Skip to content

Commit da0c974

Browse files
author
awstools
committed
feat(client-budgets): This release adds tag support for budgets and budget actions.
1 parent 188916b commit da0c974

16 files changed

+1220
-177
lines changed

clients/client-budgets/README.md

+31-7
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ using your favorite package manager:
6565

6666
The AWS SDK is modulized by clients and commands.
6767
To send a request, you only need to import the `BudgetsClient` and
68-
the commands you need, for example `DescribeBudgetsCommand`:
68+
the commands you need, for example `ListTagsForResourceCommand`:
6969

7070
```js
7171
// ES5 example
72-
const { BudgetsClient, DescribeBudgetsCommand } = require("@aws-sdk/client-budgets");
72+
const { BudgetsClient, ListTagsForResourceCommand } = require("@aws-sdk/client-budgets");
7373
```
7474

7575
```ts
7676
// ES6+ example
77-
import { BudgetsClient, DescribeBudgetsCommand } from "@aws-sdk/client-budgets";
77+
import { BudgetsClient, ListTagsForResourceCommand } from "@aws-sdk/client-budgets";
7878
```
7979

8080
### Usage
@@ -93,7 +93,7 @@ const client = new BudgetsClient({ region: "REGION" });
9393
const params = {
9494
/** input parameters */
9595
};
96-
const command = new DescribeBudgetsCommand(params);
96+
const command = new ListTagsForResourceCommand(params);
9797
```
9898

9999
#### Async/await
@@ -172,15 +172,15 @@ const client = new AWS.Budgets({ region: "REGION" });
172172

173173
// async/await.
174174
try {
175-
const data = await client.describeBudgets(params);
175+
const data = await client.listTagsForResource(params);
176176
// process data.
177177
} catch (error) {
178178
// error handling.
179179
}
180180

181181
// Promises.
182182
client
183-
.describeBudgets(params)
183+
.listTagsForResource(params)
184184
.then((data) => {
185185
// process data.
186186
})
@@ -189,7 +189,7 @@ client
189189
});
190190

191191
// callbacks.
192-
client.describeBudgets(params, (err, data) => {
192+
client.listTagsForResource(params, (err, data) => {
193193
// process err and data.
194194
});
195195
```
@@ -396,6 +396,30 @@ ExecuteBudgetAction
396396

397397
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/budgets/command/ExecuteBudgetActionCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-budgets/Interface/ExecuteBudgetActionCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-budgets/Interface/ExecuteBudgetActionCommandOutput/)
398398

399+
</details>
400+
<details>
401+
<summary>
402+
ListTagsForResource
403+
</summary>
404+
405+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/budgets/command/ListTagsForResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-budgets/Interface/ListTagsForResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-budgets/Interface/ListTagsForResourceCommandOutput/)
406+
407+
</details>
408+
<details>
409+
<summary>
410+
TagResource
411+
</summary>
412+
413+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/budgets/command/TagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-budgets/Interface/TagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-budgets/Interface/TagResourceCommandOutput/)
414+
415+
</details>
416+
<details>
417+
<summary>
418+
UntagResource
419+
</summary>
420+
421+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/budgets/command/UntagResourceCommand/) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-budgets/Interface/UntagResourceCommandInput/) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/Package/-aws-sdk-client-budgets/Interface/UntagResourceCommandOutput/)
422+
399423
</details>
400424
<details>
401425
<summary>

clients/client-budgets/src/Budgets.ts

