From 3398a2ac167c7f8f53a1cd45b4795d1e15a8d9c6 Mon Sep 17 00:00:00 2001 From: awstools Date: Fri, 20 Dec 2024 19:13:28 +0000 Subject: [PATCH] feat(client-billing): Added new API's for defining and fetching Billing Views. --- clients/client-billing/README.md | 72 + clients/client-billing/package.json | 4 +- clients/client-billing/src/Billing.ts | 189 ++ clients/client-billing/src/BillingClient.ts | 39 +- .../src/commands/CreateBillingViewCommand.ts | 149 ++ .../src/commands/DeleteBillingViewCommand.ts | 112 ++ .../src/commands/GetBillingViewCommand.ts | 139 ++ .../src/commands/GetResourcePolicyCommand.ts | 114 ++ .../src/commands/ListBillingViewsCommand.ts | 10 +- .../ListSourceViewsForBillingViewCommand.ts | 123 ++ .../commands/ListTagsForResourceCommand.ts | 118 ++ .../src/commands/TagResourceCommand.ts | 118 ++ .../src/commands/UntagResourceCommand.ts | 115 ++ .../src/commands/UpdateBillingViewCommand.ts | 144 ++ clients/client-billing/src/commands/index.ts | 9 + clients/client-billing/src/models/models_0.ts | 819 ++++++++- .../ListSourceViewsForBillingViewPaginator.ts | 24 + .../client-billing/src/pagination/index.ts | 1 + .../src/protocols/Aws_json1_0.ts | 522 ++++++ codegen/sdk-codegen/aws-models/billing.json | 1519 +++++++++++++++-- 20 files changed, 4160 insertions(+), 180 deletions(-) create mode 100644 clients/client-billing/src/commands/CreateBillingViewCommand.ts create mode 100644 clients/client-billing/src/commands/DeleteBillingViewCommand.ts create mode 100644 clients/client-billing/src/commands/GetBillingViewCommand.ts create mode 100644 clients/client-billing/src/commands/GetResourcePolicyCommand.ts create mode 100644 clients/client-billing/src/commands/ListSourceViewsForBillingViewCommand.ts create mode 100644 clients/client-billing/src/commands/ListTagsForResourceCommand.ts create mode 100644 clients/client-billing/src/commands/TagResourceCommand.ts create mode 100644 clients/client-billing/src/commands/UntagResourceCommand.ts create mode 100644 clients/client-billing/src/commands/UpdateBillingViewCommand.ts create mode 100644 clients/client-billing/src/pagination/ListSourceViewsForBillingViewPaginator.ts diff --git a/clients/client-billing/README.md b/clients/client-billing/README.md index 06673d4148e66..246fd0e4b7d3c 100644 --- a/clients/client-billing/README.md +++ b/clients/client-billing/README.md @@ -209,6 +209,38 @@ see LICENSE for more information. ## Client Commands (Operations List) +
+ +CreateBillingView + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/CreateBillingViewCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/CreateBillingViewCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/CreateBillingViewCommandOutput/) + +
+
+ +DeleteBillingView + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/DeleteBillingViewCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/DeleteBillingViewCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/DeleteBillingViewCommandOutput/) + +
+
+ +GetBillingView + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/GetBillingViewCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/GetBillingViewCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/GetBillingViewCommandOutput/) + +
+
+ +GetResourcePolicy + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/GetResourcePolicyCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/GetResourcePolicyCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/GetResourcePolicyCommandOutput/) + +
ListBillingViews @@ -217,3 +249,43 @@ ListBillingViews [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/ListBillingViewsCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/ListBillingViewsCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/ListBillingViewsCommandOutput/)
+
+ +ListSourceViewsForBillingView + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/ListSourceViewsForBillingViewCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/ListSourceViewsForBillingViewCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/ListSourceViewsForBillingViewCommandOutput/) + +
+
+ +ListTagsForResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/ListTagsForResourceCommandOutput/) + +
+
+ +TagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/TagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/TagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/TagResourceCommandOutput/) + +
+
+ +UntagResource + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/UntagResourceCommandOutput/) + +
+
+ +UpdateBillingView + + +[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/billing/command/UpdateBillingViewCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/UpdateBillingViewCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-billing/Interface/UpdateBillingViewCommandOutput/) + +
diff --git a/clients/client-billing/package.json b/clients/client-billing/package.json index 73bb6f3e357d8..20a788b82ce85 100644 --- a/clients/client-billing/package.json +++ b/clients/client-billing/package.json @@ -58,7 +58,9 @@ "@smithy/util-middleware": "^3.0.11", "@smithy/util-retry": "^3.0.11", "@smithy/util-utf8": "^3.0.0", - "tslib": "^2.6.2" + "@types/uuid": "^9.0.1", + "tslib": "^2.6.2", + "uuid": "^9.0.1" }, "devDependencies": { "@tsconfig/node16": "16.1.3", diff --git a/clients/client-billing/src/Billing.ts b/clients/client-billing/src/Billing.ts index 1ad84ad2f1dba..081c89e2eba46 100644 --- a/clients/client-billing/src/Billing.ts +++ b/clients/client-billing/src/Billing.ts @@ -3,20 +3,136 @@ import { createAggregatedClient } from "@smithy/smithy-client"; import { HttpHandlerOptions as __HttpHandlerOptions } from "@smithy/types"; import { BillingClient, BillingClientConfig } from "./BillingClient"; +import { + CreateBillingViewCommand, + CreateBillingViewCommandInput, + CreateBillingViewCommandOutput, +} from "./commands/CreateBillingViewCommand"; +import { + DeleteBillingViewCommand, + DeleteBillingViewCommandInput, + DeleteBillingViewCommandOutput, +} from "./commands/DeleteBillingViewCommand"; +import { + GetBillingViewCommand, + GetBillingViewCommandInput, + GetBillingViewCommandOutput, +} from "./commands/GetBillingViewCommand"; +import { + GetResourcePolicyCommand, + GetResourcePolicyCommandInput, + GetResourcePolicyCommandOutput, +} from "./commands/GetResourcePolicyCommand"; import { ListBillingViewsCommand, ListBillingViewsCommandInput, ListBillingViewsCommandOutput, } from "./commands/ListBillingViewsCommand"; +import { + ListSourceViewsForBillingViewCommand, + ListSourceViewsForBillingViewCommandInput, + ListSourceViewsForBillingViewCommandOutput, +} from "./commands/ListSourceViewsForBillingViewCommand"; +import { + ListTagsForResourceCommand, + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { + UntagResourceCommand, + UntagResourceCommandInput, + UntagResourceCommandOutput, +} from "./commands/UntagResourceCommand"; +import { + UpdateBillingViewCommand, + UpdateBillingViewCommandInput, + UpdateBillingViewCommandOutput, +} from "./commands/UpdateBillingViewCommand"; const commands = { + CreateBillingViewCommand, + DeleteBillingViewCommand, + GetBillingViewCommand, + GetResourcePolicyCommand, ListBillingViewsCommand, + ListSourceViewsForBillingViewCommand, + ListTagsForResourceCommand, + TagResourceCommand, + UntagResourceCommand, + UpdateBillingViewCommand, }; export interface Billing { + /** + * @see {@link CreateBillingViewCommand} + */ + createBillingView( + args: CreateBillingViewCommandInput, + options?: __HttpHandlerOptions + ): Promise; + createBillingView( + args: CreateBillingViewCommandInput, + cb: (err: any, data?: CreateBillingViewCommandOutput) => void + ): void; + createBillingView( + args: CreateBillingViewCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: CreateBillingViewCommandOutput) => void + ): void; + + /** + * @see {@link DeleteBillingViewCommand} + */ + deleteBillingView( + args: DeleteBillingViewCommandInput, + options?: __HttpHandlerOptions + ): Promise; + deleteBillingView( + args: DeleteBillingViewCommandInput, + cb: (err: any, data?: DeleteBillingViewCommandOutput) => void + ): void; + deleteBillingView( + args: DeleteBillingViewCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: DeleteBillingViewCommandOutput) => void + ): void; + + /** + * @see {@link GetBillingViewCommand} + */ + getBillingView( + args: GetBillingViewCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getBillingView(args: GetBillingViewCommandInput, cb: (err: any, data?: GetBillingViewCommandOutput) => void): void; + getBillingView( + args: GetBillingViewCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetBillingViewCommandOutput) => void + ): void; + + /** + * @see {@link GetResourcePolicyCommand} + */ + getResourcePolicy( + args: GetResourcePolicyCommandInput, + options?: __HttpHandlerOptions + ): Promise; + getResourcePolicy( + args: GetResourcePolicyCommandInput, + cb: (err: any, data?: GetResourcePolicyCommandOutput) => void + ): void; + getResourcePolicy( + args: GetResourcePolicyCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: GetResourcePolicyCommandOutput) => void + ): void; + /** * @see {@link ListBillingViewsCommand} */ + listBillingViews(): Promise; listBillingViews( args: ListBillingViewsCommandInput, options?: __HttpHandlerOptions @@ -30,6 +146,79 @@ export interface Billing { options: __HttpHandlerOptions, cb: (err: any, data?: ListBillingViewsCommandOutput) => void ): void; + + /** + * @see {@link ListSourceViewsForBillingViewCommand} + */ + listSourceViewsForBillingView( + args: ListSourceViewsForBillingViewCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listSourceViewsForBillingView( + args: ListSourceViewsForBillingViewCommandInput, + cb: (err: any, data?: ListSourceViewsForBillingViewCommandOutput) => void + ): void; + listSourceViewsForBillingView( + args: ListSourceViewsForBillingViewCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListSourceViewsForBillingViewCommandOutput) => void + ): void; + + /** + * @see {@link ListTagsForResourceCommand} + */ + listTagsForResource( + args: ListTagsForResourceCommandInput, + options?: __HttpHandlerOptions + ): Promise; + listTagsForResource( + args: ListTagsForResourceCommandInput, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + listTagsForResource( + args: ListTagsForResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: ListTagsForResourceCommandOutput) => void + ): void; + + /** + * @see {@link TagResourceCommand} + */ + tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void; + tagResource( + args: TagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: TagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UntagResourceCommand} + */ + untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise; + untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void; + untagResource( + args: UntagResourceCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UntagResourceCommandOutput) => void + ): void; + + /** + * @see {@link UpdateBillingViewCommand} + */ + updateBillingView( + args: UpdateBillingViewCommandInput, + options?: __HttpHandlerOptions + ): Promise; + updateBillingView( + args: UpdateBillingViewCommandInput, + cb: (err: any, data?: UpdateBillingViewCommandOutput) => void + ): void; + updateBillingView( + args: UpdateBillingViewCommandInput, + options: __HttpHandlerOptions, + cb: (err: any, data?: UpdateBillingViewCommandOutput) => void + ): void; } /** diff --git a/clients/client-billing/src/BillingClient.ts b/clients/client-billing/src/BillingClient.ts index ba3056ac65d32..7838eb6f870b2 100644 --- a/clients/client-billing/src/BillingClient.ts +++ b/clients/client-billing/src/BillingClient.ts @@ -53,7 +53,22 @@ import { HttpAuthSchemeResolvedConfig, resolveHttpAuthSchemeConfig, } from "./auth/httpAuthSchemeProvider"; +import { CreateBillingViewCommandInput, CreateBillingViewCommandOutput } from "./commands/CreateBillingViewCommand"; +import { DeleteBillingViewCommandInput, DeleteBillingViewCommandOutput } from "./commands/DeleteBillingViewCommand"; +import { GetBillingViewCommandInput, GetBillingViewCommandOutput } from "./commands/GetBillingViewCommand"; +import { GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput } from "./commands/GetResourcePolicyCommand"; import { ListBillingViewsCommandInput, ListBillingViewsCommandOutput } from "./commands/ListBillingViewsCommand"; +import { + ListSourceViewsForBillingViewCommandInput, + ListSourceViewsForBillingViewCommandOutput, +} from "./commands/ListSourceViewsForBillingViewCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "./commands/ListTagsForResourceCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand"; +import { UpdateBillingViewCommandInput, UpdateBillingViewCommandOutput } from "./commands/UpdateBillingViewCommand"; import { ClientInputEndpointParameters, ClientResolvedEndpointParameters, @@ -68,12 +83,32 @@ export { __Client }; /** * @public */ -export type ServiceInputTypes = ListBillingViewsCommandInput; +export type ServiceInputTypes = + | CreateBillingViewCommandInput + | DeleteBillingViewCommandInput + | GetBillingViewCommandInput + | GetResourcePolicyCommandInput + | ListBillingViewsCommandInput + | ListSourceViewsForBillingViewCommandInput + | ListTagsForResourceCommandInput + | TagResourceCommandInput + | UntagResourceCommandInput + | UpdateBillingViewCommandInput; /** * @public */ -export type ServiceOutputTypes = ListBillingViewsCommandOutput; +export type ServiceOutputTypes = + | CreateBillingViewCommandOutput + | DeleteBillingViewCommandOutput + | GetBillingViewCommandOutput + | GetResourcePolicyCommandOutput + | ListBillingViewsCommandOutput + | ListSourceViewsForBillingViewCommandOutput + | ListTagsForResourceCommandOutput + | TagResourceCommandOutput + | UntagResourceCommandOutput + | UpdateBillingViewCommandOutput; /** * @public diff --git a/clients/client-billing/src/commands/CreateBillingViewCommand.ts b/clients/client-billing/src/commands/CreateBillingViewCommand.ts new file mode 100644 index 0000000000000..2d9779fa2f6fe --- /dev/null +++ b/clients/client-billing/src/commands/CreateBillingViewCommand.ts @@ -0,0 +1,149 @@ +// 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 { BillingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { + CreateBillingViewRequest, + CreateBillingViewRequestFilterSensitiveLog, + CreateBillingViewResponse, +} from "../models/models_0"; +import { de_CreateBillingViewCommand, se_CreateBillingViewCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link CreateBillingViewCommand}. + */ +export interface CreateBillingViewCommandInput extends CreateBillingViewRequest {} +/** + * @public + * + * The output of {@link CreateBillingViewCommand}. + */ +export interface CreateBillingViewCommandOutput extends CreateBillingViewResponse, __MetadataBearer {} + +/** + *

+ * Creates a billing view with the specified billing view attributes. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BillingClient, CreateBillingViewCommand } from "@aws-sdk/client-billing"; // ES Modules import + * // const { BillingClient, CreateBillingViewCommand } = require("@aws-sdk/client-billing"); // CommonJS import + * const client = new BillingClient(config); + * const input = { // CreateBillingViewRequest + * name: "STRING_VALUE", // required + * description: "STRING_VALUE", + * sourceViews: [ // BillingViewSourceViewsList // required + * "STRING_VALUE", + * ], + * dataFilterExpression: { // Expression + * dimensions: { // DimensionValues + * key: "LINKED_ACCOUNT", // required + * values: [ // Values // required + * "STRING_VALUE", + * ], + * }, + * tags: { // TagValues + * key: "STRING_VALUE", // required + * values: [ // required + * "STRING_VALUE", + * ], + * }, + * }, + * clientToken: "STRING_VALUE", + * resourceTags: [ // ResourceTagList + * { // ResourceTag + * key: "STRING_VALUE", // required + * value: "STRING_VALUE", + * }, + * ], + * }; + * const command = new CreateBillingViewCommand(input); + * const response = await client.send(command); + * // { // CreateBillingViewResponse + * // arn: "STRING_VALUE", // required + * // createdAt: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param CreateBillingViewCommandInput - {@link CreateBillingViewCommandInput} + * @returns {@link CreateBillingViewCommandOutput} + * @see {@link CreateBillingViewCommandInput} for command's `input` shape. + * @see {@link CreateBillingViewCommandOutput} for command's `response` shape. + * @see {@link BillingClientResolvedConfig | config} for BillingClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You don't have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

+ * The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. + *

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

+ * You've reached the limit of resources you can create, or exceeded the size of an individual resource. + *

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling. + *

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an Amazon Web Services service. + *

+ * + * @throws {@link BillingServiceException} + *

Base exception class for all service exceptions from Billing service.

+ * + * @public + */ +export class CreateBillingViewCommand extends $Command + .classBuilder< + CreateBillingViewCommandInput, + CreateBillingViewCommandOutput, + BillingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BillingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBilling", "CreateBillingView", {}) + .n("BillingClient", "CreateBillingViewCommand") + .f(CreateBillingViewRequestFilterSensitiveLog, void 0) + .ser(se_CreateBillingViewCommand) + .de(de_CreateBillingViewCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: CreateBillingViewRequest; + output: CreateBillingViewResponse; + }; + sdk: { + input: CreateBillingViewCommandInput; + output: CreateBillingViewCommandOutput; + }; + }; +} diff --git a/clients/client-billing/src/commands/DeleteBillingViewCommand.ts b/clients/client-billing/src/commands/DeleteBillingViewCommand.ts new file mode 100644 index 0000000000000..634561d1c9660 --- /dev/null +++ b/clients/client-billing/src/commands/DeleteBillingViewCommand.ts @@ -0,0 +1,112 @@ +// 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 { BillingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { DeleteBillingViewRequest, DeleteBillingViewResponse } from "../models/models_0"; +import { de_DeleteBillingViewCommand, se_DeleteBillingViewCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link DeleteBillingViewCommand}. + */ +export interface DeleteBillingViewCommandInput extends DeleteBillingViewRequest {} +/** + * @public + * + * The output of {@link DeleteBillingViewCommand}. + */ +export interface DeleteBillingViewCommandOutput extends DeleteBillingViewResponse, __MetadataBearer {} + +/** + *

