Test-ZZZ/src/com/zoho/crm/api/bulkread/BulkReadOperations.pm
require 'src/com/zoho/crm/api/util/APIResponse.pm';
require 'src/com/zoho/crm/api/util/CommonAPIHandler.pm';
require 'src/com/zoho/crm/api/util/Constants.pm';
require 'src/com/zoho/api/exception/SDKException.pm';
package bulkread::BulkReadOperations;
use Moose;
sub new
{
my ($class) = shift;
my $self =
{
};
bless $self,$class;
return $self;
}
sub get_bulk_read_job_details
{
my ($self,$job_id) = @_;
my $handler_instance = CommonAPIHandler->new();
my $api_path = "";
$api_path = $api_path . "/crm/bulk/v2/read/";
$api_path = $api_path . "".$job_id;
$handler_instance->set_api_path($api_path);
$handler_instance->set_http_method($Constants::REQUEST_METHOD_GET);
$handler_instance->set_category_method($Constants::REQUEST_CATEGORY_READ);
return $handler_instance->api_call("bulkread.ResponseHandler", "application/json");
}
sub download_result
{
my ($self,$job_id) = @_;
my $handler_instance = CommonAPIHandler->new();
my $api_path = "";
$api_path = $api_path . "/crm/bulk/v2/read/";
$api_path = $api_path . "".$job_id;
$api_path = $api_path . "/result";
$handler_instance->set_api_path($api_path);
$handler_instance->set_http_method($Constants::REQUEST_METHOD_GET);
$handler_instance->set_category_method($Constants::REQUEST_CATEGORY_READ);
return $handler_instance->api_call("bulkread.ResponseHandler", "application/x-download");
}
sub create_bulk_read_job
{
my ($self,$request) = @_;
if(!(($request)->isa("bulkread::RequestWrapper")))
{
die SDKException->new($Constants::DATA_TYPE_ERROR, "KEY: request EXPECTED TYPE: bulkread::RequestWrapper", undef, undef);
}
my $handler_instance = CommonAPIHandler->new();
my $api_path = "";
$api_path = $api_path . "/crm/bulk/v2/read";
$handler_instance->set_api_path($api_path);
$handler_instance->set_http_method($Constants::REQUEST_METHOD_POST);
$handler_instance->set_category_method($Constants::REQUEST_CATEGORY_CREATE);
$handler_instance->set_content_type("application/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("bulkread.ActionHandler", "application/json");
}
1;