+53
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,17 @@ import {
9898
ExecuteBudgetActionCommandInput,
9999
ExecuteBudgetActionCommandOutput,
100100
} from "./commands/ExecuteBudgetActionCommand";
101+
import {
102+
ListTagsForResourceCommand,
103+
ListTagsForResourceCommandInput,
104+
ListTagsForResourceCommandOutput,
105+
} from "./commands/ListTagsForResourceCommand";
106+
import { TagResourceCommand, TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
107+
import {
108+
UntagResourceCommand,
109+
UntagResourceCommandInput,
110+
UntagResourceCommandOutput,
111+
} from "./commands/UntagResourceCommand";
101112
import {
102113
UpdateBudgetActionCommand,
103114
UpdateBudgetActionCommandInput,
@@ -139,6 +150,9 @@ const commands = {
139150
DescribeNotificationsForBudgetCommand,
140151
DescribeSubscribersForNotificationCommand,
141152
ExecuteBudgetActionCommand,
153+
ListTagsForResourceCommand,
154+
TagResourceCommand,
155+
UntagResourceCommand,
142156
UpdateBudgetCommand,
143157
UpdateBudgetActionCommand,
144158
UpdateNotificationCommand,
@@ -451,6 +465,45 @@ export interface Budgets {
451465
cb: (err: any, data?: ExecuteBudgetActionCommandOutput) => void
452466
): void;
453467

468+
/**
469+
* @see {@link ListTagsForResourceCommand}
470+
*/
471+
listTagsForResource(
472+
args: ListTagsForResourceCommandInput,
473+
options?: __HttpHandlerOptions
474+
): Promise<ListTagsForResourceCommandOutput>;
475+
listTagsForResource(
476+
args: ListTagsForResourceCommandInput,
477+
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
478+
): void;
479+
listTagsForResource(
480+
args: ListTagsForResourceCommandInput,
481+
options: __HttpHandlerOptions,
482+
cb: (err: any, data?: ListTagsForResourceCommandOutput) => void
483+
): void;
484+
485+
/**
486+
* @see {@link TagResourceCommand}
487+
*/
488+
tagResource(args: TagResourceCommandInput, options?: __HttpHandlerOptions): Promise<TagResourceCommandOutput>;
489+
tagResource(args: TagResourceCommandInput, cb: (err: any, data?: TagResourceCommandOutput) => void): void;
490+
tagResource(
491+
args: TagResourceCommandInput,
492+
options: __HttpHandlerOptions,
493+
cb: (err: any, data?: TagResourceCommandOutput) => void
494+
): void;
495+
496+
/**
497+
* @see {@link UntagResourceCommand}
498+
*/
499+
untagResource(args: UntagResourceCommandInput, options?: __HttpHandlerOptions): Promise<UntagResourceCommandOutput>;
500+
untagResource(args: UntagResourceCommandInput, cb: (err: any, data?: UntagResourceCommandOutput) => void): void;
501+
untagResource(
502+
args: UntagResourceCommandInput,
503+
options: __HttpHandlerOptions,
504+
cb: (err: any, data?: UntagResourceCommandOutput) => void
505+
): void;
506+
454507
/**
455508
* @see {@link UpdateBudgetCommand}
456509
*/

clients/client-budgets/src/BudgetsClient.ts

+12
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,12 @@ import {
9999
ExecuteBudgetActionCommandInput,
100100
ExecuteBudgetActionCommandOutput,
101101
} from "./commands/ExecuteBudgetActionCommand";
102+
import {
103+
ListTagsForResourceCommandInput,
104+
ListTagsForResourceCommandOutput,
105+
} from "./commands/ListTagsForResourceCommand";
106+
import { TagResourceCommandInput, TagResourceCommandOutput } from "./commands/TagResourceCommand";
107+
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "./commands/UntagResourceCommand";
102108
import { UpdateBudgetActionCommandInput, UpdateBudgetActionCommandOutput } from "./commands/UpdateBudgetActionCommand";
103109
import { UpdateBudgetCommandInput, UpdateBudgetCommandOutput } from "./commands/UpdateBudgetCommand";
104110
import { UpdateNotificationCommandInput, UpdateNotificationCommandOutput } from "./commands/UpdateNotificationCommand";
@@ -137,6 +143,9 @@ export type ServiceInputTypes =
137143
| DescribeNotificationsForBudgetCommandInput
138144
| DescribeSubscribersForNotificationCommandInput
139145
| ExecuteBudgetActionCommandInput
146+
| ListTagsForResourceCommandInput
147+
| TagResourceCommandInput
148+
| UntagResourceCommandInput
140149
| UpdateBudgetActionCommandInput
141150
| UpdateBudgetCommandInput
142151
| UpdateNotificationCommandInput
@@ -165,6 +174,9 @@ export type ServiceOutputTypes =
165174
| DescribeNotificationsForBudgetCommandOutput
166175
| DescribeSubscribersForNotificationCommandOutput
167176
| ExecuteBudgetActionCommandOutput
177+
| ListTagsForResourceCommandOutput
178+
| TagResourceCommandOutput
179+
| UntagResourceCommandOutput
168180
| UpdateBudgetActionCommandOutput
169181
| UpdateBudgetCommandOutput
170182
| UpdateNotificationCommandOutput

clients/client-budgets/src/commands/CreateBudgetActionCommand.ts

+9
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ export interface CreateBudgetActionCommandOutput extends CreateBudgetActionRespo
8484
* Address: "STRING_VALUE", // required
8585
* },
8686
* ],
87+
* ResourceTags: [ // ResourceTagList
88+
* { // ResourceTag
89+
* Key: "STRING_VALUE", // required
90+
* Value: "STRING_VALUE", // required
91+
* },
92+
* ],
8793
* };
8894
* const command = new CreateBudgetActionCommand(input);
8995
* const response = await client.send(command);
@@ -119,6 +125,9 @@ export interface CreateBudgetActionCommandOutput extends CreateBudgetActionRespo
119125
* @throws {@link NotFoundException} (client fault)
120126
* <p>We can’t locate the resource that you specified.</p>
121127
*
128+
* @throws {@link ServiceQuotaExceededException} (client fault)
129+
* <p>You've reached the limit on the number of tags you can associate with a resource.</p>
130+
*
122131
* @throws {@link ThrottlingException} (client fault)
123132
* <p>The number of API requests has exceeded the maximum allowed API request throttling limit
124133
* for the account.</p>

