Fastly/ObservabilityAggregationsForLogsApi.pm untested

filter: Statementstmt 0.0% 0 / 84 Branchbran 0.0% 0 / 34 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 / 140 CC 18 SCAR 52.3
CC
18
Cov
0%
log_aggregations_get
306.0
new
6.0
BEGIN
2.0
CRAP 186.9
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::ObservabilityAggregationsForLogsApi;
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 # log_aggregations_get
51 #
52 # Retrieve aggregated log results
53 #
54 # @param string $source (required)
55 # @param string $service_id (required)
56 # @param string $start (required)
57 # @param string $end (required)
58 # @param string $series (required)
59 # @param double $limit (optional)
60 # @param string $filter (optional)
61 # @param string $dimensions (optional)
62 # @param string $sort (optional)
63 {
64 my $params = {
65 'source' => {
66 data_type => 'string',
67 description => '',
68 required => '1',
69 },
70 'service_id' => {
71 data_type => 'string',
72 description => '',
73 required => '1',
74 },
75 'start' => {
76 data_type => 'string',
77 description => '',
78 required => '1',
79 },
80 'end' => {
81 data_type => 'string',
82 description => '',
83 required => '1',
84 },
85 'series' => {
86 data_type => 'string',
87 description => '',
88 required => '1',
89 },
90 'limit' => {
91 data_type => 'double',
92 description => '',
93 required => '0',
94 },
95 'filter' => {
96 data_type => 'string',
97 description => '',
98 required => '0',
99 },
100 'dimensions' => {
101 data_type => 'string',
102 description => '',
103 required => '0',
104 },
105 'sort' => {
106 data_type => 'string',
107 description => '',
108 required => '0',
109 },
110 };
111 __PACKAGE__->method_documentation->{ 'log_aggregations_get' } = {
112 summary => 'Retrieve aggregated log results',
113 params => $params,
114 returns => 'LogAggregationsGetResponse',
115 };
116 }
117 # @return LogAggregationsGetResponse
118 #
119 sub log_aggregations_get {
120 my ($self, %args) = @_;
121  
122 # verify the required parameter 'source' is set
123 unless (exists $args{'source'}) {
124 croak("Missing the required parameter 'source' when calling log_aggregations_get");
125 }
126  
127 # verify the required parameter 'service_id' is set
128 unless (exists $args{'service_id'}) {
129 croak("Missing the required parameter 'service_id' when calling log_aggregations_get");
130 }
131  
132 # verify the required parameter 'start' is set
133 unless (exists $args{'start'}) {
134 croak("Missing the required parameter 'start' when calling log_aggregations_get");
135 }
136  
137 # verify the required parameter 'end' is set
138 unless (exists $args{'end'}) {
139 croak("Missing the required parameter 'end' when calling log_aggregations_get");
140 }
141  
142 # verify the required parameter 'series' is set
143 unless (exists $args{'series'}) {
144 croak("Missing the required parameter 'series' when calling log_aggregations_get");
145 }
146  
147 # parse inputs
148 my $_resource_path = '/observability/aggregations';
149  
150 my $_method = 'GET';
151 my $query_params = {};
152 my $header_params = {};
153 my $form_params = {};
154  
155 # 'Accept' and 'Content-Type' header
156 my $_header_accept = $self->{api_client}->select_header_accept('application/json');
157 if ($_header_accept) {
158 $header_params->{'Accept'} = $_header_accept;
159 }
160 $header_params->{'Content-Type'} = $self->{api_client}->select_header_content_type();
161  
162 # query params
163 if ( exists $args{'source'}) {
164 $query_params->{'source'} = $self->{api_client}->to_query_value($args{'source'});
165 }
166  
167 # query params
168 if ( exists $args{'service_id'}) {
169 $query_params->{'service_id'} = $self->{api_client}->to_query_value($args{'service_id'});
170 }
171  
172 # query params
173 if ( exists $args{'start'}) {
174 $query_params->{'start'} = $self->{api_client}->to_query_value($args{'start'});
175 }
176  
177 # query params
178 if ( exists $args{'end'}) {
179 $query_params->{'end'} = $self->{api_client}->to_query_value($args{'end'});
180 }
181  
182 # query params
183 if ( exists $args{'limit'}) {
184 $query_params->{'limit'} = $self->{api_client}->to_query_value($args{'limit'});
185 }
186  
187 # query params
188 if ( exists $args{'filter'}) {
189 $query_params->{'filter'} = $self->{api_client}->to_query_value($args{'filter'});
190 }
191  
192 # query params
193 if ( exists $args{'series'}) {
194 $query_params->{'series'} = $self->{api_client}->to_query_value($args{'series'});
195 }
196  
197 # query params
198 if ( exists $args{'dimensions'}) {
199 $query_params->{'dimensions'} = $self->{api_client}->to_query_value($args{'dimensions'});
200 }
201  
202 # query params
203 if ( exists $args{'sort'}) {
204 $query_params->{'sort'} = $self->{api_client}->to_query_value($args{'sort'});
205 }
206  
207 my $_body_data;
208 # authentication setting, if any
209 my $auth_settings = [qw(token )];
210  
211 # make the API Call
212 my $response = $self->{api_client}->call_api($_resource_path, $_method,
213 $query_params, $form_params,
214 $header_params, $_body_data, $auth_settings);
215 if (!$response) {
216 return;
217 }
218 my $_response_object = $self->{api_client}->deserialize('LogAggregationsGetResponse', $response);
219 return $_response_object;
220 }
221  
222 1;