Deletes the specified billing view.

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BillingClient, DeleteBillingViewCommand } from "@aws-sdk/client-billing"; // ES Modules import + * // const { BillingClient, DeleteBillingViewCommand } = require("@aws-sdk/client-billing"); // CommonJS import + * const client = new BillingClient(config); + * const input = { // DeleteBillingViewRequest + * arn: "STRING_VALUE", // required + * }; + * const command = new DeleteBillingViewCommand(input); + * const response = await client.send(command); + * // { // DeleteBillingViewResponse + * // arn: "STRING_VALUE", // required + * // }; + * + * ``` + * + * @param DeleteBillingViewCommandInput - {@link DeleteBillingViewCommandInput} + * @returns {@link DeleteBillingViewCommandOutput} + * @see {@link DeleteBillingViewCommandInput} for command's `input` shape. + * @see {@link DeleteBillingViewCommandOutput} for command's `response` shape. + * @see {@link BillingClientResolvedConfig | config} for BillingClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You don't have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

+ * The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. + *

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling. + *

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an Amazon Web Services service. + *

+ * + * @throws {@link BillingServiceException} + *

Base exception class for all service exceptions from Billing service.

+ * + * @public + */ +export class DeleteBillingViewCommand extends $Command + .classBuilder< + DeleteBillingViewCommandInput, + DeleteBillingViewCommandOutput, + BillingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BillingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBilling", "DeleteBillingView", {}) + .n("BillingClient", "DeleteBillingViewCommand") + .f(void 0, void 0) + .ser(se_DeleteBillingViewCommand) + .de(de_DeleteBillingViewCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: DeleteBillingViewRequest; + output: DeleteBillingViewResponse; + }; + sdk: { + input: DeleteBillingViewCommandInput; + output: DeleteBillingViewCommandOutput; + }; + }; +} diff --git a/clients/client-billing/src/commands/GetBillingViewCommand.ts b/clients/client-billing/src/commands/GetBillingViewCommand.ts new file mode 100644 index 0000000000000..ae5564216156f --- /dev/null +++ b/clients/client-billing/src/commands/GetBillingViewCommand.ts @@ -0,0 +1,139 @@ +// 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 { BillingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { + GetBillingViewRequest, + GetBillingViewResponse, + GetBillingViewResponseFilterSensitiveLog, +} from "../models/models_0"; +import { de_GetBillingViewCommand, se_GetBillingViewCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetBillingViewCommand}. + */ +export interface GetBillingViewCommandInput extends GetBillingViewRequest {} +/** + * @public + * + * The output of {@link GetBillingViewCommand}. + */ +export interface GetBillingViewCommandOutput extends GetBillingViewResponse, __MetadataBearer {} + +/** + *

Returns the metadata associated to the specified billing view ARN. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BillingClient, GetBillingViewCommand } from "@aws-sdk/client-billing"; // ES Modules import + * // const { BillingClient, GetBillingViewCommand } = require("@aws-sdk/client-billing"); // CommonJS import + * const client = new BillingClient(config); + * const input = { // GetBillingViewRequest + * arn: "STRING_VALUE", // required + * }; + * const command = new GetBillingViewCommand(input); + * const response = await client.send(command); + * // { // GetBillingViewResponse + * // billingView: { // BillingViewElement + * // arn: "STRING_VALUE", + * // name: "STRING_VALUE", + * // description: "STRING_VALUE", + * // billingViewType: "PRIMARY" || "BILLING_GROUP" || "CUSTOM", + * // ownerAccountId: "STRING_VALUE", + * // dataFilterExpression: { // Expression + * // dimensions: { // DimensionValues + * // key: "LINKED_ACCOUNT", // required + * // values: [ // Values // required + * // "STRING_VALUE", + * // ], + * // }, + * // tags: { // TagValues + * // key: "STRING_VALUE", // required + * // values: [ // required + * // "STRING_VALUE", + * // ], + * // }, + * // }, + * // createdAt: new Date("TIMESTAMP"), + * // updatedAt: new Date("TIMESTAMP"), + * // }, + * // }; + * + * ``` + * + * @param GetBillingViewCommandInput - {@link GetBillingViewCommandInput} + * @returns {@link GetBillingViewCommandOutput} + * @see {@link GetBillingViewCommandInput} for command's `input` shape. + * @see {@link GetBillingViewCommandOutput} for command's `response` shape. + * @see {@link BillingClientResolvedConfig | config} for BillingClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You don't have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

+ * The specified ARN in the request doesn't exist. + *

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling. + *

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an Amazon Web Services service. + *

+ * + * @throws {@link BillingServiceException} + *

Base exception class for all service exceptions from Billing service.

+ * + * @public + */ +export class GetBillingViewCommand extends $Command + .classBuilder< + GetBillingViewCommandInput, + GetBillingViewCommandOutput, + BillingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BillingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBilling", "GetBillingView", {}) + .n("BillingClient", "GetBillingViewCommand") + .f(void 0, GetBillingViewResponseFilterSensitiveLog) + .ser(se_GetBillingViewCommand) + .de(de_GetBillingViewCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetBillingViewRequest; + output: GetBillingViewResponse; + }; + sdk: { + input: GetBillingViewCommandInput; + output: GetBillingViewCommandOutput; + }; + }; +} diff --git a/clients/client-billing/src/commands/GetResourcePolicyCommand.ts b/clients/client-billing/src/commands/GetResourcePolicyCommand.ts new file mode 100644 index 0000000000000..87134c039e39d --- /dev/null +++ b/clients/client-billing/src/commands/GetResourcePolicyCommand.ts @@ -0,0 +1,114 @@ +// 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 { BillingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { GetResourcePolicyRequest, GetResourcePolicyResponse } from "../models/models_0"; +import { de_GetResourcePolicyCommand, se_GetResourcePolicyCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link GetResourcePolicyCommand}. + */ +export interface GetResourcePolicyCommandInput extends GetResourcePolicyRequest {} +/** + * @public + * + * The output of {@link GetResourcePolicyCommand}. + */ +export interface GetResourcePolicyCommandOutput extends GetResourcePolicyResponse, __MetadataBearer {} + +/** + *

Returns the resource-based policy document attached to the resource in JSON format. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BillingClient, GetResourcePolicyCommand } from "@aws-sdk/client-billing"; // ES Modules import + * // const { BillingClient, GetResourcePolicyCommand } = require("@aws-sdk/client-billing"); // CommonJS import + * const client = new BillingClient(config); + * const input = { // GetResourcePolicyRequest + * resourceArn: "STRING_VALUE", // required + * }; + * const command = new GetResourcePolicyCommand(input); + * const response = await client.send(command); + * // { // GetResourcePolicyResponse + * // resourceArn: "STRING_VALUE", // required + * // policy: "STRING_VALUE", + * // }; + * + * ``` + * + * @param GetResourcePolicyCommandInput - {@link GetResourcePolicyCommandInput} + * @returns {@link GetResourcePolicyCommandOutput} + * @see {@link GetResourcePolicyCommandInput} for command's `input` shape. + * @see {@link GetResourcePolicyCommandOutput} for command's `response` shape. + * @see {@link BillingClientResolvedConfig | config} for BillingClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You don't have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

+ * The specified ARN in the request doesn't exist. + *

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling. + *

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an Amazon Web Services service. + *

+ * + * @throws {@link BillingServiceException} + *

Base exception class for all service exceptions from Billing service.

+ * + * @public + */ +export class GetResourcePolicyCommand extends $Command + .classBuilder< + GetResourcePolicyCommandInput, + GetResourcePolicyCommandOutput, + BillingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BillingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBilling", "GetResourcePolicy", {}) + .n("BillingClient", "GetResourcePolicyCommand") + .f(void 0, void 0) + .ser(se_GetResourcePolicyCommand) + .de(de_GetResourcePolicyCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: GetResourcePolicyRequest; + output: GetResourcePolicyResponse; + }; + sdk: { + input: GetResourcePolicyCommandInput; + output: GetResourcePolicyCommandOutput; + }; + }; +} diff --git a/clients/client-billing/src/commands/ListBillingViewsCommand.ts b/clients/client-billing/src/commands/ListBillingViewsCommand.ts index b3a3858ec1089..2d4e8d690bc5c 100644 --- a/clients/client-billing/src/commands/ListBillingViewsCommand.ts +++ b/clients/client-billing/src/commands/ListBillingViewsCommand.ts @@ -46,6 +46,13 @@ export interface ListBillingViewsCommandOutput extends ListBillingViewsResponse, * activeAfterInclusive: new Date("TIMESTAMP"), // required * activeBeforeInclusive: new Date("TIMESTAMP"), // required * }, + * arns: [ // BillingViewArnList + * "STRING_VALUE", + * ], + * billingViewTypes: [ // BillingViewTypeList + * "PRIMARY" || "BILLING_GROUP" || "CUSTOM", + * ], + * ownerAccountId: "STRING_VALUE", * maxResults: Number("int"), * nextToken: "STRING_VALUE", * }; @@ -56,8 +63,9 @@ export interface ListBillingViewsCommandOutput extends ListBillingViewsResponse, * // { // BillingViewListElement * // arn: "STRING_VALUE", * // name: "STRING_VALUE", + * // description: "STRING_VALUE", * // ownerAccountId: "STRING_VALUE", - * // billingViewType: "PRIMARY" || "BILLING_GROUP", + * // billingViewType: "PRIMARY" || "BILLING_GROUP" || "CUSTOM", * // }, * // ], * // nextToken: "STRING_VALUE", diff --git a/clients/client-billing/src/commands/ListSourceViewsForBillingViewCommand.ts b/clients/client-billing/src/commands/ListSourceViewsForBillingViewCommand.ts new file mode 100644 index 0000000000000..fd4522cd516c0 --- /dev/null +++ b/clients/client-billing/src/commands/ListSourceViewsForBillingViewCommand.ts @@ -0,0 +1,123 @@ +// 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 { BillingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListSourceViewsForBillingViewRequest, ListSourceViewsForBillingViewResponse } from "../models/models_0"; +import { + de_ListSourceViewsForBillingViewCommand, + se_ListSourceViewsForBillingViewCommand, +} from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListSourceViewsForBillingViewCommand}. + */ +export interface ListSourceViewsForBillingViewCommandInput extends ListSourceViewsForBillingViewRequest {} +/** + * @public + * + * The output of {@link ListSourceViewsForBillingViewCommand}. + */ +export interface ListSourceViewsForBillingViewCommandOutput + extends ListSourceViewsForBillingViewResponse, + __MetadataBearer {} + +/** + *

