@aws-sdk/client-migrationhub-config 3.52.0 → 3.53.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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [3.53.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.52.0...v3.53.0) (2022-02-24)
7
+
8
+
9
+ ### Features
10
+
11
+ * **clients:** generate service exceptions as classes ([#3267](https://github.com/aws/aws-sdk-js-v3/issues/3267)) ([ca64fee](https://github.com/aws/aws-sdk-js-v3/commit/ca64feed3351c394c07dc26b782a5760a396a074))
12
+
13
+
14
+
15
+
16
+
6
17
  # [3.52.0](https://github.com/aws/aws-sdk-js-v3/compare/v3.51.0...v3.52.0) (2022-02-18)
7
18
 
8
19
  **Note:** Version bump only for package @aws-sdk/client-migrationhub-config
package/dist-cjs/index.js CHANGED
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MigrationHubConfigServiceException = void 0;
3
4
  const tslib_1 = require("tslib");
4
5
  tslib_1.__exportStar(require("./MigrationHubConfig"), exports);
5
6
  tslib_1.__exportStar(require("./MigrationHubConfigClient"), exports);
6
7
  tslib_1.__exportStar(require("./commands"), exports);
7
8
  tslib_1.__exportStar(require("./models"), exports);
8
9
  tslib_1.__exportStar(require("./pagination"), exports);
10
+ var MigrationHubConfigServiceException_1 = require("./models/MigrationHubConfigServiceException");
11
+ Object.defineProperty(exports, "MigrationHubConfigServiceException", { enumerable: true, get: function () { return MigrationHubConfigServiceException_1.MigrationHubConfigServiceException; } });
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MigrationHubConfigServiceException = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
5
+ class MigrationHubConfigServiceException extends smithy_client_1.ServiceException {
6
+ constructor(options) {
7
+ super(options);
8
+ Object.setPrototypeOf(this, MigrationHubConfigServiceException.prototype);
9
+ }
10
+ }
11
+ exports.MigrationHubConfigServiceException = MigrationHubConfigServiceException;
@@ -1,6 +1,21 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GetHomeRegionResult = exports.GetHomeRegionRequest = exports.DescribeHomeRegionControlsResult = exports.DescribeHomeRegionControlsRequest = exports.CreateHomeRegionControlResult = exports.HomeRegionControl = exports.CreateHomeRegionControlRequest = exports.Target = exports.TargetType = void 0;
3
+ exports.GetHomeRegionResult = exports.GetHomeRegionRequest = exports.DescribeHomeRegionControlsResult = exports.DescribeHomeRegionControlsRequest = exports.ThrottlingException = exports.ServiceUnavailableException = exports.InvalidInputException = exports.InternalServerError = exports.DryRunOperation = exports.CreateHomeRegionControlResult = exports.HomeRegionControl = exports.CreateHomeRegionControlRequest = exports.Target = exports.TargetType = exports.AccessDeniedException = void 0;
4
+ const MigrationHubConfigServiceException_1 = require("./MigrationHubConfigServiceException");
5
+ class AccessDeniedException extends MigrationHubConfigServiceException_1.MigrationHubConfigServiceException {
6
+ constructor(opts) {
7
+ super({
8
+ name: "AccessDeniedException",
9
+ $fault: "client",
10
+ ...opts,
11
+ });
12
+ this.name = "AccessDeniedException";
13
+ this.$fault = "client";
14
+ Object.setPrototypeOf(this, AccessDeniedException.prototype);
15
+ this.Message = opts.Message;
16
+ }
17
+ }
18
+ exports.AccessDeniedException = AccessDeniedException;
4
19
  var TargetType;
5
20
  (function (TargetType) {
6
21
  TargetType["ACCOUNT"] = "ACCOUNT";
@@ -29,6 +44,77 @@ var CreateHomeRegionControlResult;
29
44
  ...obj,
30
45
  });
31
46
  })(CreateHomeRegionControlResult = exports.CreateHomeRegionControlResult || (exports.CreateHomeRegionControlResult = {}));
47
+ class DryRunOperation extends MigrationHubConfigServiceException_1.MigrationHubConfigServiceException {
48
+ constructor(opts) {
49
+ super({
50
+ name: "DryRunOperation",
51
+ $fault: "client",
52
+ ...opts,
53
+ });
54
+ this.name = "DryRunOperation";
55
+ this.$fault = "client";
56
+ Object.setPrototypeOf(this, DryRunOperation.prototype);
57
+ this.Message = opts.Message;
58
+ }
59
+ }
60
+ exports.DryRunOperation = DryRunOperation;
61
+ class InternalServerError extends MigrationHubConfigServiceException_1.MigrationHubConfigServiceException {
62
+ constructor(opts) {
63
+ super({
64
+ name: "InternalServerError",
65
+ $fault: "server",
66
+ ...opts,
67
+ });
68
+ this.name = "InternalServerError";
69
+ this.$fault = "server";
70
+ Object.setPrototypeOf(this, InternalServerError.prototype);
71
+ this.Message = opts.Message;
72
+ }
73
+ }
74
+ exports.InternalServerError = InternalServerError;
75
+ class InvalidInputException extends MigrationHubConfigServiceException_1.MigrationHubConfigServiceException {
76
+ constructor(opts) {
77
+ super({
78
+ name: "InvalidInputException",
79
+ $fault: "client",
80
+ ...opts,
81
+ });
82
+ this.name = "InvalidInputException";
83
+ this.$fault = "client";
84
+ Object.setPrototypeOf(this, InvalidInputException.prototype);
85
+ this.Message = opts.Message;
86
+ }
87
+ }
88
+ exports.InvalidInputException = InvalidInputException;
89
+ class ServiceUnavailableException extends MigrationHubConfigServiceException_1.MigrationHubConfigServiceException {
90
+ constructor(opts) {
91
+ super({
92
+ name: "ServiceUnavailableException",
93
+ $fault: "server",
94
+ ...opts,
95
+ });
96
+ this.name = "ServiceUnavailableException";
97
+ this.$fault = "server";
98
+ Object.setPrototypeOf(this, ServiceUnavailableException.prototype);
99
+ this.Message = opts.Message;
100
+ }
101
+ }
102
+ exports.ServiceUnavailableException = ServiceUnavailableException;
103
+ class ThrottlingException extends MigrationHubConfigServiceException_1.MigrationHubConfigServiceException {
104
+ constructor(opts) {
105
+ super({
106
+ name: "ThrottlingException",
107
+ $fault: "client",
108
+ ...opts,
109
+ });
110
+ this.name = "ThrottlingException";
111
+ this.$fault = "client";
112
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
113
+ this.Message = opts.Message;
114
+ this.RetryAfterSeconds = opts.RetryAfterSeconds;
115
+ }
116
+ }
117
+ exports.ThrottlingException = ThrottlingException;
32
118
  var DescribeHomeRegionControlsRequest;
