@aws-sdk/client-bcm-data-exports 3.458.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 (139) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +308 -0
  3. package/dist-cjs/BCMDataExports.js +35 -0
  4. package/dist-cjs/BCMDataExportsClient.js +43 -0
  5. package/dist-cjs/commands/CreateExportCommand.js +50 -0
  6. package/dist-cjs/commands/DeleteExportCommand.js +50 -0
  7. package/dist-cjs/commands/GetExecutionCommand.js +50 -0
  8. package/dist-cjs/commands/GetExportCommand.js +50 -0
  9. package/dist-cjs/commands/GetTableCommand.js +50 -0
  10. package/dist-cjs/commands/ListExecutionsCommand.js +50 -0
  11. package/dist-cjs/commands/ListExportsCommand.js +50 -0
  12. package/dist-cjs/commands/ListTablesCommand.js +50 -0
  13. package/dist-cjs/commands/ListTagsForResourceCommand.js +50 -0
  14. package/dist-cjs/commands/TagResourceCommand.js +50 -0
  15. package/dist-cjs/commands/UntagResourceCommand.js +50 -0
  16. package/dist-cjs/commands/UpdateExportCommand.js +50 -0
  17. package/dist-cjs/commands/index.js +15 -0
  18. package/dist-cjs/endpoint/EndpointParameters.js +11 -0
  19. package/dist-cjs/endpoint/endpointResolver.js +12 -0
  20. package/dist-cjs/endpoint/ruleset.js +7 -0
  21. package/dist-cjs/extensionConfiguration.js +2 -0
  22. package/dist-cjs/index.js +12 -0
  23. package/dist-cjs/models/BCMDataExportsServiceException.js +12 -0
  24. package/dist-cjs/models/index.js +4 -0
  25. package/dist-cjs/models/models_0.js +126 -0
  26. package/dist-cjs/pagination/Interfaces.js +2 -0
  27. package/dist-cjs/pagination/ListExecutionsPaginator.js +29 -0
  28. package/dist-cjs/pagination/ListExportsPaginator.js +29 -0
  29. package/dist-cjs/pagination/ListTablesPaginator.js +29 -0
  30. package/dist-cjs/pagination/index.js +7 -0
  31. package/dist-cjs/protocols/Aws_json1_1.js +775 -0
  32. package/dist-cjs/runtimeConfig.browser.js +39 -0
  33. package/dist-cjs/runtimeConfig.js +50 -0
  34. package/dist-cjs/runtimeConfig.native.js +15 -0
  35. package/dist-cjs/runtimeConfig.shared.js +24 -0
  36. package/dist-cjs/runtimeExtensions.js +22 -0
  37. package/dist-es/BCMDataExports.js +31 -0
  38. package/dist-es/BCMDataExportsClient.js +39 -0
  39. package/dist-es/commands/CreateExportCommand.js +46 -0
  40. package/dist-es/commands/DeleteExportCommand.js +46 -0
  41. package/dist-es/commands/GetExecutionCommand.js +46 -0
  42. package/dist-es/commands/GetExportCommand.js +46 -0
  43. package/dist-es/commands/GetTableCommand.js +46 -0
  44. package/dist-es/commands/ListExecutionsCommand.js +46 -0
  45. package/dist-es/commands/ListExportsCommand.js +46 -0
  46. package/dist-es/commands/ListTablesCommand.js +46 -0
  47. package/dist-es/commands/ListTagsForResourceCommand.js +46 -0
  48. package/dist-es/commands/TagResourceCommand.js +46 -0
  49. package/dist-es/commands/UntagResourceCommand.js +46 -0
  50. package/dist-es/commands/UpdateExportCommand.js +46 -0
  51. package/dist-es/commands/index.js +12 -0
  52. package/dist-es/endpoint/EndpointParameters.js +7 -0
  53. package/dist-es/endpoint/endpointResolver.js +8 -0
  54. package/dist-es/endpoint/ruleset.js +4 -0
  55. package/dist-es/extensionConfiguration.js +1 -0
  56. package/dist-es/index.js +7 -0
  57. package/dist-es/models/BCMDataExportsServiceException.js +8 -0
  58. package/dist-es/models/index.js +1 -0
  59. package/dist-es/models/models_0.js +118 -0
  60. package/dist-es/pagination/Interfaces.js +1 -0
  61. package/dist-es/pagination/ListExecutionsPaginator.js +25 -0
  62. package/dist-es/pagination/ListExportsPaginator.js +25 -0
  63. package/dist-es/pagination/ListTablesPaginator.js +25 -0
  64. package/dist-es/pagination/index.js +4 -0
  65. package/dist-es/protocols/Aws_json1_1.js +748 -0
  66. package/dist-es/runtimeConfig.browser.js +34 -0
  67. package/dist-es/runtimeConfig.js +45 -0
  68. package/dist-es/runtimeConfig.native.js +11 -0
  69. package/dist-es/runtimeConfig.shared.js +20 -0
  70. package/dist-es/runtimeExtensions.js +18 -0
  71. package/dist-types/BCMDataExports.d.ts +101 -0
  72. package/dist-types/BCMDataExportsClient.d.ts +188 -0
  73. package/dist-types/commands/CreateExportCommand.d.ts +138 -0
  74. package/dist-types/commands/DeleteExportCommand.d.ts +87 -0
  75. package/dist-types/commands/GetExecutionCommand.d.ts +124 -0
  76. package/dist-types/commands/GetExportCommand.d.ts +122 -0
  77. package/dist-types/commands/GetTableCommand.d.ts +99 -0
  78. package/dist-types/commands/ListExecutionsCommand.d.ts +101 -0
  79. package/dist-types/commands/ListExportsCommand.d.ts +98 -0
  80. package/dist-types/commands/ListTablesCommand.d.ts +101 -0
  81. package/dist-types/commands/ListTagsForResourceCommand.d.ts +95 -0
  82. package/dist-types/commands/TagResourceCommand.d.ts +91 -0
  83. package/dist-types/commands/UntagResourceCommand.d.ts +88 -0
  84. package/dist-types/commands/UpdateExportCommand.d.ts +117 -0
  85. package/dist-types/commands/index.d.ts +12 -0
  86. package/dist-types/endpoint/EndpointParameters.d.ts +20 -0
  87. package/dist-types/endpoint/endpointResolver.d.ts +5 -0
  88. package/dist-types/endpoint/ruleset.d.ts +2 -0
  89. package/dist-types/extensionConfiguration.d.ts +8 -0
  90. package/dist-types/index.d.ts +22 -0
  91. package/dist-types/models/BCMDataExportsServiceException.d.ts +13 -0
  92. package/dist-types/models/index.d.ts +1 -0
  93. package/dist-types/models/models_0.d.ts +921 -0
  94. package/dist-types/pagination/Interfaces.d.ts +8 -0
  95. package/dist-types/pagination/ListExecutionsPaginator.d.ts +7 -0
  96. package/dist-types/pagination/ListExportsPaginator.d.ts +7 -0
  97. package/dist-types/pagination/ListTablesPaginator.d.ts +7 -0
  98. package/dist-types/pagination/index.d.ts +4 -0
  99. package/dist-types/protocols/Aws_json1_1.d.ts +110 -0
  100. package/dist-types/runtimeConfig.browser.d.ts +46 -0
  101. package/dist-types/runtimeConfig.d.ts +46 -0
  102. package/dist-types/runtimeConfig.native.d.ts +45 -0
  103. package/dist-types/runtimeConfig.shared.d.ts +19 -0
  104. package/dist-types/runtimeExtensions.d.ts +17 -0
  105. package/dist-types/ts3.4/BCMDataExports.d.ts +211 -0
  106. package/dist-types/ts3.4/BCMDataExportsClient.d.ts +191 -0
  107. package/dist-types/ts3.4/commands/CreateExportCommand.d.ts +35 -0
  108. package/dist-types/ts3.4/commands/DeleteExportCommand.d.ts +35 -0
  109. package/dist-types/ts3.4/commands/GetExecutionCommand.d.ts +35 -0
  110. package/dist-types/ts3.4/commands/GetExportCommand.d.ts +35 -0
  111. package/dist-types/ts3.4/commands/GetTableCommand.d.ts +35 -0
  112. package/dist-types/ts3.4/commands/ListExecutionsCommand.d.ts +38 -0
  113. package/dist-types/ts3.4/commands/ListExportsCommand.d.ts +35 -0
  114. package/dist-types/ts3.4/commands/ListTablesCommand.d.ts +35 -0
  115. package/dist-types/ts3.4/commands/ListTagsForResourceCommand.d.ts +39 -0
  116. package/dist-types/ts3.4/commands/TagResourceCommand.d.ts +35 -0
  117. package/dist-types/ts3.4/commands/UntagResourceCommand.d.ts +38 -0
  118. package/dist-types/ts3.4/commands/UpdateExportCommand.d.ts +35 -0
  119. package/dist-types/ts3.4/commands/index.d.ts +12 -0
  120. package/dist-types/ts3.4/endpoint/EndpointParameters.d.ts +31 -0
  121. package/dist-types/ts3.4/endpoint/endpointResolver.d.ts +8 -0
  122. package/dist-types/ts3.4/endpoint/ruleset.d.ts +2 -0
  123. package/dist-types/ts3.4/extensionConfiguration.d.ts +7 -0
  124. package/dist-types/ts3.4/index.d.ts +10 -0
  125. package/dist-types/ts3.4/models/BCMDataExportsServiceException.d.ts +8 -0
  126. package/dist-types/ts3.4/models/index.d.ts +1 -0
  127. package/dist-types/ts3.4/models/models_0.d.ts +277 -0
  128. package/dist-types/ts3.4/pagination/Interfaces.d.ts +6 -0
  129. package/dist-types/ts3.4/pagination/ListExecutionsPaginator.d.ts +11 -0
  130. package/dist-types/ts3.4/pagination/ListExportsPaginator.d.ts +11 -0
  131. package/dist-types/ts3.4/pagination/ListTablesPaginator.d.ts +11 -0
  132. package/dist-types/ts3.4/pagination/index.d.ts +4 -0
  133. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +149 -0
  134. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +97 -0
  135. package/dist-types/ts3.4/runtimeConfig.d.ts +97 -0
  136. package/dist-types/ts3.4/runtimeConfig.native.d.ts +88 -0
  137. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +19 -0
  138. package/dist-types/ts3.4/runtimeExtensions.d.ts +11 -0
  139. package/package.json +102 -0
