@aws-sdk/client-migrationhub-config 3.310.0 → 3.315.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.
@@ -6,32 +6,23 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const MigrationHubConfigServiceException_1 = require("../models/MigrationHubConfigServiceException");
7
7
  const models_0_1 = require("../models/models_0");
8
8
  const se_CreateHomeRegionControlCommand = async (input, context) => {
9
- const headers = {
10
- "content-type": "application/x-amz-json-1.1",
11
- "x-amz-target": "AWSMigrationHubMultiAccountService.CreateHomeRegionControl",
12
- };
9
+ const headers = sharedHeaders("CreateHomeRegionControl");
13
10
  let body;
14
- body = JSON.stringify(se_CreateHomeRegionControlRequest(input, context));
11
+ body = JSON.stringify((0, smithy_client_1._json)(input));
15
12
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
13
  };
17
14
  exports.se_CreateHomeRegionControlCommand = se_CreateHomeRegionControlCommand;
18
15
  const se_DescribeHomeRegionControlsCommand = async (input, context) => {
19
- const headers = {
20
- "content-type": "application/x-amz-json-1.1",
21
- "x-amz-target": "AWSMigrationHubMultiAccountService.DescribeHomeRegionControls",
22
- };
16
+ const headers = sharedHeaders("DescribeHomeRegionControls");
23
17
  let body;
24
- body = JSON.stringify(se_DescribeHomeRegionControlsRequest(input, context));
18
+ body = JSON.stringify((0, smithy_client_1._json)(input));
25
19
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
26
20
  };
27
21
  exports.se_DescribeHomeRegionControlsCommand = se_DescribeHomeRegionControlsCommand;
28
22
  const se_GetHomeRegionCommand = async (input, context) => {
29
- const headers = {
30
- "content-type": "application/x-amz-json-1.1",
31
- "x-amz-target": "AWSMigrationHubMultiAccountService.GetHomeRegion",
32
- };
23
+ const headers = sharedHeaders("GetHomeRegion");
33
24
  let body;
34
- body = JSON.stringify(se_GetHomeRegionRequest(input, context));
25
+ body = JSON.stringify((0, smithy_client_1._json)(input));
35
26
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
36
27
  };
37
28
  exports.se_GetHomeRegionCommand = se_GetHomeRegionCommand;
@@ -46,7 +37,7 @@ const de_CreateHomeRegionControlCommand = async (output, context) => {
46
37
  $metadata: deserializeMetadata(output),
47
38
  ...contents,
48
39
  };
49
- return Promise.resolve(response);
40
+ return response;
50
41
  };
51
42
  exports.de_CreateHomeRegionControlCommand = de_CreateHomeRegionControlCommand;