Lists the source views (managed Amazon Web Services billing views) associated with the billing view. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BillingClient, ListSourceViewsForBillingViewCommand } from "@aws-sdk/client-billing"; // ES Modules import + * // const { BillingClient, ListSourceViewsForBillingViewCommand } = require("@aws-sdk/client-billing"); // CommonJS import + * const client = new BillingClient(config); + * const input = { // ListSourceViewsForBillingViewRequest + * arn: "STRING_VALUE", // required + * maxResults: Number("int"), + * nextToken: "STRING_VALUE", + * }; + * const command = new ListSourceViewsForBillingViewCommand(input); + * const response = await client.send(command); + * // { // ListSourceViewsForBillingViewResponse + * // sourceViews: [ // BillingViewSourceViewsList // required + * // "STRING_VALUE", + * // ], + * // nextToken: "STRING_VALUE", + * // }; + * + * ``` + * + * @param ListSourceViewsForBillingViewCommandInput - {@link ListSourceViewsForBillingViewCommandInput} + * @returns {@link ListSourceViewsForBillingViewCommandOutput} + * @see {@link ListSourceViewsForBillingViewCommandInput} for command's `input` shape. + * @see {@link ListSourceViewsForBillingViewCommandOutput} for command's `response` shape. + * @see {@link BillingClientResolvedConfig | config} for BillingClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You don't have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

+ * The specified ARN in the request doesn't exist. + *

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling. + *

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an Amazon Web Services service. + *

+ * + * @throws {@link BillingServiceException} + *

Base exception class for all service exceptions from Billing service.

+ * + * @public + */ +export class ListSourceViewsForBillingViewCommand extends $Command + .classBuilder< + ListSourceViewsForBillingViewCommandInput, + ListSourceViewsForBillingViewCommandOutput, + BillingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BillingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBilling", "ListSourceViewsForBillingView", {}) + .n("BillingClient", "ListSourceViewsForBillingViewCommand") + .f(void 0, void 0) + .ser(se_ListSourceViewsForBillingViewCommand) + .de(de_ListSourceViewsForBillingViewCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListSourceViewsForBillingViewRequest; + output: ListSourceViewsForBillingViewResponse; + }; + sdk: { + input: ListSourceViewsForBillingViewCommandInput; + output: ListSourceViewsForBillingViewCommandOutput; + }; + }; +} diff --git a/clients/client-billing/src/commands/ListTagsForResourceCommand.ts b/clients/client-billing/src/commands/ListTagsForResourceCommand.ts new file mode 100644 index 0000000000000..df0ba6b54b0b6 --- /dev/null +++ b/clients/client-billing/src/commands/ListTagsForResourceCommand.ts @@ -0,0 +1,118 @@ +// 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 { BillingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { ListTagsForResourceRequest, ListTagsForResourceResponse } from "../models/models_0"; +import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandInput extends ListTagsForResourceRequest {} +/** + * @public + * + * The output of {@link ListTagsForResourceCommand}. + */ +export interface ListTagsForResourceCommandOutput extends ListTagsForResourceResponse, __MetadataBearer {} + +/** + *

Lists tags associated with the billing view resource. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BillingClient, ListTagsForResourceCommand } from "@aws-sdk/client-billing"; // ES Modules import + * // const { BillingClient, ListTagsForResourceCommand } = require("@aws-sdk/client-billing"); // CommonJS import + * const client = new BillingClient(config); + * const input = { // ListTagsForResourceRequest + * resourceArn: "STRING_VALUE", // required + * }; + * const command = new ListTagsForResourceCommand(input); + * const response = await client.send(command); + * // { // ListTagsForResourceResponse + * // resourceTags: [ // ResourceTagList + * // { // ResourceTag + * // key: "STRING_VALUE", // required + * // value: "STRING_VALUE", + * // }, + * // ], + * // }; + * + * ``` + * + * @param ListTagsForResourceCommandInput - {@link ListTagsForResourceCommandInput} + * @returns {@link ListTagsForResourceCommandOutput} + * @see {@link ListTagsForResourceCommandInput} for command's `input` shape. + * @see {@link ListTagsForResourceCommandOutput} for command's `response` shape. + * @see {@link BillingClientResolvedConfig | config} for BillingClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You don't have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

+ * The specified ARN in the request doesn't exist. + *

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling. + *

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an Amazon Web Services service. + *

+ * + * @throws {@link BillingServiceException} + *

Base exception class for all service exceptions from Billing service.

+ * + * @public + */ +export class ListTagsForResourceCommand extends $Command + .classBuilder< + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, + BillingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BillingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBilling", "ListTagsForResource", {}) + .n("BillingClient", "ListTagsForResourceCommand") + .f(void 0, void 0) + .ser(se_ListTagsForResourceCommand) + .de(de_ListTagsForResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: ListTagsForResourceRequest; + output: ListTagsForResourceResponse; + }; + sdk: { + input: ListTagsForResourceCommandInput; + output: ListTagsForResourceCommandOutput; + }; + }; +} diff --git a/clients/client-billing/src/commands/TagResourceCommand.ts b/clients/client-billing/src/commands/TagResourceCommand.ts new file mode 100644 index 0000000000000..9be190e19a8c4 --- /dev/null +++ b/clients/client-billing/src/commands/TagResourceCommand.ts @@ -0,0 +1,118 @@ +// 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 { BillingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { TagResourceRequest, TagResourceResponse } from "../models/models_0"; +import { de_TagResourceCommand, se_TagResourceCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link TagResourceCommand}. + */ +export interface TagResourceCommandInput extends TagResourceRequest {} +/** + * @public + * + * The output of {@link TagResourceCommand}. + */ +export interface TagResourceCommandOutput extends TagResourceResponse, __MetadataBearer {} + +/** + *

+ * An API operation for adding one or more tags (key-value pairs) to a resource. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BillingClient, TagResourceCommand } from "@aws-sdk/client-billing"; // ES Modules import + * // const { BillingClient, TagResourceCommand } = require("@aws-sdk/client-billing"); // CommonJS import + * const client = new BillingClient(config); + * const input = { // TagResourceRequest + * resourceArn: "STRING_VALUE", // required + * resourceTags: [ // ResourceTagList // required + * { // ResourceTag + * key: "STRING_VALUE", // required + * value: "STRING_VALUE", + * }, + * ], + * }; + * const command = new TagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param TagResourceCommandInput - {@link TagResourceCommandInput} + * @returns {@link TagResourceCommandOutput} + * @see {@link TagResourceCommandInput} for command's `input` shape. + * @see {@link TagResourceCommandOutput} for command's `response` shape. + * @see {@link BillingClientResolvedConfig | config} for BillingClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You don't have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

+ * The specified ARN in the request doesn't exist. + *

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling. + *

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an Amazon Web Services service. + *

+ * + * @throws {@link BillingServiceException} + *

Base exception class for all service exceptions from Billing service.

+ * + * @public + */ +export class TagResourceCommand extends $Command + .classBuilder< + TagResourceCommandInput, + TagResourceCommandOutput, + BillingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BillingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBilling", "TagResource", {}) + .n("BillingClient", "TagResourceCommand") + .f(void 0, void 0) + .ser(se_TagResourceCommand) + .de(de_TagResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: TagResourceRequest; + output: {}; + }; + sdk: { + input: TagResourceCommandInput; + output: TagResourceCommandOutput; + }; + }; +} diff --git a/clients/client-billing/src/commands/UntagResourceCommand.ts b/clients/client-billing/src/commands/UntagResourceCommand.ts new file mode 100644 index 0000000000000..c28187e4b86ee --- /dev/null +++ b/clients/client-billing/src/commands/UntagResourceCommand.ts @@ -0,0 +1,115 @@ +// 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 { BillingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { UntagResourceRequest, UntagResourceResponse } from "../models/models_0"; +import { de_UntagResourceCommand, se_UntagResourceCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandInput extends UntagResourceRequest {} +/** + * @public + * + * The output of {@link UntagResourceCommand}. + */ +export interface UntagResourceCommandOutput extends UntagResourceResponse, __MetadataBearer {} + +/** + *

+ * Removes one or more tags from a resource. Specify only tag keys in your request. Don't specify the value. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BillingClient, UntagResourceCommand } from "@aws-sdk/client-billing"; // ES Modules import + * // const { BillingClient, UntagResourceCommand } = require("@aws-sdk/client-billing"); // CommonJS import + * const client = new BillingClient(config); + * const input = { // UntagResourceRequest + * resourceArn: "STRING_VALUE", // required + * resourceTagKeys: [ // ResourceTagKeyList // required + * "STRING_VALUE", + * ], + * }; + * const command = new UntagResourceCommand(input); + * const response = await client.send(command); + * // {}; + * + * ``` + * + * @param UntagResourceCommandInput - {@link UntagResourceCommandInput} + * @returns {@link UntagResourceCommandOutput} + * @see {@link UntagResourceCommandInput} for command's `input` shape. + * @see {@link UntagResourceCommandOutput} for command's `response` shape. + * @see {@link BillingClientResolvedConfig | config} for BillingClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You don't have sufficient access to perform this action.

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

+ * The specified ARN in the request doesn't exist. + *

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling. + *

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an Amazon Web Services service. + *

+ * + * @throws {@link BillingServiceException} + *

Base exception class for all service exceptions from Billing service.

+ * + * @public + */ +export class UntagResourceCommand extends $Command + .classBuilder< + UntagResourceCommandInput, + UntagResourceCommandOutput, + BillingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BillingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBilling", "UntagResource", {}) + .n("BillingClient", "UntagResourceCommand") + .f(void 0, void 0) + .ser(se_UntagResourceCommand) + .de(de_UntagResourceCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: UntagResourceRequest; + output: {}; + }; + sdk: { + input: UntagResourceCommandInput; + output: UntagResourceCommandOutput; + }; + }; +} diff --git a/clients/client-billing/src/commands/UpdateBillingViewCommand.ts b/clients/client-billing/src/commands/UpdateBillingViewCommand.ts new file mode 100644 index 0000000000000..a2eef70fd0272 --- /dev/null +++ b/clients/client-billing/src/commands/UpdateBillingViewCommand.ts @@ -0,0 +1,144 @@ +// 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 { BillingClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BillingClient"; +import { commonParams } from "../endpoint/EndpointParameters"; +import { + UpdateBillingViewRequest, + UpdateBillingViewRequestFilterSensitiveLog, + UpdateBillingViewResponse, +} from "../models/models_0"; +import { de_UpdateBillingViewCommand, se_UpdateBillingViewCommand } from "../protocols/Aws_json1_0"; + +/** + * @public + */ +export type { __MetadataBearer }; +export { $Command }; +/** + * @public + * + * The input for {@link UpdateBillingViewCommand}. + */ +export interface UpdateBillingViewCommandInput extends UpdateBillingViewRequest {} +/** + * @public + * + * The output of {@link UpdateBillingViewCommand}. + */ +export interface UpdateBillingViewCommandOutput extends UpdateBillingViewResponse, __MetadataBearer {} + +/** + *

An API to update the attributes of the billing view. + *

+ * @example + * Use a bare-bones client and the command you need to make an API call. + * ```javascript + * import { BillingClient, UpdateBillingViewCommand } from "@aws-sdk/client-billing"; // ES Modules import + * // const { BillingClient, UpdateBillingViewCommand } = require("@aws-sdk/client-billing"); // CommonJS import + * const client = new BillingClient(config); + * const input = { // UpdateBillingViewRequest + * arn: "STRING_VALUE", // required + * name: "STRING_VALUE", + * description: "STRING_VALUE", + * dataFilterExpression: { // Expression + * dimensions: { // DimensionValues + * key: "LINKED_ACCOUNT", // required + * values: [ // Values // required + * "STRING_VALUE", + * ], + * }, + * tags: { // TagValues + * key: "STRING_VALUE", // required + * values: [ // required + * "STRING_VALUE", + * ], + * }, + * }, + * }; + * const command = new UpdateBillingViewCommand(input); + * const response = await client.send(command); + * // { // UpdateBillingViewResponse + * // arn: "STRING_VALUE", // required + * // updatedAt: new Date("TIMESTAMP"), + * // }; + * + * ``` + * + * @param UpdateBillingViewCommandInput - {@link UpdateBillingViewCommandInput} + * @returns {@link UpdateBillingViewCommandOutput} + * @see {@link UpdateBillingViewCommandInput} for command's `input` shape. + * @see {@link UpdateBillingViewCommandOutput} for command's `response` shape. + * @see {@link BillingClientResolvedConfig | config} for BillingClient's `config` shape. + * + * @throws {@link AccessDeniedException} (client fault) + *

You don't have sufficient access to perform this action.

+ * + * @throws {@link ConflictException} (client fault) + *

+ * The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. + *

+ * + * @throws {@link InternalServerException} (server fault) + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * + * @throws {@link ResourceNotFoundException} (client fault) + *

+ * The specified ARN in the request doesn't exist. + *

+ * + * @throws {@link ServiceQuotaExceededException} (client fault) + *

+ * You've reached the limit of resources you can create, or exceeded the size of an individual resource. + *

+ * + * @throws {@link ThrottlingException} (client fault) + *

The request was denied due to request throttling. + *

+ * + * @throws {@link ValidationException} (client fault) + *

The input fails to satisfy the constraints specified by an Amazon Web Services service. + *

+ * + * @throws {@link BillingServiceException} + *

Base exception class for all service exceptions from Billing service.

+ * + * @public + */ +export class UpdateBillingViewCommand extends $Command + .classBuilder< + UpdateBillingViewCommandInput, + UpdateBillingViewCommandOutput, + BillingClientResolvedConfig, + ServiceInputTypes, + ServiceOutputTypes + >() + .ep(commonParams) + .m(function (this: any, Command: any, cs: any, config: BillingClientResolvedConfig, o: any) { + return [ + getSerdePlugin(config, this.serialize, this.deserialize), + getEndpointPlugin(config, Command.getEndpointParameterInstructions()), + ]; + }) + .s("AWSBilling", "UpdateBillingView", {}) + .n("BillingClient", "UpdateBillingViewCommand") + .f(UpdateBillingViewRequestFilterSensitiveLog, void 0) + .ser(se_UpdateBillingViewCommand) + .de(de_UpdateBillingViewCommand) + .build() { + /** @internal type navigation helper, not in runtime. */ + protected declare static __types: { + api: { + input: UpdateBillingViewRequest; + output: UpdateBillingViewResponse; + }; + sdk: { + input: UpdateBillingViewCommandInput; + output: UpdateBillingViewCommandOutput; + }; + }; +} diff --git a/clients/client-billing/src/commands/index.ts b/clients/client-billing/src/commands/index.ts index 853515c0fc646..561836d2a9602 100644 --- a/clients/client-billing/src/commands/index.ts +++ b/clients/client-billing/src/commands/index.ts @@ -1,2 +1,11 @@ // smithy-typescript generated code +export * from "./CreateBillingViewCommand"; +export * from "./DeleteBillingViewCommand"; +export * from "./GetBillingViewCommand"; +export * from "./GetResourcePolicyCommand"; export * from "./ListBillingViewsCommand"; +export * from "./ListSourceViewsForBillingViewCommand"; +export * from "./ListTagsForResourceCommand"; +export * from "./TagResourceCommand"; +export * from "./UntagResourceCommand"; +export * from "./UpdateBillingViewCommand"; diff --git a/clients/client-billing/src/models/models_0.ts b/clients/client-billing/src/models/models_0.ts index 07776857a2432..7b0cfff283669 100644 --- a/clients/client-billing/src/models/models_0.ts +++ b/clients/client-billing/src/models/models_0.ts @@ -44,117 +44,301 @@ export interface ActiveTimeRange { } /** - *

