File Coverage

lib/Smartcat/Client/CallbackApi.pm
Criterion Covered Total %
statement 29 98 29.5
branch 1 20 5.0
condition 2 6 33.3
subroutine 9 13 69.2
pod 0 5 0.0
total 41 142 28.8


line stmt bran cond sub pod time code
1              
2             =begin comment
3              
4             Smartcat Integration API
5              
6             No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
7              
8             OpenAPI spec version: v1
9              
10             Generated by: https://github.com/swagger-api/swagger-codegen.git
11              
12             =end comment
13              
14             =cut
15              
16             #
17             # NOTE: This class is auto generated by the swagger code generator program.
18             # Do not edit the class manually.
19             # Ref: https://github.com/swagger-api/swagger-codegen
20             #
21             package Smartcat::Client::CallbackApi;
22              
23             require 5.6.0;
24 1     1   781 use strict;
  1         2  
  1         30  
25 1     1   5 use warnings;
  1         2  
  1         25  
26 1     1   659 use utf8;
  1         17  
  1         5  
27 1     1   32 use Exporter;
  1         1  
  1         38  
28 1     1   6 use Carp qw( croak );
  1         1  
  1         53  
29 1     1   519 use Log::Any qw($log);
  1         8808  
  1         5  
30              
31 1     1   2713 use Smartcat::Client::ApiClient;
  1         3  
  1         48  
32              
33 1     1   7 use base "Class::Data::Inheritable";
  1         2  
  1         555  
