blib/lib/Paws/CostExplorer/GetCostAndUsage.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 2 Podpod n/a totaltotal 0.0% 0 / 17 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1  
2 package Paws::CostExplorer::GetCostAndUsage;
3 use Moose;
4 has Filter => (is => 'ro', isa => 'Paws::CostExplorer::Expression');
5 has Granularity => (is => 'ro', isa => 'Str', required => 1);
6 has GroupBy => (is => 'ro', isa => 'ArrayRef[Paws::CostExplorer::GroupDefinition]');
7 has Metrics => (is => 'ro', isa => 'ArrayRef[Str|Undef]', required => 1);
8 has NextPageToken => (is => 'ro', isa => 'Str');
9 has TimePeriod => (is => 'ro', isa => 'Paws::CostExplorer::DateInterval', required => 1);
10  
11 use MooseX::ClassAttribute;
12  
13 class_has _api_call => (isa => 'Str', is => 'ro', default => 'GetCostAndUsage');
14 class_has _returns => (isa => 'Str', is => 'ro', default => 'Paws::CostExplorer::GetCostAndUsageResponse');
15 class_has _result_key => (isa => 'Str', is => 'ro');
16 1;
17  
18 ### main pod documentation begin ###
19  
20 =head1 NAME
21  
22 Paws::CostExplorer::GetCostAndUsage - Arguments for method GetCostAndUsage on L<Paws::CostExplorer>
23  
24 =head1 DESCRIPTION
25  
26 This class represents the parameters used for calling the method GetCostAndUsage on the
27 L<AWS Cost Explorer Service|Paws::CostExplorer> service. Use the attributes of this class
28 as arguments to method GetCostAndUsage.
29  
30 You shouldn't make instances of this class. Each attribute should be used as a named argument in the call to GetCostAndUsage.
31  
32 =head1 SYNOPSIS
33  
34 my $ce = Paws->service('CostExplorer');
35 my $GetCostAndUsageResponse = $ce->GetCostAndUsage(
36 Granularity => 'DAILY',
37 Metrics => [
38 'MyMetricName', ... # max: 1024
39 ],
40 TimePeriod => {
41 End => 'MyYearMonthDay', # max: 40
42 Start => 'MyYearMonthDay', # max: 40
43  
44 },
45 Filter => {
46 And => [ <Expression>, ... ], # OPTIONAL
47 CostCategories => {
48 Key => 'MyCostCategoryName', # min: 1, max: 50; OPTIONAL
49 MatchOptions => [
50 'EQUALS',
51 ... # values: EQUALS, ABSENT, STARTS_WITH, ENDS_WITH, CONTAINS, CASE_SENSITIVE, CASE_INSENSITIVE
52 ], # OPTIONAL
53 Values => [
54 'MyValue', ... # max: 1024
55 ], # OPTIONAL
56 }, # OPTIONAL
57 Dimensions => {
58 Key => 'AZ'
59 , # values: AZ, INSTANCE_TYPE, LINKED_ACCOUNT, LINKED_ACCOUNT_NAME, OPERATION, PURCHASE_TYPE, REGION, SERVICE, SERVICE_CODE, USAGE_TYPE, USAGE_TYPE_GROUP, RECORD_TYPE, OPERATING_SYSTEM, TENANCY, SCOPE, PLATFORM, SUBSCRIPTION_ID, LEGAL_ENTITY_NAME, DEPLOYMENT_OPTION, DATABASE_ENGINE, CACHE_ENGINE, INSTANCE_TYPE_FAMILY, BILLING_ENTITY, RESERVATION_ID, RESOURCE_ID, RIGHTSIZING_TYPE, SAVINGS_PLANS_TYPE, SAVINGS_PLAN_ARN, PAYMENT_OPTION, AGREEMENT_END_DATE_TIME_AFTER, AGREEMENT_END_DATE_TIME_BEFORE; OPTIONAL
60 MatchOptions => [
61 'EQUALS',
62 ... # values: EQUALS, ABSENT, STARTS_WITH, ENDS_WITH, CONTAINS, CASE_SENSITIVE, CASE_INSENSITIVE
63 ], # OPTIONAL
64 Values => [
65 'MyValue', ... # max: 1024
66 ], # OPTIONAL
67 }, # OPTIONAL
68 Not => <Expression>,
69 Or => [ <Expression>, ... ], # OPTIONAL
70 Tags => {
71 Key => 'MyTagKey', # max: 1024; OPTIONAL
72 MatchOptions => [
73 'EQUALS',
74 ... # values: EQUALS, ABSENT, STARTS_WITH, ENDS_WITH, CONTAINS, CASE_SENSITIVE, CASE_INSENSITIVE
75 ], # OPTIONAL
76 Values => [
77 'MyValue', ... # max: 1024
78 ], # OPTIONAL
79 }, # OPTIONAL
80 }, # OPTIONAL
81 GroupBy => [
82 {
83 Key => 'MyGroupDefinitionKey', # max: 1024; OPTIONAL
84 Type => 'DIMENSION', # values: DIMENSION, TAG, COST_CATEGORY; OPTIONAL
85 },
86 ...
87 ], # OPTIONAL
88 NextPageToken => 'MyNextPageToken', # OPTIONAL
89 );
90  
91 # Results:
92 my $DimensionValueAttributes =
93 $GetCostAndUsageResponse->DimensionValueAttributes;
94 my $GroupDefinitions = $GetCostAndUsageResponse->GroupDefinitions;
95 my $NextPageToken = $GetCostAndUsageResponse->NextPageToken;
96 my $ResultsByTime = $GetCostAndUsageResponse->ResultsByTime;
97  
98 # Returns a L<Paws::CostExplorer::GetCostAndUsageResponse> object.
99  
100 Values for attributes that are native types (Int, String, Float, etc) can passed as-is (scalar values). Values for complex Types (objects) can be passed as a HashRef. The keys and values of the hashref will be used to instance the underlying object.
101 For the AWS API documentation, see L<https://docs.aws.amazon.com/goto/WebAPI/ce/GetCostAndUsage>
102  
103 =head1 ATTRIBUTES
104  
105  
106 =head2 Filter => L<Paws::CostExplorer::Expression>
107  
108 Filters AWS costs by different dimensions. For example, you can specify
109 C<SERVICE> and C<LINKED_ACCOUNT> and get the costs that are associated
110 with that account's usage of that service. You can nest C<Expression>
111 objects to define any combination of dimension filters. For more
112 information, see Expression
113 (https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html).
114  
115  
116  
117 =head2 B<REQUIRED> Granularity => Str
118  
119 Sets the AWS cost granularity to C<MONTHLY> or C<DAILY>, or C<HOURLY>.
120 If C<Granularity> isn't set, the response object doesn't include the
121 C<Granularity>, either C<MONTHLY> or C<DAILY>, or C<HOURLY>.
122  
123 Valid values are: C<"DAILY">, C<"MONTHLY">, C<"HOURLY">
124  
125 =head2 GroupBy => ArrayRef[L<Paws::CostExplorer::GroupDefinition>]
126  
127 You can group AWS costs using up to two different groups, either
128 dimensions, tag keys, cost categories, or any two group by types.
129  
130 When you group by tag key, you get all tag values, including empty
131 strings.
132  
133 Valid values are C<AZ>, C<INSTANCE_TYPE>, C<LEGAL_ENTITY_NAME>,
134 C<LINKED_ACCOUNT>, C<OPERATION>, C<PLATFORM>, C<PURCHASE_TYPE>,
135 C<SERVICE>, C<TAGS>, C<TENANCY>, C<RECORD_TYPE>, and C<USAGE_TYPE>.
136  
137  
138  
139 =head2 B<REQUIRED> Metrics => ArrayRef[Str|Undef]
140  
141 Which metrics are returned in the query. For more information about
142 blended and unblended rates, see Why does the "blended" annotation
143 appear on some line items in my bill?
144 (http://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/).
145  
146 Valid values are C<AmortizedCost>, C<BlendedCost>, C<NetAmortizedCost>,
147 C<NetUnblendedCost>, C<NormalizedUsageAmount>, C<UnblendedCost>, and
148 C<UsageQuantity>.
149  
150 If you return the C<UsageQuantity> metric, the service aggregates all
151 usage numbers without taking into account the units. For example, if
152 you aggregate C<usageQuantity> across all of Amazon EC2, the results
153 aren't meaningful because Amazon EC2 compute hours and data transfer
154 are measured in different units (for example, hours vs. GB). To get
155 more meaningful C<UsageQuantity> metrics, filter by C<UsageType> or
156 C<UsageTypeGroups>.
157  
158 C<Metrics> is required for C<GetCostAndUsage> requests.
159  
160  
161  
162 =head2 NextPageToken => Str
163  
164 The token to retrieve the next set of results. AWS provides the token
165 when the response from a previous call has more results than the
166 maximum page size.
167  
168  
169  
170 =head2 B<REQUIRED> TimePeriod => L<Paws::CostExplorer::DateInterval>
171  
172 Sets the start and end dates for retrieving AWS costs. The start date
173 is inclusive, but the end date is exclusive. For example, if C<start>
174 is C<2017-01-01> and C<end> is C<2017-05-01>, then the cost and usage
175 data is retrieved from C<2017-01-01> up to and including C<2017-04-30>
176 but not including C<2017-05-01>.
177  
178  
179  
180  
181 =head1 SEE ALSO
182  
183 This class forms part of L<Paws>, documenting arguments for method GetCostAndUsage in L<Paws::CostExplorer>
184  
185 =head1 BUGS and CONTRIBUTIONS
186  
187 The source code is located here: L<https://github.com/pplu/aws-sdk-perl>
188  
189 Please report bugs to: L<https://github.com/pplu/aws-sdk-perl/issues>
190  
191 =cut
192