The request processing failed because of an unknown error, exception, or failure. - *

+ *

+ * The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. + *

* @public */ -export class InternalServerException extends __BaseException { - readonly name: "InternalServerException" = "InternalServerException"; - readonly $fault: "server" = "server"; +export class ConflictException extends __BaseException { + readonly name: "ConflictException" = "ConflictException"; + readonly $fault: "client" = "client"; + /** + *

+ * The identifier for the service resource associated with the request. + *

+ * @public + */ + resourceId: string | undefined; + + /** + *

+ * The type of resource associated with the request. + *

+ * @public + */ + resourceType: string | undefined; + /** * @internal */ - constructor(opts: __ExceptionOptionType) { + constructor(opts: __ExceptionOptionType) { super({ - name: "InternalServerException", - $fault: "server", + name: "ConflictException", + $fault: "client", ...opts, }); - Object.setPrototypeOf(this, InternalServerException.prototype); + Object.setPrototypeOf(this, ConflictException.prototype); + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; } } +/** + * @public + * @enum + */ +export const Dimension = { + LINKED_ACCOUNT: "LINKED_ACCOUNT", +} as const; + /** * @public */ -export interface ListBillingViewsRequest { +export type Dimension = (typeof Dimension)[keyof typeof Dimension]; + +/** + *

+ * The metadata that you can use to filter and group your results. + *

+ * @public + */ +export interface DimensionValues { /** *

- * The time range for the billing views listed. PRIMARY billing view is always listed. BILLING_GROUP billing views are listed for time ranges when the associated billing group resource in Billing Conductor is active. The time range must be within one calendar month. + * The names of the metadata types that you can use to filter and group your results. *

* @public */ - activeTimeRange: ActiveTimeRange | undefined; + key: Dimension | undefined; /** - *

The maximum number of billing views to retrieve. Default is 100. - *

+ *

+ * The metadata values that you can use to filter and group your results. + *

* @public */ - maxResults?: number | undefined; + values: string[] | undefined; +} +/** + *

+ * The values that are available for a tag. + *

+ * @public + */ +export interface TagValues { /** - *

The pagination token that is used on subsequent calls to list billing views.

+ *

+ * The key for the tag. + *

* @public */ - nextToken?: string | undefined; + key: string | undefined; + + /** + *

+ * The specific value of the tag. + *

+ * @public + */ + values: string[] | undefined; } /** + *

+ * See Expression. Billing view only supports LINKED_ACCOUNT and Tags. + *

* @public - * @enum */ -export const BillingViewType = { - BILLING_GROUP: "BILLING_GROUP", - PRIMARY: "PRIMARY", -} as const; +export interface Expression { + /** + *

+ * The specific Dimension to use for Expression. + *

+ * @public + */ + dimensions?: DimensionValues | undefined; + + /** + *

+ * The specific Tag to use for Expression. + *

+ * @public + */ + tags?: TagValues | undefined; +} /** + *

+ * The tag structure that contains a tag key and value. + *

* @public */ -export type BillingViewType = (typeof BillingViewType)[keyof typeof BillingViewType]; +export interface ResourceTag { + /** + *

+ * The key that's associated with the tag. + *

+ * @public + */ + key: string | undefined; + + /** + *

+ * The value that's associated with the tag. + *

+ * @public + */ + value?: string | undefined; +} /** - *

A representation of a billing view.

* @public */ -export interface BillingViewListElement { +export interface CreateBillingViewRequest { /** - *

The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. - *

+ *

+ * The name of the billing view. + *

* @public */ - arn?: string | undefined; + name: string | undefined; /** *

- * A list of names of the Billing view. + * The description of the billing view. *

* @public */ - name?: string | undefined; + description?: string | undefined; + + /** + *

A list of billing views used as the data source for the custom billing view.

+ * @public + */ + sourceViews: string[] | undefined; /** *

- * The list of owners of the Billing view. + * See Expression. Billing view only supports LINKED_ACCOUNT and Tags. *

* @public */ - ownerAccountId?: string | undefined; + dataFilterExpression?: Expression | undefined; /** - *

The type of billing view.

+ *

A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request. + *

* @public */ - billingViewType?: BillingViewType | undefined; + clientToken?: string | undefined; + + /** + *

A list of key value map specifying tags associated to the billing view being created. + *

+ * @public + */ + resourceTags?: ResourceTag[] | undefined; } /** * @public */ -export interface ListBillingViewsResponse { +export interface CreateBillingViewResponse { /** - *

A list of BillingViewListElement retrieved.

+ *

+ * The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

* @public */ - billingViews: BillingViewListElement[] | undefined; + arn: string | undefined; /** - *

The pagination token to use on subsequent calls to list billing views. - *

+ *

+ * The time when the billing view was created. + *

* @public */ - nextToken?: string | undefined; + createdAt?: Date | undefined; +} + +/** + *

The request processing failed because of an unknown error, exception, or failure. + *

+ * @public + */ +export class InternalServerException extends __BaseException { + readonly name: "InternalServerException" = "InternalServerException"; + readonly $fault: "server" = "server"; + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "InternalServerException", + $fault: "server", + ...opts, + }); + Object.setPrototypeOf(this, InternalServerException.prototype); + } +} + +/** + *

+ * You've reached the limit of resources you can create, or exceeded the size of an individual resource. + *

+ * @public + */ +export class ServiceQuotaExceededException extends __BaseException { + readonly name: "ServiceQuotaExceededException" = "ServiceQuotaExceededException"; + readonly $fault: "client" = "client"; + /** + *

+ * The ID of the resource. + *

+ * @public + */ + resourceId: string | undefined; + + /** + *

+ * The type of Amazon Web Services resource. + *

+ * @public + */ + resourceType: string | undefined; + + /** + *

+ * The container for the serviceCode. + *

+ * @public + */ + serviceCode: string | undefined; + + /** + *

+ * The container for the quotaCode. + *

+ * @public + */ + quotaCode: string | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ServiceQuotaExceededException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype); + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + this.serviceCode = opts.serviceCode; + this.quotaCode = opts.quotaCode; + } } /** @@ -249,19 +433,552 @@ export class ValidationException extends __BaseException { } /** - * @internal + * @public */ -export const BillingViewListElementFilterSensitiveLog = (obj: BillingViewListElement): any => ({ - ...obj, - ...(obj.name && { name: SENSITIVE_STRING }), -}); +export interface DeleteBillingViewRequest { + /** + *

+ * The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

+ * @public + */ + arn: string | undefined; +} /** - * @internal + * @public */ -export const ListBillingViewsResponseFilterSensitiveLog = (obj: ListBillingViewsResponse): any => ({ - ...obj, - ...(obj.billingViews && { - billingViews: obj.billingViews.map((item) => BillingViewListElementFilterSensitiveLog(item)), - }), +export interface DeleteBillingViewResponse { + /** + *

+ * The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

+ * @public + */ + arn: string | undefined; +} + +/** + * @public + */ +export interface GetBillingViewRequest { + /** + *

+ * The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

+ * @public + */ + arn: string | undefined; +} + +/** + * @public + * @enum + */ +export const BillingViewType = { + BILLING_GROUP: "BILLING_GROUP", + CUSTOM: "CUSTOM", + PRIMARY: "PRIMARY", +} as const; + +/** + * @public + */ +export type BillingViewType = (typeof BillingViewType)[keyof typeof BillingViewType]; + +/** + *

The metadata associated to the billing view. + *

+ * @public + */ +export interface BillingViewElement { + /** + *

+ * The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

+ * @public + */ + arn?: string | undefined; + + /** + *

+ * A list of names of the billing view. + *

+ * @public + */ + name?: string | undefined; + + /** + *

+ * The description of the billing view. + *

+ * @public + */ + description?: string | undefined; + + /** + *

The type of billing group. + *

+ * @public + */ + billingViewType?: BillingViewType | undefined; + + /** + *

+ * The list of owners of the billing view. + *

+ * @public + */ + ownerAccountId?: string | undefined; + + /** + *

+ * See Expression. Billing view only supports LINKED_ACCOUNT and Tags. + *

+ * @public + */ + dataFilterExpression?: Expression | undefined; + + /** + *

The time when the billing view was created. + *

+ * @public + */ + createdAt?: Date | undefined; + + /** + *

The time when the billing view was last updated. + *

+ * @public + */ + updatedAt?: Date | undefined; +} + +/** + * @public + */ +export interface GetBillingViewResponse { + /** + *

The billing view element associated with the specified ARN. + *

+ * @public + */ + billingView: BillingViewElement | undefined; +} + +/** + *

+ * The specified ARN in the request doesn't exist. + *

+ * @public + */ +export class ResourceNotFoundException extends __BaseException { + readonly name: "ResourceNotFoundException" = "ResourceNotFoundException"; + readonly $fault: "client" = "client"; + /** + *

+ * Value is a list of resource IDs that were not found. + *

+ * @public + */ + resourceId: string | undefined; + + /** + *

+ * Value is the type of resource that was not found. + *

+ * @public + */ + resourceType: string | undefined; + + /** + * @internal + */ + constructor(opts: __ExceptionOptionType) { + super({ + name: "ResourceNotFoundException", + $fault: "client", + ...opts, + }); + Object.setPrototypeOf(this, ResourceNotFoundException.prototype); + this.resourceId = opts.resourceId; + this.resourceType = opts.resourceType; + } +} + +/** + * @public + */ +export interface GetResourcePolicyRequest { + /** + *

The Amazon Resource Name (ARN) of the billing view resource to which the policy is attached to. + *

+ * @public + */ + resourceArn: string | undefined; +} + +/** + * @public + */ +export interface GetResourcePolicyResponse { + /** + *

The Amazon Resource Name (ARN) of the billing view resource to which the policy is attached to. + *

+ * @public + */ + resourceArn: string | undefined; + + /** + *

The resource-based policy document attached to the resource in JSON format. + *

+ * @public + */ + policy?: string | undefined; +} + +/** + * @public + */ +export interface ListBillingViewsRequest { + /** + *

+ * The time range for the billing views listed. PRIMARY billing view is always listed. BILLING_GROUP billing views are listed for time ranges when the associated billing group resource in Billing Conductor is active. The time range must be within one calendar month. + *

+ * @public + */ + activeTimeRange?: ActiveTimeRange | undefined; + + /** + *

The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

+ * @public + */ + arns?: string[] | undefined; + + /** + *

The type of billing view.

+ * @public + */ + billingViewTypes?: BillingViewType[] | undefined; + + /** + *

+ * The list of owners of the billing view. + *

+ * @public + */ + ownerAccountId?: string | undefined; + + /** + *

The maximum number of billing views to retrieve. Default is 100. + *

+ * @public + */ + maxResults?: number | undefined; + + /** + *

The pagination token that is used on subsequent calls to list billing views.

+ * @public + */ + nextToken?: string | undefined; +} + +/** + *

A representation of a billing view.

+ * @public + */ +export interface BillingViewListElement { + /** + *

The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

+ * @public + */ + arn?: string | undefined; + + /** + *

+ * A list of names of the Billing view. + *

+ * @public + */ + name?: string | undefined; + + /** + *

+ * The description of the billing view. + *

+ * @public + */ + description?: string | undefined; + + /** + *

+ * The list of owners of the Billing view. + *

+ * @public + */ + ownerAccountId?: string | undefined; + + /** + *

The type of billing view.

+ * @public + */ + billingViewType?: BillingViewType | undefined; +} + +/** + * @public + */ +export interface ListBillingViewsResponse { + /** + *

A list of BillingViewListElement retrieved.

+ * @public + */ + billingViews: BillingViewListElement[] | undefined; + + /** + *

The pagination token to use on subsequent calls to list billing views. + *

+ * @public + */ + nextToken?: string | undefined; +} + +/** + * @public + */ +export interface ListSourceViewsForBillingViewRequest { + /** + *

+ * The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

+ * @public + */ + arn: string | undefined; + + /** + *

+ * The number of entries a paginated response contains. + *

+ * @public + */ + maxResults?: number | undefined; + + /** + *

+ * The pagination token that is used on subsequent calls to list billing views. + *

+ * @public + */ + nextToken?: string | undefined; +} + +/** + * @public + */ +export interface ListSourceViewsForBillingViewResponse { + /** + *

A list of billing views used as the data source for the custom billing view. + *

+ * @public + */ + sourceViews: string[] | undefined; + + /** + *

+ * The pagination token that is used on subsequent calls to list billing views. + *

+ * @public + */ + nextToken?: string | undefined; +} + +/** + * @public + */ +export interface ListTagsForResourceRequest { + /** + *

+ * The Amazon Resource Name (ARN) of the resource. + *

+ * @public + */ + resourceArn: string | undefined; +} + +/** + * @public + */ +export interface ListTagsForResourceResponse { + /** + *

+ * A list of tag key value pairs that are associated with the resource. + *

+ * @public + */ + resourceTags?: ResourceTag[] | undefined; +} + +/** + * @public + */ +export interface TagResourceRequest { + /** + *

+ * The Amazon Resource Name (ARN) of the resource. + *

+ * @public + */ + resourceArn: string | undefined; + + /** + *

+ * A list of tag key value pairs that are associated with the resource. + *

+ * @public + */ + resourceTags: ResourceTag[] | undefined; +} + +/** + * @public + */ +export interface TagResourceResponse {} + +/** + * @public + */ +export interface UntagResourceRequest { + /** + *

+ * The Amazon Resource Name (ARN) of the resource. + *

+ * @public + */ + resourceArn: string | undefined; + + /** + *

+ * A list of tag key value pairs that are associated with the resource. + *

+ * @public + */ + resourceTagKeys: string[] | undefined; +} + +/** + * @public + */ +export interface UntagResourceResponse {} + +/** + * @public + */ +export interface UpdateBillingViewRequest { + /** + *

+ * The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

+ * @public + */ + arn: string | undefined; + + /** + *

+ * The name of the billing view. + *

+ * @public + */ + name?: string | undefined; + + /** + *

+ * The description of the billing view. + *

+ * @public + */ + description?: string | undefined; + + /** + *

See Expression. Billing view only supports LINKED_ACCOUNT and Tags. + *

+ * @public + */ + dataFilterExpression?: Expression | undefined; +} + +/** + * @public + */ +export interface UpdateBillingViewResponse { + /** + *

+ * The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view. + *

+ * @public + */ + arn: string | undefined; + + /** + *

+ * The time when the billing view was last updated. + *

+ * @public + */ + updatedAt?: Date | undefined; +} + +/** + * @internal + */ +export const CreateBillingViewRequestFilterSensitiveLog = (obj: CreateBillingViewRequest): any => ({ + ...obj, + ...(obj.name && { name: SENSITIVE_STRING }), + ...(obj.description && { description: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const BillingViewElementFilterSensitiveLog = (obj: BillingViewElement): any => ({ + ...obj, + ...(obj.name && { name: SENSITIVE_STRING }), + ...(obj.description && { description: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const GetBillingViewResponseFilterSensitiveLog = (obj: GetBillingViewResponse): any => ({ + ...obj, + ...(obj.billingView && { billingView: BillingViewElementFilterSensitiveLog(obj.billingView) }), +}); + +/** + * @internal + */ +export const BillingViewListElementFilterSensitiveLog = (obj: BillingViewListElement): any => ({ + ...obj, + ...(obj.name && { name: SENSITIVE_STRING }), + ...(obj.description && { description: SENSITIVE_STRING }), +}); + +/** + * @internal + */ +export const ListBillingViewsResponseFilterSensitiveLog = (obj: ListBillingViewsResponse): any => ({ + ...obj, + ...(obj.billingViews && { + billingViews: obj.billingViews.map((item) => BillingViewListElementFilterSensitiveLog(item)), + }), +}); + +/** + * @internal + */ +export const UpdateBillingViewRequestFilterSensitiveLog = (obj: UpdateBillingViewRequest): any => ({ + ...obj, + ...(obj.name && { name: SENSITIVE_STRING }), + ...(obj.description && { description: SENSITIVE_STRING }), }); diff --git a/clients/client-billing/src/pagination/ListSourceViewsForBillingViewPaginator.ts b/clients/client-billing/src/pagination/ListSourceViewsForBillingViewPaginator.ts new file mode 100644 index 0000000000000..94c95a419f1f8 --- /dev/null +++ b/clients/client-billing/src/pagination/ListSourceViewsForBillingViewPaginator.ts @@ -0,0 +1,24 @@ +// smithy-typescript generated code +import { createPaginator } from "@smithy/core"; +import { Paginator } from "@smithy/types"; + +import { BillingClient } from "../BillingClient"; +import { + ListSourceViewsForBillingViewCommand, + ListSourceViewsForBillingViewCommandInput, + ListSourceViewsForBillingViewCommandOutput, +} from "../commands/ListSourceViewsForBillingViewCommand"; +import { BillingPaginationConfiguration } from "./Interfaces"; + +/** + * @public + */ +export const paginateListSourceViewsForBillingView: ( + config: BillingPaginationConfiguration, + input: ListSourceViewsForBillingViewCommandInput, + ...rest: any[] +) => Paginator = createPaginator< + BillingPaginationConfiguration, + ListSourceViewsForBillingViewCommandInput, + ListSourceViewsForBillingViewCommandOutput +>(BillingClient, ListSourceViewsForBillingViewCommand, "nextToken", "nextToken", "maxResults"); diff --git a/clients/client-billing/src/pagination/index.ts b/clients/client-billing/src/pagination/index.ts index d1f7110723908..62bbb2bf82c15 100644 --- a/clients/client-billing/src/pagination/index.ts +++ b/clients/client-billing/src/pagination/index.ts @@ -1,3 +1,4 @@ // smithy-typescript generated code export * from "./Interfaces"; export * from "./ListBillingViewsPaginator"; +export * from "./ListSourceViewsForBillingViewPaginator"; diff --git a/clients/client-billing/src/protocols/Aws_json1_0.ts b/clients/client-billing/src/protocols/Aws_json1_0.ts index 4f57ca022dc82..1a329be40551c 100644 --- a/clients/client-billing/src/protocols/Aws_json1_0.ts +++ b/clients/client-billing/src/protocols/Aws_json1_0.ts @@ -5,6 +5,10 @@ import { _json, collectBody, decorateServiceException as __decorateServiceException, + expectNonNull as __expectNonNull, + expectNumber as __expectNumber, + expectString as __expectString, + parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client"; @@ -14,18 +18,107 @@ import { ResponseMetadata as __ResponseMetadata, SerdeContext as __SerdeContext, } from "@smithy/types"; +import { v4 as generateIdempotencyToken } from "uuid"; +import { CreateBillingViewCommandInput, CreateBillingViewCommandOutput } from "../commands/CreateBillingViewCommand"; +import { DeleteBillingViewCommandInput, DeleteBillingViewCommandOutput } from "../commands/DeleteBillingViewCommand"; +import { GetBillingViewCommandInput, GetBillingViewCommandOutput } from "../commands/GetBillingViewCommand"; +import { GetResourcePolicyCommandInput, GetResourcePolicyCommandOutput } from "../commands/GetResourcePolicyCommand"; import { ListBillingViewsCommandInput, ListBillingViewsCommandOutput } from "../commands/ListBillingViewsCommand"; +import { + ListSourceViewsForBillingViewCommandInput, + ListSourceViewsForBillingViewCommandOutput, +} from "../commands/ListSourceViewsForBillingViewCommand"; +import { + ListTagsForResourceCommandInput, + ListTagsForResourceCommandOutput, +} from "../commands/ListTagsForResourceCommand"; +import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand"; +import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand"; +import { UpdateBillingViewCommandInput, UpdateBillingViewCommandOutput } from "../commands/UpdateBillingViewCommand"; import { BillingServiceException as __BaseException } from "../models/BillingServiceException"; import { AccessDeniedException, ActiveTimeRange, + BillingViewElement, + BillingViewType, + ConflictException, + CreateBillingViewRequest, + CreateBillingViewResponse, + DeleteBillingViewRequest, + DimensionValues, + Expression, + GetBillingViewRequest, + GetBillingViewResponse, + GetResourcePolicyRequest, InternalServerException, ListBillingViewsRequest, + ListSourceViewsForBillingViewRequest, + ListTagsForResourceRequest, + ResourceNotFoundException, + ResourceTag, + ServiceQuotaExceededException, + TagResourceRequest, + TagValues, ThrottlingException, + UntagResourceRequest, + UpdateBillingViewRequest, + UpdateBillingViewResponse, ValidationException, } from "../models/models_0"; +/** + * serializeAws_json1_0CreateBillingViewCommand + */ +export const se_CreateBillingViewCommand = async ( + input: CreateBillingViewCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("CreateBillingView"); + let body: any; + body = JSON.stringify(se_CreateBillingViewRequest(input, context)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0DeleteBillingViewCommand + */ +export const se_DeleteBillingViewCommand = async ( + input: DeleteBillingViewCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("DeleteBillingView"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0GetBillingViewCommand + */ +export const se_GetBillingViewCommand = async ( + input: GetBillingViewCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GetBillingView"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0GetResourcePolicyCommand + */ +export const se_GetResourcePolicyCommand = async ( + input: GetResourcePolicyCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("GetResourcePolicy"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + /** * serializeAws_json1_0ListBillingViewsCommand */ @@ -39,6 +132,151 @@ export const se_ListBillingViewsCommand = async ( return buildHttpRpcRequest(context, headers, "/", undefined, body); }; +/** + * serializeAws_json1_0ListSourceViewsForBillingViewCommand + */ +export const se_ListSourceViewsForBillingViewCommand = async ( + input: ListSourceViewsForBillingViewCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ListSourceViewsForBillingView"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0ListTagsForResourceCommand + */ +export const se_ListTagsForResourceCommand = async ( + input: ListTagsForResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("ListTagsForResource"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0TagResourceCommand + */ +export const se_TagResourceCommand = async ( + input: TagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("TagResource"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0UntagResourceCommand + */ +export const se_UntagResourceCommand = async ( + input: UntagResourceCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("UntagResource"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * serializeAws_json1_0UpdateBillingViewCommand + */ +export const se_UpdateBillingViewCommand = async ( + input: UpdateBillingViewCommandInput, + context: __SerdeContext +): Promise<__HttpRequest> => { + const headers: __HeaderBag = sharedHeaders("UpdateBillingView"); + let body: any; + body = JSON.stringify(_json(input)); + return buildHttpRpcRequest(context, headers, "/", undefined, body); +}; + +/** + * deserializeAws_json1_0CreateBillingViewCommand + */ +export const de_CreateBillingViewCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_CreateBillingViewResponse(data, context); + const response: CreateBillingViewCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0DeleteBillingViewCommand + */ +export const de_DeleteBillingViewCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: DeleteBillingViewCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0GetBillingViewCommand + */ +export const de_GetBillingViewCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_GetBillingViewResponse(data, context); + const response: GetBillingViewCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0GetResourcePolicyCommand + */ +export const de_GetResourcePolicyCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: GetResourcePolicyCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserializeAws_json1_0ListBillingViewsCommand */ @@ -59,6 +297,106 @@ export const de_ListBillingViewsCommand = async ( return response; }; +/** + * deserializeAws_json1_0ListSourceViewsForBillingViewCommand + */ +export const de_ListSourceViewsForBillingViewCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListSourceViewsForBillingViewCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0ListTagsForResourceCommand + */ +export const de_ListTagsForResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: ListTagsForResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0TagResourceCommand + */ +export const de_TagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: TagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0UntagResourceCommand + */ +export const de_UntagResourceCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = _json(data); + const response: UntagResourceCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + +/** + * deserializeAws_json1_0UpdateBillingViewCommand + */ +export const de_UpdateBillingViewCommand = async ( + output: __HttpResponse, + context: __SerdeContext +): Promise => { + if (output.statusCode >= 300) { + return de_CommandError(output, context); + } + const data: any = await parseBody(output.body, context); + let contents: any = {}; + contents = de_UpdateBillingViewResponse(data, context); + const response: UpdateBillingViewCommandOutput = { + $metadata: deserializeMetadata(output), + ...contents, + }; + return response; +}; + /** * deserialize_Aws_json1_0CommandError */ @@ -72,15 +410,24 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext): case "AccessDeniedException": case "com.amazonaws.billing#AccessDeniedException": throw await de_AccessDeniedExceptionRes(parsedOutput, context); + case "ConflictException": + case "com.amazonaws.billing#ConflictException": + throw await de_ConflictExceptionRes(parsedOutput, context); case "InternalServerException": case "com.amazonaws.billing#InternalServerException": throw await de_InternalServerExceptionRes(parsedOutput, context); + case "ServiceQuotaExceededException": + case "com.amazonaws.billing#ServiceQuotaExceededException": + throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context); case "ThrottlingException": case "com.amazonaws.billing#ThrottlingException": throw await de_ThrottlingExceptionRes(parsedOutput, context); case "ValidationException": case "com.amazonaws.billing#ValidationException": throw await de_ValidationExceptionRes(parsedOutput, context); + case "ResourceNotFoundException": + case "com.amazonaws.billing#ResourceNotFoundException": + throw await de_ResourceNotFoundExceptionRes(parsedOutput, context); default: const parsedBody = parsedOutput.body; return throwDefaultError({ @@ -107,6 +454,19 @@ const de_AccessDeniedExceptionRes = async ( return __decorateServiceException(exception, body); }; +/** + * deserializeAws_json1_0ConflictExceptionRes + */ +const de_ConflictExceptionRes = async (parsedOutput: any, context: __SerdeContext): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ConflictException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + /** * deserializeAws_json1_0InternalServerExceptionRes */ @@ -123,6 +483,38 @@ const de_InternalServerExceptionRes = async ( return __decorateServiceException(exception, body); }; +/** + * deserializeAws_json1_0ResourceNotFoundExceptionRes + */ +const de_ResourceNotFoundExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ResourceNotFoundException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + +/** + * deserializeAws_json1_0ServiceQuotaExceededExceptionRes + */ +const de_ServiceQuotaExceededExceptionRes = async ( + parsedOutput: any, + context: __SerdeContext +): Promise => { + const body = parsedOutput.body; + const deserialized: any = _json(body); + const exception = new ServiceQuotaExceededException({ + $metadata: deserializeMetadata(parsedOutput), + ...deserialized, + }); + return __decorateServiceException(exception, body); +}; + /** * deserializeAws_json1_0ThrottlingExceptionRes */ @@ -159,35 +551,165 @@ const se_ActiveTimeRange = (input: ActiveTimeRange, context: __SerdeContext): an }); }; +// se_BillingViewArnList omitted. + +// se_BillingViewSourceViewsList omitted. + +// se_BillingViewTypeList omitted. + +/** + * serializeAws_json1_0CreateBillingViewRequest + */ +const se_CreateBillingViewRequest = (input: CreateBillingViewRequest, context: __SerdeContext): any => { + return take(input, { + clientToken: [true, (_) => _ ?? generateIdempotencyToken()], + dataFilterExpression: _json, + description: [], + name: [], + resourceTags: _json, + sourceViews: _json, + }); +}; + +// se_DeleteBillingViewRequest omitted. + +// se_DimensionValues omitted. + +// se_Expression omitted. + +// se_GetBillingViewRequest omitted. + +// se_GetResourcePolicyRequest omitted. + /** * serializeAws_json1_0ListBillingViewsRequest */ const se_ListBillingViewsRequest = (input: ListBillingViewsRequest, context: __SerdeContext): any => { return take(input, { activeTimeRange: (_) => se_ActiveTimeRange(_, context), + arns: _json, + billingViewTypes: _json, maxResults: [], nextToken: [], + ownerAccountId: [], }); }; +// se_ListSourceViewsForBillingViewRequest omitted. + +// se_ListTagsForResourceRequest omitted. + +// se_ResourceTag omitted. + +// se_ResourceTagKeyList omitted. + +// se_ResourceTagList omitted. + +// se_TagResourceRequest omitted. + +// se_TagValues omitted. + +// se_UntagResourceRequest omitted. + +// se_UpdateBillingViewRequest omitted. + +// se_Values omitted. + // de_AccessDeniedException omitted. +/** + * deserializeAws_json1_0BillingViewElement + */ +const de_BillingViewElement = (output: any, context: __SerdeContext): BillingViewElement => { + return take(output, { + arn: __expectString, + billingViewType: __expectString, + createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + dataFilterExpression: _json, + description: __expectString, + name: __expectString, + ownerAccountId: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; + // de_BillingViewList omitted. // de_BillingViewListElement omitted. +// de_BillingViewSourceViewsList omitted. + +// de_ConflictException omitted. + +/** + * deserializeAws_json1_0CreateBillingViewResponse + */ +const de_CreateBillingViewResponse = (output: any, context: __SerdeContext): CreateBillingViewResponse => { + return take(output, { + arn: __expectString, + createdAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; + +// de_DeleteBillingViewResponse omitted. + +// de_DimensionValues omitted. + +// de_Expression omitted. + +/** + * deserializeAws_json1_0GetBillingViewResponse + */ +const de_GetBillingViewResponse = (output: any, context: __SerdeContext): GetBillingViewResponse => { + return take(output, { + billingView: (_: any) => de_BillingViewElement(_, context), + }) as any; +}; + +// de_GetResourcePolicyResponse omitted. + // de_InternalServerException omitted. // de_ListBillingViewsResponse omitted. +// de_ListSourceViewsForBillingViewResponse omitted. + +// de_ListTagsForResourceResponse omitted. + +// de_ResourceNotFoundException omitted. + +// de_ResourceTag omitted. + +// de_ResourceTagList omitted. + +// de_ServiceQuotaExceededException omitted. + +// de_TagResourceResponse omitted. + +// de_TagValues omitted. + // de_ThrottlingException omitted. +// de_UntagResourceResponse omitted. + +/** + * deserializeAws_json1_0UpdateBillingViewResponse + */ +const de_UpdateBillingViewResponse = (output: any, context: __SerdeContext): UpdateBillingViewResponse => { + return take(output, { + arn: __expectString, + updatedAt: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))), + }) as any; +}; + // de_ValidationException omitted. // de_ValidationExceptionField omitted. // de_ValidationExceptionFieldList omitted. +// de_Values omitted. + const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ httpStatusCode: output.statusCode, requestId: diff --git a/codegen/sdk-codegen/aws-models/billing.json b/codegen/sdk-codegen/aws-models/billing.json index be21ab25ef2a3..6b01cfef7408c 100644 --- a/codegen/sdk-codegen/aws-models/billing.json +++ b/codegen/sdk-codegen/aws-models/billing.json @@ -5,8 +5,35 @@ "type": "service", "version": "2023-09-07", "operations": [ + { + "target": "com.amazonaws.billing#CreateBillingView" + }, + { + "target": "com.amazonaws.billing#DeleteBillingView" + }, + { + "target": "com.amazonaws.billing#GetBillingView" + }, + { + "target": "com.amazonaws.billing#GetResourcePolicy" + }, { "target": "com.amazonaws.billing#ListBillingViews" + }, + { + "target": "com.amazonaws.billing#ListSourceViewsForBillingView" + }, + { + "target": "com.amazonaws.billing#ListTagsForResource" + }, + { + "target": "com.amazonaws.billing#TagResource" + }, + { + "target": "com.amazonaws.billing#UntagResource" + }, + { + "target": "com.amazonaws.billing#UpdateBillingView" } ], "traits": { @@ -543,7 +570,86 @@ "com.amazonaws.billing#BillingViewArn": { "type": "string", "traits": { - "smithy.api#pattern": "^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9_\\+=\\.\\-@]{1,43}$" + "smithy.api#pattern": "^arn:aws[a-z-]*:(billing)::[0-9]{12}:billingview/[a-zA-Z0-9/:_\\+=\\.\\-@]{0,59}[a-zA-Z0-9]$" + } + }, + "com.amazonaws.billing#BillingViewArnList": { + "type": "list", + "member": { + "target": "com.amazonaws.billing#BillingViewArn" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 10 + } + } + }, + "com.amazonaws.billing#BillingViewDescription": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1024 + }, + "smithy.api#pattern": "^([ a-zA-Z0-9_\\+=\\.\\-@]+)?$", + "smithy.api#sensitive": {} + } + }, + "com.amazonaws.billing#BillingViewElement": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.billing#BillingViewArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.\n

" + } + }, + "name": { + "target": "com.amazonaws.billing#BillingViewName", + "traits": { + "smithy.api#documentation": "

\n A list of names of the billing view.\n

" + } + }, + "description": { + "target": "com.amazonaws.billing#BillingViewDescription", + "traits": { + "smithy.api#documentation": "

\n The description of the billing view.\n

" + } + }, + "billingViewType": { + "target": "com.amazonaws.billing#BillingViewType", + "traits": { + "smithy.api#documentation": "

The type of billing group.\n

" + } + }, + "ownerAccountId": { + "target": "com.amazonaws.billing#AccountId", + "traits": { + "smithy.api#documentation": "

\n The list of owners of the billing view.\n

" + } + }, + "dataFilterExpression": { + "target": "com.amazonaws.billing#Expression", + "traits": { + "smithy.api#documentation": "

\n See Expression. Billing view only supports LINKED_ACCOUNT and Tags.\n

" + } + }, + "createdAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the billing view was created.\n

" + } + }, + "updatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

The time when the billing view was last updated.\n

" + } + } + }, + "traits": { + "smithy.api#documentation": "

The metadata associated to the billing view.\n

" } }, "com.amazonaws.billing#BillingViewList": { @@ -567,6 +673,12 @@ "smithy.api#documentation": "

\n A list of names of the Billing view.\n

" } }, + "description": { + "target": "com.amazonaws.billing#BillingViewDescription", + "traits": { + "smithy.api#documentation": "

\n The description of the billing view.\n

" + } + }, "ownerAccountId": { "target": "com.amazonaws.billing#AccountId", "traits": { @@ -587,10 +699,26 @@ "com.amazonaws.billing#BillingViewName": { "type": "string", "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + }, "smithy.api#pattern": "^[ a-zA-Z0-9_\\+=\\.\\-@]+$", "smithy.api#sensitive": {} } }, + "com.amazonaws.billing#BillingViewSourceViewsList": { + "type": "list", + "member": { + "target": "com.amazonaws.billing#BillingViewArn" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1 + } + } + }, "com.amazonaws.billing#BillingViewType": { "type": "enum", "members": { @@ -605,9 +733,21 @@ "traits": { "smithy.api#enumValue": "BILLING_GROUP" } + }, + "CUSTOM": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "CUSTOM" + } } } }, + "com.amazonaws.billing#BillingViewTypeList": { + "type": "list", + "member": { + "target": "com.amazonaws.billing#BillingViewType" + } + }, "com.amazonaws.billing#BillingViewsMaxResults": { "type": "integer", "traits": { @@ -617,23 +757,13 @@ } } }, - "com.amazonaws.billing#ErrorMessage": { - "type": "string", - "traits": { - "smithy.api#length": { - "max": 1024 - } - } - }, - "com.amazonaws.billing#FieldName": { + "com.amazonaws.billing#ClientToken": { "type": "string", "traits": { - "smithy.api#length": { - "max": 100 - } + "smithy.api#pattern": "^[a-zA-Z0-9-]+$" } }, - "com.amazonaws.billing#InternalServerException": { + "com.amazonaws.billing#ConflictException": { "type": "structure", "members": { "message": { @@ -641,33 +771,53 @@ "traits": { "smithy.api#required": {} } + }, + "resourceId": { + "target": "com.amazonaws.billing#ResourceId", + "traits": { + "smithy.api#documentation": "

\n The identifier for the service resource associated with the request.\n

", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "com.amazonaws.billing#ResourceType", + "traits": { + "smithy.api#documentation": "

\n The type of resource associated with the request.\n

", + "smithy.api#required": {} + } } }, "traits": { "aws.protocols#awsQueryError": { - "code": "BillingInternalServer", - "httpResponseCode": 500 + "code": "BillingConflict", + "httpResponseCode": 409 }, - "smithy.api#documentation": "

The request processing failed because of an unknown error, exception, or failure.\n

", - "smithy.api#error": "server", - "smithy.api#httpError": 500 + "smithy.api#documentation": "

\n The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.\n

", + "smithy.api#error": "client", + "smithy.api#httpError": 409 } }, - "com.amazonaws.billing#ListBillingViews": { + "com.amazonaws.billing#CreateBillingView": { "type": "operation", "input": { - "target": "com.amazonaws.billing#ListBillingViewsRequest" + "target": "com.amazonaws.billing#CreateBillingViewRequest" }, "output": { - "target": "com.amazonaws.billing#ListBillingViewsResponse" + "target": "com.amazonaws.billing#CreateBillingViewResponse" }, "errors": [ { "target": "com.amazonaws.billing#AccessDeniedException" }, + { + "target": "com.amazonaws.billing#ConflictException" + }, { "target": "com.amazonaws.billing#InternalServerException" }, + { + "target": "com.amazonaws.billing#ServiceQuotaExceededException" + }, { "target": "com.amazonaws.billing#ThrottlingException" }, @@ -676,97 +826,71 @@ } ], "traits": { - "smithy.api#documentation": "

Lists the billing views available for a given time period.\n

\n

Every Amazon Web Services account has a unique PRIMARY billing view that represents the billing data available by default. Accounts that use Billing Conductor also have BILLING_GROUP billing views representing pro forma costs associated with each created billing group.

", + "smithy.api#documentation": "

\nCreates a billing view with the specified billing view attributes.\n

", "smithy.api#examples": [ { - "title": "Invoke ListBillingViews", + "title": "Invoke CreateBillingView", "input": { - "activeTimeRange": { - "activeAfterInclusive": 1719792000, - "activeBeforeInclusive": 1.722470399999e9 + "name": "Example Custom Billing View", + "sourceViews": ["arn:aws:billing::123456789101:billingview/primary"], + "description": "Custom Billing View Example", + "dataFilterExpression": { + "dimensions": { + "key": "LINKED_ACCOUNT", + "values": ["000000000000"] + } } }, "output": { - "billingViews": [ - { - "arn": "arn:aws:billing::123456789101:billingview/primary", - "billingViewType": "PRIMARY", - "name": "Primary Billing View Account 123456789101", - "ownerAccountId": "123456789101" - } - ] + "arn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899", + "createdAt": 1719792001 } - }, - { - "title": "Error example for ListBillingViews", - "input": { - "activeTimeRange": { - "activeAfterInclusive": 1719792001, - "activeBeforeInclusive": 1719792000 - } - }, - "error": { - "shapeId": "com.amazonaws.billing#ValidationException", - "content": { - "message": "Failed to get billing view data for an invalid time range.", - "reason": "other" - } - }, - "allowConstraintErrors": true } ], - "smithy.api#http": { - "method": "POST", - "uri": "/", - "code": 200 - }, - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "pageSize": "maxResults", - "items": "billingViews" - }, - "smithy.api#readonly": {}, - "smithy.test#smokeTests": [ - { - "id": "ListBillingViewsSuccess", - "params": { - "activeTimeRange": { - "activeAfterInclusive": 1719792000, - "activeBeforeInclusive": 1.722470399999e9 - } - }, - "expect": { - "success": {} - }, - "vendorParamsShape": "aws.test#AwsVendorParams", - "vendorParams": { - "region": "us-east-1" - } - } - ] + "smithy.api#idempotent": {} } }, - "com.amazonaws.billing#ListBillingViewsRequest": { + "com.amazonaws.billing#CreateBillingViewRequest": { "type": "structure", "members": { - "activeTimeRange": { - "target": "com.amazonaws.billing#ActiveTimeRange", + "name": { + "target": "com.amazonaws.billing#BillingViewName", "traits": { - "smithy.api#documentation": "

\n The time range for the billing views listed. PRIMARY billing view is always listed. BILLING_GROUP billing views are listed for time ranges when the associated billing group resource in Billing Conductor is active. The time range must be within one calendar month.\n

", + "smithy.api#documentation": "

\n The name of the billing view.\n

", "smithy.api#required": {} } }, - "maxResults": { - "target": "com.amazonaws.billing#BillingViewsMaxResults", + "description": { + "target": "com.amazonaws.billing#BillingViewDescription", "traits": { - "smithy.api#documentation": "

The maximum number of billing views to retrieve. Default is 100.\n

" + "smithy.api#documentation": "

\n The description of the billing view.\n

" } }, - "nextToken": { - "target": "com.amazonaws.billing#PageToken", + "sourceViews": { + "target": "com.amazonaws.billing#BillingViewSourceViewsList", "traits": { - "smithy.api#documentation": "

The pagination token that is used on subsequent calls to list billing views.

" + "smithy.api#documentation": "

A list of billing views used as the data source for the custom billing view.

", + "smithy.api#required": {} + } + }, + "dataFilterExpression": { + "target": "com.amazonaws.billing#Expression", + "traits": { + "smithy.api#documentation": "

\n See Expression. Billing view only supports LINKED_ACCOUNT and Tags.\n

" + } + }, + "clientToken": { + "target": "com.amazonaws.billing#ClientToken", + "traits": { + "smithy.api#documentation": "

A unique, case-sensitive identifier you specify to ensure idempotency of the request. Idempotency ensures that an API request completes no more than one time. If the original request completes successfully, any subsequent retries complete successfully without performing any further actions with an idempotent request.\n

", + "smithy.api#httpHeader": "X-Amzn-Client-Token", + "smithy.api#idempotencyToken": {} + } + }, + "resourceTags": { + "target": "com.amazonaws.billing#ResourceTagList", + "traits": { + "smithy.api#documentation": "

A list of key value map specifying tags associated to the billing view being created.\n

" } } }, @@ -774,20 +898,20 @@ "smithy.api#input": {} } }, - "com.amazonaws.billing#ListBillingViewsResponse": { + "com.amazonaws.billing#CreateBillingViewResponse": { "type": "structure", "members": { - "billingViews": { - "target": "com.amazonaws.billing#BillingViewList", + "arn": { + "target": "com.amazonaws.billing#BillingViewArn", "traits": { - "smithy.api#documentation": "

A list of BillingViewListElement retrieved.

", + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.\n

", "smithy.api#required": {} } }, - "nextToken": { - "target": "com.amazonaws.billing#PageToken", + "createdAt": { + "target": "smithy.api#Timestamp", "traits": { - "smithy.api#documentation": "

The pagination token to use on subsequent calls to list billing views.\n

" + "smithy.api#documentation": "

\n The time when the billing view was created.\n

" } } }, @@ -795,34 +919,1157 @@ "smithy.api#output": {} } }, - "com.amazonaws.billing#PageToken": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 1, - "max": 2047 - } - } - }, - "com.amazonaws.billing#ThrottlingException": { - "type": "structure", - "members": { - "message": { - "target": "com.amazonaws.billing#ErrorMessage", - "traits": { - "smithy.api#required": {} - } - } + "com.amazonaws.billing#DeleteBillingView": { + "type": "operation", + "input": { + "target": "com.amazonaws.billing#DeleteBillingViewRequest" }, - "traits": { - "aws.protocols#awsQueryError": { - "code": "BillingThrottling", - "httpResponseCode": 429 + "output": { + "target": "com.amazonaws.billing#DeleteBillingViewResponse" + }, + "errors": [ + { + "target": "com.amazonaws.billing#AccessDeniedException" }, - "smithy.api#documentation": "

The request was denied due to request throttling.\n

", - "smithy.api#error": "client", - "smithy.api#httpError": 429 - } + { + "target": "com.amazonaws.billing#ConflictException" + }, + { + "target": "com.amazonaws.billing#InternalServerException" + }, + { + "target": "com.amazonaws.billing#ThrottlingException" + }, + { + "target": "com.amazonaws.billing#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Deletes the specified billing view.

", + "smithy.api#examples": [ + { + "title": "Invoke DeleteBillingView", + "input": { + "arn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899" + }, + "output": { + "arn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899" + } + } + ], + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.billing#DeleteBillingViewRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.billing#BillingViewArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.billing#DeleteBillingViewResponse": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.billing#BillingViewArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.billing#Dimension": { + "type": "enum", + "members": { + "LINKED_ACCOUNT": { + "target": "smithy.api#Unit", + "traits": { + "smithy.api#enumValue": "LINKED_ACCOUNT" + } + } + } + }, + "com.amazonaws.billing#DimensionValues": { + "type": "structure", + "members": { + "key": { + "target": "com.amazonaws.billing#Dimension", + "traits": { + "smithy.api#documentation": "

\n The names of the metadata types that you can use to filter and group your results. \n

", + "smithy.api#required": {} + } + }, + "values": { + "target": "com.amazonaws.billing#Values", + "traits": { + "smithy.api#documentation": "

\n The metadata values that you can use to filter and group your results. \n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

\n The metadata that you can use to filter and group your results.\n

" + } + }, + "com.amazonaws.billing#ErrorMessage": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 1024 + } + } + }, + "com.amazonaws.billing#Expression": { + "type": "structure", + "members": { + "dimensions": { + "target": "com.amazonaws.billing#DimensionValues", + "traits": { + "smithy.api#documentation": "

\n The specific Dimension to use for Expression.\n

" + } + }, + "tags": { + "target": "com.amazonaws.billing#TagValues", + "traits": { + "smithy.api#documentation": "

\n The specific Tag to use for Expression.\n

" + } + } + }, + "traits": { + "smithy.api#documentation": "

\n See Expression. Billing view only supports LINKED_ACCOUNT and Tags.\n

" + } + }, + "com.amazonaws.billing#FieldName": { + "type": "string", + "traits": { + "smithy.api#length": { + "max": 100 + } + } + }, + "com.amazonaws.billing#GetBillingView": { + "type": "operation", + "input": { + "target": "com.amazonaws.billing#GetBillingViewRequest" + }, + "output": { + "target": "com.amazonaws.billing#GetBillingViewResponse" + }, + "errors": [ + { + "target": "com.amazonaws.billing#AccessDeniedException" + }, + { + "target": "com.amazonaws.billing#InternalServerException" + }, + { + "target": "com.amazonaws.billing#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.billing#ThrottlingException" + }, + { + "target": "com.amazonaws.billing#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns the metadata associated to the specified billing view ARN.\n

", + "smithy.api#examples": [ + { + "title": "Invoke GetBillingView", + "input": { + "arn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899" + }, + "output": { + "billingView": { + "arn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899", + "name": "Example Custom Billing View", + "description": "Custom Billing View Example -- updated description", + "dataFilterExpression": { + "dimensions": { + "key": "LINKED_ACCOUNT", + "values": ["000000000000"] + } + }, + "ownerAccountId": "123456789101", + "billingViewType": "CUSTOM" + } + } + } + ], + "smithy.api#readonly": {} + } + }, + "com.amazonaws.billing#GetBillingViewRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.billing#BillingViewArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.billing#GetBillingViewResponse": { + "type": "structure", + "members": { + "billingView": { + "target": "com.amazonaws.billing#BillingViewElement", + "traits": { + "smithy.api#documentation": "

The billing view element associated with the specified ARN.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.billing#GetResourcePolicy": { + "type": "operation", + "input": { + "target": "com.amazonaws.billing#GetResourcePolicyRequest" + }, + "output": { + "target": "com.amazonaws.billing#GetResourcePolicyResponse" + }, + "errors": [ + { + "target": "com.amazonaws.billing#AccessDeniedException" + }, + { + "target": "com.amazonaws.billing#InternalServerException" + }, + { + "target": "com.amazonaws.billing#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.billing#ThrottlingException" + }, + { + "target": "com.amazonaws.billing#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Returns the resource-based policy document attached to the resource in JSON format.\n

", + "smithy.api#examples": [ + { + "title": "Invoke GetResourcePolicy", + "input": { + "resourceArn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899" + }, + "output": { + "resourceArn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899", + "policy": "{\"Version\":\"2012-10-17\",\"Id\":\"46f47cb2-a11d-43f3-983d-470b5708a899\",\"Statement\":[{\"Sid\":\"ExampleStatement1\",\"Effect\":\"Allow\",\"Principal\":{\"AWS\":\"arn:aws:iam::000000000000:root\"},\"Action\":[\"ce:GetDimensionValues\",\"ce:GetCostAndUsageWithResources\",\"ce:GetCostAndUsage\",\"ce:GetCostForecast\",\"ce:GetTags\",\"ce:GetUsageForecast\",\"ce:GetCostCategories\",\"billing:GetBillingView\"],\"Resource\":\"arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899\"}]}" + } + } + ], + "smithy.api#readonly": {} + } + }, + "com.amazonaws.billing#GetResourcePolicyRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.billing#ResourceArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the billing view resource to which the policy is attached to.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.billing#GetResourcePolicyResponse": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.billing#ResourceArn", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) of the billing view resource to which the policy is attached to.\n

", + "smithy.api#required": {} + } + }, + "policy": { + "target": "com.amazonaws.billing#PolicyDocument", + "traits": { + "smithy.api#documentation": "

The resource-based policy document attached to the resource in JSON format.\n

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.billing#InternalServerException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.billing#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "BillingInternalServer", + "httpResponseCode": 500 + }, + "smithy.api#documentation": "

The request processing failed because of an unknown error, exception, or failure.\n

", + "smithy.api#error": "server", + "smithy.api#httpError": 500 + } + }, + "com.amazonaws.billing#ListBillingViews": { + "type": "operation", + "input": { + "target": "com.amazonaws.billing#ListBillingViewsRequest" + }, + "output": { + "target": "com.amazonaws.billing#ListBillingViewsResponse" + }, + "errors": [ + { + "target": "com.amazonaws.billing#AccessDeniedException" + }, + { + "target": "com.amazonaws.billing#InternalServerException" + }, + { + "target": "com.amazonaws.billing#ThrottlingException" + }, + { + "target": "com.amazonaws.billing#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists the billing views available for a given time period.\n

\n

Every Amazon Web Services account has a unique PRIMARY billing view that represents the billing data available by default. Accounts that use Billing Conductor also have BILLING_GROUP billing views representing pro forma costs associated with each created billing group.

", + "smithy.api#examples": [ + { + "title": "Invoke ListBillingViews", + "input": { + "activeTimeRange": { + "activeAfterInclusive": 1719792000, + "activeBeforeInclusive": 1.722470399999e9 + } + }, + "output": { + "billingViews": [ + { + "arn": "arn:aws:billing::123456789101:billingview/primary", + "billingViewType": "PRIMARY", + "name": "Primary Billing View Account 123456789101", + "ownerAccountId": "123456789101" + } + ] + } + }, + { + "title": "Error example for ListBillingViews", + "input": { + "activeTimeRange": { + "activeAfterInclusive": 1719792001, + "activeBeforeInclusive": 1719792000 + } + }, + "error": { + "shapeId": "com.amazonaws.billing#ValidationException", + "content": { + "message": "Failed to get billing view data for an invalid time range.", + "reason": "other" + } + }, + "allowConstraintErrors": true + } + ], + "smithy.api#http": { + "method": "POST", + "uri": "/", + "code": 200 + }, + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "billingViews" + }, + "smithy.api#readonly": {}, + "smithy.test#smokeTests": [ + { + "id": "ListBillingViewsSuccess", + "params": { + "activeTimeRange": { + "activeAfterInclusive": 1719792000, + "activeBeforeInclusive": 1.722470399999e9 + } + }, + "expect": { + "success": {} + }, + "vendorParamsShape": "aws.test#AwsVendorParams", + "vendorParams": { + "region": "us-east-1" + } + } + ] + } + }, + "com.amazonaws.billing#ListBillingViewsRequest": { + "type": "structure", + "members": { + "activeTimeRange": { + "target": "com.amazonaws.billing#ActiveTimeRange", + "traits": { + "smithy.api#documentation": "

\n The time range for the billing views listed. PRIMARY billing view is always listed. BILLING_GROUP billing views are listed for time ranges when the associated billing group resource in Billing Conductor is active. The time range must be within one calendar month.\n

" + } + }, + "arns": { + "target": "com.amazonaws.billing#BillingViewArnList", + "traits": { + "smithy.api#documentation": "

The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.\n

" + } + }, + "billingViewTypes": { + "target": "com.amazonaws.billing#BillingViewTypeList", + "traits": { + "smithy.api#documentation": "

The type of billing view.

" + } + }, + "ownerAccountId": { + "target": "com.amazonaws.billing#AccountId", + "traits": { + "smithy.api#documentation": "

\n The list of owners of the billing view.\n

" + } + }, + "maxResults": { + "target": "com.amazonaws.billing#BillingViewsMaxResults", + "traits": { + "smithy.api#documentation": "

The maximum number of billing views to retrieve. Default is 100.\n

" + } + }, + "nextToken": { + "target": "com.amazonaws.billing#PageToken", + "traits": { + "smithy.api#documentation": "

The pagination token that is used on subsequent calls to list billing views.

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.billing#ListBillingViewsResponse": { + "type": "structure", + "members": { + "billingViews": { + "target": "com.amazonaws.billing#BillingViewList", + "traits": { + "smithy.api#documentation": "

A list of BillingViewListElement retrieved.

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.billing#PageToken", + "traits": { + "smithy.api#documentation": "

The pagination token to use on subsequent calls to list billing views.\n

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.billing#ListSourceViewsForBillingView": { + "type": "operation", + "input": { + "target": "com.amazonaws.billing#ListSourceViewsForBillingViewRequest" + }, + "output": { + "target": "com.amazonaws.billing#ListSourceViewsForBillingViewResponse" + }, + "errors": [ + { + "target": "com.amazonaws.billing#AccessDeniedException" + }, + { + "target": "com.amazonaws.billing#InternalServerException" + }, + { + "target": "com.amazonaws.billing#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.billing#ThrottlingException" + }, + { + "target": "com.amazonaws.billing#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists the source views (managed Amazon Web Services billing views) associated with the billing view.\n

", + "smithy.api#examples": [ + { + "title": "Invoke ListSourceViewsForBillingView", + "input": { + "arn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899" + }, + "output": { + "sourceViews": ["arn:aws:billing::123456789101:billingview/primary"] + } + } + ], + "smithy.api#paginated": { + "inputToken": "nextToken", + "outputToken": "nextToken", + "pageSize": "maxResults", + "items": "sourceViews" + }, + "smithy.api#readonly": {} + } + }, + "com.amazonaws.billing#ListSourceViewsForBillingViewRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.billing#BillingViewArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.\n

", + "smithy.api#required": {} + } + }, + "maxResults": { + "target": "com.amazonaws.billing#BillingViewsMaxResults", + "traits": { + "smithy.api#documentation": "

\n The number of entries a paginated response contains.\n

" + } + }, + "nextToken": { + "target": "com.amazonaws.billing#PageToken", + "traits": { + "smithy.api#documentation": "

\n The pagination token that is used on subsequent calls to list billing views.\n

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.billing#ListSourceViewsForBillingViewResponse": { + "type": "structure", + "members": { + "sourceViews": { + "target": "com.amazonaws.billing#BillingViewSourceViewsList", + "traits": { + "smithy.api#documentation": "

A list of billing views used as the data source for the custom billing view.\n

", + "smithy.api#required": {} + } + }, + "nextToken": { + "target": "com.amazonaws.billing#PageToken", + "traits": { + "smithy.api#documentation": "

\n The pagination token that is used on subsequent calls to list billing views.\n

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.billing#ListTagsForResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.billing#ListTagsForResourceRequest" + }, + "output": { + "target": "com.amazonaws.billing#ListTagsForResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.billing#AccessDeniedException" + }, + { + "target": "com.amazonaws.billing#InternalServerException" + }, + { + "target": "com.amazonaws.billing#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.billing#ThrottlingException" + }, + { + "target": "com.amazonaws.billing#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

Lists tags associated with the billing view resource.\n

", + "smithy.api#examples": [ + { + "title": "Invoke ListTagsForResource", + "input": { + "resourceArn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899" + }, + "output": { + "resourceTags": [ + { + "key": "ExampleTagKey", + "value": "ExampleTagValue" + } + ] + } + } + ], + "smithy.api#readonly": {} + } + }, + "com.amazonaws.billing#ListTagsForResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.billing#ResourceArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) of the resource. \n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.billing#ListTagsForResourceResponse": { + "type": "structure", + "members": { + "resourceTags": { + "target": "com.amazonaws.billing#ResourceTagList", + "traits": { + "smithy.api#documentation": "

\n A list of tag key value pairs that are associated with the resource.\n

" + } + } + }, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.billing#PageToken": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 2047 + } + } + }, + "com.amazonaws.billing#PolicyDocument": { + "type": "string" + }, + "com.amazonaws.billing#QuotaCode": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + } + } + }, + "com.amazonaws.billing#ResourceArn": { + "type": "string", + "traits": { + "smithy.api#pattern": "^arn:aws[a-z-]*:(billing)::[0-9]{12}:[a-zA-Z0-9/:_\\+=\\.\\@-]{0,70}[a-zA-Z0-9]$" + } + }, + "com.amazonaws.billing#ResourceId": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + } + } + }, + "com.amazonaws.billing#ResourceNotFoundException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.billing#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + }, + "resourceId": { + "target": "com.amazonaws.billing#ResourceId", + "traits": { + "smithy.api#documentation": "

\n Value is a list of resource IDs that were not found.\n

", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "com.amazonaws.billing#ResourceType", + "traits": { + "smithy.api#documentation": "

\n Value is the type of resource that was not found.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "BillingResourceNotFound", + "httpResponseCode": 404 + }, + "smithy.api#documentation": "

