Fastly/DomainResearchApi.pm untested

filter: Statementstmt 0.0% 0 / 96 Branchbran 0.0% 0 / 28 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 12 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 148 CC 15 SCAR 37.4
CC
15
Cov
0%
suggest_domains
90.0
domain_status
42.0
new
6.0
CRAP 42.0
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::DomainResearchApi;
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 # domain_status
51 #
52 # Domain status
53 #
54 # @param string $domain (required)
55 # @param string $scope (optional)
56 {
57 my $params = {
58 'domain' => {
59 data_type => 'string',
60 description => '',
61 required => '1',
62 },
63 'scope' => {
64 data_type => 'string',
65 description => '',
66 required => '0',
67 },
68 };
69 __PACKAGE__->method_documentation->{ 'domain_status' } = {
70 summary => 'Domain status',
71 params => $params,
72 returns => 'Status',
73 };
74 }
75 # @return Status
76 #
77 sub domain_status {
78 my ($self, %args) = @_;
79  
80 # verify the required parameter 'domain' is set
81 unless (exists $args{'domain'}) {
82 croak("Missing the required parameter 'domain' when calling domain_status");
83 }
84  
85 # parse inputs
86 my $_resource_path = '/domain-management/v1/tools/status';
87  
88 my $_method = 'GET';
89 my $query_params = {};
90 my $header_params = {};
91 my $form_params = {};
92  
93 # 'Accept' and 'Content-Type' header
94 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
95 if ($_header_accept) {
96 $header_params->{'Accept'} = $_header_accept;
97 }
98 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
99  
100 # query params
101 if ( exists $args{'domain'}) {
102 $query_params->{'domain'} = $self->{api_client}->to_query_value($args{'domain'});
103 }
104  
105 # query params
106 if ( exists $args{'scope'}) {
107 $query_params->{'scope'} = $self->{api_client}->to_query_value($args{'scope'});
108 }
109  
110 my $_body_data;
111 # authentication setting, if any
112 my $auth_settings = [qw(token )];
113  
114 # make the API Call
115 my $response = $self->{api_client}->call_api($_resource_path, $_method,
116 $query_params, $form_params,
117 $header_params, $_body_data, $auth_settings);
118 if (!$response) {
119 return;
120 }
121 my $_response_object = $self->{api_client}->deserialize('Status', $response);
122 return $_response_object;
123 }
124  
125 #
126 # suggest_domains
127 #
128 # Suggest domains
129 #
130 # @param string $query (required)
131 # @param string $defaults (optional)
132 # @param string $keywords (optional)
133 # @param string $location (optional)
134 # @param string $vendor (optional)
135 {
136 my $params = {
137 'query' => {
138 data_type => 'string',
139 description => '',
140 required => '1',
141 },
142 'defaults' => {
143 data_type => 'string',
144 description => '',
145 required => '0',
146 },
147 'keywords' => {
148 data_type => 'string',
149 description => '',
150 required => '0',
151 },
152 'location' => {
153 data_type => 'string',
154 description => '',
155 required => '0',
156 },
157 'vendor' => {
158 data_type => 'string',
159 description => '',
160 required => '0',
161 },
162 };
163 __PACKAGE__->method_documentation->{ 'suggest_domains' } = {
164 summary => 'Suggest domains',
165 params => $params,
166 returns => 'InlineResponse20016',
167 };
168 }
169 # @return InlineResponse20016
170 #
171 sub suggest_domains {
172 my ($self, %args) = @_;
173  
174 # verify the required parameter 'query' is set
175 unless (exists $args{'query'}) {
176 croak("Missing the required parameter 'query' when calling suggest_domains");
177 }
178  
179 # parse inputs
180 my $_resource_path = '/domain-management/v1/tools/suggest';
181  
182 my $_method = 'GET';
183 my $query_params = {};
184 my $header_params = {};
185 my $form_params = {};
186  
187 # 'Accept' and 'Content-Type' header
188 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
189 if ($_header_accept) {
190 $header_params->{'Accept'} = $_header_accept;
191 }
192 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
193  
194 # query params
195 if ( exists $args{'query'}) {
196 $query_params->{'query'} = $self->{api_client}->to_query_value($args{'query'});
197 }
198  
199 # query params
200 if ( exists $args{'defaults'}) {
201 $query_params->{'defaults'} = $self->{api_client}->to_query_value($args{'defaults'});
202 }
203  
204 # query params
205 if ( exists $args{'keywords'}) {
206 $query_params->{'keywords'} = $self->{api_client}->to_query_value($args{'keywords'});
207 }
208  
209 # query params
210 if ( exists $args{'location'}) {
211 $query_params->{'location'} = $self->{api_client}->to_query_value($args{'location'});
212 }
213  
214 # query params
215 if ( exists $args{'vendor'}) {
216 $query_params->{'vendor'} = $self->{api_client}->to_query_value($args{'vendor'});
217 }
218  
219 my $_body_data;
220 # authentication setting, if any
221 my $auth_settings = [qw(token )];
222  
223 # make the API Call
224 my $response = $self->{api_client}->call_api($_resource_path, $_method,
225 $query_params, $form_params,
226 $header_params, $_body_data, $auth_settings);
227 if (!$response) {
228 return;
229 }
230 my $_response_object = $self->{api_client}->deserialize('InlineResponse20016', $response);
231 return $_response_object;
232 }
233  
234 1;