blib/lib/Paws/Pricing.pm

filter: Statementstmt 15.1% 12 / 79 Branchbran 0.0% 0 / 24 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 33.3% 5 / 15 Podpod 50.0% 6 / 12 totaltotal 17.6% 23 / 130 CC 19 SCAR 35.9
CC
19
Cov
12%
DescribeAllServices
56.0
GetAllAttributeValues
56.0
GetAllProducts
56.0
CRAP 36.2
« blib/lib/Paws/RDS.pm ↑ Summary blib/lib/Paws/RedShift.pm »
1 package Paws::Pricing;
2 1 ▶ use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶ sub service { 'api.pricing' }
Subroutine service: called CC=1 SCAR=0.0
Pod undocumented
4 1 ▶ sub signing_name { 'pricing' }
Subroutine signing_name: called CC=1 SCAR=0.0
Pod undocumented
5 0 ▶ sub version { '2017-10-15' }
Subroutine version: not called CC=1 SCAR=6.9
Pod undocumented
6 0 ▶ sub target_prefix { 'AWSPriceListService' }
Subroutine target_prefix: not called CC=1 SCAR=6.9
Pod undocumented
7 0 ▶ sub json_version { "1.1" }
Subroutine json_version: not called CC=1 SCAR=6.9
Pod undocumented
8 1 has max_attempts => (is => 'ro', isa => 'Int', default => 5);
9 1 ▶ has retry => (is => 'ro', isa => 'HashRef', default => sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
10 1 { base => 'rand', type => 'exponential', growth_factor => 2 }
11 1 });
12 1 ▶ has retriables => (is => 'ro', isa => 'ArrayRef', default => sub { [
Subroutine __ANON__: called CC=1 SCAR=0.0
13 1 ] });
14  
15 1 with 'Paws::API::Caller', 'Paws::API::EndpointResolver', 'Paws::Net::V4Signature', 'Paws::Net::JsonCaller';
16  
17
18 0 ▶ sub DescribeServices {
Subroutine DescribeServices: not called CC=1 SCAR=6.9
Pod documented
19 0 my $self = shift;
20 0 my $call_object = $self->new_with_coercions('Paws::Pricing::DescribeServices', @_);
21 0 return $self->caller->do_call($self, $call_object);
22 }
23 0 ▶ sub GetAttributeValues {
Subroutine GetAttributeValues: not called CC=1 SCAR=6.9
Pod documented
24 0 my $self = shift;
25 0 my $call_object = $self->new_with_coercions('Paws::Pricing::GetAttributeValues', @_);
26 0 return $self->caller->do_call($self, $call_object);
27 }
28 0 ▶ sub GetProducts {
Subroutine GetProducts: not called CC=1 SCAR=6.9
Pod documented
29 0 my $self = shift;
30 0 my $call_object = $self->new_with_coercions('Paws::Pricing::GetProducts', @_);
31 0 return $self->caller->do_call($self, $call_object);
32 }
33
34 0 ▶ sub DescribeAllServices {
Subroutine DescribeAllServices: not called CC=7 SCAR=40.3
Pod documented
35 0 my $self = shift;
36  
37 0 ▶ my $callback = shift @_ if (ref($_[0]) eq 'CODE');
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] eq "CODE" 0 0 0
38 0 my $result = $self->DescribeServices(@_);
39 0 my $next_result = $result;
40  
41 0 ▶ if (not defined $callback) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $callback) { } 0 0 0
42 0 ▶ while ($next_result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($next_result->NextToken) 0 0 0
43 0 $next_result = $self->DescribeServices(@_, NextToken => $next_result->NextToken);
44 0 push @{ $result->Services }, @{ $next_result->Services };
45 }
46 0 return $result;
47 } else {
48 0 ▶ while ($result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($result->NextToken) 0 0 0
49 0 $callback->($_ => 'Services') foreach (@{ $result->Services });
50 0 $result = $self->DescribeServices(@_, NextToken => $result->NextToken);
51 }
52 0 $callback->($_ => 'Services') foreach (@{ $result->Services });
53 }
54  
55 return undef
56 0 }
57 0 ▶ sub GetAllAttributeValues {
Subroutine GetAllAttributeValues: not called CC=7 SCAR=40.3
Pod documented
58 0 my $self = shift;
59  
60 0 ▶ my $callback = shift @_ if (ref($_[0]) eq 'CODE');
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] eq "CODE" 0 0 0
61 0 my $result = $self->GetAttributeValues(@_);
62 0 my $next_result = $result;
63  
64 0 ▶ if (not defined $callback) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $callback) { } 0 0 0
65 0 ▶ while ($next_result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($next_result->NextToken) 0 0 0
66 0 $next_result = $self->GetAttributeValues(@_, NextToken => $next_result->NextToken);
67 0 push @{ $result->AttributeValues }, @{ $next_result->AttributeValues };
68 }
69 0 return $result;
70 } else {
71 0 ▶ while ($result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($result->NextToken) 0 0 0
72 0 $callback->($_ => 'AttributeValues') foreach (@{ $result->AttributeValues });
73 0 $result = $self->GetAttributeValues(@_, NextToken => $result->NextToken);
74 }
75 0 $callback->($_ => 'AttributeValues') foreach (@{ $result->AttributeValues });
76 }
77  
78 return undef
79 0 }
80 0 ▶ sub GetAllProducts {
Subroutine GetAllProducts: not called CC=7 SCAR=40.3
Pod documented
81 0 my $self = shift;
82  
83 0 ▶ my $callback = shift @_ if (ref($_[0]) eq 'CODE');
Branch: 1 branch
BranchTrueFalseTotal
if ref $_[0] eq "CODE" 0 0 0
84 0 my $result = $self->GetProducts(@_);
85 0 my $next_result = $result;
86  
87 0 ▶ if (not defined $callback) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $callback) { } 0 0 0
88 0 ▶ while ($next_result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($next_result->NextToken) 0 0 0
89 0 $next_result = $self->GetProducts(@_, NextToken => $next_result->NextToken);
90 0 push @{ $result->PriceList }, @{ $next_result->PriceList };
91 }
92 0 return $result;
93 } else {
94 0 ▶ while ($result->NextToken) {
Branch: 1 branch
BranchTrueFalseTotal
if ($result->NextToken) 0 0 0
95 0 $callback->($_ => 'PriceList') foreach (@{ $result->PriceList });
96 0 $result = $self->GetProducts(@_, NextToken => $result->NextToken);
97 }
98 0 $callback->($_ => 'PriceList') foreach (@{ $result->PriceList });
99 }
100  
101 return undef
102 0 }
103  
104  
105 0 ▶ sub operations { qw/DescribeServices GetAttributeValues GetProducts / }
Subroutine operations: not called CC=1 SCAR=6.9
Pod undocumented
106  
107 1 1;
108  
109 ### main pod documentation begin ###
110  
111 =head1 NAME
112  
113 Paws::Pricing - Perl Interface to AWS AWS Price List Service
114  
115 =head1 SYNOPSIS
116  
117 use Paws;
118  
119 my $obj = Paws->service('Pricing');
120 my $res = $obj->Method(
121 Arg1 => $val1,
122 Arg2 => [ 'V1', 'V2' ],
123 # if Arg3 is an object, the HashRef will be used as arguments to the constructor
124 # of the arguments type
125 Arg3 => { Att1 => 'Val1' },
126 # if Arg4 is an array of objects, the HashRefs will be passed as arguments to
127 # the constructor of the arguments type
128 Arg4 => [ { Att1 => 'Val1' }, { Att1 => 'Val2' } ],
129 );
130  
131 =head1 DESCRIPTION
132  
133 AWS Price List Service API (AWS Price List Service) is a centralized
134 and convenient way to programmatically query Amazon Web Services for
135 services, products, and pricing information. The AWS Price List Service
136 uses standardized product attributes such as C<Location>, C<Storage
137 Class>, and C<Operating System>, and provides prices at the SKU level.
138 You can use the AWS Price List Service to build cost control and
139 scenario planning tools, reconcile billing data, forecast future spend
140 for budgeting purposes, and provide cost benefit analysis that compare
141 your internal workloads with AWS.
142  
143 Use C<GetServices> without a service code to retrieve the service codes
144 for all AWS services, then C<GetServices> with a service code to
145 retreive the attribute names for that service. After you have the
146 service code and attribute names, you can use C<GetAttributeValues> to
147 see what values are available for an attribute. With the service code
148 and an attribute name and value, you can use C<GetProducts> to find
149 specific products that you're interested in, such as an C<AmazonEC2>
150 instance, with a C<Provisioned IOPS> C<volumeType>.
151  
152 Service Endpoint
153  
154 AWS Price List Service API provides the following two endpoints:
155  
156 =over
157  
158 =item *
159  
160 https://api.pricing.us-east-1.amazonaws.com
161  
162 =item *
163  
164 https://api.pricing.ap-south-1.amazonaws.com
165  
166 =back
167  
168  
169 For the AWS API documentation, see L<https://docs.aws.amazon.com/account-billing/>
170  
171  
172 =head1 METHODS
173  
174 =head2 DescribeServices
175  
176 =over
177  
178 =item [FormatVersion => Str]
179  
180 =item [MaxResults => Int]
181  
182 =item [NextToken => Str]
183  
184 =item [ServiceCode => Str]
185  
186  
187 =back
188  
189 Each argument is described in detail in: L<Paws::Pricing::DescribeServices>
190  
191 Returns: a L<Paws::Pricing::DescribeServicesResponse> instance
192  
193 Returns the metadata for one service or a list of the metadata for all
194 services. Use this without a service code to get the service codes for
195 all services. Use it with a service code, such as C<AmazonEC2>, to get
196 information specific to that service, such as the attribute names
197 available for that service. For example, some of the attribute names
198 available for EC2 are C<volumeType>, C<maxIopsVolume>, C<operation>,
199 C<locationType>, and C<instanceCapacity10xlarge>.
200  
201  
202 =head2 GetAttributeValues
203  
204 =over
205  
206 =item AttributeName => Str
207  
208 =item ServiceCode => Str
209  
210 =item [MaxResults => Int]
211  
212 =item [NextToken => Str]
213  
214  
215 =back
216  
217 Each argument is described in detail in: L<Paws::Pricing::GetAttributeValues>
218  
219 Returns: a L<Paws::Pricing::GetAttributeValuesResponse> instance
220  
221 Returns a list of attribute values. Attibutes are similar to the
222 details in a Price List API offer file. For a list of available
223 attributes, see Offer File Definitions
224 (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/reading-an-offer.html#pps-defs)
225 in the AWS Billing and Cost Management User Guide
226 (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-what-is.html).
227  
228  
229 =head2 GetProducts
230  
231 =over
232  
233 =item [Filters => ArrayRef[L<Paws::Pricing::Filter>]]
234  
235 =item [FormatVersion => Str]
236  
237 =item [MaxResults => Int]
238  
239 =item [NextToken => Str]
240  
241 =item [ServiceCode => Str]
242  
243  
244 =back
245  
246 Each argument is described in detail in: L<Paws::Pricing::GetProducts>
247  
248 Returns: a L<Paws::Pricing::GetProductsResponse> instance
249  
250 Returns a list of all products that match the filter criteria.
251  
252  
253  
254  
255 =head1 PAGINATORS
256  
257 Paginator methods are helpers that repetively call methods that return partial results
258  
259 =head2 DescribeAllServices(sub { },[FormatVersion => Str, MaxResults => Int, NextToken => Str, ServiceCode => Str])
260  
261 =head2 DescribeAllServices([FormatVersion => Str, MaxResults => Int, NextToken => Str, ServiceCode => Str])
262  
263  
264 If passed a sub as first parameter, it will call the sub for each element found in :
265  
266 - Services, passing the object as the first parameter, and the string 'Services' as the second parameter
267  
268 If not, it will return a a L<Paws::Pricing::DescribeServicesResponse> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
269  
270  
271 =head2 GetAllAttributeValues(sub { },AttributeName => Str, ServiceCode => Str, [MaxResults => Int, NextToken => Str])
272  
273 =head2 GetAllAttributeValues(AttributeName => Str, ServiceCode => Str, [MaxResults => Int, NextToken => Str])
274  
275  
276 If passed a sub as first parameter, it will call the sub for each element found in :
277  
278 - AttributeValues, passing the object as the first parameter, and the string 'AttributeValues' as the second parameter
279  
280 If not, it will return a a L<Paws::Pricing::GetAttributeValuesResponse> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
281  
282  
283 =head2 GetAllProducts(sub { },[Filters => ArrayRef[L<Paws::Pricing::Filter>], FormatVersion => Str, MaxResults => Int, NextToken => Str, ServiceCode => Str])
284  
285 =head2 GetAllProducts([Filters => ArrayRef[L<Paws::Pricing::Filter>], FormatVersion => Str, MaxResults => Int, NextToken => Str, ServiceCode => Str])
286  
287  
288 If passed a sub as first parameter, it will call the sub for each element found in :
289  
290 - PriceList, passing the object as the first parameter, and the string 'PriceList' as the second parameter
291  
292 If not, it will return a a L<Paws::Pricing::GetProductsResponse> instance with all the C<param>s; from all the responses. Please take into account that this mode can potentially consume vasts ammounts of memory.
293  
294  
295  
296  
297  
298 =head1 SEE ALSO
299  
300 This service class forms part of L<Paws>
301  
302 =head1 BUGS and CONTRIBUTIONS
303  
304 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
305  
306 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
307  
308 =cut
309  
« blib/lib/Paws/RDS.pm ↑ Summary blib/lib/Paws/RedShift.pm »