\n The specified ARN in the request doesn't exist.\n

", + "smithy.api#error": "client", + "smithy.api#httpError": 404 + } + }, + "com.amazonaws.billing#ResourceTag": { + "type": "structure", + "members": { + "key": { + "target": "com.amazonaws.billing#ResourceTagKey", + "traits": { + "smithy.api#documentation": "

\n The key that's associated with the tag.\n

", + "smithy.api#required": {} + } + }, + "value": { + "target": "com.amazonaws.billing#ResourceTagValue", + "traits": { + "smithy.api#documentation": "

\n The value that's associated with the tag.\n

" + } + } + }, + "traits": { + "smithy.api#documentation": "

\n The tag structure that contains a tag key and value.\n

" + } + }, + "com.amazonaws.billing#ResourceTagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 128 + } + } + }, + "com.amazonaws.billing#ResourceTagKeyList": { + "type": "list", + "member": { + "target": "com.amazonaws.billing#ResourceTagKey" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.billing#ResourceTagList": { + "type": "list", + "member": { + "target": "com.amazonaws.billing#ResourceTag" + }, + "traits": { + "smithy.api#length": { + "min": 0, + "max": 200 + } + } + }, + "com.amazonaws.billing#ResourceTagValue": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 256 + } + } + }, + "com.amazonaws.billing#ResourceType": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + } + } + }, + "com.amazonaws.billing#ServiceCode": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 1, + "max": 1024 + } + } + }, + "com.amazonaws.billing#ServiceQuotaExceededException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.billing#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + }, + "resourceId": { + "target": "com.amazonaws.billing#ResourceId", + "traits": { + "smithy.api#documentation": "