clients/client-budgets/src/commands/CreateBudgetCommand.ts

+9
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,12 @@ export interface CreateBudgetCommandOutput extends CreateBudgetResponse, __Metad
112112
* ],
113113
* },
114114
* ],
115+
* ResourceTags: [ // ResourceTagList
116+
* { // ResourceTag
117+
* Key: "STRING_VALUE", // required
118+
* Value: "STRING_VALUE", // required
119+
* },
120+
* ],
115121
* };
116122
* const command = new CreateBudgetCommand(input);
117123
* const response = await client.send(command);
@@ -140,6 +146,9 @@ export interface CreateBudgetCommandOutput extends CreateBudgetResponse, __Metad
140146
* @throws {@link InvalidParameterException} (client fault)
141147
* <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
142148
*
149+
* @throws {@link ServiceQuotaExceededException} (client fault)
150+
* <p>You've reached the limit on the number of tags you can associate with a resource.</p>
151+
*
143152
* @throws {@link ThrottlingException} (client fault)
144153
* <p>The number of API requests has exceeded the maximum allowed API request throttling limit
145154
* for the account.</p>

clients/client-budgets/src/commands/DeleteBudgetActionCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ export interface DeleteBudgetActionCommandOutput extends DeleteBudgetActionRespo
119119
* <p>We can’t locate the resource that you specified.</p>
120120
*
121121
* @throws {@link ResourceLockedException} (client fault)
122-
* <p> The request was received and recognized by the server, but the server rejected that
123-
* particular method for the requested resource. </p>
122+
* <p>The request was received and recognized by the server, but the server rejected that
123+
* particular method for the requested resource.</p>
124124
*
125125
* @throws {@link ThrottlingException} (client fault)
126126
* <p>The number of API requests has exceeded the maximum allowed API request throttling limit

clients/client-budgets/src/commands/DescribeBudgetNotificationsForAccountCommand.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ export interface DescribeBudgetNotificationsForAccountCommandOutput
3636
__MetadataBearer {}
3737