33
119
  (function (DescribeHomeRegionControlsRequest) {
34
120
  DescribeHomeRegionControlsRequest.filterSensitiveLog = (obj) => ({
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_json1_1GetHomeRegionCommand = exports.deserializeAws_json1_1DescribeHomeRegionControlsCommand = exports.deserializeAws_json1_1CreateHomeRegionControlCommand = exports.serializeAws_json1_1GetHomeRegionCommand = exports.serializeAws_json1_1DescribeHomeRegionControlsCommand = exports.serializeAws_json1_1CreateHomeRegionControlCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const MigrationHubConfigServiceException_1 = require("../models/MigrationHubConfigServiceException");
7
+ const models_0_1 = require("../models/models_0");
6
8
  const serializeAws_json1_1CreateHomeRegionControlCommand = async (input, context) => {
7
9
  const headers = {
8
10
  "content-type": "application/x-amz-json-1.1",
@@ -58,67 +60,31 @@ const deserializeAws_json1_1CreateHomeRegionControlCommandError = async (output,
58
60
  switch (errorCode) {
59
61
  case "AccessDeniedException":
60
62
  case "com.amazonaws.migrationhubconfig#AccessDeniedException":
61
- response = {
62
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
63
- name: errorCode,
64
- $metadata: deserializeMetadata(output),
65
- };
66
- break;
63
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
67
64
  case "DryRunOperation":
68
65
  case "com.amazonaws.migrationhubconfig#DryRunOperation":
69
- response = {
70
- ...(await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)),
71
- name: errorCode,
72
- $metadata: deserializeMetadata(output),
73
- };
74
- break;
66
+ throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
75
67
  case "InternalServerError":
76
68
  case "com.amazonaws.migrationhubconfig#InternalServerError":
77
- response = {
78
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
79
- name: errorCode,
80
- $metadata: deserializeMetadata(output),
81
- };
82
- break;
69
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
83
70
  case "InvalidInputException":
84
71
  case "com.amazonaws.migrationhubconfig#InvalidInputException":
85
- response = {
86
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
87
- name: errorCode,
88
- $metadata: deserializeMetadata(output),
89
- };
90
- break;
72
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
91
73
  case "ServiceUnavailableException":
92
74
  case "com.amazonaws.migrationhubconfig#ServiceUnavailableException":
93
- response = {
94
- ...(await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)),
95
- name: errorCode,
96
- $metadata: deserializeMetadata(output),
97
- };
98
- break;
75
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
99
76
  case "ThrottlingException":
100
77
  case "com.amazonaws.migrationhubconfig#ThrottlingException":
101
- response = {
102
- ...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
103
- name: errorCode,
104
- $metadata: deserializeMetadata(output),
105
- };
106
- break;
78
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
107
79
  default:
108
80
  const parsedBody = parsedOutput.body;
109
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
110
- response = {
111
- ...parsedBody,
112
- name: `${errorCode}`,
113
- message: parsedBody.message || parsedBody.Message || errorCode,
81
+ response = new MigrationHubConfigServiceException_1.MigrationHubConfigServiceException({
82
+ name: parsedBody.code || parsedBody.Code || errorCode,
114
83
  $fault: "client",
115
84
  $metadata: deserializeMetadata(output),
116
- };
85
+ });
86
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
117
87
  }
118
- const message = response.message || response.Message || errorCode;
119
- response.message = message;
120
- delete response.Message;
121
- return Promise.reject(Object.assign(new Error(message), response));
122
88
  };
123
89
  const deserializeAws_json1_1DescribeHomeRegionControlsCommand = async (output, context) => {
124
90
  if (output.statusCode >= 300) {
@@ -145,59 +111,28 @@ const deserializeAws_json1_1DescribeHomeRegionControlsCommandError = async (outp
145
111
  switch (errorCode) {
146
112
  case "AccessDeniedException":
147
113
  case "com.amazonaws.migrationhubconfig#AccessDeniedException":
148
- response = {
149
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
150
- name: errorCode,
151
- $metadata: deserializeMetadata(output),
152
- };
153
- break;
114
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
154
115
  case "InternalServerError":
155
116
  case "com.amazonaws.migrationhubconfig#InternalServerError":
156
- response = {
157
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
158
- name: errorCode,
159
- $metadata: deserializeMetadata(output),
160
- };
161
- break;
117
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
162
118
  case "InvalidInputException":
163
119
  case "com.amazonaws.migrationhubconfig#InvalidInputException":
164
- response = {
165
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
166
- name: errorCode,
167
- $metadata: deserializeMetadata(output),
168
- };
169
- break;
120
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
170
121
  case "ServiceUnavailableException":
171
122
  case "com.amazonaws.migrationhubconfig#ServiceUnavailableException":
172
- response = {
173
- ...(await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)),
174
- name: errorCode,
175
- $metadata: deserializeMetadata(output),
176
- };
177
- break;
123
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
178
124
  case "ThrottlingException":
179
125
  case "com.amazonaws.migrationhubconfig#ThrottlingException":
180
- response = {
181
- ...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
182
- name: errorCode,
183
- $metadata: deserializeMetadata(output),
184
- };
185
- break;
126
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
186
127
  default:
187
128
  const parsedBody = parsedOutput.body;
188
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
189
- response = {
190
- ...parsedBody,
191
- name: `${errorCode}`,
192
- message: parsedBody.message || parsedBody.Message || errorCode,
129
+ response = new MigrationHubConfigServiceException_1.MigrationHubConfigServiceException({
130
+ name: parsedBody.code || parsedBody.Code || errorCode,
193
131
  $fault: "client",
194
132
  $metadata: deserializeMetadata(output),
195
- };
133
+ });
134
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
196
135
  }
197
- const message = response.message || response.Message || errorCode;
198
- response.message = message;
199
- delete response.Message;
200
- return Promise.reject(Object.assign(new Error(message), response));
201
136
  };
202
137
  const deserializeAws_json1_1GetHomeRegionCommand = async (output, context) => {
203
138
  if (output.statusCode >= 300) {
@@ -224,125 +159,82 @@ const deserializeAws_json1_1GetHomeRegionCommandError = async (output, context)
224
159
  switch (errorCode) {
225
160
  case "AccessDeniedException":
226
161
  case "com.amazonaws.migrationhubconfig#AccessDeniedException":
227
- response = {
228
- ...(await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)),
229
- name: errorCode,
230
- $metadata: deserializeMetadata(output),
231
- };
232
- break;
162
+ throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
233
163
  case "InternalServerError":
234
164
  case "com.amazonaws.migrationhubconfig#InternalServerError":
235
- response = {
236
- ...(await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)),
237
- name: errorCode,
238
- $metadata: deserializeMetadata(output),
239
- };
240
- break;
165
+ throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
241
166
  case "InvalidInputException":
242
167
  case "com.amazonaws.migrationhubconfig#InvalidInputException":
243
- response = {
244
- ...(await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)),
245
- name: errorCode,
246
- $metadata: deserializeMetadata(output),
247
- };
248
- break;
168
+ throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
249
169
  case "ServiceUnavailableException":
250
170
  case "com.amazonaws.migrationhubconfig#ServiceUnavailableException":
251
- response = {
252
- ...(await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)),
253
- name: errorCode,
254
- $metadata: deserializeMetadata(output),
255
- };
256
- break;
171
+ throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
257
172
  case "ThrottlingException":
258
173
  case "com.amazonaws.migrationhubconfig#ThrottlingException":
259
- response = {
260
- ...(await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)),
261
- name: errorCode,
262
- $metadata: deserializeMetadata(output),
263
- };
264
- break;
174
+ throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
265
175
  default:
266
176
  const parsedBody = parsedOutput.body;
267
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
268
- response = {
269
- ...parsedBody,
270
- name: `${errorCode}`,
271
- message: parsedBody.message || parsedBody.Message || errorCode,
177
+ response = new MigrationHubConfigServiceException_1.MigrationHubConfigServiceException({
178
+ name: parsedBody.code || parsedBody.Code || errorCode,
272
179
  $fault: "client",
273
180
  $metadata: deserializeMetadata(output),
274
- };
181
+ });
182
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
275
183
  }
276
- const message = response.message || response.Message || errorCode;
277
- response.message = message;
278
- delete response.Message;
279
- return Promise.reject(Object.assign(new Error(message), response));
280
184
  };
281
185
  const deserializeAws_json1_1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
282
186
  const body = parsedOutput.body;
283
187
  const deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
284
- const contents = {
285
- name: "AccessDeniedException",
286
- $fault: "client",
188
+ const exception = new models_0_1.AccessDeniedException({
287
189
  $metadata: deserializeMetadata(parsedOutput),
288
190
  ...deserialized,
289
- };
290
- return contents;
191
+ });
192
+ return smithy_client_1.decorateServiceException(exception, body);
291
193
  };
