Fastly/LoggingGcsApi.pm untested

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