forked from aws/aws-sdk-go-v2
/
api.go
1457 lines (1207 loc) · 46.9 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package costexplorer
import (
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
const opGetCostAndUsage = "GetCostAndUsage"
// GetCostAndUsageRequest is a API request type for the GetCostAndUsage API operation.
type GetCostAndUsageRequest struct {
*aws.Request
Input *GetCostAndUsageInput
Copy func(*GetCostAndUsageInput) GetCostAndUsageRequest
}
// Send marshals and sends the GetCostAndUsage API request.
func (r GetCostAndUsageRequest) Send() (*GetCostAndUsageOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetCostAndUsageOutput), nil
}
// GetCostAndUsageRequest returns a request value for making API operation for
// AWS Cost Explorer Service.
//
// Retrieve cost and usage metrics for your account. You can specify which cost
// and usage-related metric, such as BlendedCosts or UsageQuantity, that you
// want the request to return. You can also filter and group your data by various
// dimensions, such as SERVICE or AZ, in a specific time range. See the GetDimensionValues
// action for a complete list of the valid dimensions. Master accounts in an
// organization have access to all member accounts.
//
// // Example sending a request using the GetCostAndUsageRequest method.
// req := client.GetCostAndUsageRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetCostAndUsage
func (c *CostExplorer) GetCostAndUsageRequest(input *GetCostAndUsageInput) GetCostAndUsageRequest {
op := &aws.Operation{
Name: opGetCostAndUsage,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetCostAndUsageInput{}
}
output := &GetCostAndUsageOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetCostAndUsageRequest{Request: req, Input: input, Copy: c.GetCostAndUsageRequest}
}
const opGetDimensionValues = "GetDimensionValues"
// GetDimensionValuesRequest is a API request type for the GetDimensionValues API operation.
type GetDimensionValuesRequest struct {
*aws.Request
Input *GetDimensionValuesInput
Copy func(*GetDimensionValuesInput) GetDimensionValuesRequest
}
// Send marshals and sends the GetDimensionValues API request.
func (r GetDimensionValuesRequest) Send() (*GetDimensionValuesOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetDimensionValuesOutput), nil
}
// GetDimensionValuesRequest returns a request value for making API operation for
// AWS Cost Explorer Service.
//
// You can use GetDimensionValues to retrieve all available filter values for
// a specific filter over a period of time. You can search the dimension values
// for an arbitrary string.
//
// // Example sending a request using the GetDimensionValuesRequest method.
// req := client.GetDimensionValuesRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetDimensionValues
func (c *CostExplorer) GetDimensionValuesRequest(input *GetDimensionValuesInput) GetDimensionValuesRequest {
op := &aws.Operation{
Name: opGetDimensionValues,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetDimensionValuesInput{}
}
output := &GetDimensionValuesOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetDimensionValuesRequest{Request: req, Input: input, Copy: c.GetDimensionValuesRequest}
}
const opGetReservationCoverage = "GetReservationCoverage"
// GetReservationCoverageRequest is a API request type for the GetReservationCoverage API operation.
type GetReservationCoverageRequest struct {
*aws.Request
Input *GetReservationCoverageInput
Copy func(*GetReservationCoverageInput) GetReservationCoverageRequest
}
// Send marshals and sends the GetReservationCoverage API request.
func (r GetReservationCoverageRequest) Send() (*GetReservationCoverageOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetReservationCoverageOutput), nil
}
// GetReservationCoverageRequest returns a request value for making API operation for
// AWS Cost Explorer Service.
//
// Retrieve the reservation coverage for your account. An organization's master
// account has access to the associated member accounts. For any time period,
// you can filter data about reservation usage by the following dimensions.
//
// * AZ
//
// * INSTANCE_TYPE
//
// * LINKED_ACCOUNT
//
// * PLATFORM
//
// * REGION
//
// * TENANCY
//
// To determine valid values for a dimension, use the GetDimensionValues operation.
//
// // Example sending a request using the GetReservationCoverageRequest method.
// req := client.GetReservationCoverageRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationCoverage
func (c *CostExplorer) GetReservationCoverageRequest(input *GetReservationCoverageInput) GetReservationCoverageRequest {
op := &aws.Operation{
Name: opGetReservationCoverage,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetReservationCoverageInput{}
}
output := &GetReservationCoverageOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetReservationCoverageRequest{Request: req, Input: input, Copy: c.GetReservationCoverageRequest}
}
const opGetReservationUtilization = "GetReservationUtilization"
// GetReservationUtilizationRequest is a API request type for the GetReservationUtilization API operation.
type GetReservationUtilizationRequest struct {
*aws.Request
Input *GetReservationUtilizationInput
Copy func(*GetReservationUtilizationInput) GetReservationUtilizationRequest
}
// Send marshals and sends the GetReservationUtilization API request.
func (r GetReservationUtilizationRequest) Send() (*GetReservationUtilizationOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetReservationUtilizationOutput), nil
}
// GetReservationUtilizationRequest returns a request value for making API operation for
// AWS Cost Explorer Service.
//
// You can retrieve the Reservation utilization for your account. Master accounts
// in an organization have access to their associated member accounts. You can
// filter data by dimensions in a time period. You can use GetDimensionValues
// to determine the possible dimension values. Currently, you can group only
// by SUBSCRIPTION_ID.
//
// // Example sending a request using the GetReservationUtilizationRequest method.
// req := client.GetReservationUtilizationRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationUtilization
func (c *CostExplorer) GetReservationUtilizationRequest(input *GetReservationUtilizationInput) GetReservationUtilizationRequest {
op := &aws.Operation{
Name: opGetReservationUtilization,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetReservationUtilizationInput{}
}
output := &GetReservationUtilizationOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetReservationUtilizationRequest{Request: req, Input: input, Copy: c.GetReservationUtilizationRequest}
}
const opGetTags = "GetTags"
// GetTagsRequest is a API request type for the GetTags API operation.
type GetTagsRequest struct {
*aws.Request
Input *GetTagsInput
Copy func(*GetTagsInput) GetTagsRequest
}
// Send marshals and sends the GetTags API request.
func (r GetTagsRequest) Send() (*GetTagsOutput, error) {
err := r.Request.Send()
if err != nil {
return nil, err
}
return r.Request.Data.(*GetTagsOutput), nil
}
// GetTagsRequest returns a request value for making API operation for
// AWS Cost Explorer Service.
//
// You can query for available tag keys and tag values for a specified period.
// You can search the tag values for an arbitrary string.
//
// // Example sending a request using the GetTagsRequest method.
// req := client.GetTagsRequest(params)
// resp, err := req.Send()
// if err == nil {
// fmt.Println(resp)
// }
//
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetTags
func (c *CostExplorer) GetTagsRequest(input *GetTagsInput) GetTagsRequest {
op := &aws.Operation{
Name: opGetTags,
HTTPMethod: "POST",
HTTPPath: "/",
}
if input == nil {
input = &GetTagsInput{}
}
output := &GetTagsOutput{}
req := c.newRequest(op, input, output)
output.responseMetadata = aws.Response{Request: req}
return GetTagsRequest{Request: req, Input: input, Copy: c.GetTagsRequest}
}
// The amount of instance usage that a reservation covered.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/Coverage
type Coverage struct {
_ struct{} `type:"structure"`
// The amount of instance usage that a reservation covered, in hours.
CoverageHours *CoverageHours `type:"structure"`
}
// String returns the string representation
func (s Coverage) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Coverage) GoString() string {
return s.String()
}
// Reservation coverage, in hours.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/CoverageByTime
type CoverageByTime struct {
_ struct{} `type:"structure"`
// The group of instances that a reservation covered.
Groups []ReservationCoverageGroup `type:"list"`
// The period over which this coverage was used.
TimePeriod *DateInterval `type:"structure"`
// The total reservation coverage, in hours.
Total *Coverage `type:"structure"`
}
// String returns the string representation
func (s CoverageByTime) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CoverageByTime) GoString() string {
return s.String()
}
// How long a running instance either used a reservation or was On-Demand.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/CoverageHours
type CoverageHours struct {
_ struct{} `type:"structure"`
// The percentage of instance hours covered by a reservation.
CoverageHoursPercentage *string `type:"string"`
// The number of instance running hours covered by On-Demand Instances.
OnDemandHours *string `type:"string"`
// The number of instance running hours covered by reservations.
ReservedHours *string `type:"string"`
// The total instance usage, in hours.
TotalRunningHours *string `type:"string"`
}
// String returns the string representation
func (s CoverageHours) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s CoverageHours) GoString() string {
return s.String()
}
// The time period that you want the usage and costs for.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/DateInterval
type DateInterval struct {
_ struct{} `type:"structure"`
// The end of the time period that you want the usage and costs for. The end
// date is exclusive. For example, if the end is 2017-05-01, then the cost and
// usage data is retrieved from the start date but not including 2017-05-01.
//
// End is a required field
End *string `type:"string" required:"true"`
// The beginning of the time period that you want the usage and costs for. The
// start date is inclusive. For example, if start is 2017-01-01, then the cost
// and usage data is retrieved starting at 2017-01-01 up to the end date.
//
// Start is a required field
Start *string `type:"string" required:"true"`
}
// String returns the string representation
func (s DateInterval) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DateInterval) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *DateInterval) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "DateInterval"}
if s.End == nil {
invalidParams.Add(aws.NewErrParamRequired("End"))
}
if s.Start == nil {
invalidParams.Add(aws.NewErrParamRequired("Start"))
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// The metadata that you can use to filter and group your results. You can use
// GetDimensionValues to find specific values.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/DimensionValues
type DimensionValues struct {
_ struct{} `type:"structure"`
// The names of the metadata types that you can use to filter and group your
// results. For example, AZ returns a list of Availability Zones.
Key Dimension `type:"string" enum:"true"`
// The metadata values that you can use to filter and group your results. You
// can use GetDimensionValues to find specific values.
Values []string `type:"list"`
}
// String returns the string representation
func (s DimensionValues) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DimensionValues) GoString() string {
return s.String()
}
// The metadata of a specific type that you can use to filter and group your
// results. You can use GetDimensionValues to find specific values.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/DimensionValuesWithAttributes
type DimensionValuesWithAttributes struct {
_ struct{} `type:"structure"`
// The attribute that applies to a specific Dimension.
Attributes map[string]string `type:"map"`
// The value of a dimension with a specific attribute.
Value *string `type:"string"`
}
// String returns the string representation
func (s DimensionValuesWithAttributes) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s DimensionValuesWithAttributes) GoString() string {
return s.String()
}
// Use Expression to filter by cost or by usage. There are two patterns:
//
// * Simple dimension values - You can set the dimension name and values
// for the filters that you plan to use. For example, you can filter for
// INSTANCE_TYPE==m4.xlarge OR INSTANCE_TYPE==c4.large. The Expression for
// that looks like this.
//
// { "Dimensions": { "Key": "INSTANCE_TYPE", "Values": [ "m4.xlarge", “c4.large”
// ] } }
//
// The list of dimension values are OR'd together to retrieve cost or usage
// data. You can create Expression and DimensionValues objects using either
// with* methods or set* methods in multiple lines.
//
// * Compound dimension values with logical operations - You can use multiple
// Expression types and the logical operators AND/OR/NOT to create a list
// of one or more Expression objects. This allows you to filter on more advanced
// options. For example, you can filter on ((INSTANCE_TYPE == m4.large OR
// INSTANCE_TYPE == m3.large) OR (TAG.Type == Type1)) AND (USAGE_TYPE !=
// DataTransfer). The Expression for that looks like this.
//
// { "And": [ {"Or": [ {"Dimensions": { "Key": "INSTANCE_TYPE", "Values": [
// "m4.x.large", "c4.large" ] }}, {"Tag": { "Key": "TagName", "Values": ["Value1"]
// } } ]}, {"Not": {"dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"]
// }}} ] }
//
// Because each Expression can have only one operator, the service returns an
// error if more than one is specified. The following example shows an Expression
// object that will create an error.
//
// { "And": [ ... ], "DimensionValues": { "Dimension": "USAGE_TYPE", "Values":
// [ "DataTransfer" ] } }
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/Expression
type Expression struct {
_ struct{} `type:"structure"`
// Return results that match both Dimension objects.
And []Expression `type:"list"`
// The specific Dimension to use for Expression.
Dimensions *DimensionValues `type:"structure"`
// Return results that don't match Dimension.
Not *Expression `type:"structure"`
// Return results that match either Dimension.
Or []Expression `type:"list"`
// The specific Tag to use for Expression.
Tags *TagValues `type:"structure"`
}
// String returns the string representation
func (s Expression) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s Expression) GoString() string {
return s.String()
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetCostAndUsageRequest
type GetCostAndUsageInput struct {
_ struct{} `type:"structure"`
// Filters AWS costs by different dimensions. For example, you can specify SERVICE
// and LINKED_ACCOUNT and get the costs associated with that account's usage
// of that service. You can nest Expression objects to define any combination
// of dimension filters. For more information, see Expression (http://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html).
Filter *Expression `type:"structure"`
// Sets the AWS cost granularity to MONTHLY or DAILY. If Granularity isn't set,
// the response object doesn't include the Granularity, either MONTHLY or DAILY.
Granularity Granularity `type:"string" enum:"true"`
// You can group AWS costs using up to two different groups, either dimensions,
// tag keys, or both.
//
// When you group by tag key, you get all tag values, including empty strings.
//
// Valid values are AZ, INSTANCE_TYPE, LINKED_ACCOUNT, OPERATION, PLATFORM,
// PURCHASE_TYPE, SERVICE, TAGS, TENANCY, and USAGE_TYPE.
GroupBy []GroupDefinition `type:"list"`
// Which metrics are returned in the query. For more information about blended
// and unblended rates, see Why does the "blended" annotation appear on some
// line items in my bill? (https://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/).
//
// Valid values are BlendedCost, UnblendedCost, and UsageQuantity.
//
// If you return the UsageQuantity metric, the service aggregates all usage
// numbers without taking into account the units. For example, if you aggregate
// usageQuantity across all of EC2, the results aren't meaningful because EC2
// compute hours and data transfer are measured in different units (for example,
// hours vs. GB). To get more meaningful UsageQuantity metrics, filter by UsageType
// or UsageTypeGroups.
Metrics []string `type:"list"`
// The token to retrieve the next set of results. AWS provides the token when
// the response from a previous call has more results than the maximum page
// size.
NextPageToken *string `type:"string"`
// Sets the start and end dates for retrieving AWS costs. The start date is
// inclusive, but the end date is exclusive. For example, if start is 2017-01-01
// and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01
// up to and including 2017-04-30 but not including 2017-05-01.
TimePeriod *DateInterval `type:"structure"`
}
// String returns the string representation
func (s GetCostAndUsageInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetCostAndUsageInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetCostAndUsageInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "GetCostAndUsageInput"}
if s.TimePeriod != nil {
if err := s.TimePeriod.Validate(); err != nil {
invalidParams.AddNested("TimePeriod", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetCostAndUsageResponse
type GetCostAndUsageOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// The groups specified by the the Filter or GroupBy parameters in the request.
GroupDefinitions []GroupDefinition `type:"list"`
// The token for the next set of retrievable results. AWS provides the token
// when the response from a previous call has more results than the maximum
// page size.
NextPageToken *string `type:"string"`
// The time period covered by the results in the response.
ResultsByTime []ResultByTime `type:"list"`
}
// String returns the string representation
func (s GetCostAndUsageOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetCostAndUsageOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s GetCostAndUsageOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetDimensionValuesRequest
type GetDimensionValuesInput struct {
_ struct{} `type:"structure"`
// The context for the call to GetDimensionValues. This can be RESERVATIONS
// or COST_AND_USAGE. The default value is COST_AND_USAGE. If the context is
// set to RESERVATIONS, the resulting dimension values can be used in the GetReservationUtilization
// action. If the context is set to COST_AND_USAGE, the resulting dimension
// values can be used in the GetCostAndUsage operation.
//
// If you set the context to CostAndUsage, you can use the following dimensions
// for searching:
//
// * AZ - The Availability Zone. An example is us-east-1a.
//
// * INSTANCE_TYPE - The type of EC2 instance. An example is m4.xlarge.
//
// * LINKED_ACCOUNT - The description in the attribute map that includes
// the full name of the member account. The value field contains the AWS
// ID of the member account
//
// * OPERATION - The action performed. Examples include RunInstance and CreateBucket.
//
// * PURCHASE_TYPE - The reservation type of the purchase to which this usage
// is related. Examples include: On Demand Instances and Standard Reserved
// Instances
//
// * SERVICE - The AWS service such as DynamoDB.
//
// * USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes.
// The response for the GetDimensionValues action includes a unit attribute,
// examples of which include GB and Hrs.
//
// * USAGE_TYPE_GROUP - The grouping of common usage types. An example is
// EC2: CloudWatch – Alarms. The response for this action includes a unit
// attribute.
//
// * RECORD_TYPE - The different types of charges such as RI fees, usage
// costs, tax refunds, and credits.
//
// If you set the context to RESERVATIONS, you can use the following dimensions
// for searching:
//
// * AZ - The Availability Zone. An example is us-east-1a.
//
// * INSTANCE_TYPE - The type of EC2 instance. An example is m4.xlarge.
//
// * LINKED_ACCOUNT - The description in the attribute map that includes
// the full name of the member account. The value field contains the AWS
// ID of the member account
//
// * PLATFORM - The operating system. Examples are Windows or Linux.
//
// * REGION - The AWS region.
//
// * SCOPE - The scope of a reserved instance (RI). Values are regional or
// a single availability zone.
//
// * TENANCY - The tenancy of a resource. Examples are shared or dedicated.
Context Context `type:"string" enum:"true"`
// The name of the dimension. Each Dimensionsis available for different a Context.
// For more information, see Context.
//
// Dimension is a required field
Dimension Dimension `type:"string" required:"true" enum:"true"`
// The token to retrieve the next set of results. AWS provides the token when
// the response from a previous call has more results than the maximum page
// size.
NextPageToken *string `type:"string"`
// The value that you want to search the filter values for.
SearchString *string `type:"string"`
// The start and end dates for retrieving the dimension values. The start date
// is inclusive, but the end date is exclusive. For example, if start is 2017-01-01
// and end is 2017-05-01, then the cost and usage data is retrieved from 2017-01-01
// up to and including 2017-04-30 but not including 2017-05-01.
//
// TimePeriod is a required field
TimePeriod *DateInterval `type:"structure" required:"true"`
}
// String returns the string representation
func (s GetDimensionValuesInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetDimensionValuesInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetDimensionValuesInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "GetDimensionValuesInput"}
if len(s.Dimension) == 0 {
invalidParams.Add(aws.NewErrParamRequired("Dimension"))
}
if s.TimePeriod == nil {
invalidParams.Add(aws.NewErrParamRequired("TimePeriod"))
}
if s.TimePeriod != nil {
if err := s.TimePeriod.Validate(); err != nil {
invalidParams.AddNested("TimePeriod", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetDimensionValuesResponse
type GetDimensionValuesOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// The filters that you used to filter your request. Some dimensions are available
// only for a specific context:
//
// If you set the context to CostAndUsage, you can use the following dimensions
// for searching:
//
// * AZ - The Availability Zone. An example is us-east-1a.
//
// * INSTANCE_TYPE - The type of EC2 instance. An example is m4.xlarge.
//
// * LINKED_ACCOUNT - The description in the attribute map that includes
// the full name of the member account. The value field contains the AWS
// ID of the member account
//
// * OPERATION - The action performed. Examples include RunInstance and CreateBucket.
//
// * PURCHASE_TYPE - The reservation type of the purchase to which this usage
// is related. Examples include: On Demand Instances and Standard Reserved
// Instances
//
// * SERVICE - The AWS service such as DynamoDB.
//
// * USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes.
// The response for the GetDimensionValues action includes a unit attribute,
// examples of which include GB and Hrs.
//
// * USAGE_TYPE_GROUP - The grouping of common usage types. An example is
// EC2: CloudWatch – Alarms. The response for this action includes a unit
// attribute.
//
// * RECORD_TYPE - The different types of charges such as RI fees, usage
// costs, tax refunds, and credits.
//
// If you set the context to RESERVATIONS, you can use the following dimensions
// for searching:
//
// * AZ - The Availability Zone. An example is us-east-1a.
//
// * INSTANCE_TYPE - The type of EC2 instance. An example is m4.xlarge.
//
// * LINKED_ACCOUNT - The description in the attribute map that includes
// the full name of the member account. The value field contains the AWS
// ID of the member account
//
// * PLATFORM - The operating system. Examples are Windows or Linux.
//
// * REGION - The AWS region.
//
// * SCOPE - The scope of a reserved instance (RI). Values are regional or
// a single availability zone.
//
// * TENANCY - The tenancy of a resource. Examples are shared or dedicated.
//
// DimensionValues is a required field
DimensionValues []DimensionValuesWithAttributes `type:"list" required:"true"`
// The token for the next set of retrievable results. AWS provides the token
// when the response from a previous call has more results than the maximum
// page size.
NextPageToken *string `type:"string"`
// The number of results that AWS returned at one time.
//
// ReturnSize is a required field
ReturnSize *int64 `type:"integer" required:"true"`
// The total number of search results.
//
// TotalSize is a required field
TotalSize *int64 `type:"integer" required:"true"`
}
// String returns the string representation
func (s GetDimensionValuesOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetDimensionValuesOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s GetDimensionValuesOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// You can query for how much of your instance usage was covered by a reservation.
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationCoverageRequest
type GetReservationCoverageInput struct {
_ struct{} `type:"structure"`
// Filters utilization data by dimensions. You can filter by the following dimensions.
//
// * AZ
//
// * INSTANCE_TYPE
//
// * LINKED_ACCOUNT
//
// * PLATFORM
//
// * REGION
//
// * TENANCY
//
// GetReservationCoverage uses the same Expression object as the other operations,
// but only AND is supported among each dimension. You can nest only one level
// deep. If there are multiple values for a dimension, they are OR'd together.
Filter *Expression `type:"structure"`
// The granularity of the AWS cost data for the reservation. Valid values are
// MONTHLY and DAILY.
//
// If GroupBy is set, Granularity can't be set. If Granularity isn't set, the
// response object doesn't include the Granularity, either MONTHLY or DAILY.
Granularity Granularity `type:"string" enum:"true"`
// You can group the data by the following attributes.
//
// * AZ
//
// * INSTANCE_TYPE
//
// * LINKED_ACCOUNT
//
// * PLATFORM
//
// * REGION
//
// * TENANCY
GroupBy []GroupDefinition `type:"list"`
// The token to retrieve the next set of results. AWS provides the token when
// the response from a previous call has more results than the maximum page
// size.
NextPageToken *string `type:"string"`
// The start and end dates of the period for which you want to retrieve data
// about reservation coverage. You can retrieve data for a maximum of 13 months-the
// last 12 months and the current month. The start date is inclusive, but the
// end date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01,
// then the cost and usage data is retrieved from 2017-01-01 up to and including
// 2017-04-30 but not including 2017-05-01.
//
// TimePeriod is a required field
TimePeriod *DateInterval `type:"structure" required:"true"`
}
// String returns the string representation
func (s GetReservationCoverageInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetReservationCoverageInput) GoString() string {
return s.String()
}
// Validate inspects the fields of the type to determine if they are valid.
func (s *GetReservationCoverageInput) Validate() error {
invalidParams := aws.ErrInvalidParams{Context: "GetReservationCoverageInput"}
if s.TimePeriod == nil {
invalidParams.Add(aws.NewErrParamRequired("TimePeriod"))
}
if s.TimePeriod != nil {
if err := s.TimePeriod.Validate(); err != nil {
invalidParams.AddNested("TimePeriod", err.(aws.ErrInvalidParams))
}
}
if invalidParams.Len() > 0 {
return invalidParams
}
return nil
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationCoverageResponse
type GetReservationCoverageOutput struct {
_ struct{} `type:"structure"`
responseMetadata aws.Response
// The amount of time that your reservations covered.
//
// CoveragesByTime is a required field
CoveragesByTime []CoverageByTime `type:"list" required:"true"`
// The token for the next set of retrievable results. AWS provides the token
// when the response from a previous call has more results than the maximum
// page size.
NextPageToken *string `type:"string"`
// The total amount of instance usage covered by a reservation.
Total *Coverage `type:"structure"`
}
// String returns the string representation
func (s GetReservationCoverageOutput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetReservationCoverageOutput) GoString() string {
return s.String()
}
// SDKResponseMetdata return sthe response metadata for the API.
func (s GetReservationCoverageOutput) SDKResponseMetadata() aws.Response {
return s.responseMetadata
}
// Please also see https://docs.aws.amazon.com/goto/WebAPI/ce-2017-10-25/GetReservationUtilizationRequest
type GetReservationUtilizationInput struct {
_ struct{} `type:"structure"`
// Filters utilization data by using different dimensions. GetReservationUtilization
// uses the same Expression object as the other operations, but only AND is
// supported among each dimension, and nesting is supported up to only one level
// deep. If there are multiple values for a dimension, they are OR'd together.
Filter *Expression `type:"structure"`
// If GroupBy is set, Granularity can't be set. If Granularity isn't set, the
// response object doesn't include the Granularity, either MONTHLY or DAILY.
// If both GroupBy and Granularity aren't set, GetReservationUtilization defaults
// to DAILY.
Granularity Granularity `type:"string" enum:"true"`
// Groups only by SUBSCRIPTION_ID. Metadata is included.
GroupBy []GroupDefinition `type:"list"`
// The token to retrieve the next set of results. AWS provides the token when
// the response from a previous call has more results than the maximum page
// size.
NextPageToken *string `type:"string"`
// Sets the start and end dates for retrieving reserve instance (RI) utilization.
// The start date is inclusive, but the end date is exclusive. For example,
// if start is 2017-01-01 and end is 2017-05-01, then the cost and usage data
// is retrieved from 2017-01-01 up to and including 2017-04-30 but not including
// 2017-05-01.
//
// TimePeriod is a required field
TimePeriod *DateInterval `type:"structure" required:"true"`
}
// String returns the string representation
func (s GetReservationUtilizationInput) String() string {
return awsutil.Prettify(s)
}
// GoString returns the string representation
func (s GetReservationUtilizationInput) GoString() string {