Fastly/LoggingPubsubApi.pm untested

filter: Statementstmt 0.0% 0 / 266 Branchbran 0.0% 0 / 118 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 / 414 CC 60 SCAR 54.1
CC
60
Cov
0%
update_log_gcp_pubsub
420.0
create_log_gcp_pubsub
342.0
delete_log_gcp_pubsub
90.0
CRAP 224.3
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::LoggingPubsubApi;
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_gcp_pubsub
51 #
52 # Create a GCP Cloud Pub/Sub 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 $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)
63 # @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)
64 # @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)
65 # @param string $topic The Google Cloud Pub/Sub topic to which logs will be published. Required. (optional)
66 # @param string $project_id Your Google Cloud Platform project ID. Required (optional)
67 {
68 my $params = {
69 'service_id' => {
70 data_type => 'string',
71 description => 'Alphanumeric string identifying the service.',
72 required => '1',
73 },
74 'version_id' => {
75 data_type => 'int',
76 description => 'Integer identifying a service version.',
77 required => '1',
78 },
79 'name' => {
80 data_type => 'string',
81 description => 'The name for the real-time logging configuration.',
82 required => '0',
83 },
84 'placement' => {
85 data_type => 'string',
86 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`. ',
87 required => '0',
88 },
89 'response_condition' => {
90 data_type => 'string',
91 description => 'The name of an existing condition in the configured endpoint, or leave blank to always execute.',
92 required => '0',
93 },
94 'format' => {
95 data_type => 'string',
96 description => 'A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).',
97 required => '0',
98 },
99 'log_processing_region' => {
100 data_type => 'string',
101 description => 'The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.',
102 required => '0',
103 },
104 'format_version' => {
105 data_type => 'int',
106 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`. ',
107 required => '0',
108 },
109 'user' => {
110 data_type => 'string',
111 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.',
112 required => '0',
113 },
114 'secret_key' => {
115 data_type => 'string',
116 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.',
117 required => '0',
118 },
119 'account_name' => {
120 data_type => 'string',
121 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.',
122 required => '0',
123 },
124 'topic' => {
125 data_type => 'string',
126 description => 'The Google Cloud Pub/Sub topic to which logs will be published. Required.',
127 required => '0',
128 },
129 'project_id' => {
130 data_type => 'string',
131 description => 'Your Google Cloud Platform project ID. Required',
132 required => '0',
133 },
134 };
135 __PACKAGE__->method_documentation->{ 'create_log_gcp_pubsub' } = {
136 summary => 'Create a GCP Cloud Pub/Sub log endpoint',
137 params => $params,
138 returns => 'LoggingGooglePubsubResponse',
139 };
140 }
141 # @return LoggingGooglePubsubResponse
142 #
143 sub create_log_gcp_pubsub {
144 my ($self, %args) = @_;
145  
146 # verify the required parameter 'service_id' is set
147 unless (exists $args{'service_id'}) {
148 croak("Missing the required parameter 'service_id' when calling create_log_gcp_pubsub");
149 }
150  
151 # verify the required parameter 'version_id' is set
152 unless (exists $args{'version_id'}) {
153 croak("Missing the required parameter 'version_id' when calling create_log_gcp_pubsub");
154 }
155  
156 # parse inputs
157 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/pubsub';
158  
159 my $_method = 'POST';
160 my $query_params = {};
161 my $header_params = {};
162 my $form_params = {};
163  
164 # 'Accept' and 'Content-Type' header
165 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
166 if ($_header_accept) {
167 $header_params->{'Accept'} = $_header_accept;
168 }
169 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
170  
171 # path params
172 if ( exists $args{'service_id'}) {
173 my $_base_variable = "{" . "service_id" . "}";
174 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
175 $_resource_path =~ s/$_base_variable/$_base_value/g;
176 }
177  
178 # path params
179 if ( exists $args{'version_id'}) {
180 my $_base_variable = "{" . "version_id" . "}";
181 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
182 $_resource_path =~ s/$_base_variable/$_base_value/g;
183 }
184  
185 # form params
186 if ( exists $args{'name'} ) {
187 $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
188 }
189  
190 # form params
191 if ( exists $args{'placement'} ) {
192 $form_params->{'placement'} = $self->{api_client}->to_form_value($args{'placement'});
193 }
194  
195 # form params
196 if ( exists $args{'response_condition'} ) {
197 $form_params->{'response_condition'} = $self->{api_client}->to_form_value($args{'response_condition'});
198 }
199  
200 # form params
201 if ( exists $args{'format'} ) {
202 $form_params->{'format'} = $self->{api_client}->to_form_value($args{'format'});
203 }
204  
205 # form params
206 if ( exists $args{'log_processing_region'} ) {
207 $form_params->{'log_processing_region'} = $self->{api_client}->to_form_value($args{'log_processing_region'});
208 }
209  
210 # form params
211 if ( exists $args{'format_version'} ) {
212 $form_params->{'format_version'} = $self->{api_client}->to_form_value($args{'format_version'});
213 }
214  
215 # form params
216 if ( exists $args{'user'} ) {
217 $form_params->{'user'} = $self->{api_client}->to_form_value($args{'user'});
218 }
219  
220 # form params
221 if ( exists $args{'secret_key'} ) {
222 $form_params->{'secret_key'} = $self->{api_client}->to_form_value($args{'secret_key'});
223 }
224  
225 # form params
226 if ( exists $args{'account_name'} ) {
227 $form_params->{'account_name'} = $self->{api_client}->to_form_value($args{'account_name'});
228 }
229  
230 # form params
231 if ( exists $args{'topic'} ) {
232 $form_params->{'topic'} = $self->{api_client}->to_form_value($args{'topic'});
233 }
234  
235 # form params
236 if ( exists $args{'project_id'} ) {
237 $form_params->{'project_id'} = $self->{api_client}->to_form_value($args{'project_id'});
238 }
239  
240 my $_body_data;
241 # authentication setting, if any
242 my $auth_settings = [qw(token )];
243  
244 # make the API Call
245 my $response = $self->{api_client}->call_api($_resource_path, $_method,
246 $query_params, $form_params,
247 $header_params, $_body_data, $auth_settings);
248 if (!$response) {
249 return;
250 }
251 my $_response_object = $self->{api_client}->deserialize('LoggingGooglePubsubResponse', $response);
252 return $_response_object;
253 }
254  
255 #
256 # delete_log_gcp_pubsub
257 #
258 # Delete a GCP Cloud Pub/Sub log endpoint
259 #
260 # @param string $service_id Alphanumeric string identifying the service. (required)
261 # @param int $version_id Integer identifying a service version. (required)
262 # @param string $logging_google_pubsub_name The name for the real-time logging configuration. (required)
263 {
264 my $params = {
265 'service_id' => {
266 data_type => 'string',
267 description => 'Alphanumeric string identifying the service.',
268 required => '1',
269 },
270 'version_id' => {
271 data_type => 'int',
272 description => 'Integer identifying a service version.',
273 required => '1',
274 },
275 'logging_google_pubsub_name' => {
276 data_type => 'string',
277 description => 'The name for the real-time logging configuration.',
278 required => '1',
279 },
280 };
281 __PACKAGE__->method_documentation->{ 'delete_log_gcp_pubsub' } = {
282 summary => 'Delete a GCP Cloud Pub/Sub log endpoint',
283 params => $params,
284 returns => 'InlineResponse200',
285 };
286 }
287 # @return InlineResponse200
288 #
289 sub delete_log_gcp_pubsub {
290 my ($self, %args) = @_;
291  
292 # verify the required parameter 'service_id' is set
293 unless (exists $args{'service_id'}) {
294 croak("Missing the required parameter 'service_id' when calling delete_log_gcp_pubsub");
295 }
296  
297 # verify the required parameter 'version_id' is set
298 unless (exists $args{'version_id'}) {
299 croak("Missing the required parameter 'version_id' when calling delete_log_gcp_pubsub");
300 }
301  
302 # verify the required parameter 'logging_google_pubsub_name' is set
303 unless (exists $args{'logging_google_pubsub_name'}) {
304 croak("Missing the required parameter 'logging_google_pubsub_name' when calling delete_log_gcp_pubsub");
305 }
306  
307 # parse inputs
308 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/pubsub/{logging_google_pubsub_name}';
309  
310 my $_method = 'DELETE';
311 my $query_params = {};
312 my $header_params = {};
313 my $form_params = {};
314  
315 # 'Accept' and 'Content-Type' header
316 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
317 if ($_header_accept) {
318 $header_params->{'Accept'} = $_header_accept;
319 }
320 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
321  
322 # path params
323 if ( exists $args{'service_id'}) {
324 my $_base_variable = "{" . "service_id" . "}";
325 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
326 $_resource_path =~ s/$_base_variable/$_base_value/g;
327 }
328  
329 # path params
330 if ( exists $args{'version_id'}) {
331 my $_base_variable = "{" . "version_id" . "}";
332 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
333 $_resource_path =~ s/$_base_variable/$_base_value/g;
334 }
335  
336 # path params
337 if ( exists $args{'logging_google_pubsub_name'}) {
338 my $_base_variable = "{" . "logging_google_pubsub_name" . "}";
339 my $_base_value = $self->{api_client}->to_path_value($args{'logging_google_pubsub_name'});
340 $_resource_path =~ s/$_base_variable/$_base_value/g;
341 }
342  
343 my $_body_data;
344 # authentication setting, if any
345 my $auth_settings = [qw(token )];
346  
347 # make the API Call
348 my $response = $self->{api_client}->call_api($_resource_path, $_method,
349 $query_params, $form_params,
350 $header_params, $_body_data, $auth_settings);
351 if (!$response) {
352 return;
353 }
354 my $_response_object = $self->{api_client}->deserialize('InlineResponse200', $response);
355 return $_response_object;
356 }
357  
358 #
359 # get_log_gcp_pubsub
360 #
361 # Get a GCP Cloud Pub/Sub log endpoint
362 #
363 # @param string $service_id Alphanumeric string identifying the service. (required)
364 # @param int $version_id Integer identifying a service version. (required)
365 # @param string $logging_google_pubsub_name The name for the real-time logging configuration. (required)
366 {
367 my $params = {
368 'service_id' => {
369 data_type => 'string',
370 description => 'Alphanumeric string identifying the service.',
371 required => '1',
372 },
373 'version_id' => {
374 data_type => 'int',
375 description => 'Integer identifying a service version.',
376 required => '1',
377 },
378 'logging_google_pubsub_name' => {
379 data_type => 'string',
380 description => 'The name for the real-time logging configuration.',
381 required => '1',
382 },
383 };
384 __PACKAGE__->method_documentation->{ 'get_log_gcp_pubsub' } = {
385 summary => 'Get a GCP Cloud Pub/Sub log endpoint',
386 params => $params,
387 returns => 'LoggingGooglePubsubResponse',
388 };
389 }
390 # @return LoggingGooglePubsubResponse
391 #
392 sub get_log_gcp_pubsub {
393 my ($self, %args) = @_;
394  
395 # verify the required parameter 'service_id' is set
396 unless (exists $args{'service_id'}) {
397 croak("Missing the required parameter 'service_id' when calling get_log_gcp_pubsub");
398 }
399  
400 # verify the required parameter 'version_id' is set
401 unless (exists $args{'version_id'}) {
402 croak("Missing the required parameter 'version_id' when calling get_log_gcp_pubsub");
403 }
404  
405 # verify the required parameter 'logging_google_pubsub_name' is set
406 unless (exists $args{'logging_google_pubsub_name'}) {
407 croak("Missing the required parameter 'logging_google_pubsub_name' when calling get_log_gcp_pubsub");
408 }
409  
410 # parse inputs
411 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/pubsub/{logging_google_pubsub_name}';
412  
413 my $_method = 'GET';
414 my $query_params = {};
415 my $header_params = {};
416 my $form_params = {};
417  
418 # 'Accept' and 'Content-Type' header
419 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
420 if ($_header_accept) {
421 $header_params->{'Accept'} = $_header_accept;
422 }
423 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
424  
425 # path params
426 if ( exists $args{'service_id'}) {
427 my $_base_variable = "{" . "service_id" . "}";
428 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
429 $_resource_path =~ s/$_base_variable/$_base_value/g;
430 }
431  
432 # path params
433 if ( exists $args{'version_id'}) {
434 my $_base_variable = "{" . "version_id" . "}";
435 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
436 $_resource_path =~ s/$_base_variable/$_base_value/g;
437 }
438  
439 # path params
440 if ( exists $args{'logging_google_pubsub_name'}) {
441 my $_base_variable = "{" . "logging_google_pubsub_name" . "}";
442 my $_base_value = $self->{api_client}->to_path_value($args{'logging_google_pubsub_name'});
443 $_resource_path =~ s/$_base_variable/$_base_value/g;
444 }
445  
446 my $_body_data;
447 # authentication setting, if any
448 my $auth_settings = [qw(token )];
449  
450 # make the API Call
451 my $response = $self->{api_client}->call_api($_resource_path, $_method,
452 $query_params, $form_params,
453 $header_params, $_body_data, $auth_settings);
454 if (!$response) {
455 return;
456 }
457 my $_response_object = $self->{api_client}->deserialize('LoggingGooglePubsubResponse', $response);
458 return $_response_object;
459 }
460  
461 #
462 # list_log_gcp_pubsub
463 #
464 # List GCP Cloud Pub/Sub log endpoints
465 #
466 # @param string $service_id Alphanumeric string identifying the service. (required)
467 # @param int $version_id Integer identifying a service version. (required)
468 {
469 my $params = {
470 'service_id' => {
471 data_type => 'string',
472 description => 'Alphanumeric string identifying the service.',
473 required => '1',
474 },
475 'version_id' => {
476 data_type => 'int',
477 description => 'Integer identifying a service version.',
478 required => '1',
479 },
480 };
481 __PACKAGE__->method_documentation->{ 'list_log_gcp_pubsub' } = {
482 summary => 'List GCP Cloud Pub/Sub log endpoints',
483 params => $params,
484 returns => 'ARRAY[LoggingGooglePubsubResponse]',
485 };
486 }
487 # @return ARRAY[LoggingGooglePubsubResponse]
488 #
489 sub list_log_gcp_pubsub {
490 my ($self, %args) = @_;
491  
492 # verify the required parameter 'service_id' is set
493 unless (exists $args{'service_id'}) {
494 croak("Missing the required parameter 'service_id' when calling list_log_gcp_pubsub");
495 }
496  
497 # verify the required parameter 'version_id' is set
498 unless (exists $args{'version_id'}) {
499 croak("Missing the required parameter 'version_id' when calling list_log_gcp_pubsub");
500 }
501  
502 # parse inputs
503 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/pubsub';
504  
505 my $_method = 'GET';
506 my $query_params = {};
507 my $header_params = {};
508 my $form_params = {};
509  
510 # 'Accept' and 'Content-Type' header
511 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
512 if ($_header_accept) {
513 $header_params->{'Accept'} = $_header_accept;
514 }
515 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
516  
517 # path params
518 if ( exists $args{'service_id'}) {
519 my $_base_variable = "{" . "service_id" . "}";
520 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
521 $_resource_path =~ s/$_base_variable/$_base_value/g;
522 }
523  
524 # path params
525 if ( exists $args{'version_id'}) {
526 my $_base_variable = "{" . "version_id" . "}";
527 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
528 $_resource_path =~ s/$_base_variable/$_base_value/g;
529 }
530  
531 my $_body_data;
532 # authentication setting, if any
533 my $auth_settings = [qw(token )];
534  
535 # make the API Call
536 my $response = $self->{api_client}->call_api($_resource_path, $_method,
537 $query_params, $form_params,
538 $header_params, $_body_data, $auth_settings);
539 if (!$response) {
540 return;
541 }
542 my $_response_object = $self->{api_client}->deserialize('ARRAY[LoggingGooglePubsubResponse]', $response);
543 return $_response_object;
544 }
545  
546 #
547 # update_log_gcp_pubsub
548 #
549 # Update a GCP Cloud Pub/Sub log endpoint
550 #
551 # @param string $service_id Alphanumeric string identifying the service. (required)
552 # @param int $version_id Integer identifying a service version. (required)
553 # @param string $logging_google_pubsub_name The name for the real-time logging configuration. (required)
554 # @param string $name The name for the real-time logging configuration. (optional)
555 # @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)
556 # @param string $response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional)
557 # @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')
558 # @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')
559 # @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)
560 # @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)
561 # @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)
562 # @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)
563 # @param string $topic The Google Cloud Pub/Sub topic to which logs will be published. Required. (optional)
564 # @param string $project_id Your Google Cloud Platform project ID. Required (optional)
565 {
566 my $params = {
567 'service_id' => {
568 data_type => 'string',
569 description => 'Alphanumeric string identifying the service.',
570 required => '1',
571 },
572 'version_id' => {
573 data_type => 'int',
574 description => 'Integer identifying a service version.',
575 required => '1',
576 },
577 'logging_google_pubsub_name' => {
578 data_type => 'string',
579 description => 'The name for the real-time logging configuration.',
580 required => '1',
581 },
582 'name' => {
583 data_type => 'string',
584 description => 'The name for the real-time logging configuration.',
585 required => '0',
586 },
587 'placement' => {
588 data_type => 'string',
589 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`. ',
590 required => '0',
591 },
592 'response_condition' => {
593 data_type => 'string',
594 description => 'The name of an existing condition in the configured endpoint, or leave blank to always execute.',
595 required => '0',
596 },
597 'format' => {
598 data_type => 'string',
599 description => 'A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).',
600 required => '0',
601 },
602 'log_processing_region' => {
603 data_type => 'string',
604 description => 'The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.',
605 required => '0',
606 },
607 'format_version' => {
608 data_type => 'int',
609 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`. ',
610 required => '0',
611 },
612 'user' => {
613 data_type => 'string',
614 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.',
615 required => '0',
616 },
617 'secret_key' => {
618 data_type => 'string',
619 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.',
620 required => '0',
621 },
622 'account_name' => {
623 data_type => 'string',
624 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.',
625 required => '0',
626 },
627 'topic' => {
628 data_type => 'string',
629 description => 'The Google Cloud Pub/Sub topic to which logs will be published. Required.',
630 required => '0',
631 },
632 'project_id' => {
633 data_type => 'string',
634 description => 'Your Google Cloud Platform project ID. Required',
635 required => '0',
636 },
637 };
638 __PACKAGE__->method_documentation->{ 'update_log_gcp_pubsub' } = {
639 summary => 'Update a GCP Cloud Pub/Sub log endpoint',
640 params => $params,
641 returns => 'LoggingGooglePubsubResponse',
642 };
643 }
644 # @return LoggingGooglePubsubResponse
645 #
646 sub update_log_gcp_pubsub {
647 my ($self, %args) = @_;
648  
649 # verify the required parameter 'service_id' is set
650 unless (exists $args{'service_id'}) {
651 croak("Missing the required parameter 'service_id' when calling update_log_gcp_pubsub");
652 }
653  
654 # verify the required parameter 'version_id' is set
655 unless (exists $args{'version_id'}) {
656 croak("Missing the required parameter 'version_id' when calling update_log_gcp_pubsub");
657 }
658  
659 # verify the required parameter 'logging_google_pubsub_name' is set
660 unless (exists $args{'logging_google_pubsub_name'}) {
661 croak("Missing the required parameter 'logging_google_pubsub_name' when calling update_log_gcp_pubsub");
662 }
663  
664 # parse inputs
665 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/pubsub/{logging_google_pubsub_name}';
666  
667 my $_method = 'PUT';
668 my $query_params = {};
669 my $header_params = {};
670 my $form_params = {};
671  
672 # 'Accept' and 'Content-Type' header
673 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
674 if ($_header_accept) {
675 $header_params->{'Accept'} = $_header_accept;
676 }
677 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
678  
679 # path params
680 if ( exists $args{'service_id'}) {
681 my $_base_variable = "{" . "service_id" . "}";
682 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
683 $_resource_path =~ s/$_base_variable/$_base_value/g;
684 }
685  
686 # path params
687 if ( exists $args{'version_id'}) {
688 my $_base_variable = "{" . "version_id" . "}";
689 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
690 $_resource_path =~ s/$_base_variable/$_base_value/g;
691 }
692  
693 # path params
694 if ( exists $args{'logging_google_pubsub_name'}) {
695 my $_base_variable = "{" . "logging_google_pubsub_name" . "}";
696 my $_base_value = $self->{api_client}->to_path_value($args{'logging_google_pubsub_name'});
697 $_resource_path =~ s/$_base_variable/$_base_value/g;
698 }
699  
700 # form params
701 if ( exists $args{'name'} ) {
702 $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
703 }
704  
705 # form params
706 if ( exists $args{'placement'} ) {
707 $form_params->{'placement'} = $self->{api_client}->to_form_value($args{'placement'});
708 }
709  
710 # form params
711 if ( exists $args{'response_condition'} ) {
712 $form_params->{'response_condition'} = $self->{api_client}->to_form_value($args{'response_condition'});
713 }
714  
715 # form params
716 if ( exists $args{'format'} ) {
717 $form_params->{'format'} = $self->{api_client}->to_form_value($args{'format'});
718 }
719  
720 # form params
721 if ( exists $args{'log_processing_region'} ) {
722 $form_params->{'log_processing_region'} = $self->{api_client}->to_form_value($args{'log_processing_region'});
723 }
724  
725 # form params
726 if ( exists $args{'format_version'} ) {
727 $form_params->{'format_version'} = $self->{api_client}->to_form_value($args{'format_version'});
728 }
729  
730 # form params
731 if ( exists $args{'user'} ) {
732 $form_params->{'user'} = $self->{api_client}->to_form_value($args{'user'});
733 }
734  
735 # form params
736 if ( exists $args{'secret_key'} ) {
737 $form_params->{'secret_key'} = $self->{api_client}->to_form_value($args{'secret_key'});
738 }
739  
740 # form params
741 if ( exists $args{'account_name'} ) {
742 $form_params->{'account_name'} = $self->{api_client}->to_form_value($args{'account_name'});
743 }
744  
745 # form params
746 if ( exists $args{'topic'} ) {
747 $form_params->{'topic'} = $self->{api_client}->to_form_value($args{'topic'});
748 }
749  
750 # form params
751 if ( exists $args{'project_id'} ) {
752 $form_params->{'project_id'} = $self->{api_client}->to_form_value($args{'project_id'});
753 }
754  
755 my $_body_data;
756 # authentication setting, if any
757 my $auth_settings = [qw(token )];
758  
759 # make the API Call
760 my $response = $self->{api_client}->call_api($_resource_path, $_method,
761 $query_params, $form_params,
762 $header_params, $_body_data, $auth_settings);
763 if (!$response) {
764 return;
765 }
766 my $_response_object = $self->{api_client}->deserialize('LoggingGooglePubsubResponse', $response);
767 return $_response_object;
768 }
769  
770 1;