Skip to content

Commit

Permalink
feat(client-cost-optimization-hub): This release adds savings percent…
Browse files Browse the repository at this point in the history
…age support to the ListRecommendationSummaries API.
  • Loading branch information
awstools committed Aug 6, 2024
1 parent f35898e commit 82ea670
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export interface ListRecommendationSummariesCommandOutput
* },
* groupBy: "STRING_VALUE", // required
* maxResults: Number("int"),
* metrics: [ // SummaryMetricsList
* "SavingsPercentage",
* ],
* nextToken: "STRING_VALUE",
* };
* const command = new ListRecommendationSummariesCommand(input);
Expand All @@ -98,6 +101,9 @@ export interface ListRecommendationSummariesCommandOutput
* // ],
* // groupBy: "STRING_VALUE",
* // currencyCode: "STRING_VALUE",
* // metrics: { // SummaryMetricsResult
* // savingsPercentage: "STRING_VALUE",
* // },
* // nextToken: "STRING_VALUE",
* // };
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export interface UpdateEnrollmentStatusCommandOutput extends UpdateEnrollmentSta
/**
* <p>Updates the enrollment (opt in and opt out) status of an account to the Cost Optimization
* Hub service.</p>
* <p>If the account is a management account of an organization, this action can also be used to
* enroll member accounts of the organization.</p>
* <p>If the account is a management account or delegated administrator of an organization, this
* action can also be used to enroll member accounts of the organization.</p>
* <p>You must have the appropriate permissions to opt in to Cost Optimization Hub and to view
* its recommendations. When you opt in, Cost Optimization Hub automatically creates a
* service-linked role in your account to access its data.</p>
Expand Down
53 changes: 49 additions & 4 deletions clients/client-cost-optimization-hub/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2233,7 +2233,7 @@ export interface ListEnrollmentStatusesResponse {

/**
* <p>The enrollment status of all member accounts in the organization if the account is the
* management account.</p>
* management account or delegated administrator.</p>
* @public
*/
includeMemberAccounts?: boolean;
Expand Down Expand Up @@ -2536,6 +2536,19 @@ export interface ListRecommendationsResponse {
nextToken?: string;
}

/**
* @public
* @enum
*/
export const SummaryMetrics = {
SAVINGS_PERCENTAGE: "SavingsPercentage",
} as const;

/**
* @public
*/
export type SummaryMetrics = (typeof SummaryMetrics)[keyof typeof SummaryMetrics];

/**
* @public
*/
Expand All @@ -2554,11 +2567,18 @@ export interface ListRecommendationSummariesRequest {
groupBy: string | undefined;

/**
* <p>The maximum number of recommendations that are returned for the request.</p>
* <p>The maximum number of recommendations to be returned for the request.</p>
* @public
*/
maxResults?: number;

/**
* <p>Additional metrics to be returned for the request. The only valid value is
* <code>savingsPercentage</code>.</p>
* @public
*/
metrics?: SummaryMetrics[];

/**
* <p>The token to retrieve the next set of results.</p>
* @public
Expand Down Expand Up @@ -2591,6 +2611,24 @@ export interface RecommendationSummary {
recommendationCount?: number;
}

/**
* <p>The results or descriptions for the additional metrics, based on whether the metrics were
* or were not requested.</p>
* @public
*/
export interface SummaryMetricsResult {
/**
* <p>The savings percentage based on your Amazon Web Services spend over the past 30
* days.</p>
* <note>
* <p>Savings percentage is only supported when filtering by Region, account ID, or
* tags.</p>
* </note>
* @public
*/
savingsPercentage?: string;
}

/**
* @public
*/
Expand All @@ -2602,7 +2640,7 @@ export interface ListRecommendationSummariesResponse {
estimatedTotalDedupedSavings?: number;

/**
* <p>List of all savings recommendations.</p>
* <p>A list of all savings recommendations.</p>
* @public
*/
items?: RecommendationSummary[];
Expand All @@ -2619,6 +2657,13 @@ export interface ListRecommendationSummariesResponse {
*/
currencyCode?: string;

/**
* <p>The results or descriptions for the additional metrics, based on whether the metrics were
* or were not requested.</p>
* @public
*/
metrics?: SummaryMetricsResult;

/**
* <p>The token to retrieve the next set of results.</p>
* @public
Expand All @@ -2638,7 +2683,7 @@ export interface UpdateEnrollmentStatusRequest {

/**
* <p>Indicates whether to enroll member accounts of the organization if the account is the
* management account.</p>
* management account or delegated administrator.</p>
* @public
*/
includeMemberAccounts?: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ import {
SavingsPlansCostCalculation,
SavingsPlansPricing,
StorageConfiguration,
SummaryMetrics,
Tag,
ThrottlingException,
UpdateEnrollmentStatusRequest,
Expand Down Expand Up @@ -476,6 +477,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont

// se_ResourceTypeList omitted.

// se_SummaryMetricsList omitted.

// se_Tag omitted.

// se_TagList omitted.
Expand Down Expand Up @@ -749,6 +752,7 @@ const de_ListRecommendationSummariesResponse = (
estimatedTotalDedupedSavings: __limitedParseDouble,
groupBy: __expectString,
items: (_: any) => de_RecommendationSummariesList(_, context),
metrics: _json,
nextToken: __expectString,
}) as any;
};
Expand Down Expand Up @@ -1063,6 +1067,8 @@ const de_StorageConfiguration = (output: any, context: __SerdeContext): StorageC
}) as any;
};

