@aws-sdk/client-migrationhub-config 3.312.0 → 3.316.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.
@@ -1,52 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.MigrationHubConfig = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
4
5
  const CreateHomeRegionControlCommand_1 = require("./commands/CreateHomeRegionControlCommand");
5
6
  const DescribeHomeRegionControlsCommand_1 = require("./commands/DescribeHomeRegionControlsCommand");
6
7
  const GetHomeRegionCommand_1 = require("./commands/GetHomeRegionCommand");
7
8
  const MigrationHubConfigClient_1 = require("./MigrationHubConfigClient");
9
+ const commands = {
10
+ CreateHomeRegionControlCommand: CreateHomeRegionControlCommand_1.CreateHomeRegionControlCommand,
11
+ DescribeHomeRegionControlsCommand: DescribeHomeRegionControlsCommand_1.DescribeHomeRegionControlsCommand,
12
+ GetHomeRegionCommand: GetHomeRegionCommand_1.GetHomeRegionCommand,
13
+ };
8
14
  class MigrationHubConfig extends MigrationHubConfigClient_1.MigrationHubConfigClient {
9
- createHomeRegionControl(args, optionsOrCb, cb) {
10
- const command = new CreateHomeRegionControlCommand_1.CreateHomeRegionControlCommand(args);
11
- if (typeof optionsOrCb === "function") {
12
- this.send(command, optionsOrCb);
13
- }
14
- else if (typeof cb === "function") {
15
- if (typeof optionsOrCb !== "object")
16
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
17
- this.send(command, optionsOrCb || {}, cb);
18
- }
19
- else {
20
- return this.send(command, optionsOrCb);
21
- }
22
- }
23
- describeHomeRegionControls(args, optionsOrCb, cb) {
24
- const command = new DescribeHomeRegionControlsCommand_1.DescribeHomeRegionControlsCommand(args);
25
- if (typeof optionsOrCb === "function") {
26
- this.send(command, optionsOrCb);
27
- }
28
- else if (typeof cb === "function") {
29
- if (typeof optionsOrCb !== "object")
30
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
31
- this.send(command, optionsOrCb || {}, cb);
32
- }
33
- else {
34
- return this.send(command, optionsOrCb);
35
- }
36
- }
37
- getHomeRegion(args, optionsOrCb, cb) {
38
- const command = new GetHomeRegionCommand_1.GetHomeRegionCommand(args);
39
- if (typeof optionsOrCb === "function") {
40
- this.send(command, optionsOrCb);
41
- }
42
- else if (typeof cb === "function") {
43
- if (typeof optionsOrCb !== "object")
44
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
45
- this.send(command, optionsOrCb || {}, cb);
46
- }
47
- else {
48
- return this.send(command, optionsOrCb);
49
- }
50
- }
51
15
  }
52
16
  exports.MigrationHubConfig = MigrationHubConfig;
17
+ (0, smithy_client_1.createAggregatedClient)(commands, MigrationHubConfig);
@@ -8,21 +8,21 @@ const models_0_1 = require("../models/models_0");
8
8
  const se_CreateHomeRegionControlCommand = async (input, context) => {
9
9
  const headers = sharedHeaders("CreateHomeRegionControl");
10
10
  let body;
11
- body = JSON.stringify(se_CreateHomeRegionControlRequest(input, context));
11
+ body = JSON.stringify((0, smithy_client_1._json)(input));
12
12
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
13
  };
14
14
  exports.se_CreateHomeRegionControlCommand = se_CreateHomeRegionControlCommand;
15
15
  const se_DescribeHomeRegionControlsCommand = async (input, context) => {
16
16
  const headers = sharedHeaders("DescribeHomeRegionControls");
17
17
  let body;
18
- body = JSON.stringify(se_DescribeHomeRegionControlsRequest(input, context));
18
+ body = JSON.stringify((0, smithy_client_1._json)(input));
19
19
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
20
  };
21
21
  exports.se_DescribeHomeRegionControlsCommand = se_DescribeHomeRegionControlsCommand;
22
22
  const se_GetHomeRegionCommand = async (input, context) => {
23
23
  const headers = sharedHeaders("GetHomeRegion");
24
24
  let body;
25
- body = JSON.stringify(se_GetHomeRegionRequest(input, context));
25
+ body = JSON.stringify((0, smithy_client_1._json)(input));
26
26
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
27
27
  };
