Fastly/ProductNgwafApi.pm untested

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