3838
/**
39-
* <p>
40-
* Lists the budget names and notifications that are associated with an account.
41-
* </p>
39+
* <p> Lists the budget names and notifications that are associated with an account. </p>
4240
* @example
4341
* Use a bare-bones client and the command you need to make an API call.
4442
* ```javascript

clients/client-budgets/src/commands/ExecuteBudgetActionCommand.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ export interface ExecuteBudgetActionCommandOutput extends ExecuteBudgetActionRes
7272
* <p>We can’t locate the resource that you specified.</p>
7373
*
7474
* @throws {@link ResourceLockedException} (client fault)
75-
* <p> The request was received and recognized by the server, but the server rejected that
76-
* particular method for the requested resource. </p>
75+
* <p>The request was received and recognized by the server, but the server rejected that
76+
* particular method for the requested resource.</p>
7777
*
7878
* @throws {@link ThrottlingException} (client fault)
7979
* <p>The number of API requests has exceeded the maximum allowed API request throttling limit
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// smithy-typescript generated code
2+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
3+
import { getSerdePlugin } from "@smithy/middleware-serde";
4+
import { Command as $Command } from "@smithy/smithy-client";
5+
import { MetadataBearer as __MetadataBearer } from "@smithy/types";
6+
7+
import { BudgetsClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../BudgetsClient";
8+
import { commonParams } from "../endpoint/EndpointParameters";
9+
import { ListTagsForResourceRequest, ListTagsForResourceResponse } from "../models/models_0";
10+
import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_json1_1";
11+
12+
/**
13+
* @public
14+
*/
15+
export { __MetadataBearer, $Command };
16+
/**
17+
* @public
18+
*
19+
* The input for {@link ListTagsForResourceCommand}.
20+
*/
21+
export interface ListTagsForResourceCommandInput extends ListTagsForResourceRequest {}
22+
/**
23+
* @public
24+
*
25+
* The output of {@link ListTagsForResourceCommand}.
26+
*/
27+
export interface ListTagsForResourceCommandOutput extends ListTagsForResourceResponse, __MetadataBearer {}
28+
29+
/**
30+
* <p>Lists tags associated with a budget or budget action resource.</p>
31+
* @example
32+
* Use a bare-bones client and the command you need to make an API call.
33+
* ```javascript
34+
* import { BudgetsClient, ListTagsForResourceCommand } from "@aws-sdk/client-budgets"; // ES Modules import
35+
* // const { BudgetsClient, ListTagsForResourceCommand } = require("@aws-sdk/client-budgets"); // CommonJS import
36+
* const client = new BudgetsClient(config);
37+
* const input = { // ListTagsForResourceRequest
38+
* ResourceARN: "STRING_VALUE", // required
39+
* };
40+
* const command = new ListTagsForResourceCommand(input);
41+
* const response = await client.send(command);
42+
* // { // ListTagsForResourceResponse
43+
* // ResourceTags: [ // ResourceTagList
44+
* // { // ResourceTag
45+
* // Key: "STRING_VALUE", // required
46+
* // Value: "STRING_VALUE", // required
47+
* // },
48+
* // ],
49+
* // };
50+
*
51+
* ```
52+
*
53+
* @param ListTagsForResourceCommandInput - {@link ListTagsForResourceCommandInput}
54+
* @returns {@link ListTagsForResourceCommandOutput}
55+
* @see {@link ListTagsForResourceCommandInput} for command's `input` shape.
56+
* @see {@link ListTagsForResourceCommandOutput} for command's `response` shape.
57+
* @see {@link BudgetsClientResolvedConfig | config} for BudgetsClient's `config` shape.
58+
*
59+
* @throws {@link AccessDeniedException} (client fault)
60+
* <p>You are not authorized to use this operation with the given parameters.</p>
61+
*
62+
* @throws {@link InternalErrorException} (server fault)
63+
* <p>An error on the server occurred during the processing of your request. Try again later.</p>
64+
*
65+
* @throws {@link InvalidParameterException} (client fault)
66+
* <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
67+
*
68+
* @throws {@link NotFoundException} (client fault)
69+
* <p>We can’t locate the resource that you specified.</p>
70+
*
71+
* @throws {@link ThrottlingException} (client fault)
72+
* <p>The number of API requests has exceeded the maximum allowed API request throttling limit
73+
* for the account.</p>
74+
*
75+
* @throws {@link BudgetsServiceException}
76+
* <p>Base exception class for all service exceptions from Budgets service.</p>
77+
*
78+
* @public
79+
*/
80+
export class ListTagsForResourceCommand extends $Command
81+
.classBuilder<
82+
ListTagsForResourceCommandInput,
83+
ListTagsForResourceCommandOutput,
84+
BudgetsClientResolvedConfig,
85+
ServiceInputTypes,
86+
ServiceOutputTypes
87+
>()
88+
.ep({
89+
...commonParams,
90+
})
91+
.m(function (this: any, Command: any, cs: any, config: BudgetsClientResolvedConfig, o: any) {
92+
return [
93+
getSerdePlugin(config, this.serialize, this.deserialize),
94+
getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
95+
];
96+
})
97+
.s("AWSBudgetServiceGateway", "ListTagsForResource", {})
98+
.n("BudgetsClient", "ListTagsForResourceCommand")
99+
.f(void 0, void 0)
100+
.ser(se_ListTagsForResourceCommand)
101+
.de(de_ListTagsForResourceCommand)
102+
.build() {}

0 commit comments

Comments
 (0)