Fastly/LoggingHttpsApi.pm untested

filter: Statementstmt 0.0% 0 / 302 Branchbran 0.0% 0 / 154 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 / 486 CC 78 SCAR 62.5
CC
78
Cov
0%
update_log_https
870.0
create_log_https
756.0
delete_log_https
90.0
CRAP 518.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::LoggingHttpsApi;
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_https
51 #
52 # Create an HTTPS 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` (10k). (optional, default to 0)
67 # @param int $request_max_bytes The maximum number of bytes sent in one request. Defaults `0` (100MB). (optional, default to 0)
68 # @param string $url The URL to send logs to. Must use HTTPS. Required. (optional)
69 # @param string $content_type Content type of the header sent with the request. (optional, default to 'null')
70 # @param string $header_name Name of the custom header sent with the request. (optional, default to 'null')
71 # @param LoggingMessageType $message_type (optional)
72 # @param string $header_value Value of the custom header sent with the request. (optional, default to 'null')
73 # @param string $method HTTP method used for request. (optional, default to 'POST')
74 # @param string $json_format Enforces valid JSON formatting for log entries. (optional)
75 # @param int $period How frequently, in seconds, batches of log data are sent to the HTTPS endpoint. A value of `0` sends logs at the same interval as the default, which is `5` seconds. (optional, default to 5)
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 'request_max_entries' => {
139 data_type => 'int',
140 description => 'The maximum number of logs sent in one request. Defaults `0` (10k).',
141 required => '0',
142 },
143 'request_max_bytes' => {
144 data_type => 'int',
145 description => 'The maximum number of bytes sent in one request. Defaults `0` (100MB).',
146 required => '0',
147 },
148 'url' => {
149 data_type => 'string',
150 description => 'The URL to send logs to. Must use HTTPS. Required.',
151 required => '0',
152 },
153 'content_type' => {
154 data_type => 'string',
155 description => 'Content type of the header sent with the request.',
156 required => '0',
157 },
158 'header_name' => {
159 data_type => 'string',
160 description => 'Name of the custom header sent with the request.',
161 required => '0',
162 },
163 'message_type' => {
164 data_type => 'LoggingMessageType',
165 description => '',
166 required => '0',
167 },
168 'header_value' => {
169 data_type => 'string',
170 description => 'Value of the custom header sent with the request.',
171 required => '0',
172 },
173 'method' => {
174 data_type => 'string',
175 description => 'HTTP method used for request.',
176 required => '0',
177 },
178 'json_format' => {
179 data_type => 'string',
180 description => 'Enforces valid JSON formatting for log entries.',
181 required => '0',
182 },
183 'period' => {
184 data_type => 'int',
185 description => 'How frequently, in seconds, batches of log data are sent to the HTTPS endpoint. A value of `0` sends logs at the same interval as the default, which is `5` seconds.',
186 required => '0',
187 },
188 };
189 __PACKAGE__->method_documentation->{ 'create_log_https' } = {
190 summary => 'Create an HTTPS log endpoint',
191 params => $params,
192 returns => 'LoggingHttpsResponse',
193 };
194 }
195 # @return LoggingHttpsResponse
196 #
197 sub create_log_https {
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_https");
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_https");
208 }
209  
210 # parse inputs
211 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/https';
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{'request_max_entries'} ) {
291 $form_params->{'request_max_entries'} = $self->{api_client}->to_form_value($args{'request_max_entries'});
292 }
293  
294 # form params
295 if ( exists $args{'request_max_bytes'} ) {
296 $form_params->{'request_max_bytes'} = $self->{api_client}->to_form_value($args{'request_max_bytes'});
297 }
298  
299 # form params
300 if ( exists $args{'url'} ) {
301 $form_params->{'url'} = $self->{api_client}->to_form_value($args{'url'});
302 }
303  
304 # form params
305 if ( exists $args{'content_type'} ) {
306 $form_params->{'content_type'} = $self->{api_client}->to_form_value($args{'content_type'});
307 }
308  
309 # form params
310 if ( exists $args{'header_name'} ) {
311 $form_params->{'header_name'} = $self->{api_client}->to_form_value($args{'header_name'});
312 }
313  
314 # form params
315 if ( exists $args{'message_type'} ) {
316 $form_params->{'message_type'} = $self->{api_client}->to_form_value($args{'message_type'});
317 }
318  
319 # form params
320 if ( exists $args{'header_value'} ) {
321 $form_params->{'header_value'} = $self->{api_client}->to_form_value($args{'header_value'});
322 }
323  
324 # form params
325 if ( exists $args{'method'} ) {
326 $form_params->{'method'} = $self->{api_client}->to_form_value($args{'method'});
327 }
328  
329 # form params
330 if ( exists $args{'json_format'} ) {
331 $form_params->{'json_format'} = $self->{api_client}->to_form_value($args{'json_format'});
332 }
333  
334 # form params
335 if ( exists $args{'period'} ) {
336 $form_params->{'period'} = $self->{api_client}->to_form_value($args{'period'});
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('LoggingHttpsResponse', $response);
351 return $_response_object;
352 }
353  
354 #
355 # delete_log_https
356 #
357 # Delete an HTTPS 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_https_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_https_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_https' } = {
381 summary => 'Delete an HTTPS log endpoint',
382 params => $params,
383 returns => 'InlineResponse200',
384 };
385 }
386 # @return InlineResponse200
387 #
388 sub delete_log_https {
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_https");
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_https");
399 }
400  
401 # verify the required parameter 'logging_https_name' is set
402 unless (exists $args{'logging_https_name'}) {
403 croak("Missing the required parameter 'logging_https_name' when calling delete_log_https");
404 }
405  
406 # parse inputs
407 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/https/{logging_https_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_https_name'}) {
437 my $_base_variable = "{" . "logging_https_name" . "}";
438 my $_base_value = $self->{api_client}->to_path_value($args{'logging_https_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_https
459 #
460 # Get an HTTPS 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_https_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_https_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_https' } = {
484 summary => 'Get an HTTPS log endpoint',
485 params => $params,
486 returns => 'LoggingHttpsResponse',
487 };
488 }
489 # @return LoggingHttpsResponse
490 #
491 sub get_log_https {
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_https");
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_https");
502 }
503  
504 # verify the required parameter 'logging_https_name' is set
505 unless (exists $args{'logging_https_name'}) {
506 croak("Missing the required parameter 'logging_https_name' when calling get_log_https");
507 }
508  
509 # parse inputs
510 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/https/{logging_https_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_https_name'}) {
540 my $_base_variable = "{" . "logging_https_name" . "}";
541 my $_base_value = $self->{api_client}->to_path_value($args{'logging_https_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('LoggingHttpsResponse', $response);
557 return $_response_object;
558 }
559  
560 #
561 # list_log_https
562 #
563 # List HTTPS 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_https' } = {
581 summary => 'List HTTPS log endpoints',
582 params => $params,
583 returns => 'ARRAY[LoggingHttpsResponse]',
584 };
585 }
586 # @return ARRAY[LoggingHttpsResponse]
587 #
588 sub list_log_https {
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_https");
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_https");
599 }
600  
601 # parse inputs
602 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/https';
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[LoggingHttpsResponse]', $response);
642 return $_response_object;
643 }
644  
645 #
646 # update_log_https
647 #
648 # Update an HTTPS 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_https_name The name for the real-time logging configuration. (required)
653 # @param string $name The name for the real-time logging configuration. (optional)
654 # @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)
655 # @param string $response_condition The name of an existing condition in the configured endpoint, or leave blank to always execute. (optional)
656 # @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')
657 # @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')
658 # @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)
659 # @param string $tls_ca_cert A secure certificate to authenticate a server with. Must be in PEM format. (optional, default to 'null')
660 # @param string $tls_client_cert The client certificate used to make authenticated requests. Must be in PEM format. (optional, default to 'null')
661 # @param string $tls_client_key The client private key used to make authenticated requests. Must be in PEM format. (optional, default to 'null')
662 # @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')
663 # @param int $request_max_entries The maximum number of logs sent in one request. Defaults `0` (10k). (optional, default to 0)
664 # @param int $request_max_bytes The maximum number of bytes sent in one request. Defaults `0` (100MB). (optional, default to 0)
665 # @param string $url The URL to send logs to. Must use HTTPS. Required. (optional)
666 # @param string $content_type Content type of the header sent with the request. (optional, default to 'null')
667 # @param string $header_name Name of the custom header sent with the request. (optional, default to 'null')
668 # @param LoggingMessageType $message_type (optional)
669 # @param string $header_value Value of the custom header sent with the request. (optional, default to 'null')
670 # @param string $method HTTP method used for request. (optional, default to 'POST')
671 # @param string $json_format Enforces valid JSON formatting for log entries. (optional)
672 # @param int $period How frequently, in seconds, batches of log data are sent to the HTTPS endpoint. A value of `0` sends logs at the same interval as the default, which is `5` seconds. (optional, default to 5)
673 {
674 my $params = {
675 'service_id' => {
676 data_type => 'string',
677 description => 'Alphanumeric string identifying the service.',
678 required => '1',
679 },
680 'version_id' => {
681 data_type => 'int',
682 description => 'Integer identifying a service version.',
683 required => '1',
684 },
685 'logging_https_name' => {
686 data_type => 'string',
687 description => 'The name for the real-time logging configuration.',
688 required => '1',
689 },
690 'name' => {
691 data_type => 'string',
692 description => 'The name for the real-time logging configuration.',
693 required => '0',
694 },
695 'placement' => {
696 data_type => 'string',
697 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`. ',
698 required => '0',
699 },
700 'response_condition' => {
701 data_type => 'string',
702 description => 'The name of an existing condition in the configured endpoint, or leave blank to always execute.',
703 required => '0',
704 },
705 'format' => {
706 data_type => 'string',
707 description => 'A Fastly [log format string](https://www.fastly.com/documentation/guides/integrations/streaming-logs/custom-log-formats/).',
708 required => '0',
709 },
710 'log_processing_region' => {
711 data_type => 'string',
712 description => 'The geographic region where the logs will be processed before streaming. Valid values are `us`, `eu`, and `none` for global.',
713 required => '0',
714 },
715 'format_version' => {
716 data_type => 'int',
717 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`. ',
718 required => '0',
719 },
720 'tls_ca_cert' => {
721 data_type => 'string',
722 description => 'A secure certificate to authenticate a server with. Must be in PEM format.',
723 required => '0',
724 },
725 'tls_client_cert' => {
726 data_type => 'string',
727 description => 'The client certificate used to make authenticated requests. Must be in PEM format.',
728 required => '0',
729 },
730 'tls_client_key' => {
731 data_type => 'string',
732 description => 'The client private key used to make authenticated requests. Must be in PEM format.',
733 required => '0',
734 },
735 'tls_hostname' => {
736 data_type => 'string',
737 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.',
738 required => '0',
739 },
740 'request_max_entries' => {
741 data_type => 'int',
742 description => 'The maximum number of logs sent in one request. Defaults `0` (10k).',
743 required => '0',
744 },
745 'request_max_bytes' => {
746 data_type => 'int',
747 description => 'The maximum number of bytes sent in one request. Defaults `0` (100MB).',
748 required => '0',
749 },
750 'url' => {
751 data_type => 'string',
752 description => 'The URL to send logs to. Must use HTTPS. Required.',
753 required => '0',
754 },
755 'content_type' => {
756 data_type => 'string',
757 description => 'Content type of the header sent with the request.',
758 required => '0',
759 },
760 'header_name' => {
761 data_type => 'string',
762 description => 'Name of the custom header sent with the request.',
763 required => '0',
764 },
765 'message_type' => {
766 data_type => 'LoggingMessageType',
767 description => '',
768 required => '0',
769 },
770 'header_value' => {
771 data_type => 'string',
772 description => 'Value of the custom header sent with the request.',
773 required => '0',
774 },
775 'method' => {
776 data_type => 'string',
777 description => 'HTTP method used for request.',
778 required => '0',
779 },
780 'json_format' => {
781 data_type => 'string',
782 description => 'Enforces valid JSON formatting for log entries.',
783 required => '0',
784 },
785 'period' => {
786 data_type => 'int',
787 description => 'How frequently, in seconds, batches of log data are sent to the HTTPS endpoint. A value of `0` sends logs at the same interval as the default, which is `5` seconds.',
788 required => '0',
789 },
790 };
791 __PACKAGE__->method_documentation->{ 'update_log_https' } = {
792 summary => 'Update an HTTPS log endpoint',
793 params => $params,
794 returns => 'LoggingHttpsResponse',
795 };
796 }
797 # @return LoggingHttpsResponse
798 #
799 sub update_log_https {
800 my ($self, %args) = @_;
801  
802 # verify the required parameter 'service_id' is set
803 unless (exists $args{'service_id'}) {
804 croak("Missing the required parameter 'service_id' when calling update_log_https");
805 }
806  
807 # verify the required parameter 'version_id' is set
808 unless (exists $args{'version_id'}) {
809 croak("Missing the required parameter 'version_id' when calling update_log_https");
810 }
811  
812 # verify the required parameter 'logging_https_name' is set
813 unless (exists $args{'logging_https_name'}) {
814 croak("Missing the required parameter 'logging_https_name' when calling update_log_https");
815 }
816  
817 # parse inputs
818 my $_resource_path = '/service/{service_id}/version/{version_id}/logging/https/{logging_https_name}';
819  
820 my $_method = 'PUT';
821 my $query_params = {};
822 my $header_params = {};
823 my $form_params = {};
824  
825 # 'Accept' and 'Content-Type' header
826 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
827 if ($_header_accept) {
828 $header_params->{'Accept'} = $_header_accept;
829 }
830 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
831  
832 # path params
833 if ( exists $args{'service_id'}) {
834 my $_base_variable = "{" . "service_id" . "}";
835 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
836 $_resource_path =~ s/$_base_variable/$_base_value/g;
837 }
838  
839 # path params
840 if ( exists $args{'version_id'}) {
841 my $_base_variable = "{" . "version_id" . "}";
842 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
843 $_resource_path =~ s/$_base_variable/$_base_value/g;
844 }
845  
846 # path params
847 if ( exists $args{'logging_https_name'}) {
848 my $_base_variable = "{" . "logging_https_name" . "}";
849 my $_base_value = $self->{api_client}->to_path_value($args{'logging_https_name'});
850 $_resource_path =~ s/$_base_variable/$_base_value/g;
851 }
852  
853 # form params
854 if ( exists $args{'name'} ) {
855 $form_params->{'name'} = $self->{api_client}->to_form_value($args{'name'});
856 }
857  
858 # form params
859 if ( exists $args{'placement'} ) {
860 $form_params->{'placement'} = $self->{api_client}->to_form_value($args{'placement'});
861 }
862  
863 # form params
864 if ( exists $args{'response_condition'} ) {
865 $form_params->{'response_condition'} = $self->{api_client}->to_form_value($args{'response_condition'});
866 }
867  
868 # form params
869 if ( exists $args{'format'} ) {
870 $form_params->{'format'} = $self->{api_client}->to_form_value($args{'format'});
871 }
872  
873 # form params
874 if ( exists $args{'log_processing_region'} ) {
875 $form_params->{'log_processing_region'} = $self->{api_client}->to_form_value($args{'log_processing_region'});
876 }
877  
878 # form params
879 if ( exists $args{'format_version'} ) {
880 $form_params->{'format_version'} = $self->{api_client}->to_form_value($args{'format_version'});
881 }
882  
883 # form params
884 if ( exists $args{'tls_ca_cert'} ) {
885 $form_params->{'tls_ca_cert'} = $self->{api_client}->to_form_value($args{'tls_ca_cert'});
886 }
887  
888 # form params
889 if ( exists $args{'tls_client_cert'} ) {
890 $form_params->{'tls_client_cert'} = $self->{api_client}->to_form_value($args{'tls_client_cert'});
891 }
892  
893 # form params
894 if ( exists $args{'tls_client_key'} ) {
895 $form_params->{'tls_client_key'} = $self->{api_client}->to_form_value($args{'tls_client_key'});
896 }
897  
898 # form params
899 if ( exists $args{'tls_hostname'} ) {
900 $form_params->{'tls_hostname'} = $self->{api_client}->to_form_value($args{'tls_hostname'});
901 }
902  
903 # form params
904 if ( exists $args{'request_max_entries'} ) {
905 $form_params->{'request_max_entries'} = $self->{api_client}->to_form_value($args{'request_max_entries'});
906 }
907  
908 # form params
909 if ( exists $args{'request_max_bytes'} ) {
910 $form_params->{'request_max_bytes'} = $self->{api_client}->to_form_value($args{'request_max_bytes'});
911 }
912  
913 # form params
914 if ( exists $args{'url'} ) {
915 $form_params->{'url'} = $self->{api_client}->to_form_value($args{'url'});
916 }
917  
918 # form params
919 if ( exists $args{'content_type'} ) {
920 $form_params->{'content_type'} = $self->{api_client}->to_form_value($args{'content_type'});
921 }
922  
923 # form params
924 if ( exists $args{'header_name'} ) {
925 $form_params->{'header_name'} = $self->{api_client}->to_form_value($args{'header_name'});
926 }
927  
928 # form params
929 if ( exists $args{'message_type'} ) {
930 $form_params->{'message_type'} = $self->{api_client}->to_form_value($args{'message_type'});
931 }
932  
933 # form params
934 if ( exists $args{'header_value'} ) {
935 $form_params->{'header_value'} = $self->{api_client}->to_form_value($args{'header_value'});
936 }
937  
938 # form params
939 if ( exists $args{'method'} ) {
940 $form_params->{'method'} = $self->{api_client}->to_form_value($args{'method'});
941 }
942  
943 # form params
944 if ( exists $args{'json_format'} ) {
945 $form_params->{'json_format'} = $self->{api_client}->to_form_value($args{'json_format'});
946 }
947  
948 # form params
949 if ( exists $args{'period'} ) {
950 $form_params->{'period'} = $self->{api_client}->to_form_value($args{'period'});
951 }
952  
953 my $_body_data;
954 # authentication setting, if any
955 my $auth_settings = [qw(token )];
956  
957 # make the API Call
958 my $response = $self->{api_client}->call_api($_resource_path, $_method,
959 $query_params, $form_params,
960 $header_params, $_body_data, $auth_settings);
961 if (!$response) {
962 return;
963 }
964 my $_response_object = $self->{api_client}->deserialize('LoggingHttpsResponse', $response);
965 return $_response_object;
966 }
967  
968 1;