// de_SummaryMetricsResult omitted.

// de_Tag omitted.

// de_TagList omitted.
Expand Down
61 changes: 56 additions & 5 deletions codegen/sdk-codegen/aws-models/cost-optimization-hub.json
Original file line number Diff line number Diff line change
Expand Up @@ -1943,7 +1943,7 @@
"includeMemberAccounts": {
"target": "smithy.api#Boolean",
"traits": {
"smithy.api#documentation": "<p>The enrollment status of all member accounts in the organization if the account is the\n management account.</p>"
"smithy.api#documentation": "<p>The enrollment status of all member accounts in the organization if the account is the\n management account or delegated administrator.</p>"
}
},
"nextToken": {
Expand Down Expand Up @@ -2006,13 +2006,20 @@
"maxResults": {
"target": "com.amazonaws.costoptimizationhub#MaxResults",
"traits": {
"smithy.api#documentation": "<p>The maximum number of recommendations that are returned for the request.</p>",
"smithy.api#documentation": "<p>The maximum number of recommendations to be returned for the request.</p>",
"smithy.api#range": {
"min": 0,
"max": 1000
}
}
},
"metrics": {
"target": "com.amazonaws.costoptimizationhub#SummaryMetricsList",
"traits": {
"smithy.api#documentation": "<p>Additional metrics to be returned for the request. The only valid value is\n <code>savingsPercentage</code>.</p>",
"smithy.api#tags": ["delegatedAdmin"]
}
},
"nextToken": {
"target": "smithy.api#String",
"traits": {
Expand All @@ -2036,7 +2043,7 @@
"items": {
"target": "com.amazonaws.costoptimizationhub#RecommendationSummariesList",
"traits": {
"smithy.api#documentation": "<p>List of all savings recommendations.</p>"
"smithy.api#documentation": "<p>A list of all savings recommendations.</p>"
}
},
"groupBy": {
Expand All @@ -2051,6 +2058,13 @@
"smithy.api#documentation": "<p>The currency code used for the recommendation.</p>"
}
},
"metrics": {
"target": "com.amazonaws.costoptimizationhub#SummaryMetricsResult",
"traits": {
"smithy.api#documentation": "<p>The results or descriptions for the additional metrics, based on whether the metrics were\n or were not requested.</p>",
"smithy.api#tags": ["delegatedAdmin"]
}
},
"nextToken": {
"target": "smithy.api#String",
"traits": {
Expand Down Expand Up @@ -3341,6 +3355,43 @@
"smithy.api#documentation": "<p>The storage configuration used for recommendations.</p>"
}
},
"com.amazonaws.costoptimizationhub#SummaryMetrics": {
"type": "enum",
"members": {
"SAVINGS_PERCENTAGE": {
"target": "smithy.api#Unit",
"traits": {
"smithy.api#enumValue": "SavingsPercentage"
}
}
}
},
"com.amazonaws.costoptimizationhub#SummaryMetricsList": {
"type": "list",
"member": {
"target": "com.amazonaws.costoptimizationhub#SummaryMetrics"
},
"traits": {
"smithy.api#length": {
"min": 1,
"max": 100
}
}
},
"com.amazonaws.costoptimizationhub#SummaryMetricsResult": {
"type": "structure",
"members": {
"savingsPercentage": {
"target": "smithy.api#String",
"traits": {
"smithy.api#documentation": "<p>The savings percentage based on your Amazon Web Services spend over the past 30\n days.</p>\n <note>\n <p>Savings percentage is only supported when filtering by Region, account ID, or\n tags.</p>\n </note>"
}
}
},
"traits": {
"smithy.api#documentation": "<p>The results or descriptions for the additional metrics, based on whether the metrics were\n or were not requested.</p>"
}
},
"com.amazonaws.costoptimizationhub#Tag": {
"type": "structure",
"members": {
Expand Down Expand Up @@ -3409,7 +3460,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Updates the enrollment (opt in and opt out) status of an account to the Cost Optimization\n Hub service.</p>\n <p>If the account is a management account of an organization, this action can also be used to\n enroll member accounts of the organization.</p>\n <p>You must have the appropriate permissions to opt in to Cost Optimization Hub and to view\n its recommendations. When you opt in, Cost Optimization Hub automatically creates a\n service-linked role in your account to access its data.</p>"
"smithy.api#documentation": "<p>Updates the enrollment (opt in and opt out) status of an account to the Cost Optimization\n Hub service.</p>\n <p>If the account is a management account or delegated administrator of an organization, this\n action can also be used to enroll member accounts of the organization.</p>\n <p>You must have the appropriate permissions to opt in to Cost Optimization Hub and to view\n its recommendations. When you opt in, Cost Optimization Hub automatically creates a\n service-linked role in your account to access its data.</p>"
}
},
"com.amazonaws.costoptimizationhub#UpdateEnrollmentStatusRequest": {
Expand All @@ -3425,7 +3476,7 @@
"includeMemberAccounts": {
"target": "smithy.api#Boolean",
"traits": {
"smithy.api#documentation": "<p>Indicates whether to enroll member accounts of the organization if the account is the\n management account.</p>"
"smithy.api#documentation": "<p>Indicates whether to enroll member accounts of the organization if the account is the\n management account or delegated administrator.</p>"
}
}
},
Expand Down

0 comments on commit 82ea670

Please sign in to comment.