\n The ID of the resource.\n

", + "smithy.api#required": {} + } + }, + "resourceType": { + "target": "com.amazonaws.billing#ResourceType", + "traits": { + "smithy.api#documentation": "

\n The type of Amazon Web Services resource.\n

", + "smithy.api#required": {} + } + }, + "serviceCode": { + "target": "com.amazonaws.billing#ServiceCode", + "traits": { + "smithy.api#documentation": "

\n The container for the serviceCode.\n

", + "smithy.api#required": {} + } + }, + "quotaCode": { + "target": "com.amazonaws.billing#QuotaCode", + "traits": { + "smithy.api#documentation": "

\n The container for the quotaCode.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "BillingServiceQuotaExceeded", + "httpResponseCode": 402 + }, + "smithy.api#documentation": "

\n You've reached the limit of resources you can create, or exceeded the size of an individual resource.\n

", + "smithy.api#error": "client", + "smithy.api#httpError": 402 + } + }, + "com.amazonaws.billing#TagKey": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1024 + }, + "smithy.api#pattern": "^[\\S\\s]*$" + } + }, + "com.amazonaws.billing#TagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.billing#TagResourceRequest" + }, + "output": { + "target": "com.amazonaws.billing#TagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.billing#AccessDeniedException" + }, + { + "target": "com.amazonaws.billing#InternalServerException" + }, + { + "target": "com.amazonaws.billing#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.billing#ThrottlingException" + }, + { + "target": "com.amazonaws.billing#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