292
194
  const deserializeAws_json1_1DryRunOperationResponse = async (parsedOutput, context) => {
293
195
  const body = parsedOutput.body;
294
196
  const deserialized = deserializeAws_json1_1DryRunOperation(body, context);
295
- const contents = {
296
- name: "DryRunOperation",
297
- $fault: "client",
197
+ const exception = new models_0_1.DryRunOperation({
298
198
  $metadata: deserializeMetadata(parsedOutput),
299
199
  ...deserialized,
300
- };
301
- return contents;
200
+ });
201
+ return smithy_client_1.decorateServiceException(exception, body);
302
202
  };
303
203
  const deserializeAws_json1_1InternalServerErrorResponse = async (parsedOutput, context) => {
304
204
  const body = parsedOutput.body;
305
205
  const deserialized = deserializeAws_json1_1InternalServerError(body, context);
306
- const contents = {
307
- name: "InternalServerError",
308
- $fault: "server",
206
+ const exception = new models_0_1.InternalServerError({
309
207
  $metadata: deserializeMetadata(parsedOutput),
310
208
  ...deserialized,
311
- };
312
- return contents;
209
+ });
210
+ return smithy_client_1.decorateServiceException(exception, body);
313
211
  };
314
212
  const deserializeAws_json1_1InvalidInputExceptionResponse = async (parsedOutput, context) => {
315
213
  const body = parsedOutput.body;
316
214
  const deserialized = deserializeAws_json1_1InvalidInputException(body, context);
317
- const contents = {
318
- name: "InvalidInputException",
319
- $fault: "client",
215
+ const exception = new models_0_1.InvalidInputException({
320
216
  $metadata: deserializeMetadata(parsedOutput),
321
217
  ...deserialized,
322
- };
323
- return contents;
218
+ });
219
+ return smithy_client_1.decorateServiceException(exception, body);
324
220
  };
325
221
  const deserializeAws_json1_1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
326
222
  const body = parsedOutput.body;
327
223
  const deserialized = deserializeAws_json1_1ServiceUnavailableException(body, context);
328
- const contents = {
329
- name: "ServiceUnavailableException",
330
- $fault: "server",
224
+ const exception = new models_0_1.ServiceUnavailableException({
331
225
  $metadata: deserializeMetadata(parsedOutput),
332
226
  ...deserialized,
333
- };
334
- return contents;
227
+ });
228
+ return smithy_client_1.decorateServiceException(exception, body);
335
229
  };
336
230
  const deserializeAws_json1_1ThrottlingExceptionResponse = async (parsedOutput, context) => {
337
231
  const body = parsedOutput.body;
338
232
  const deserialized = deserializeAws_json1_1ThrottlingException(body, context);
339
- const contents = {
340
- name: "ThrottlingException",
341
- $fault: "client",
233
+ const exception = new models_0_1.ThrottlingException({
342
234
  $metadata: deserializeMetadata(parsedOutput),
343
235
  ...deserialized,
344
- };
345
- return contents;
236
+ });
237
+ return smithy_client_1.decorateServiceException(exception, body);
346
238
  };
