@aws-sdk/client-migrationhub-config 3.35.0 → 3.38.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 (106) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/dist-cjs/MigrationHubConfig.js +0 -29
  3. package/dist-cjs/MigrationHubConfigClient.js +0 -34
  4. package/dist-cjs/commands/CreateHomeRegionControlCommand.js +0 -25
  5. package/dist-cjs/commands/DescribeHomeRegionControlsCommand.js +0 -26
  6. package/dist-cjs/commands/GetHomeRegionCommand.js +0 -29
  7. package/dist-cjs/commands/index.js +6 -0
  8. package/dist-cjs/endpoints.js +1 -2
  9. package/dist-cjs/index.js +4 -8
  10. package/dist-cjs/models/index.js +0 -1
  11. package/dist-cjs/models/models_0.js +0 -43
  12. package/dist-cjs/pagination/DescribeHomeRegionControlsPaginator.js +0 -11
  13. package/dist-cjs/pagination/Interfaces.js +0 -1
  14. package/dist-cjs/pagination/index.js +5 -0
  15. package/dist-cjs/protocols/Aws_json1_1.js +0 -6
  16. package/dist-cjs/runtimeConfig.browser.js +1 -6
  17. package/dist-cjs/runtimeConfig.js +2 -7
  18. package/dist-cjs/runtimeConfig.native.js +0 -4
  19. package/dist-cjs/runtimeConfig.shared.js +0 -4
  20. package/dist-es/MigrationHubConfig.js +0 -1
  21. package/dist-es/MigrationHubConfigClient.js +0 -1
  22. package/dist-es/commands/CreateHomeRegionControlCommand.js +0 -1
  23. package/dist-es/commands/DescribeHomeRegionControlsCommand.js +0 -1
  24. package/dist-es/commands/GetHomeRegionCommand.js +0 -1
  25. package/dist-es/commands/index.js +3 -0
  26. package/dist-es/endpoints.js +1 -2
  27. package/dist-es/index.js +4 -8
  28. package/dist-es/models/index.js +0 -1
  29. package/dist-es/models/models_0.js +0 -1
  30. package/dist-es/pagination/DescribeHomeRegionControlsPaginator.js +0 -1
  31. package/dist-es/pagination/Interfaces.js +0 -1
  32. package/dist-es/pagination/index.js +2 -0
  33. package/dist-es/protocols/Aws_json1_1.js +0 -1
  34. package/dist-es/runtimeConfig.browser.js +1 -2
  35. package/dist-es/runtimeConfig.js +2 -3
  36. package/dist-es/runtimeConfig.native.js +0 -1
  37. package/dist-es/runtimeConfig.shared.js +0 -1
  38. package/dist-types/commands/index.d.ts +3 -0
  39. package/dist-types/index.d.ts +4 -7
  40. package/dist-types/pagination/index.d.ts +2 -0
  41. package/dist-types/ts3.4/MigrationHubConfig.d.ts +4 -42
  42. package/dist-types/ts3.4/MigrationHubConfigClient.d.ts +24 -114
  43. package/dist-types/ts3.4/commands/CreateHomeRegionControlCommand.d.ts +2 -20
  44. package/dist-types/ts3.4/commands/DescribeHomeRegionControlsCommand.d.ts +2 -21
  45. package/dist-types/ts3.4/commands/GetHomeRegionCommand.d.ts +2 -24
  46. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  47. package/dist-types/ts3.4/index.d.ts +4 -7
  48. package/dist-types/ts3.4/models/models_0.d.ts +41 -147
  49. package/dist-types/ts3.4/pagination/index.d.ts +2 -0
  50. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -3
  51. package/dist-types/ts3.4/runtimeConfig.d.ts +1 -3
  52. package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -3
  53. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +1 -3
  54. package/package.json +33 -30
  55. package/dist-cjs/MigrationHubConfig.js.map +0 -1
  56. package/dist-cjs/MigrationHubConfigClient.js.map +0 -1
  57. package/dist-cjs/commands/CreateHomeRegionControlCommand.js.map +0 -1
  58. package/dist-cjs/commands/DescribeHomeRegionControlsCommand.js.map +0 -1
  59. package/dist-cjs/commands/GetHomeRegionCommand.js.map +0 -1
  60. package/dist-cjs/endpoints.js.map +0 -1
  61. package/dist-cjs/index.js.map +0 -1
  62. package/dist-cjs/models/index.js.map +0 -1
  63. package/dist-cjs/models/models_0.js.map +0 -1
  64. package/dist-cjs/pagination/DescribeHomeRegionControlsPaginator.js.map +0 -1
  65. package/dist-cjs/pagination/Interfaces.js.map +0 -1
  66. package/dist-cjs/protocols/Aws_json1_1.js.map +0 -1
  67. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  68. package/dist-cjs/runtimeConfig.js.map +0 -1
  69. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  70. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  71. package/dist-es/MigrationHubConfig.js.map +0 -1
  72. package/dist-es/MigrationHubConfigClient.js.map +0 -1
  73. package/dist-es/commands/CreateHomeRegionControlCommand.js.map +0 -1
  74. package/dist-es/commands/DescribeHomeRegionControlsCommand.js.map +0 -1
  75. package/dist-es/commands/GetHomeRegionCommand.js.map +0 -1
  76. package/dist-es/endpoints.js.map +0 -1
  77. package/dist-es/index.js.map +0 -1
  78. package/dist-es/models/index.js.map +0 -1
  79. package/dist-es/models/models_0.js.map +0 -1
  80. package/dist-es/pagination/DescribeHomeRegionControlsPaginator.js.map +0 -1
  81. package/dist-es/pagination/Interfaces.js.map +0 -1
  82. package/dist-es/protocols/Aws_json1_1.js.map +0 -1
  83. package/dist-es/runtimeConfig.browser.js.map +0 -1
  84. package/dist-es/runtimeConfig.js.map +0 -1
  85. package/dist-es/runtimeConfig.native.js.map +0 -1
  86. package/dist-es/runtimeConfig.shared.js.map +0 -1
  87. package/jest.config.js +0 -4
  88. package/src/MigrationHubConfig.ts +0 -149
  89. package/src/MigrationHubConfigClient.ts +0 -276
  90. package/src/commands/CreateHomeRegionControlCommand.ts +0 -99
  91. package/src/commands/DescribeHomeRegionControlsCommand.ts +0 -103
  92. package/src/commands/GetHomeRegionCommand.ts +0 -103
  93. package/src/endpoints.ts +0 -57
  94. package/src/index.ts +0 -8
  95. package/src/models/index.ts +0 -1
  96. package/src/models/models_0.ts +0 -325
  97. package/src/pagination/DescribeHomeRegionControlsPaginator.ts +0 -59
  98. package/src/pagination/Interfaces.ts +0 -8
  99. package/src/protocols/Aws_json1_1.ts +0 -663
  100. package/src/runtimeConfig.browser.ts +0 -41
  101. package/src/runtimeConfig.native.ts +0 -17
  102. package/src/runtimeConfig.shared.ts +0 -17
  103. package/src/runtimeConfig.ts +0 -46
  104. package/tsconfig.es.json +0 -10
  105. package/tsconfig.json +0 -33
  106. package/tsconfig.types.json +0 -9