\n An API operation for adding one or more tags (key-value pairs) to a resource.\n

", + "smithy.api#examples": [ + { + "title": "Invoke TagResource", + "input": { + "resourceArn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899", + "resourceTags": [ + { + "key": "ExampleTagKey", + "value": "ExampleTagValue" + } + ] + }, + "output": {} + } + ] + } + }, + "com.amazonaws.billing#TagResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.billing#ResourceArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) of the resource.\n

", + "smithy.api#required": {} + } + }, + "resourceTags": { + "target": "com.amazonaws.billing#ResourceTagList", + "traits": { + "smithy.api#documentation": "

\n A list of tag key value pairs that are associated with the resource.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.billing#TagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.billing#TagValues": { + "type": "structure", + "members": { + "key": { + "target": "com.amazonaws.billing#TagKey", + "traits": { + "smithy.api#documentation": "

\n The key for the tag.\n

", + "smithy.api#required": {} + } + }, + "values": { + "target": "com.amazonaws.billing#Values", + "traits": { + "smithy.api#documentation": "

\n The specific value of the tag.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#documentation": "

\n The values that are available for a tag.\n

" + } + }, + "com.amazonaws.billing#ThrottlingException": { + "type": "structure", + "members": { + "message": { + "target": "com.amazonaws.billing#ErrorMessage", + "traits": { + "smithy.api#required": {} + } + } + }, + "traits": { + "aws.protocols#awsQueryError": { + "code": "BillingThrottling", + "httpResponseCode": 429 + }, + "smithy.api#documentation": "