347
239
  const serializeAws_json1_1CreateHomeRegionControlRequest = (input, context) => {
348
240
  return {
@@ -414,7 +306,7 @@ const deserializeAws_json1_1HomeRegionControl = (output, context) => {
414
306
  };
415
307
  };
416
308
  const deserializeAws_json1_1HomeRegionControls = (output, context) => {
417
- return (output || [])
309
+ const retVal = (output || [])
418
310
  .filter((e) => e != null)
419
311
  .map((entry) => {
420
312
  if (entry === null) {
@@ -422,6 +314,7 @@ const deserializeAws_json1_1HomeRegionControls = (output, context) => {
422
314
  }
423
315
  return deserializeAws_json1_1HomeRegionControl(entry, context);
424
316
  });
317
+ return retVal;
425
318
  };
426
319
  const deserializeAws_json1_1InternalServerError = (output, context) => {
427
320
  return {
package/dist-es/index.js CHANGED
@@ -3,3 +3,4 @@ export * from "./MigrationHubConfigClient";
3
3
  export * from "./commands";
4
4
  export * from "./models";
5
5
  export * from "./pagination";
6
+ export { MigrationHubConfigServiceException } from "./models/MigrationHubConfigServiceException";
@@ -0,0 +1,12 @@
1
+ import { __extends } from "tslib";
2
+ import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client";
3
+ var MigrationHubConfigServiceException = (function (_super) {
4
+ __extends(MigrationHubConfigServiceException, _super);
5
+ function MigrationHubConfigServiceException(options) {
6
+ var _this = _super.call(this, options) || this;
7
+ Object.setPrototypeOf(_this, MigrationHubConfigServiceException.prototype);
8
+ return _this;
9
+ }
10
+ return MigrationHubConfigServiceException;
11
+ }(__ServiceException));
12
+ export { MigrationHubConfigServiceException };
@@ -1,4 +1,18 @@
1
- import { __assign } from "tslib";
1
+ import { __assign, __extends } from "tslib";
2
+ import { MigrationHubConfigServiceException as __BaseException } from "./MigrationHubConfigServiceException";
3
+ var AccessDeniedException = (function (_super) {
4
+ __extends(AccessDeniedException, _super);
5
+ function AccessDeniedException(opts) {
6
+ var _this = _super.call(this, __assign({ name: "AccessDeniedException", $fault: "client" }, opts)) || this;
7
+ _this.name = "AccessDeniedException";
8
+ _this.$fault = "client";
9
+ Object.setPrototypeOf(_this, AccessDeniedException.prototype);
10
+ _this.Message = opts.Message;
11
+ return _this;
12
+ }
13
+ return AccessDeniedException;
14
+ }(__BaseException));
15
+ export { AccessDeniedException };
2
16
  export var TargetType;
3
17
  (function (TargetType) {
4
18
  TargetType["ACCOUNT"] = "ACCOUNT";
@@ -19,6 +33,72 @@ export var CreateHomeRegionControlResult;
19
33
  (function (CreateHomeRegionControlResult) {
20
34
  CreateHomeRegionControlResult.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
21
35
  })(CreateHomeRegionControlResult || (CreateHomeRegionControlResult = {}));
36
+ var DryRunOperation = (function (_super) {
37
+ __extends(DryRunOperation, _super);
38
+ function DryRunOperation(opts) {
39
+ var _this = _super.call(this, __assign({ name: "DryRunOperation", $fault: "client" }, opts)) || this;
40
+ _this.name = "DryRunOperation";
41
+ _this.$fault = "client";
42
+ Object.setPrototypeOf(_this, DryRunOperation.prototype);
43
+ _this.Message = opts.Message;
44
+ return _this;
45
+ }
46
+ return DryRunOperation;
47
+ }(__BaseException));
48
+ export { DryRunOperation };
49
+ var InternalServerError = (function (_super) {
50
+ __extends(InternalServerError, _super);
51
+ function InternalServerError(opts) {
52
+ var _this = _super.call(this, __assign({ name: "InternalServerError", $fault: "server" }, opts)) || this;
53
+ _this.name = "InternalServerError";
54
+ _this.$fault = "server";
55
+ Object.setPrototypeOf(_this, InternalServerError.prototype);
56
+ _this.Message = opts.Message;
57
+ return _this;
58
+ }
59
+ return InternalServerError;
60
+ }(__BaseException));
61
+ export { InternalServerError };
62
+ var InvalidInputException = (function (_super) {
63
+ __extends(InvalidInputException, _super);
64
+ function InvalidInputException(opts) {
65
+ var _this = _super.call(this, __assign({ name: "InvalidInputException", $fault: "client" }, opts)) || this;
66
+ _this.name = "InvalidInputException";
67
+ _this.$fault = "client";
68
+ Object.setPrototypeOf(_this, InvalidInputException.prototype);
69
+ _this.Message = opts.Message;
70
+ return _this;
71
+ }
72
+ return InvalidInputException;
73
+ }(__BaseException));
74
+ export { InvalidInputException };
75
+ var ServiceUnavailableException = (function (_super) {
76
+ __extends(ServiceUnavailableException, _super);
77
+ function ServiceUnavailableException(opts) {
78
+ var _this = _super.call(this, __assign({ name: "ServiceUnavailableException", $fault: "server" }, opts)) || this;
79
+ _this.name = "ServiceUnavailableException";
80
+ _this.$fault = "server";
81
+ Object.setPrototypeOf(_this, ServiceUnavailableException.prototype);
82
+ _this.Message = opts.Message;
83
+ return _this;
84
+ }
85
+ return ServiceUnavailableException;
86
+ }(__BaseException));
87
+ export { ServiceUnavailableException };
88
+ var ThrottlingException = (function (_super) {
89
+ __extends(ThrottlingException, _super);
90
+ function ThrottlingException(opts) {
91
+ var _this = _super.call(this, __assign({ name: "ThrottlingException", $fault: "client" }, opts)) || this;
92
+ _this.name = "ThrottlingException";
93
+ _this.$fault = "client";
94
+ Object.setPrototypeOf(_this, ThrottlingException.prototype);
95
+ _this.Message = opts.Message;
96
+ _this.RetryAfterSeconds = opts.RetryAfterSeconds;
97
+ return _this;
98
+ }
99
+ return ThrottlingException;
100
+ }(__BaseException));
101
+ export { ThrottlingException };
22
102
  export var DescribeHomeRegionControlsRequest;
23
103
  (function (DescribeHomeRegionControlsRequest) {
24
104
  DescribeHomeRegionControlsRequest.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };
@@ -1,6 +1,8 @@
1
1
  import { __assign, __awaiter, __generator } from "tslib";
2
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
3
- import { expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
3
+ import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, } from "@aws-sdk/smithy-client";
4
+ import { MigrationHubConfigServiceException as __BaseException } from "../models/MigrationHubConfigServiceException";
5
+ import { AccessDeniedException, DryRunOperation, InternalServerError, InvalidInputException, ServiceUnavailableException, ThrottlingException, } from "../models/models_0";
4
6
  export var serializeAws_json1_1CreateHomeRegionControlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
5
7
  var headers, body;
6
8
  return __generator(this, function (_a) {
@@ -53,16 +55,16 @@ export var deserializeAws_json1_1CreateHomeRegionControlCommand = function (outp
53
55
  });
54
56
  }); };
55
57
  var deserializeAws_json1_1CreateHomeRegionControlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
56
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;
57
- var _j;
58
- return __generator(this, function (_k) {
59
- switch (_k.label) {
58
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
59
+ var _c;
60
+ return __generator(this, function (_d) {
61
+ switch (_d.label) {
60
62
  case 0:
61
63
  _a = [__assign({}, output)];
62
- _j = {};
64
+ _c = {};
63
65
  return [4, parseBody(output.body, context)];
64
66
  case 1:
65
- parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));
67
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
66
68
  errorCode = "UnknownError";
67
69
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
68
70
  _b = errorCode;
@@ -81,52 +83,26 @@ var deserializeAws_json1_1CreateHomeRegionControlCommandError = function (output
81
83
  case "com.amazonaws.migrationhubconfig#ThrottlingException": return [3, 12];
82
84
  }
83
85
  return [3, 14];
84
- case 2:
85
- _c = [{}];
86
- return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
87
- case 3:
88
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
89
- return [3, 15];
90
- case 4:
91
- _d = [{}];
92
- return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
93
- case 5:
94
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
95
- return [3, 15];
96
- case 6:
97
- _e = [{}];
98
- return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
99
- case 7:
100
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
101
- return [3, 15];
102
- case 8:
103
- _f = [{}];
104
- return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
105
- case 9:
106
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
107
- return [3, 15];
108
- case 10:
109
- _g = [{}];
110
- return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
111
- case 11:
112
- response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
113
- return [3, 15];
114
- case 12:
115
- _h = [{}];
116
- return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
117
- case 13:
118
- response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
119
- return [3, 15];
86
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
87
+ case 3: throw _d.sent();
88
+ case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
89
+ case 5: throw _d.sent();
90
+ case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
91
+ case 7: throw _d.sent();
92
+ case 8: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
93
+ case 9: throw _d.sent();
94
+ case 10: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
95
+ case 11: throw _d.sent();
96
+ case 12: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
97
+ case 13: throw _d.sent();
120
98
  case 14:
121
99
  parsedBody = parsedOutput.body;
122
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
123
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
124
- _k.label = 15;
125
- case 15:
126
- message = response.message || response.Message || errorCode;
127
- response.message = message;
128
- delete response.Message;
129
- return [2, Promise.reject(Object.assign(new Error(message), response))];
100
+ response = new __BaseException({
101
+ name: parsedBody.code || parsedBody.Code || errorCode,
102
+ $fault: "client",
103
+ $metadata: deserializeMetadata(output),
104
+ });
105
+ throw __decorateServiceException(response, parsedBody);
130
106
  }
131
107
  });
132
108
  }); };
@@ -149,16 +125,16 @@ export var deserializeAws_json1_1DescribeHomeRegionControlsCommand = function (o
149
125
  });
150
126
  }); };
