Fastly/Http3Api.pm untested

filter: Statementstmt 0.0% 0 / 148 Branchbran 0.0% 0 / 50 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 224 CC 26 SCAR 44.3
CC
26
Cov
0%
create_http3
182.0
delete_http3
56.0
get_http3
56.0
CRAP 83.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::Http3Api;
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 # create_http3
51 #
52 # Enable support for HTTP/3
53 #
54 # @param string $service_id Alphanumeric string identifying the service. (required)
55 # @param int $version_id Integer identifying a service version. (required)
56 # @param string $service_id (optional)
57 # @param int $version (optional)
58 # @param DateTime $created_at Date and time in ISO 8601 format. (optional)
59 # @param DateTime $deleted_at Date and time in ISO 8601 format. (optional)
60 # @param DateTime $updated_at Date and time in ISO 8601 format. (optional)
61 # @param int $feature_revision Revision number of the HTTP/3 feature implementation. Defaults to the most recent revision. (optional)
62 {
63 my $params = {
64 'service_id' => {
65 data_type => 'string',
66 description => 'Alphanumeric string identifying the service.',
67 required => '1',
68 },
69 'version_id' => {
70 data_type => 'int',
71 description => 'Integer identifying a service version.',
72 required => '1',
73 },
74 'service_id' => {
75 data_type => 'string',
76 description => '',
77 required => '0',
78 },
79 'version' => {
80 data_type => 'int',
81 description => '',
82 required => '0',
83 },
84 'created_at' => {
85 data_type => 'DateTime',
86 description => 'Date and time in ISO 8601 format.',
87 required => '0',
88 },
89 'deleted_at' => {
90 data_type => 'DateTime',
91 description => 'Date and time in ISO 8601 format.',
92 required => '0',
93 },
94 'updated_at' => {
95 data_type => 'DateTime',
96 description => 'Date and time in ISO 8601 format.',
97 required => '0',
98 },
99 'feature_revision' => {
100 data_type => 'int',
101 description => 'Revision number of the HTTP/3 feature implementation. Defaults to the most recent revision.',
102 required => '0',
103 },
104 };
105 __PACKAGE__->method_documentation->{ 'create_http3' } = {
106 summary => 'Enable support for HTTP/3',
107 params => $params,
108 returns => 'Http3',
109 };
110 }
111 # @return Http3
112 #
113 sub create_http3 {
114 my ($self, %args) = @_;
115  
116 # verify the required parameter 'service_id' is set
117 unless (exists $args{'service_id'}) {
118 croak("Missing the required parameter 'service_id' when calling create_http3");
119 }
120  
121 # verify the required parameter 'version_id' is set
122 unless (exists $args{'version_id'}) {
123 croak("Missing the required parameter 'version_id' when calling create_http3");
124 }
125  
126 # parse inputs
127 my $_resource_path = '/service/{service_id}/version/{version_id}/http3';
128  
129 my $_method = 'POST';
130 my $query_params = {};
131 my $header_params = {};
132 my $form_params = {};
133  
134 # 'Accept' and 'Content-Type' header
135 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
136 if ($_header_accept) {
137 $header_params->{'Accept'} = $_header_accept;
138 }
139 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/x-www-form-urlencoded');
140  
141 # path params
142 if ( exists $args{'service_id'}) {
143 my $_base_variable = "{" . "service_id" . "}";
144 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
145 $_resource_path =~ s/$_base_variable/$_base_value/g;
146 }
147  
148 # path params
149 if ( exists $args{'version_id'}) {
150 my $_base_variable = "{" . "version_id" . "}";
151 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
152 $_resource_path =~ s/$_base_variable/$_base_value/g;
153 }
154  
155 # form params
156 if ( exists $args{'service_id'} ) {
157 $form_params->{'service_id'} = $self->{api_client}->to_form_value($args{'service_id'});
158 }
159  
160 # form params
161 if ( exists $args{'version'} ) {
162 $form_params->{'version'} = $self->{api_client}->to_form_value($args{'version'});
163 }
164  
165 # form params
166 if ( exists $args{'created_at'} ) {
167 $form_params->{'created_at'} = $self->{api_client}->to_form_value($args{'created_at'});
168 }
169  
170 # form params
171 if ( exists $args{'deleted_at'} ) {
172 $form_params->{'deleted_at'} = $self->{api_client}->to_form_value($args{'deleted_at'});
173 }
174  
175 # form params
176 if ( exists $args{'updated_at'} ) {
177 $form_params->{'updated_at'} = $self->{api_client}->to_form_value($args{'updated_at'});
178 }
179  
180 # form params
181 if ( exists $args{'feature_revision'} ) {
182 $form_params->{'feature_revision'} = $self->{api_client}->to_form_value($args{'feature_revision'});
183 }
184  
185 my $_body_data;
186 # authentication setting, if any
187 my $auth_settings = [qw(token )];
188  
189 # make the API Call
190 my $response = $self->{api_client}->call_api($_resource_path, $_method,
191 $query_params, $form_params,
192 $header_params, $_body_data, $auth_settings);
193 if (!$response) {
194 return;
195 }
196 my $_response_object = $self->{api_client}->deserialize('Http3', $response);
197 return $_response_object;
198 }
199  
200 #
201 # delete_http3
202 #
203 # Disable support for HTTP/3
204 #
205 # @param string $service_id Alphanumeric string identifying the service. (required)
206 # @param int $version_id Integer identifying a service version. (required)
207 {
208 my $params = {
209 'service_id' => {
210 data_type => 'string',
211 description => 'Alphanumeric string identifying the service.',
212 required => '1',
213 },
214 'version_id' => {
215 data_type => 'int',
216 description => 'Integer identifying a service version.',
217 required => '1',
218 },
219 };
220 __PACKAGE__->method_documentation->{ 'delete_http3' } = {
221 summary => 'Disable support for HTTP/3',
222 params => $params,
223 returns => 'InlineResponse200',
224 };
225 }
226 # @return InlineResponse200
227 #
228 sub delete_http3 {
229 my ($self, %args) = @_;
230  
231 # verify the required parameter 'service_id' is set
232 unless (exists $args{'service_id'}) {
233 croak("Missing the required parameter 'service_id' when calling delete_http3");
234 }
235  
236 # verify the required parameter 'version_id' is set
237 unless (exists $args{'version_id'}) {
238 croak("Missing the required parameter 'version_id' when calling delete_http3");
239 }
240  
241 # parse inputs
242 my $_resource_path = '/service/{service_id}/version/{version_id}/http3';
243  
244 my $_method = 'DELETE';
245 my $query_params = {};
246 my $header_params = {};
247 my $form_params = {};
248  
249 # 'Accept' and 'Content-Type' header
250 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
251 if ($_header_accept) {
252 $header_params->{'Accept'} = $_header_accept;
253 }
254 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
255  
256 # path params
257 if ( exists $args{'service_id'}) {
258 my $_base_variable = "{" . "service_id" . "}";
259 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
260 $_resource_path =~ s/$_base_variable/$_base_value/g;
261 }
262  
263 # path params
264 if ( exists $args{'version_id'}) {
265 my $_base_variable = "{" . "version_id" . "}";
266 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
267 $_resource_path =~ s/$_base_variable/$_base_value/g;
268 }
269  
270 my $_body_data;
271 # authentication setting, if any
272 my $auth_settings = [qw(token )];
273  
274 # make the API Call
275 my $response = $self->{api_client}->call_api($_resource_path, $_method,
276 $query_params, $form_params,
277 $header_params, $_body_data, $auth_settings);
278 if (!$response) {
279 return;
280 }
281 my $_response_object = $self->{api_client}->deserialize('InlineResponse200', $response);
282 return $_response_object;
283 }
284  
285 #
286 # get_http3
287 #
288 # Get HTTP/3 status
289 #
290 # @param string $service_id Alphanumeric string identifying the service. (required)
291 # @param int $version_id Integer identifying a service version. (required)
292 {
293 my $params = {
294 'service_id' => {
295 data_type => 'string',
296 description => 'Alphanumeric string identifying the service.',
297 required => '1',
298 },
299 'version_id' => {
300 data_type => 'int',
301 description => 'Integer identifying a service version.',
302 required => '1',
303 },
304 };
305 __PACKAGE__->method_documentation->{ 'get_http3' } = {
306 summary => 'Get HTTP/3 status',
307 params => $params,
308 returns => 'Http3',
309 };
310 }
311 # @return Http3
312 #
313 sub get_http3 {
314 my ($self, %args) = @_;
315  
316 # verify the required parameter 'service_id' is set
317 unless (exists $args{'service_id'}) {
318 croak("Missing the required parameter 'service_id' when calling get_http3");
319 }
320  
321 # verify the required parameter 'version_id' is set
322 unless (exists $args{'version_id'}) {
323 croak("Missing the required parameter 'version_id' when calling get_http3");
324 }
325  
326 # parse inputs
327 my $_resource_path = '/service/{service_id}/version/{version_id}/http3';
328  
329 my $_method = 'GET';
330 my $query_params = {};
331 my $header_params = {};
332 my $form_params = {};
333  
334 # 'Accept' and 'Content-Type' header
335 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
336 if ($_header_accept) {
337 $header_params->{'Accept'} = $_header_accept;
338 }
339 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
340  
341 # path params
342 if ( exists $args{'service_id'}) {
343 my $_base_variable = "{" . "service_id" . "}";
344 my $_base_value = $self->{api_client}->to_path_value($args{'service_id'});
345 $_resource_path =~ s/$_base_variable/$_base_value/g;
346 }
347  
348 # path params
349 if ( exists $args{'version_id'}) {
350 my $_base_variable = "{" . "version_id" . "}";
351 my $_base_value = $self->{api_client}->to_path_value($args{'version_id'});
352 $_resource_path =~ s/$_base_variable/$_base_value/g;
353 }
354  
355 my $_body_data;
356 # authentication setting, if any
357 my $auth_settings = [qw(token )];
358  
359 # make the API Call
360 my $response = $self->{api_client}->call_api($_resource_path, $_method,
361 $query_params, $form_params,
362 $header_params, $_body_data, $auth_settings);
363 if (!$response) {
364 return;
365 }
366 my $_response_object = $self->{api_client}->deserialize('Http3', $response);
367 return $_response_object;
368 }
369  
370 1;