Fastly/ProductBotManagementApi.pm untested

filter: Statementstmt 0.0% 0 / 194 Branchbran 0.0% 0 / 46 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 16 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 272 CC 24 SCAR 30.8
CC
24
Cov
0%
set_product_bot_management_configuration
42.0
enable_product_bot_management
30.0
get_product_bot_management
30.0
CRAP 21.7
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::ProductBotManagementApi;
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 # disable_product_bot_management
51 #
52 # Disable product
53 #
54 # @param string $service_id Alphanumeric string identifying the service. (required)
55 {
56 my $params = {
57 'service_id' => {
58 data_type => 'string',
59 description => 'Alphanumeric string identifying the service.',
60 required => '1',
61 },
62 };
63 __PACKAGE__->method_documentation->{ 'disable_product_bot_management' } = {
64 summary => 'Disable product',
65 params => $params,
66 returns => undef,
67 };
68 }
69 # @return void
70 #
71 sub disable_product_bot_management {
72 my ($self, %args) = @_;
73  
74 # verify the required parameter 'service_id' is set
75 unless (exists $args{'service_id'}) {
76 croak("Missing the required parameter 'service_id' when calling disable_product_bot_management");
77 }
78  
79 # parse inputs
80 my $_resource_path = '/enabled-products/v1/bot_management/services/{service_id}';
81  
82 my $_method = 'DELETE';
83 my $query_params = {};
84 my $header_params = {};
85 my $form_params = {};
86  
87 # 'Accept' and 'Content-Type' header
88 my $_header_accept = $self->{api_client}->select_header_accept();
89 if ($_header_accept) {
90 $header_params->{'Accept'} = $_header_accept;
91 }
92 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
93  
94 # path params
95 if ( exists $args{'service_id'}) {
96 my $_base_variable = "{" . "service_id" . "}";
97 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
98 $_resource_path =~ s/$_base_variable/$_base_value/g;
99 }
100  
101 my $_body_data;
102 # authentication setting, if any
103 my $auth_settings = [qw(token )];
104  
105 # make the API Call
106 $self->{api_client}->call_api($_resource_path, $_method,
107 $query_params, $form_params,
108 $header_params, $_body_data, $auth_settings);
109 return;
110 }
111  
112 #
113 # enable_product_bot_management
114 #
115 # Enable product
116 #
117 # @param string $service_id Alphanumeric string identifying the service. (required)
118 {
119 my $params = {
120 'service_id' => {
121 data_type => 'string',
122 description => 'Alphanumeric string identifying the service.',
123 required => '1',
124 },
125 };
126 __PACKAGE__->method_documentation->{ 'enable_product_bot_management' } = {
127 summary => 'Enable product',
128 params => $params,
129 returns => 'BotManagementResponseBodyEnable',
130 };
131 }
132 # @return BotManagementResponseBodyEnable
133 #
134 sub enable_product_bot_management {
135 my ($self, %args) = @_;
136  
137 # verify the required parameter 'service_id' is set
138 unless (exists $args{'service_id'}) {
139 croak("Missing the required parameter 'service_id' when calling enable_product_bot_management");
140 }
141  
142 # parse inputs
143 my $_resource_path = '/enabled-products/v1/bot_management/services/{service_id}';
144  
145 my $_method = 'PUT';
146 my $query_params = {};
147 my $header_params = {};
148 my $form_params = {};
149  
150 # 'Accept' and 'Content-Type' header
151 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
152 if ($_header_accept) {
153 $header_params->{'Accept'} = $_header_accept;
154 }
155 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
156  
157 # path params
158 if ( exists $args{'service_id'}) {
159 my $_base_variable = "{" . "service_id" . "}";
160 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
161 $_resource_path =~ s/$_base_variable/$_base_value/g;
162 }
163  
164 my $_body_data;
165 # authentication setting, if any
166 my $auth_settings = [qw(token )];
167  
168 # make the API Call
169 my $response = $self->{api_client}->call_api($_resource_path, $_method,
170 $query_params, $form_params,
171 $header_params, $_body_data, $auth_settings);
172 if (!$response) {
173 return;
174 }
175 my $_response_object = $self->{api_client}->deserialize('BotManagementResponseBodyEnable', $response);
176 return $_response_object;
177 }
178  
179 #
180 # get_product_bot_management
181 #
182 # Get product enablement status
183 #
184 # @param string $service_id Alphanumeric string identifying the service. (required)
185 {
186 my $params = {
187 'service_id' => {
188 data_type => 'string',
189 description => 'Alphanumeric string identifying the service.',
190 required => '1',
191 },
192 };
193 __PACKAGE__->method_documentation->{ 'get_product_bot_management' } = {
194 summary => 'Get product enablement status',
195 params => $params,
196 returns => 'BotManagementResponseBodyEnable',
197 };
198 }
199 # @return BotManagementResponseBodyEnable
200 #
201 sub get_product_bot_management {
202 my ($self, %args) = @_;
203  
204 # verify the required parameter 'service_id' is set
205 unless (exists $args{'service_id'}) {
206 croak("Missing the required parameter 'service_id' when calling get_product_bot_management");
207 }
208  
209 # parse inputs
210 my $_resource_path = '/enabled-products/v1/bot_management/services/{service_id}';
211  
212 my $_method = 'GET';
213 my $query_params = {};
214 my $header_params = {};
215 my $form_params = {};
216  
217 # 'Accept' and 'Content-Type' header
218 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
219 if ($_header_accept) {
220 $header_params->{'Accept'} = $_header_accept;
221 }
222 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
223  
224 # path params
225 if ( exists $args{'service_id'}) {
226 my $_base_variable = "{" . "service_id" . "}";
227 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
228 $_resource_path =~ s/$_base_variable/$_base_value/g;
229 }
230  
231 my $_body_data;
232 # authentication setting, if any
233 my $auth_settings = [qw(token )];
234  
235 # make the API Call
236 my $response = $self->{api_client}->call_api($_resource_path, $_method,
237 $query_params, $form_params,
238 $header_params, $_body_data, $auth_settings);
239 if (!$response) {
240 return;
241 }
242 my $_response_object = $self->{api_client}->deserialize('BotManagementResponseBodyEnable', $response);
243 return $_response_object;
244 }
245  
246 #
247 # get_product_bot_management_configuration
248 #
249 # Get configuration
250 #
251 # @param string $service_id Alphanumeric string identifying the service. (required)
252 {
253 my $params = {
254 'service_id' => {
255 data_type => 'string',
256 description => 'Alphanumeric string identifying the service.',
257 required => '1',
258 },
259 };
260 __PACKAGE__->method_documentation->{ 'get_product_bot_management_configuration' } = {
261 summary => 'Get configuration',
262 params => $params,
263 returns => 'BotManagementResponseConfigure',
264 };
265 }
266 # @return BotManagementResponseConfigure
267 #
268 sub get_product_bot_management_configuration {
269 my ($self, %args) = @_;
270  
271 # verify the required parameter 'service_id' is set
272 unless (exists $args{'service_id'}) {
273 croak("Missing the required parameter 'service_id' when calling get_product_bot_management_configuration");
274 }
275  
276 # parse inputs
277 my $_resource_path = '/enabled-products/v1/bot_management/services/{service_id}/configuration';
278  
279 my $_method = 'GET';
280 my $query_params = {};
281 my $header_params = {};
282 my $form_params = {};
283  
284 # 'Accept' and 'Content-Type' header
285 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
286 if ($_header_accept) {
287 $header_params->{'Accept'} = $_header_accept;
288 }
289 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
290  
291 # path params
292 if ( exists $args{'service_id'}) {
293 my $_base_variable = "{" . "service_id" . "}";
294 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
295 $_resource_path =~ s/$_base_variable/$_base_value/g;
296 }
297  
298 my $_body_data;
299 # authentication setting, if any
300 my $auth_settings = [qw(token )];
301  
302 # make the API Call
303 my $response = $self->{api_client}->call_api($_resource_path, $_method,
304 $query_params, $form_params,
305 $header_params, $_body_data, $auth_settings);
306 if (!$response) {
307 return;
308 }
309 my $_response_object = $self->{api_client}->deserialize('BotManagementResponseConfigure', $response);
310 return $_response_object;
311 }
312  
313 #
314 # get_services_product_bot_management
315 #
316 # Get services with product enabled
317 #
318 {
319 my $params = {
320 };
321 __PACKAGE__->method_documentation->{ 'get_services_product_bot_management' } = {
322 summary => 'Get services with product enabled',
323 params => $params,
324 returns => 'BotManagementResponseBodyGetAllServices',
325 };
326 }
327 # @return BotManagementResponseBodyGetAllServices
328 #
329 sub get_services_product_bot_management {
330 my ($self, %args) = @_;
331  
332 # parse inputs
333 my $_resource_path = '/enabled-products/v1/bot_management/services';
334  
335 my $_method = 'GET';
336 my $query_params = {};
337 my $header_params = {};
338 my $form_params = {};
339  
340 # 'Accept' and 'Content-Type' header
341 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
342 if ($_header_accept) {
343 $header_params->{'Accept'} = $_header_accept;
344 }
345 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
346  
347 my $_body_data;
348 # authentication setting, if any
349 my $auth_settings = [qw(token )];
350  
351 # make the API Call
352 my $response = $self->{api_client}->call_api($_resource_path, $_method,
353 $query_params, $form_params,
354 $header_params, $_body_data, $auth_settings);
355 if (!$response) {
356 return;
357 }
358 my $_response_object = $self->{api_client}->deserialize('BotManagementResponseBodyGetAllServices', $response);
359 return $_response_object;
360 }
361  
362 #
363 # set_product_bot_management_configuration
364 #
365 # Update configuration
366 #
367 # @param string $service_id Alphanumeric string identifying the service. (required)
368 # @param BotManagementRequestUpdateConfiguration $bot_management_request_update_configuration (optional)
369 {
370 my $params = {
371 'service_id' => {
372 data_type => 'string',
373 description => 'Alphanumeric string identifying the service.',
374 required => '1',
375 },
376 'bot_management_request_update_configuration' => {
377 data_type => 'BotManagementRequestUpdateConfiguration',
378 description => '',
379 required => '0',
380 },
381 };
382 __PACKAGE__->method_documentation->{ 'set_product_bot_management_configuration' } = {
383 summary => 'Update configuration',
384 params => $params,
385 returns => 'BotManagementResponseConfigure',
386 };
387 }
388 # @return BotManagementResponseConfigure
389 #
390 sub set_product_bot_management_configuration {
391 my ($self, %args) = @_;
392  
393 # verify the required parameter 'service_id' is set
394 unless (exists $args{'service_id'}) {
395 croak("Missing the required parameter 'service_id' when calling set_product_bot_management_configuration");
396 }
397  
398 # parse inputs
399 my $_resource_path = '/enabled-products/v1/bot_management/services/{service_id}/configuration';
400  
401 my $_method = 'PATCH';
402 my $query_params = {};
403 my $header_params = {};
404 my $form_params = {};
405  
406 # 'Accept' and 'Content-Type' header
407 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
408 if ($_header_accept) {
409 $header_params->{'Accept'} = $_header_accept;
410 }
411 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
412  
413 # path params
414 if ( exists $args{'service_id'}) {
415 my $_base_variable = "{" . "service_id" . "}";
416 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
417 $_resource_path =~ s/$_base_variable/$_base_value/g;
418 }
419  
420 my $_body_data;
421 # body params
422 if ( exists $args{'bot_management_request_update_configuration'}) {
423 $_body_data = $args{'bot_management_request_update_configuration'};
424 }
425  
426 # authentication setting, if any
427 my $auth_settings = [qw(token )];
428  
429 # make the API Call
430 my $response = $self->{api_client}->call_api($_resource_path, $_method,
431 $query_params, $form_params,
432 $header_params, $_body_data, $auth_settings);
433 if (!$response) {
434 return;
435 }
436 my $_response_object = $self->{api_client}->deserialize('BotManagementResponseConfigure', $response);
437 return $_response_object;
438 }
439  
440 1;