Fastly/ObservabilityTimeseriesApi.pm untested

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