34              
35             __PACKAGE__->mk_classdata( 'method_documentation' => {} );
36              
37             sub new {
38 1     1 0 669 my $class = shift;
39 1         2 my $api_client;
40              
41 1 50 33     6 if ( $_[0] && ref $_[0] && ref $_[0] eq 'Smartcat::Client::ApiClient' ) {
      33        
42 0         0 $api_client = $_[0];
43             }
44             else {
45 1         7 $api_client = Smartcat::Client::ApiClient->new(@_);
46             }
47              
48 1         6 bless { api_client => $api_client }, $class;
49              
50             }
51              
52             #
53             # callback_delete
54             #
55             # Resetting the configuration of notifications reception
56             #
57             {
58             my $params = {};
59             __PACKAGE__->method_documentation->{'callback_delete'} = {
60             summary => 'Resetting the configuration of notifications reception',
61             params => $params,
62             returns => undef,
63             };
64             }
65              
66             # @return void
67             #
68             sub callback_delete {
69 0     0 0   my ( $self, %args ) = @_;
70              
71             # parse inputs
72 0           my $_resource_path = '/api/integration/v1/callback';
73              
74 0           my $_method = 'DELETE';
75 0           my $query_params = {};
76 0           my $header_params = {};
77 0           my $form_params = {};
78              
79             # 'Accept' and 'Content-Type' header
80 0           my $_header_accept = $self->{api_client}->select_header_accept();
81 0 0         if ($_header_accept) {
82 0           $header_params->{'Accept'} = $_header_accept;
83             }
84             $header_params->{'Content-Type'} =
85 0           $self->{api_client}->select_header_content_type();
86              
87 0           my $_body_data;
88              
89             # authentication setting, if any
90 0           my $auth_settings = [qw()];
91              
92             # make the API Call
93             $self->{api_client}->call_api(
94 0           $_resource_path, $_method, $query_params, $form_params,
95             $header_params, $_body_data, $auth_settings
96             );
97 0           return;
98             }
99              
100             #
101             # callback_get
102             #
103             # Reading configurations of notifications reception of the account
104             #
105             {
106             my $params = {};
107             __PACKAGE__->method_documentation->{'callback_get'} = {
108             summary =>
109             'Reading configurations of notifications reception of the account',
110             params => $params,
111             returns => 'CallbackPropertyModel',
112             };
113             }
114              
115             # @return CallbackPropertyModel
116             #
117             sub callback_get {
118 0     0 0   my ( $self, %args ) = @_;
119              
120             # parse inputs
121 0           my $_resource_path = '/api/integration/v1/callback';
122              
123 0           my $_method = 'GET';
124 0           my $query_params = {};
125 0           my $header_params = {};
126 0           my $form_params = {};
127              
128             # 'Accept' and 'Content-Type' header
129             my $_header_accept = $self->{api_client}
130 0           ->select_header_accept( 'application/json', 'text/json' );
131 0 0         if ($_header_accept) {
132 0           $header_params->{'Accept'} = $_header_accept;
133             }
134             $header_params->{'Content-Type'} =
135 0           $self->{api_client}->select_header_content_type();
136              
137 0           my $_body_data;
138              
139             # authentication setting, if any
140 0           my $auth_settings = [qw()];
141              
142             # make the API Call
143             my $response = $self->{api_client}->call_api(
144 0           $_resource_path, $_method, $query_params, $form_params,
145             $header_params, $_body_data, $auth_settings
146             );
147 0 0         if ( !$response ) {
148 0           return;
149             }
150             my $_response_object =
151 0           $self->{api_client}->deserialize( 'CallbackPropertyModel', $response );
152 0           return $_response_object;
153             }
154              
155             #
156             # callback_get_last_errors
157             #
158             # Reading the recent sending errors
159             #
160             # @param int $limit Limit on the number of returned errors (no more than 100) (optional)
161             {
162             my $params = {
163             'limit' => {
164             data_type => 'int',
165             description =>
166             'Limit on the number of returned errors (no more than 100)',
167             required => '0',
168             },
169             };
170             __PACKAGE__->method_documentation->{'callback_get_last_errors'} = {
171             summary => 'Reading the recent sending errors',
172             params => $params,
173             returns => 'ARRAY[CallbackErrorModel]',
174             };
175             }
176              
177             # @return ARRAY[CallbackErrorModel]
178             #
179             sub callback_get_last_errors {
180 0     0 0   my ( $self, %args ) = @_;
181              
182             # parse inputs
183 0           my $_resource_path = '/api/integration/v1/callback/lastErrors';
184              
185 0           my $_method = 'GET';
186 0           my $query_params = {};
187 0           my $header_params = {};
188 0           my $form_params = {};
189              
190             # 'Accept' and 'Content-Type' header
191             my $_header_accept = $self->{api_client}
192 0           ->select_header_accept( 'application/json', 'text/json' );
193 0 0         if ($_header_accept) {
194 0           $header_params->{'Accept'} = $_header_accept;
195             }
196             $header_params->{'Content-Type'} =
197 0           $self->{api_client}->select_header_content_type();
198              
199             # query params
200 0 0         if ( exists $args{'limit'} ) {
201             $query_params->{'limit'} =
202 0           $self->{api_client}->to_query_value( $args{'limit'} );
203             }
204              
205 0           my $_body_data;
206              
207             # authentication setting, if any
208 0           my $auth_settings = [qw()];
209              
210             # make the API Call
211             my $response = $self->{api_client}->call_api(
212 0           $_resource_path, $_method, $query_params, $form_params,
213             $header_params, $_body_data, $auth_settings
214             );
215 0 0         if ( !$response ) {
216 0           return;
217             }
218             my $_response_object = $self->{api_client}
219 0           ->deserialize( 'ARRAY[CallbackErrorModel]', $response );
220 0           return $_response_object;
221             }
222              
223             #
224             # callback_update
225             #
226             #
227             #
228             # @param CallbackPropertyModel $callback_property (required)
229             {
230             my $params = {
231             'callback_property' => {
232             data_type => 'CallbackPropertyModel',
233             description => '',
234             required => '1',
235             },
236             };
237             __PACKAGE__->method_documentation->{'callback_update'} = {
238             summary => '',
239             params => $params,
240             returns => undef,
241             };
242             }
243              
244             # @return void
245             #
246             sub callback_update {
247 0     0 0   my ( $self, %args ) = @_;
248              
249             # verify the required parameter 'callback_property' is set
250 0 0         unless ( exists $args{'callback_property'} ) {
251 0           croak(
252             "Missing the required parameter 'callback_property' when calling callback_update"
253             );
254             }
255              
256             # parse inputs
257 0           my $_resource_path = '/api/integration/v1/callback';
258              
259 0           my $_method = 'POST';
260 0           my $query_params = {};
261 0           my $header_params = {};
262 0           my $form_params = {};
263              
264             # 'Accept' and 'Content-Type' header
265 0           my $_header_accept = $self->{api_client}->select_header_accept();
266 0 0         if ($_header_accept) {
267 0           $header_params->{'Accept'} = $_header_accept;
268             }
269             $header_params->{'Content-Type'} = $self->{api_client}
270 0           ->select_header_content_type( 'application/json', 'text/json' );
271              
272 0           my $_body_data;
273              
274             # body params
275 0 0         if ( exists $args{'callback_property'} ) {
276 0           $_body_data = $args{'callback_property'};
277             }
278              
279             # authentication setting, if any
280 0           my $auth_settings = [qw()];
281              
282             # make the API Call
283             $self->{api_client}->call_api(
284 0           $_resource_path, $_method, $query_params, $form_params,
285             $header_params, $_body_data, $auth_settings
286             );
287 0           return;
288             }
289              
290             1;