Fastly/VclApi.pm untested

filter: Statementstmt 0.0% 0 / 516 Branchbran 0.0% 0 / 192 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 23 Podpod 0.0% 0 / 14 totaltotal 0.0% 0 / 754 CC 97 SCAR 43.7
CC
97
Cov
0%
update_custom_vcl
156.0
create_custom_vcl
110.0
get_custom_vcl
110.0
CRAP 79.4
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::VclApi;
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 # create_custom_vcl
51 #
52 # Create a custom VCL file
53 #
54 # @param string $service_id Alphanumeric string identifying the service. (required)
55 # @param int $version_id Integer identifying a service version. (required)
56 # @param string $content The VCL code to be included. (optional)
57 # @param boolean $main Set to `true` when this is the main VCL, otherwise `false`. (optional)
58 # @param string $name The name of this VCL. (optional)
59 {
60 my $params = {
61 'service_id' => {
62 data_type => 'string',
63 description => 'Alphanumeric string identifying the service.',
64 required => '1',
65 },
66 'version_id' => {
67 data_type => 'int',
68 description => 'Integer identifying a service version.',
69 required => '1',
70 },
71 'content' => {
72 data_type => 'string',
73 description => 'The VCL code to be included.',
74 required => '0',
75 },
76 'main' => {
77 data_type => 'boolean',
78 description => 'Set to `true` when this is the main VCL, otherwise `false`.',
79 required => '0',
80 },
81 'name' => {
82 data_type => 'string',
83 description => 'The name of this VCL.',
84 required => '0',
85 },
86 };
87 __PACKAGE__->method_documentation->{ 'create_custom_vcl' } = {
88 summary => 'Create a custom VCL file',
89 params => $params,
90 returns => 'VclResponse',
91 };
92 }
93 # @return VclResponse
94 #
95 sub create_custom_vcl {
96 my ($self, %args) = @_;
97  
98 # verify the required parameter 'service_id' is set
99 unless (exists $args{'service_id'}) {
100 croak("Missing the required parameter 'service_id' when calling create_custom_vcl");
101 }
102  
103 # verify the required parameter 'version_id' is set
104 unless (exists $args{'version_id'}) {
105 croak("Missing the required parameter 'version_id' when calling create_custom_vcl");
106 }
107  
108 # parse inputs
109 my $_resource_path = '/service/{service_id}/version/{version_id}/vcl';
110  
111 my $_method = 'POST';
112 my $query_params = {};
113 my $header_params = {};
114 my $form_params = {};
115  
116 # 'Accept' and 'Content-Type' header
117 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
118 if ($_header_accept) {
119 $header_params->{'Accept'} = $_header_accept;
120 }
121 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
122  
123 # path params
124 if ( exists $args{'service_id'}) {
125 my $_base_variable = "{" . "service_id" . "}";
126 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
127 $_resource_path =~ s/$_base_variable/$_base_value/g;
128 }
129  
130 # path params
131 if ( exists $args{'version_id'}) {
132 my $_base_variable = "{" . "version_id" . "}";
133 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
134 $_resource_path =~ s/$_base_variable/$_base_value/g;
135 }
136  
137 # form params
138 if ( exists $args{'content'} ) {
139 $form_params->{'content'} = $self->{api_client}->to_form_value($args{'content'});
140 }
141  
142 # form params
143 if ( exists $args{'main'} ) {
144 $form_params->{'main'} = $self->{api_client}->to_form_value($args{'main'});
145 }
146  
147 # form params
148 if ( exists $args{'name'} ) {
149 $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
150 }
151  
152 my $_body_data;
153 # authentication setting, if any
154 my $auth_settings = [qw(token )];
155  
156 # make the API Call
157 my $response = $self->{api_client}->call_api($_resource_path, $_method,
158 $query_params, $form_params,
159 $header_params, $_body_data, $auth_settings);
160 if (!$response) {
161 return;
162 }
163 my $_response_object = $self->{api_client}->deserialize('VclResponse', $response);
164 return $_response_object;
165 }
166  
167 #
168 # delete_custom_vcl
169 #
170 # Delete a custom VCL file
171 #
172 # @param string $service_id Alphanumeric string identifying the service. (required)
173 # @param int $version_id Integer identifying a service version. (required)
174 # @param string $vcl_name The name of this VCL. (required)
175 {
176 my $params = {
177 'service_id' => {
178 data_type => 'string',
179 description => 'Alphanumeric string identifying the service.',
180 required => '1',
181 },
182 'version_id' => {
183 data_type => 'int',
184 description => 'Integer identifying a service version.',
185 required => '1',
186 },
187 'vcl_name' => {
188 data_type => 'string',
189 description => 'The name of this VCL.',
190 required => '1',
191 },
192 };
193 __PACKAGE__->method_documentation->{ 'delete_custom_vcl' } = {
194 summary => 'Delete a custom VCL file',
195 params => $params,
196 returns => 'InlineResponse200',
197 };
198 }
199 # @return InlineResponse200
200 #
201 sub delete_custom_vcl {
202 my ($self, %args) = @_;
203  
204 # verify the required parameter 'service_id' is set
205 unless (exists $args{'service_id'}) {
206 croak("Missing the required parameter 'service_id' when calling delete_custom_vcl");
207 }
208  
209 # verify the required parameter 'version_id' is set
210 unless (exists $args{'version_id'}) {
211 croak("Missing the required parameter 'version_id' when calling delete_custom_vcl");
212 }
213  
214 # verify the required parameter 'vcl_name' is set
215 unless (exists $args{'vcl_name'}) {
216 croak("Missing the required parameter 'vcl_name' when calling delete_custom_vcl");
217 }
218  
219 # parse inputs
220 my $_resource_path = '/service/{service_id}/version/{version_id}/vcl/{vcl_name}';
221  
222 my $_method = 'DELETE';
223 my $query_params = {};
224 my $header_params = {};
225 my $form_params = {};
226  
227 # 'Accept' and 'Content-Type' header
228 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
229 if ($_header_accept) {
230 $header_params->{'Accept'} = $_header_accept;
231 }
232 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
233  
234 # path params
235 if ( exists $args{'service_id'}) {
236 my $_base_variable = "{" . "service_id" . "}";
237 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
238 $_resource_path =~ s/$_base_variable/$_base_value/g;
239 }
240  
241 # path params
242 if ( exists $args{'version_id'}) {
243 my $_base_variable = "{" . "version_id" . "}";
244 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
245 $_resource_path =~ s/$_base_variable/$_base_value/g;
246 }
247  
248 # path params
249 if ( exists $args{'vcl_name'}) {
250 my $_base_variable = "{" . "vcl_name" . "}";
251 my $_base_value = $self->{api_client}->to_path_value($args{'vcl_name'});
252 $_resource_path =~ s/$_base_variable/$_base_value/g;
253 }
254  
255 my $_body_data;
256 # authentication setting, if any
257 my $auth_settings = [qw(token )];
258  
259 # make the API Call
260 my $response = $self->{api_client}->call_api($_resource_path, $_method,
261 $query_params, $form_params,
262 $header_params, $_body_data, $auth_settings);
263 if (!$response) {
264 return;
265 }
266 my $_response_object = $self->{api_client}->deserialize('InlineResponse200', $response);
267 return $_response_object;
268 }
269  
270 #
271 # get_custom_vcl
272 #
273 # Get a custom VCL file
274 #
275 # @param string $service_id Alphanumeric string identifying the service. (required)
276 # @param int $version_id Integer identifying a service version. (required)
277 # @param string $vcl_name The name of this VCL. (required)
278 # @param string $no_content Omit VCL content. (optional, default to '0')
279 {
280 my $params = {
281 'service_id' => {
282 data_type => 'string',
283 description => 'Alphanumeric string identifying the service.',
284 required => '1',
285 },
286 'version_id' => {
287 data_type => 'int',
288 description => 'Integer identifying a service version.',
289 required => '1',
290 },
291 'vcl_name' => {
292 data_type => 'string',
293 description => 'The name of this VCL.',
294 required => '1',
295 },
296 'no_content' => {
297 data_type => 'string',
298 description => 'Omit VCL content.',
299 required => '0',
300 },
301 };
302 __PACKAGE__->method_documentation->{ 'get_custom_vcl' } = {
303 summary => 'Get a custom VCL file',
304 params => $params,
305 returns => 'VclResponse',
306 };
307 }
308 # @return VclResponse
309 #
310 sub get_custom_vcl {
311 my ($self, %args) = @_;
312  
313 # verify the required parameter 'service_id' is set
314 unless (exists $args{'service_id'}) {
315 croak("Missing the required parameter 'service_id' when calling get_custom_vcl");
316 }
317  
318 # verify the required parameter 'version_id' is set
319 unless (exists $args{'version_id'}) {
320 croak("Missing the required parameter 'version_id' when calling get_custom_vcl");
321 }
322  
323 # verify the required parameter 'vcl_name' is set
324 unless (exists $args{'vcl_name'}) {
325 croak("Missing the required parameter 'vcl_name' when calling get_custom_vcl");
326 }
327  
328 # parse inputs
329 my $_resource_path = '/service/{service_id}/version/{version_id}/vcl/{vcl_name}';
330  
331 my $_method = 'GET';
332 my $query_params = {};
333 my $header_params = {};
334 my $form_params = {};
335  
336 # 'Accept' and 'Content-Type' header
337 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
338 if ($_header_accept) {
339 $header_params->{'Accept'} = $_header_accept;
340 }
341 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
342  
343 # query params
344 if ( exists $args{'no_content'}) {
345 $query_params->{'no_content'} = $self->{api_client}->to_query_value($args{'no_content'});
346 }
347  
348 # path params
349 if ( exists $args{'service_id'}) {
350 my $_base_variable = "{" . "service_id" . "}";
351 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
352 $_resource_path =~ s/$_base_variable/$_base_value/g;
353 }
354  
355 # path params
356 if ( exists $args{'version_id'}) {
357 my $_base_variable = "{" . "version_id" . "}";
358 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
359 $_resource_path =~ s/$_base_variable/$_base_value/g;
360 }
361  
362 # path params
363 if ( exists $args{'vcl_name'}) {
364 my $_base_variable = "{" . "vcl_name" . "}";
365 my $_base_value = $self->{api_client}->to_path_value($args{'vcl_name'});
366 $_resource_path =~ s/$_base_variable/$_base_value/g;
367 }
368  
369 my $_body_data;
370 # authentication setting, if any
371 my $auth_settings = [qw(token )];
372  
373 # make the API Call
374 my $response = $self->{api_client}->call_api($_resource_path, $_method,
375 $query_params, $form_params,
376 $header_params, $_body_data, $auth_settings);
377 if (!$response) {
378 return;
379 }
380 my $_response_object = $self->{api_client}->deserialize('VclResponse', $response);
381 return $_response_object;
382 }
383  
384 #
385 # get_custom_vcl_boilerplate
386 #
387 # Get boilerplate VCL
388 #
389 # @param string $service_id Alphanumeric string identifying the service. (required)
390 # @param int $version_id Integer identifying a service version. (required)
391 {
392 my $params = {
393 'service_id' => {
394 data_type => 'string',
395 description => 'Alphanumeric string identifying the service.',
396 required => '1',
397 },
398 'version_id' => {
399 data_type => 'int',
400 description => 'Integer identifying a service version.',
401 required => '1',
402 },
403 };
404 __PACKAGE__->method_documentation->{ 'get_custom_vcl_boilerplate' } = {
405 summary => 'Get boilerplate VCL',
406 params => $params,
407 returns => 'string',
408 };
409 }
410 # @return string
411 #
412 sub get_custom_vcl_boilerplate {
413 my ($self, %args) = @_;
414  
415 # verify the required parameter 'service_id' is set
416 unless (exists $args{'service_id'}) {
417 croak("Missing the required parameter 'service_id' when calling get_custom_vcl_boilerplate");
418 }
419  
420 # verify the required parameter 'version_id' is set
421 unless (exists $args{'version_id'}) {
422 croak("Missing the required parameter 'version_id' when calling get_custom_vcl_boilerplate");
423 }
424  
425 # parse inputs
426 my $_resource_path = '/service/{service_id}/version/{version_id}/boilerplate';
427  
428 my $_method = 'GET';
429 my $query_params = {};
430 my $header_params = {};
431 my $form_params = {};
432  
433 # 'Accept' and 'Content-Type' header
434 my $_header_accept = $self->{api_client}->select_header_accept('text/plain');
435 if ($_header_accept) {
436 $header_params->{'Accept'} = $_header_accept;
437 }
438 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
439  
440 # path params
441 if ( exists $args{'service_id'}) {
442 my $_base_variable = "{" . "service_id" . "}";
443 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
444 $_resource_path =~ s/$_base_variable/$_base_value/g;
445 }
446  
447 # path params
448 if ( exists $args{'version_id'}) {
449 my $_base_variable = "{" . "version_id" . "}";
450 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
451 $_resource_path =~ s/$_base_variable/$_base_value/g;
452 }
453  
454 my $_body_data;
455 # authentication setting, if any
456 my $auth_settings = [qw(token )];
457  
458 # make the API Call
459 my $response = $self->{api_client}->call_api($_resource_path, $_method,
460 $query_params, $form_params,
461 $header_params, $_body_data, $auth_settings);
462 if (!$response) {
463 return;
464 }
465 my $_response_object = $self->{api_client}->deserialize('string', $response);
466 return $_response_object;
467 }
468  
469 #
470 # get_custom_vcl_generated
471 #
472 # Get the generated VCL for a service
473 #
474 # @param string $service_id Alphanumeric string identifying the service. (required)
475 # @param int $version_id Integer identifying a service version. (required)
476 {
477 my $params = {
478 'service_id' => {
479 data_type => 'string',
480 description => 'Alphanumeric string identifying the service.',
481 required => '1',
482 },
483 'version_id' => {
484 data_type => 'int',
485 description => 'Integer identifying a service version.',
486 required => '1',
487 },
488 };
489 __PACKAGE__->method_documentation->{ 'get_custom_vcl_generated' } = {
490 summary => 'Get the generated VCL for a service',
491 params => $params,
492 returns => 'VclResponse',
493 };
494 }
495 # @return VclResponse
496 #
497 sub get_custom_vcl_generated {
498 my ($self, %args) = @_;
499  
500 # verify the required parameter 'service_id' is set
501 unless (exists $args{'service_id'}) {
502 croak("Missing the required parameter 'service_id' when calling get_custom_vcl_generated");
503 }
504  
505 # verify the required parameter 'version_id' is set
506 unless (exists $args{'version_id'}) {
507 croak("Missing the required parameter 'version_id' when calling get_custom_vcl_generated");
508 }
509  
510 # parse inputs
511 my $_resource_path = '/service/{service_id}/version/{version_id}/generated_vcl';
512  
513 my $_method = 'GET';
514 my $query_params = {};
515 my $header_params = {};
516 my $form_params = {};
517  
518 # 'Accept' and 'Content-Type' header
519 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
520 if ($_header_accept) {
521 $header_params->{'Accept'} = $_header_accept;
522 }
523 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
524  
525 # path params
526 if ( exists $args{'service_id'}) {
527 my $_base_variable = "{" . "service_id" . "}";
528 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
529 $_resource_path =~ s/$_base_variable/$_base_value/g;
530 }
531  
532 # path params
533 if ( exists $args{'version_id'}) {
534 my $_base_variable = "{" . "version_id" . "}";
535 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
536 $_resource_path =~ s/$_base_variable/$_base_value/g;
537 }
538  
539 my $_body_data;
540 # authentication setting, if any
541 my $auth_settings = [qw(token )];
542  
543 # make the API Call
544 my $response = $self->{api_client}->call_api($_resource_path, $_method,
545 $query_params, $form_params,
546 $header_params, $_body_data, $auth_settings);
547 if (!$response) {
548 return;
549 }
550 my $_response_object = $self->{api_client}->deserialize('VclResponse', $response);
551 return $_response_object;
552 }
553  
554 #
555 # get_custom_vcl_generated_highlighted
556 #
557 # Get the generated VCL with syntax highlighting
558 #
559 # @param string $service_id Alphanumeric string identifying the service. (required)
560 # @param int $version_id Integer identifying a service version. (required)
561 {
562 my $params = {
563 'service_id' => {
564 data_type => 'string',
565 description => 'Alphanumeric string identifying the service.',
566 required => '1',
567 },
568 'version_id' => {
569 data_type => 'int',
570 description => 'Integer identifying a service version.',
571 required => '1',
572 },
573 };
574 __PACKAGE__->method_documentation->{ 'get_custom_vcl_generated_highlighted' } = {
575 summary => 'Get the generated VCL with syntax highlighting',
576 params => $params,
577 returns => 'VclSyntaxHighlightingResponse',
578 };
579 }
580 # @return VclSyntaxHighlightingResponse
581 #
582 sub get_custom_vcl_generated_highlighted {
583 my ($self, %args) = @_;
584  
585 # verify the required parameter 'service_id' is set
586 unless (exists $args{'service_id'}) {
587 croak("Missing the required parameter 'service_id' when calling get_custom_vcl_generated_highlighted");
588 }
589  
590 # verify the required parameter 'version_id' is set
591 unless (exists $args{'version_id'}) {
592 croak("Missing the required parameter 'version_id' when calling get_custom_vcl_generated_highlighted");
593 }
594  
595 # parse inputs
596 my $_resource_path = '/service/{service_id}/version/{version_id}/generated_vcl/content';
597  
598 my $_method = 'GET';
599 my $query_params = {};
600 my $header_params = {};
601 my $form_params = {};
602  
603 # 'Accept' and 'Content-Type' header
604 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
605 if ($_header_accept) {
606 $header_params->{'Accept'} = $_header_accept;
607 }
608 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
609  
610 # path params
611 if ( exists $args{'service_id'}) {
612 my $_base_variable = "{" . "service_id" . "}";
613 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
614 $_resource_path =~ s/$_base_variable/$_base_value/g;
615 }
616  
617 # path params
618 if ( exists $args{'version_id'}) {
619 my $_base_variable = "{" . "version_id" . "}";
620 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
621 $_resource_path =~ s/$_base_variable/$_base_value/g;
622 }
623  
624 my $_body_data;
625 # authentication setting, if any
626 my $auth_settings = [qw(token )];
627  
628 # make the API Call
629 my $response = $self->{api_client}->call_api($_resource_path, $_method,
630 $query_params, $form_params,
631 $header_params, $_body_data, $auth_settings);
632 if (!$response) {
633 return;
634 }
635 my $_response_object = $self->{api_client}->deserialize('VclSyntaxHighlightingResponse', $response);
636 return $_response_object;
637 }
638  
639 #
640 # get_custom_vcl_highlighted
641 #
642 # Get a custom VCL file with syntax highlighting
643 #
644 # @param string $service_id Alphanumeric string identifying the service. (required)
645 # @param int $version_id Integer identifying a service version. (required)
646 # @param string $vcl_name The name of this VCL. (required)
647 {
648 my $params = {
649 'service_id' => {
650 data_type => 'string',
651 description => 'Alphanumeric string identifying the service.',
652 required => '1',
653 },
654 'version_id' => {
655 data_type => 'int',
656 description => 'Integer identifying a service version.',
657 required => '1',
658 },
659 'vcl_name' => {
660 data_type => 'string',
661 description => 'The name of this VCL.',
662 required => '1',
663 },
664 };
665 __PACKAGE__->method_documentation->{ 'get_custom_vcl_highlighted' } = {
666 summary => 'Get a custom VCL file with syntax highlighting',
667 params => $params,
668 returns => 'VclSyntaxHighlightingResponse',
669 };
670 }
671 # @return VclSyntaxHighlightingResponse
672 #
673 sub get_custom_vcl_highlighted {
674 my ($self, %args) = @_;
675  
676 # verify the required parameter 'service_id' is set
677 unless (exists $args{'service_id'}) {
678 croak("Missing the required parameter 'service_id' when calling get_custom_vcl_highlighted");
679 }
680  
681 # verify the required parameter 'version_id' is set
682 unless (exists $args{'version_id'}) {
683 croak("Missing the required parameter 'version_id' when calling get_custom_vcl_highlighted");
684 }
685  
686 # verify the required parameter 'vcl_name' is set
687 unless (exists $args{'vcl_name'}) {
688 croak("Missing the required parameter 'vcl_name' when calling get_custom_vcl_highlighted");
689 }
690  
691 # parse inputs
692 my $_resource_path = '/service/{service_id}/version/{version_id}/vcl/{vcl_name}/content';
693  
694 my $_method = 'GET';
695 my $query_params = {};
696 my $header_params = {};
697 my $form_params = {};
698  
699 # 'Accept' and 'Content-Type' header
700 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
701 if ($_header_accept) {
702 $header_params->{'Accept'} = $_header_accept;
703 }
704 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
705  
706 # path params
707 if ( exists $args{'service_id'}) {
708 my $_base_variable = "{" . "service_id" . "}";
709 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
710 $_resource_path =~ s/$_base_variable/$_base_value/g;
711 }
712  
713 # path params
714 if ( exists $args{'version_id'}) {
715 my $_base_variable = "{" . "version_id" . "}";
716 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
717 $_resource_path =~ s/$_base_variable/$_base_value/g;
718 }
719  
720 # path params
721 if ( exists $args{'vcl_name'}) {
722 my $_base_variable = "{" . "vcl_name" . "}";
723 my $_base_value = $self->{api_client}->to_path_value($args{'vcl_name'});
724 $_resource_path =~ s/$_base_variable/$_base_value/g;
725 }
726  
727 my $_body_data;
728 # authentication setting, if any
729 my $auth_settings = [qw(token )];
730  
731 # make the API Call
732 my $response = $self->{api_client}->call_api($_resource_path, $_method,
733 $query_params, $form_params,
734 $header_params, $_body_data, $auth_settings);
735 if (!$response) {
736 return;
737 }
738 my $_response_object = $self->{api_client}->deserialize('VclSyntaxHighlightingResponse', $response);
739 return $_response_object;
740 }
741  
742 #
743 # get_custom_vcl_raw
744 #
745 # Download a custom VCL file
746 #
747 # @param string $service_id Alphanumeric string identifying the service. (required)
748 # @param int $version_id Integer identifying a service version. (required)
749 # @param string $vcl_name The name of this VCL. (required)
750 {
751 my $params = {
752 'service_id' => {
753 data_type => 'string',
754 description => 'Alphanumeric string identifying the service.',
755 required => '1',
756 },
757 'version_id' => {
758 data_type => 'int',
759 description => 'Integer identifying a service version.',
760 required => '1',
761 },
762 'vcl_name' => {
763 data_type => 'string',
764 description => 'The name of this VCL.',
765 required => '1',
766 },
767 };
768 __PACKAGE__->method_documentation->{ 'get_custom_vcl_raw' } = {
769 summary => 'Download a custom VCL file',
770 params => $params,
771 returns => 'string',
772 };
773 }
774 # @return string
775 #
776 sub get_custom_vcl_raw {
777 my ($self, %args) = @_;
778  
779 # verify the required parameter 'service_id' is set
780 unless (exists $args{'service_id'}) {
781 croak("Missing the required parameter 'service_id' when calling get_custom_vcl_raw");
782 }
783  
784 # verify the required parameter 'version_id' is set
785 unless (exists $args{'version_id'}) {
786 croak("Missing the required parameter 'version_id' when calling get_custom_vcl_raw");
787 }
788  
789 # verify the required parameter 'vcl_name' is set
790 unless (exists $args{'vcl_name'}) {
791 croak("Missing the required parameter 'vcl_name' when calling get_custom_vcl_raw");
792 }
793  
794 # parse inputs
795 my $_resource_path = '/service/{service_id}/version/{version_id}/vcl/{vcl_name}/download';
796  
797 my $_method = 'GET';
798 my $query_params = {};
799 my $header_params = {};
800 my $form_params = {};
801  
802 # 'Accept' and 'Content-Type' header
803 my $_header_accept = $self->{api_client}->select_header_accept('text/plain');
804 if ($_header_accept) {
805 $header_params->{'Accept'} = $_header_accept;
806 }
807 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
808  
809 # path params
810 if ( exists $args{'service_id'}) {
811 my $_base_variable = "{" . "service_id" . "}";
812 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
813 $_resource_path =~ s/$_base_variable/$_base_value/g;
814 }
815  
816 # path params
817 if ( exists $args{'version_id'}) {
818 my $_base_variable = "{" . "version_id" . "}";
819 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
820 $_resource_path =~ s/$_base_variable/$_base_value/g;
821 }
822  
823 # path params
824 if ( exists $args{'vcl_name'}) {
825 my $_base_variable = "{" . "vcl_name" . "}";
826 my $_base_value = $self->{api_client}->to_path_value($args{'vcl_name'});
827 $_resource_path =~ s/$_base_variable/$_base_value/g;
828 }
829  
830 my $_body_data;
831 # authentication setting, if any
832 my $auth_settings = [qw(token )];
833  
834 # make the API Call
835 my $response = $self->{api_client}->call_api($_resource_path, $_method,
836 $query_params, $form_params,
837 $header_params, $_body_data, $auth_settings);
838 if (!$response) {
839 return;
840 }
841 my $_response_object = $self->{api_client}->deserialize('string', $response);
842 return $_response_object;
843 }
844  
845 #
846 # lint_vcl_default
847 #
848 # Lint (validate) VCL using a default set of flags.
849 #
850 # @param InlineObject1 $inline_object1 (required)
851 {
852 my $params = {
853 'inline_object1' => {
854 data_type => 'InlineObject1',
855 description => '',
856 required => '1',
857 },
858 };
859 __PACKAGE__->method_documentation->{ 'lint_vcl_default' } = {
860 summary => 'Lint (validate) VCL using a default set of flags.',
861 params => $params,
862 returns => 'ValidatorResult',
863 };
864 }
865 # @return ValidatorResult
866 #
867 sub lint_vcl_default {
868 my ($self, %args) = @_;
869  
870 # verify the required parameter 'inline_object1' is set
871 unless (exists $args{'inline_object1'}) {
872 croak("Missing the required parameter 'inline_object1' when calling lint_vcl_default");
873 }
874  
875 # parse inputs
876 my $_resource_path = '/vcl_lint';
877  
878 my $_method = 'POST';
879 my $query_params = {};
880 my $header_params = {};
881 my $form_params = {};
882  
883 # 'Accept' and 'Content-Type' header
884 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
885 if ($_header_accept) {
886 $header_params->{'Accept'} = $_header_accept;
887 }
888 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
889  
890 my $_body_data;
891 # body params
892 if ( exists $args{'inline_object1'}) {
893 $_body_data = $args{'inline_object1'};
894 }
895  
896 # authentication setting, if any
897 my $auth_settings = [qw(token )];
898  
899 # make the API Call
900 my $response = $self->{api_client}->call_api($_resource_path, $_method,
901 $query_params, $form_params,
902 $header_params, $_body_data, $auth_settings);
903 if (!$response) {
904 return;
905 }
906 my $_response_object = $self->{api_client}->deserialize('ValidatorResult', $response);
907 return $_response_object;
908 }
909  
910 #
911 # lint_vcl_for_service
912 #
913 # Lint (validate) VCL using flags set for the service.
914 #
915 # @param string $service_id Alphanumeric string identifying the service. (required)
916 # @param InlineObject $inline_object (required)
917 {
918 my $params = {
919 'service_id' => {
920 data_type => 'string',
921 description => 'Alphanumeric string identifying the service.',
922 required => '1',
923 },
924 'inline_object' => {
925 data_type => 'InlineObject',
926 description => '',
927 required => '1',
928 },
929 };
930 __PACKAGE__->method_documentation->{ 'lint_vcl_for_service' } = {
931 summary => 'Lint (validate) VCL using flags set for the service.',
932 params => $params,
933 returns => 'ValidatorResult',
934 };
935 }
936 # @return ValidatorResult
937 #
938 sub lint_vcl_for_service {
939 my ($self, %args) = @_;
940  
941 # verify the required parameter 'service_id' is set
942 unless (exists $args{'service_id'}) {
943 croak("Missing the required parameter 'service_id' when calling lint_vcl_for_service");
944 }
945  
946 # verify the required parameter 'inline_object' is set
947 unless (exists $args{'inline_object'}) {
948 croak("Missing the required parameter 'inline_object' when calling lint_vcl_for_service");
949 }
950  
951 # parse inputs
952 my $_resource_path = '/service/{service_id}/lint';
953  
954 my $_method = 'POST';
955 my $query_params = {};
956 my $header_params = {};
957 my $form_params = {};
958  
959 # 'Accept' and 'Content-Type' header
960 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
961 if ($_header_accept) {
962 $header_params->{'Accept'} = $_header_accept;
963 }
964 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
965  
966 # path params
967 if ( exists $args{'service_id'}) {
968 my $_base_variable = "{" . "service_id" . "}";
969 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
970 $_resource_path =~ s/$_base_variable/$_base_value/g;
971 }
972  
973 my $_body_data;
974 # body params
975 if ( exists $args{'inline_object'}) {
976 $_body_data = $args{'inline_object'};
977 }
978  
979 # authentication setting, if any
980 my $auth_settings = [qw(token )];
981  
982 # make the API Call
983 my $response = $self->{api_client}->call_api($_resource_path, $_method,
984 $query_params, $form_params,
985 $header_params, $_body_data, $auth_settings);
986 if (!$response) {
987 return;
988 }
989 my $_response_object = $self->{api_client}->deserialize('ValidatorResult', $response);
990 return $_response_object;
991 }
992  
993 #
994 # list_custom_vcl
995 #
996 # List custom VCL files
997 #
998 # @param string $service_id Alphanumeric string identifying the service. (required)
999 # @param int $version_id Integer identifying a service version. (required)
1000 {
1001 my $params = {
1002 'service_id' => {
1003 data_type => 'string',
1004 description => 'Alphanumeric string identifying the service.',
1005 required => '1',
1006 },
1007 'version_id' => {
1008 data_type => 'int',
1009 description => 'Integer identifying a service version.',
1010 required => '1',
1011 },
1012 };
1013 __PACKAGE__->method_documentation->{ 'list_custom_vcl' } = {
1014 summary => 'List custom VCL files',
1015 params => $params,
1016 returns => 'ARRAY[VclResponse]',
1017 };
1018 }
1019 # @return ARRAY[VclResponse]
1020 #
1021 sub list_custom_vcl {
1022 my ($self, %args) = @_;
1023  
1024 # verify the required parameter 'service_id' is set
1025 unless (exists $args{'service_id'}) {
1026 croak("Missing the required parameter 'service_id' when calling list_custom_vcl");
1027 }
1028  
1029 # verify the required parameter 'version_id' is set
1030 unless (exists $args{'version_id'}) {
1031 croak("Missing the required parameter 'version_id' when calling list_custom_vcl");
1032 }
1033  
1034 # parse inputs
1035 my $_resource_path = '/service/{service_id}/version/{version_id}/vcl';
1036  
1037 my $_method = 'GET';
1038 my $query_params = {};
1039 my $header_params = {};
1040 my $form_params = {};
1041  
1042 # 'Accept' and 'Content-Type' header
1043 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
1044 if ($_header_accept) {
1045 $header_params->{'Accept'} = $_header_accept;
1046 }
1047 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
1048  
1049 # path params
1050 if ( exists $args{'service_id'}) {
1051 my $_base_variable = "{" . "service_id" . "}";
1052 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
1053 $_resource_path =~ s/$_base_variable/$_base_value/g;
1054 }
1055  
1056 # path params
1057 if ( exists $args{'version_id'}) {
1058 my $_base_variable = "{" . "version_id" . "}";
1059 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
1060 $_resource_path =~ s/$_base_variable/$_base_value/g;
1061 }
1062  
1063 my $_body_data;
1064 # authentication setting, if any
1065 my $auth_settings = [qw(token )];
1066  
1067 # make the API Call
1068 my $response = $self->{api_client}->call_api($_resource_path, $_method,
1069 $query_params, $form_params,
1070 $header_params, $_body_data, $auth_settings);
1071 if (!$response) {
1072 return;
1073 }
1074 my $_response_object = $self->{api_client}->deserialize('ARRAY[VclResponse]', $response);
1075 return $_response_object;
1076 }
1077  
1078 #
1079 # set_custom_vcl_main
1080 #
1081 # Set a custom VCL file as main
1082 #
1083 # @param string $service_id Alphanumeric string identifying the service. (required)
1084 # @param int $version_id Integer identifying a service version. (required)
1085 # @param string $vcl_name The name of this VCL. (required)
1086 {
1087 my $params = {
1088 'service_id' => {
1089 data_type => 'string',
1090 description => 'Alphanumeric string identifying the service.',
1091 required => '1',
1092 },
1093 'version_id' => {
1094 data_type => 'int',
1095 description => 'Integer identifying a service version.',
1096 required => '1',
1097 },
1098 'vcl_name' => {
1099 data_type => 'string',
1100 description => 'The name of this VCL.',
1101 required => '1',
1102 },
1103 };
1104 __PACKAGE__->method_documentation->{ 'set_custom_vcl_main' } = {
1105 summary => 'Set a custom VCL file as main',
1106 params => $params,
1107 returns => 'VclResponse',
1108 };
1109 }
1110 # @return VclResponse
1111 #
1112 sub set_custom_vcl_main {
1113 my ($self, %args) = @_;
1114  
1115 # verify the required parameter 'service_id' is set
1116 unless (exists $args{'service_id'}) {
1117 croak("Missing the required parameter 'service_id' when calling set_custom_vcl_main");
1118 }
1119  
1120 # verify the required parameter 'version_id' is set
1121 unless (exists $args{'version_id'}) {
1122 croak("Missing the required parameter 'version_id' when calling set_custom_vcl_main");
1123 }
1124  
1125 # verify the required parameter 'vcl_name' is set
1126 unless (exists $args{'vcl_name'}) {
1127 croak("Missing the required parameter 'vcl_name' when calling set_custom_vcl_main");
1128 }
1129  
1130 # parse inputs
1131 my $_resource_path = '/service/{service_id}/version/{version_id}/vcl/{vcl_name}/main';
1132  
1133 my $_method = 'PUT';
1134 my $query_params = {};
1135 my $header_params = {};
1136 my $form_params = {};
1137  
1138 # 'Accept' and 'Content-Type' header
1139 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
1140 if ($_header_accept) {
1141 $header_params->{'Accept'} = $_header_accept;
1142 }
1143 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
1144  
1145 # path params
1146 if ( exists $args{'service_id'}) {
1147 my $_base_variable = "{" . "service_id" . "}";
1148 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
1149 $_resource_path =~ s/$_base_variable/$_base_value/g;
1150 }
1151  
1152 # path params
1153 if ( exists $args{'version_id'}) {
1154 my $_base_variable = "{" . "version_id" . "}";
1155 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
1156 $_resource_path =~ s/$_base_variable/$_base_value/g;
1157 }
1158  
1159 # path params
1160 if ( exists $args{'vcl_name'}) {
1161 my $_base_variable = "{" . "vcl_name" . "}";
1162 my $_base_value = $self->{api_client}->to_path_value($args{'vcl_name'});
1163 $_resource_path =~ s/$_base_variable/$_base_value/g;
1164 }
1165  
1166 my $_body_data;
1167 # authentication setting, if any
1168 my $auth_settings = [qw(token )];
1169  
1170 # make the API Call
1171 my $response = $self->{api_client}->call_api($_resource_path, $_method,
1172 $query_params, $form_params,
1173 $header_params, $_body_data, $auth_settings);
1174 if (!$response) {
1175 return;
1176 }
1177 my $_response_object = $self->{api_client}->deserialize('VclResponse', $response);
1178 return $_response_object;
1179 }
1180  
1181 #
1182 # update_custom_vcl
1183 #
1184 # Update a custom VCL file
1185 #
1186 # @param string $service_id Alphanumeric string identifying the service. (required)
1187 # @param int $version_id Integer identifying a service version. (required)
1188 # @param string $vcl_name The name of this VCL. (required)
1189 # @param string $content The VCL code to be included. (optional)
1190 # @param boolean $main Set to `true` when this is the main VCL, otherwise `false`. (optional)
1191 # @param string $name The name of this VCL. (optional)
1192 {
1193 my $params = {
1194 'service_id' => {
1195 data_type => 'string',
1196 description => 'Alphanumeric string identifying the service.',
1197 required => '1',
1198 },
1199 'version_id' => {
1200 data_type => 'int',
1201 description => 'Integer identifying a service version.',
1202 required => '1',
1203 },
1204 'vcl_name' => {
1205 data_type => 'string',
1206 description => 'The name of this VCL.',
1207 required => '1',
1208 },
1209 'content' => {
1210 data_type => 'string',
1211 description => 'The VCL code to be included.',
1212 required => '0',
1213 },
1214 'main' => {
1215 data_type => 'boolean',
1216 description => 'Set to `true` when this is the main VCL, otherwise `false`.',
1217 required => '0',
1218 },
1219 'name' => {
1220 data_type => 'string',
1221 description => 'The name of this VCL.',
1222 required => '0',
1223 },
1224 };
1225 __PACKAGE__->method_documentation->{ 'update_custom_vcl' } = {
1226 summary => 'Update a custom VCL file',
1227 params => $params,
1228 returns => 'VclResponse',
1229 };
1230 }
1231 # @return VclResponse
1232 #
1233 sub update_custom_vcl {
1234 my ($self, %args) = @_;
1235  
1236 # verify the required parameter 'service_id' is set
1237 unless (exists $args{'service_id'}) {
1238 croak("Missing the required parameter 'service_id' when calling update_custom_vcl");
1239 }
1240  
1241 # verify the required parameter 'version_id' is set
1242 unless (exists $args{'version_id'}) {
1243 croak("Missing the required parameter 'version_id' when calling update_custom_vcl");
1244 }
1245  
1246 # verify the required parameter 'vcl_name' is set
1247 unless (exists $args{'vcl_name'}) {
1248 croak("Missing the required parameter 'vcl_name' when calling update_custom_vcl");
1249 }
1250  
1251 # parse inputs
1252 my $_resource_path = '/service/{service_id}/version/{version_id}/vcl/{vcl_name}';
1253  
1254 my $_method = 'PUT';
1255 my $query_params = {};
1256 my $header_params = {};
1257 my $form_params = {};
1258  
1259 # 'Accept' and 'Content-Type' header
1260 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
1261 if ($_header_accept) {
1262 $header_params->{'Accept'} = $_header_accept;
1263 }
1264 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
1265  
1266 # path params
1267 if ( exists $args{'service_id'}) {
1268 my $_base_variable = "{" . "service_id" . "}";
1269 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
1270 $_resource_path =~ s/$_base_variable/$_base_value/g;
1271 }
1272  
1273 # path params
1274 if ( exists $args{'version_id'}) {
1275 my $_base_variable = "{" . "version_id" . "}";
1276 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
1277 $_resource_path =~ s/$_base_variable/$_base_value/g;
1278 }
1279  
1280 # path params
1281 if ( exists $args{'vcl_name'}) {
1282 my $_base_variable = "{" . "vcl_name" . "}";
1283 my $_base_value = $self->{api_client}->to_path_value($args{'vcl_name'});
1284 $_resource_path =~ s/$_base_variable/$_base_value/g;
1285 }
1286  
1287 # form params
1288 if ( exists $args{'content'} ) {
1289 $form_params->{'content'} = $self->{api_client}->to_form_value($args{'content'});
1290 }
1291  
1292 # form params
1293 if ( exists $args{'main'} ) {
1294 $form_params->{'main'} = $self->{api_client}->to_form_value($args{'main'});
1295 }
1296  
1297 # form params
1298 if ( exists $args{'name'} ) {
1299 $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
1300 }
1301  
1302 my $_body_data;
1303 # authentication setting, if any
1304 my $auth_settings = [qw(token )];
1305  
1306 # make the API Call
1307 my $response = $self->{api_client}->call_api($_resource_path, $_method,
1308 $query_params, $form_params,
1309 $header_params, $_body_data, $auth_settings);
1310 if (!$response) {
1311 return;
1312 }
1313 my $_response_object = $self->{api_client}->deserialize('VclResponse', $response);
1314 return $_response_object;
1315 }
1316  
1317 1;