@@ -0,0 +1,748 @@
1
+ import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectString as __expectString, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
3
+ import { BCMDataExportsServiceException as __BaseException } from "../models/BCMDataExportsServiceException";
4
+ import { InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
5
+ export const se_CreateExportCommand = async (input, context) => {
6
+ const headers = sharedHeaders("CreateExport");
7
+ let body;
8
+ body = JSON.stringify(_json(input));
9
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
10
+ };
11
+ export const se_DeleteExportCommand = async (input, context) => {
12
+ const headers = sharedHeaders("DeleteExport");
13
+ let body;
14
+ body = JSON.stringify(_json(input));
15
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
+ };
17
+ export const se_GetExecutionCommand = async (input, context) => {
18
+ const headers = sharedHeaders("GetExecution");
19
+ let body;
20
+ body = JSON.stringify(_json(input));
21
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
+ };
23
+ export const se_GetExportCommand = async (input, context) => {
24
+ const headers = sharedHeaders("GetExport");
25
+ let body;
26
+ body = JSON.stringify(_json(input));
27
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
28
+ };
29
+ export const se_GetTableCommand = async (input, context) => {
30
+ const headers = sharedHeaders("GetTable");
31
+ let body;
32
+ body = JSON.stringify(_json(input));
33
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
34
+ };
35
+ export const se_ListExecutionsCommand = async (input, context) => {
36
+ const headers = sharedHeaders("ListExecutions");
37
+ let body;
38
+ body = JSON.stringify(_json(input));
39
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
+ };
41
+ export const se_ListExportsCommand = async (input, context) => {
42
+ const headers = sharedHeaders("ListExports");
43
+ let body;
44
+ body = JSON.stringify(_json(input));
45
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
46
+ };
47
+ export const se_ListTablesCommand = async (input, context) => {
48
+ const headers = sharedHeaders("ListTables");
49
+ let body;
50
+ body = JSON.stringify(_json(input));
51
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
52
+ };
53
+ export const se_ListTagsForResourceCommand = async (input, context) => {
54
+ const headers = sharedHeaders("ListTagsForResource");
55
+ let body;
56
+ body = JSON.stringify(_json(input));
57
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
+ };
59
+ export const se_TagResourceCommand = async (input, context) => {
60
+ const headers = sharedHeaders("TagResource");
61
+ let body;
62
+ body = JSON.stringify(_json(input));
63
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
64
+ };
65
+ export const se_UntagResourceCommand = async (input, context) => {
66
+ const headers = sharedHeaders("UntagResource");
67
+ let body;
68
+ body = JSON.stringify(_json(input));
69
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
70
+ };
71
+ export const se_UpdateExportCommand = async (input, context) => {
72
+ const headers = sharedHeaders("UpdateExport");
73
+ let body;
74
+ body = JSON.stringify(_json(input));
75
+ return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
+ };
77
+ export const de_CreateExportCommand = async (output, context) => {
78
+ if (output.statusCode >= 300) {
79
+ return de_CreateExportCommandError(output, context);
80
+ }
81
+ const data = await parseBody(output.body, context);
82
+ let contents = {};
83
+ contents = _json(data);
84
+ const response = {
85
+ $metadata: deserializeMetadata(output),
86
+ ...contents,
87
+ };
88
+ return response;
89
+ };
90
+ const de_CreateExportCommandError = async (output, context) => {
91
+ const parsedOutput = {
92
+ ...output,
93
+ body: await parseErrorBody(output.body, context),
94
+ };
95
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
96
+ switch (errorCode) {
97
+ case "InternalServerException":
98
+ case "com.amazonaws.bcmdataexports#InternalServerException":
99
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
100
+ case "ServiceQuotaExceededException":
101
+ case "com.amazonaws.bcmdataexports#ServiceQuotaExceededException":
102
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
103
+ case "ThrottlingException":
104
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
105
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
106
+ case "ValidationException":
107
+ case "com.amazonaws.bcmdataexports#ValidationException":
108
+ throw await de_ValidationExceptionRes(parsedOutput, context);
109
+ default:
110
+ const parsedBody = parsedOutput.body;
111
+ return throwDefaultError({
112
+ output,
113
+ parsedBody,
114
+ errorCode,
115
+ });
116
+ }
117
+ };
118
+ export const de_DeleteExportCommand = async (output, context) => {
119
+ if (output.statusCode >= 300) {
120
+ return de_DeleteExportCommandError(output, context);
121
+ }
122
+ const data = await parseBody(output.body, context);
123
+ let contents = {};
124
+ contents = _json(data);
125
+ const response = {
126
+ $metadata: deserializeMetadata(output),
127
+ ...contents,
128
+ };
129
+ return response;
130
+ };
131
+ const de_DeleteExportCommandError = async (output, context) => {
132
+ const parsedOutput = {
133
+ ...output,
134
+ body: await parseErrorBody(output.body, context),
135
+ };
136
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
137
+ switch (errorCode) {
138
+ case "InternalServerException":
139
+ case "com.amazonaws.bcmdataexports#InternalServerException":
140
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
141
+ case "ResourceNotFoundException":
142
+ case "com.amazonaws.bcmdataexports#ResourceNotFoundException":
143
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
144
+ case "ThrottlingException":
145
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
146
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
147
+ case "ValidationException":
148
+ case "com.amazonaws.bcmdataexports#ValidationException":
149
+ throw await de_ValidationExceptionRes(parsedOutput, context);
150
+ default:
151
+ const parsedBody = parsedOutput.body;
152
+ return throwDefaultError({
153
+ output,
154
+ parsedBody,
155
+ errorCode,
156
+ });
157
+ }
158
+ };
159
+ export const de_GetExecutionCommand = async (output, context) => {
160
+ if (output.statusCode >= 300) {
161
+ return de_GetExecutionCommandError(output, context);
162
+ }
163
+ const data = await parseBody(output.body, context);
164
+ let contents = {};
165
+ contents = de_GetExecutionResponse(data, context);
166
+ const response = {
167
+ $metadata: deserializeMetadata(output),
168
+ ...contents,
169
+ };
170
+ return response;
171
+ };
172
+ const de_GetExecutionCommandError = async (output, context) => {
173
+ const parsedOutput = {
174
+ ...output,
175
+ body: await parseErrorBody(output.body, context),
176
+ };
177
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
178
+ switch (errorCode) {
179
+ case "InternalServerException":
180
+ case "com.amazonaws.bcmdataexports#InternalServerException":
181
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
182
+ case "ResourceNotFoundException":
183
+ case "com.amazonaws.bcmdataexports#ResourceNotFoundException":
184
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
185
+ case "ThrottlingException":
186
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
187
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
188
+ case "ValidationException":
189
+ case "com.amazonaws.bcmdataexports#ValidationException":
190
+ throw await de_ValidationExceptionRes(parsedOutput, context);
191
+ default:
192
+ const parsedBody = parsedOutput.body;
193
+ return throwDefaultError({
194
+ output,
195
+ parsedBody,
196
+ errorCode,
197
+ });
198
+ }
199
+ };
200
+ export const de_GetExportCommand = async (output, context) => {
201
+ if (output.statusCode >= 300) {
202
+ return de_GetExportCommandError(output, context);
203
+ }
204
+ const data = await parseBody(output.body, context);
205
+ let contents = {};
206
+ contents = de_GetExportResponse(data, context);
207
+ const response = {
208
+ $metadata: deserializeMetadata(output),
209
+ ...contents,
210
+ };
211
+ return response;
212
+ };
213
+ const de_GetExportCommandError = async (output, context) => {
214
+ const parsedOutput = {
215
+ ...output,
216
+ body: await parseErrorBody(output.body, context),
217
+ };
218
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
219
+ switch (errorCode) {
220
+ case "InternalServerException":
221
+ case "com.amazonaws.bcmdataexports#InternalServerException":
222
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
223
+ case "ResourceNotFoundException":
224
+ case "com.amazonaws.bcmdataexports#ResourceNotFoundException":
225
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
226
+ case "ThrottlingException":
227
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
228
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
229
+ case "ValidationException":
230
+ case "com.amazonaws.bcmdataexports#ValidationException":
231
+ throw await de_ValidationExceptionRes(parsedOutput, context);
232
+ default:
233
+ const parsedBody = parsedOutput.body;
234
+ return throwDefaultError({
235
+ output,
236
+ parsedBody,
237
+ errorCode,
238
+ });
239
+ }
240
+ };
241
+ export const de_GetTableCommand = async (output, context) => {
242
+ if (output.statusCode >= 300) {
243
+ return de_GetTableCommandError(output, context);
244
+ }
245
+ const data = await parseBody(output.body, context);
246
+ let contents = {};
247
+ contents = _json(data);
248
+ const response = {
249
+ $metadata: deserializeMetadata(output),
250
+ ...contents,
251
+ };
252
+ return response;
253
+ };
254
+ const de_GetTableCommandError = async (output, context) => {
255
+ const parsedOutput = {
256
+ ...output,
257
+ body: await parseErrorBody(output.body, context),
258
+ };
259
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
260
+ switch (errorCode) {
261
+ case "InternalServerException":
262
+ case "com.amazonaws.bcmdataexports#InternalServerException":
263
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
264
+ case "ThrottlingException":
265
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
266
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
267
+ case "ValidationException":
268
+ case "com.amazonaws.bcmdataexports#ValidationException":
269
+ throw await de_ValidationExceptionRes(parsedOutput, context);
270
+ default:
271
+ const parsedBody = parsedOutput.body;
272
+ return throwDefaultError({
273
+ output,
274
+ parsedBody,
275
+ errorCode,
276
+ });
277
+ }
278
+ };
279
+ export const de_ListExecutionsCommand = async (output, context) => {
280
+ if (output.statusCode >= 300) {
281
+ return de_ListExecutionsCommandError(output, context);
282
+ }
283
+ const data = await parseBody(output.body, context);
284
+ let contents = {};
285
+ contents = de_ListExecutionsResponse(data, context);
286
+ const response = {
287
+ $metadata: deserializeMetadata(output),
288
+ ...contents,
289
+ };
290
+ return response;
291
+ };
292
+ const de_ListExecutionsCommandError = async (output, context) => {
293
+ const parsedOutput = {
294
+ ...output,
295
+ body: await parseErrorBody(output.body, context),
296
+ };
297
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
298
+ switch (errorCode) {
299
+ case "InternalServerException":
300
+ case "com.amazonaws.bcmdataexports#InternalServerException":
301
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
302
+ case "ResourceNotFoundException":
303
+ case "com.amazonaws.bcmdataexports#ResourceNotFoundException":
304
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
305
+ case "ThrottlingException":
306
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
307
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
308
+ case "ValidationException":
309
+ case "com.amazonaws.bcmdataexports#ValidationException":
310
+ throw await de_ValidationExceptionRes(parsedOutput, context);
311
+ default:
312
+ const parsedBody = parsedOutput.body;
313
+ return throwDefaultError({
314
+ output,
315
+ parsedBody,
316
+ errorCode,
317
+ });
318
+ }
319
+ };
320
+ export const de_ListExportsCommand = async (output, context) => {
321
+ if (output.statusCode >= 300) {
322
+ return de_ListExportsCommandError(output, context);
323
+ }
324
+ const data = await parseBody(output.body, context);
325
+ let contents = {};
326
+ contents = de_ListExportsResponse(data, context);
327
+ const response = {
328
+ $metadata: deserializeMetadata(output),
329
+ ...contents,
330
+ };
331
+ return response;
332
+ };
333
+ const de_ListExportsCommandError = async (output, context) => {
334
+ const parsedOutput = {
335
+ ...output,
336
+ body: await parseErrorBody(output.body, context),
337
+ };
338
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
339
+ switch (errorCode) {
340
+ case "InternalServerException":
341
+ case "com.amazonaws.bcmdataexports#InternalServerException":
342
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
343
+ case "ThrottlingException":
344
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
345
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
346
+ case "ValidationException":
347
+ case "com.amazonaws.bcmdataexports#ValidationException":
348
+ throw await de_ValidationExceptionRes(parsedOutput, context);
349
+ default:
350
+ const parsedBody = parsedOutput.body;
351
+ return throwDefaultError({
352
+ output,
353
+ parsedBody,
354
+ errorCode,
355
+ });
356
+ }
357
+ };
358
+ export const de_ListTablesCommand = async (output, context) => {
359
+ if (output.statusCode >= 300) {
360
+ return de_ListTablesCommandError(output, context);
361
+ }
362
+ const data = await parseBody(output.body, context);
363
+ let contents = {};
364
+ contents = _json(data);
365
+ const response = {
366
+ $metadata: deserializeMetadata(output),
367
+ ...contents,
368
+ };
369
+ return response;
370
+ };
371
+ const de_ListTablesCommandError = async (output, context) => {
372
+ const parsedOutput = {
373
+ ...output,
374
+ body: await parseErrorBody(output.body, context),
375
+ };
376
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
377
+ switch (errorCode) {
378
+ case "InternalServerException":
379
+ case "com.amazonaws.bcmdataexports#InternalServerException":
380
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
381
+ case "ThrottlingException":
382
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
383
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
384
+ case "ValidationException":
385
+ case "com.amazonaws.bcmdataexports#ValidationException":
386
+ throw await de_ValidationExceptionRes(parsedOutput, context);
387
+ default:
388
+ const parsedBody = parsedOutput.body;
389
+ return throwDefaultError({
390
+ output,
391
+ parsedBody,
392
+ errorCode,
393
+ });
394
+ }
395
+ };
396
+ export const de_ListTagsForResourceCommand = async (output, context) => {
397
+ if (output.statusCode >= 300) {
398
+ return de_ListTagsForResourceCommandError(output, context);
399
+ }
400
+ const data = await parseBody(output.body, context);
401
+ let contents = {};
402
+ contents = _json(data);
403
+ const response = {
404
+ $metadata: deserializeMetadata(output),
405
+ ...contents,
406
+ };
407
+ return response;
408
+ };
409
+ const de_ListTagsForResourceCommandError = async (output, context) => {
410
+ const parsedOutput = {
411
+ ...output,
412
+ body: await parseErrorBody(output.body, context),
413
+ };
414
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
415
+ switch (errorCode) {
416
+ case "InternalServerException":
417
+ case "com.amazonaws.bcmdataexports#InternalServerException":
418
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
419
+ case "ResourceNotFoundException":
420
+ case "com.amazonaws.bcmdataexports#ResourceNotFoundException":
421
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
422
+ case "ThrottlingException":
423
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
424
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
425
+ case "ValidationException":
426
+ case "com.amazonaws.bcmdataexports#ValidationException":
427
+ throw await de_ValidationExceptionRes(parsedOutput, context);
428
+ default:
429
+ const parsedBody = parsedOutput.body;
430
+ return throwDefaultError({
431
+ output,
432
+ parsedBody,
433
+ errorCode,
434
+ });
435
+ }
436
+ };
437
+ export const de_TagResourceCommand = async (output, context) => {
438
+ if (output.statusCode >= 300) {
439
+ return de_TagResourceCommandError(output, context);
440
+ }
441
+ const data = await parseBody(output.body, context);
442
+ let contents = {};
443
+ contents = _json(data);
444
+ const response = {
445
+ $metadata: deserializeMetadata(output),
446
+ ...contents,
447
+ };
448
+ return response;
449
+ };
450
+ const de_TagResourceCommandError = async (output, context) => {
451
+ const parsedOutput = {
452
+ ...output,
453
+ body: await parseErrorBody(output.body, context),
454
+ };
455
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
456
+ switch (errorCode) {
457
+ case "InternalServerException":
458
+ case "com.amazonaws.bcmdataexports#InternalServerException":
459
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
460
+ case "ResourceNotFoundException":
461
+ case "com.amazonaws.bcmdataexports#ResourceNotFoundException":
462
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
463
+ case "ThrottlingException":
464
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
465
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
466
+ case "ValidationException":
467
+ case "com.amazonaws.bcmdataexports#ValidationException":
468
+ throw await de_ValidationExceptionRes(parsedOutput, context);
469
+ default:
470
+ const parsedBody = parsedOutput.body;
471
+ return throwDefaultError({
472
+ output,
473
+ parsedBody,
474
+ errorCode,
475
+ });
476
+ }
477
+ };
478
+ export const de_UntagResourceCommand = async (output, context) => {
479
+ if (output.statusCode >= 300) {
480
+ return de_UntagResourceCommandError(output, context);
481
+ }
482
+ const data = await parseBody(output.body, context);
483
+ let contents = {};
484
+ contents = _json(data);
485
+ const response = {
486
+ $metadata: deserializeMetadata(output),
487
+ ...contents,
488
+ };
489
+ return response;
490
+ };
491
+ const de_UntagResourceCommandError = async (output, context) => {
492
+ const parsedOutput = {
493
+ ...output,
494
+ body: await parseErrorBody(output.body, context),
495
+ };
496
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
497
+ switch (errorCode) {
498
+ case "InternalServerException":
499
+ case "com.amazonaws.bcmdataexports#InternalServerException":
500
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
501
+ case "ResourceNotFoundException":
502
+ case "com.amazonaws.bcmdataexports#ResourceNotFoundException":
503
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
504
+ case "ThrottlingException":
505
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
506
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
507
+ case "ValidationException":
508
+ case "com.amazonaws.bcmdataexports#ValidationException":
509
+ throw await de_ValidationExceptionRes(parsedOutput, context);
510
+ default:
511
+ const parsedBody = parsedOutput.body;
512
+ return throwDefaultError({
513
+ output,
514
+ parsedBody,
515
+ errorCode,
516
+ });
517
+ }
518
+ };
519
+ export const de_UpdateExportCommand = async (output, context) => {
520
+ if (output.statusCode >= 300) {
521
+ return de_UpdateExportCommandError(output, context);
522
+ }
523
+ const data = await parseBody(output.body, context);
524
+ let contents = {};
525
+ contents = _json(data);
526
+ const response = {
527
+ $metadata: deserializeMetadata(output),
528
+ ...contents,
529
+ };
530
+ return response;
531
+ };
532
+ const de_UpdateExportCommandError = async (output, context) => {
533
+ const parsedOutput = {
534
+ ...output,
535
+ body: await parseErrorBody(output.body, context),
536
+ };
537
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
538
+ switch (errorCode) {
539
+ case "InternalServerException":
540
+ case "com.amazonaws.bcmdataexports#InternalServerException":
541
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
542
+ case "ResourceNotFoundException":
543
+ case "com.amazonaws.bcmdataexports#ResourceNotFoundException":
544
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
545
+ case "ThrottlingException":
546
+ case "com.amazonaws.bcmdataexports#ThrottlingException":
547
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
548
+ case "ValidationException":
549
+ case "com.amazonaws.bcmdataexports#ValidationException":
550
+ throw await de_ValidationExceptionRes(parsedOutput, context);
551
+ default:
552
+ const parsedBody = parsedOutput.body;
553
+ return throwDefaultError({
554
+ output,
555
+ parsedBody,
556
+ errorCode,
557
+ });
558
+ }
559
+ };
560
+ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
561
+ const body = parsedOutput.body;
562
+ const deserialized = _json(body);
563
+ const exception = new InternalServerException({
564
+ $metadata: deserializeMetadata(parsedOutput),
565
+ ...deserialized,
566
+ });
567
+ return __decorateServiceException(exception, body);
568
+ };
569
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
570
+ const body = parsedOutput.body;
571
+ const deserialized = _json(body);
572
+ const exception = new ResourceNotFoundException({
573
+ $metadata: deserializeMetadata(parsedOutput),
574
+ ...deserialized,
575
+ });
576
+ return __decorateServiceException(exception, body);
577
+ };
578
+ const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
579
+ const body = parsedOutput.body;
580
+ const deserialized = _json(body);
581
+ const exception = new ServiceQuotaExceededException({
582
+ $metadata: deserializeMetadata(parsedOutput),
583
+ ...deserialized,
584
+ });
585
+ return __decorateServiceException(exception, body);
586
+ };
587
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
588
+ const body = parsedOutput.body;
589
+ const deserialized = _json(body);
590
+ const exception = new ThrottlingException({
591
+ $metadata: deserializeMetadata(parsedOutput),
592
+ ...deserialized,
593
+ });
594
+ return __decorateServiceException(exception, body);
595
+ };
596
+ const de_ValidationExceptionRes = async (parsedOutput, context) => {
597
+ const body = parsedOutput.body;
598
+ const deserialized = _json(body);
599
+ const exception = new ValidationException({
600
+ $metadata: deserializeMetadata(parsedOutput),
601
+ ...deserialized,
602
+ });
603
+ return __decorateServiceException(exception, body);
604
+ };
605
+ const de_ExecutionReference = (output, context) => {
606
+ return take(output, {
607
+ ExecutionId: __expectString,
608
+ ExecutionStatus: (_) => de_ExecutionStatus(_, context),
609
+ });
610
+ };
611
+ const de_ExecutionReferenceList = (output, context) => {
612
+ const retVal = (output || [])
613
+ .filter((e) => e != null)
614
+ .map((entry) => {
615
+ return de_ExecutionReference(entry, context);
616
+ });
617
+ return retVal;
618
+ };
619
+ const de_ExecutionStatus = (output, context) => {
620
+ return take(output, {
621
+ CompletedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
622
+ CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
623
+ LastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
624
+ StatusCode: __expectString,
625
+ StatusReason: __expectString,
626
+ });
627
+ };
628
+ const de_ExportReference = (output, context) => {
629
+ return take(output, {
630
+ ExportArn: __expectString,
631
+ ExportName: __expectString,
632
+ ExportStatus: (_) => de_ExportStatus(_, context),
633
+ });
634
+ };
635
+ const de_ExportReferenceList = (output, context) => {
636
+ const retVal = (output || [])
637
+ .filter((e) => e != null)
638
+ .map((entry) => {
639
+ return de_ExportReference(entry, context);
640
+ });
641
+ return retVal;
642
+ };
643
+ const de_ExportStatus = (output, context) => {
644
+ return take(output, {
645
+ CreatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
646
+ LastRefreshedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
647
+ LastUpdatedAt: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
648
+ StatusCode: __expectString,
649
+ StatusReason: __expectString,
650
+ });
651
+ };
652
+ const de_GetExecutionResponse = (output, context) => {
653
+ return take(output, {
654
+ ExecutionId: __expectString,
655
+ ExecutionStatus: (_) => de_ExecutionStatus(_, context),
656
+ Export: _json,
657
+ });
658
+ };
659
+ const de_GetExportResponse = (output, context) => {
660
+ return take(output, {
661
+ Export: _json,
662
+ ExportStatus: (_) => de_ExportStatus(_, context),
663
+ });
664
+ };
665
+ const de_ListExecutionsResponse = (output, context) => {
666
+ return take(output, {
667
+ Executions: (_) => de_ExecutionReferenceList(_, context),
668
+ NextToken: __expectString,
669
+ });
670
+ };
671
+ const de_ListExportsResponse = (output, context) => {
672
+ return take(output, {
673
+ Exports: (_) => de_ExportReferenceList(_, context),
674
+ NextToken: __expectString,
675
+ });
676
+ };
677
+ const deserializeMetadata = (output) => ({
678
+ httpStatusCode: output.statusCode,
679
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
680
+ extendedRequestId: output.headers["x-amz-id-2"],
681
+ cfId: output.headers["x-amz-cf-id"],
682
+ });
683
+ const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
684
+ const throwDefaultError = withBaseException(__BaseException);
685
+ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
686
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
687
+ const contents = {
688
+ protocol,
689
+ hostname,
690
+ port,
691
+ method: "POST",
692
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
693
+ headers,
694
+ };
695
+ if (resolvedHostname !== undefined) {
696
+ contents.hostname = resolvedHostname;
697
+ }
698
+ if (body !== undefined) {
699
+ contents.body = body;
700
+ }
701
+ return new __HttpRequest(contents);
702
+ };
703
+ function sharedHeaders(operation) {
704
+ return {
705
+ "content-type": "application/x-amz-json-1.1",
706
+ "x-amz-target": `AWSBillingAndCostManagementDataExports.${operation}`,
707
+ };
708
+ }
709
+ const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
710
+ if (encoded.length) {
711
+ return JSON.parse(encoded);
712
+ }
713
+ return {};
714
+ });
715
+ const parseErrorBody = async (errorBody, context) => {
716
+ const value = await parseBody(errorBody, context);
717
+ value.message = value.message ?? value.Message;
718
+ return value;
719
+ };
720
+ const loadRestJsonErrorCode = (output, data) => {
721
+ const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
722
+ const sanitizeErrorCode = (rawValue) => {
723
+ let cleanValue = rawValue;
724
+ if (typeof cleanValue === "number") {
725
+ cleanValue = cleanValue.toString();
726
+ }
727
+ if (cleanValue.indexOf(",") >= 0) {
728
+ cleanValue = cleanValue.split(",")[0];
729
+ }
730
+ if (cleanValue.indexOf(":") >= 0) {
731
+ cleanValue = cleanValue.split(":")[0];
732
+ }
733
+ if (cleanValue.indexOf("#") >= 0) {
734
+ cleanValue = cleanValue.split("#")[1];
735
+ }
736
+ return cleanValue;
737
+ };
738
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
739
+ if (headerKey !== undefined) {
740
+ return sanitizeErrorCode(output.headers[headerKey]);
741
+ }
742
+ if (data.code !== undefined) {
743
+ return sanitizeErrorCode(data.code);
744
+ }
745
+ if (data["__type"] !== undefined) {
746
+ return sanitizeErrorCode(data["__type"]);
747
+ }
748
+ };