151
127
  var deserializeAws_json1_1DescribeHomeRegionControlsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
152
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
153
- var _h;
154
- return __generator(this, function (_j) {
155
- switch (_j.label) {
128
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
129
+ var _c;
130
+ return __generator(this, function (_d) {
131
+ switch (_d.label) {
156
132
  case 0:
157
133
  _a = [__assign({}, output)];
158
- _h = {};
134
+ _c = {};
159
135
  return [4, parseBody(output.body, context)];
160
136
  case 1:
161
- parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
137
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
162
138
  errorCode = "UnknownError";
163
139
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
164
140
  _b = errorCode;
@@ -175,46 +151,24 @@ var deserializeAws_json1_1DescribeHomeRegionControlsCommandError = function (out
175
151
  case "com.amazonaws.migrationhubconfig#ThrottlingException": return [3, 10];
176
152
  }
177
153
  return [3, 12];
178
- case 2:
179
- _c = [{}];
180
- return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
181
- case 3:
182
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
183
- return [3, 13];
184
- case 4:
185
- _d = [{}];
186
- return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
187
- case 5:
188
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
189
- return [3, 13];
190
- case 6:
191
- _e = [{}];
192
- return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
193
- case 7:
194
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
195
- return [3, 13];
196
- case 8:
197
- _f = [{}];
198
- return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
199
- case 9:
200
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
201
- return [3, 13];
202
- case 10:
203
- _g = [{}];
204
- return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
205
- case 11:
206
- response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
207
- return [3, 13];
154
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
155
+ case 3: throw _d.sent();
156
+ case 4: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
157
+ case 5: throw _d.sent();
158
+ case 6: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
159
+ case 7: throw _d.sent();
160
+ case 8: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
161
+ case 9: throw _d.sent();
162
+ case 10: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
163
+ case 11: throw _d.sent();
208
164
  case 12:
209
165
  parsedBody = parsedOutput.body;
210
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
211
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
212
- _j.label = 13;
213
- case 13:
214
- message = response.message || response.Message || errorCode;
215
- response.message = message;
216
- delete response.Message;
217
- return [2, Promise.reject(Object.assign(new Error(message), response))];
166
+ response = new __BaseException({
167
+ name: parsedBody.code || parsedBody.Code || errorCode,
168
+ $fault: "client",
169
+ $metadata: deserializeMetadata(output),
170
+ });
171
+ throw __decorateServiceException(response, parsedBody);
218
172
  }
219
173
  });
220
174
  }); };
@@ -237,16 +191,16 @@ export var deserializeAws_json1_1GetHomeRegionCommand = function (output, contex
237
191
  });
238
192
  }); };
239
193
  var deserializeAws_json1_1GetHomeRegionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
