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