Fastly/ProductLogExplorerInsightsApi.pm untested

filter: Statementstmt 0.0% 0 / 136 Branchbran 0.0% 0 / 28 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 14 Podpod 0.0% 0 / 5 totaltotal 0.0% 0 / 192 CC 15 SCAR 27.7
CC
15
Cov
0%
enable_product_log_explorer_insights
30.0
get_product_log_explorer_insights
30.0
disable_product_log_explorer_insights
20.0
CRAP 15.9
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::ProductLogExplorerInsightsApi;
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_log_explorer_insights
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_log_explorer_insights' } = {
64 summary => 'Disable product',
65 params => $params,
66 returns => undef,
67 };
68 }
69 # @return void
70 #
71 sub disable_product_log_explorer_insights {
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_log_explorer_insights");
77 }
78  
79 # parse inputs
80 my $_resource_path = '/enabled-products/v1/log_explorer_insights/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_log_explorer_insights
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_log_explorer_insights' } = {
127 summary => 'Enable product',
128 params => $params,
129 returns => 'LogExplorerInsightsResponseBodyEnable',
130 };
131 }
132 # @return LogExplorerInsightsResponseBodyEnable
133 #
134 sub enable_product_log_explorer_insights {
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_log_explorer_insights");
140 }
141  
142 # parse inputs
143 my $_resource_path = '/enabled-products/v1/log_explorer_insights/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('LogExplorerInsightsResponseBodyEnable', $response);
176 return $_response_object;
177 }
178  
179 #
180 # get_product_log_explorer_insights
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_log_explorer_insights' } = {
194 summary => 'Get product enablement status',
195 params => $params,
196 returns => 'LogExplorerInsightsResponseBodyEnable',
197 };
198 }
199 # @return LogExplorerInsightsResponseBodyEnable
200 #
201 sub get_product_log_explorer_insights {
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_log_explorer_insights");
207 }
208  
209 # parse inputs
210 my $_resource_path = '/enabled-products/v1/log_explorer_insights/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('LogExplorerInsightsResponseBodyEnable', $response);
243 return $_response_object;
244 }
245  
246 #
247 # get_services_product_log_explorer_insights
248 #
249 # Get services with product enabled
250 #
251 {
252 my $params = {
253 };
254 __PACKAGE__->method_documentation->{ 'get_services_product_log_explorer_insights' } = {
255 summary => 'Get services with product enabled',
256 params => $params,
257 returns => 'LogExplorerInsightsResponseBodyGetAllServices',
258 };
259 }
260 # @return LogExplorerInsightsResponseBodyGetAllServices
261 #
262 sub get_services_product_log_explorer_insights {
263 my ($self, %args) = @_;
264  
265 # parse inputs
266 my $_resource_path = '/enabled-products/v1/log_explorer_insights/services';
267  
268 my $_method = 'GET';
269 my $query_params = {};
270 my $header_params = {};
271 my $form_params = {};
272  
273 # 'Accept' and 'Content-Type' header
274 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
275 if ($_header_accept) {
276 $header_params->{'Accept'} = $_header_accept;
277 }
278 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
279  
280 my $_body_data;
281 # authentication setting, if any
282 my $auth_settings = [qw(token )];
283  
284 # make the API Call
285 my $response = $self->{api_client}->call_api($_resource_path, $_method,
286 $query_params, $form_params,
287 $header_params, $_body_data, $auth_settings);
288 if (!$response) {
289 return;
290 }
291 my $_response_object = $self->{api_client}->deserialize('LogExplorerInsightsResponseBodyGetAllServices', $response);
292 return $_response_object;
293 }
294  
295 1;