Skip to content

Commit 7e0d639

Browse files
Add support for Cost Category resource associations including filtering by resource type on ListCostCategoryDefinitions and new ListCostCategoryResourceAssociations API.
1 parent 5f42933 commit 7e0d639

File tree

48 files changed

+1595
-265
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1595
-265
lines changed

generator/ServiceModels/ce/ce-2017-10-25.api.json

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,19 @@
501501
{"shape":"LimitExceededException"}
502502
]
503503
},
504+
"ListCostCategoryResourceAssociations":{
505+
"name":"ListCostCategoryResourceAssociations",
506+
"http":{
507+
"method":"POST",
508+
"requestUri":"/"
509+
},
510+
"input":{"shape":"ListCostCategoryResourceAssociationsRequest"},
511+
"output":{"shape":"ListCostCategoryResourceAssociationsResponse"},
512+
"errors":[
513+
{"shape":"LimitExceededException"},
514+
{"shape":"ResourceNotFoundException"}
515+
]
516+
},
504517
"ListSavingsPlansPurchaseRecommendationGeneration":{
505518
"name":"ListSavingsPlansPurchaseRecommendationGeneration",
506519
"http":{
@@ -1099,13 +1112,26 @@
10991112
"NumberOfRules":{"shape":"NonNegativeInteger"},
11001113
"ProcessingStatus":{"shape":"CostCategoryProcessingStatusList"},
11011114
"Values":{"shape":"CostCategoryValuesList"},
1102-
"DefaultValue":{"shape":"CostCategoryValue"}
1115+
"DefaultValue":{"shape":"CostCategoryValue"},
1116+
"SupportedResourceTypes":{"shape":"ResourceTypes"}
11031117
}
11041118
},
11051119
"CostCategoryReferencesList":{
11061120
"type":"list",
11071121
"member":{"shape":"CostCategoryReference"}
11081122
},
1123+
"CostCategoryResourceAssociation":{
1124+
"type":"structure",
1125+
"members":{
1126+
"ResourceArn":{"shape":"GenericArn"},
1127+
"CostCategoryName":{"shape":"CostCategoryName"},
1128+
"CostCategoryArn":{"shape":"Arn"}
1129+
}
1130+
},
1131+
"CostCategoryResourceAssociations":{
1132+
"type":"list",
1133+
"member":{"shape":"CostCategoryResourceAssociation"}
1134+
},
11091135
"CostCategoryRule":{
11101136
"type":"structure",
11111137
"members":{
@@ -1680,6 +1706,12 @@
16801706
"type":"list",
16811707
"member":{"shape":"GenerationSummary"}
16821708
},
1709+
"GenericArn":{
1710+
"type":"string",
1711+
"max":2048,
1712+
"min":20,
1713+
"pattern":"arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+"
1714+
},
16831715
"GenericBoolean":{"type":"boolean"},
16841716
"GenericDouble":{"type":"double"},
16851717
"GenericString":{
@@ -2394,7 +2426,8 @@
23942426
"MaxResults":{
23952427
"shape":"CostCategoryMaxResults",
23962428
"box":true
2397-
}
2429+
},
2430+
"SupportedResourceTypes":{"shape":"ResourceTypesFilterInput"}
23982431
}
23992432
},
24002433
"ListCostCategoryDefinitionsResponse":{
@@ -2404,6 +2437,24 @@
24042437
"NextToken":{"shape":"NextPageToken"}
24052438
}
24062439
},
2440+
"ListCostCategoryResourceAssociationsRequest":{
2441+
"type":"structure",
2442+
"members":{
2443+
"CostCategoryArn":{"shape":"Arn"},
2444+
"NextToken":{"shape":"NextPageToken"},
2445+
"MaxResults":{
2446+
"shape":"CostCategoryMaxResults",
2447+
"box":true
2448+
}
2449+
}
2450+
},
2451+
"ListCostCategoryResourceAssociationsResponse":{
2452+
"type":"structure",
2453+
"members":{
2454+
"CostCategoryResourceAssociations":{"shape":"CostCategoryResourceAssociations"},
2455+
"NextToken":{"shape":"NextPageToken"}
2456+
}
2457+
},
24072458
"ListSavingsPlansPurchaseRecommendationGenerationRequest":{
24082459
"type":"structure",
24092460
"members":{
@@ -2909,6 +2960,20 @@
29092960
"min":0,
29102961
"pattern":"^([\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*)$"
29112962
},
2963+
"ResourceType":{
2964+
"type":"string",
2965+
"pattern":"^[-a-zA-Z0-9/_]+:[-a-zA-Z0-9/_]+"
2966+
},
2967+
"ResourceTypes":{
2968+
"type":"list",
2969+
"member":{"shape":"ResourceType"}
2970+
},
2971+
"ResourceTypesFilterInput":{
2972+
"type":"list",
2973+
"member":{"shape":"ResourceType"},
2974+
"max":5,
2975+
"min":0
2976+
},
29122977
"ResourceUtilization":{
29132978
"type":"structure",
29142979
"members":{

generator/ServiceModels/ce/ce-2017-10-25.docs.json

Lines changed: 102 additions & 50 deletions
Large diffs are not rendered by default.

generator/ServiceModels/ce/ce-2017-10-25.normal.json

Lines changed: 142 additions & 50 deletions
Large diffs are not rendered by default.

generator/ServiceModels/ce/ce-2017-10-25.paginators.json

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,26 @@
4343
"ListCostAllocationTagBackfillHistory": {
4444
"input_token": "NextToken",
4545
"output_token": "NextToken",
46-
"limit_key": "MaxResults"
46+
"limit_key": "MaxResults",
47+
"result_key": "BackfillRequests"
4748
},
4849
"ListCostAllocationTags": {
4950
"input_token": "NextToken",
5051
"output_token": "NextToken",
51-
"limit_key": "MaxResults"
52+
"limit_key": "MaxResults",
53+
"result_key": "CostAllocationTags"
5254
},
5355
"ListCostCategoryDefinitions": {
5456
"input_token": "NextToken",
5557
"output_token": "NextToken",
56-
"limit_key": "MaxResults"
58+
"limit_key": "MaxResults",
59+
"result_key": "CostCategoryReferences"
60+
},
61+
"ListCostCategoryResourceAssociations": {
62+
"input_token": "NextToken",
63+
"output_token": "NextToken",
64+
"limit_key": "MaxResults",
65+
"result_key": "CostCategoryResourceAssociations"
5766
}
5867
}
5968
}

sdk/code-analysis/ServiceAnalysis/CostExplorer/Generated/PropertyValueRules.xml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -593,6 +593,29 @@
593593
<max>8192</max>
594594
<pattern>[\S\s]*</pattern>
595595
</property-value-rule>
596+
<property-value-rule>
597+
<property>Amazon.CostExplorer.Model.ListCostCategoryResourceAssociationsRequest.CostCategoryArn</property>
598+
<min>20</min>
599+
<max>2048</max>
600+
<pattern>arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+</pattern>
601+
</property-value-rule>
602+
<property-value-rule>
603+
<property>Amazon.CostExplorer.Model.ListCostCategoryResourceAssociationsRequest.MaxResults</property>
604+
<min>1</min>
605+
<max>100</max>
606+
</property-value-rule>
607+
<property-value-rule>
608+
<property>Amazon.CostExplorer.Model.ListCostCategoryResourceAssociationsRequest.NextToken</property>
609+
<min>0</min>
610+
<max>8192</max>
611+
<pattern>[\S\s]*</pattern>
612+
</property-value-rule>
613+
<property-value-rule>
614+
<property>Amazon.CostExplorer.Model.ListCostCategoryResourceAssociationsResponse.NextToken</property>
615+
<min>0</min>
616+
<max>8192</max>
617+
<pattern>[\S\s]*</pattern>
618+
</property-value-rule>
596619
<property-value-rule>
597620
<property>Amazon.CostExplorer.Model.ListSavingsPlansPurchaseRecommendationGenerationRequest.NextPageToken</property>
598621
<min>0</min>
@@ -1015,6 +1038,24 @@
10151038
<property>Amazon.CostExplorer.Model.CostCategoryReference.NumberOfRules</property>
10161039
<min>0</min>
10171040
</property-value-rule>
1041+
<property-value-rule>
1042+
<property>Amazon.CostExplorer.Model.CostCategoryResourceAssociation.CostCategoryArn</property>
1043+
<min>20</min>
1044+
<max>2048</max>
1045+
<pattern>arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+</pattern>
1046+
</property-value-rule>
1047+
<property-value-rule>
1048+
<property>Amazon.CostExplorer.Model.CostCategoryResourceAssociation.CostCategoryName</property>
1049+
<min>1</min>
1050+
<max>50</max>
1051+
<pattern>^(?! )[\p{L}\p{N}\p{Z}-_]*(?&lt;! )$</pattern>
1052+
</property-value-rule>
1053+
<property-value-rule>
1054+
<property>Amazon.CostExplorer.Model.CostCategoryResourceAssociation.ResourceArn</property>
1055+
<min>20</min>
1056+
<max>2048</max>
1057+
<pattern>arn:aws[-a-z0-9]*:[a-z0-9]+:[-a-z0-9]*:[0-9]{12}:[-a-zA-Z0-9/:_]+</pattern>
1058+
</property-value-rule>
10181059
<property-value-rule>
10191060
<property>Amazon.CostExplorer.Model.CostCategoryRule.Value</property>
10201061
<min>1</min>

sdk/src/Services/CostExplorer/Generated/Model/CostCategory.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public partial class CostCategory
4848
/// <summary>
4949
/// Gets and sets the property CostCategoryArn.
5050
/// <para>
51-
/// The unique identifier for your Cost Category.
51+
/// The unique identifier for your cost category.
5252
/// </para>
5353
/// </summary>
5454
[AWSProperty(Required=true, Min=20, Max=2048)]
@@ -83,7 +83,7 @@ internal bool IsSetDefaultValue()
8383
/// <summary>
8484
/// Gets and sets the property EffectiveEnd.
8585
/// <para>
86-
/// The effective end date of your Cost Category.
86+
/// The effective end date of your cost category.
8787
/// </para>
8888
/// </summary>
8989
[AWSProperty(Min=20, Max=25)]
@@ -102,7 +102,7 @@ internal bool IsSetEffectiveEnd()
102102
/// <summary>
103103
/// Gets and sets the property EffectiveStart.
104104
/// <para>
105-
/// The effective start date of your Cost Category.
105+
/// The effective start date of your cost category.
106106
/// </para>
107107
/// </summary>
108108
[AWSProperty(Required=true, Min=20, Max=25)]
@@ -162,7 +162,7 @@ internal bool IsSetProcessingStatus()
162162
/// Gets and sets the property Rules.
163163
/// <para>
164164
/// The rules are processed in order. If there are multiple rules that match the line
165-
/// item, then the first rule to match is used to determine that Cost Category value.
165+
/// item, then the first rule to match is used to determine that cost category value.
166166
///
167167
/// </para>
168168
/// <para />
@@ -203,7 +203,7 @@ internal bool IsSetRuleVersion()
203203
/// <summary>
204204
/// Gets and sets the property SplitChargeRules.
205205
/// <para>
206-
/// The split charge rules that are used to allocate your charges between your Cost Category
206+
/// The split charge rules that are used to allocate your charges between your cost category
207207
/// values.
208208
/// </para>
209209
/// <para />

sdk/src/Services/CostExplorer/Generated/Model/CostCategoryReference.cs

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
namespace Amazon.CostExplorer.Model
3131
{
3232
/// <summary>
33-
/// A reference to a Cost Category containing only enough information to identify the
33+
/// A reference to a cost category containing only enough information to identify the
3434
/// Cost Category.
3535
///
3636
///
3737
/// <para>
38-
/// You can use this information to retrieve the full Cost Category information using
38+
/// You can use this information to retrieve the full cost category information using
3939
/// <c>DescribeCostCategory</c>.
4040
/// </para>
4141
/// </summary>
@@ -48,12 +48,13 @@ public partial class CostCategoryReference
4848
private string _name;
4949
private int? _numberOfRules;
5050
private List<CostCategoryProcessingStatus> _processingStatus = AWSConfigs.InitializeCollections ? new List<CostCategoryProcessingStatus>() : null;
51+
private List<string> _supportedResourceTypes = AWSConfigs.InitializeCollections ? new List<string>() : null;
5152
private List<string> _values = AWSConfigs.InitializeCollections ? new List<string>() : null;
5253

5354
/// <summary>
5455
/// Gets and sets the property CostCategoryArn.
5556
/// <para>
56-
/// The unique identifier for your Cost Category.
57+
/// The unique identifier for your cost category.
5758
/// </para>
5859
/// </summary>
5960
[AWSProperty(Min=20, Max=2048)]
@@ -88,7 +89,7 @@ internal bool IsSetDefaultValue()
8889
/// <summary>
8990
/// Gets and sets the property EffectiveEnd.
9091
/// <para>
91-
/// The Cost Category's effective end date.
92+
/// The cost category's effective end date.
9293
/// </para>
9394
/// </summary>
9495
[AWSProperty(Min=20, Max=25)]
@@ -107,7 +108,7 @@ internal bool IsSetEffectiveEnd()
107108
/// <summary>
108109
/// Gets and sets the property EffectiveStart.
109110
/// <para>
110-
/// The Cost Category's effective start date.
111+
/// The cost category's effective start date.
111112
/// </para>
112113
/// </summary>
113114
[AWSProperty(Min=20, Max=25)]
@@ -142,7 +143,7 @@ internal bool IsSetName()
142143
/// <summary>
143144
/// Gets and sets the property NumberOfRules.
144145
/// <para>
145-
/// The number of rules that are associated with a specific Cost Category.
146+
/// The number of rules that are associated with a specific cost category.
146147
/// </para>
147148
/// </summary>
148149
[AWSProperty(Min=0)]
@@ -182,6 +183,29 @@ internal bool IsSetProcessingStatus()
182183
return this._processingStatus != null && (this._processingStatus.Count > 0 || !AWSConfigs.InitializeCollections);
183184
}
184185

186+
/// <summary>
187+
/// Gets and sets the property SupportedResourceTypes.
188+
/// <para>
189+
/// The resource types supported by a specific cost category.
190+
/// </para>
191+
/// <para />
192+
/// Starting with version 4 of the SDK this property will default to null. If no data for this property is returned
193+
/// from the service the property will also be null. This was changed to improve performance and allow the SDK and caller
194+
/// to distinguish between a property not set or a property being empty to clear out a value. To retain the previous
195+
/// SDK behavior set the AWSConfigs.InitializeCollections static property to true.
196+
/// </summary>
197+
public List<string> SupportedResourceTypes
198+
{
199+
get { return this._supportedResourceTypes; }
200+
set { this._supportedResourceTypes = value; }
201+
}
202+
203+
// Check to see if SupportedResourceTypes property is set
204+
internal bool IsSetSupportedResourceTypes()
205+
{
206+
return this._supportedResourceTypes != null && (this._supportedResourceTypes.Count > 0 || !AWSConfigs.InitializeCollections);
207+
}
208+
185209
/// <summary>
186210
/// Gets and sets the property Values.
187211
/// <para>

0 commit comments

Comments
 (0)