@aws-sdk/client-resource-groups-tagging-api 3.35.0 → 3.36.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 (126) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist-cjs/ResourceGroupsTaggingAPI.js +0 -1
  3. package/dist-cjs/ResourceGroupsTaggingAPIClient.js +0 -1
  4. package/dist-cjs/commands/DescribeReportCreationCommand.js +0 -1
  5. package/dist-cjs/commands/GetComplianceSummaryCommand.js +0 -1
  6. package/dist-cjs/commands/GetResourcesCommand.js +0 -1
  7. package/dist-cjs/commands/GetTagKeysCommand.js +0 -1
  8. package/dist-cjs/commands/GetTagValuesCommand.js +0 -1
  9. package/dist-cjs/commands/StartReportCreationCommand.js +0 -1
  10. package/dist-cjs/commands/TagResourcesCommand.js +0 -1
  11. package/dist-cjs/commands/UntagResourcesCommand.js +0 -1
  12. package/dist-cjs/endpoints.js +0 -1
  13. package/dist-cjs/index.js +0 -1
  14. package/dist-cjs/models/index.js +0 -1
  15. package/dist-cjs/models/models_0.js +0 -1
  16. package/dist-cjs/pagination/GetComplianceSummaryPaginator.js +0 -1
  17. package/dist-cjs/pagination/GetResourcesPaginator.js +0 -1
  18. package/dist-cjs/pagination/GetTagKeysPaginator.js +0 -1
  19. package/dist-cjs/pagination/GetTagValuesPaginator.js +0 -1
  20. package/dist-cjs/pagination/Interfaces.js +0 -1
  21. package/dist-cjs/protocols/Aws_json1_1.js +0 -1
  22. package/dist-cjs/runtimeConfig.browser.js +2 -3
  23. package/dist-cjs/runtimeConfig.js +3 -4
  24. package/dist-cjs/runtimeConfig.native.js +0 -1
  25. package/dist-cjs/runtimeConfig.shared.js +0 -1
  26. package/dist-es/ResourceGroupsTaggingAPI.js +0 -1
  27. package/dist-es/ResourceGroupsTaggingAPIClient.js +0 -1
  28. package/dist-es/commands/DescribeReportCreationCommand.js +0 -1
  29. package/dist-es/commands/GetComplianceSummaryCommand.js +0 -1
  30. package/dist-es/commands/GetResourcesCommand.js +0 -1
  31. package/dist-es/commands/GetTagKeysCommand.js +0 -1
  32. package/dist-es/commands/GetTagValuesCommand.js +0 -1
  33. package/dist-es/commands/StartReportCreationCommand.js +0 -1
  34. package/dist-es/commands/TagResourcesCommand.js +0 -1
  35. package/dist-es/commands/UntagResourcesCommand.js +0 -1
  36. package/dist-es/endpoints.js +0 -1
  37. package/dist-es/index.js +0 -1
  38. package/dist-es/models/index.js +0 -1
  39. package/dist-es/models/models_0.js +0 -1
  40. package/dist-es/pagination/GetComplianceSummaryPaginator.js +0 -1
  41. package/dist-es/pagination/GetResourcesPaginator.js +0 -1
  42. package/dist-es/pagination/GetTagKeysPaginator.js +0 -1
  43. package/dist-es/pagination/GetTagValuesPaginator.js +0 -1
  44. package/dist-es/pagination/Interfaces.js +0 -1
  45. package/dist-es/protocols/Aws_json1_1.js +0 -1
  46. package/dist-es/runtimeConfig.browser.js +1 -2
  47. package/dist-es/runtimeConfig.js +2 -3
  48. package/dist-es/runtimeConfig.native.js +0 -1
  49. package/dist-es/runtimeConfig.shared.js +0 -1
  50. package/package.json +33 -30
  51. package/dist-cjs/ResourceGroupsTaggingAPI.js.map +0 -1
  52. package/dist-cjs/ResourceGroupsTaggingAPIClient.js.map +0 -1
  53. package/dist-cjs/commands/DescribeReportCreationCommand.js.map +0 -1
  54. package/dist-cjs/commands/GetComplianceSummaryCommand.js.map +0 -1
  55. package/dist-cjs/commands/GetResourcesCommand.js.map +0 -1
  56. package/dist-cjs/commands/GetTagKeysCommand.js.map +0 -1
  57. package/dist-cjs/commands/GetTagValuesCommand.js.map +0 -1
  58. package/dist-cjs/commands/StartReportCreationCommand.js.map +0 -1
  59. package/dist-cjs/commands/TagResourcesCommand.js.map +0 -1
  60. package/dist-cjs/commands/UntagResourcesCommand.js.map +0 -1
  61. package/dist-cjs/endpoints.js.map +0 -1
  62. package/dist-cjs/index.js.map +0 -1
  63. package/dist-cjs/models/index.js.map +0 -1
  64. package/dist-cjs/models/models_0.js.map +0 -1
  65. package/dist-cjs/pagination/GetComplianceSummaryPaginator.js.map +0 -1
  66. package/dist-cjs/pagination/GetResourcesPaginator.js.map +0 -1
  67. package/dist-cjs/pagination/GetTagKeysPaginator.js.map +0 -1
  68. package/dist-cjs/pagination/GetTagValuesPaginator.js.map +0 -1
  69. package/dist-cjs/pagination/Interfaces.js.map +0 -1
  70. package/dist-cjs/protocols/Aws_json1_1.js.map +0 -1
  71. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  72. package/dist-cjs/runtimeConfig.js.map +0 -1
  73. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  74. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  75. package/dist-es/ResourceGroupsTaggingAPI.js.map +0 -1
  76. package/dist-es/ResourceGroupsTaggingAPIClient.js.map +0 -1
  77. package/dist-es/commands/DescribeReportCreationCommand.js.map +0 -1
  78. package/dist-es/commands/GetComplianceSummaryCommand.js.map +0 -1
  79. package/dist-es/commands/GetResourcesCommand.js.map +0 -1
  80. package/dist-es/commands/GetTagKeysCommand.js.map +0 -1
  81. package/dist-es/commands/GetTagValuesCommand.js.map +0 -1
  82. package/dist-es/commands/StartReportCreationCommand.js.map +0 -1
  83. package/dist-es/commands/TagResourcesCommand.js.map +0 -1
  84. package/dist-es/commands/UntagResourcesCommand.js.map +0 -1
  85. package/dist-es/endpoints.js.map +0 -1
  86. package/dist-es/index.js.map +0 -1
  87. package/dist-es/models/index.js.map +0 -1
  88. package/dist-es/models/models_0.js.map +0 -1
  89. package/dist-es/pagination/GetComplianceSummaryPaginator.js.map +0 -1
  90. package/dist-es/pagination/GetResourcesPaginator.js.map +0 -1
  91. package/dist-es/pagination/GetTagKeysPaginator.js.map +0 -1
  92. package/dist-es/pagination/GetTagValuesPaginator.js.map +0 -1
  93. package/dist-es/pagination/Interfaces.js.map +0 -1
  94. package/dist-es/protocols/Aws_json1_1.js.map +0 -1
  95. package/dist-es/runtimeConfig.browser.js.map +0 -1
  96. package/dist-es/runtimeConfig.js.map +0 -1
  97. package/dist-es/runtimeConfig.native.js.map +0 -1
  98. package/dist-es/runtimeConfig.shared.js.map +0 -1
  99. package/jest.config.js +0 -4
  100. package/src/ResourceGroupsTaggingAPI.ts +0 -386
  101. package/src/ResourceGroupsTaggingAPIClient.ts +0 -270
  102. package/src/commands/DescribeReportCreationCommand.ts +0 -101
  103. package/src/commands/GetComplianceSummaryCommand.ts +0 -111
  104. package/src/commands/GetResourcesCommand.ts +0 -122
  105. package/src/commands/GetTagKeysCommand.ts +0 -106
  106. package/src/commands/GetTagValuesCommand.ts +0 -106
  107. package/src/commands/StartReportCreationCommand.ts +0 -107
  108. package/src/commands/TagResourcesCommand.ts +0 -126
  109. package/src/commands/UntagResourcesCommand.ts +0 -114
  110. package/src/endpoints.ts +0 -57
  111. package/src/index.ts +0 -16
  112. package/src/models/index.ts +0 -1
  113. package/src/models/models_0.ts +0 -947
  114. package/src/pagination/GetComplianceSummaryPaginator.ts +0 -59
  115. package/src/pagination/GetResourcesPaginator.ts +0 -59
  116. package/src/pagination/GetTagKeysPaginator.ts +0 -54
  117. package/src/pagination/GetTagValuesPaginator.ts +0 -58
  118. package/src/pagination/Interfaces.ts +0 -8
  119. package/src/protocols/Aws_json1_1.ts +0 -1449
  120. package/src/runtimeConfig.browser.ts +0 -41
  121. package/src/runtimeConfig.native.ts +0 -17
  122. package/src/runtimeConfig.shared.ts +0 -17
  123. package/src/runtimeConfig.ts +0 -46
  124. package/tsconfig.es.json +0 -10
  125. package/tsconfig.json +0 -33
  126. package/tsconfig.types.json +0 -9
