Fastly/LoggingSplunkApi.pm untested

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