itializer::get_json_details();
my %json_details = %{$init};
$pack =~ s/::/./;
$package_path = $self->find_class_path($pack, \%json_details);
my $class_detail = $json_details{$packa
if("$type" eq "List")
{
my @array = $self->set_json_array($field_value, $member_detail);
$request_hash->{$key_name} = [@array];
type" eq "HashMap")
{
$request_hash->{$key_name} = $self->set_json_object($field_value, \%member_detail);
}
elsif(exists($member_det
ST_METHOD_DELETE);
return $handler_instance->api_call("attachments.ActionHandler", "application/json");
}
sub get_attachments
{
my ($self) = shift;
my $handler_instance = CommonAPIHandler->new()
_CATEGORY_READ);
return $handler_instance->api_call("attachments.ResponseHandler", "application/json");
}
sub upload_attachment
{
my ($self,$request) = @_;
if(!(($request)->isa("attachments::Fil
datory_checker(1);
return $handler_instance->api_call("attachments.ActionHandler", "application/json");
}
sub upload_link_attachment
{
my ($self,$param_instance) = @_;
if((defined($param_instanc
com::zoho::crm::api::util::Constants;
use JSON;
use File::Spec::Functions qw(catfile);
use Try::Catch;
use Log::Handler;
use File::Path;
use JSON::Parse "json_file_to_perl";
our $logger = Log::Handle
ld_details_json = json_file_to_perl($record_field_details_path);
my %record_field_details_json = %{$record_field_details_json};
if(exists($record_field_details_json{lc($modul
ls_json{lc($module)});
}
my $JSON = JSON->new->utf8;
my $data;
open($data, ">", $record_field_details_path);
my $encoded_json = $JSON->e
der($header_instance);
return $handler_instance->api_call("users.ResponseHandler", "application/json");
}
sub create_user
{
my ($self,$request) = @_;
if(!(($request)->isa("users::BodyWrapper")))
application/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("users.ActionHandler", "application/json");
}
sub
application/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("users.ActionHandler", "application/json");
}
sub
T_CATEGORY_READ);
return $handler_instance->api_call("currencies.ResponseHandler", "application/json");
}
sub add_currencies
{
my ($self,$request) = @_;
if(!(($request)->isa("currencies::BodyWra
plication/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("currencies.ActionHandler", "application/json");
}
s
plication/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("currencies.ActionHandler", "application/json");
}
s
us::Plugin::InlineJSON;
our $VERSION = '1.000000'; # 1.0.0
$VERSION = eval $VERSION;
use Mojo::Base 'Mojolicious::Plugin';
use Mojo::ByteStream qw(b);
use Mojo::JSON qw(encode_json);
use Mojo::Util
s_json_string => \&js_json_string);
$app->helper(js_data_via_json => \&js_data_via_json);
}
sub _escape_tag { $_[0] =~ s/>/\\>/gr }
sub _js_data { _escape_tag(encode_json($_[1])) }
sub _js_json_
e_tag(encode_json(encode_json($_[1]))) }
# returns '{ "foo": 1 }'
sub js_data { b(&_js_data) }
# returns '"{ \"foo\": 1 }"'
sub js_json_string { b(&_js_json_string) }
# returns 'JSON.parse("{ \"f
me($module_api_name);
return $handler_instance->api_call("record.ResponseHandler", "application/json");
}
sub update_record
{
my ($self,$request,$module_api_name,$id) = @_;
if(!(($request)->isa(
y_method($Constants::REQUEST_CATEGORY_UPDATE);
$handler_instance->set_content_type("application/json");
$handler_instance->set_request($request);
Utility::get_fields($module_api_name);
$handle
name($module_api_name);
return $handler_instance->api_call("record.ActionHandler", "application/json");
}
sub delete_record
{
my ($self,$param_instance,$module_api_name,$id) = @_;
if((defined($p
set_mandatory_checker(1);
return $handler_instance->api_call("file.ActionHandler", "application/json");
}
sub get_file
{
my ($self,$param_instance) = @_;
if((defined($param_instance))&&(!(($para
ister if $self->auto_unregister;
}
sub parse_request {
my ($self, $req) = @_;
return $req->json;
}
sub _set_http_response {
my ($record, $outcome) = @_;
my $message = $outcome->{sent_re
fices
: (text => $outcome->{response})
};
$record->{source}{refs}{controller}->render(json => $message);
$record->{source}{flags}{rendered} = 1;
return;
}
around process => sub {
package Log;
use JSON;
sub new
{
my ($class, $level, $file_path) = @_;
my $self={
'level' => $level,
'file_path' => $file_path
};
bless $self, $class;
return $self;
}
s
elf->{module});
return $handler_instance->api_call("relatedlists.ResponseHandler", "application/json");
}
sub get_related_list
{
my ($self,$id) = @_;
my $handler_instance = CommonAPIHandler->new
ry_method($Constants::REQUEST_CATEGORY_READ);
$handler_instance->add_param("module", $self->{module});
return $handler_instance->api_call("relatedlists.ResponseHandler", "application/json");
}
1;
TEGORY_READ);
return $handler_instance->api_call("variablegroups.ResponseHandler", "application/json");
}
sub get_variable_group_by_id
{
my ($self,$id) = @_;
my $handler_instance = CommonAPIHand
TEGORY_READ);
return $handler_instance->api_call("variablegroups.ResponseHandler", "application/json");
}
sub get_variable_group_by_api_name
{
my ($self,$api_name) = @_;
my $handler_instance = C
nts::REQUEST_METHOD_GET);
$handler_instance->set_category_method($Constants::REQUEST_CATEGORY_READ);
return $handler_instance->api_call("variablegroups.ResponseHandler", "application/json");
}
1;
use Error;
use JSON;
sub new
{
my ($class, $code, $message, $details, $cause) = @_;
my $self={
code => $code,
message => $message,
details => JSON->new->utf8->enco
or code.
Param message : A String containing the Exception error message.
Param details : A JSONObject containing the error response.
Param cause : A Exception class instance.
=item C<to_s
param($param_instance);
return $handler_instance->api_call("tags.ResponseHandler", "application/json");
}
sub create_tags
{
my ($self,$request,$param_instance) = @_;
if(!(($request)->isa("tags::
y_method($Constants::REQUEST_CATEGORY_CREATE);
$handler_instance->set_content_type("application/json");
$handler_instance->set_request($request);
$handler_instance->set_param($param_instance);
set_mandatory_checker(1);
return $handler_instance->api_call("tags.ActionHandler", "application/json");
}
sub update_tags
{
my ($self,$request,$param_instance) = @_;
if(!(($request)->isa("tags::
elf->token);
}
sub parse_response {
my ($self, $res, $threshold_id) = @_;
my $data = $res->json // {};
return grep { $_->{update_id} >= $threshold_id } @{$data->{result}//[]}
if $data-
s error: ' . $error);
if ($log->is_trace) {
local $Data::Dumper::Indent = 1;
for ([json => $data], [res => $res]) {
(my $d = Dumper $_->[1]) =~ s{\A.*?=}{$_->[0] =>}mxs;
aram_instance);
return $handler_instance->api_call("sharerecords.ResponseHandler", "application/json");
}
sub share_record
{
my ($self,$request) = @_;
if(!(($request)->isa("sharerecords::BodyWra
lication/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("sharerecords.ActionHandler", "application/json");
}
lication/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("sharerecords.ActionHandler", "application/json");
}
der($header_instance);
return $handler_instance->api_call("notes.ResponseHandler", "application/json");
}
sub create_notes
{
my ($self,$request) = @_;
if(!(($request)->isa("notes::BodyWrapper"))
application/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("notes.ActionHandler", "application/json");
}
sub
application/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("notes.ActionHandler", "application/json");
}
sub
ST_CATEGORY_READ);
return $handler_instance->api_call("blueprint.ResponseHandler", "application/json");
}
sub update_blueprint
{
my ($self,$request) = @_;
if(!(($request)->isa("blueprint::BodyWr
plication/json");
$handler_instance->set_request($request);
$handler_instance->set_mandatory_checker(1);
return $handler_instance->api_call("blueprint.ActionResponse", "application/json");
}
1;
ST_METHOD_DELETE);
return $handler_instance->api_call("attachments.ActionHandler", "application/json");
}
sub get_attachments
{
my ($self) = shift;
my $handler_instance = CommonAPIHandler->new()
_CATEGORY_READ);
return $handler_instance->api_call("attachments.ResponseHandler", "application/json");
}
sub upload_attachment
{
my ($self,$request) = @_;
if(!(($request)->isa("attachments::Fil
datory_checker(1);
return $handler_instance->api_call("attachments.ActionHandler", "application/json");
}
sub upload_link_attachment
{
my ($self,$param_instance) = @_;
if((defined($param_instanc
ings;
package Initializer;
use Moose;
use File::Spec::Functions qw(catfile);
use Try::Catch;
use JSON;
use Log::Handler;
use Cwd qw(realpath);
use Cwd qw(getcwd);
use src::com::zoho::crm::api::UserSi
tore;
our $json_details;
our $logger;
our $resource_path;
has 'user' => (is => "rw");
has 'environment' => (is => "rw");
has 'token' => (is => "rw");
has 'store' => (is => "rw");
has 'json_details' =
try
{
use JSON::Parse 'json_file_to_perl';
my $json_file_path = realpath($Constants::JSON_DETAILS_FILE_PATH);
$json_details = json_file_to_perl($json_file_path);
}