Fastly/TlsDomainsApi.pm untested

filter: Statementstmt 0.0% 0 / 70 Branchbran 0.0% 0 / 20 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 112 CC 11 SCAR 39.9
CC
11
Cov
0%
list_tls_domains
110.0
new
6.0
BEGIN
2.0
CRAP 53.8
1 =begin comment
2  
3 Fastly API
4  
5 Via the Fastly API you can perform any of the operations that are possible within the management console, including creating services, domains, and backends, configuring rules or uploading your own application code, as well as account operations such as user administration and billing reports. The API is organized into collections of endpoints that allow manipulation of objects related to Fastly services and accounts. For the most accurate and up-to-date API reference content, visit our [Developer Hub](https://www.fastly.com/documentation/reference/api/)
6  
7 The version of the API Spec document: 1.0.0
8 Contact: oss@fastly.com
9  
10 =end comment
11  
12 =cut
13  
14 #
15 # NOTE: This class is auto generated.
16 # Do not edit the class manually.
17 #
18 package WebService::Fastly::TlsDomainsApi;
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 # list_tls_domains
51 #
52 # List TLS domains
53 #
54 # @param string $filter[in_use] Optional. Limit the returned domains to those currently using Fastly to terminate TLS with SNI (that is, domains considered \"in use\") Permitted values: true, false. (optional)
55 # @param string $filter[tls_certificates/id] Optional. Limit the returned domains to those listed in the given TLS certificate's SAN list. (optional)
56 # @param string $filter[tls_subscriptions/id] Optional. Limit the returned domains to those for a given TLS subscription. (optional)
57 # @param string $include Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`, `tls_certificates`, `tls_subscriptions`, `tls_subscriptions.tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. (optional)
58 # @param string $sort The order in which to list the results. (optional, default to 'id')
59 # @param int $page[number] Current page. (optional)
60 # @param int $page[size] Number of records per page. (optional, default to 20)
61 {
62 my $params = {
63 'filter[in_use]' => {
64 data_type => 'string',
65 description => 'Optional. Limit the returned domains to those currently using Fastly to terminate TLS with SNI (that is, domains considered \"in use\") Permitted values: true, false.',
66 required => '0',
67 },
68 'filter[tls_certificates/id]' => {
69 data_type => 'string',
70 description => 'Optional. Limit the returned domains to those listed in the given TLS certificate's SAN list.',
71 required => '0',
72 },
73 'filter[tls_subscriptions/id]' => {
74 data_type => 'string',
75 description => 'Optional. Limit the returned domains to those for a given TLS subscription.',
76 required => '0',
77 },
78 'include' => {
79 data_type => 'string',
80 description => 'Include related objects. Optional, comma-separated values. Permitted values: `tls_activations`, `tls_certificates`, `tls_subscriptions`, `tls_subscriptions.tls_authorizations`, `tls_authorizations.globalsign_email_challenge`, and `tls_authorizations.self_managed_http_challenge`. ',
81 required => '0',
82 },
83 'sort' => {
84 data_type => 'string',
85 description => 'The order in which to list the results.',
86 required => '0',
87 },
88 'page[number]' => {
89 data_type => 'int',
90 description => 'Current page.',
91 required => '0',
92 },
93 'page[size]' => {
94 data_type => 'int',
95 description => 'Number of records per page.',
96 required => '0',
97 },
98 };
99 __PACKAGE__->method_documentation->{ 'list_tls_domains' } = {
100 summary => 'List TLS domains',
101 params => $params,
102 returns => 'TlsDomainsResponse',
103 };
104 }
105 # @return TlsDomainsResponse
106 #
107 sub list_tls_domains {
108 my ($self, %args) = @_;
109  
110 # parse inputs
111 my $_resource_path = '/tls/domains';
112  
113 my $_method = 'GET';
114 my $query_params = {};
115 my $header_params = {};
116 my $form_params = {};
117  
118 # 'Accept' and 'Content-Type' header
119 my $_header_accept = $self->{api_client}->select_header_accept('application/vnd.api+json');
120 if ($_header_accept) {
121 $header_params->{'Accept'} = $_header_accept;
122 }
123 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
124  
125 # query params
126 if ( exists $args{'filter[in_use]'}) {
127 $query_params->{'filter[in_use]'} = $self->{api_client}->to_query_value($args{'filter[in_use]'});
128 }
129  
130 # query params
131 if ( exists $args{'filter[tls_certificates/id]'}) {
132 $query_params->{'filter[tls_certificates.id]'} = $self->{api_client}->to_query_value($args{'filter[tls_certificates/id]'});
133 }
134  
135 # query params
136 if ( exists $args{'filter[tls_subscriptions/id]'}) {
137 $query_params->{'filter[tls_subscriptions.id]'} = $self->{api_client}->to_query_value($args{'filter[tls_subscriptions/id]'});
138 }
139  
140 # query params
141 if ( exists $args{'include'}) {
142 $query_params->{'include'} = $self->{api_client}->to_query_value($args{'include'});
143 }
144  
145 # query params
146 if ( exists $args{'sort'}) {
147 $query_params->{'sort'} = $self->{api_client}->to_query_value($args{'sort'});
148 }
149  
150 # query params
151 if ( exists $args{'page[number]'}) {
152 $query_params->{'page[number]'} = $self->{api_client}->to_query_value($args{'page[number]'});
153 }
154  
155 # query params
156 if ( exists $args{'page[size]'}) {
157 $query_params->{'page[size]'} = $self->{api_client}->to_query_value($args{'page[size]'});
158 }
159  
160 my $_body_data;
161 # authentication setting, if any
162 my $auth_settings = [qw(token )];
163  
164 # make the API Call
165 my $response = $self->{api_client}->call_api($_resource_path, $_method,
166 $query_params, $form_params,
167 $header_params, $_body_data, $auth_settings);
168 if (!$response) {
169 return;
170 }
171 my $_response_object = $self->{api_client}->deserialize('TlsDomainsResponse', $response);
172 return $_response_object;
173 }
174  
175 1;