Fastly/LoggingKafkaApi.pm untested

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