@@ -1,1449 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import {
3
- expectBoolean as __expectBoolean,
4
- expectInt32 as __expectInt32,
5
- expectLong as __expectLong,
6
- expectString as __expectString,
7
- } from "@aws-sdk/smithy-client";
8
- import {
9
- Endpoint as __Endpoint,
10
- HeaderBag as __HeaderBag,
11
- MetadataBearer as __MetadataBearer,
12
- ResponseMetadata as __ResponseMetadata,
13
- SerdeContext as __SerdeContext,
14
- SmithyException as __SmithyException,
15
- } from "@aws-sdk/types";
16
-
17
- import {
18
- DescribeReportCreationCommandInput,
19
- DescribeReportCreationCommandOutput,
20
- } from "../commands/DescribeReportCreationCommand";
21
- import {
22
- GetComplianceSummaryCommandInput,
23
- GetComplianceSummaryCommandOutput,
24
- } from "../commands/GetComplianceSummaryCommand";
25
- import { GetResourcesCommandInput, GetResourcesCommandOutput } from "../commands/GetResourcesCommand";
26
- import { GetTagKeysCommandInput, GetTagKeysCommandOutput } from "../commands/GetTagKeysCommand";
27
- import { GetTagValuesCommandInput, GetTagValuesCommandOutput } from "../commands/GetTagValuesCommand";
28
- import {
29
- StartReportCreationCommandInput,
30
- StartReportCreationCommandOutput,
31
- } from "../commands/StartReportCreationCommand";
32
- import { TagResourcesCommandInput, TagResourcesCommandOutput } from "../commands/TagResourcesCommand";
33
- import { UntagResourcesCommandInput, UntagResourcesCommandOutput } from "../commands/UntagResourcesCommand";
34
- import {
35
- ComplianceDetails,
36
- ConcurrentModificationException,
37
- ConstraintViolationException,
38
- DescribeReportCreationInput,
39
- DescribeReportCreationOutput,
40
- FailureInfo,
41
- GetComplianceSummaryInput,
42
- GetComplianceSummaryOutput,
43
- GetResourcesInput,
44
- GetResourcesOutput,
45
- GetTagKeysInput,
46
- GetTagKeysOutput,
47
- GetTagValuesInput,
48
- GetTagValuesOutput,
49
- GroupByAttribute,
50
- InternalServiceException,
51
- InvalidParameterException,
52
- PaginationTokenExpiredException,
53
- ResourceTagMapping,
54
- StartReportCreationInput,
55
- StartReportCreationOutput,
56
- Summary,
57
- Tag,
58
- TagFilter,
59
- TagResourcesInput,
60
- TagResourcesOutput,
61
- ThrottledException,
62
- UntagResourcesInput,
63
- UntagResourcesOutput,
64
- } from "../models/models_0";
65
-
66
- export const serializeAws_json1_1DescribeReportCreationCommand = async (
67
- input: DescribeReportCreationCommandInput,
68
- context: __SerdeContext
69
- ): Promise<__HttpRequest> => {
70
- const headers: __HeaderBag = {
71
- "content-type": "application/x-amz-json-1.1",
72
- "x-amz-target": "ResourceGroupsTaggingAPI_20170126.DescribeReportCreation",
73
- };
74
- let body: any;
75
- body = JSON.stringify(serializeAws_json1_1DescribeReportCreationInput(input, context));
76
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
- };
78
-
79
- export const serializeAws_json1_1GetComplianceSummaryCommand = async (
80
- input: GetComplianceSummaryCommandInput,
81
- context: __SerdeContext
82
- ): Promise<__HttpRequest> => {
83
- const headers: __HeaderBag = {
84
- "content-type": "application/x-amz-json-1.1",
85
- "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetComplianceSummary",
86
- };
87
- let body: any;
88
- body = JSON.stringify(serializeAws_json1_1GetComplianceSummaryInput(input, context));
89
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
90
- };
91
-
92
- export const serializeAws_json1_1GetResourcesCommand = async (
93
- input: GetResourcesCommandInput,
94
- context: __SerdeContext
95
- ): Promise<__HttpRequest> => {
96
- const headers: __HeaderBag = {
97
- "content-type": "application/x-amz-json-1.1",
98
- "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetResources",
99
- };
100
- let body: any;
101
- body = JSON.stringify(serializeAws_json1_1GetResourcesInput(input, context));
102
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
103
- };
104
-
105
- export const serializeAws_json1_1GetTagKeysCommand = async (
106
- input: GetTagKeysCommandInput,
107
- context: __SerdeContext
108
- ): Promise<__HttpRequest> => {
109
- const headers: __HeaderBag = {
110
- "content-type": "application/x-amz-json-1.1",
111
- "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetTagKeys",
112
- };
113
- let body: any;
114
- body = JSON.stringify(serializeAws_json1_1GetTagKeysInput(input, context));
115
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
116
- };
117
-
118
- export const serializeAws_json1_1GetTagValuesCommand = async (
119
- input: GetTagValuesCommandInput,
120
- context: __SerdeContext
121
- ): Promise<__HttpRequest> => {
122
- const headers: __HeaderBag = {
123
- "content-type": "application/x-amz-json-1.1",
124
- "x-amz-target": "ResourceGroupsTaggingAPI_20170126.GetTagValues",
125
- };
126
- let body: any;
127
- body = JSON.stringify(serializeAws_json1_1GetTagValuesInput(input, context));
128
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
129
- };
130
-
131
- export const serializeAws_json1_1StartReportCreationCommand = async (
132
- input: StartReportCreationCommandInput,
133
- context: __SerdeContext
134
- ): Promise<__HttpRequest> => {
135
- const headers: __HeaderBag = {
136
- "content-type": "application/x-amz-json-1.1",
137
- "x-amz-target": "ResourceGroupsTaggingAPI_20170126.StartReportCreation",
138
- };
139
- let body: any;
140
- body = JSON.stringify(serializeAws_json1_1StartReportCreationInput(input, context));
141
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
142
- };
143
-
144
- export const serializeAws_json1_1TagResourcesCommand = async (
145
- input: TagResourcesCommandInput,
146
- context: __SerdeContext
147
- ): Promise<__HttpRequest> => {
148
- const headers: __HeaderBag = {
149
- "content-type": "application/x-amz-json-1.1",
150
- "x-amz-target": "ResourceGroupsTaggingAPI_20170126.TagResources",
151
- };
152
- let body: any;
153
- body = JSON.stringify(serializeAws_json1_1TagResourcesInput(input, context));
154
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
155
- };
156
-
157
- export const serializeAws_json1_1UntagResourcesCommand = async (
158
- input: UntagResourcesCommandInput,
159
- context: __SerdeContext
160
- ): Promise<__HttpRequest> => {
161
- const headers: __HeaderBag = {
162
- "content-type": "application/x-amz-json-1.1",
163
- "x-amz-target": "ResourceGroupsTaggingAPI_20170126.UntagResources",
164
- };
165
- let body: any;
166
- body = JSON.stringify(serializeAws_json1_1UntagResourcesInput(input, context));
167
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
168
- };
169
-
170
- export const deserializeAws_json1_1DescribeReportCreationCommand = async (
171
- output: __HttpResponse,
172
- context: __SerdeContext
173
- ): Promise<DescribeReportCreationCommandOutput> => {
174
- if (output.statusCode >= 300) {
175
- return deserializeAws_json1_1DescribeReportCreationCommandError(output, context);
176
- }
177
- const data: any = await parseBody(output.body, context);
178
- let contents: any = {};
179
- contents = deserializeAws_json1_1DescribeReportCreationOutput(data, context);
180
- const response: DescribeReportCreationCommandOutput = {
181
- $metadata: deserializeMetadata(output),
182
- ...contents,
183
- };
184
- return Promise.resolve(response);
185
- };
186
-
187
- const deserializeAws_json1_1DescribeReportCreationCommandError = async (
188
- output: __HttpResponse,
189
- context: __SerdeContext
190
- ): Promise<DescribeReportCreationCommandOutput> => {
191
- const parsedOutput: any = {
192
- ...output,
193
- body: await parseBody(output.body, context),
194
- };
195
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
196
- let errorCode = "UnknownError";
197
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
198
- switch (errorCode) {
199
- case "ConstraintViolationException":
200
- case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException":
201
- response = {
202
- ...(await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context)),
203
- name: errorCode,
204
- $metadata: deserializeMetadata(output),
205
- };
206
- break;
207
- case "InternalServiceException":
208
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
209
- response = {
210
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
211
- name: errorCode,
212
- $metadata: deserializeMetadata(output),
213
- };
214
- break;
215
- case "InvalidParameterException":
216
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
217
- response = {
218
- ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
219
- name: errorCode,
220
- $metadata: deserializeMetadata(output),
221
- };
222
- break;
223
- case "ThrottledException":
224
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
225
- response = {
226
- ...(await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)),
227
- name: errorCode,
228
- $metadata: deserializeMetadata(output),
229
- };
230
- break;
231
- default:
232
- const parsedBody = parsedOutput.body;
233
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
234
- response = {
235
- ...parsedBody,
236
- name: `${errorCode}`,
237
- message: parsedBody.message || parsedBody.Message || errorCode,
238
- $fault: "client",
239
- $metadata: deserializeMetadata(output),
240
- } as any;
241
- }
242
- const message = response.message || response.Message || errorCode;
243
- response.message = message;
244
- delete response.Message;
245
- return Promise.reject(Object.assign(new Error(message), response));
246
- };
247
-
248
- export const deserializeAws_json1_1GetComplianceSummaryCommand = async (
249
- output: __HttpResponse,
250
- context: __SerdeContext
251
- ): Promise<GetComplianceSummaryCommandOutput> => {
252
- if (output.statusCode >= 300) {
253
- return deserializeAws_json1_1GetComplianceSummaryCommandError(output, context);
254
- }
255
- const data: any = await parseBody(output.body, context);
256
- let contents: any = {};
257
- contents = deserializeAws_json1_1GetComplianceSummaryOutput(data, context);
258
- const response: GetComplianceSummaryCommandOutput = {
259
- $metadata: deserializeMetadata(output),
260
- ...contents,
261
- };
262
- return Promise.resolve(response);
263
- };
264
-
265
- const deserializeAws_json1_1GetComplianceSummaryCommandError = async (
266
- output: __HttpResponse,
267
- context: __SerdeContext
268
- ): Promise<GetComplianceSummaryCommandOutput> => {
269
- const parsedOutput: any = {
270
- ...output,
271
- body: await parseBody(output.body, context),
272
- };
273
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
274
- let errorCode = "UnknownError";
275
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
276
- switch (errorCode) {
277
- case "ConstraintViolationException":
278
- case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException":
279
- response = {
280
- ...(await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context)),
281
- name: errorCode,
282
- $metadata: deserializeMetadata(output),
283
- };
284
- break;
285
- case "InternalServiceException":
286
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
287
- response = {
288
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
289
- name: errorCode,
290
- $metadata: deserializeMetadata(output),
291
- };
292
- break;
293
- case "InvalidParameterException":
294
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
295
- response = {
296
- ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
297
- name: errorCode,
298
- $metadata: deserializeMetadata(output),
299
- };
300
- break;
301
- case "ThrottledException":
302
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
303
- response = {
304
- ...(await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)),
305
- name: errorCode,
306
- $metadata: deserializeMetadata(output),
307
- };
308
- break;
309
- default:
310
- const parsedBody = parsedOutput.body;
311
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
312
- response = {
313
- ...parsedBody,
314
- name: `${errorCode}`,
315
- message: parsedBody.message || parsedBody.Message || errorCode,
316
- $fault: "client",
317
- $metadata: deserializeMetadata(output),
318
- } as any;
319
- }
320
- const message = response.message || response.Message || errorCode;
321
- response.message = message;
322
- delete response.Message;
323
- return Promise.reject(Object.assign(new Error(message), response));
324
- };
325
-
326
- export const deserializeAws_json1_1GetResourcesCommand = async (
327
- output: __HttpResponse,
328
- context: __SerdeContext
329
- ): Promise<GetResourcesCommandOutput> => {
330
- if (output.statusCode >= 300) {
331
- return deserializeAws_json1_1GetResourcesCommandError(output, context);
332
- }
333
- const data: any = await parseBody(output.body, context);
334
- let contents: any = {};
335
- contents = deserializeAws_json1_1GetResourcesOutput(data, context);
336
- const response: GetResourcesCommandOutput = {
337
- $metadata: deserializeMetadata(output),
338
- ...contents,
339
- };
340
- return Promise.resolve(response);
341
- };
342
-
343
- const deserializeAws_json1_1GetResourcesCommandError = async (
344
- output: __HttpResponse,
345
- context: __SerdeContext
346
- ): Promise<GetResourcesCommandOutput> => {
347
- const parsedOutput: any = {
348
- ...output,
349
- body: await parseBody(output.body, context),
350
- };
351
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
352
- let errorCode = "UnknownError";
353
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
354
- switch (errorCode) {
355
- case "InternalServiceException":
356
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
357
- response = {
358
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
359
- name: errorCode,
360
- $metadata: deserializeMetadata(output),
361
- };
362
- break;
363
- case "InvalidParameterException":
364
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
365
- response = {
366
- ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
367
- name: errorCode,
368
- $metadata: deserializeMetadata(output),
369
- };
370
- break;
371
- case "PaginationTokenExpiredException":
372
- case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException":
373
- response = {
374
- ...(await deserializeAws_json1_1PaginationTokenExpiredExceptionResponse(parsedOutput, context)),
375
- name: errorCode,
376
- $metadata: deserializeMetadata(output),
377
- };
378
- break;
379
- case "ThrottledException":
380
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
381
- response = {
382
- ...(await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)),
383
- name: errorCode,
384
- $metadata: deserializeMetadata(output),
385
- };
386
- break;
387
- default:
388
- const parsedBody = parsedOutput.body;
389
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
390
- response = {
391
- ...parsedBody,
392
- name: `${errorCode}`,
393
- message: parsedBody.message || parsedBody.Message || errorCode,
394
- $fault: "client",
395
- $metadata: deserializeMetadata(output),
396
- } as any;
397
- }
398
- const message = response.message || response.Message || errorCode;
399
- response.message = message;
400
- delete response.Message;
401
- return Promise.reject(Object.assign(new Error(message), response));
402
- };
403
-
404
- export const deserializeAws_json1_1GetTagKeysCommand = async (
405
- output: __HttpResponse,
406
- context: __SerdeContext
407
- ): Promise<GetTagKeysCommandOutput> => {
408
- if (output.statusCode >= 300) {
409
- return deserializeAws_json1_1GetTagKeysCommandError(output, context);
410
- }
411
- const data: any = await parseBody(output.body, context);
412
- let contents: any = {};
413
- contents = deserializeAws_json1_1GetTagKeysOutput(data, context);
414
- const response: GetTagKeysCommandOutput = {
415
- $metadata: deserializeMetadata(output),
416
- ...contents,
417
- };
418
- return Promise.resolve(response);
419
- };
420
-
421
- const deserializeAws_json1_1GetTagKeysCommandError = async (
422
- output: __HttpResponse,
423
- context: __SerdeContext
424
- ): Promise<GetTagKeysCommandOutput> => {
425
- const parsedOutput: any = {
426
- ...output,
427
- body: await parseBody(output.body, context),
428
- };
429
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
430
- let errorCode = "UnknownError";
431
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
432
- switch (errorCode) {
433
- case "InternalServiceException":
434
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
435
- response = {
436
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
437
- name: errorCode,
438
- $metadata: deserializeMetadata(output),
439
- };
440
- break;
441
- case "InvalidParameterException":
442
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
443
- response = {
444
- ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
445
- name: errorCode,
446
- $metadata: deserializeMetadata(output),
447
- };
448
- break;
449
- case "PaginationTokenExpiredException":
450
- case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException":
451
- response = {
452
- ...(await deserializeAws_json1_1PaginationTokenExpiredExceptionResponse(parsedOutput, context)),
453
- name: errorCode,
454
- $metadata: deserializeMetadata(output),
455
- };
456
- break;
457
- case "ThrottledException":
458
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
459
- response = {
460
- ...(await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)),
461
- name: errorCode,
462
- $metadata: deserializeMetadata(output),
463
- };
464
- break;
465
- default:
466
- const parsedBody = parsedOutput.body;
467
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
468
- response = {
469
- ...parsedBody,
470
- name: `${errorCode}`,
471
- message: parsedBody.message || parsedBody.Message || errorCode,
472
- $fault: "client",
473
- $metadata: deserializeMetadata(output),
474
- } as any;
475
- }
476
- const message = response.message || response.Message || errorCode;
477
- response.message = message;
478
- delete response.Message;
479
- return Promise.reject(Object.assign(new Error(message), response));
480
- };
481
-
482
- export const deserializeAws_json1_1GetTagValuesCommand = async (
483
- output: __HttpResponse,
484
- context: __SerdeContext
485
- ): Promise<GetTagValuesCommandOutput> => {
486
- if (output.statusCode >= 300) {
487
- return deserializeAws_json1_1GetTagValuesCommandError(output, context);
488
- }
489
- const data: any = await parseBody(output.body, context);
490
- let contents: any = {};
491
- contents = deserializeAws_json1_1GetTagValuesOutput(data, context);
492
- const response: GetTagValuesCommandOutput = {
493
- $metadata: deserializeMetadata(output),
494
- ...contents,
495
- };
496
- return Promise.resolve(response);
497
- };
498
-
499
- const deserializeAws_json1_1GetTagValuesCommandError = async (
500
- output: __HttpResponse,
501
- context: __SerdeContext
502
- ): Promise<GetTagValuesCommandOutput> => {
503
- const parsedOutput: any = {
504
- ...output,
505
- body: await parseBody(output.body, context),
506
- };
507
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
508
- let errorCode = "UnknownError";
509
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
510
- switch (errorCode) {
511
- case "InternalServiceException":
512
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
513
- response = {
514
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
515
- name: errorCode,
516
- $metadata: deserializeMetadata(output),
517
- };
518
- break;
519
- case "InvalidParameterException":
520
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
521
- response = {
522
- ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
523
- name: errorCode,
524
- $metadata: deserializeMetadata(output),
525
- };
526
- break;
527
- case "PaginationTokenExpiredException":
528
- case "com.amazonaws.resourcegroupstaggingapi#PaginationTokenExpiredException":
529
- response = {
530
- ...(await deserializeAws_json1_1PaginationTokenExpiredExceptionResponse(parsedOutput, context)),
531
- name: errorCode,
532
- $metadata: deserializeMetadata(output),
533
- };
534
- break;
535
- case "ThrottledException":
536
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
537
- response = {
538
- ...(await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)),
539
- name: errorCode,
540
- $metadata: deserializeMetadata(output),
541
- };
542
- break;
543
- default:
544
- const parsedBody = parsedOutput.body;
545
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
546
- response = {
547
- ...parsedBody,
548
- name: `${errorCode}`,
549
- message: parsedBody.message || parsedBody.Message || errorCode,
550
- $fault: "client",
551
- $metadata: deserializeMetadata(output),
552
- } as any;
553
- }
554
- const message = response.message || response.Message || errorCode;
555
- response.message = message;
556
- delete response.Message;
557
- return Promise.reject(Object.assign(new Error(message), response));
558
- };
559
-
560
- export const deserializeAws_json1_1StartReportCreationCommand = async (
561
- output: __HttpResponse,
562
- context: __SerdeContext
563
- ): Promise<StartReportCreationCommandOutput> => {
564
- if (output.statusCode >= 300) {
565
- return deserializeAws_json1_1StartReportCreationCommandError(output, context);
566
- }
567
- const data: any = await parseBody(output.body, context);
568
- let contents: any = {};
569
- contents = deserializeAws_json1_1StartReportCreationOutput(data, context);
570
- const response: StartReportCreationCommandOutput = {
571
- $metadata: deserializeMetadata(output),
572
- ...contents,
573
- };
574
- return Promise.resolve(response);
575
- };
576
-
577
- const deserializeAws_json1_1StartReportCreationCommandError = async (
578
- output: __HttpResponse,
579
- context: __SerdeContext
580
- ): Promise<StartReportCreationCommandOutput> => {
581
- const parsedOutput: any = {
582
- ...output,
583
- body: await parseBody(output.body, context),
584
- };
585
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
586
- let errorCode = "UnknownError";
587
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
588
- switch (errorCode) {
589
- case "ConcurrentModificationException":
590
- case "com.amazonaws.resourcegroupstaggingapi#ConcurrentModificationException":
591
- response = {
592
- ...(await deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)),
593
- name: errorCode,
594
- $metadata: deserializeMetadata(output),
595
- };
596
- break;
597
- case "ConstraintViolationException":
598
- case "com.amazonaws.resourcegroupstaggingapi#ConstraintViolationException":
599
- response = {
600
- ...(await deserializeAws_json1_1ConstraintViolationExceptionResponse(parsedOutput, context)),
601
- name: errorCode,
602
- $metadata: deserializeMetadata(output),
603
- };
604
- break;
605
- case "InternalServiceException":
606
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
607
- response = {
608
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
609
- name: errorCode,
610
- $metadata: deserializeMetadata(output),
611
- };
612
- break;
613
- case "InvalidParameterException":
614
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
615
- response = {
616
- ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
617
- name: errorCode,
618
- $metadata: deserializeMetadata(output),
619
- };
620
- break;
621
- case "ThrottledException":
622
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
623
- response = {
624
- ...(await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)),
625
- name: errorCode,
626
- $metadata: deserializeMetadata(output),
627
- };
628
- break;
629
- default:
630
- const parsedBody = parsedOutput.body;
631
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
632
- response = {
633
- ...parsedBody,
634
- name: `${errorCode}`,
635
- message: parsedBody.message || parsedBody.Message || errorCode,
636
- $fault: "client",
637
- $metadata: deserializeMetadata(output),
638
- } as any;
639
- }
640
- const message = response.message || response.Message || errorCode;
641
- response.message = message;
642
- delete response.Message;
643
- return Promise.reject(Object.assign(new Error(message), response));
644
- };
645
-
646
- export const deserializeAws_json1_1TagResourcesCommand = async (
647
- output: __HttpResponse,
648
- context: __SerdeContext
649
- ): Promise<TagResourcesCommandOutput> => {
650
- if (output.statusCode >= 300) {
651
- return deserializeAws_json1_1TagResourcesCommandError(output, context);
652
- }
653
- const data: any = await parseBody(output.body, context);
654
- let contents: any = {};
655
- contents = deserializeAws_json1_1TagResourcesOutput(data, context);
656
- const response: TagResourcesCommandOutput = {
657
- $metadata: deserializeMetadata(output),
658
- ...contents,
659
- };
660
- return Promise.resolve(response);
661
- };
662
-
663
- const deserializeAws_json1_1TagResourcesCommandError = async (
664
- output: __HttpResponse,
665
- context: __SerdeContext
666
- ): Promise<TagResourcesCommandOutput> => {
667
- const parsedOutput: any = {
668
- ...output,
669
- body: await parseBody(output.body, context),
670
- };
671
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
672
- let errorCode = "UnknownError";
673
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
674
- switch (errorCode) {
675
- case "InternalServiceException":
676
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
677
- response = {
678
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
679
- name: errorCode,
680
- $metadata: deserializeMetadata(output),
681
- };
682
- break;
683
- case "InvalidParameterException":
684
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
685
- response = {
686
- ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
687
- name: errorCode,
688
- $metadata: deserializeMetadata(output),
689
- };
690
- break;
691
- case "ThrottledException":
692
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
693
- response = {
694
- ...(await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)),
695
- name: errorCode,
696
- $metadata: deserializeMetadata(output),
697
- };
698
- break;
699
- default:
700
- const parsedBody = parsedOutput.body;
701
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
702
- response = {
703
- ...parsedBody,
704
- name: `${errorCode}`,
705
- message: parsedBody.message || parsedBody.Message || errorCode,
706
- $fault: "client",
707
- $metadata: deserializeMetadata(output),
708
- } as any;
709
- }
710
- const message = response.message || response.Message || errorCode;
711
- response.message = message;
712
- delete response.Message;
713
- return Promise.reject(Object.assign(new Error(message), response));
714
- };
715
-
716
- export const deserializeAws_json1_1UntagResourcesCommand = async (
717
- output: __HttpResponse,
718
- context: __SerdeContext
719
- ): Promise<UntagResourcesCommandOutput> => {
720
- if (output.statusCode >= 300) {
721
- return deserializeAws_json1_1UntagResourcesCommandError(output, context);
722
- }
723
- const data: any = await parseBody(output.body, context);
724
- let contents: any = {};
725
- contents = deserializeAws_json1_1UntagResourcesOutput(data, context);
726
- const response: UntagResourcesCommandOutput = {
727
- $metadata: deserializeMetadata(output),
728
- ...contents,
729
- };
730
- return Promise.resolve(response);
731
- };
732
-
733
- const deserializeAws_json1_1UntagResourcesCommandError = async (
734
- output: __HttpResponse,
735
- context: __SerdeContext
736
- ): Promise<UntagResourcesCommandOutput> => {
737
- const parsedOutput: any = {
738
- ...output,
739
- body: await parseBody(output.body, context),
740
- };
741
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
742
- let errorCode = "UnknownError";
743
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
744
- switch (errorCode) {
745
- case "InternalServiceException":
746
- case "com.amazonaws.resourcegroupstaggingapi#InternalServiceException":
747
- response = {
748
- ...(await deserializeAws_json1_1InternalServiceExceptionResponse(parsedOutput, context)),
749
- name: errorCode,
750
- $metadata: deserializeMetadata(output),
751
- };
752
- break;
753
- case "InvalidParameterException":
754
- case "com.amazonaws.resourcegroupstaggingapi#InvalidParameterException":
755
- response = {
756
- ...(await deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)),
757
- name: errorCode,
758
- $metadata: deserializeMetadata(output),
759
- };
760
- break;
761
- case "ThrottledException":
762
- case "com.amazonaws.resourcegroupstaggingapi#ThrottledException":
763
- response = {
764
- ...(await deserializeAws_json1_1ThrottledExceptionResponse(parsedOutput, context)),
765
- name: errorCode,
766
- $metadata: deserializeMetadata(output),
767
- };
768
- break;
769
- default:
770
- const parsedBody = parsedOutput.body;
771
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
772
- response = {
773
- ...parsedBody,
774
- name: `${errorCode}`,
775
- message: parsedBody.message || parsedBody.Message || errorCode,
776
- $fault: "client",
777
- $metadata: deserializeMetadata(output),
778
- } as any;
779
- }
780
- const message = response.message || response.Message || errorCode;
781
- response.message = message;
782
- delete response.Message;
783
- return Promise.reject(Object.assign(new Error(message), response));
784
- };
785
-
786
- const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async (
787
- parsedOutput: any,
788
- context: __SerdeContext
789
- ): Promise<ConcurrentModificationException> => {
790
- const body = parsedOutput.body;
791
- const deserialized: any = deserializeAws_json1_1ConcurrentModificationException(body, context);
792
- const contents: ConcurrentModificationException = {
793
- name: "ConcurrentModificationException",
794
- $fault: "client",
795
- $metadata: deserializeMetadata(parsedOutput),
796
- ...deserialized,
797
- };
798
- return contents;
799
- };
800
-
801
- const deserializeAws_json1_1ConstraintViolationExceptionResponse = async (
802
- parsedOutput: any,
803
- context: __SerdeContext
804
- ): Promise<ConstraintViolationException> => {
805
- const body = parsedOutput.body;
806
- const deserialized: any = deserializeAws_json1_1ConstraintViolationException(body, context);
807
- const contents: ConstraintViolationException = {
808
- name: "ConstraintViolationException",
809
- $fault: "client",
810
- $metadata: deserializeMetadata(parsedOutput),
811
- ...deserialized,
812
- };
813
- return contents;
814
- };
815
-
816
- const deserializeAws_json1_1InternalServiceExceptionResponse = async (
817
- parsedOutput: any,
818
- context: __SerdeContext
819
- ): Promise<InternalServiceException> => {
820
- const body = parsedOutput.body;
821
- const deserialized: any = deserializeAws_json1_1InternalServiceException(body, context);
822
- const contents: InternalServiceException = {
823
- name: "InternalServiceException",
824
- $fault: "server",
825
- $metadata: deserializeMetadata(parsedOutput),
826
- ...deserialized,
827
- };
828
- return contents;
829
- };
830
-
831
- const deserializeAws_json1_1InvalidParameterExceptionResponse = async (
832
- parsedOutput: any,
833
- context: __SerdeContext
834
- ): Promise<InvalidParameterException> => {
835
- const body = parsedOutput.body;
836
- const deserialized: any = deserializeAws_json1_1InvalidParameterException(body, context);
837
- const contents: InvalidParameterException = {
838
- name: "InvalidParameterException",
839
- $fault: "client",
840
- $metadata: deserializeMetadata(parsedOutput),
841
- ...deserialized,
842
- };
843
- return contents;
844
- };
845
-
846
- const deserializeAws_json1_1PaginationTokenExpiredExceptionResponse = async (
847
- parsedOutput: any,
848
- context: __SerdeContext
849
- ): Promise<PaginationTokenExpiredException> => {
850
- const body = parsedOutput.body;
851
- const deserialized: any = deserializeAws_json1_1PaginationTokenExpiredException(body, context);
852
- const contents: PaginationTokenExpiredException = {
853
- name: "PaginationTokenExpiredException",
854
- $fault: "client",
855
- $metadata: deserializeMetadata(parsedOutput),
856
- ...deserialized,
857
- };
858
- return contents;
859
- };
860
-
861
- const deserializeAws_json1_1ThrottledExceptionResponse = async (
862
- parsedOutput: any,
863
- context: __SerdeContext
864
- ): Promise<ThrottledException> => {
865
- const body = parsedOutput.body;
866
- const deserialized: any = deserializeAws_json1_1ThrottledException(body, context);
867
- const contents: ThrottledException = {
868
- name: "ThrottledException",
869
- $fault: "client",
870
- $metadata: deserializeMetadata(parsedOutput),
871
- ...deserialized,
872
- };
873
- return contents;
874
- };
875
-
876
- const serializeAws_json1_1DescribeReportCreationInput = (
877
- input: DescribeReportCreationInput,
878
- context: __SerdeContext
879
- ): any => {
880
- return {};
881
- };
882
-
883
- const serializeAws_json1_1GetComplianceSummaryInput = (
884
- input: GetComplianceSummaryInput,
885
- context: __SerdeContext
886
- ): any => {
887
- return {
888
- ...(input.GroupBy !== undefined &&
889
- input.GroupBy !== null && { GroupBy: serializeAws_json1_1GroupBy(input.GroupBy, context) }),
890
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
891
- ...(input.PaginationToken !== undefined &&
892
- input.PaginationToken !== null && { PaginationToken: input.PaginationToken }),
893
- ...(input.RegionFilters !== undefined &&
894
- input.RegionFilters !== null && {
895
- RegionFilters: serializeAws_json1_1RegionFilterList(input.RegionFilters, context),
896
- }),
897
- ...(input.ResourceTypeFilters !== undefined &&
898
- input.ResourceTypeFilters !== null && {
899
- ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context),
900
- }),
901
- ...(input.TagKeyFilters !== undefined &&
902
- input.TagKeyFilters !== null && {
903
- TagKeyFilters: serializeAws_json1_1TagKeyFilterList(input.TagKeyFilters, context),
904
- }),
905
- ...(input.TargetIdFilters !== undefined &&
906
- input.TargetIdFilters !== null && {
907
- TargetIdFilters: serializeAws_json1_1TargetIdFilterList(input.TargetIdFilters, context),
908
- }),
909
- };
910
- };
911
-
912
- const serializeAws_json1_1GetResourcesInput = (input: GetResourcesInput, context: __SerdeContext): any => {
913
- return {
914
- ...(input.ExcludeCompliantResources !== undefined &&
915
- input.ExcludeCompliantResources !== null && { ExcludeCompliantResources: input.ExcludeCompliantResources }),
916
- ...(input.IncludeComplianceDetails !== undefined &&
917
- input.IncludeComplianceDetails !== null && { IncludeComplianceDetails: input.IncludeComplianceDetails }),
918
- ...(input.PaginationToken !== undefined &&
919
- input.PaginationToken !== null && { PaginationToken: input.PaginationToken }),
920
- ...(input.ResourceARNList !== undefined &&
921
- input.ResourceARNList !== null && {
922
- ResourceARNList: serializeAws_json1_1ResourceARNListForGet(input.ResourceARNList, context),
923
- }),
924
- ...(input.ResourceTypeFilters !== undefined &&
925
- input.ResourceTypeFilters !== null && {
926
- ResourceTypeFilters: serializeAws_json1_1ResourceTypeFilterList(input.ResourceTypeFilters, context),
927
- }),
928
- ...(input.ResourcesPerPage !== undefined &&
929
- input.ResourcesPerPage !== null && { ResourcesPerPage: input.ResourcesPerPage }),
930
- ...(input.TagFilters !== undefined &&
931
- input.TagFilters !== null && { TagFilters: serializeAws_json1_1TagFilterList(input.TagFilters, context) }),
932
- ...(input.TagsPerPage !== undefined && input.TagsPerPage !== null && { TagsPerPage: input.TagsPerPage }),
933
- };
934
- };
935
-
936
- const serializeAws_json1_1GetTagKeysInput = (input: GetTagKeysInput, context: __SerdeContext): any => {
937
- return {
938
- ...(input.PaginationToken !== undefined &&
939
- input.PaginationToken !== null && { PaginationToken: input.PaginationToken }),
940
- };
941
- };
942
-
943
- const serializeAws_json1_1GetTagValuesInput = (input: GetTagValuesInput, context: __SerdeContext): any => {
944
- return {
945
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
946
- ...(input.PaginationToken !== undefined &&
947
- input.PaginationToken !== null && { PaginationToken: input.PaginationToken }),
948
- };
949
- };
950
-
951
- const serializeAws_json1_1GroupBy = (input: (GroupByAttribute | string)[], context: __SerdeContext): any => {
952
- return input
953
- .filter((e: any) => e != null)
954
- .map((entry) => {
955
- if (entry === null) {
956
- return null as any;
957
- }
958
- return entry;
959
- });
960
- };
961
-
962
- const serializeAws_json1_1RegionFilterList = (input: string[], context: __SerdeContext): any => {
963
- return input
964
- .filter((e: any) => e != null)
965
- .map((entry) => {
966
- if (entry === null) {
967
- return null as any;
968
- }
969
- return entry;
970
- });
971
- };
972
-
973
- const serializeAws_json1_1ResourceARNListForGet = (input: string[], context: __SerdeContext): any => {
974
- return input
975
- .filter((e: any) => e != null)
976
- .map((entry) => {
977
- if (entry === null) {
978
- return null as any;
979
- }
980
- return entry;
981
- });
982
- };
983
-
984
- const serializeAws_json1_1ResourceARNListForTagUntag = (input: string[], context: __SerdeContext): any => {
985
- return input
986
- .filter((e: any) => e != null)
987
- .map((entry) => {
988
- if (entry === null) {
989
- return null as any;
990
- }
991
- return entry;
992
- });
993
- };
994
-
995
- const serializeAws_json1_1ResourceTypeFilterList = (input: string[], context: __SerdeContext): any => {
996
- return input
997
- .filter((e: any) => e != null)
998
- .map((entry) => {
999
- if (entry === null) {
1000
- return null as any;
1001
- }
1002
- return entry;
1003
- });
1004
- };
1005
-
1006
- const serializeAws_json1_1StartReportCreationInput = (
1007
- input: StartReportCreationInput,
1008
- context: __SerdeContext
1009
- ): any => {
1010
- return {
1011
- ...(input.S3Bucket !== undefined && input.S3Bucket !== null && { S3Bucket: input.S3Bucket }),
1012
- };
1013
- };
1014
-
1015
- const serializeAws_json1_1TagFilter = (input: TagFilter, context: __SerdeContext): any => {
1016
- return {
1017
- ...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
1018
- ...(input.Values !== undefined &&
1019
- input.Values !== null && { Values: serializeAws_json1_1TagValueList(input.Values, context) }),
1020
- };
1021
- };
1022
-
1023
- const serializeAws_json1_1TagFilterList = (input: TagFilter[], context: __SerdeContext): any => {
1024
- return input
1025
- .filter((e: any) => e != null)
1026
- .map((entry) => {
1027
- if (entry === null) {
1028
- return null as any;
1029
- }
1030
- return serializeAws_json1_1TagFilter(entry, context);
1031
- });
1032
- };
1033
-
1034
- const serializeAws_json1_1TagKeyFilterList = (input: string[], context: __SerdeContext): any => {
1035
- return input
1036
- .filter((e: any) => e != null)
1037
- .map((entry) => {
1038
- if (entry === null) {
1039
- return null as any;
1040
- }
1041
- return entry;
1042
- });
1043
- };
1044
-
1045
- const serializeAws_json1_1TagKeyListForUntag = (input: string[], context: __SerdeContext): any => {
1046
- return input
1047
- .filter((e: any) => e != null)
1048
- .map((entry) => {
1049
- if (entry === null) {
1050
- return null as any;
1051
- }
1052
- return entry;
1053
- });
1054
- };
1055
-
1056
- const serializeAws_json1_1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
1057
- return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
1058
- if (value === null) {
1059
- return acc;
1060
- }
1061
- return {
1062
- ...acc,
1063
- [key]: value,
1064
- };
1065
- }, {});
1066
- };
1067
-
1068
- const serializeAws_json1_1TagResourcesInput = (input: TagResourcesInput, context: __SerdeContext): any => {
1069
- return {
1070
- ...(input.ResourceARNList !== undefined &&
1071
- input.ResourceARNList !== null && {
1072
- ResourceARNList: serializeAws_json1_1ResourceARNListForTagUntag(input.ResourceARNList, context),
1073
- }),
1074
- ...(input.Tags !== undefined && input.Tags !== null && { Tags: serializeAws_json1_1TagMap(input.Tags, context) }),
1075
- };
1076
- };
1077
-
1078
- const serializeAws_json1_1TagValueList = (input: string[], context: __SerdeContext): any => {
1079
- return input
1080
- .filter((e: any) => e != null)
1081
- .map((entry) => {
1082
- if (entry === null) {
1083
- return null as any;
1084
- }
1085
- return entry;
1086
- });
1087
- };
1088
-
1089
- const serializeAws_json1_1TargetIdFilterList = (input: string[], context: __SerdeContext): any => {
1090
- return input
1091
- .filter((e: any) => e != null)
1092
- .map((entry) => {
1093
- if (entry === null) {
1094
- return null as any;
1095
- }
1096
- return entry;
1097
- });
1098
- };
1099
-
1100
- const serializeAws_json1_1UntagResourcesInput = (input: UntagResourcesInput, context: __SerdeContext): any => {
1101
- return {
1102
- ...(input.ResourceARNList !== undefined &&
1103
- input.ResourceARNList !== null && {
1104
- ResourceARNList: serializeAws_json1_1ResourceARNListForTagUntag(input.ResourceARNList, context),
1105
- }),
1106
- ...(input.TagKeys !== undefined &&
1107
- input.TagKeys !== null && { TagKeys: serializeAws_json1_1TagKeyListForUntag(input.TagKeys, context) }),
1108
- };
1109
- };
1110
-
1111
- const deserializeAws_json1_1ComplianceDetails = (output: any, context: __SerdeContext): ComplianceDetails => {
1112
- return {
1113
- ComplianceStatus: __expectBoolean(output.ComplianceStatus),
1114
- KeysWithNoncompliantValues:
1115
- output.KeysWithNoncompliantValues !== undefined && output.KeysWithNoncompliantValues !== null
1116
- ? deserializeAws_json1_1TagKeyList(output.KeysWithNoncompliantValues, context)
1117
- : undefined,
1118
- NoncompliantKeys:
1119
- output.NoncompliantKeys !== undefined && output.NoncompliantKeys !== null
1120
- ? deserializeAws_json1_1TagKeyList(output.NoncompliantKeys, context)
1121
- : undefined,
1122
- } as any;
1123
- };
1124
-
1125
- const deserializeAws_json1_1ConcurrentModificationException = (
1126
- output: any,
1127
- context: __SerdeContext
1128
- ): ConcurrentModificationException => {
1129
- return {
1130
- Message: __expectString(output.Message),
1131
- } as any;
1132
- };
1133
-
1134
- const deserializeAws_json1_1ConstraintViolationException = (
1135
- output: any,
1136
- context: __SerdeContext
1137
- ): ConstraintViolationException => {
1138
- return {
1139
- Message: __expectString(output.Message),
1140
- } as any;
1141
- };
1142
-
1143
- const deserializeAws_json1_1DescribeReportCreationOutput = (
1144
- output: any,
1145
- context: __SerdeContext
1146
- ): DescribeReportCreationOutput => {
1147
- return {
1148
- ErrorMessage: __expectString(output.ErrorMessage),
1149
- S3Location: __expectString(output.S3Location),
1150
- StartDate: __expectString(output.StartDate),
1151
- Status: __expectString(output.Status),
1152
- } as any;
1153
- };
1154
-
1155
- const deserializeAws_json1_1FailedResourcesMap = (
1156
- output: any,
1157
- context: __SerdeContext
1158
- ): { [key: string]: FailureInfo } => {
1159
- return Object.entries(output).reduce((acc: { [key: string]: FailureInfo }, [key, value]: [string, any]) => {
1160
- if (value === null) {
1161
- return acc;
1162
- }
1163
- return {
1164
- ...acc,
1165
- [key]: deserializeAws_json1_1FailureInfo(value, context),
1166
- };
1167
- }, {});
1168
- };
1169
-
1170
- const deserializeAws_json1_1FailureInfo = (output: any, context: __SerdeContext): FailureInfo => {
1171
- return {
1172
- ErrorCode: __expectString(output.ErrorCode),
1173
- ErrorMessage: __expectString(output.ErrorMessage),
1174
- StatusCode: __expectInt32(output.StatusCode),
1175
- } as any;
1176
- };
1177
-
1178
- const deserializeAws_json1_1GetComplianceSummaryOutput = (
1179
- output: any,
1180
- context: __SerdeContext
1181
- ): GetComplianceSummaryOutput => {
1182
- return {
1183
- PaginationToken: __expectString(output.PaginationToken),
1184
- SummaryList:
1185
- output.SummaryList !== undefined && output.SummaryList !== null
1186
- ? deserializeAws_json1_1SummaryList(output.SummaryList, context)
1187
- : undefined,
1188
- } as any;
1189
- };
1190
-
1191
- const deserializeAws_json1_1GetResourcesOutput = (output: any, context: __SerdeContext): GetResourcesOutput => {
1192
- return {
1193
- PaginationToken: __expectString(output.PaginationToken),
1194
- ResourceTagMappingList:
1195
- output.ResourceTagMappingList !== undefined && output.ResourceTagMappingList !== null
1196
- ? deserializeAws_json1_1ResourceTagMappingList(output.ResourceTagMappingList, context)
1197
- : undefined,
1198
- } as any;
1199
- };
1200
-
1201
- const deserializeAws_json1_1GetTagKeysOutput = (output: any, context: __SerdeContext): GetTagKeysOutput => {
1202
- return {
1203
- PaginationToken: __expectString(output.PaginationToken),
1204
- TagKeys:
1205
- output.TagKeys !== undefined && output.TagKeys !== null
1206
- ? deserializeAws_json1_1TagKeyList(output.TagKeys, context)
1207
- : undefined,
1208
- } as any;
1209
- };
1210
-
1211
- const deserializeAws_json1_1GetTagValuesOutput = (output: any, context: __SerdeContext): GetTagValuesOutput => {
1212
- return {
1213
- PaginationToken: __expectString(output.PaginationToken),
1214
- TagValues:
1215
- output.TagValues !== undefined && output.TagValues !== null
1216
- ? deserializeAws_json1_1TagValuesOutputList(output.TagValues, context)
1217
- : undefined,
1218
- } as any;
1219
- };
1220
-
1221
- const deserializeAws_json1_1InternalServiceException = (
1222
- output: any,
1223
- context: __SerdeContext
1224
- ): InternalServiceException => {
1225
- return {
1226
- Message: __expectString(output.Message),
1227
- } as any;
1228
- };
1229
-
1230
- const deserializeAws_json1_1InvalidParameterException = (
1231
- output: any,
1232
- context: __SerdeContext
1233
- ): InvalidParameterException => {
1234
- return {
1235
- Message: __expectString(output.Message),
1236
- } as any;
1237
- };
1238
-
1239
- const deserializeAws_json1_1PaginationTokenExpiredException = (
1240
- output: any,
1241
- context: __SerdeContext
1242
- ): PaginationTokenExpiredException => {
1243
- return {
1244
- Message: __expectString(output.Message),
1245
- } as any;
1246
- };
1247
-
1248
- const deserializeAws_json1_1ResourceTagMapping = (output: any, context: __SerdeContext): ResourceTagMapping => {
1249
- return {
1250
- ComplianceDetails:
1251
- output.ComplianceDetails !== undefined && output.ComplianceDetails !== null
1252
- ? deserializeAws_json1_1ComplianceDetails(output.ComplianceDetails, context)
1253
- : undefined,
1254
- ResourceARN: __expectString(output.ResourceARN),
1255
- Tags:
1256
- output.Tags !== undefined && output.Tags !== null
1257
- ? deserializeAws_json1_1TagList(output.Tags, context)
1258
- : undefined,
1259
- } as any;
1260
- };
1261
-
1262
- const deserializeAws_json1_1ResourceTagMappingList = (output: any, context: __SerdeContext): ResourceTagMapping[] => {
1263
- return (output || [])
1264
- .filter((e: any) => e != null)
1265
- .map((entry: any) => {
1266
- if (entry === null) {
1267
- return null as any;
1268
- }
1269
- return deserializeAws_json1_1ResourceTagMapping(entry, context);
1270
- });
1271
- };
1272
-
1273
- const deserializeAws_json1_1StartReportCreationOutput = (
1274
- output: any,
1275
- context: __SerdeContext
1276
- ): StartReportCreationOutput => {
1277
- return {} as any;
1278
- };
1279
-
1280
- const deserializeAws_json1_1Summary = (output: any, context: __SerdeContext): Summary => {
1281
- return {
1282
- LastUpdated: __expectString(output.LastUpdated),
1283
- NonCompliantResources: __expectLong(output.NonCompliantResources),
1284
- Region: __expectString(output.Region),
1285
- ResourceType: __expectString(output.ResourceType),
1286
- TargetId: __expectString(output.TargetId),
1287
- TargetIdType: __expectString(output.TargetIdType),
1288
- } as any;
1289
- };
1290
-
1291
- const deserializeAws_json1_1SummaryList = (output: any, context: __SerdeContext): Summary[] => {
1292
- return (output || [])
1293
- .filter((e: any) => e != null)
1294
- .map((entry: any) => {
1295
- if (entry === null) {
1296
- return null as any;
1297
- }
1298
- return deserializeAws_json1_1Summary(entry, context);
1299
- });
1300
- };
1301
-
1302
- const deserializeAws_json1_1Tag = (output: any, context: __SerdeContext): Tag => {
1303
- return {
1304
- Key: __expectString(output.Key),
1305
- Value: __expectString(output.Value),
1306
- } as any;
1307
- };
1308
-
1309
- const deserializeAws_json1_1TagKeyList = (output: any, context: __SerdeContext): string[] => {
1310
- return (output || [])
1311
- .filter((e: any) => e != null)
1312
- .map((entry: any) => {
1313
- if (entry === null) {
1314
- return null as any;
1315
- }
1316
- return __expectString(entry) as any;
1317
- });
1318
- };
1319
-
1320
- const deserializeAws_json1_1TagList = (output: any, context: __SerdeContext): Tag[] => {
1321
- return (output || [])
1322
- .filter((e: any) => e != null)
1323
- .map((entry: any) => {
1324
- if (entry === null) {
1325
- return null as any;
1326
- }
1327
- return deserializeAws_json1_1Tag(entry, context);
1328
- });
1329
- };
1330
-
1331
- const deserializeAws_json1_1TagResourcesOutput = (output: any, context: __SerdeContext): TagResourcesOutput => {
1332
- return {
1333
- FailedResourcesMap:
1334
- output.FailedResourcesMap !== undefined && output.FailedResourcesMap !== null
1335
- ? deserializeAws_json1_1FailedResourcesMap(output.FailedResourcesMap, context)
1336
- : undefined,
1337
- } as any;
1338
- };
1339
-
1340
- const deserializeAws_json1_1TagValuesOutputList = (output: any, context: __SerdeContext): string[] => {
1341
- return (output || [])
1342
- .filter((e: any) => e != null)
1343
- .map((entry: any) => {
1344
- if (entry === null) {
1345
- return null as any;
1346
- }
1347
- return __expectString(entry) as any;
1348
- });
1349
- };
1350
-
1351
- const deserializeAws_json1_1ThrottledException = (output: any, context: __SerdeContext): ThrottledException => {
1352
- return {
1353
- Message: __expectString(output.Message),
1354
- } as any;
1355
- };
1356
-
1357
- const deserializeAws_json1_1UntagResourcesOutput = (output: any, context: __SerdeContext): UntagResourcesOutput => {
1358
- return {
1359
- FailedResourcesMap:
1360
- output.FailedResourcesMap !== undefined && output.FailedResourcesMap !== null
1361
- ? deserializeAws_json1_1FailedResourcesMap(output.FailedResourcesMap, context)
1362
- : undefined,
1363
- } as any;
1364
- };
1365
-
1366
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
1367
- httpStatusCode: output.statusCode,
1368
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
1369
- extendedRequestId: output.headers["x-amz-id-2"],
1370
- cfId: output.headers["x-amz-cf-id"],
1371
- });
1372
-
1373
- // Collect low-level response body stream to Uint8Array.
1374
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
1375
- if (streamBody instanceof Uint8Array) {
1376
- return Promise.resolve(streamBody);
1377
- }
1378
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
1379
- };
1380
-
1381
- // Encode Uint8Array data into string with utf-8.
1382
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
1383
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
1384
-
1385
- const buildHttpRpcRequest = async (
1386
- context: __SerdeContext,
1387
- headers: __HeaderBag,
1388
- path: string,
1389
- resolvedHostname: string | undefined,
1390
- body: any
1391
- ): Promise<__HttpRequest> => {
1392
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
1393
- const contents: any = {
1394
- protocol,
1395
- hostname,
1396
- port,
1397
- method: "POST",
1398
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
1399
- headers,
1400
- };
1401
- if (resolvedHostname !== undefined) {
1402
- contents.hostname = resolvedHostname;
1403
- }
1404
- if (body !== undefined) {
1405
- contents.body = body;
1406
- }
1407
- return new __HttpRequest(contents);
1408
- };
1409
-
1410
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
1411
- collectBodyString(streamBody, context).then((encoded) => {
1412
- if (encoded.length) {
1413
- return JSON.parse(encoded);
1414
- }
1415
- return {};
1416
- });
1417
-
1418
- /**
1419
- * Load an error code for the aws.rest-json-1.1 protocol.
1420
- */
1421
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
1422
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1423
-
1424
- const sanitizeErrorCode = (rawValue: string): string => {
1425
- let cleanValue = rawValue;
1426
- if (cleanValue.indexOf(":") >= 0) {
1427
- cleanValue = cleanValue.split(":")[0];
1428
- }
1429
- if (cleanValue.indexOf("#") >= 0) {
1430
- cleanValue = cleanValue.split("#")[1];
1431
- }
1432
- return cleanValue;
1433
- };
1434
-
1435
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1436
- if (headerKey !== undefined) {
1437
- return sanitizeErrorCode(output.headers[headerKey]);
1438
- }
1439
-
1440
- if (data.code !== undefined) {
1441
- return sanitizeErrorCode(data.code);
1442
- }
1443
-
1444
- if (data["__type"] !== undefined) {
1445
- return sanitizeErrorCode(data["__type"]);
1446
- }
1447
-
1448
- return "";
1449
- };