52
43
  const de_CreateHomeRegionControlCommandError = async (output, context) => {
@@ -76,10 +67,9 @@ const de_CreateHomeRegionControlCommandError = async (output, context) => {
76
67
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
77
68
  default:
78
69
  const parsedBody = parsedOutput.body;
79
- (0, smithy_client_1.throwDefaultError)({
70
+ return throwDefaultError({
80
71
  output,
81
72
  parsedBody,
82
- exceptionCtor: MigrationHubConfigServiceException_1.MigrationHubConfigServiceException,
83
73
  errorCode,
84
74
  });
85
75
  }
@@ -95,7 +85,7 @@ const de_DescribeHomeRegionControlsCommand = async (output, context) => {
95
85
  $metadata: deserializeMetadata(output),
96
86
  ...contents,
97
87
  };
98
- return Promise.resolve(response);
88
+ return response;
99
89
  };
100
90
  exports.de_DescribeHomeRegionControlsCommand = de_DescribeHomeRegionControlsCommand;
101
91
  const de_DescribeHomeRegionControlsCommandError = async (output, context) => {
@@ -122,10 +112,9 @@ const de_DescribeHomeRegionControlsCommandError = async (output, context) => {
122
112
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
123
113
  default:
124
114
  const parsedBody = parsedOutput.body;
125
- (0, smithy_client_1.throwDefaultError)({
115
+ return throwDefaultError({
126
116
  output,
127
117
  parsedBody,
128
- exceptionCtor: MigrationHubConfigServiceException_1.MigrationHubConfigServiceException,
129
118
  errorCode,
130
119
  });
131
120
  }
@@ -136,12 +125,12 @@ const de_GetHomeRegionCommand = async (output, context) => {
136
125
  }
137
126
  const data = await parseBody(output.body, context);
138
127
  let contents = {};
139
- contents = de_GetHomeRegionResult(data, context);
128
+ contents = (0, smithy_client_1._json)(data);
140
129
  const response = {
141
130
  $metadata: deserializeMetadata(output),
142
131
  ...contents,
143
132
  };
144
- return Promise.resolve(response);
133
+ return response;
145
134
  };
146
135
  exports.de_GetHomeRegionCommand = de_GetHomeRegionCommand;
147
136
  const de_GetHomeRegionCommandError = async (output, context) => {
@@ -168,17 +157,16 @@ const de_GetHomeRegionCommandError = async (output, context) => {
168
157
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
169
158
  default:
170
159
  const parsedBody = parsedOutput.body;
171
- (0, smithy_client_1.throwDefaultError)({
160
+ return throwDefaultError({
172
161
  output,
173
162
  parsedBody,
174
- exceptionCtor: MigrationHubConfigServiceException_1.MigrationHubConfigServiceException,
175
163
  errorCode,
176
164
  });
177
165
  }
178
166
  };
179
167
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
180
168
  const body = parsedOutput.body;
181
- const deserialized = de_AccessDeniedException(body, context);
169
+ const deserialized = (0, smithy_client_1._json)(body);
182
170
  const exception = new models_0_1.AccessDeniedException({
183
171
  $metadata: deserializeMetadata(parsedOutput),
184
172
  ...deserialized,
@@ -187,7 +175,7 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
187
175
  };
188
176
  const de_DryRunOperationRes = async (parsedOutput, context) => {
189
177
  const body = parsedOutput.body;
190
- const deserialized = de_DryRunOperation(body, context);
178
+ const deserialized = (0, smithy_client_1._json)(body);
191
179
  const exception = new models_0_1.DryRunOperation({
192
180
  $metadata: deserializeMetadata(parsedOutput),
193
181
  ...deserialized,
@@ -196,7 +184,7 @@ const de_DryRunOperationRes = async (parsedOutput, context) => {
196
184
  };
197
185
  const de_InternalServerErrorRes = async (parsedOutput, context) => {
198
186
  const body = parsedOutput.body;
199
- const deserialized = de_InternalServerError(body, context);
187
+ const deserialized = (0, smithy_client_1._json)(body);
200
188
  const exception = new models_0_1.InternalServerError({
201
189
  $metadata: deserializeMetadata(parsedOutput),
202
190
  ...deserialized,
@@ -205,7 +193,7 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
205
193
  };
206
194
  const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
207
195
  const body = parsedOutput.body;
208
- const deserialized = de_InvalidInputException(body, context);
196
+ const deserialized = (0, smithy_client_1._json)(body);
209
197
  const exception = new models_0_1.InvalidInputException({
210
198
  $metadata: deserializeMetadata(parsedOutput),
211
199
  ...deserialized,
@@ -214,7 +202,7 @@ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
214
202
  };
215
203
  const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
216
204
  const body = parsedOutput.body;
217
- const deserialized = de_ServiceUnavailableException(body, context);
205
+ const deserialized = (0, smithy_client_1._json)(body);
218
206
  const exception = new models_0_1.ServiceUnavailableException({
219
207
  $metadata: deserializeMetadata(parsedOutput),
220
208
  ...deserialized,
@@ -223,112 +211,40 @@ const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
223
211
  };
224
212
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
225
213
  const body = parsedOutput.body;
226
- const deserialized = de_ThrottlingException(body, context);
214
+ const deserialized = (0, smithy_client_1._json)(body);
227
215
  const exception = new models_0_1.ThrottlingException({
228
216
  $metadata: deserializeMetadata(parsedOutput),
229
217
  ...deserialized,
230
218
  });
231
219
  return (0, smithy_client_1.decorateServiceException)(exception, body);
232
220
  };
233
- const se_CreateHomeRegionControlRequest = (input, context) => {
234
- return {
235
- ...(input.DryRun != null && { DryRun: input.DryRun }),
236
- ...(input.HomeRegion != null && { HomeRegion: input.HomeRegion }),
237
- ...(input.Target != null && { Target: se_Target(input.Target, context) }),
238
- };
239
- };
240
- const se_DescribeHomeRegionControlsRequest = (input, context) => {
241
- return {
242
- ...(input.ControlId != null && { ControlId: input.ControlId }),
243
- ...(input.HomeRegion != null && { HomeRegion: input.HomeRegion }),
244
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
245
- ...(input.NextToken != null && { NextToken: input.NextToken }),
246
- ...(input.Target != null && { Target: se_Target(input.Target, context) }),
247
- };
248
- };
249
- const se_GetHomeRegionRequest = (input, context) => {
250
- return {};
251
- };
252
- const se_Target = (input, context) => {
253
- return {
254
- ...(input.Id != null && { Id: input.Id }),
255
- ...(input.Type != null && { Type: input.Type }),
256
- };
257
- };
258
- const de_AccessDeniedException = (output, context) => {
259
- return {
260
- Message: (0, smithy_client_1.expectString)(output.Message),
261
- };
262
- };
263
221
  const de_CreateHomeRegionControlResult = (output, context) => {
264
- return {
265
- HomeRegionControl: output.HomeRegionControl != null ? de_HomeRegionControl(output.HomeRegionControl, context) : undefined,
266
- };
222
+ return (0, smithy_client_1.take)(output, {
223
+ HomeRegionControl: (_) => de_HomeRegionControl(_, context),
224
+ });
267
225
  };
268
226
  const de_DescribeHomeRegionControlsResult = (output, context) => {
269
- return {
270
- HomeRegionControls: output.HomeRegionControls != null ? de_HomeRegionControls(output.HomeRegionControls, context) : undefined,
271
- NextToken: (0, smithy_client_1.expectString)(output.NextToken),
272
- };
273
- };
274
- const de_DryRunOperation = (output, context) => {
275
- return {
276
- Message: (0, smithy_client_1.expectString)(output.Message),
277
- };
278
- };
279
- const de_GetHomeRegionResult = (output, context) => {
280
- return {
281
- HomeRegion: (0, smithy_client_1.expectString)(output.HomeRegion),
282
- };
227
+ return (0, smithy_client_1.take)(output, {
228
+ HomeRegionControls: (_) => de_HomeRegionControls(_, context),
229
+ NextToken: smithy_client_1.expectString,
230
+ });
283
231
  };
284
232
  const de_HomeRegionControl = (output, context) => {
285
- return {
286
- ControlId: (0, smithy_client_1.expectString)(output.ControlId),
287
- HomeRegion: (0, smithy_client_1.expectString)(output.HomeRegion),
288
- RequestedTime: output.RequestedTime != null
289
- ? (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(output.RequestedTime)))
290
- : undefined,
291
- Target: output.Target != null ? de_Target(output.Target, context) : undefined,
292
- };
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
+ });
293
239
  };
294
240
  const de_HomeRegionControls = (output, context) => {
295
241
  const retVal = (output || [])
296
242
  .filter((e) => e != null)
297
243
  .map((entry) => {
298
- if (entry === null) {
299
- return null;
300
- }
301
244
  return de_HomeRegionControl(entry, context);
302
245
  });
303
246
  return retVal;
304
247
  };
305
- const de_InternalServerError = (output, context) => {
306
- return {
307
- Message: (0, smithy_client_1.expectString)(output.Message),
308
- };
309
- };
310
- const de_InvalidInputException = (output, context) => {
311
- return {
312
- Message: (0, smithy_client_1.expectString)(output.Message),
313
- };
314
- };
315
- const de_ServiceUnavailableException = (output, context) => {
316
- return {
317
- Message: (0, smithy_client_1.expectString)(output.Message),
318
- };
319
- };
320
- const de_Target = (output, context) => {
321
- return {
322
- Id: (0, smithy_client_1.expectString)(output.Id),
323
- Type: (0, smithy_client_1.expectString)(output.Type),
324
- };
325
- };
326
- const de_ThrottlingException = (output, context) => {
327
- return {
328
- Message: (0, smithy_client_1.expectString)(output.Message),
329
- RetryAfterSeconds: (0, smithy_client_1.expectInt32)(output.RetryAfterSeconds),
330
- };
331
- };
332
248
  const deserializeMetadata = (output) => ({
333
249
  httpStatusCode: output.statusCode,
334
250
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -342,6 +258,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
342
258
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
343
259
  };
344
260
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
261
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(MigrationHubConfigServiceException_1.MigrationHubConfigServiceException);
345
262
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
346
263
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
347
264
  const contents = {
@@ -360,6 +277,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
360
277
  }
361
278
  return new protocol_http_1.HttpRequest(contents);
362
279
  };
280
+ function sharedHeaders(operation) {
281
+ return {
282
+ "content-type": "application/x-amz-json-1.1",
283
+ "x-amz-target": `AWSMigrationHubMultiAccountService.${operation}`,
284
+ };
285
+ }
363
286
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
364
287
  if (encoded.length) {
365
288
  return JSON.parse(encoded);
@@ -1,32 +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
- const headers = {
7
- "content-type": "application/x-amz-json-1.1",
8
- "x-amz-target": "AWSMigrationHubMultiAccountService.CreateHomeRegionControl",
9
- };
6
+ const headers = sharedHeaders("CreateHomeRegionControl");
10
7
  let body;
11
- body = JSON.stringify(se_CreateHomeRegionControlRequest(input, context));
8
+ body = JSON.stringify(_json(input));
12
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
10
  };
14
11
  export const se_DescribeHomeRegionControlsCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.1",
17
- "x-amz-target": "AWSMigrationHubMultiAccountService.DescribeHomeRegionControls",
18
- };
12
+ const headers = sharedHeaders("DescribeHomeRegionControls");
19
13
  let body;
20
- body = JSON.stringify(se_DescribeHomeRegionControlsRequest(input, context));
14
+ body = JSON.stringify(_json(input));
21
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
16
  };
23
17
  export const se_GetHomeRegionCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.1",
26
- "x-amz-target": "AWSMigrationHubMultiAccountService.GetHomeRegion",
27
- };
18
+ const headers = sharedHeaders("GetHomeRegion");
28
19
  let body;
29
- body = JSON.stringify(se_GetHomeRegionRequest(input, context));
20
+ body = JSON.stringify(_json(input));
30
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
22
  };
32
23
  export const de_CreateHomeRegionControlCommand = async (output, context) => {
@@ -40,7 +31,7 @@ export const de_CreateHomeRegionControlCommand = async (output, context) => {
40
31
  $metadata: deserializeMetadata(output),
41
32
  ...contents,
42
33
  };
43
- return Promise.resolve(response);
34
+ return response;
44
35
  };
45
36
  const de_CreateHomeRegionControlCommandError = async (output, context) => {
46
37
  const parsedOutput = {
@@ -69,10 +60,9 @@ const de_CreateHomeRegionControlCommandError = async (output, context) => {
69
60
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
70
61
  default:
71
62
  const parsedBody = parsedOutput.body;
72
- throwDefaultError({
63
+ return throwDefaultError({
73
64
  output,
74
65
  parsedBody,
75
- exceptionCtor: __BaseException,
76
66
  errorCode,
77
67
  });
78
68
  }
@@ -88,7 +78,7 @@ export const de_DescribeHomeRegionControlsCommand = async (output, context) => {
88
78
  $metadata: deserializeMetadata(output),
89
79
  ...contents,
90
80
  };
91
- return Promise.resolve(response);
81
+ return response;
92
82
  };
93
83
  const de_DescribeHomeRegionControlsCommandError = async (output, context) => {
94
84
  const parsedOutput = {
@@ -114,10 +104,9 @@ const de_DescribeHomeRegionControlsCommandError = async (output, context) => {
114
104
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
115
105
  default:
116
106
  const parsedBody = parsedOutput.body;
117
- throwDefaultError({
107
+ return throwDefaultError({
118
108
  output,
119
109
  parsedBody,
120
- exceptionCtor: __BaseException,
121
110
  errorCode,
122
111
  });
123
112
  }
@@ -128,12 +117,12 @@ export const de_GetHomeRegionCommand = async (output, context) => {
128
117
  }
129
118
  const data = await parseBody(output.body, context);
130
119
  let contents = {};
131
- contents = de_GetHomeRegionResult(data, context);
120
+ contents = _json(data);
132
121
  const response = {
133
122
  $metadata: deserializeMetadata(output),
134
123
  ...contents,
135
124
  };
136
- return Promise.resolve(response);
125
+ return response;
137
126
  };
138
127
  const de_GetHomeRegionCommandError = async (output, context) => {
139
128
  const parsedOutput = {
@@ -159,17 +148,16 @@ const de_GetHomeRegionCommandError = async (output, context) => {
159
148
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
160
149
  default:
161
150
  const parsedBody = parsedOutput.body;
162
- throwDefaultError({
151
+ return throwDefaultError({
163
152
  output,
164
153
  parsedBody,
165
- exceptionCtor: __BaseException,
166
154
  errorCode,
167
155
  });
168
156
  }
169
157
  };
170
158
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
171
159
  const body = parsedOutput.body;
172
- const deserialized = de_AccessDeniedException(body, context);
160
+ const deserialized = _json(body);
173
161
  const exception = new AccessDeniedException({
174
162
  $metadata: deserializeMetadata(parsedOutput),
175
163
  ...deserialized,
@@ -178,7 +166,7 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
178
166
  };
179
167
  const de_DryRunOperationRes = async (parsedOutput, context) => {
180
168
  const body = parsedOutput.body;
181
- const deserialized = de_DryRunOperation(body, context);
169
+ const deserialized = _json(body);
182
170
  const exception = new DryRunOperation({
183
171
  $metadata: deserializeMetadata(parsedOutput),
184
172
  ...deserialized,
@@ -187,7 +175,7 @@ const de_DryRunOperationRes = async (parsedOutput, context) => {
187
175
  };
188
176
  const de_InternalServerErrorRes = async (parsedOutput, context) => {
189
177
  const body = parsedOutput.body;
190
- const deserialized = de_InternalServerError(body, context);
178
+ const deserialized = _json(body);
191
179
  const exception = new InternalServerError({
192
180
  $metadata: deserializeMetadata(parsedOutput),
193
181
  ...deserialized,
@@ -196,7 +184,7 @@ const de_InternalServerErrorRes = async (parsedOutput, context) => {
196
184
  };
197
185
  const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
198
186
  const body = parsedOutput.body;
199
- const deserialized = de_InvalidInputException(body, context);
187
+ const deserialized = _json(body);
200
188
  const exception = new InvalidInputException({
201
189
  $metadata: deserializeMetadata(parsedOutput),
202
190
  ...deserialized,
@@ -205,7 +193,7 @@ const de_InvalidInputExceptionRes = async (parsedOutput, context) => {
205
193
  };
206
194
  const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
207
195
  const body = parsedOutput.body;
208
- const deserialized = de_ServiceUnavailableException(body, context);
196
+ const deserialized = _json(body);
209
197
  const exception = new ServiceUnavailableException({
210
198
  $metadata: deserializeMetadata(parsedOutput),
211
199
  ...deserialized,
@@ -214,112 +202,40 @@ const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
214
202
  };
215
203
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
216
204
  const body = parsedOutput.body;
217
- const deserialized = de_ThrottlingException(body, context);
205
+ const deserialized = _json(body);
218
206
  const exception = new ThrottlingException({
219
207
  $metadata: deserializeMetadata(parsedOutput),
220
208
  ...deserialized,
221
209
  });
222
210
  return __decorateServiceException(exception, body);
223
211
  };
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: __expectString(output.Message),
252
- };
253
- };
254
212
  const de_CreateHomeRegionControlResult = (output, context) => {
255
- return {
256
- HomeRegionControl: output.HomeRegionControl != null ? de_HomeRegionControl(output.HomeRegionControl, context) : undefined,
257
- };
213
+ return take(output, {
214
+ HomeRegionControl: (_) => de_HomeRegionControl(_, context),
215
+ });
258
216
  };
259
217
  const de_DescribeHomeRegionControlsResult = (output, context) => {
260
- return {
261
- HomeRegionControls: output.HomeRegionControls != null ? de_HomeRegionControls(output.HomeRegionControls, context) : undefined,
262
- NextToken: __expectString(output.NextToken),
263
- };
264
- };
265
- const de_DryRunOperation = (output, context) => {
266
- return {
267
- Message: __expectString(output.Message),
268
- };
269
- };
270
- const de_GetHomeRegionResult = (output, context) => {
271
- return {
272
- HomeRegion: __expectString(output.HomeRegion),
273
- };
218
+ return take(output, {
219
+ HomeRegionControls: (_) => de_HomeRegionControls(_, context),
220
+ NextToken: __expectString,
221
+ });
274
222
  };
275
223
  const de_HomeRegionControl = (output, context) => {
276
- return {
277
- ControlId: __expectString(output.ControlId),
278
- HomeRegion: __expectString(output.HomeRegion),
279
- RequestedTime: output.RequestedTime != null
280
- ? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.RequestedTime)))
281
- : undefined,
282
- Target: output.Target != null ? de_Target(output.Target, context) : undefined,
283
- };
224
+ return take(output, {
225
+ ControlId: __expectString,
226
+ HomeRegion: __expectString,
227
+ RequestedTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
228
+ Target: _json,
229
+ });
284
230
  };
285
231
  const de_HomeRegionControls = (output, context) => {
286
232
  const retVal = (output || [])
287
233
  .filter((e) => e != null)
288
234
  .map((entry) => {
289
- if (entry === null) {
290
- return null;
291
- }
292
235
  return de_HomeRegionControl(entry, context);
293
236
  });
294
237
  return retVal;
295
238
  };
296
- const de_InternalServerError = (output, context) => {
297
- return {
298
- Message: __expectString(output.Message),
299
- };
300
- };
301
- const de_InvalidInputException = (output, context) => {
302
- return {
303
- Message: __expectString(output.Message),
304
- };
305
- };
306
- const de_ServiceUnavailableException = (output, context) => {
307
- return {
308
- Message: __expectString(output.Message),
309
- };
310
- };
311
- const de_Target = (output, context) => {
312
- return {
313
- Id: __expectString(output.Id),
314
- Type: __expectString(output.Type),
315
- };
316
- };
317
- const de_ThrottlingException = (output, context) => {
318
- return {
319
- Message: __expectString(output.Message),
320
- RetryAfterSeconds: __expectInt32(output.RetryAfterSeconds),
321
- };
322
- };
323
239
  const deserializeMetadata = (output) => ({
324
240
  httpStatusCode: output.statusCode,
325
241
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -333,6 +249,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
333
249
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
334
250
  };
335
251
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
252
+ const throwDefaultError = withBaseException(__BaseException);
336
253
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
337
254
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
338
255
  const contents = {
@@ -351,6 +268,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
351
268
  }
352
269
  return new __HttpRequest(contents);
353
270
  };
271
+ function sharedHeaders(operation) {
272
+ return {
273
+ "content-type": "application/x-amz-json-1.1",
274
+ "x-amz-target": `AWSMigrationHubMultiAccountService.${operation}`,
275
+ };
276
+ }
354
277
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
355
278
  if (encoded.length) {
356
279
  return JSON.parse(encoded);
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.310.0",
4
+ "version": "3.315.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.310.0",
24
+ "@aws-sdk/client-sts": "3.315.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.315.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.315.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.315.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.315.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",