Fastly/SecretStoreApi.pm untested

filter: Statementstmt 0.0% 0 / 181 Branchbran 0.0% 0 / 40 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 / 253 CC 21 SCAR 29.1
CC
21
Cov
0%
get_secret_stores
42.0
get_secret_store
30.0
create_secret_store
20.0
CRAP 18.4
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::SecretStoreApi;
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 # client_key
51 #
52 # Create new client key
53 #
54 {
55 my $params = {
56 };
57 __PACKAGE__->method_documentation->{ 'client_key' } = {
58 summary => 'Create new client key',
59 params => $params,
60 returns => 'ClientKey',
61 };
62 }
63 # @return ClientKey
64 #
65 sub client_key {
66 my ($self, %args) = @_;
67  
68 # parse inputs
69 my $_resource_path = '/resources/stores/secret/client-key';
70  
71 my $_method = 'POST';
72 my $query_params = {};
73 my $header_params = {};
74 my $form_params = {};
75  
76 # 'Accept' and 'Content-Type' header
77 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
78 if ($_header_accept) {
79 $header_params->{'Accept'} = $_header_accept;
80 }
81 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
82  
83 my $_body_data;
84 # authentication setting, if any
85 my $auth_settings = [qw(token )];
86  
87 # make the API Call
88 my $response = $self->{api_client}->call_api($_resource_path, $_method,
89 $query_params, $form_params,
90 $header_params, $_body_data, $auth_settings);
91 if (!$response) {
92 return;
93 }
94 my $_response_object = $self->{api_client}->deserialize('ClientKey', $response);
95 return $_response_object;
96 }
97  
98 #
99 # create_secret_store
100 #
101 # Create new secret store
102 #
103 # @param SecretStore $secret_store (optional)
104 {
105 my $params = {
106 'secret_store' => {
107 data_type => 'SecretStore',
108 description => '',
109 required => '0',
110 },
111 };
112 __PACKAGE__->method_documentation->{ 'create_secret_store' } = {
113 summary => 'Create new secret store',
114 params => $params,
115 returns => 'SecretStoreResponse',
116 };
117 }
118 # @return SecretStoreResponse
119 #
120 sub create_secret_store {
121 my ($self, %args) = @_;
122  
123 # parse inputs
124 my $_resource_path = '/resources/stores/secret';
125  
126 my $_method = 'POST';
127 my $query_params = {};
128 my $header_params = {};
129 my $form_params = {};
130  
131 # 'Accept' and 'Content-Type' header
132 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
133 if ($_header_accept) {
134 $header_params->{'Accept'} = $_header_accept;
135 }
136 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type('application/json');
137  
138 my $_body_data;
139 # body params
140 if ( exists $args{'secret_store'}) {
141 $_body_data = $args{'secret_store'};
142 }
143  
144 # authentication setting, if any
145 my $auth_settings = [qw(token )];
146  
147 # make the API Call
148 my $response = $self->{api_client}->call_api($_resource_path, $_method,
149 $query_params, $form_params,
150 $header_params, $_body_data, $auth_settings);
151 if (!$response) {
152 return;
153 }
154 my $_response_object = $self->{api_client}->deserialize('SecretStoreResponse', $response);
155 return $_response_object;
156 }
157  
158 #
159 # delete_secret_store
160 #
161 # Delete secret store
162 #
163 # @param string $store_id (required)
164 {
165 my $params = {
166 'store_id' => {
167 data_type => 'string',
168 description => '',
169 required => '1',
170 },
171 };
172 __PACKAGE__->method_documentation->{ 'delete_secret_store' } = {
173 summary => 'Delete secret store',
174 params => $params,
175 returns => undef,
176 };
177 }
178 # @return void
179 #
180 sub delete_secret_store {
181 my ($self, %args) = @_;
182  
183 # verify the required parameter 'store_id' is set
184 unless (exists $args{'store_id'}) {
185 croak("Missing the required parameter 'store_id' when calling delete_secret_store");
186 }
187  
188 # parse inputs
189 my $_resource_path = '/resources/stores/secret/{store_id}';
190  
191 my $_method = 'DELETE';
192 my $query_params = {};
193 my $header_params = {};
194 my $form_params = {};
195  
196 # 'Accept' and 'Content-Type' header
197 my $_header_accept = $self->{api_client}->select_header_accept();
198 if ($_header_accept) {
199 $header_params->{'Accept'} = $_header_accept;
200 }
201 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
202  
203 # path params
204 if ( exists $args{'store_id'}) {
205 my $_base_variable = "{" . "store_id" . "}";
206 my $_base_value = $self->{api_client}->to_path_value($args{'store_id'});
207 $_resource_path =~ s/$_base_variable/$_base_value/g;
208 }
209  
210 my $_body_data;
211 # authentication setting, if any
212 my $auth_settings = [qw(token )];
213  
214 # make the API Call
215 $self->{api_client}->call_api($_resource_path, $_method,
216 $query_params, $form_params,
217 $header_params, $_body_data, $auth_settings);
218 return;
219 }
220  
221 #
222 # get_secret_store
223 #
224 # Get secret store by ID
225 #
226 # @param string $store_id (required)
227 {
228 my $params = {
229 'store_id' => {
230 data_type => 'string',
231 description => '',
232 required => '1',
233 },
234 };
235 __PACKAGE__->method_documentation->{ 'get_secret_store' } = {
236 summary => 'Get secret store by ID',
237 params => $params,
238 returns => 'SecretStoreResponse',
239 };
240 }
241 # @return SecretStoreResponse
242 #
243 sub get_secret_store {
244 my ($self, %args) = @_;
245  
246 # verify the required parameter 'store_id' is set
247 unless (exists $args{'store_id'}) {
248 croak("Missing the required parameter 'store_id' when calling get_secret_store");
249 }
250  
251 # parse inputs
252 my $_resource_path = '/resources/stores/secret/{store_id}';
253  
254 my $_method = 'GET';
255 my $query_params = {};
256 my $header_params = {};
257 my $form_params = {};
258  
259 # 'Accept' and 'Content-Type' header
260 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
261 if ($_header_accept) {
262 $header_params->{'Accept'} = $_header_accept;
263 }
264 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
265  
266 # path params
267 if ( exists $args{'store_id'}) {
268 my $_base_variable = "{" . "store_id" . "}";
269 my $_base_value = $self->{api_client}->to_path_value($args{'store_id'});
270 $_resource_path =~ s/$_base_variable/$_base_value/g;
271 }
272  
273 my $_body_data;
274 # authentication setting, if any
275 my $auth_settings = [qw(token )];
276  
277 # make the API Call
278 my $response = $self->{api_client}->call_api($_resource_path, $_method,
279 $query_params, $form_params,
280 $header_params, $_body_data, $auth_settings);
281 if (!$response) {
282 return;
283 }
284 my $_response_object = $self->{api_client}->deserialize('SecretStoreResponse', $response);
285 return $_response_object;
286 }
287  
288 #
289 # get_secret_stores
290 #
291 # Get all secret stores
292 #
293 # @param string $cursor Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty. (optional)
294 # @param string $limit Number of results per page. The maximum is 200. (optional, default to '100')
295 # @param string $name Returns a one-element array containing the details for the named secret store. (optional)
296 {
297 my $params = {
298 'cursor' => {
299 data_type => 'string',
300 description => 'Cursor value from the `next_cursor` field of a previous response, used to retrieve the next page. To request the first page, this should be empty.',
301 required => '0',
302 },
303 'limit' => {
304 data_type => 'string',
305 description => 'Number of results per page. The maximum is 200.',
306 required => '0',
307 },
308 'name' => {
309 data_type => 'string',
310 description => 'Returns a one-element array containing the details for the named secret store.',
311 required => '0',
312 },
313 };
314 __PACKAGE__->method_documentation->{ 'get_secret_stores' } = {
315 summary => 'Get all secret stores',
316 params => $params,
317 returns => 'InlineResponse20020',
318 };
319 }
320 # @return InlineResponse20020
321 #
322 sub get_secret_stores {
323 my ($self, %args) = @_;
324  
325 # parse inputs
326 my $_resource_path = '/resources/stores/secret';
327  
328 my $_method = 'GET';
329 my $query_params = {};
330 my $header_params = {};
331 my $form_params = {};
332  
333 # 'Accept' and 'Content-Type' header
334 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
335 if ($_header_accept) {
336 $header_params->{'Accept'} = $_header_accept;
337 }
338 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
339  
340 # query params
341 if ( exists $args{'cursor'}) {
342 $query_params->{'cursor'} = $self->{api_client}->to_query_value($args{'cursor'});
343 }
344  
345 # query params
346 if ( exists $args{'limit'}) {
347 $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'});
348 }
349  
350 # query params
351 if ( exists $args{'name'}) {
352 $query_params->{'name'} = $self->{api_client}->to_query_value($args{'name'});
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('InlineResponse20020', $response);
367 return $_response_object;
368 }
369  
370 #
371 # signing_key
372 #
373 # Get public key
374 #
375 {
376 my $params = {
377 };
378 __PACKAGE__->method_documentation->{ 'signing_key' } = {
379 summary => 'Get public key',
380 params => $params,
381 returns => 'SigningKey',
382 };
383 }
384 # @return SigningKey
385 #
386 sub signing_key {
387 my ($self, %args) = @_;
388  
389 # parse inputs
390 my $_resource_path = '/resources/stores/secret/signing-key';
391  
392 my $_method = 'GET';
393 my $query_params = {};
394 my $header_params = {};
395 my $form_params = {};
396  
397 # 'Accept' and 'Content-Type' header
398 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
399 if ($_header_accept) {
400 $header_params->{'Accept'} = $_header_accept;
401 }
402 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
403  
404 my $_body_data;
405 # authentication setting, if any
406 my $auth_settings = [qw(token )];
407  
408 # make the API Call
409 my $response = $self->{api_client}->call_api($_resource_path, $_method,
410 $query_params, $form_params,
411 $header_params, $_body_data, $auth_settings);
412 if (!$response) {
413 return;
414 }
415 my $_response_object = $self->{api_client}->deserialize('SigningKey', $response);
416 return $_response_object;
417 }
418  
419 1;