Fastly/AiRuntimeControlProviderConnectionsApi.pm untested

filter: Statementstmt 0.0% 0 / 171 Branchbran 0.0% 0 / 44 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 15 Podpod 0.0% 0 / 6 totaltotal 0.0% 0 / 245 CC 23 SCAR 32.5
CC
23
Cov
0%
arc_update_provider_connection
56.0
arc_create_provider_connection
30.0
arc_get_provider_connection
30.0
CRAP 25.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::AiRuntimeControlProviderConnectionsApi;
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 # arc_create_provider_connection
51 #
52 # Create a provider connection
53 #
54 # @param ArcProviderConnectionRequest $arc_provider_connection_request (required)
55 {
56 my $params = {
57 'arc_provider_connection_request' => {
58 data_type => 'ArcProviderConnectionRequest',
59 description => '',
60 required => '1',
61 },
62 };
63 __PACKAGE__->method_documentation->{ 'arc_create_provider_connection' } = {
64 summary => 'Create a provider connection',
65 params => $params,
66 returns => 'ArcProviderConnectionResponse',
67 };
68 }
69 # @return ArcProviderConnectionResponse
70 #
71 sub arc_create_provider_connection {
72 my ($self, %args) = @_;
73  
74 # verify the required parameter 'arc_provider_connection_request' is set
75 unless (exists $args{'arc_provider_connection_request'}) {
76 croak("Missing the required parameter 'arc_provider_connection_request' when calling arc_create_provider_connection");
77 }
78  
79 # parse inputs
80 my $_resource_path = '/ai-runtime-control/v1/provider-connections';
81  
82 my $_method = 'POST';
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('application/json', 'application/problem+json');
89 if ($_header_accept) {
90 $header_params->{'Accept'} = $_header_accept;
91 }
92 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
93  
94 my $_body_data;
95 # body params
96 if ( exists $args{'arc_provider_connection_request'}) {
97 $_body_data = $args{'arc_provider_connection_request'};
98 }
99  
100 # authentication setting, if any
101 my $auth_settings = [qw(token )];
102  
103 # make the API Call
104 my $response = $self->{api_client}->call_api($_resource_path, $_method,
105 $query_params, $form_params,
106 $header_params, $_body_data, $auth_settings);
107 if (!$response) {
108 return;
109 }
110 my $_response_object = $self->{api_client}->deserialize('ArcProviderConnectionResponse', $response);
111 return $_response_object;
112 }
113  
114 #
115 # arc_delete_provider_connection
116 #
117 # Delete a provider connection
118 #
119 # @param string $id The ID of the provider connection. (required)
120 {
121 my $params = {
122 'id' => {
123 data_type => 'string',
124 description => 'The ID of the provider connection.',
125 required => '1',
126 },
127 };
128 __PACKAGE__->method_documentation->{ 'arc_delete_provider_connection' } = {
129 summary => 'Delete a provider connection',
130 params => $params,
131 returns => undef,
132 };
133 }
134 # @return void
135 #
136 sub arc_delete_provider_connection {
137 my ($self, %args) = @_;
138  
139 # verify the required parameter 'id' is set
140 unless (exists $args{'id'}) {
141 croak("Missing the required parameter 'id' when calling arc_delete_provider_connection");
142 }
143  
144 # parse inputs
145 my $_resource_path = '/ai-runtime-control/v1/provider-connections/{id}';
146  
147 my $_method = 'DELETE';
148 my $query_params = {};
149 my $header_params = {};
150 my $form_params = {};
151  
152 # 'Accept' and 'Content-Type' header
153 my $_header_accept = $self->{api_client}->select_header_accept('application/problem+json');
154 if ($_header_accept) {
155 $header_params->{'Accept'} = $_header_accept;
156 }
157 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
158  
159 # path params
160 if ( exists $args{'id'}) {
161 my $_base_variable = "{" . "id" . "}";
162 my $_base_value = $self->{api_client}->to_path_value($args{'id'});
163 $_resource_path =~ s/$_base_variable/$_base_value/g;
164 }
165  
166 my $_body_data;
167 # authentication setting, if any
168 my $auth_settings = [qw(token )];
169  
170 # make the API Call
171 $self->{api_client}->call_api($_resource_path, $_method,
172 $query_params, $form_params,
173 $header_params, $_body_data, $auth_settings);
174 return;
175 }
176  
177 #
178 # arc_get_provider_connection
179 #
180 # Get a provider connection
181 #
182 # @param string $id The ID of the provider connection. (required)
183 {
184 my $params = {
185 'id' => {
186 data_type => 'string',
187 description => 'The ID of the provider connection.',
188 required => '1',
189 },
190 };
191 __PACKAGE__->method_documentation->{ 'arc_get_provider_connection' } = {
192 summary => 'Get a provider connection',
193 params => $params,
194 returns => 'ArcGetProviderConnectionResponse',
195 };
196 }
197 # @return ArcGetProviderConnectionResponse
198 #
199 sub arc_get_provider_connection {
200 my ($self, %args) = @_;
201  
202 # verify the required parameter 'id' is set
203 unless (exists $args{'id'}) {
204 croak("Missing the required parameter 'id' when calling arc_get_provider_connection");
205 }
206  
207 # parse inputs
208 my $_resource_path = '/ai-runtime-control/v1/provider-connections/{id}';
209  
210 my $_method = 'GET';
211 my $query_params = {};
212 my $header_params = {};
213 my $form_params = {};
214  
215 # 'Accept' and 'Content-Type' header
216 my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json');
217 if ($_header_accept) {
218 $header_params->{'Accept'} = $_header_accept;
219 }
220 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
221  
222 # path params
223 if ( exists $args{'id'}) {
224 my $_base_variable = "{" . "id" . "}";
225 my $_base_value = $self->{api_client}->to_path_value($args{'id'});
226 $_resource_path =~ s/$_base_variable/$_base_value/g;
227 }
228  
229 my $_body_data;
230 # authentication setting, if any
231 my $auth_settings = [qw(token )];
232  
233 # make the API Call
234 my $response = $self->{api_client}->call_api($_resource_path, $_method,
235 $query_params, $form_params,
236 $header_params, $_body_data, $auth_settings);
237 if (!$response) {
238 return;
239 }
240 my $_response_object = $self->{api_client}->deserialize('ArcGetProviderConnectionResponse', $response);
241 return $_response_object;
242 }
243  
244 #
245 # arc_list_provider_connections
246 #
247 # List provider connections
248 #
249 # @param boolean $include_deleted Include deleted provider connections in the results. Deleted connections have a `deleted_at` value. (optional, default to false)
250 # @param string $sort Sort field. Prefix with `-` for descending order (e.g., `sort=-name`). (optional, default to 'created_at')
251 {
252 my $params = {
253 'include_deleted' => {
254 data_type => 'boolean',
255 description => 'Include deleted provider connections in the results. Deleted connections have a `deleted_at` value.',
256 required => '0',
257 },
258 'sort' => {
259 data_type => 'string',
260 description => 'Sort field. Prefix with `-` for descending order (e.g., `sort=-name`). ',
261 required => '0',
262 },
263 };
264 __PACKAGE__->method_documentation->{ 'arc_list_provider_connections' } = {
265 summary => 'List provider connections',
266 params => $params,
267 returns => 'ArcProviderConnectionsResponse',
268 };
269 }
270 # @return ArcProviderConnectionsResponse
271 #
272 sub arc_list_provider_connections {
273 my ($self, %args) = @_;
274  
275 # parse inputs
276 my $_resource_path = '/ai-runtime-control/v1/provider-connections';
277  
278 my $_method = 'GET';
279 my $query_params = {};
280 my $header_params = {};
281 my $form_params = {};
282  
283 # 'Accept' and 'Content-Type' header
284 my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json');
285 if ($_header_accept) {
286 $header_params->{'Accept'} = $_header_accept;
287 }
288 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
289  
290 # query params
291 if ( exists $args{'include_deleted'}) {
292 $query_params->{'include_deleted'} = $self->{api_client}->to_query_value($args{'include_deleted'});
293 }
294  
295 # query params
296 if ( exists $args{'sort'}) {
297 $query_params->{'sort'} = $self->{api_client}->to_query_value($args{'sort'});
298 }
299  
300 my $_body_data;
301 # authentication setting, if any
302 my $auth_settings = [qw(token )];
303  
304 # make the API Call
305 my $response = $self->{api_client}->call_api($_resource_path, $_method,
306 $query_params, $form_params,
307 $header_params, $_body_data, $auth_settings);
308 if (!$response) {
309 return;
310 }
311 my $_response_object = $self->{api_client}->deserialize('ArcProviderConnectionsResponse', $response);
312 return $_response_object;
313 }
314  
315 #
316 # arc_update_provider_connection
317 #
318 # Update a provider connection
319 #
320 # @param string $id The ID of the provider connection. (required)
321 # @param ArcUpdateProviderConnectionRequest $arc_update_provider_connection_request (required)
322 {
323 my $params = {
324 'id' => {
325 data_type => 'string',
326 description => 'The ID of the provider connection.',
327 required => '1',
328 },
329 'arc_update_provider_connection_request' => {
330 data_type => 'ArcUpdateProviderConnectionRequest',
331 description => '',
332 required => '1',
333 },
334 };
335 __PACKAGE__->method_documentation->{ 'arc_update_provider_connection' } = {
336 summary => 'Update a provider connection',
337 params => $params,
338 returns => 'ArcProviderConnectionResponse',
339 };
340 }
341 # @return ArcProviderConnectionResponse
342 #
343 sub arc_update_provider_connection {
344 my ($self, %args) = @_;
345  
346 # verify the required parameter 'id' is set
347 unless (exists $args{'id'}) {
348 croak("Missing the required parameter 'id' when calling arc_update_provider_connection");
349 }
350  
351 # verify the required parameter 'arc_update_provider_connection_request' is set
352 unless (exists $args{'arc_update_provider_connection_request'}) {
353 croak("Missing the required parameter 'arc_update_provider_connection_request' when calling arc_update_provider_connection");
354 }
355  
356 # parse inputs
357 my $_resource_path = '/ai-runtime-control/v1/provider-connections/{id}';
358  
359 my $_method = 'PATCH';
360 my $query_params = {};
361 my $header_params = {};
362 my $form_params = {};
363  
364 # 'Accept' and 'Content-Type' header
365 my $_header_accept = $self->{api_client}->select_header_accept('application/json', 'application/problem+json');
366 if ($_header_accept) {
367 $header_params->{'Accept'} = $_header_accept;
368 }
369 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
370  
371 # path params
372 if ( exists $args{'id'}) {
373 my $_base_variable = "{" . "id" . "}";
374 my $_base_value = $self->{api_client}->to_path_value($args{'id'});
375 $_resource_path =~ s/$_base_variable/$_base_value/g;
376 }
377  
378 my $_body_data;
379 # body params
380 if ( exists $args{'arc_update_provider_connection_request'}) {
381 $_body_data = $args{'arc_update_provider_connection_request'};
382 }
383  
384 # authentication setting, if any
385 my $auth_settings = [qw(token )];
386  
387 # make the API Call
388 my $response = $self->{api_client}->call_api($_resource_path, $_method,
389 $query_params, $form_params,
390 $header_params, $_body_data, $auth_settings);
391 if (!$response) {
392 return;
393 }
394 my $_response_object = $self->{api_client}->deserialize('ArcProviderConnectionResponse', $response);
395 return $_response_object;
396 }
397  
398 1;