240
- var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;
241
- var _h;
242
- return __generator(this, function (_j) {
243
- switch (_j.label) {
194
+ var parsedOutput, _a, response, errorCode, _b, parsedBody;
195
+ var _c;
196
+ return __generator(this, function (_d) {
197
+ switch (_d.label) {
244
198
  case 0:
245
199
  _a = [__assign({}, output)];
246
- _h = {};
200
+ _c = {};
247
201
  return [4, parseBody(output.body, context)];
248
202
  case 1:
249
- parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));
203
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
250
204
  errorCode = "UnknownError";
251
205
  errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
252
206
  _b = errorCode;
@@ -263,101 +217,79 @@ var deserializeAws_json1_1GetHomeRegionCommandError = function (output, context)
263
217
  case "com.amazonaws.migrationhubconfig#ThrottlingException": return [3, 10];
264
218
  }
265
219
  return [3, 12];
266
- case 2:
267
- _c = [{}];
268
- return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
269
- case 3:
270
- response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
271
- return [3, 13];
272
- case 4:
273
- _d = [{}];
274
- return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
275
- case 5:
276
- response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
277
- return [3, 13];
278
- case 6:
279
- _e = [{}];
280
- return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
281
- case 7:
282
- response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
283
- return [3, 13];
284
- case 8:
285
- _f = [{}];
286
- return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
287
- case 9:
288
- response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
289
- return [3, 13];
290
- case 10:
291
- _g = [{}];
292
- return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
293
- case 11:
294
- response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);
295
- return [3, 13];
220
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
221
+ case 3: throw _d.sent();
222
+ case 4: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
223
+ case 5: throw _d.sent();
224
+ case 6: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
225
+ case 7: throw _d.sent();
226
+ case 8: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
227
+ case 9: throw _d.sent();
228
+ case 10: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
229
+ case 11: throw _d.sent();
296
230
  case 12:
297
231
  parsedBody = parsedOutput.body;
298
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
299
- response = __assign(__assign({}, parsedBody), { name: "" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: "client", $metadata: deserializeMetadata(output) });
300
- _j.label = 13;
301
- case 13:
302
- message = response.message || response.Message || errorCode;
303
- response.message = message;
304
- delete response.Message;
305
- return [2, Promise.reject(Object.assign(new Error(message), response))];
232
+ response = new __BaseException({
233
+ name: parsedBody.code || parsedBody.Code || errorCode,
234
+ $fault: "client",
235
+ $metadata: deserializeMetadata(output),
236
+ });
237
+ throw __decorateServiceException(response, parsedBody);
306
238
  }
307
239
  });
308
240
  }); };
309
241
  var deserializeAws_json1_1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
310
- var body, deserialized, contents;
242
+ var body, deserialized, exception;
311
243
  return __generator(this, function (_a) {
312
244
  body = parsedOutput.body;
313
245
  deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
314
- contents = __assign({ name: "AccessDeniedException", $fault: "client", $metadata: deserializeMetadata(parsedOutput) }, deserialized);
315
- return [2, contents];
246
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
247
+ return [2, __decorateServiceException(exception, body)];
316
248
  });
317
249
  }); };
318
250
  var deserializeAws_json1_1DryRunOperationResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
319
- var body, deserialized, contents;
251
+ var body, deserialized, exception;
320
252
  return __generator(this, function (_a) {
321
253
  body = parsedOutput.body;
322
254
  deserialized = deserializeAws_json1_1DryRunOperation(body, context);
323
- contents = __assign({ name: "DryRunOperation", $fault: "client", $metadata: deserializeMetadata(parsedOutput) }, deserialized);
324
- return [2, contents];
255
+ exception = new DryRunOperation(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
256
+ return [2, __decorateServiceException(exception, body)];
325
257
  });
326
258
  }); };
327
259
  var deserializeAws_json1_1InternalServerErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
328
- var body, deserialized, contents;
260
+ var body, deserialized, exception;
329
261
  return __generator(this, function (_a) {
330
262
  body = parsedOutput.body;
331
263
  deserialized = deserializeAws_json1_1InternalServerError(body, context);
332
- contents = __assign({ name: "InternalServerError", $fault: "server", $metadata: deserializeMetadata(parsedOutput) }, deserialized);
333
- return [2, contents];
264
+ exception = new InternalServerError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
265
+ return [2, __decorateServiceException(exception, body)];
334
266
  });
335
267
  }); };
336
268
  var deserializeAws_json1_1InvalidInputExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
337
- var body, deserialized, contents;
269
+ var body, deserialized, exception;
338
270
  return __generator(this, function (_a) {
339
271
  body = parsedOutput.body;
340
272
  deserialized = deserializeAws_json1_1InvalidInputException(body, context);
341
- contents = __assign({ name: "InvalidInputException", $fault: "client", $metadata: deserializeMetadata(parsedOutput) }, deserialized);
342
- return [2, contents];
273
+ exception = new InvalidInputException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
274
+ return [2, __decorateServiceException(exception, body)];
343
275
  });
344
276
  }); };
345
277
  var deserializeAws_json1_1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
346
- var body, deserialized, contents;
278
+ var body, deserialized, exception;
347
279
  return __generator(this, function (_a) {
348
280
  body = parsedOutput.body;
349
281
  deserialized = deserializeAws_json1_1ServiceUnavailableException(body, context);
350
- contents = __assign({ name: "ServiceUnavailableException", $fault: "server", $metadata: deserializeMetadata(parsedOutput) }, deserialized);
351
- return [2, contents];
282
+ exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
283
+ return [2, __decorateServiceException(exception, body)];
352
284
  });
353
285
  }); };
354
286
  var deserializeAws_json1_1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
355
- var body, deserialized, contents;
287
+ var body, deserialized, exception;
356
288
  return __generator(this, function (_a) {
357
289
  body = parsedOutput.body;
358
290
  deserialized = deserializeAws_json1_1ThrottlingException(body, context);
359
- contents = __assign({ name: "ThrottlingException", $fault: "client", $metadata: deserializeMetadata(parsedOutput) }, deserialized);
360
- return [2, contents];
291
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
292
+ return [2, __decorateServiceException(exception, body)];
361
293
  });
362
294
  }); };
363
295
  var serializeAws_json1_1CreateHomeRegionControlRequest = function (input, context) {
@@ -417,7 +349,7 @@ var deserializeAws_json1_1HomeRegionControl = function (output, context) {
417
349
  };
418
350
  };
