Fastly/LogExplorerApi.pm untested

filter: Statementstmt 0.0% 0 / 74 Branchbran 0.0% 0 / 24 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 / 120 CC 13 SCAR 44.2
CC
13
Cov
0%
get_log_records
156.0
new
6.0
BEGIN
2.0
CRAP 82.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::LogExplorerApi;
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 # get_log_records
51 #
52 # Retrieve log records
53 #
54 # @param string $service_id (required)
55 # @param string $start (required)
56 # @param string $end (required)
57 # @param double $limit (optional)
58 # @param string $next_cursor (optional)
59 # @param string $filter (optional)
60 {
61 my $params = {
62 'service_id' => {
63 data_type => 'string',
64 description => '',
65 required => '1',
66 },
67 'start' => {
68 data_type => 'string',
69 description => '',
70 required => '1',
71 },
72 'end' => {
73 data_type => 'string',
74 description => '',
75 required => '1',
76 },
77 'limit' => {
78 data_type => 'double',
79 description => '',
80 required => '0',
81 },
82 'next_cursor' => {
83 data_type => 'string',
84 description => '',
85 required => '0',
86 },
87 'filter' => {
88 data_type => 'string',
89 description => '',
90 required => '0',
91 },
92 };
93 __PACKAGE__->method_documentation->{ 'get_log_records' } = {
94 summary => 'Retrieve log records',
95 params => $params,
96 returns => 'GetLogRecordsResponse',
97 };
98 }
99 # @return GetLogRecordsResponse
100 #
101 sub get_log_records {
102 my ($self, %args) = @_;
103  
104 # verify the required parameter 'service_id' is set
105 unless (exists $args{'service_id'}) {
106 croak("Missing the required parameter 'service_id' when calling get_log_records");
107 }
108  
109 # verify the required parameter 'start' is set
110 unless (exists $args{'start'}) {
111 croak("Missing the required parameter 'start' when calling get_log_records");
112 }
113  
114 # verify the required parameter 'end' is set
115 unless (exists $args{'end'}) {
116 croak("Missing the required parameter 'end' when calling get_log_records");
117 }
118  
119 # parse inputs
120 my $_resource_path = '/observability/log-explorer';
121  
122 my $_method = 'GET';
123 my $query_params = {};
124 my $header_params = {};
125 my $form_params = {};
126  
127 # 'Accept' and 'Content-Type' header
128 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
129 if ($_header_accept) {
130 $header_params->{'Accept'} = $_header_accept;
131 }
132 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
133  
134 # query params
135 if ( exists $args{'service_id'}) {
136 $query_params->{'service_id'} = $self->{api_client}->to_query_value($args{'service_id'});
137 }
138  
139 # query params
140 if ( exists $args{'start'}) {
141 $query_params->{'start'} = $self->{api_client}->to_query_value($args{'start'});
142 }
143  
144 # query params
145 if ( exists $args{'end'}) {
146 $query_params->{'end'} = $self->{api_client}->to_query_value($args{'end'});
147 }
148  
149 # query params
150 if ( exists $args{'limit'}) {
151 $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'});
152 }
153  
154 # query params
155 if ( exists $args{'next_cursor'}) {
156 $query_params->{'next_cursor'} = $self->{api_client}->to_query_value($args{'next_cursor'});
157 }
158  
159 # query params
160 if ( exists $args{'filter'}) {
161 $query_params->{'filter'} = $self->{api_client}->to_query_value($args{'filter'});
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('GetLogRecordsResponse', $response);
176 return $_response_object;
177 }
178  
179 1;