@@ -1,663 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import {
3
- expectInt32 as __expectInt32,
4
- expectNonNull as __expectNonNull,
5
- expectNumber as __expectNumber,
6
- expectString as __expectString,
7
- parseEpochTimestamp as __parseEpochTimestamp,
8
- } from "@aws-sdk/smithy-client";
9
- import {
10
- Endpoint as __Endpoint,
11
- HeaderBag as __HeaderBag,
12
- MetadataBearer as __MetadataBearer,
13
- ResponseMetadata as __ResponseMetadata,
14
- SerdeContext as __SerdeContext,
15
- SmithyException as __SmithyException,
16
- } from "@aws-sdk/types";
17
-
18
- import {
19
- CreateHomeRegionControlCommandInput,
20
- CreateHomeRegionControlCommandOutput,
21
- } from "../commands/CreateHomeRegionControlCommand";
22
- import {
23
- DescribeHomeRegionControlsCommandInput,
24
- DescribeHomeRegionControlsCommandOutput,
25
- } from "../commands/DescribeHomeRegionControlsCommand";
26
- import { GetHomeRegionCommandInput, GetHomeRegionCommandOutput } from "../commands/GetHomeRegionCommand";
27
- import {
28
- AccessDeniedException,
29
- CreateHomeRegionControlRequest,
30
- CreateHomeRegionControlResult,
31
- DescribeHomeRegionControlsRequest,
32
- DescribeHomeRegionControlsResult,
33
- DryRunOperation,
34
- GetHomeRegionRequest,
35
- GetHomeRegionResult,
36
- HomeRegionControl,
37
- InternalServerError,
38
- InvalidInputException,
39
- ServiceUnavailableException,
40
- Target,
41
- ThrottlingException,
42
- } from "../models/models_0";
43
-
44
- export const serializeAws_json1_1CreateHomeRegionControlCommand = async (
45
- input: CreateHomeRegionControlCommandInput,
46
- context: __SerdeContext
47
- ): Promise<__HttpRequest> => {
48
- const headers: __HeaderBag = {
49
- "content-type": "application/x-amz-json-1.1",
50
- "x-amz-target": "AWSMigrationHubMultiAccountService.CreateHomeRegionControl",
51
- };
52
- let body: any;
53
- body = JSON.stringify(serializeAws_json1_1CreateHomeRegionControlRequest(input, context));
54
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
55
- };
56
-
57
- export const serializeAws_json1_1DescribeHomeRegionControlsCommand = async (
58
- input: DescribeHomeRegionControlsCommandInput,
59
- context: __SerdeContext
60
- ): Promise<__HttpRequest> => {
61
- const headers: __HeaderBag = {
62
- "content-type": "application/x-amz-json-1.1",
63
- "x-amz-target": "AWSMigrationHubMultiAccountService.DescribeHomeRegionControls",
64
- };
65
- let body: any;
66
- body = JSON.stringify(serializeAws_json1_1DescribeHomeRegionControlsRequest(input, context));
67
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
68
- };
69
-
70
- export const serializeAws_json1_1GetHomeRegionCommand = async (
71
- input: GetHomeRegionCommandInput,
72
- context: __SerdeContext
73
- ): Promise<__HttpRequest> => {
74
- const headers: __HeaderBag = {
75
- "content-type": "application/x-amz-json-1.1",
76
- "x-amz-target": "AWSMigrationHubMultiAccountService.GetHomeRegion",
77
- };
78
- let body: any;
79
- body = JSON.stringify(serializeAws_json1_1GetHomeRegionRequest(input, context));
80
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
81
- };
82
-
83
- export const deserializeAws_json1_1CreateHomeRegionControlCommand = async (
84
- output: __HttpResponse,
85
- context: __SerdeContext
86
- ): Promise<CreateHomeRegionControlCommandOutput> => {
87
- if (output.statusCode >= 300) {
88
- return deserializeAws_json1_1CreateHomeRegionControlCommandError(output, context);
89
- }
90
- const data: any = await parseBody(output.body, context);
91
- let contents: any = {};
92
- contents = deserializeAws_json1_1CreateHomeRegionControlResult(data, context);
93
- const response: CreateHomeRegionControlCommandOutput = {
94
- $metadata: deserializeMetadata(output),
95
- ...contents,
96
- };
97
- return Promise.resolve(response);
98
- };
99
-
100
- const deserializeAws_json1_1CreateHomeRegionControlCommandError = async (
101
- output: __HttpResponse,
102
- context: __SerdeContext
103
- ): Promise<CreateHomeRegionControlCommandOutput> => {
104
- const parsedOutput: any = {
105
- ...output,
106
- body: await parseBody(output.body, context),
107
- };
108
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
109
- let errorCode = "UnknownError";
110
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
111
- switch (errorCode) {
112
- case "AccessDeniedException":
113
- case "com.amazonaws.migrationhubconfig#AccessDeniedException":
114
- response = {
115
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
116
- name: errorCode,
117
- $metadata: deserializeMetadata(output),
118
- };
119
- break;
120
- case "DryRunOperation":
121
- case "com.amazonaws.migrationhubconfig#DryRunOperation":
122
- response = {
123
- ...(await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)),
124
- name: errorCode,
125
- $metadata: deserializeMetadata(output),
126
- };
127
- break;
128
- case "InternalServerError":
129
- case "com.amazonaws.migrationhubconfig#InternalServerError":
130
- response = {
131
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
132
- name: errorCode,
133
- $metadata: deserializeMetadata(output),
134
- };
135
- break;
136
- case "InvalidInputException":
137
- case "com.amazonaws.migrationhubconfig#InvalidInputException":
138
- response = {
139
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
140
- name: errorCode,
141
- $metadata: deserializeMetadata(output),
142
- };
143
- break;
144
- case "ServiceUnavailableException":
145
- case "com.amazonaws.migrationhubconfig#ServiceUnavailableException":
146
- response = {
147
- ...(await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)),
148
- name: errorCode,
149
- $metadata: deserializeMetadata(output),
150
- };
151
- break;
152
- case "ThrottlingException":
153
- case "com.amazonaws.migrationhubconfig#ThrottlingException":
154
- response = {
155
- ...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
156
- name: errorCode,
157
- $metadata: deserializeMetadata(output),
158
- };
159
- break;
160
- default:
161
- const parsedBody = parsedOutput.body;
162
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
163
- response = {
164
- ...parsedBody,
165
- name: `${errorCode}`,
166
- message: parsedBody.message || parsedBody.Message || errorCode,
167
- $fault: "client",
168
- $metadata: deserializeMetadata(output),
169
- } as any;
170
- }
171
- const message = response.message || response.Message || errorCode;
172
- response.message = message;
173
- delete response.Message;
174
- return Promise.reject(Object.assign(new Error(message), response));
175
- };
176
-
177
- export const deserializeAws_json1_1DescribeHomeRegionControlsCommand = async (
178
- output: __HttpResponse,
179
- context: __SerdeContext
180
- ): Promise<DescribeHomeRegionControlsCommandOutput> => {
181
- if (output.statusCode >= 300) {
182
- return deserializeAws_json1_1DescribeHomeRegionControlsCommandError(output, context);
183
- }
184
- const data: any = await parseBody(output.body, context);
185
- let contents: any = {};
186
- contents = deserializeAws_json1_1DescribeHomeRegionControlsResult(data, context);
187
- const response: DescribeHomeRegionControlsCommandOutput = {
188
- $metadata: deserializeMetadata(output),
189
- ...contents,
190
- };
191
- return Promise.resolve(response);
192
- };
193
-
194
- const deserializeAws_json1_1DescribeHomeRegionControlsCommandError = async (
195
- output: __HttpResponse,
196
- context: __SerdeContext
197
- ): Promise<DescribeHomeRegionControlsCommandOutput> => {
198
- const parsedOutput: any = {
199
- ...output,
200
- body: await parseBody(output.body, context),
201
- };
202
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
203
- let errorCode = "UnknownError";
204
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
205
- switch (errorCode) {
206
- case "AccessDeniedException":
207
- case "com.amazonaws.migrationhubconfig#AccessDeniedException":
208
- response = {
209
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
210
- name: errorCode,
211
- $metadata: deserializeMetadata(output),
212
- };
213
- break;
214
- case "InternalServerError":
215
- case "com.amazonaws.migrationhubconfig#InternalServerError":
216
- response = {
217
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
218
- name: errorCode,
219
- $metadata: deserializeMetadata(output),
220
- };
221
- break;
222
- case "InvalidInputException":
223
- case "com.amazonaws.migrationhubconfig#InvalidInputException":
224
- response = {
225
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
226
- name: errorCode,
227
- $metadata: deserializeMetadata(output),
228
- };
229
- break;
230
- case "ServiceUnavailableException":
231
- case "com.amazonaws.migrationhubconfig#ServiceUnavailableException":
232
- response = {
233
- ...(await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)),
234
- name: errorCode,
235
- $metadata: deserializeMetadata(output),
236
- };
237
- break;
238
- case "ThrottlingException":
239
- case "com.amazonaws.migrationhubconfig#ThrottlingException":
240
- response = {
241
- ...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
242
- name: errorCode,
243
- $metadata: deserializeMetadata(output),
244
- };
245
- break;
246
- default:
247
- const parsedBody = parsedOutput.body;
248
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
249
- response = {
250
- ...parsedBody,
251
- name: `${errorCode}`,
252
- message: parsedBody.message || parsedBody.Message || errorCode,
253
- $fault: "client",
254
- $metadata: deserializeMetadata(output),
255
- } as any;
256
- }
257
- const message = response.message || response.Message || errorCode;
258
- response.message = message;
259
- delete response.Message;
260
- return Promise.reject(Object.assign(new Error(message), response));
261
- };
262
-
263
- export const deserializeAws_json1_1GetHomeRegionCommand = async (
264
- output: __HttpResponse,
265
- context: __SerdeContext
266
- ): Promise<GetHomeRegionCommandOutput> => {
267
- if (output.statusCode >= 300) {
268
- return deserializeAws_json1_1GetHomeRegionCommandError(output, context);
269
- }
270
- const data: any = await parseBody(output.body, context);
271
- let contents: any = {};
272
- contents = deserializeAws_json1_1GetHomeRegionResult(data, context);
273
- const response: GetHomeRegionCommandOutput = {
274
- $metadata: deserializeMetadata(output),
275
- ...contents,
276
- };
277
- return Promise.resolve(response);
278
- };
279
-
280
- const deserializeAws_json1_1GetHomeRegionCommandError = async (
281
- output: __HttpResponse,
282
- context: __SerdeContext
283
- ): Promise<GetHomeRegionCommandOutput> => {
284
- const parsedOutput: any = {
285
- ...output,
286
- body: await parseBody(output.body, context),
287
- };
288
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
289
- let errorCode = "UnknownError";
290
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
291
- switch (errorCode) {
292
- case "AccessDeniedException":
293
- case "com.amazonaws.migrationhubconfig#AccessDeniedException":
294
- response = {
295
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
296
- name: errorCode,
297
- $metadata: deserializeMetadata(output),
298
- };
299
- break;
300
- case "InternalServerError":
301
- case "com.amazonaws.migrationhubconfig#InternalServerError":
302
- response = {
303
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
304
- name: errorCode,
305
- $metadata: deserializeMetadata(output),
306
- };
307
- break;
308
- case "InvalidInputException":
309
- case "com.amazonaws.migrationhubconfig#InvalidInputException":
310
- response = {
311
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
312
- name: errorCode,
313
- $metadata: deserializeMetadata(output),
314
- };
315
- break;
316
- case "ServiceUnavailableException":
317
- case "com.amazonaws.migrationhubconfig#ServiceUnavailableException":
318
- response = {
319
- ...(await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)),
320
- name: errorCode,
321
- $metadata: deserializeMetadata(output),
322
- };
323
- break;
324
- case "ThrottlingException":
325
- case "com.amazonaws.migrationhubconfig#ThrottlingException":
326
- response = {
327
- ...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
328
- name: errorCode,
329
- $metadata: deserializeMetadata(output),
330
- };
331
- break;
332
- default:
333
- const parsedBody = parsedOutput.body;
334
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
335
- response = {
336
- ...parsedBody,
337
- name: `${errorCode}`,
338
- message: parsedBody.message || parsedBody.Message || errorCode,
339
- $fault: "client",
340
- $metadata: deserializeMetadata(output),
341
- } as any;
342
- }
343
- const message = response.message || response.Message || errorCode;
344
- response.message = message;
345
- delete response.Message;
346
- return Promise.reject(Object.assign(new Error(message), response));
347
- };
348
-
349
- const deserializeAws_json1_1AccessDeniedExceptionResponse = async (
350
- parsedOutput: any,
351
- context: __SerdeContext
352
- ): Promise<AccessDeniedException> => {
353
- const body = parsedOutput.body;
354
- const deserialized: any = deserializeAws_json1_1AccessDeniedException(body, context);
355
- const contents: AccessDeniedException = {
356
- name: "AccessDeniedException",
357
- $fault: "client",
358
- $metadata: deserializeMetadata(parsedOutput),
359
- ...deserialized,
360
- };
361
- return contents;
362
- };
363
-
364
- const deserializeAws_json1_1DryRunOperationResponse = async (
365
- parsedOutput: any,
366
- context: __SerdeContext
367
- ): Promise<DryRunOperation> => {
368
- const body = parsedOutput.body;
369
- const deserialized: any = deserializeAws_json1_1DryRunOperation(body, context);
370
- const contents: DryRunOperation = {
371
- name: "DryRunOperation",
372
- $fault: "client",
373
- $metadata: deserializeMetadata(parsedOutput),
374
- ...deserialized,
375
- };
376
- return contents;
377
- };
378
-
379
- const deserializeAws_json1_1InternalServerErrorResponse = async (
380
- parsedOutput: any,
381
- context: __SerdeContext
382
- ): Promise<InternalServerError> => {
383
- const body = parsedOutput.body;
384
- const deserialized: any = deserializeAws_json1_1InternalServerError(body, context);
385
- const contents: InternalServerError = {
386
- name: "InternalServerError",
387
- $fault: "server",
388
- $metadata: deserializeMetadata(parsedOutput),
389
- ...deserialized,
390
- };
391
- return contents;
392
- };
393
-
394
- const deserializeAws_json1_1InvalidInputExceptionResponse = async (
395
- parsedOutput: any,
396
- context: __SerdeContext
397
- ): Promise<InvalidInputException> => {
398
- const body = parsedOutput.body;
399
- const deserialized: any = deserializeAws_json1_1InvalidInputException(body, context);
400
- const contents: InvalidInputException = {
401
- name: "InvalidInputException",
402
- $fault: "client",
403
- $metadata: deserializeMetadata(parsedOutput),
404
- ...deserialized,
405
- };
406
- return contents;
407
- };
408
-
409
- const deserializeAws_json1_1ServiceUnavailableExceptionResponse = async (
410
- parsedOutput: any,
411
- context: __SerdeContext
412
- ): Promise<ServiceUnavailableException> => {
413
- const body = parsedOutput.body;
414
- const deserialized: any = deserializeAws_json1_1ServiceUnavailableException(body, context);
415
- const contents: ServiceUnavailableException = {
416
- name: "ServiceUnavailableException",
417
- $fault: "server",
418
- $metadata: deserializeMetadata(parsedOutput),
419
- ...deserialized,
420
- };
421
- return contents;
422
- };
423
-
424
- const deserializeAws_json1_1ThrottlingExceptionResponse = async (
425
- parsedOutput: any,
426
- context: __SerdeContext
427
- ): Promise<ThrottlingException> => {
428
- const body = parsedOutput.body;
429
- const deserialized: any = deserializeAws_json1_1ThrottlingException(body, context);
430
- const contents: ThrottlingException = {
431
- name: "ThrottlingException",
432
- $fault: "client",
433
- $metadata: deserializeMetadata(parsedOutput),
434
- ...deserialized,
435
- };
436
- return contents;
437
- };
438
-
439
- const serializeAws_json1_1CreateHomeRegionControlRequest = (
440
- input: CreateHomeRegionControlRequest,
441
- context: __SerdeContext
442
- ): any => {
443
- return {
444
- ...(input.DryRun !== undefined && input.DryRun !== null && { DryRun: input.DryRun }),
445
- ...(input.HomeRegion !== undefined && input.HomeRegion !== null && { HomeRegion: input.HomeRegion }),
446
- ...(input.Target !== undefined &&
447
- input.Target !== null && { Target: serializeAws_json1_1Target(input.Target, context) }),
448
- };
449
- };
450
-
451
- const serializeAws_json1_1DescribeHomeRegionControlsRequest = (
452
- input: DescribeHomeRegionControlsRequest,
453
- context: __SerdeContext
454
- ): any => {
455
- return {
456
- ...(input.ControlId !== undefined && input.ControlId !== null && { ControlId: input.ControlId }),
457
- ...(input.HomeRegion !== undefined && input.HomeRegion !== null && { HomeRegion: input.HomeRegion }),
458
- ...(input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults }),
459
- ...(input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }),
460
- ...(input.Target !== undefined &&
461
- input.Target !== null && { Target: serializeAws_json1_1Target(input.Target, context) }),
462
- };
463
- };
464
-
465
- const serializeAws_json1_1GetHomeRegionRequest = (input: GetHomeRegionRequest, context: __SerdeContext): any => {
466
- return {};
467
- };
468
-
469
- const serializeAws_json1_1Target = (input: Target, context: __SerdeContext): any => {
470
- return {
471
- ...(input.Id !== undefined && input.Id !== null && { Id: input.Id }),
472
- ...(input.Type !== undefined && input.Type !== null && { Type: input.Type }),
473
- };
474
- };
475
-
476
- const deserializeAws_json1_1AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => {
477
- return {
478
- Message: __expectString(output.Message),
479
- } as any;
480
- };
481
-
482
- const deserializeAws_json1_1CreateHomeRegionControlResult = (
483
- output: any,
484
- context: __SerdeContext
485
- ): CreateHomeRegionControlResult => {
486
- return {
487
- HomeRegionControl:
488
- output.HomeRegionControl !== undefined && output.HomeRegionControl !== null
489
- ? deserializeAws_json1_1HomeRegionControl(output.HomeRegionControl, context)
490
- : undefined,
491
- } as any;
492
- };
493
-
494
- const deserializeAws_json1_1DescribeHomeRegionControlsResult = (
495
- output: any,
496
- context: __SerdeContext
497
- ): DescribeHomeRegionControlsResult => {
498
- return {
499
- HomeRegionControls:
500
- output.HomeRegionControls !== undefined && output.HomeRegionControls !== null
501
- ? deserializeAws_json1_1HomeRegionControls(output.HomeRegionControls, context)
502
- : undefined,
503
- NextToken: __expectString(output.NextToken),
504
- } as any;
505
- };
506
-
507
- const deserializeAws_json1_1DryRunOperation = (output: any, context: __SerdeContext): DryRunOperation => {
508
- return {
509
- Message: __expectString(output.Message),
510
- } as any;
511
- };
512
-
513
- const deserializeAws_json1_1GetHomeRegionResult = (output: any, context: __SerdeContext): GetHomeRegionResult => {
514
- return {
515
- HomeRegion: __expectString(output.HomeRegion),
516
- } as any;
517
- };
518
-
519
- const deserializeAws_json1_1HomeRegionControl = (output: any, context: __SerdeContext): HomeRegionControl => {
520
- return {
521
- ControlId: __expectString(output.ControlId),
522
- HomeRegion: __expectString(output.HomeRegion),
523
- RequestedTime:
524
- output.RequestedTime !== undefined && output.RequestedTime !== null
525
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.RequestedTime)))
526
- : undefined,
527
- Target:
528
- output.Target !== undefined && output.Target !== null
529
- ? deserializeAws_json1_1Target(output.Target, context)
530
- : undefined,
531
- } as any;
532
- };
533
-
534
- const deserializeAws_json1_1HomeRegionControls = (output: any, context: __SerdeContext): HomeRegionControl[] => {
535
- return (output || [])
536
- .filter((e: any) => e != null)
537
- .map((entry: any) => {
538
- if (entry === null) {
539
- return null as any;
540
- }
541
- return deserializeAws_json1_1HomeRegionControl(entry, context);
542
- });
543
- };
544
-
545
- const deserializeAws_json1_1InternalServerError = (output: any, context: __SerdeContext): InternalServerError => {
546
- return {
547
- Message: __expectString(output.Message),
548
- } as any;
549
- };
550
-
551
- const deserializeAws_json1_1InvalidInputException = (output: any, context: __SerdeContext): InvalidInputException => {
552
- return {
553
- Message: __expectString(output.Message),
554
- } as any;
555
- };
556
-
557
- const deserializeAws_json1_1ServiceUnavailableException = (
558
- output: any,
559
- context: __SerdeContext
560
- ): ServiceUnavailableException => {
561
- return {
562
- Message: __expectString(output.Message),
563
- } as any;
564
- };
565
-
566
- const deserializeAws_json1_1Target = (output: any, context: __SerdeContext): Target => {
567
- return {
568
- Id: __expectString(output.Id),
569
- Type: __expectString(output.Type),
570
- } as any;
571
- };
572
-
573
- const deserializeAws_json1_1ThrottlingException = (output: any, context: __SerdeContext): ThrottlingException => {
574
- return {
575
- Message: __expectString(output.Message),
576
- RetryAfterSeconds: __expectInt32(output.RetryAfterSeconds),
577
- } as any;
578
- };
579
-
580
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
581
- httpStatusCode: output.statusCode,
582
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
583
- extendedRequestId: output.headers["x-amz-id-2"],
584
- cfId: output.headers["x-amz-cf-id"],
585
- });
586
-
587
- // Collect low-level response body stream to Uint8Array.
588
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
589
- if (streamBody instanceof Uint8Array) {
590
- return Promise.resolve(streamBody);
591
- }
592
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
593
- };
594
-
595
- // Encode Uint8Array data into string with utf-8.
596
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
597
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
598
-
599
- const buildHttpRpcRequest = async (
600
- context: __SerdeContext,
601
- headers: __HeaderBag,
602
- path: string,
603
- resolvedHostname: string | undefined,
604
- body: any
605
- ): Promise<__HttpRequest> => {
606
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
607
- const contents: any = {
608
- protocol,
609
- hostname,
610
- port,
611
- method: "POST",
612
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
613
- headers,
614
- };
615
- if (resolvedHostname !== undefined) {
616
- contents.hostname = resolvedHostname;
617
- }
618
- if (body !== undefined) {
619
- contents.body = body;
620
- }
621
- return new __HttpRequest(contents);
622
- };
623
-
624
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
625
- collectBodyString(streamBody, context).then((encoded) => {
626
- if (encoded.length) {
627
- return JSON.parse(encoded);
628
- }
629
- return {};
630
- });
631
-
632
- /**
633
- * Load an error code for the aws.rest-json-1.1 protocol.
634
- */
635
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
636
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
637
-
638
- const sanitizeErrorCode = (rawValue: string): string => {
639
- let cleanValue = rawValue;
640
- if (cleanValue.indexOf(":") >= 0) {
641
- cleanValue = cleanValue.split(":")[0];
642
- }
643
- if (cleanValue.indexOf("#") >= 0) {
644
- cleanValue = cleanValue.split("#")[1];
645
- }
646
- return cleanValue;
647
- };
648
-
649
- const headerKey = findKey(output.headers, "x-amzn-errortype");
650
- if (headerKey !== undefined) {
651
- return sanitizeErrorCode(output.headers[headerKey]);
652
- }
653
-
654
- if (data.code !== undefined) {
655
- return sanitizeErrorCode(data.code);
656
- }
657
-
658
- if (data["__type"] !== undefined) {
659
- return sanitizeErrorCode(data["__type"]);
660
- }
661
-
662
- return "";
663
- };
@@ -1,41 +0,0 @@
1
- import { Sha256 } from "@aws-crypto/sha256-browser";
2
- import { FetchHttpHandler, streamCollector } from "@aws-sdk/fetch-http-handler";
3
- import { invalidProvider } from "@aws-sdk/invalid-dependency";
4
- import { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE } from "@aws-sdk/middleware-retry";
5
- import { fromBase64, toBase64 } from "@aws-sdk/util-base64-browser";
6
- import { calculateBodyLength } from "@aws-sdk/util-body-length-browser";
7
- import { defaultUserAgent } from "@aws-sdk/util-user-agent-browser";
8
- import { fromUtf8, toUtf8 } from "@aws-sdk/util-utf8-browser";
9
-
10
- // @ts-ignore: package.json will be imported from dist folders
11
- import packageInfo from "../package.json";
12
- import { MigrationHubConfigClientConfig } from "./MigrationHubConfigClient";
13
- import { getRuntimeConfig as getSharedRuntimeConfig } from "./runtimeConfig.shared";
14
-
15
- /**
16
- * @internal
17
- */
18
- export const getRuntimeConfig = (config: MigrationHubConfigClientConfig) => {
19
- const clientSharedValues = getSharedRuntimeConfig(config);
20
- return {
21
- ...clientSharedValues,
22
- ...config,
23
- runtime: "browser",
24
- base64Decoder: config?.base64Decoder ?? fromBase64,
25
- base64Encoder: config?.base64Encoder ?? toBase64,
26
- bodyLengthChecker: config?.bodyLengthChecker ?? calculateBodyLength,
27
- credentialDefaultProvider:
28
- config?.credentialDefaultProvider ?? ((_: unknown) => () => Promise.reject(new Error("Credential is missing"))),
29
- defaultUserAgentProvider:
30
- config?.defaultUserAgentProvider ??
31
- defaultUserAgent({ serviceId: clientSharedValues.serviceId, clientVersion: packageInfo.version }),
32
- maxAttempts: config?.maxAttempts ?? DEFAULT_MAX_ATTEMPTS,
33
- region: config?.region ?? invalidProvider("Region is missing"),
34
- requestHandler: config?.requestHandler ?? new FetchHttpHandler(),
35
- retryMode: config?.retryMode ?? (() => Promise.resolve(DEFAULT_RETRY_MODE)),
36
- sha256: config?.sha256 ?? Sha256,
37
- streamCollector: config?.streamCollector ?? streamCollector,
38
- utf8Decoder: config?.utf8Decoder ?? fromUtf8,
39
- utf8Encoder: config?.utf8Encoder ?? toUtf8,
40
- };
41
- };