28
28
  exports.se_GetHomeRegionCommand = se_GetHomeRegionCommand;
@@ -37,7 +37,7 @@ const de_CreateHomeRegionControlCommand = async (output, context) => {
37
37
  $metadata: deserializeMetadata(output),
38
38
  ...contents,
39
39
  };
40
- return Promise.resolve(response);
40
+ return response;
41
41
  };
42
42
  exports.de_CreateHomeRegionControlCommand = de_CreateHomeRegionControlCommand;
43
43
  const de_CreateHomeRegionControlCommandError = async (output, context) => {
@@ -67,10 +67,9 @@ const de_CreateHomeRegionControlCommandError = async (output, context) => {
67
67
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
68
68
  default:
69
69
  const parsedBody = parsedOutput.body;
70
- (0, smithy_client_1.throwDefaultError)({
70
+ return throwDefaultError({
71
71
  output,
72
72
  parsedBody,
73
- exceptionCtor: MigrationHubConfigServiceException_1.MigrationHubConfigServiceException,
74
73
  errorCode,
75
74
  });
76
75
  }
@@ -86,7 +85,7 @@ const de_DescribeHomeRegionControlsCommand = async (output, context) => {
86
85
  $metadata: deserializeMetadata(output),
87
86
  ...contents,
88
87
  };
89
- return Promise.resolve(response);
88
+ return response;
90
89
  };
91
90
  exports.de_DescribeHomeRegionControlsCommand = de_DescribeHomeRegionControlsCommand;
92
91
  const de_DescribeHomeRegionControlsCommandError = async (output, context) => {
@@ -113,10 +112,9 @@ const de_DescribeHomeRegionControlsCommandError = async (output, context) => {
113
112
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
114
113
  default:
115
114
  const parsedBody = parsedOutput.body;
116
- (0, smithy_client_1.throwDefaultError)({
115
+ return throwDefaultError({
117
116
  output,
118
117
  parsedBody,
119
- exceptionCtor: MigrationHubConfigServiceException_1.MigrationHubConfigServiceException,
120
118
  errorCode,
121
119
  });
122
120
  }
@@ -127,12 +125,12 @@ const de_GetHomeRegionCommand = async (output, context) => {
127
125
  }
128
126
  const data = await parseBody(output.body, context);
129
127
  let contents = {};
130
- contents = de_GetHomeRegionResult(data, context);
128
+ contents = (0, smithy_client_1._json)(data);
131
129
  const response = {
132
130
  $metadata: deserializeMetadata(output),
133
131
  ...contents,
134
132
  };
135
- return Promise.resolve(response);
133
+ return response;
136
134
  };
137
135
  exports.de_GetHomeRegionCommand = de_GetHomeRegionCommand;
138
136
  const de_GetHomeRegionCommandError = async (output, context) => {
@@ -159,17 +157,16 @@ const de_GetHomeRegionCommandError = async (output, context) => {
159
157
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
160
158
  default:
161
159
  const parsedBody = parsedOutput.body;
162
- (0, smithy_client_1.throwDefaultError)({
160
+ return throwDefaultError({
163
161
  output,
164
162
  parsedBody,
165
- exceptionCtor: MigrationHubConfigServiceException_1.MigrationHubConfigServiceException,
166
163
  errorCode,
167
164
  });
168
165
  }
169
166
  };
170
167
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
171
168
  const body = parsedOutput.body;
172
- const deserialized = de_AccessDeniedException(body, context);
169
+ const deserialized = (0, smithy_client_1._json)(body);
173
170
  const exception = new models_0_1.AccessDeniedException({
174
171
  $metadata: deserializeMetadata(parsedOutput),
175
172
  ...deserialized,
@@ -178,7 +175,7 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
178
175
  };
179
176
  const de_DryRunOperationRes = async (parsedOutput, context) => {
180
177
  const body = parsedOutput.body;
181
- const deserialized = de_DryRunOperation(body, context);
178
+ const deserialized = (0, smithy_client_1._json)(body);
182
179
  const exception = new models_0_1.DryRunOperation({
183
180
  $metadata: deserializeMetadata(parsedOutput),
184
181
  ...deserialized,
@@ -187,7 +184,7 @@ const de_DryRunOperationRes = async (parsedOutput, context) => {
187
184
  };
188
185
  const de_InternalServerErrorRes = async (parsedOutput, context) => {
189
186
  const body = parsedOutput.body;
190
- const deserialized = de_InternalServerError(body, context);
187
+ const deserialized = (0, smithy_client_1._json)(body);
191
188
  const exception = new models_0_1.InternalServerError({
192
189
  $metadata: deserializeMetadata(parsedOutput),
193
190
  ...deserialized,
@@ -196,7 +193,7 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
196
193
  };
197
194
  const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
198
195
  const body = parsedOutput.body;
199
- const deserialized = de_InvalidInputException(body, context);
196
+ const deserialized = (0, smithy_client_1._json)(body);
200
197
  const exception = new models_0_1.InvalidInputException({
201
198
  $metadata: deserializeMetadata(parsedOutput),
202
199
  ...deserialized,
@@ -205,7 +202,7 @@ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
205
202
  };
206
203
  const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
207
204
  const body = parsedOutput.body;
208
- const deserialized = de_ServiceUnavailableException(body, context);
205
+ const deserialized = (0, smithy_client_1._json)(body);
209
206
  const exception = new models_0_1.ServiceUnavailableException({
210
207
  $metadata: deserializeMetadata(parsedOutput),
211
208
  ...deserialized,
@@ -214,112 +211,40 @@ const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
214
211
  };
215
212
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
216
213
  const body = parsedOutput.body;
217
- const deserialized = de_ThrottlingException(body, context);
214
+ const deserialized = (0, smithy_client_1._json)(body);
218
215
  const exception = new models_0_1.ThrottlingException({
219
216
  $metadata: deserializeMetadata(parsedOutput),
220
217
  ...deserialized,
221
218
  });
222
219
  return (0, smithy_client_1.decorateServiceException)(exception, body);
223
220
  };
224
- const se_CreateHomeRegionControlRequest = (input, context) => {
225
- return {
226
- ...(input.DryRun != null && { DryRun: input.DryRun }),
227
- ...(input.HomeRegion != null && { HomeRegion: input.HomeRegion }),
228
- ...(input.Target != null && { Target: se_Target(input.Target, context) }),
229
- };
230
- };
231
- const se_DescribeHomeRegionControlsRequest = (input, context) => {
232
- return {
233
- ...(input.ControlId != null && { ControlId: input.ControlId }),
234
- ...(input.HomeRegion != null && { HomeRegion: input.HomeRegion }),
235
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
236
- ...(input.NextToken != null && { NextToken: input.NextToken }),
237
- ...(input.Target != null && { Target: se_Target(input.Target, context) }),
238
- };
239
- };
240
- const se_GetHomeRegionRequest = (input, context) => {
241
- return {};
242
- };
243
- const se_Target = (input, context) => {
244
- return {
245
- ...(input.Id != null && { Id: input.Id }),
246
- ...(input.Type != null && { Type: input.Type }),
247
- };
248
- };
249
- const de_AccessDeniedException = (output, context) => {
250
- return {
251
- Message: (0, smithy_client_1.expectString)(output.Message),
252
- };
253
- };
254
221
  const de_CreateHomeRegionControlResult = (output, context) => {
255
- return {
256
- HomeRegionControl: output.HomeRegionControl != null ? de_HomeRegionControl(output.HomeRegionControl, context) : undefined,
257
- };
222
+ return (0, smithy_client_1.take)(output, {
223
+ HomeRegionControl: (_) => de_HomeRegionControl(_, context),
224
+ });
258
225
  };
259
226
  const de_DescribeHomeRegionControlsResult = (output, context) => {
260
- return {
261
- HomeRegionControls: output.HomeRegionControls != null ? de_HomeRegionControls(output.HomeRegionControls, context) : undefined,
262
- NextToken: (0, smithy_client_1.expectString)(output.NextToken),
263
- };
264
- };
265
- const de_DryRunOperation = (output, context) => {
266
- return {
267
- Message: (0, smithy_client_1.expectString)(output.Message),
268
- };
269
- };
270
- const de_GetHomeRegionResult = (output, context) => {
271
- return {
272
- HomeRegion: (0, smithy_client_1.expectString)(output.HomeRegion),
273
- };
227
+ return (0, smithy_client_1.take)(output, {
228
+ HomeRegionControls: (_) => de_HomeRegionControls(_, context),
229
+ NextToken: smithy_client_1.expectString,
230
+ });
274
231
  };
275
232
  const de_HomeRegionControl = (output, context) => {
276
- return {
277
- ControlId: (0, smithy_client_1.expectString)(output.ControlId),
278
- HomeRegion: (0, smithy_client_1.expectString)(output.HomeRegion),
279
- RequestedTime: output.RequestedTime != null
280
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.RequestedTime)))
281
- : undefined,
282
- Target: output.Target != null ? de_Target(output.Target, context) : undefined,
283
- };
233
+ return (0, smithy_client_1.take)(output, {
234
+ ControlId: smithy_client_1.expectString,
235
+ HomeRegion: smithy_client_1.expectString,
236
+ RequestedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
237
+ Target: smithy_client_1._json,
238
+ });
284
239
  };
285
240
  const de_HomeRegionControls = (output, context) => {
286
241
  const retVal = (output || [])
287
242
  .filter((e) => e != null)
288
243
  .map((entry) => {
289
- if (entry === null) {
290
- return null;
291
- }
292
244
  return de_HomeRegionControl(entry, context);
293
245
  });
294
246
  return retVal;
295
247
  };
296
- const de_InternalServerError = (output, context) => {
297
- return {
298
- Message: (0, smithy_client_1.expectString)(output.Message),
299
- };
300
- };
301
- const de_InvalidInputException = (output, context) => {
302
- return {
303
- Message: (0, smithy_client_1.expectString)(output.Message),
304
- };
305
- };
306
- const de_ServiceUnavailableException = (output, context) => {
307
- return {
308
- Message: (0, smithy_client_1.expectString)(output.Message),
309
- };
310
- };
311
- const de_Target = (output, context) => {
312
- return {
313
- Id: (0, smithy_client_1.expectString)(output.Id),
314
- Type: (0, smithy_client_1.expectString)(output.Type),
315
- };
316
- };
317
- const de_ThrottlingException = (output, context) => {
318
- return {
319
- Message: (0, smithy_client_1.expectString)(output.Message),
320
- RetryAfterSeconds: (0, smithy_client_1.expectInt32)(output.RetryAfterSeconds),
321
- };
322
- };
323
248
  const deserializeMetadata = (output) => ({
324
249
  httpStatusCode: output.statusCode,
325
250
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -333,6 +258,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
333
258
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
334
259
  };
335
260
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
261
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(MigrationHubConfigServiceException_1.MigrationHubConfigServiceException);
336
262
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
337
263
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
338
264
  const contents = {
@@ -1,48 +1,13 @@
1
+ import { createAggregatedClient } from "@aws-sdk/smithy-client";
1
2
  import { CreateHomeRegionControlCommand, } from "./commands/CreateHomeRegionControlCommand";
2
3
  import { DescribeHomeRegionControlsCommand, } from "./commands/DescribeHomeRegionControlsCommand";
3
4
  import { GetHomeRegionCommand, } from "./commands/GetHomeRegionCommand";
4
5
  import { MigrationHubConfigClient } from "./MigrationHubConfigClient";
6
+ const commands = {
7
+ CreateHomeRegionControlCommand,
8
+ DescribeHomeRegionControlsCommand,
9
+ GetHomeRegionCommand,
10
+ };
5
11
  export class MigrationHubConfig extends MigrationHubConfigClient {
6
- createHomeRegionControl(args, optionsOrCb, cb) {
7
- const command = new CreateHomeRegionControlCommand(args);
8
- if (typeof optionsOrCb === "function") {
9
- this.send(command, optionsOrCb);
10
- }
11
- else if (typeof cb === "function") {
12
- if (typeof optionsOrCb !== "object")
13
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
14
- this.send(command, optionsOrCb || {}, cb);
15
- }
16
- else {
17
- return this.send(command, optionsOrCb);
18
- }
19
- }
20
- describeHomeRegionControls(args, optionsOrCb, cb) {
21
- const command = new DescribeHomeRegionControlsCommand(args);
22
- if (typeof optionsOrCb === "function") {
23
- this.send(command, optionsOrCb);
24
- }
25
- else if (typeof cb === "function") {
26
- if (typeof optionsOrCb !== "object")
27
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
28
- this.send(command, optionsOrCb || {}, cb);
29
- }
30
- else {
31
- return this.send(command, optionsOrCb);
32
- }
33
- }
34
- getHomeRegion(args, optionsOrCb, cb) {
35
- const command = new GetHomeRegionCommand(args);
36
- if (typeof optionsOrCb === "function") {
37
- this.send(command, optionsOrCb);
38
- }
39
- else if (typeof cb === "function") {
40
- if (typeof optionsOrCb !== "object")
41
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
42
- this.send(command, optionsOrCb || {}, cb);
43
- }
44
- else {
45
- return this.send(command, optionsOrCb);
46
- }
47
- }
48
12
  }
13
+ createAggregatedClient(commands, MigrationHubConfig);
@@ -1,23 +1,23 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { MigrationHubConfigServiceException as __BaseException } from "../models/MigrationHubConfigServiceException";
4
4
  import { AccessDeniedException, DryRunOperation, InternalServerError, InvalidInputException, ServiceUnavailableException, ThrottlingException, } from "../models/models_0";
5
5
  export const se_CreateHomeRegionControlCommand = async (input, context) => {
6
6
  const headers = sharedHeaders("CreateHomeRegionControl");
7
7
  let body;
8
- body = JSON.stringify(se_CreateHomeRegionControlRequest(input, context));
8
+ body = JSON.stringify(_json(input));
9
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
10
10
  };
11
11
  export const se_DescribeHomeRegionControlsCommand = async (input, context) => {
12
12
  const headers = sharedHeaders("DescribeHomeRegionControls");
13
13
  let body;
14
- body = JSON.stringify(se_DescribeHomeRegionControlsRequest(input, context));
14
+ body = JSON.stringify(_json(input));
15
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
16
  };
17
17
  export const se_GetHomeRegionCommand = async (input, context) => {
18
18
  const headers = sharedHeaders("GetHomeRegion");
19
19
  let body;
20
- body = JSON.stringify(se_GetHomeRegionRequest(input, context));
20
+ body = JSON.stringify(_json(input));
21
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
22
  };
23
23
  export const de_CreateHomeRegionControlCommand = async (output, context) => {
@@ -31,7 +31,7 @@ export const de_CreateHomeRegionControlCommand = async (output, context) => {
31
31
  $metadata: deserializeMetadata(output),
32
32
  ...contents,
33
33
  };
34
- return Promise.resolve(response);
34
+ return response;
35
35
  };
36
36
  const de_CreateHomeRegionControlCommandError = async (output, context) => {
37
37
  const parsedOutput = {
@@ -60,10 +60,9 @@ const de_CreateHomeRegionControlCommandError = async (output, context) => {
60
60
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
61
61
  default:
62
62
  const parsedBody = parsedOutput.body;
63
- throwDefaultError({
63
+ return throwDefaultError({
64
64
  output,
65
65
  parsedBody,
66
- exceptionCtor: __BaseException,
67
66
  errorCode,
68
67
  });
69
68
  }
@@ -79,7 +78,7 @@ export const de_DescribeHomeRegionControlsCommand = async (output, context) => {
79
78
  $metadata: deserializeMetadata(output),
80
79
  ...contents,
81
80
  };
82
- return Promise.resolve(response);
81
+ return response;
83
82
  };
84
83
  const de_DescribeHomeRegionControlsCommandError = async (output, context) => {
85
84
  const parsedOutput = {
@@ -105,10 +104,9 @@ const de_DescribeHomeRegionControlsCommandError = async (output, context) => {
105
104
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
106
105
  default:
107
106
  const parsedBody = parsedOutput.body;
108
- throwDefaultError({
107
+ return throwDefaultError({
109
108
  output,
110
109
  parsedBody,
111
- exceptionCtor: __BaseException,
112
110
  errorCode,
113
111
  });
114
112
  }
@@ -119,12 +117,12 @@ export const de_GetHomeRegionCommand = async (output, context) => {
119
117
  }
120
118
  const data = await parseBody(output.body, context);
121
119
  let contents = {};
122
- contents = de_GetHomeRegionResult(data, context);
120
+ contents = _json(data);
123
121
  const response = {
124
122
  $metadata: deserializeMetadata(output),
125
123
  ...contents,
126
124
  };
127
- return Promise.resolve(response);
125
+ return response;
128
126
  };
129
127
  const de_GetHomeRegionCommandError = async (output, context) => {
130
128
  const parsedOutput = {
@@ -150,17 +148,16 @@ const de_GetHomeRegionCommandError = async (output, context) => {
150
148
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
151
149
  default:
152
150
  const parsedBody = parsedOutput.body;
153
- throwDefaultError({
151
+ return throwDefaultError({
154
152
  output,
155
153
  parsedBody,
156
- exceptionCtor: __BaseException,
157
154
  errorCode,
158
155
  });
159
156
  }
160
157
  };
161
158
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
162
159
  const body = parsedOutput.body;
163
- const deserialized = de_AccessDeniedException(body, context);
160
+ const deserialized = _json(body);
164
161
  const exception = new AccessDeniedException({
165
162
  $metadata: deserializeMetadata(parsedOutput),
166
163
  ...deserialized,
@@ -169,7 +166,7 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
169
166
  };
170
167
  const de_DryRunOperationRes = async (parsedOutput, context) => {
171
168
  const body = parsedOutput.body;
172
- const deserialized = de_DryRunOperation(body, context);
169
+ const deserialized = _json(body);
173
170
  const exception = new DryRunOperation({
174
171
  $metadata: deserializeMetadata(parsedOutput),
175
172
  ...deserialized,
@@ -178,7 +175,7 @@ const de_DryRunOperationRes = async (parsedOutput, context) => {
178
175
  };
179
176
  const de_InternalServerErrorRes = async (parsedOutput, context) => {
180
177
  const body = parsedOutput.body;
181
- const deserialized = de_InternalServerError(body, context);
178
+ const deserialized = _json(body);
182
179
  const exception = new InternalServerError({
183
180
  $metadata: deserializeMetadata(parsedOutput),
184
181
  ...deserialized,
@@ -187,7 +184,7 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
187
184
  };
188
185
  const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
189
186
  const body = parsedOutput.body;
190
- const deserialized = de_InvalidInputException(body, context);
187
+ const deserialized = _json(body);
191
188
  const exception = new InvalidInputException({
192
189
  $metadata: deserializeMetadata(parsedOutput),
193
190
  ...deserialized,
@@ -196,7 +193,7 @@ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
196
193
  };
197
194
  const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
198
195
  const body = parsedOutput.body;
199
- const deserialized = de_ServiceUnavailableException(body, context);
196
+ const deserialized = _json(body);
200
197
  const exception = new ServiceUnavailableException({
201
198
  $metadata: deserializeMetadata(parsedOutput),
202
199
  ...deserialized,
@@ -205,112 +202,40 @@ const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
205
202
  };
206
203
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
207
204
  const body = parsedOutput.body;
208
- const deserialized = de_ThrottlingException(body, context);
205
+ const deserialized = _json(body);
209
206
  const exception = new ThrottlingException({
210
207
  $metadata: deserializeMetadata(parsedOutput),
211
208
  ...deserialized,
212
209
  });
213
210
  return __decorateServiceException(exception, body);
214
211
  };
215
- const se_CreateHomeRegionControlRequest = (input, context) => {
216
- return {
217
- ...(input.DryRun != null && { DryRun: input.DryRun }),
218
- ...(input.HomeRegion != null && { HomeRegion: input.HomeRegion }),
219
- ...(input.Target != null && { Target: se_Target(input.Target, context) }),
220
- };
221
- };
222
- const se_DescribeHomeRegionControlsRequest = (input, context) => {
223
- return {
224
- ...(input.ControlId != null && { ControlId: input.ControlId }),
225
- ...(input.HomeRegion != null && { HomeRegion: input.HomeRegion }),
226
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
227
- ...(input.NextToken != null && { NextToken: input.NextToken }),
228
- ...(input.Target != null && { Target: se_Target(input.Target, context) }),
229
- };
230
- };
231
- const se_GetHomeRegionRequest = (input, context) => {
232
- return {};
233
- };
234
- const se_Target = (input, context) => {
235
- return {
236
- ...(input.Id != null && { Id: input.Id }),
237
- ...(input.Type != null && { Type: input.Type }),
238
- };
239
- };
240
- const de_AccessDeniedException = (output, context) => {
241
- return {
242
- Message: __expectString(output.Message),
243
- };
244
- };
245
212
  const de_CreateHomeRegionControlResult = (output, context) => {
246
- return {
247
- HomeRegionControl: output.HomeRegionControl != null ? de_HomeRegionControl(output.HomeRegionControl, context) : undefined,
248
- };
213
+ return take(output, {
214
+ HomeRegionControl: (_) => de_HomeRegionControl(_, context),
215
+ });
249
216
  };
250
217
  const de_DescribeHomeRegionControlsResult = (output, context) => {
251
- return {
252
- HomeRegionControls: output.HomeRegionControls != null ? de_HomeRegionControls(output.HomeRegionControls, context) : undefined,
253
- NextToken: __expectString(output.NextToken),
254
- };
255
- };
256
- const de_DryRunOperation = (output, context) => {
257
- return {
258
- Message: __expectString(output.Message),
259
- };
260
- };
261
- const de_GetHomeRegionResult = (output, context) => {
262
- return {
263
- HomeRegion: __expectString(output.HomeRegion),
264
- };
218
+ return take(output, {
219
+ HomeRegionControls: (_) => de_HomeRegionControls(_, context),
220
+ NextToken: __expectString,
221
+ });
265
222
  };
266
223
  const de_HomeRegionControl = (output, context) => {
267
- return {
268
- ControlId: __expectString(output.ControlId),
269
- HomeRegion: __expectString(output.HomeRegion),
270
- RequestedTime: output.RequestedTime != null
271
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.RequestedTime)))
272
- : undefined,
273
- Target: output.Target != null ? de_Target(output.Target, context) : undefined,
274
- };
224
+ return take(output, {
225
+ ControlId: __expectString,
226
+ HomeRegion: __expectString,
227
+ RequestedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
228
+ Target: _json,
229
+ });
275
230
  };
276
231
  const de_HomeRegionControls = (output, context) => {
277
232
  const retVal = (output || [])
278
233
  .filter((e) => e != null)
279
234
  .map((entry) => {
280
- if (entry === null) {
281
- return null;
282
- }
283
235
  return de_HomeRegionControl(entry, context);
284
236
  });
285
237
  return retVal;
286
238
  };
287
- const de_InternalServerError = (output, context) => {
288
- return {
289
- Message: __expectString(output.Message),
290
- };
291
- };
292
- const de_InvalidInputException = (output, context) => {
293
- return {
294
- Message: __expectString(output.Message),
295
- };
296
- };
297
- const de_ServiceUnavailableException = (output, context) => {
298
- return {
299
- Message: __expectString(output.Message),
300
- };
301
- };
302
- const de_Target = (output, context) => {
303
- return {
304
- Id: __expectString(output.Id),
305
- Type: __expectString(output.Type),
306
- };
307
- };
308
- const de_ThrottlingException = (output, context) => {
309
- return {
310
- Message: __expectString(output.Message),
311
- RetryAfterSeconds: __expectInt32(output.RetryAfterSeconds),
312
- };
313
- };
314
239
  const deserializeMetadata = (output) => ({
315
240
  httpStatusCode: output.statusCode,
316
241
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -324,6 +249,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
324
249
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
325
250
  };
326
251
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
252
+ const throwDefaultError = withBaseException(__BaseException);
327
253
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
328
254
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
329
255
  const contents = {
@@ -3,6 +3,26 @@ import { CreateHomeRegionControlCommandInput, CreateHomeRegionControlCommandOutp
3
3
  import { DescribeHomeRegionControlsCommandInput, DescribeHomeRegionControlsCommandOutput } from "./commands/DescribeHomeRegionControlsCommand";
4
4
  import { GetHomeRegionCommandInput, GetHomeRegionCommandOutput } from "./commands/GetHomeRegionCommand";
5
5
  import { MigrationHubConfigClient } from "./MigrationHubConfigClient";
6
+ export interface MigrationHubConfig {
7
+ /**
8
+ * @see {@link CreateHomeRegionControlCommand}
9
+ */
10
+ createHomeRegionControl(args: CreateHomeRegionControlCommandInput, options?: __HttpHandlerOptions): Promise<CreateHomeRegionControlCommandOutput>;
11
+ createHomeRegionControl(args: CreateHomeRegionControlCommandInput, cb: (err: any, data?: CreateHomeRegionControlCommandOutput) => void): void;
12
+ createHomeRegionControl(args: CreateHomeRegionControlCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateHomeRegionControlCommandOutput) => void): void;
13
+ /**
14
+ * @see {@link DescribeHomeRegionControlsCommand}
15
+ */
16
+ describeHomeRegionControls(args: DescribeHomeRegionControlsCommandInput, options?: __HttpHandlerOptions): Promise<DescribeHomeRegionControlsCommandOutput>;
17
+ describeHomeRegionControls(args: DescribeHomeRegionControlsCommandInput, cb: (err: any, data?: DescribeHomeRegionControlsCommandOutput) => void): void;
18
+ describeHomeRegionControls(args: DescribeHomeRegionControlsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeHomeRegionControlsCommandOutput) => void): void;
19
+ /**
20
+ * @see {@link GetHomeRegionCommand}
21
+ */
22
+ getHomeRegion(args: GetHomeRegionCommandInput, options?: __HttpHandlerOptions): Promise<GetHomeRegionCommandOutput>;
23
+ getHomeRegion(args: GetHomeRegionCommandInput, cb: (err: any, data?: GetHomeRegionCommandOutput) => void): void;
24
+ getHomeRegion(args: GetHomeRegionCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetHomeRegionCommandOutput) => void): void;
25
+ }
6
26
  /**
7
27
  * @public
8
28
  * <p>The AWS Migration Hub home region APIs are available specifically for working with your
@@ -32,31 +52,5 @@ import { MigrationHubConfigClient } from "./MigrationHubConfigClient";
32
52
  * <p>For specific API usage, see the sections that follow in this AWS Migration Hub Home Region
33
53
  * API reference. </p>
34
54
  */
35
- export declare class MigrationHubConfig extends MigrationHubConfigClient {
36
- /**
37
- * @public
38
- * <p>This API sets up the home region for the calling account only.</p>
39
- */
40
- createHomeRegionControl(args: CreateHomeRegionControlCommandInput, options?: __HttpHandlerOptions): Promise<CreateHomeRegionControlCommandOutput>;
41
- createHomeRegionControl(args: CreateHomeRegionControlCommandInput, cb: (err: any, data?: CreateHomeRegionControlCommandOutput) => void): void;
42
- createHomeRegionControl(args: CreateHomeRegionControlCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateHomeRegionControlCommandOutput) => void): void;
43
- /**
44
- * @public
45
- * <p>This API permits filtering on the <code>ControlId</code> and <code>HomeRegion</code>
46
- * fields.</p>
47
- */
48
- describeHomeRegionControls(args: DescribeHomeRegionControlsCommandInput, options?: __HttpHandlerOptions): Promise<DescribeHomeRegionControlsCommandOutput>;
49
- describeHomeRegionControls(args: DescribeHomeRegionControlsCommandInput, cb: (err: any, data?: DescribeHomeRegionControlsCommandOutput) => void): void;
50
- describeHomeRegionControls(args: DescribeHomeRegionControlsCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeHomeRegionControlsCommandOutput) => void): void;
51
- /**
52
- * @public
53
- * <p>Returns the calling account’s home region, if configured. This API is used by other AWS
54
- * services to determine the regional endpoint for calling AWS Application Discovery Service and
55
- * Migration Hub. You must call <code>GetHomeRegion</code> at least once before you call any
56
- * other AWS Application Discovery Service and AWS Migration Hub APIs, to obtain the account's
57
- * Migration Hub home region.</p>
58
- */
59
- getHomeRegion(args: GetHomeRegionCommandInput, options?: __HttpHandlerOptions): Promise<GetHomeRegionCommandOutput>;
60
- getHomeRegion(args: GetHomeRegionCommandInput, cb: (err: any, data?: GetHomeRegionCommandOutput) => void): void;
61
- getHomeRegion(args: GetHomeRegionCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetHomeRegionCommandOutput) => void): void;
55
+ export declare class MigrationHubConfig extends MigrationHubConfigClient implements MigrationHubConfig {
62
56
  }
@@ -12,7 +12,7 @@ import {
12
12
  GetHomeRegionCommandOutput,
13
13
  } from "./commands/GetHomeRegionCommand";
14
14
  import { MigrationHubConfigClient } from "./MigrationHubConfigClient";
15
- export declare class MigrationHubConfig extends MigrationHubConfigClient {
15
+ export interface MigrationHubConfig {
16
16
  createHomeRegionControl(
17
17
  args: CreateHomeRegionControlCommandInput,
18
18
  options?: __HttpHandlerOptions
@@ -53,3 +53,6 @@ export declare class MigrationHubConfig extends MigrationHubConfigClient {
53
53
  cb: (err: any, data?: GetHomeRegionCommandOutput) => void
54
54
  ): void;
55
55
  }
56
+ export declare class MigrationHubConfig
57
+ extends MigrationHubConfigClient
58
+ implements MigrationHubConfig {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-migrationhub-config",
3
3
  "description": "AWS SDK for JavaScript Migrationhub Config Client for Node.js, Browser and React Native",
4
- "version": "3.312.0",
4
+ "version": "3.316.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.312.0",
24
+ "@aws-sdk/client-sts": "3.316.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.316.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.316.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.316.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.316.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",