419
351
  var deserializeAws_json1_1HomeRegionControls = function (output, context) {
420
- return (output || [])
352
+ var retVal = (output || [])
421
353
  .filter(function (e) { return e != null; })
422
354
  .map(function (entry) {
423
355
  if (entry === null) {
@@ -425,6 +357,7 @@ var deserializeAws_json1_1HomeRegionControls = function (output, context) {
425
357
  }
426
358
  return deserializeAws_json1_1HomeRegionControl(entry, context);
427
359
  });
360
+ return retVal;
428
361
  };
429
362
  var deserializeAws_json1_1InternalServerError = function (output, context) {
430
363
  return {
@@ -3,3 +3,4 @@ export * from "./MigrationHubConfigClient";
3
3
  export * from "./commands";
4
4
  export * from "./models";
5
5
  export * from "./pagination";
6
+ export { MigrationHubConfigServiceException } from "./models/MigrationHubConfigServiceException";
@@ -0,0 +1,10 @@
1
+ import { ServiceException as __ServiceException, ServiceExceptionOptions as __ServiceExceptionOptions } from "@aws-sdk/smithy-client";
2
+ /**
3
+ * Base exception class for all service exceptions from MigrationHubConfig service.
4
+ */
5
+ export declare class MigrationHubConfigServiceException extends __ServiceException {
6
+ /**
7
+ * @internal
8
+ */
9
+ constructor(options: __ServiceExceptionOptions);
10
+ }
@@ -1,11 +1,16 @@
1
- import { MetadataBearer as $MetadataBearer, SmithyException as __SmithyException } from "@aws-sdk/types";
1
+ import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client";
2
+ import { MigrationHubConfigServiceException as __BaseException } from "./MigrationHubConfigServiceException";
2
3
  /**
3
4
  * <p>You do not have sufficient access to perform this action.</p>
4
5
  */
5
- export interface AccessDeniedException extends __SmithyException, $MetadataBearer {
6
- name: "AccessDeniedException";
7
- $fault: "client";
6
+ export declare class AccessDeniedException extends __BaseException {
7
+ readonly name: "AccessDeniedException";
8
+ readonly $fault: "client";
8
9
  Message?: string;
10
+ /**
11
+ * @internal
12
+ */
13
+ constructor(opts: __ExceptionOptionType<AccessDeniedException, __BaseException>);
9
14
  }
10
15
  export declare enum TargetType {
11
16
  ACCOUNT = "ACCOUNT"
@@ -105,49 +110,69 @@ export declare namespace CreateHomeRegionControlResult {
105
110
  * <p>Exception raised to indicate that authorization of an action was successful, when the
106
111
  * <code>DryRun</code> flag is set to true.</p>
107
112
  */
108
- export interface DryRunOperation extends __SmithyException, $MetadataBearer {
109
- name: "DryRunOperation";
110
- $fault: "client";
113
+ export declare class DryRunOperation extends __BaseException {
114
+ readonly name: "DryRunOperation";
115
+ readonly $fault: "client";
111
116
  Message?: string;
117
+ /**
118
+ * @internal
119
+ */
120
+ constructor(opts: __ExceptionOptionType<DryRunOperation, __BaseException>);
112
121
  }
113
122
  /**
114
123
  * <p>Exception raised when an internal, configuration, or dependency error is
115
124
  * encountered.</p>
116
125
  */
117
- export interface InternalServerError extends __SmithyException, $MetadataBearer {
118
- name: "InternalServerError";
119
- $fault: "server";
126
+ export declare class InternalServerError extends __BaseException {
127
+ readonly name: "InternalServerError";
128
+ readonly $fault: "server";
120
129
  Message?: string;
130
+ /**
131
+ * @internal
132
+ */
133
+ constructor(opts: __ExceptionOptionType<InternalServerError, __BaseException>);
121
134
  }
122
135
  /**
123
136
  * <p>Exception raised when the provided input violates a policy constraint or is entered in the
124
137
  * wrong format or data type.</p>
125
138
  */
126
- export interface InvalidInputException extends __SmithyException, $MetadataBearer {
127
- name: "InvalidInputException";
128
- $fault: "client";
139
+ export declare class InvalidInputException extends __BaseException {
140
+ readonly name: "InvalidInputException";
141
+ readonly $fault: "client";
129
142
  Message?: string;
143
+ /**
144
+ * @internal
145
+ */
146
+ constructor(opts: __ExceptionOptionType<InvalidInputException, __BaseException>);
130
147
  }
131
148
  /**
132
149
  * <p>Exception raised when a request fails due to temporary unavailability of the
133
150
  * service.</p>
134
151
  */
135
- export interface ServiceUnavailableException extends __SmithyException, $MetadataBearer {
136
- name: "ServiceUnavailableException";
137
- $fault: "server";
152
+ export declare class ServiceUnavailableException extends __BaseException {
153
+ readonly name: "ServiceUnavailableException";
154
+ readonly $fault: "server";
138
155
  Message?: string;
156
+ /**
157
+ * @internal
158
+ */
159
+ constructor(opts: __ExceptionOptionType<ServiceUnavailableException, __BaseException>);
139
160
  }
140
161
  /**
141
162
  * <p>The request was denied due to request throttling.</p>
142
163
  */
143
- export interface ThrottlingException extends __SmithyException, $MetadataBearer {
144
- name: "ThrottlingException";
145
- $fault: "client";
164
+ export declare class ThrottlingException extends __BaseException {
165
+ readonly name: "ThrottlingException";
166
+ readonly $fault: "client";
146
167
  Message: string | undefined;
147
168
  /**
148
169
  * <p>The number of seconds the caller should wait before retrying.</p>
149
170
  */
150
171
  RetryAfterSeconds?: number;
172
+ /**
173
+ * @internal
174
+ */
175
+ constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>);
151
176
  }
152
177
  export interface DescribeHomeRegionControlsRequest {
153
178
  /**
@@ -3,3 +3,4 @@ export * from "./MigrationHubConfigClient";
3
3
  export * from "./commands";
4
4
  export * from "./models";
5
5
  export * from "./pagination";
6
+ export { MigrationHubConfigServiceException } from "./models/MigrationHubConfigServiceException";
@@ -0,0 +1,6 @@
1
+ import { ServiceException as __ServiceException, ServiceExceptionOptions as __ServiceExceptionOptions } from "@aws-sdk/smithy-client";
2
+
3
+ export declare class MigrationHubConfigServiceException extends __ServiceException {
4
+
5
+ constructor(options: __ServiceExceptionOptions);
6
+ }
@@ -1,9 +1,12 @@
1
- import { MetadataBearer as $MetadataBearer, SmithyException as __SmithyException } from "@aws-sdk/types";
1
+ import { ExceptionOptionType as __ExceptionOptionType } from "@aws-sdk/smithy-client";
2
+ import { MigrationHubConfigServiceException as __BaseException } from "./MigrationHubConfigServiceException";
2
3
 
3
- export interface AccessDeniedException extends __SmithyException, $MetadataBearer {
4
- name: "AccessDeniedException";
5
- $fault: "client";
4
+ export declare class AccessDeniedException extends __BaseException {
5
+ readonly name: "AccessDeniedException";
6
+ readonly $fault: "client";
6
7
  Message?: string;
8
+
9
+ constructor(opts: __ExceptionOptionType<AccessDeniedException, __BaseException>);
7
10
  }
8
11
  export declare enum TargetType {
9
12
  ACCOUNT = "ACCOUNT"
@@ -55,36 +58,46 @@ export declare namespace CreateHomeRegionControlResult {
55
58
  const filterSensitiveLog: (obj: CreateHomeRegionControlResult) => any;
56
59
  }
57
60
 
58
- export interface DryRunOperation extends __SmithyException, $MetadataBearer {
59
- name: "DryRunOperation";
60
- $fault: "client";
61
+ export declare class DryRunOperation extends __BaseException {
62
+ readonly name: "DryRunOperation";
63
+ readonly $fault: "client";
61
64
  Message?: string;
65
+
66
+ constructor(opts: __ExceptionOptionType<DryRunOperation, __BaseException>);
62
67
  }
63
68
 
64
- export interface InternalServerError extends __SmithyException, $MetadataBearer {
65
- name: "InternalServerError";
66
- $fault: "server";
69
+ export declare class InternalServerError extends __BaseException {
70
+ readonly name: "InternalServerError";
71
+ readonly $fault: "server";
67
72
  Message?: string;
73
+
74
+ constructor(opts: __ExceptionOptionType<InternalServerError, __BaseException>);
68
75
  }
69
76
 
70
- export interface InvalidInputException extends __SmithyException, $MetadataBearer {
71
- name: "InvalidInputException";
72
- $fault: "client";
77
+ export declare class InvalidInputException extends __BaseException {
78
+ readonly name: "InvalidInputException";
79
+ readonly $fault: "client";
73
80
  Message?: string;
81
+
82
+ constructor(opts: __ExceptionOptionType<InvalidInputException, __BaseException>);
74
83
  }
75
84
 
76
- export interface ServiceUnavailableException extends __SmithyException, $MetadataBearer {
77
- name: "ServiceUnavailableException";
78
- $fault: "server";
85
+ export declare class ServiceUnavailableException extends __BaseException {
86
+ readonly name: "ServiceUnavailableException";
87
+ readonly $fault: "server";
79
88
  Message?: string;
89
+
90
+ constructor(opts: __ExceptionOptionType<ServiceUnavailableException, __BaseException>);
80
91
  }
81
92
 
82
- export interface ThrottlingException extends __SmithyException, $MetadataBearer {
83
- name: "ThrottlingException";
84
- $fault: "client";
93
+ export declare class ThrottlingException extends __BaseException {
94
+ readonly name: "ThrottlingException";
95
+ readonly $fault: "client";
85
96
  Message: string | undefined;
86
97
 
87
98
  RetryAfterSeconds?: number;
99
+
100
+ constructor(opts: __ExceptionOptionType<ThrottlingException, __BaseException>);
88
101
  }
89
102
  export interface DescribeHomeRegionControlsRequest {
90
103
 
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.52.0",
4
+ "version": "3.53.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",
@@ -18,34 +18,34 @@
18
18
  "dependencies": {
19
19
  "@aws-crypto/sha256-browser": "2.0.0",
20
20
  "@aws-crypto/sha256-js": "2.0.0",
21
- "@aws-sdk/client-sts": "3.52.0",
22
- "@aws-sdk/config-resolver": "3.52.0",
23
- "@aws-sdk/credential-provider-node": "3.52.0",
24
- "@aws-sdk/fetch-http-handler": "3.52.0",
25
- "@aws-sdk/hash-node": "3.52.0",
26
- "@aws-sdk/invalid-dependency": "3.52.0",
27
- "@aws-sdk/middleware-content-length": "3.52.0",
28
- "@aws-sdk/middleware-host-header": "3.52.0",
29
- "@aws-sdk/middleware-logger": "3.52.0",
30
- "@aws-sdk/middleware-retry": "3.52.0",
31
- "@aws-sdk/middleware-serde": "3.52.0",
32
- "@aws-sdk/middleware-signing": "3.52.0",
33
- "@aws-sdk/middleware-stack": "3.52.0",
34
- "@aws-sdk/middleware-user-agent": "3.52.0",
35
- "@aws-sdk/node-config-provider": "3.52.0",
36
- "@aws-sdk/node-http-handler": "3.52.0",
37
- "@aws-sdk/protocol-http": "3.52.0",
38
- "@aws-sdk/smithy-client": "3.52.0",
39
- "@aws-sdk/types": "3.52.0",
40
- "@aws-sdk/url-parser": "3.52.0",
21
+ "@aws-sdk/client-sts": "3.53.0",
22
+ "@aws-sdk/config-resolver": "3.53.0",
23
+ "@aws-sdk/credential-provider-node": "3.53.0",
24
+ "@aws-sdk/fetch-http-handler": "3.53.0",
25
+ "@aws-sdk/hash-node": "3.53.0",
26
+ "@aws-sdk/invalid-dependency": "3.53.0",
27
+ "@aws-sdk/middleware-content-length": "3.53.0",
28
+ "@aws-sdk/middleware-host-header": "3.53.0",
29
+ "@aws-sdk/middleware-logger": "3.53.0",
30
+ "@aws-sdk/middleware-retry": "3.53.0",
31
+ "@aws-sdk/middleware-serde": "3.53.0",
32
+ "@aws-sdk/middleware-signing": "3.53.0",
33
+ "@aws-sdk/middleware-stack": "3.53.0",
34
+ "@aws-sdk/middleware-user-agent": "3.53.0",
35
+ "@aws-sdk/node-config-provider": "3.53.0",
36
+ "@aws-sdk/node-http-handler": "3.53.0",
37
+ "@aws-sdk/protocol-http": "3.53.0",
38
+ "@aws-sdk/smithy-client": "3.53.0",
39
+ "@aws-sdk/types": "3.53.0",
40
+ "@aws-sdk/url-parser": "3.53.0",
41
41
  "@aws-sdk/util-base64-browser": "3.52.0",
42
42
  "@aws-sdk/util-base64-node": "3.52.0",
43
43
  "@aws-sdk/util-body-length-browser": "3.52.0",
44
44
  "@aws-sdk/util-body-length-node": "3.52.0",
45
- "@aws-sdk/util-defaults-mode-browser": "3.52.0",
46
- "@aws-sdk/util-defaults-mode-node": "3.52.0",
47
- "@aws-sdk/util-user-agent-browser": "3.52.0",
48
- "@aws-sdk/util-user-agent-node": "3.52.0",
45
+ "@aws-sdk/util-defaults-mode-browser": "3.53.0",
46
+ "@aws-sdk/util-defaults-mode-node": "3.53.0",
47
+ "@aws-sdk/util-user-agent-browser": "3.53.0",
48
+ "@aws-sdk/util-user-agent-node": "3.53.0",
49
49
  "@aws-sdk/util-utf8-browser": "3.52.0",
50
50
  "@aws-sdk/util-utf8-node": "3.52.0",
51
51
  "tslib": "^2.3.0"