-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-cost-explorer): This release introduces the new API 'GetA…
…pproximateUsageRecords', which retrieves estimated usage records for hourly granularity or resource-level data at daily granularity.
- Loading branch information
awstools
committed
Feb 28, 2024
1 parent
4528e88
commit 83885d0
Showing
8 changed files
with
411 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
99 changes: 99 additions & 0 deletions
99
clients/client-cost-explorer/src/commands/GetApproximateUsageRecordsCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// smithy-typescript generated code | ||
import { getEndpointPlugin } from "@smithy/middleware-endpoint"; | ||
import { getSerdePlugin } from "@smithy/middleware-serde"; | ||
import { Command as $Command } from "@smithy/smithy-client"; | ||
import { MetadataBearer as __MetadataBearer } from "@smithy/types"; | ||
|
||
import { CostExplorerClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../CostExplorerClient"; | ||
import { commonParams } from "../endpoint/EndpointParameters"; | ||
import { GetApproximateUsageRecordsRequest, GetApproximateUsageRecordsResponse } from "../models/models_0"; | ||
import { de_GetApproximateUsageRecordsCommand, se_GetApproximateUsageRecordsCommand } from "../protocols/Aws_json1_1"; | ||
|
||
/** | ||
* @public | ||
*/ | ||
export { __MetadataBearer, $Command }; | ||
/** | ||
* @public | ||
* | ||
* The input for {@link GetApproximateUsageRecordsCommand}. | ||
*/ | ||
export interface GetApproximateUsageRecordsCommandInput extends GetApproximateUsageRecordsRequest {} | ||
/** | ||
* @public | ||
* | ||
* The output of {@link GetApproximateUsageRecordsCommand}. | ||
*/ | ||
export interface GetApproximateUsageRecordsCommandOutput extends GetApproximateUsageRecordsResponse, __MetadataBearer {} | ||
|
||
/** | ||
* @public | ||
* <p>Retrieves estimated usage records for hourly granularity or resource-level data at daily | ||
* granularity.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { CostExplorerClient, GetApproximateUsageRecordsCommand } from "@aws-sdk/client-cost-explorer"; // ES Modules import | ||
* // const { CostExplorerClient, GetApproximateUsageRecordsCommand } = require("@aws-sdk/client-cost-explorer"); // CommonJS import | ||
* const client = new CostExplorerClient(config); | ||
* const input = { // GetApproximateUsageRecordsRequest | ||
* Granularity: "DAILY" || "MONTHLY" || "HOURLY", // required | ||
* Services: [ // UsageServices | ||
* "STRING_VALUE", | ||
* ], | ||
* ApproximationDimension: "SERVICE" || "RESOURCE", // required | ||
* }; | ||
* const command = new GetApproximateUsageRecordsCommand(input); | ||
* const response = await client.send(command); | ||
* // { // GetApproximateUsageRecordsResponse | ||
* // Services: { // ApproximateUsageRecordsPerService | ||
* // "<keys>": Number("long"), | ||
* // }, | ||
* // TotalRecords: Number("long"), | ||
* // LookbackPeriod: { // DateInterval | ||
* // Start: "STRING_VALUE", // required | ||
* // End: "STRING_VALUE", // required | ||
* // }, | ||
* // }; | ||
* | ||
* ``` | ||
* | ||
* @param GetApproximateUsageRecordsCommandInput - {@link GetApproximateUsageRecordsCommandInput} | ||
* @returns {@link GetApproximateUsageRecordsCommandOutput} | ||
* @see {@link GetApproximateUsageRecordsCommandInput} for command's `input` shape. | ||
* @see {@link GetApproximateUsageRecordsCommandOutput} for command's `response` shape. | ||
* @see {@link CostExplorerClientResolvedConfig | config} for CostExplorerClient's `config` shape. | ||
* | ||
* @throws {@link DataUnavailableException} (client fault) | ||
* <p>The requested data is unavailable.</p> | ||
* | ||
* @throws {@link LimitExceededException} (client fault) | ||
* <p>You made too many calls in a short period of time. Try again later.</p> | ||
* | ||
* @throws {@link CostExplorerServiceException} | ||
* <p>Base exception class for all service exceptions from CostExplorer service.</p> | ||
* | ||
*/ | ||
export class GetApproximateUsageRecordsCommand extends $Command | ||
.classBuilder< | ||
GetApproximateUsageRecordsCommandInput, | ||
GetApproximateUsageRecordsCommandOutput, | ||
CostExplorerClientResolvedConfig, | ||
ServiceInputTypes, | ||
ServiceOutputTypes | ||
>() | ||
.ep({ | ||
...commonParams, | ||
}) | ||
.m(function (this: any, Command: any, cs: any, config: CostExplorerClientResolvedConfig, o: any) { | ||
return [ | ||
getSerdePlugin(config, this.serialize, this.deserialize), | ||
getEndpointPlugin(config, Command.getEndpointParameterInstructions()), | ||
]; | ||
}) | ||
.s("AWSInsightsIndexService", "GetApproximateUsageRecords", {}) | ||
.n("CostExplorerClient", "GetApproximateUsageRecordsCommand") | ||
.f(void 0, void 0) | ||
.ser(se_GetApproximateUsageRecordsCommand) | ||
.de(de_GetApproximateUsageRecordsCommand) | ||
.build() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.