@aws-sdk/client-cost-and-usage-report-service 3.445.0 → 3.450.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +41 -17
  2. package/dist-cjs/CostAndUsageReportService.js +6 -0
  3. package/dist-cjs/commands/ListTagsForResourceCommand.js +51 -0
  4. package/dist-cjs/commands/TagResourceCommand.js +51 -0
  5. package/dist-cjs/commands/UntagResourceCommand.js +51 -0
  6. package/dist-cjs/commands/index.js +3 -0
  7. package/dist-cjs/models/models_0.js +21 -1
  8. package/dist-cjs/protocols/Aws_json1_1.js +151 -1
  9. package/dist-es/CostAndUsageReportService.js +6 -0
  10. package/dist-es/commands/ListTagsForResourceCommand.js +47 -0
  11. package/dist-es/commands/TagResourceCommand.js +47 -0
  12. package/dist-es/commands/UntagResourceCommand.js +47 -0
  13. package/dist-es/commands/index.js +3 -0
  14. package/dist-es/models/models_0.js +19 -0
  15. package/dist-es/protocols/Aws_json1_1.js +145 -1
  16. package/dist-types/CostAndUsageReportService.d.ts +30 -10
  17. package/dist-types/CostAndUsageReportServiceClient.d.ts +14 -12
  18. package/dist-types/commands/DeleteReportDefinitionCommand.d.ts +4 -3
  19. package/dist-types/commands/DescribeReportDefinitionsCommand.d.ts +6 -2
  20. package/dist-types/commands/ListTagsForResourceCommand.d.ts +87 -0
  21. package/dist-types/commands/ModifyReportDefinitionCommand.d.ts +7 -3
  22. package/dist-types/commands/PutReportDefinitionCommand.d.ts +15 -2
  23. package/dist-types/commands/TagResourceCommand.d.ts +86 -0
  24. package/dist-types/commands/UntagResourceCommand.d.ts +83 -0
  25. package/dist-types/commands/index.d.ts +3 -0
  26. package/dist-types/index.d.ts +9 -10
  27. package/dist-types/models/models_0.d.ts +153 -14
  28. package/dist-types/protocols/Aws_json1_1.d.ts +27 -0
  29. package/dist-types/ts3.4/CostAndUsageReportService.d.ts +51 -0
  30. package/dist-types/ts3.4/CostAndUsageReportServiceClient.d.ts +20 -2
  31. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +39 -0
  32. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +35 -0
  33. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +38 -0
  34. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  35. package/dist-types/ts3.4/models/models_0.d.ts +42 -1
  36. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +36 -0
  37. package/package.json +12 -12
package/README.md CHANGED
@@ -6,19 +6,19 @@
6
6
 
7
7
  AWS SDK for JavaScript CostAndUsageReportService Client for Node.js, Browser and React Native.
8
8
 
9
- <p>The AWS Cost and Usage Report API enables you to programmatically create, query, and delete
10
- AWS Cost and Usage report definitions.</p>
11
- <p>AWS Cost and Usage reports track the monthly AWS costs and usage
12
- associated with your AWS account.
9
+ <p>You can use the Amazon Web Services Cost and Usage Report API to programmatically create, query, and delete
10
+ Amazon Web Services Cost and Usage Report definitions.</p>
11
+ <p>Amazon Web Services Cost and Usage Report track the monthly Amazon Web Services costs and usage
12
+ associated with your Amazon Web Services account.
13
13
 
14
- The report contains line items for each unique combination of AWS product,
15
- usage type, and operation that your AWS account uses.
14
+ The report contains line items for each unique combination of Amazon Web Services product,
15
+ usage type, and operation that your Amazon Web Services account uses.
16
16
 
17
- You can configure the AWS Cost and Usage report to show only the data that you want, using the
18
- AWS Cost and Usage API.</p>
17
+ You can configure the Amazon Web Services Cost and Usage Report to show only the data that you want, using the
18
+ Amazon Web Services Cost and Usage Report API.</p>
19
19
 
20
20
  <p>Service Endpoint</p>
21
- <p>The AWS Cost and Usage Report API provides the following endpoint:</p>
21
+ <p>The Amazon Web Services Cost and Usage Report API provides the following endpoint:</p>
22
22
  <ul>
23
23
  <li>
