Fastly/AclsInComputeApi.pm untested

filter: Statementstmt 0.0% 0 / 225 Branchbran 0.0% 0 / 58 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 17 Podpod 0.0% 0 / 8 totaltotal 0.0% 0 / 317 CC 30 SCAR 33.5
CC
30
Cov
0%
compute_acl_list_acl_entries
56.0
compute_acl_lookup_acls
56.0
compute_acl_list_acls_s_acl_id
30.0
CRAP 28.5
1 =begin comment
2  
3 Fastly API
4  
5 Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
6  
7 The version of the API Spec document: 1.0.0
8 Contact: oss@fastly.com
9  
10 =end comment
11  
12 =cut
13  
14 #
15 # NOTE: This class is auto generated.
16 # Do not edit the class manually.
17 #
18 package WebService::Fastly::AclsInComputeApi;
19  
20 require 5.6.0;
21 use strict;
22 use warnings;
23 use utf8;
24 use Exporter;
25 use Carp qw( croak );
26 use Log::Any qw($log);
27  
28 use WebService::Fastly::ApiClient;
29  
30 use base "Class::Data::Inheritable";
31  
32 __PACKAGE__->mk_classdata('method_documentation' => {});
33  
34 sub new {
35 my $class = shift;
36 my $api_client;
37  
38 if ($_[0] && ref $_[0] && ref $_[0] eq 'WebService::Fastly::ApiClient' ) {
39 $api_client = $_[0];
40 } else {
41 $api_client = WebService::Fastly::ApiClient->new(@_);
42 }
43  
44 bless { api_client => $api_client }, $class;
45  
46 }
47  
48  
49 #
50 # compute_acl_create_acls
51 #
52 # Create a new ACL
53 #
54 # @param ComputeAclCreateAclsRequest $compute_acl_create_acls_request (optional)
55 {
56 my $params = {
57 'compute_acl_create_acls_request' => {
58 data_type => 'ComputeAclCreateAclsRequest',
59 description => '',
60 required => '0',
61 },
62 };
63 __PACKAGE__->method_documentation->{ 'compute_acl_create_acls' } = {
64 summary => 'Create a new ACL',
65 params => $params,
66 returns => 'ComputeAclCreateAclsResponse',
67 };
68 }
69 # @return ComputeAclCreateAclsResponse
70 #
71 sub compute_acl_create_acls {
72 my ($self, %args) = @_;
73  
74 # parse inputs
75 my $_resource_path = '/resources/acls';
76  
77 my $_method = 'POST';
78 my $query_params = {};
79 my $header_params = {};
80 my $form_params = {};
81  
82 # 'Accept' and 'Content-Type' header
83 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
84 if ($_header_accept) {
85 $header_params->{'Accept'} = $_header_accept;
86 }
87 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
88  
89 my $_body_data;
90 # body params
91 if ( exists $args{'compute_acl_create_acls_request'}) {
92 $_body_data = $args{'compute_acl_create_acls_request'};
93 }
94  
95 # authentication setting, if any
96 my $auth_settings = [qw(token )];
97  
98 # make the API Call
99 my $response = $self->{api_client}->call_api($_resource_path, $_method,
100 $query_params, $form_params,
101 $header_params, $_body_data, $auth_settings);
102 if (!$response) {
103 return;
104 }
105 my $_response_object = $self->{api_client}->deserialize('ComputeAclCreateAclsResponse', $response);
106 return $_response_object;
107 }
108  
109 #
110 # compute_acl_delete_s_acl_id
111 #
112 # Delete an ACL
113 #
114 # @param string $acl_id (required)
115 {
116 my $params = {
117 'acl_id' => {
118 data_type => 'string',
119 description => '',
120 required => '1',
121 },
122 };
123 __PACKAGE__->method_documentation->{ 'compute_acl_delete_s_acl_id' } = {
124 summary => 'Delete an ACL',
125 params => $params,
126 returns => undef,
127 };
128 }
129 # @return void
130 #
131 sub compute_acl_delete_s_acl_id {
132 my ($self, %args) = @_;
133  
134 # verify the required parameter 'acl_id' is set
135 unless (exists $args{'acl_id'}) {
136 croak("Missing the required parameter 'acl_id' when calling compute_acl_delete_s_acl_id");
137 }
138  
139 # parse inputs
140 my $_resource_path = '/resources/acls/{acl_id}';
141  
142 my $_method = 'DELETE';
143 my $query_params = {};
144 my $header_params = {};
145 my $form_params = {};
146  
147 # 'Accept' and 'Content-Type' header
148 my $_header_accept = $self->{api_client}->select_header_accept();
149 if ($_header_accept) {
150 $header_params->{'Accept'} = $_header_accept;
151 }
152 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
153  
154 # path params
155 if ( exists $args{'acl_id'}) {
156 my $_base_variable = "{" . "acl_id" . "}";
157 my $_base_value = $self->{api_client}->to_path_value($args{'acl_id'});
158 $_resource_path =~ s/$_base_variable/$_base_value/g;
159 }
160  
161 my $_body_data;
162 # authentication setting, if any
163 my $auth_settings = [qw(token )];
164  
165 # make the API Call
166 $self->{api_client}->call_api($_resource_path, $_method,
167 $query_params, $form_params,
168 $header_params, $_body_data, $auth_settings);
169 return;
170 }
171  
172 #
173 # compute_acl_list_acl_entries
174 #
175 # List an ACL
176 #
177 # @param string $acl_id (required)
178 # @param string $cursor (optional)
179 # @param int $limit (optional, default to 100)
180 {
181 my $params = {
182 'acl_id' => {
183 data_type => 'string',
184 description => '',
185 required => '1',
186 },
187 'cursor' => {
188 data_type => 'string',
189 description => '',
190 required => '0',
191 },
192 'limit' => {
193 data_type => 'int',
194 description => '',
195 required => '0',
196 },
197 };
198 __PACKAGE__->method_documentation->{ 'compute_acl_list_acl_entries' } = {
199 summary => 'List an ACL',
200 params => $params,
201 returns => 'ComputeAclListEntries',
202 };
203 }
204 # @return ComputeAclListEntries
205 #
206 sub compute_acl_list_acl_entries {
207 my ($self, %args) = @_;
208  
209 # verify the required parameter 'acl_id' is set
210 unless (exists $args{'acl_id'}) {
211 croak("Missing the required parameter 'acl_id' when calling compute_acl_list_acl_entries");
212 }
213  
214 # parse inputs
215 my $_resource_path = '/resources/acls/{acl_id}/entries';
216  
217 my $_method = 'GET';
218 my $query_params = {};
219 my $header_params = {};
220 my $form_params = {};
221  
222 # 'Accept' and 'Content-Type' header
223 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
224 if ($_header_accept) {
225 $header_params->{'Accept'} = $_header_accept;
226 }
227 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
228  
229 # query params
230 if ( exists $args{'cursor'}) {
231 $query_params->{'cursor'} = $self->{api_client}->to_query_value($args{'cursor'});
232 }
233  
234 # query params
235 if ( exists $args{'limit'}) {
236 $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'});
237 }
238  
239 # path params
240 if ( exists $args{'acl_id'}) {
241 my $_base_variable = "{" . "acl_id" . "}";
242 my $_base_value = $self->{api_client}->to_path_value($args{'acl_id'});
243 $_resource_path =~ s/$_base_variable/$_base_value/g;
244 }
245  
246 my $_body_data;
247 # authentication setting, if any
248 my $auth_settings = [qw(token )];
249  
250 # make the API Call
251 my $response = $self->{api_client}->call_api($_resource_path, $_method,
252 $query_params, $form_params,
253 $header_params, $_body_data, $auth_settings);
254 if (!$response) {
255 return;
256 }
257 my $_response_object = $self->{api_client}->deserialize('ComputeAclListEntries', $response);
258 return $_response_object;
259 }
260  
261 #
262 # compute_acl_list_acls
263 #
264 # List ACLs
265 #
266 {
267 my $params = {
268 };
269 __PACKAGE__->method_documentation->{ 'compute_acl_list_acls' } = {
270 summary => 'List ACLs',
271 params => $params,
272 returns => 'ComputeAclList',
273 };
274 }
275 # @return ComputeAclList
276 #
277 sub compute_acl_list_acls {
278 my ($self, %args) = @_;
279  
280 # parse inputs
281 my $_resource_path = '/resources/acls';
282  
283 my $_method = 'GET';
284 my $query_params = {};
285 my $header_params = {};
286 my $form_params = {};
287  
288 # 'Accept' and 'Content-Type' header
289 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
290 if ($_header_accept) {
291 $header_params->{'Accept'} = $_header_accept;
292 }
293 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
294  
295 my $_body_data;
296 # authentication setting, if any
297 my $auth_settings = [qw(token )];
298  
299 # make the API Call
300 my $response = $self->{api_client}->call_api($_resource_path, $_method,
301 $query_params, $form_params,
302 $header_params, $_body_data, $auth_settings);
303 if (!$response) {
304 return;
305 }
306 my $_response_object = $self->{api_client}->deserialize('ComputeAclList', $response);
307 return $_response_object;
308 }
309  
310 #
311 # compute_acl_list_acls_s_acl_id
312 #
313 # Describe an ACL
314 #
315 # @param string $acl_id (required)
316 {
317 my $params = {
318 'acl_id' => {
319 data_type => 'string',
320 description => '',
321 required => '1',
322 },
323 };
324 __PACKAGE__->method_documentation->{ 'compute_acl_list_acls_s_acl_id' } = {
325 summary => 'Describe an ACL',
326 params => $params,
327 returns => 'ComputeAclCreateAclsResponse',
328 };
329 }
330 # @return ComputeAclCreateAclsResponse
331 #
332 sub compute_acl_list_acls_s_acl_id {
333 my ($self, %args) = @_;
334  
335 # verify the required parameter 'acl_id' is set
336 unless (exists $args{'acl_id'}) {
337 croak("Missing the required parameter 'acl_id' when calling compute_acl_list_acls_s_acl_id");
338 }
339  
340 # parse inputs
341 my $_resource_path = '/resources/acls/{acl_id}';
342  
343 my $_method = 'GET';
344 my $query_params = {};
345 my $header_params = {};
346 my $form_params = {};
347  
348 # 'Accept' and 'Content-Type' header
349 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
350 if ($_header_accept) {
351 $header_params->{'Accept'} = $_header_accept;
352 }
353 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
354  
355 # path params
356 if ( exists $args{'acl_id'}) {
357 my $_base_variable = "{" . "acl_id" . "}";
358 my $_base_value = $self->{api_client}->to_path_value($args{'acl_id'});
359 $_resource_path =~ s/$_base_variable/$_base_value/g;
360 }
361  
362 my $_body_data;
363 # authentication setting, if any
364 my $auth_settings = [qw(token )];
365  
366 # make the API Call
367 my $response = $self->{api_client}->call_api($_resource_path, $_method,
368 $query_params, $form_params,
369 $header_params, $_body_data, $auth_settings);
370 if (!$response) {
371 return;
372 }
373 my $_response_object = $self->{api_client}->deserialize('ComputeAclCreateAclsResponse', $response);
374 return $_response_object;
375 }
376  
377 #
378 # compute_acl_lookup_acls
379 #
380 # Lookup an ACL
381 #
382 # @param string $acl_id (required)
383 # @param string $acl_ip (required)
384 {
385 my $params = {
386 'acl_id' => {
387 data_type => 'string',
388 description => '',
389 required => '1',
390 },
391 'acl_ip' => {
392 data_type => 'string',
393 description => '',
394 required => '1',
395 },
396 };
397 __PACKAGE__->method_documentation->{ 'compute_acl_lookup_acls' } = {
398 summary => 'Lookup an ACL',
399 params => $params,
400 returns => 'ComputeAclLookup',
401 };
402 }
403 # @return ComputeAclLookup
404 #
405 sub compute_acl_lookup_acls {
406 my ($self, %args) = @_;
407  
408 # verify the required parameter 'acl_id' is set
409 unless (exists $args{'acl_id'}) {
410 croak("Missing the required parameter 'acl_id' when calling compute_acl_lookup_acls");
411 }
412  
413 # verify the required parameter 'acl_ip' is set
414 unless (exists $args{'acl_ip'}) {
415 croak("Missing the required parameter 'acl_ip' when calling compute_acl_lookup_acls");
416 }
417  
418 # parse inputs
419 my $_resource_path = '/resources/acls/{acl_id}/entry/{acl_ip}';
420  
421 my $_method = 'GET';
422 my $query_params = {};
423 my $header_params = {};
424 my $form_params = {};
425  
426 # 'Accept' and 'Content-Type' header
427 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
428 if ($_header_accept) {
429 $header_params->{'Accept'} = $_header_accept;
430 }
431 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
432  
433 # path params
434 if ( exists $args{'acl_id'}) {
435 my $_base_variable = "{" . "acl_id" . "}";
436 my $_base_value = $self->{api_client}->to_path_value($args{'acl_id'});
437 $_resource_path =~ s/$_base_variable/$_base_value/g;
438 }
439  
440 # path params
441 if ( exists $args{'acl_ip'}) {
442 my $_base_variable = "{" . "acl_ip" . "}";
443 my $_base_value = $self->{api_client}->to_path_value($args{'acl_ip'});
444 $_resource_path =~ s/$_base_variable/$_base_value/g;
445 }
446  
447 my $_body_data;
448 # authentication setting, if any
449 my $auth_settings = [qw(token )];
450  
451 # make the API Call
452 my $response = $self->{api_client}->call_api($_resource_path, $_method,
453 $query_params, $form_params,
454 $header_params, $_body_data, $auth_settings);
455 if (!$response) {
456 return;
457 }
458 my $_response_object = $self->{api_client}->deserialize('ComputeAclLookup', $response);
459 return $_response_object;
460 }
461  
462 #
463 # compute_acl_update_acls
464 #
465 # Update an ACL
466 #
467 # @param string $acl_id (required)
468 # @param ComputeAclUpdate $compute_acl_update (optional)
469 {
470 my $params = {
471 'acl_id' => {
472 data_type => 'string',
473 description => '',
474 required => '1',
475 },
476 'compute_acl_update' => {
477 data_type => 'ComputeAclUpdate',
478 description => '',
479 required => '0',
480 },
481 };
482 __PACKAGE__->method_documentation->{ 'compute_acl_update_acls' } = {
483 summary => 'Update an ACL',
484 params => $params,
485 returns => undef,
486 };
487 }
488 # @return void
489 #
490 sub compute_acl_update_acls {
491 my ($self, %args) = @_;
492  
493 # verify the required parameter 'acl_id' is set
494 unless (exists $args{'acl_id'}) {
495 croak("Missing the required parameter 'acl_id' when calling compute_acl_update_acls");
496 }
497  
498 # parse inputs
499 my $_resource_path = '/resources/acls/{acl_id}/entries';
500  
501 my $_method = 'PATCH';
502 my $query_params = {};
503 my $header_params = {};
504 my $form_params = {};
505  
506 # 'Accept' and 'Content-Type' header
507 my $_header_accept = $self->{api_client}->select_header_accept();
508 if ($_header_accept) {
509 $header_params->{'Accept'} = $_header_accept;
510 }
511 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
512  
513 # path params
514 if ( exists $args{'acl_id'}) {
515 my $_base_variable = "{" . "acl_id" . "}";
516 my $_base_value = $self->{api_client}->to_path_value($args{'acl_id'});
517 $_resource_path =~ s/$_base_variable/$_base_value/g;
518 }
519  
520 my $_body_data;
521 # body params
522 if ( exists $args{'compute_acl_update'}) {
523 $_body_data = $args{'compute_acl_update'};
524 }
525  
526 # authentication setting, if any
527 my $auth_settings = [qw(token )];
528  
529 # make the API Call
530 $self->{api_client}->call_api($_resource_path, $_method,
531 $query_params, $form_params,
532 $header_params, $_body_data, $auth_settings);
533 return;
534 }
535  
536 1;