Fastly/ContentApi.pm untested

filter: Statementstmt 0.0% 0 / 58 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 88 CC 5 SCAR 19.9
CC
5
Cov
0%
content_check
20.0
new
6.0
BEGIN
2.0
CRAP 7.3
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::ContentApi;
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 # content_check
51 #
52 # Check status of content in each POP's cache
53 #
54 # @param string $url Full URL (host and path) to check on all nodes. if protocol is omitted, http will be assumed. (optional)
55 {
56 my $params = {
57 'url' => {
58 data_type => 'string',
59 description => 'Full URL (host and path) to check on all nodes. if protocol is omitted, http will be assumed.',
60 required => '0',
61 },
62 };
63 __PACKAGE__->method_documentation->{ 'content_check' } = {
64 summary => 'Check status of content in each POP's cache',
65 params => $params,
66 returns => 'ARRAY[Content]',
67 };
68 }
69 # @return ARRAY[Content]
70 #
71 sub content_check {
72 my ($self, %args) = @_;
73  
74 # parse inputs
75 my $_resource_path = '/content/edge_check';
76  
77 my $_method = 'GET';
78 my $query_params = {};
79 my $header_params = {};
80 my $form_params = {};
81  
82 # 'Accept' and 'Content-Type' header
83 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
84 if ($_header_accept) {
85 $header_params->{'Accept'} = $_header_accept;
86 }
87 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
88  
89 # query params
90 if ( exists $args{'url'}) {
91 $query_params->{'url'} = $self->{api_client}->to_query_value($args{'url'});
92 }
93  
94 my $_body_data;
95 # authentication setting, if any
96 my $auth_settings = [qw(token )];
97  
98 # make the API Call
99 my $response = $self->{api_client}->call_api($_resource_path, $_method,
100 $query_params, $form_params,
101 $header_params, $_body_data, $auth_settings);
102 if (!$response) {
103 return;
104 }
105 my $_response_object = $self->{api_client}->deserialize('ARRAY[Content]', $response);
106 return $_response_object;
107 }
108  
109 1;