The request was denied due to request throttling.\n

", + "smithy.api#error": "client", + "smithy.api#httpError": 429 + } + }, + "com.amazonaws.billing#UntagResource": { + "type": "operation", + "input": { + "target": "com.amazonaws.billing#UntagResourceRequest" + }, + "output": { + "target": "com.amazonaws.billing#UntagResourceResponse" + }, + "errors": [ + { + "target": "com.amazonaws.billing#AccessDeniedException" + }, + { + "target": "com.amazonaws.billing#InternalServerException" + }, + { + "target": "com.amazonaws.billing#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.billing#ThrottlingException" + }, + { + "target": "com.amazonaws.billing#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

\n Removes one or more tags from a resource. Specify only tag keys in your request. Don't specify the value.\n

", + "smithy.api#examples": [ + { + "title": "Invoke UntagResource", + "input": { + "resourceArn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899", + "resourceTagKeys": ["ExampleTagKey"] + }, + "output": {} + } + ] + } + }, + "com.amazonaws.billing#UntagResourceRequest": { + "type": "structure", + "members": { + "resourceArn": { + "target": "com.amazonaws.billing#ResourceArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) of the resource.\n

", + "smithy.api#required": {} + } + }, + "resourceTagKeys": { + "target": "com.amazonaws.billing#ResourceTagKeyList", + "traits": { + "smithy.api#documentation": "

\n A list of tag key value pairs that are associated with the resource.\n

", + "smithy.api#required": {} + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.billing#UntagResourceResponse": { + "type": "structure", + "members": {}, + "traits": { + "smithy.api#output": {} + } + }, + "com.amazonaws.billing#UpdateBillingView": { + "type": "operation", + "input": { + "target": "com.amazonaws.billing#UpdateBillingViewRequest" + }, + "output": { + "target": "com.amazonaws.billing#UpdateBillingViewResponse" + }, + "errors": [ + { + "target": "com.amazonaws.billing#AccessDeniedException" + }, + { + "target": "com.amazonaws.billing#ConflictException" + }, + { + "target": "com.amazonaws.billing#InternalServerException" + }, + { + "target": "com.amazonaws.billing#ResourceNotFoundException" + }, + { + "target": "com.amazonaws.billing#ServiceQuotaExceededException" + }, + { + "target": "com.amazonaws.billing#ThrottlingException" + }, + { + "target": "com.amazonaws.billing#ValidationException" + } + ], + "traits": { + "smithy.api#documentation": "

An API to update the attributes of the billing view.\n

", + "smithy.api#examples": [ + { + "title": "Invoke UpdateBillingView", + "input": { + "name": "Example Custom Billing View", + "arn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899", + "description": "Custom Billing View Example -- updated description", + "dataFilterExpression": { + "dimensions": { + "key": "LINKED_ACCOUNT", + "values": ["000000000000"] + } + } + }, + "output": { + "arn": "arn:aws:billing::123456789101:billingview/custom-46f47cb2-a11d-43f3-983d-470b5708a899", + "updatedAt": 1719792001 + } + } + ], + "smithy.api#idempotent": {} + } + }, + "com.amazonaws.billing#UpdateBillingViewRequest": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.billing#BillingViewArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.\n

", + "smithy.api#required": {} + } + }, + "name": { + "target": "com.amazonaws.billing#BillingViewName", + "traits": { + "smithy.api#documentation": "

\n The name of the billing view.\n

" + } + }, + "description": { + "target": "com.amazonaws.billing#BillingViewDescription", + "traits": { + "smithy.api#documentation": "

\n The description of the billing view.\n

" + } + }, + "dataFilterExpression": { + "target": "com.amazonaws.billing#Expression", + "traits": { + "smithy.api#documentation": "

See Expression. Billing view only supports LINKED_ACCOUNT and Tags.\n

" + } + } + }, + "traits": { + "smithy.api#input": {} + } + }, + "com.amazonaws.billing#UpdateBillingViewResponse": { + "type": "structure", + "members": { + "arn": { + "target": "com.amazonaws.billing#BillingViewArn", + "traits": { + "smithy.api#documentation": "

\n The Amazon Resource Name (ARN) that can be used to uniquely identify the billing view.\n

", + "smithy.api#required": {} + } + }, + "updatedAt": { + "target": "smithy.api#Timestamp", + "traits": { + "smithy.api#documentation": "

\n The time when the billing view was last updated.\n

" + } + } + }, + "traits": { + "smithy.api#output": {} + } }, "com.amazonaws.billing#ValidationException": { "type": "structure", @@ -913,6 +2160,28 @@ } } } + }, + "com.amazonaws.billing#Value": { + "type": "string", + "traits": { + "smithy.api#length": { + "min": 0, + "max": 1024 + }, + "smithy.api#pattern": "^[\\S\\s]*$" + } + }, + "com.amazonaws.billing#Values": { + "type": "list", + "member": { + "target": "com.amazonaws.billing#Value" + }, + "traits": { + "smithy.api#length": { + "min": 1, + "max": 200 + } + } } } }