Fastly/LoggingFtpApi.pm untested

filter: Statementstmt 0.0% 0 / 298 Branchbran 0.0% 0 / 150 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 15 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 478 CC 76 SCAR 61.7
CC
76
Cov
0%
update_log_ftp
812.0
create_log_ftp
702.0
delete_log_ftp
90.0
CRAP 478.1
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::LoggingFtpApi;
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_log_ftp
51 #
52 # Create an FTP log endpoint
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 $name The name for the real-time logging configuration. (optional)
57 # @param string $placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. (optional)
58 # @param string $response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional)
59 # @param string $format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (optional, default to '%h %l %u %t "%r" %>s %b')
60 # @param string $log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (optional, default to 'none')
61 # @param int $format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional, default to 2)
62 # @param string $message_type How the message should be formatted. (optional, default to 'blank')
63 # @param string $timestamp_format A timestamp format (optional)
64 # @param string $compression_codec The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional)
65 # @param int $period How frequently log files are finalized so they can be available for reading (in seconds). (optional, default to 3600)
66 # @param int $gzip_level The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional, default to 0)
67 # @param string $address An hostname or IPv4 address. (optional)
68 # @param string $hostname Hostname used. (optional)
69 # @param string $ipv4 IPv4 address of the host. (optional)
70 # @param string $password The password for the server. For anonymous use an email address. (optional)
71 # @param string $path The path to upload log files to. If the path ends in `/` then it is treated as a directory. (optional)
72 # @param string $public_key A PGP public key that Fastly will use to encrypt your log files before writing them to disk. (optional, default to 'null')
73 # @param string $user The username for the server. Can be anonymous. (optional)
74 # @param int $port The port number. (optional, default to 21)
75 {
76 my $params = {
77 'service_id' => {
78 data_type => 'string',
79 description => 'Alphanumeric string identifying the service.',
80 required => '1',
81 },
82 'version_id' => {
83 data_type => 'int',
84 description => 'Integer identifying a service version.',
85 required => '1',
86 },
87 'name' => {
88 data_type => 'string',
89 description => 'The name for the real-time logging configuration.',
90 required => '0',
91 },
92 'placement' => {
93 data_type => 'string',
94 description => 'Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. ',
95 required => '0',
96 },
97 'response_condition' => {
98 data_type => 'string',
99 description => 'The name of an existing condition in the configured endpoint, or leave blank to always execute.',
100 required => '0',
101 },
102 'format' => {
103 data_type => 'string',
104 description => 'A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).',
105 required => '0',
106 },
107 'log_processing_region' => {
108 data_type => 'string',
109 description => 'The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.',
110 required => '0',
111 },
112 'format_version' => {
113 data_type => 'int',
114 description => 'The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. ',
115 required => '0',
116 },
117 'message_type' => {
118 data_type => 'string',
119 description => 'How the message should be formatted.',
120 required => '0',
121 },
122 'timestamp_format' => {
123 data_type => 'string',
124 description => 'A timestamp format',
125 required => '0',
126 },
127 'compression_codec' => {
128 data_type => 'string',
129 description => 'The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.',
130 required => '0',
131 },
132 'period' => {
133 data_type => 'int',
134 description => 'How frequently log files are finalized so they can be available for reading (in seconds).',
135 required => '0',
136 },
137 'gzip_level' => {
138 data_type => 'int',
139 description => 'The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.',
140 required => '0',
141 },
142 'address' => {
143 data_type => 'string',
144 description => 'An hostname or IPv4 address.',
145 required => '0',
146 },
147 'hostname' => {
148 data_type => 'string',
149 description => 'Hostname used.',
150 required => '0',
151 },
152 'ipv4' => {
153 data_type => 'string',
154 description => 'IPv4 address of the host.',
155 required => '0',
156 },
157 'password' => {
158 data_type => 'string',
159 description => 'The password for the server. For anonymous use an email address.',
160 required => '0',
161 },
162 'path' => {
163 data_type => 'string',
164 description => 'The path to upload log files to. If the path ends in `/` then it is treated as a directory.',
165 required => '0',
166 },
167 'public_key' => {
168 data_type => 'string',
169 description => 'A PGP public key that Fastly will use to encrypt your log files before writing them to disk.',
170 required => '0',
171 },
172 'user' => {
173 data_type => 'string',
174 description => 'The username for the server. Can be anonymous.',
175 required => '0',
176 },
177 'port' => {
178 data_type => 'int',
179 description => 'The port number.',
180 required => '0',
181 },
182 };
183 __PACKAGE__->method_documentation->{ 'create_log_ftp' } = {
184 summary => 'Create an FTP log endpoint',
185 params => $params,
186 returns => 'LoggingFtpResponse',
187 };
188 }
189 # @return LoggingFtpResponse
190 #
191 sub create_log_ftp {
192 my ($self, %args) = @_;
193  
194 # verify the required parameter 'service_id' is set
195 unless (exists $args{'service_id'}) {
196 croak("Missing the required parameter 'service_id' when calling create_log_ftp");
197 }
198  
199 # verify the required parameter 'version_id' is set
200 unless (exists $args{'version_id'}) {
201 croak("Missing the required parameter 'version_id' when calling create_log_ftp");
202 }
203  
204 # parse inputs
205 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/ftp';
206  
207 my $_method = 'POST';
208 my $query_params = {};
209 my $header_params = {};
210 my $form_params = {};
211  
212 # 'Accept' and 'Content-Type' header
213 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
214 if ($_header_accept) {
215 $header_params->{'Accept'} = $_header_accept;
216 }
217 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
218  
219 # path params
220 if ( exists $args{'service_id'}) {
221 my $_base_variable = "{" . "service_id" . "}";
222 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
223 $_resource_path =~ s/$_base_variable/$_base_value/g;
224 }
225  
226 # path params
227 if ( exists $args{'version_id'}) {
228 my $_base_variable = "{" . "version_id" . "}";
229 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
230 $_resource_path =~ s/$_base_variable/$_base_value/g;
231 }
232  
233 # form params
234 if ( exists $args{'name'} ) {
235 $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
236 }
237  
238 # form params
239 if ( exists $args{'placement'} ) {
240 $form_params->{'placement'} = $self->{api_client}->to_form_value($args{'placement'});
241 }
242  
243 # form params
244 if ( exists $args{'response_condition'} ) {
245 $form_params->{'response_condition'} = $self->{api_client}->to_form_value($args{'response_condition'});
246 }
247  
248 # form params
249 if ( exists $args{'format'} ) {
250 $form_params->{'format'} = $self->{api_client}->to_form_value($args{'format'});
251 }
252  
253 # form params
254 if ( exists $args{'log_processing_region'} ) {
255 $form_params->{'log_processing_region'} = $self->{api_client}->to_form_value($args{'log_processing_region'});
256 }
257  
258 # form params
259 if ( exists $args{'format_version'} ) {
260 $form_params->{'format_version'} = $self->{api_client}->to_form_value($args{'format_version'});
261 }
262  
263 # form params
264 if ( exists $args{'message_type'} ) {
265 $form_params->{'message_type'} = $self->{api_client}->to_form_value($args{'message_type'});
266 }
267  
268 # form params
269 if ( exists $args{'timestamp_format'} ) {
270 $form_params->{'timestamp_format'} = $self->{api_client}->to_form_value($args{'timestamp_format'});
271 }
272  
273 # form params
274 if ( exists $args{'compression_codec'} ) {
275 $form_params->{'compression_codec'} = $self->{api_client}->to_form_value($args{'compression_codec'});
276 }
277  
278 # form params
279 if ( exists $args{'period'} ) {
280 $form_params->{'period'} = $self->{api_client}->to_form_value($args{'period'});
281 }
282  
283 # form params
284 if ( exists $args{'gzip_level'} ) {
285 $form_params->{'gzip_level'} = $self->{api_client}->to_form_value($args{'gzip_level'});
286 }
287  
288 # form params
289 if ( exists $args{'address'} ) {
290 $form_params->{'address'} = $self->{api_client}->to_form_value($args{'address'});
291 }
292  
293 # form params
294 if ( exists $args{'hostname'} ) {
295 $form_params->{'hostname'} = $self->{api_client}->to_form_value($args{'hostname'});
296 }
297  
298 # form params
299 if ( exists $args{'ipv4'} ) {
300 $form_params->{'ipv4'} = $self->{api_client}->to_form_value($args{'ipv4'});
301 }
302  
303 # form params
304 if ( exists $args{'password'} ) {
305 $form_params->{'password'} = $self->{api_client}->to_form_value($args{'password'});
306 }
307  
308 # form params
309 if ( exists $args{'path'} ) {
310 $form_params->{'path'} = $self->{api_client}->to_form_value($args{'path'});
311 }
312  
313 # form params
314 if ( exists $args{'public_key'} ) {
315 $form_params->{'public_key'} = $self->{api_client}->to_form_value($args{'public_key'});
316 }
317  
318 # form params
319 if ( exists $args{'user'} ) {
320 $form_params->{'user'} = $self->{api_client}->to_form_value($args{'user'});
321 }
322  
323 # form params
324 if ( exists $args{'port'} ) {
325 $form_params->{'port'} = $self->{api_client}->to_form_value($args{'port'});
326 }
327  
328 my $_body_data;
329 # authentication setting, if any
330 my $auth_settings = [qw(token )];
331  
332 # make the API Call
333 my $response = $self->{api_client}->call_api($_resource_path, $_method,
334 $query_params, $form_params,
335 $header_params, $_body_data, $auth_settings);
336 if (!$response) {
337 return;
338 }
339 my $_response_object = $self->{api_client}->deserialize('LoggingFtpResponse', $response);
340 return $_response_object;
341 }
342  
343 #
344 # delete_log_ftp
345 #
346 # Delete an FTP log endpoint
347 #
348 # @param string $service_id Alphanumeric string identifying the service. (required)
349 # @param int $version_id Integer identifying a service version. (required)
350 # @param string $logging_ftp_name The name for the real-time logging configuration. (required)
351 {
352 my $params = {
353 'service_id' => {
354 data_type => 'string',
355 description => 'Alphanumeric string identifying the service.',
356 required => '1',
357 },
358 'version_id' => {
359 data_type => 'int',
360 description => 'Integer identifying a service version.',
361 required => '1',
362 },
363 'logging_ftp_name' => {
364 data_type => 'string',
365 description => 'The name for the real-time logging configuration.',
366 required => '1',
367 },
368 };
369 __PACKAGE__->method_documentation->{ 'delete_log_ftp' } = {
370 summary => 'Delete an FTP log endpoint',
371 params => $params,
372 returns => 'InlineResponse200',
373 };
374 }
375 # @return InlineResponse200
376 #
377 sub delete_log_ftp {
378 my ($self, %args) = @_;
379  
380 # verify the required parameter 'service_id' is set
381 unless (exists $args{'service_id'}) {
382 croak("Missing the required parameter 'service_id' when calling delete_log_ftp");
383 }
384  
385 # verify the required parameter 'version_id' is set
386 unless (exists $args{'version_id'}) {
387 croak("Missing the required parameter 'version_id' when calling delete_log_ftp");
388 }
389  
390 # verify the required parameter 'logging_ftp_name' is set
391 unless (exists $args{'logging_ftp_name'}) {
392 croak("Missing the required parameter 'logging_ftp_name' when calling delete_log_ftp");
393 }
394  
395 # parse inputs
396 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/ftp/{logging_ftp_name}';
397  
398 my $_method = 'DELETE';
399 my $query_params = {};
400 my $header_params = {};
401 my $form_params = {};
402  
403 # 'Accept' and 'Content-Type' header
404 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
405 if ($_header_accept) {
406 $header_params->{'Accept'} = $_header_accept;
407 }
408 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
409  
410 # path params
411 if ( exists $args{'service_id'}) {
412 my $_base_variable = "{" . "service_id" . "}";
413 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
414 $_resource_path =~ s/$_base_variable/$_base_value/g;
415 }
416  
417 # path params
418 if ( exists $args{'version_id'}) {
419 my $_base_variable = "{" . "version_id" . "}";
420 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
421 $_resource_path =~ s/$_base_variable/$_base_value/g;
422 }
423  
424 # path params
425 if ( exists $args{'logging_ftp_name'}) {
426 my $_base_variable = "{" . "logging_ftp_name" . "}";
427 my $_base_value = $self->{api_client}->to_path_value($args{'logging_ftp_name'});
428 $_resource_path =~ s/$_base_variable/$_base_value/g;
429 }
430  
431 my $_body_data;
432 # authentication setting, if any
433 my $auth_settings = [qw(token )];
434  
435 # make the API Call
436 my $response = $self->{api_client}->call_api($_resource_path, $_method,
437 $query_params, $form_params,
438 $header_params, $_body_data, $auth_settings);
439 if (!$response) {
440 return;
441 }
442 my $_response_object = $self->{api_client}->deserialize('InlineResponse200', $response);
443 return $_response_object;
444 }
445  
446 #
447 # get_log_ftp
448 #
449 # Get an FTP log endpoint
450 #
451 # @param string $service_id Alphanumeric string identifying the service. (required)
452 # @param int $version_id Integer identifying a service version. (required)
453 # @param string $logging_ftp_name The name for the real-time logging configuration. (required)
454 {
455 my $params = {
456 'service_id' => {
457 data_type => 'string',
458 description => 'Alphanumeric string identifying the service.',
459 required => '1',
460 },
461 'version_id' => {
462 data_type => 'int',
463 description => 'Integer identifying a service version.',
464 required => '1',
465 },
466 'logging_ftp_name' => {
467 data_type => 'string',
468 description => 'The name for the real-time logging configuration.',
469 required => '1',
470 },
471 };
472 __PACKAGE__->method_documentation->{ 'get_log_ftp' } = {
473 summary => 'Get an FTP log endpoint',
474 params => $params,
475 returns => 'LoggingFtpResponse',
476 };
477 }
478 # @return LoggingFtpResponse
479 #
480 sub get_log_ftp {
481 my ($self, %args) = @_;
482  
483 # verify the required parameter 'service_id' is set
484 unless (exists $args{'service_id'}) {
485 croak("Missing the required parameter 'service_id' when calling get_log_ftp");
486 }
487  
488 # verify the required parameter 'version_id' is set
489 unless (exists $args{'version_id'}) {
490 croak("Missing the required parameter 'version_id' when calling get_log_ftp");
491 }
492  
493 # verify the required parameter 'logging_ftp_name' is set
494 unless (exists $args{'logging_ftp_name'}) {
495 croak("Missing the required parameter 'logging_ftp_name' when calling get_log_ftp");
496 }
497  
498 # parse inputs
499 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/ftp/{logging_ftp_name}';
500  
501 my $_method = 'GET';
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('application/json');
508 if ($_header_accept) {
509 $header_params->{'Accept'} = $_header_accept;
510 }
511 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
512  
513 # path params
514 if ( exists $args{'service_id'}) {
515 my $_base_variable = "{" . "service_id" . "}";
516 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
517 $_resource_path =~ s/$_base_variable/$_base_value/g;
518 }
519  
520 # path params
521 if ( exists $args{'version_id'}) {
522 my $_base_variable = "{" . "version_id" . "}";
523 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
524 $_resource_path =~ s/$_base_variable/$_base_value/g;
525 }
526  
527 # path params
528 if ( exists $args{'logging_ftp_name'}) {
529 my $_base_variable = "{" . "logging_ftp_name" . "}";
530 my $_base_value = $self->{api_client}->to_path_value($args{'logging_ftp_name'});
531 $_resource_path =~ s/$_base_variable/$_base_value/g;
532 }
533  
534 my $_body_data;
535 # authentication setting, if any
536 my $auth_settings = [qw(token )];
537  
538 # make the API Call
539 my $response = $self->{api_client}->call_api($_resource_path, $_method,
540 $query_params, $form_params,
541 $header_params, $_body_data, $auth_settings);
542 if (!$response) {
543 return;
544 }
545 my $_response_object = $self->{api_client}->deserialize('LoggingFtpResponse', $response);
546 return $_response_object;
547 }
548  
549 #
550 # list_log_ftp
551 #
552 # List FTP log endpoints
553 #
554 # @param string $service_id Alphanumeric string identifying the service. (required)
555 # @param int $version_id Integer identifying a service version. (required)
556 {
557 my $params = {
558 'service_id' => {
559 data_type => 'string',
560 description => 'Alphanumeric string identifying the service.',
561 required => '1',
562 },
563 'version_id' => {
564 data_type => 'int',
565 description => 'Integer identifying a service version.',
566 required => '1',
567 },
568 };
569 __PACKAGE__->method_documentation->{ 'list_log_ftp' } = {
570 summary => 'List FTP log endpoints',
571 params => $params,
572 returns => 'ARRAY[LoggingFtpResponse]',
573 };
574 }
575 # @return ARRAY[LoggingFtpResponse]
576 #
577 sub list_log_ftp {
578 my ($self, %args) = @_;
579  
580 # verify the required parameter 'service_id' is set
581 unless (exists $args{'service_id'}) {
582 croak("Missing the required parameter 'service_id' when calling list_log_ftp");
583 }
584  
585 # verify the required parameter 'version_id' is set
586 unless (exists $args{'version_id'}) {
587 croak("Missing the required parameter 'version_id' when calling list_log_ftp");
588 }
589  
590 # parse inputs
591 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/ftp';
592  
593 my $_method = 'GET';
594 my $query_params = {};
595 my $header_params = {};
596 my $form_params = {};
597  
598 # 'Accept' and 'Content-Type' header
599 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
600 if ($_header_accept) {
601 $header_params->{'Accept'} = $_header_accept;
602 }
603 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
604  
605 # path params
606 if ( exists $args{'service_id'}) {
607 my $_base_variable = "{" . "service_id" . "}";
608 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
609 $_resource_path =~ s/$_base_variable/$_base_value/g;
610 }
611  
612 # path params
613 if ( exists $args{'version_id'}) {
614 my $_base_variable = "{" . "version_id" . "}";
615 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
616 $_resource_path =~ s/$_base_variable/$_base_value/g;
617 }
618  
619 my $_body_data;
620 # authentication setting, if any
621 my $auth_settings = [qw(token )];
622  
623 # make the API Call
624 my $response = $self->{api_client}->call_api($_resource_path, $_method,
625 $query_params, $form_params,
626 $header_params, $_body_data, $auth_settings);
627 if (!$response) {
628 return;
629 }
630 my $_response_object = $self->{api_client}->deserialize('ARRAY[LoggingFtpResponse]', $response);
631 return $_response_object;
632 }
633  
634 #
635 # update_log_ftp
636 #
637 # Update an FTP log endpoint
638 #
639 # @param string $service_id Alphanumeric string identifying the service. (required)
640 # @param int $version_id Integer identifying a service version. (required)
641 # @param string $logging_ftp_name The name for the real-time logging configuration. (required)
642 # @param string $name The name for the real-time logging configuration. (optional)
643 # @param string $placement Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. (optional)
644 # @param string $response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional)
645 # @param string $format A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/). (optional, default to '%h %l %u %t "%r" %>s %b')
646 # @param string $log_processing_region The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global. (optional, default to 'none')
647 # @param int $format_version The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. (optional, default to 2)
648 # @param string $message_type How the message should be formatted. (optional, default to 'blank')
649 # @param string $timestamp_format A timestamp format (optional)
650 # @param string $compression_codec The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional)
651 # @param int $period How frequently log files are finalized so they can be available for reading (in seconds). (optional, default to 3600)
652 # @param int $gzip_level The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error. (optional, default to 0)
653 # @param string $address An hostname or IPv4 address. (optional)
654 # @param string $hostname Hostname used. (optional)
655 # @param string $ipv4 IPv4 address of the host. (optional)
656 # @param string $password The password for the server. For anonymous use an email address. (optional)
657 # @param string $path The path to upload log files to. If the path ends in `/` then it is treated as a directory. (optional)
658 # @param string $public_key A PGP public key that Fastly will use to encrypt your log files before writing them to disk. (optional, default to 'null')
659 # @param string $user The username for the server. Can be anonymous. (optional)
660 # @param int $port The port number. (optional, default to 21)
661 {
662 my $params = {
663 'service_id' => {
664 data_type => 'string',
665 description => 'Alphanumeric string identifying the service.',
666 required => '1',
667 },
668 'version_id' => {
669 data_type => 'int',
670 description => 'Integer identifying a service version.',
671 required => '1',
672 },
673 'logging_ftp_name' => {
674 data_type => 'string',
675 description => 'The name for the real-time logging configuration.',
676 required => '1',
677 },
678 'name' => {
679 data_type => 'string',
680 description => 'The name for the real-time logging configuration.',
681 required => '0',
682 },
683 'placement' => {
684 data_type => 'string',
685 description => 'Where in the generated VCL the logging call should be placed. If not set, endpoints with `format_version` of 2 are placed in `vcl_log` and those with `format_version` of 1 are placed in `vcl_deliver`. ',
686 required => '0',
687 },
688 'response_condition' => {
689 data_type => 'string',
690 description => 'The name of an existing condition in the configured endpoint, or leave blank to always execute.',
691 required => '0',
692 },
693 'format' => {
694 data_type => 'string',
695 description => 'A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).',
696 required => '0',
697 },
698 'log_processing_region' => {
699 data_type => 'string',
700 description => 'The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.',
701 required => '0',
702 },
703 'format_version' => {
704 data_type => 'int',
705 description => 'The version of the custom logging format used for the configured endpoint. The logging call gets placed by default in `vcl_log` if `format_version` is set to `2` and in `vcl_deliver` if `format_version` is set to `1`. ',
706 required => '0',
707 },
708 'message_type' => {
709 data_type => 'string',
710 description => 'How the message should be formatted.',
711 required => '0',
712 },
713 'timestamp_format' => {
714 data_type => 'string',
715 description => 'A timestamp format',
716 required => '0',
717 },
718 'compression_codec' => {
719 data_type => 'string',
720 description => 'The codec used for compressing your logs. Valid values are `zstd`, `snappy`, and `gzip`. Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.',
721 required => '0',
722 },
723 'period' => {
724 data_type => 'int',
725 description => 'How frequently log files are finalized so they can be available for reading (in seconds).',
726 required => '0',
727 },
728 'gzip_level' => {
729 data_type => 'int',
730 description => 'The level of gzip encoding when sending logs (default `0`, no compression). Specifying both `compression_codec` and `gzip_level` in the same API request will result in an error.',
731 required => '0',
732 },
733 'address' => {
734 data_type => 'string',
735 description => 'An hostname or IPv4 address.',
736 required => '0',
737 },
738 'hostname' => {
739 data_type => 'string',
740 description => 'Hostname used.',
741 required => '0',
742 },
743 'ipv4' => {
744 data_type => 'string',
745 description => 'IPv4 address of the host.',
746 required => '0',
747 },
748 'password' => {
749 data_type => 'string',
750 description => 'The password for the server. For anonymous use an email address.',
751 required => '0',
752 },
753 'path' => {
754 data_type => 'string',
755 description => 'The path to upload log files to. If the path ends in `/` then it is treated as a directory.',
756 required => '0',
757 },
758 'public_key' => {
759 data_type => 'string',
760 description => 'A PGP public key that Fastly will use to encrypt your log files before writing them to disk.',
761 required => '0',
762 },
763 'user' => {
764 data_type => 'string',
765 description => 'The username for the server. Can be anonymous.',
766 required => '0',
767 },
768 'port' => {
769 data_type => 'int',
770 description => 'The port number.',
771 required => '0',
772 },
773 };
774 __PACKAGE__->method_documentation->{ 'update_log_ftp' } = {
775 summary => 'Update an FTP log endpoint',
776 params => $params,
777 returns => 'LoggingFtpResponse',
778 };
779 }
780 # @return LoggingFtpResponse
781 #
782 sub update_log_ftp {
783 my ($self, %args) = @_;
784  
785 # verify the required parameter 'service_id' is set
786 unless (exists $args{'service_id'}) {
787 croak("Missing the required parameter 'service_id' when calling update_log_ftp");
788 }
789  
790 # verify the required parameter 'version_id' is set
791 unless (exists $args{'version_id'}) {
792 croak("Missing the required parameter 'version_id' when calling update_log_ftp");
793 }
794  
795 # verify the required parameter 'logging_ftp_name' is set
796 unless (exists $args{'logging_ftp_name'}) {
797 croak("Missing the required parameter 'logging_ftp_name' when calling update_log_ftp");
798 }
799  
800 # parse inputs
801 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/ftp/{logging_ftp_name}';
802  
803 my $_method = 'PUT';
804 my $query_params = {};
805 my $header_params = {};
806 my $form_params = {};
807  
808 # 'Accept' and 'Content-Type' header
809 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
810 if ($_header_accept) {
811 $header_params->{'Accept'} = $_header_accept;
812 }
813 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
814  
815 # path params
816 if ( exists $args{'service_id'}) {
817 my $_base_variable = "{" . "service_id" . "}";
818 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
819 $_resource_path =~ s/$_base_variable/$_base_value/g;
820 }
821  
822 # path params
823 if ( exists $args{'version_id'}) {
824 my $_base_variable = "{" . "version_id" . "}";
825 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
826 $_resource_path =~ s/$_base_variable/$_base_value/g;
827 }
828  
829 # path params
830 if ( exists $args{'logging_ftp_name'}) {
831 my $_base_variable = "{" . "logging_ftp_name" . "}";
832 my $_base_value = $self->{api_client}->to_path_value($args{'logging_ftp_name'});
833 $_resource_path =~ s/$_base_variable/$_base_value/g;
834 }
835  
836 # form params
837 if ( exists $args{'name'} ) {
838 $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
839 }
840  
841 # form params
842 if ( exists $args{'placement'} ) {
843 $form_params->{'placement'} = $self->{api_client}->to_form_value($args{'placement'});
844 }
845  
846 # form params
847 if ( exists $args{'response_condition'} ) {
848 $form_params->{'response_condition'} = $self->{api_client}->to_form_value($args{'response_condition'});
849 }
850  
851 # form params
852 if ( exists $args{'format'} ) {
853 $form_params->{'format'} = $self->{api_client}->to_form_value($args{'format'});
854 }
855  
856 # form params
857 if ( exists $args{'log_processing_region'} ) {
858 $form_params->{'log_processing_region'} = $self->{api_client}->to_form_value($args{'log_processing_region'});
859 }
860  
861 # form params
862 if ( exists $args{'format_version'} ) {
863 $form_params->{'format_version'} = $self->{api_client}->to_form_value($args{'format_version'});
864 }
865  
866 # form params
867 if ( exists $args{'message_type'} ) {
868 $form_params->{'message_type'} = $self->{api_client}->to_form_value($args{'message_type'});
869 }
870  
871 # form params
872 if ( exists $args{'timestamp_format'} ) {
873 $form_params->{'timestamp_format'} = $self->{api_client}->to_form_value($args{'timestamp_format'});
874 }
875  
876 # form params
877 if ( exists $args{'compression_codec'} ) {
878 $form_params->{'compression_codec'} = $self->{api_client}->to_form_value($args{'compression_codec'});
879 }
880  
881 # form params
882 if ( exists $args{'period'} ) {
883 $form_params->{'period'} = $self->{api_client}->to_form_value($args{'period'});
884 }
885  
886 # form params
887 if ( exists $args{'gzip_level'} ) {
888 $form_params->{'gzip_level'} = $self->{api_client}->to_form_value($args{'gzip_level'});
889 }
890  
891 # form params
892 if ( exists $args{'address'} ) {
893 $form_params->{'address'} = $self->{api_client}->to_form_value($args{'address'});
894 }
895  
896 # form params
897 if ( exists $args{'hostname'} ) {
898 $form_params->{'hostname'} = $self->{api_client}->to_form_value($args{'hostname'});
899 }
900  
901 # form params
902 if ( exists $args{'ipv4'} ) {
903 $form_params->{'ipv4'} = $self->{api_client}->to_form_value($args{'ipv4'});
904 }
905  
906 # form params
907 if ( exists $args{'password'} ) {
908 $form_params->{'password'} = $self->{api_client}->to_form_value($args{'password'});
909 }
910  
911 # form params
912 if ( exists $args{'path'} ) {
913 $form_params->{'path'} = $self->{api_client}->to_form_value($args{'path'});
914 }
915  
916 # form params
917 if ( exists $args{'public_key'} ) {
918 $form_params->{'public_key'} = $self->{api_client}->to_form_value($args{'public_key'});
919 }
920  
921 # form params
922 if ( exists $args{'user'} ) {
923 $form_params->{'user'} = $self->{api_client}->to_form_value($args{'user'});
924 }
925  
926 # form params
927 if ( exists $args{'port'} ) {
928 $form_params->{'port'} = $self->{api_client}->to_form_value($args{'port'});
929 }
930  
931 my $_body_data;
932 # authentication setting, if any
933 my $auth_settings = [qw(token )];
934  
935 # make the API Call
936 my $response = $self->{api_client}->call_api($_resource_path, $_method,
937 $query_params, $form_params,
938 $header_params, $_body_data, $auth_settings);
939 if (!$response) {
940 return;
941 }
942 my $_response_object = $self->{api_client}->deserialize('LoggingFtpResponse', $response);
943 return $_response_object;
944 }
945  
946 1;