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