24
24
  <p>cur.us-east-1.amazonaws.com</p>
@@ -40,13 +40,13 @@ using your favorite package manager:
40
40
 
41
41
  The AWS SDK is modulized by clients and commands.
42
42
  To send a request, you only need to import the `CostAndUsageReportServiceClient` and
43
- the commands you need, for example `DescribeReportDefinitionsCommand`:
43
+ the commands you need, for example `ListTagsForResourceCommand`:
44
44
 
45
45
  ```js
46
46
  // ES5 example
47
47
  const {
48
48
  CostAndUsageReportServiceClient,
49
- DescribeReportDefinitionsCommand,
49
+ ListTagsForResourceCommand,
50
50
  } = require("@aws-sdk/client-cost-and-usage-report-service");
51
51
  ```
52
52
 
@@ -54,7 +54,7 @@ const {
54
54
  // ES6+ example
55
55
  import {
56
56
  CostAndUsageReportServiceClient,
57
- DescribeReportDefinitionsCommand,
57
+ ListTagsForResourceCommand,
58
58
  } from "@aws-sdk/client-cost-and-usage-report-service";
59
59
  ```
60
60
 
@@ -74,7 +74,7 @@ const client = new CostAndUsageReportServiceClient({ region: "REGION" });
74
74
  const params = {
75
75
  /** input parameters */
76
76
  };
77
- const command = new DescribeReportDefinitionsCommand(params);
77
+ const command = new ListTagsForResourceCommand(params);
78
78
  ```
79
79
 
80
80
  #### Async/await
@@ -153,7 +153,7 @@ const client = new AWS.CostAndUsageReportService({ region: "REGION" });
153
153
 
154
154
  // async/await.
155
155
  try {
156
- const data = await client.describeReportDefinitions(params);
156
+ const data = await client.listTagsForResource(params);
157
157
  // process data.
158
158
  } catch (error) {
159
159
  // error handling.
@@ -161,7 +161,7 @@ try {
161
161
 
162
162
  // Promises.
163
163
  client
164
- .describeReportDefinitions(params)
164
+ .listTagsForResource(params)
165
165
  .then((data) => {
166
166
  // process data.
167
167
  })
@@ -170,7 +170,7 @@ client
170
170
  });
171
171
 
172
172
  // callbacks.
173
- client.describeReportDefinitions(params, (err, data) => {
173
+ client.listTagsForResource(params, (err, data) => {
174
174
  // process err and data.
175
175
  });
176
176
  ```
@@ -185,7 +185,7 @@ try {
185
185
  const data = await client.send(command);
186
186
  // process data.
187
187
  } catch (error) {
188
- const { requestId, cfId, extendedRequestId } = error.$$metadata;
188
+ const { requestId, cfId, extendedRequestId } = error.$metadata;
189
189
  console.log({ requestId, cfId, extendedRequestId });
190
190
  /**
191
191
  * The keys within exceptions are also parsed.
@@ -241,6 +241,14 @@ DescribeReportDefinitions
241
241
 
242
242
  [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/classes/describereportdefinitionscommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/describereportdefinitionscommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/describereportdefinitionscommandoutput.html)
243
243
 
244
+ </details>
245
+ <details>
246
+ <summary>
247
+ ListTagsForResource
248
+ </summary>
249
+
250
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/classes/listtagsforresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/listtagsforresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/listtagsforresourcecommandoutput.html)
251
+
244
252
  </details>
245
253
  <details>
246
254
  <summary>
@@ -258,3 +266,19 @@ PutReportDefinition
258
266
  [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/classes/putreportdefinitioncommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/putreportdefinitioncommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/putreportdefinitioncommandoutput.html)
259
267
 
260
268
  </details>
269
+ <details>
270
+ <summary>
271
+ TagResource
272
+ </summary>
273
+
274
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/classes/tagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/tagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/tagresourcecommandoutput.html)
275
+
276
+ </details>
277
+ <details>
278
+ <summary>
279
+ UntagResource
280
+ </summary>
281
+
282
+ [Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/classes/untagresourcecommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/untagresourcecommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-cost-and-usage-report-service/interfaces/untagresourcecommandoutput.html)
283
+
284
+ </details>
@@ -4,14 +4,20 @@ exports.CostAndUsageReportService = void 0;
4
4
  const smithy_client_1 = require("@smithy/smithy-client");
5
5
  const DeleteReportDefinitionCommand_1 = require("./commands/DeleteReportDefinitionCommand");
6
6
  const DescribeReportDefinitionsCommand_1 = require("./commands/DescribeReportDefinitionsCommand");
7
+ const ListTagsForResourceCommand_1 = require("./commands/ListTagsForResourceCommand");
7
8
  const ModifyReportDefinitionCommand_1 = require("./commands/ModifyReportDefinitionCommand");
8
9
  const PutReportDefinitionCommand_1 = require("./commands/PutReportDefinitionCommand");
10
+ const TagResourceCommand_1 = require("./commands/TagResourceCommand");
11
+ const UntagResourceCommand_1 = require("./commands/UntagResourceCommand");
9
12
  const CostAndUsageReportServiceClient_1 = require("./CostAndUsageReportServiceClient");
10
13
  const commands = {
11
14
  DeleteReportDefinitionCommand: DeleteReportDefinitionCommand_1.DeleteReportDefinitionCommand,
12
15
  DescribeReportDefinitionsCommand: DescribeReportDefinitionsCommand_1.DescribeReportDefinitionsCommand,
16
+ ListTagsForResourceCommand: ListTagsForResourceCommand_1.ListTagsForResourceCommand,
13
17
  ModifyReportDefinitionCommand: ModifyReportDefinitionCommand_1.ModifyReportDefinitionCommand,
14
18
  PutReportDefinitionCommand: PutReportDefinitionCommand_1.PutReportDefinitionCommand,
19
+ TagResourceCommand: TagResourceCommand_1.TagResourceCommand,
20
+ UntagResourceCommand: UntagResourceCommand_1.UntagResourceCommand,
15
21
  };
16
22
  class CostAndUsageReportService extends CostAndUsageReportServiceClient_1.CostAndUsageReportServiceClient {
17
23
  }
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListTagsForResourceCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
10
+ class ListTagsForResourceCommand extends smithy_client_1.Command {
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ constructor(input) {
20
+ super();
21
+ this.input = input;
22
+ }
23
+ resolveMiddleware(clientStack, configuration, options) {
24
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
25
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions()));
26
+ const stack = clientStack.concat(this.middlewareStack);
27
+ const { logger } = configuration;
28
+ const clientName = "CostAndUsageReportServiceClient";
29
+ const commandName = "ListTagsForResourceCommand";
30
+ const handlerExecutionContext = {
31
+ logger,
32
+ clientName,
33
+ commandName,
34
+ inputFilterSensitiveLog: (_) => _,
35
+ outputFilterSensitiveLog: (_) => _,
36
+ [types_1.SMITHY_CONTEXT_KEY]: {
37
+ service: "AWSOrigamiServiceGatewayService",
38
+ operation: "ListTagsForResource",
39
+ },
40
+ };
41
+ const { requestHandler } = configuration;
42
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
43
+ }
44
+ serialize(input, context) {
45
+ return (0, Aws_json1_1_1.se_ListTagsForResourceCommand)(input, context);
46
+ }
47
+ deserialize(output, context) {
48
+ return (0, Aws_json1_1_1.de_ListTagsForResourceCommand)(output, context);
49
+ }
50
+ }
51
+ exports.ListTagsForResourceCommand = ListTagsForResourceCommand;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TagResourceCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
10
+ class TagResourceCommand extends smithy_client_1.Command {
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ constructor(input) {
20
+ super();
21
+ this.input = input;
22
+ }
23
+ resolveMiddleware(clientStack, configuration, options) {
24
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
25
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, TagResourceCommand.getEndpointParameterInstructions()));
26
+ const stack = clientStack.concat(this.middlewareStack);
27
+ const { logger } = configuration;
28
+ const clientName = "CostAndUsageReportServiceClient";
29
+ const commandName = "TagResourceCommand";
30
+ const handlerExecutionContext = {
31
+ logger,
32
+ clientName,
33
+ commandName,
34
+ inputFilterSensitiveLog: (_) => _,
35
+ outputFilterSensitiveLog: (_) => _,
36
+ [types_1.SMITHY_CONTEXT_KEY]: {
37
+ service: "AWSOrigamiServiceGatewayService",
38
+ operation: "TagResource",
39
+ },
40
+ };
41
+ const { requestHandler } = configuration;
42
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
43
+ }
44
+ serialize(input, context) {
45
+ return (0, Aws_json1_1_1.se_TagResourceCommand)(input, context);
46
+ }
47
+ deserialize(output, context) {
48
+ return (0, Aws_json1_1_1.de_TagResourceCommand)(output, context);
49
+ }
50
+ }
51
+ exports.TagResourceCommand = TagResourceCommand;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UntagResourceCommand = exports.$Command = void 0;
4
+ const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
5
+ const middleware_serde_1 = require("@smithy/middleware-serde");
6
+ const smithy_client_1 = require("@smithy/smithy-client");
7
+ Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
8
+ const types_1 = require("@smithy/types");
9
+ const Aws_json1_1_1 = require("../protocols/Aws_json1_1");
10
+ class UntagResourceCommand extends smithy_client_1.Command {
11
+ static getEndpointParameterInstructions() {
12
+ return {
13
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
14
+ Endpoint: { type: "builtInParams", name: "endpoint" },
15
+ Region: { type: "builtInParams", name: "region" },
16
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
17
+ };
18
+ }
19
+ constructor(input) {
20
+ super();
21
+ this.input = input;
22
+ }
23
+ resolveMiddleware(clientStack, configuration, options) {
24
+ this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
25
+ this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, UntagResourceCommand.getEndpointParameterInstructions()));
26
+ const stack = clientStack.concat(this.middlewareStack);
27
+ const { logger } = configuration;
28
+ const clientName = "CostAndUsageReportServiceClient";
29
+ const commandName = "UntagResourceCommand";
30
+ const handlerExecutionContext = {
31
+ logger,
32
+ clientName,
33
+ commandName,
34
+ inputFilterSensitiveLog: (_) => _,
35
+ outputFilterSensitiveLog: (_) => _,
36
+ [types_1.SMITHY_CONTEXT_KEY]: {
37
+ service: "AWSOrigamiServiceGatewayService",
38
+ operation: "UntagResource",
39
+ },
40
+ };
41
+ const { requestHandler } = configuration;
42
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
43
+ }
44
+ serialize(input, context) {
45
+ return (0, Aws_json1_1_1.se_UntagResourceCommand)(input, context);
46
+ }
47
+ deserialize(output, context) {
48
+ return (0, Aws_json1_1_1.de_UntagResourceCommand)(output, context);
49
+ }
50
+ }
51
+ exports.UntagResourceCommand = UntagResourceCommand;
@@ -3,5 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./DeleteReportDefinitionCommand"), exports);
5
5
  tslib_1.__exportStar(require("./DescribeReportDefinitionsCommand"), exports);
6
+ tslib_1.__exportStar(require("./ListTagsForResourceCommand"), exports);
6
7
  tslib_1.__exportStar(require("./ModifyReportDefinitionCommand"), exports);
7
8
  tslib_1.__exportStar(require("./PutReportDefinitionCommand"), exports);
9
+ tslib_1.__exportStar(require("./TagResourceCommand"), exports);
10
+ tslib_1.__exportStar(require("./UntagResourceCommand"), exports);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReportLimitReachedException = exports.DuplicateReportNameException = exports.TimeUnit = exports.AWSRegion = exports.ReportVersioning = exports.ReportFormat = exports.CompressionFormat = exports.SchemaElement = exports.ValidationException = exports.InternalErrorException = exports.AdditionalArtifact = void 0;
3
+ exports.ReportLimitReachedException = exports.DuplicateReportNameException = exports.ResourceNotFoundException = exports.TimeUnit = exports.AWSRegion = exports.ReportVersioning = exports.LastStatus = exports.ReportFormat = exports.CompressionFormat = exports.SchemaElement = exports.ValidationException = exports.InternalErrorException = exports.AdditionalArtifact = void 0;
4
4
  const CostAndUsageReportServiceServiceException_1 = require("./CostAndUsageReportServiceServiceException");
5
5
  exports.AdditionalArtifact = {
6
6
  ATHENA: "ATHENA",
@@ -36,6 +36,7 @@ class ValidationException extends CostAndUsageReportServiceServiceException_1.Co
36
36
  }
37
37
  exports.ValidationException = ValidationException;
38
38
  exports.SchemaElement = {
39
+ MANUAL_DISCOUNT_COMPATIBILITY: "MANUAL_DISCOUNT_COMPATIBILITY",
39
40
  RESOURCES: "RESOURCES",
40
41
  SPLIT_COST_ALLOCATION_DATA: "SPLIT_COST_ALLOCATION_DATA",
41
42
  };
@@ -48,6 +49,11 @@ exports.ReportFormat = {
48
49
  CSV: "textORcsv",
49
50
  Parquet: "Parquet",
50
51
  };
52
+ exports.LastStatus = {
53
+ ERROR_NO_BUCKET: "ERROR_NO_BUCKET",
54
+ ERROR_PERMISSIONS: "ERROR_PERMISSIONS",
55
+ SUCCESS: "SUCCESS",
56
+ };
51
57
  exports.ReportVersioning = {
52
58
  CREATE_NEW_REPORT: "CREATE_NEW_REPORT",
53
59
  OVERWRITE_REPORT: "OVERWRITE_REPORT",
@@ -87,6 +93,20 @@ exports.TimeUnit = {
87
93
  HOURLY: "HOURLY",
88
94
  MONTHLY: "MONTHLY",
89
95
  };
96
+ class ResourceNotFoundException extends CostAndUsageReportServiceServiceException_1.CostAndUsageReportServiceServiceException {
97
+ constructor(opts) {
98
+ super({
99
+ name: "ResourceNotFoundException",
100
+ $fault: "client",
101
+ ...opts,
102
+ });
103
+ this.name = "ResourceNotFoundException";
104
+ this.$fault = "client";
105
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
106
+ this.Message = opts.Message;
107
+ }
108
+ }
109
+ exports.ResourceNotFoundException = ResourceNotFoundException;
90
110
  class DuplicateReportNameException extends CostAndUsageReportServiceServiceException_1.CostAndUsageReportServiceServiceException {
91
111
  constructor(opts) {
92
112
  super({
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_PutReportDefinitionCommand = exports.de_ModifyReportDefinitionCommand = exports.de_DescribeReportDefinitionsCommand = exports.de_DeleteReportDefinitionCommand = exports.se_PutReportDefinitionCommand = exports.se_ModifyReportDefinitionCommand = exports.se_DescribeReportDefinitionsCommand = exports.se_DeleteReportDefinitionCommand = void 0;
3
+ exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_PutReportDefinitionCommand = exports.de_ModifyReportDefinitionCommand = exports.de_ListTagsForResourceCommand = exports.de_DescribeReportDefinitionsCommand = exports.de_DeleteReportDefinitionCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_PutReportDefinitionCommand = exports.se_ModifyReportDefinitionCommand = exports.se_ListTagsForResourceCommand = exports.se_DescribeReportDefinitionsCommand = exports.se_DeleteReportDefinitionCommand = void 0;
4
4
  const protocol_http_1 = require("@smithy/protocol-http");
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const CostAndUsageReportServiceServiceException_1 = require("../models/CostAndUsageReportServiceServiceException");
@@ -19,6 +19,13 @@ const se_DescribeReportDefinitionsCommand = async (input, context) => {
19
19
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
20
  };
21
21
  exports.se_DescribeReportDefinitionsCommand = se_DescribeReportDefinitionsCommand;
22
+ const se_ListTagsForResourceCommand = async (input, context) => {
23
+ const headers = sharedHeaders("ListTagsForResource");
24
+ let body;
25
+ body = JSON.stringify((0, smithy_client_1._json)(input));
26
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
+ };
28
+ exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
22
29
  const se_ModifyReportDefinitionCommand = async (input, context) => {
23
30
  const headers = sharedHeaders("ModifyReportDefinition");
24
31
  let body;
@@ -33,6 +40,20 @@ const se_PutReportDefinitionCommand = async (input, context) => {
33
40
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
41
  };
35
42
  exports.se_PutReportDefinitionCommand = se_PutReportDefinitionCommand;
43
+ const se_TagResourceCommand = async (input, context) => {
44
+ const headers = sharedHeaders("TagResource");
45
+ let body;
46
+ body = JSON.stringify((0, smithy_client_1._json)(input));
47
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
48
+ };
49
+ exports.se_TagResourceCommand = se_TagResourceCommand;
50
+ const se_UntagResourceCommand = async (input, context) => {
51
+ const headers = sharedHeaders("UntagResource");
52
+ let body;
53
+ body = JSON.stringify((0, smithy_client_1._json)(input));
54
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
55
+ };
56
+ exports.se_UntagResourceCommand = se_UntagResourceCommand;
36
57
  const de_DeleteReportDefinitionCommand = async (output, context) => {
37
58
  if (output.statusCode >= 300) {
38
59
  return de_DeleteReportDefinitionCommandError(output, context);
@@ -102,6 +123,45 @@ const de_DescribeReportDefinitionsCommandError = async (output, context) => {
102
123
  });
103
124
  }
104
125
  };
126
+ const de_ListTagsForResourceCommand = async (output, context) => {
127
+ if (output.statusCode >= 300) {
128
+ return de_ListTagsForResourceCommandError(output, context);
129
+ }
130
+ const data = await parseBody(output.body, context);
131
+ let contents = {};
132
+ contents = (0, smithy_client_1._json)(data);
133
+ const response = {
134
+ $metadata: deserializeMetadata(output),
135
+ ...contents,
136
+ };
137
+ return response;
138
+ };
139
+ exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
140
+ const de_ListTagsForResourceCommandError = async (output, context) => {
141
+ const parsedOutput = {
142
+ ...output,
143
+ body: await parseErrorBody(output.body, context),
144
+ };
145
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
146
+ switch (errorCode) {
147
+ case "InternalErrorException":
148
+ case "com.amazonaws.costandusagereportservice#InternalErrorException":
149
+ throw await de_InternalErrorExceptionRes(parsedOutput, context);
150
+ case "ResourceNotFoundException":
151
+ case "com.amazonaws.costandusagereportservice#ResourceNotFoundException":
152
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
153
+ case "ValidationException":
154
+ case "com.amazonaws.costandusagereportservice#ValidationException":
155
+ throw await de_ValidationExceptionRes(parsedOutput, context);
156
+ default:
157
+ const parsedBody = parsedOutput.body;
158
+ return throwDefaultError({
159
+ output,
160
+ parsedBody,
161
+ errorCode,
162
+ });
163
+ }
164
+ };
105
165
  const de_ModifyReportDefinitionCommand = async (output, context) => {
106
166
  if (output.statusCode >= 300) {
107
167
  return de_ModifyReportDefinitionCommandError(output, context);
@@ -168,6 +228,87 @@ const de_PutReportDefinitionCommandError = async (output, context) => {
168
228
  case "ReportLimitReachedException":
169
229
  case "com.amazonaws.costandusagereportservice#ReportLimitReachedException":
170
230
  throw await de_ReportLimitReachedExceptionRes(parsedOutput, context);
231
+ case "ResourceNotFoundException":
232
+ case "com.amazonaws.costandusagereportservice#ResourceNotFoundException":
233
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
234
+ case "ValidationException":
235
+ case "com.amazonaws.costandusagereportservice#ValidationException":
236
+ throw await de_ValidationExceptionRes(parsedOutput, context);
237
+ default:
238
+ const parsedBody = parsedOutput.body;
239
+ return throwDefaultError({
240
+ output,
241
+ parsedBody,
242
+ errorCode,
243
+ });
244
+ }
245
+ };
246
+ const de_TagResourceCommand = async (output, context) => {
247
+ if (output.statusCode >= 300) {
248
+ return de_TagResourceCommandError(output, context);
249
+ }
250
+ const data = await parseBody(output.body, context);
251
+ let contents = {};
252
+ contents = (0, smithy_client_1._json)(data);
253
+ const response = {
254
+ $metadata: deserializeMetadata(output),
255
+ ...contents,
256
+ };
257
+ return response;
258
+ };
259
+ exports.de_TagResourceCommand = de_TagResourceCommand;
260
+ const de_TagResourceCommandError = async (output, context) => {
261
+ const parsedOutput = {
262
+ ...output,
263
+ body: await parseErrorBody(output.body, context),
264
+ };
265
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
266
+ switch (errorCode) {
267
+ case "InternalErrorException":
268
+ case "com.amazonaws.costandusagereportservice#InternalErrorException":
269
+ throw await de_InternalErrorExceptionRes(parsedOutput, context);
270
+ case "ResourceNotFoundException":
271
+ case "com.amazonaws.costandusagereportservice#ResourceNotFoundException":
272
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
273
+ case "ValidationException":
274
+ case "com.amazonaws.costandusagereportservice#ValidationException":
275
+ throw await de_ValidationExceptionRes(parsedOutput, context);
276
+ default:
277
+ const parsedBody = parsedOutput.body;
278
+ return throwDefaultError({
279
+ output,
280
+ parsedBody,
281
+ errorCode,
282
+ });
283
+ }
284
+ };
285
+ const de_UntagResourceCommand = async (output, context) => {
286
+ if (output.statusCode >= 300) {
287
+ return de_UntagResourceCommandError(output, context);
288
+ }
289
+ const data = await parseBody(output.body, context);
290
+ let contents = {};
291
+ contents = (0, smithy_client_1._json)(data);
292
+ const response = {
293
+ $metadata: deserializeMetadata(output),
294
+ ...contents,
295
+ };
296
+ return response;
297
+ };
298
+ exports.de_UntagResourceCommand = de_UntagResourceCommand;
299
+ const de_UntagResourceCommandError = async (output, context) => {
300
+ const parsedOutput = {
301
+ ...output,
302
+ body: await parseErrorBody(output.body, context),
303
+ };
304
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
305
+ switch (errorCode) {
306
+ case "InternalErrorException":
307
+ case "com.amazonaws.costandusagereportservice#InternalErrorException":
308
+ throw await de_InternalErrorExceptionRes(parsedOutput, context);
309
+ case "ResourceNotFoundException":
310
+ case "com.amazonaws.costandusagereportservice#ResourceNotFoundException":
311
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
171
312
  case "ValidationException":
172
313
  case "com.amazonaws.costandusagereportservice#ValidationException":
173
314
  throw await de_ValidationExceptionRes(parsedOutput, context);
@@ -207,6 +348,15 @@ const de_ReportLimitReachedExceptionRes = async (parsedOutput, context) => {
207
348
  });
208
349
  return (0, smithy_client_1.decorateServiceException)(exception, body);
209
350
  };
351
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
352
+ const body = parsedOutput.body;
353
+ const deserialized = (0, smithy_client_1._json)(body);
354
+ const exception = new models_0_1.ResourceNotFoundException({
355
+ $metadata: deserializeMetadata(parsedOutput),
356
+ ...deserialized,
357
+ });
358
+ return (0, smithy_client_1.decorateServiceException)(exception, body);
359
+ };
210
360
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
211
361
  const body = parsedOutput.body;
212
362
  const deserialized = (0, smithy_client_1._json)(body);
@@ -1,14 +1,20 @@
1
1
  import { createAggregatedClient } from "@smithy/smithy-client";
2
2
  import { DeleteReportDefinitionCommand, } from "./commands/DeleteReportDefinitionCommand";
3
3
  import { DescribeReportDefinitionsCommand, } from "./commands/DescribeReportDefinitionsCommand";
4
+ import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
4
5
  import { ModifyReportDefinitionCommand, } from "./commands/ModifyReportDefinitionCommand";
5
6
  import { PutReportDefinitionCommand, } from "./commands/PutReportDefinitionCommand";
7
+ import { TagResourceCommand } from "./commands/TagResourceCommand";
8
+ import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
6
9
  import { CostAndUsageReportServiceClient, } from "./CostAndUsageReportServiceClient";
7
10
  const commands = {
8
11
  DeleteReportDefinitionCommand,
9
12
  DescribeReportDefinitionsCommand,
13
+ ListTagsForResourceCommand,
10
14
  ModifyReportDefinitionCommand,
11
15
  PutReportDefinitionCommand,
16
+ TagResourceCommand,
17
+ UntagResourceCommand,
12
18
  };
13
19
  export class CostAndUsageReportService extends CostAndUsageReportServiceClient {
14
20
  }
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_ListTagsForResourceCommand, se_ListTagsForResourceCommand } from "../protocols/Aws_json1_1";
6
+ export { $Command };
7
+ export class ListTagsForResourceCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, ListTagsForResourceCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "CostAndUsageReportServiceClient";
26
+ const commandName = "ListTagsForResourceCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "AWSOrigamiServiceGatewayService",
35
+ operation: "ListTagsForResource",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_ListTagsForResourceCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_ListTagsForResourceCommand(output, context);
46
+ }
47
+ }