@aws-sdk/client-migrationhub-config 3.183.0 → 3.185.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,264 +1,325 @@
1
+ import { __assign, __awaiter, __generator } from "tslib";
1
2
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
3
  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";
3
4
  import { MigrationHubConfigServiceException as __BaseException } from "../models/MigrationHubConfigServiceException";
4
5
  import { AccessDeniedException, DryRunOperation, InternalServerError, InvalidInputException, ServiceUnavailableException, ThrottlingException, } from "../models/models_0";
5
- export const serializeAws_json1_1CreateHomeRegionControlCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.1",
8
- "x-amz-target": "AWSMigrationHubMultiAccountService.CreateHomeRegionControl",
9
- };
10
- let body;
11
- body = JSON.stringify(serializeAws_json1_1CreateHomeRegionControlRequest(input, context));
12
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
- };
14
- export const serializeAws_json1_1DescribeHomeRegionControlsCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.1",
17
- "x-amz-target": "AWSMigrationHubMultiAccountService.DescribeHomeRegionControls",
18
- };
19
- let body;
20
- body = JSON.stringify(serializeAws_json1_1DescribeHomeRegionControlsRequest(input, context));
21
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
- };
23
- export const serializeAws_json1_1GetHomeRegionCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.1",
26
- "x-amz-target": "AWSMigrationHubMultiAccountService.GetHomeRegion",
27
- };
28
- let body;
29
- body = JSON.stringify(serializeAws_json1_1GetHomeRegionRequest(input, context));
30
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
- };
32
- export const deserializeAws_json1_1CreateHomeRegionControlCommand = async (output, context) => {
33
- if (output.statusCode >= 300) {
34
- return deserializeAws_json1_1CreateHomeRegionControlCommandError(output, context);
35
- }
36
- const data = await parseBody(output.body, context);
37
- let contents = {};
38
- contents = deserializeAws_json1_1CreateHomeRegionControlResult(data, context);
39
- const response = {
40
- $metadata: deserializeMetadata(output),
41
- ...contents,
42
- };
43
- return Promise.resolve(response);
44
- };
45
- const deserializeAws_json1_1CreateHomeRegionControlCommandError = async (output, context) => {
46
- const parsedOutput = {
47
- ...output,
48
- body: await parseErrorBody(output.body, context),
49
- };
50
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
51
- switch (errorCode) {
52
- case "AccessDeniedException":
53
- case "com.amazonaws.migrationhubconfig#AccessDeniedException":
54
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
55
- case "DryRunOperation":
56
- case "com.amazonaws.migrationhubconfig#DryRunOperation":
57
- throw await deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context);
58
- case "InternalServerError":
59
- case "com.amazonaws.migrationhubconfig#InternalServerError":
60
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
61
- case "InvalidInputException":
62
- case "com.amazonaws.migrationhubconfig#InvalidInputException":
63
- throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
64
- case "ServiceUnavailableException":
65
- case "com.amazonaws.migrationhubconfig#ServiceUnavailableException":
66
- throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
67
- case "ThrottlingException":
68
- case "com.amazonaws.migrationhubconfig#ThrottlingException":
69
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
70
- default:
71
- const parsedBody = parsedOutput.body;
72
- throwDefaultError({
73
- output,
74
- parsedBody,
75
- exceptionCtor: __BaseException,
76
- errorCode,
77
- });
78
- }
79
- };
80
- export const deserializeAws_json1_1DescribeHomeRegionControlsCommand = async (output, context) => {
81
- if (output.statusCode >= 300) {
82
- return deserializeAws_json1_1DescribeHomeRegionControlsCommandError(output, context);
83
- }
84
- const data = await parseBody(output.body, context);
85
- let contents = {};
86
- contents = deserializeAws_json1_1DescribeHomeRegionControlsResult(data, context);
87
- const response = {
88
- $metadata: deserializeMetadata(output),
89
- ...contents,
90
- };
91
- return Promise.resolve(response);
92
- };
93
- const deserializeAws_json1_1DescribeHomeRegionControlsCommandError = async (output, context) => {
94
- const parsedOutput = {
95
- ...output,
96
- body: await parseErrorBody(output.body, context),
97
- };
98
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
99
- switch (errorCode) {
100
- case "AccessDeniedException":
101
- case "com.amazonaws.migrationhubconfig#AccessDeniedException":
102
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
103
- case "InternalServerError":
104
- case "com.amazonaws.migrationhubconfig#InternalServerError":
105
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
106
- case "InvalidInputException":
107
- case "com.amazonaws.migrationhubconfig#InvalidInputException":
108
- throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
109
- case "ServiceUnavailableException":
110
- case "com.amazonaws.migrationhubconfig#ServiceUnavailableException":
111
- throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
112
- case "ThrottlingException":
113
- case "com.amazonaws.migrationhubconfig#ThrottlingException":
114
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
115
- default:
116
- const parsedBody = parsedOutput.body;
117
- throwDefaultError({
118
- output,
119
- parsedBody,
120
- exceptionCtor: __BaseException,
121
- errorCode,
122
- });
123
- }
124
- };
125
- export const deserializeAws_json1_1GetHomeRegionCommand = async (output, context) => {
126
- if (output.statusCode >= 300) {
127
- return deserializeAws_json1_1GetHomeRegionCommandError(output, context);
128
- }
129
- const data = await parseBody(output.body, context);
130
- let contents = {};
131
- contents = deserializeAws_json1_1GetHomeRegionResult(data, context);
132
- const response = {
133
- $metadata: deserializeMetadata(output),
134
- ...contents,
135
- };
136
- return Promise.resolve(response);
137
- };
138
- const deserializeAws_json1_1GetHomeRegionCommandError = async (output, context) => {
139
- const parsedOutput = {
140
- ...output,
141
- body: await parseErrorBody(output.body, context),
142
- };
143
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
144
- switch (errorCode) {
145
- case "AccessDeniedException":
146
- case "com.amazonaws.migrationhubconfig#AccessDeniedException":
147
- throw await deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context);
148
- case "InternalServerError":
149
- case "com.amazonaws.migrationhubconfig#InternalServerError":
150
- throw await deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context);
151
- case "InvalidInputException":
152
- case "com.amazonaws.migrationhubconfig#InvalidInputException":
153
- throw await deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context);
154
- case "ServiceUnavailableException":
155
- case "com.amazonaws.migrationhubconfig#ServiceUnavailableException":
156
- throw await deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context);
157
- case "ThrottlingException":
158
- case "com.amazonaws.migrationhubconfig#ThrottlingException":
159
- throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
160
- default:
161
- const parsedBody = parsedOutput.body;
162
- throwDefaultError({
163
- output,
164
- parsedBody,
165
- exceptionCtor: __BaseException,
166
- errorCode,
167
- });
168
- }
169
- };
170
- const deserializeAws_json1_1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
171
- const body = parsedOutput.body;
172
- const deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
173
- const exception = new AccessDeniedException({
174
- $metadata: deserializeMetadata(parsedOutput),
175
- ...deserialized,
6
+ export var serializeAws_json1_1CreateHomeRegionControlCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
7
+ var headers, body;
8
+ return __generator(this, function (_a) {
9
+ headers = {
10
+ "content-type": "application/x-amz-json-1.1",
11
+ "x-amz-target": "AWSMigrationHubMultiAccountService.CreateHomeRegionControl",
12
+ };
13
+ body = JSON.stringify(serializeAws_json1_1CreateHomeRegionControlRequest(input, context));
14
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
176
15
  });
177
- return __decorateServiceException(exception, body);
178
- };
179
- const deserializeAws_json1_1DryRunOperationResponse = async (parsedOutput, context) => {
180
- const body = parsedOutput.body;
181
- const deserialized = deserializeAws_json1_1DryRunOperation(body, context);
182
- const exception = new DryRunOperation({
183
- $metadata: deserializeMetadata(parsedOutput),
184
- ...deserialized,
16
+ }); };
17
+ export var serializeAws_json1_1DescribeHomeRegionControlsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
18
+ var headers, body;
19
+ return __generator(this, function (_a) {
20
+ headers = {
21
+ "content-type": "application/x-amz-json-1.1",
22
+ "x-amz-target": "AWSMigrationHubMultiAccountService.DescribeHomeRegionControls",
23
+ };
24
+ body = JSON.stringify(serializeAws_json1_1DescribeHomeRegionControlsRequest(input, context));
25
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
185
26
  });
186
- return __decorateServiceException(exception, body);
187
- };
188
- const deserializeAws_json1_1InternalServerErrorResponse = async (parsedOutput, context) => {
189
- const body = parsedOutput.body;
190
- const deserialized = deserializeAws_json1_1InternalServerError(body, context);
191
- const exception = new InternalServerError({
192
- $metadata: deserializeMetadata(parsedOutput),
193
- ...deserialized,
27
+ }); };
28
+ export var serializeAws_json1_1GetHomeRegionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
29
+ var headers, body;
30
+ return __generator(this, function (_a) {
31
+ headers = {
32
+ "content-type": "application/x-amz-json-1.1",
33
+ "x-amz-target": "AWSMigrationHubMultiAccountService.GetHomeRegion",
34
+ };
35
+ body = JSON.stringify(serializeAws_json1_1GetHomeRegionRequest(input, context));
36
+ return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
194
37
  });
195
- return __decorateServiceException(exception, body);
196
- };
197
- const deserializeAws_json1_1InvalidInputExceptionResponse = async (parsedOutput, context) => {
198
- const body = parsedOutput.body;
199
- const deserialized = deserializeAws_json1_1InvalidInputException(body, context);
200
- const exception = new InvalidInputException({
201
- $metadata: deserializeMetadata(parsedOutput),
202
- ...deserialized,
38
+ }); };
39
+ export var deserializeAws_json1_1CreateHomeRegionControlCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
40
+ var data, contents, response;
41
+ return __generator(this, function (_a) {
42
+ switch (_a.label) {
43
+ case 0:
44
+ if (output.statusCode >= 300) {
45
+ return [2, deserializeAws_json1_1CreateHomeRegionControlCommandError(output, context)];
46
+ }
47
+ return [4, parseBody(output.body, context)];
48
+ case 1:
49
+ data = _a.sent();
50
+ contents = {};
51
+ contents = deserializeAws_json1_1CreateHomeRegionControlResult(data, context);
52
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
53
+ return [2, Promise.resolve(response)];
54
+ }
203
55
  });
204
- return __decorateServiceException(exception, body);
205
- };
206
- const deserializeAws_json1_1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
207
- const body = parsedOutput.body;
208
- const deserialized = deserializeAws_json1_1ServiceUnavailableException(body, context);
209
- const exception = new ServiceUnavailableException({
210
- $metadata: deserializeMetadata(parsedOutput),
211
- ...deserialized,
56
+ }); };
57
+ var deserializeAws_json1_1CreateHomeRegionControlCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
58
+ var parsedOutput, _a, errorCode, _b, parsedBody;
59
+ var _c;
60
+ return __generator(this, function (_d) {
61
+ switch (_d.label) {
62
+ case 0:
63
+ _a = [__assign({}, output)];
64
+ _c = {};
65
+ return [4, parseErrorBody(output.body, context)];
66
+ case 1:
67
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
68
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
69
+ _b = errorCode;
70
+ switch (_b) {
71
+ case "AccessDeniedException": return [3, 2];
72
+ case "com.amazonaws.migrationhubconfig#AccessDeniedException": return [3, 2];
73
+ case "DryRunOperation": return [3, 4];
74
+ case "com.amazonaws.migrationhubconfig#DryRunOperation": return [3, 4];
75
+ case "InternalServerError": return [3, 6];
76
+ case "com.amazonaws.migrationhubconfig#InternalServerError": return [3, 6];
77
+ case "InvalidInputException": return [3, 8];
78
+ case "com.amazonaws.migrationhubconfig#InvalidInputException": return [3, 8];
79
+ case "ServiceUnavailableException": return [3, 10];
80
+ case "com.amazonaws.migrationhubconfig#ServiceUnavailableException": return [3, 10];
81
+ case "ThrottlingException": return [3, 12];
82
+ case "com.amazonaws.migrationhubconfig#ThrottlingException": return [3, 12];
83
+ }
84
+ return [3, 14];
85
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
86
+ case 3: throw _d.sent();
87
+ case 4: return [4, deserializeAws_json1_1DryRunOperationResponse(parsedOutput, context)];
88
+ case 5: throw _d.sent();
89
+ case 6: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
90
+ case 7: throw _d.sent();
91
+ case 8: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
92
+ case 9: throw _d.sent();
93
+ case 10: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
94
+ case 11: throw _d.sent();
95
+ case 12: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
96
+ case 13: throw _d.sent();
97
+ case 14:
98
+ parsedBody = parsedOutput.body;
99
+ throwDefaultError({
100
+ output: output,
101
+ parsedBody: parsedBody,
102
+ exceptionCtor: __BaseException,
103
+ errorCode: errorCode,
104
+ });
105
+ _d.label = 15;
106
+ case 15: return [2];
107
+ }
212
108
  });
213
- return __decorateServiceException(exception, body);
214
- };
215
- const deserializeAws_json1_1ThrottlingExceptionResponse = async (parsedOutput, context) => {
216
- const body = parsedOutput.body;
217
- const deserialized = deserializeAws_json1_1ThrottlingException(body, context);
218
- const exception = new ThrottlingException({
219
- $metadata: deserializeMetadata(parsedOutput),
220
- ...deserialized,
109
+ }); };
110
+ export var deserializeAws_json1_1DescribeHomeRegionControlsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
111
+ var data, contents, response;
112
+ return __generator(this, function (_a) {
113
+ switch (_a.label) {
114
+ case 0:
115
+ if (output.statusCode >= 300) {
116
+ return [2, deserializeAws_json1_1DescribeHomeRegionControlsCommandError(output, context)];
117
+ }
118
+ return [4, parseBody(output.body, context)];
119
+ case 1:
120
+ data = _a.sent();
121
+ contents = {};
122
+ contents = deserializeAws_json1_1DescribeHomeRegionControlsResult(data, context);
123
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
124
+ return [2, Promise.resolve(response)];
125
+ }
221
126
  });
222
- return __decorateServiceException(exception, body);
223
- };
224
- const serializeAws_json1_1CreateHomeRegionControlRequest = (input, context) => {
225
- return {
226
- ...(input.DryRun != null && { DryRun: input.DryRun }),
227
- ...(input.HomeRegion != null && { HomeRegion: input.HomeRegion }),
228
- ...(input.Target != null && { Target: serializeAws_json1_1Target(input.Target, context) }),
229
- };
127
+ }); };
128
+ var deserializeAws_json1_1DescribeHomeRegionControlsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
129
+ var parsedOutput, _a, errorCode, _b, parsedBody;
130
+ var _c;
131
+ return __generator(this, function (_d) {
132
+ switch (_d.label) {
133
+ case 0:
134
+ _a = [__assign({}, output)];
135
+ _c = {};
136
+ return [4, parseErrorBody(output.body, context)];
137
+ case 1:
138
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
139
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
140
+ _b = errorCode;
141
+ switch (_b) {
142
+ case "AccessDeniedException": return [3, 2];
143
+ case "com.amazonaws.migrationhubconfig#AccessDeniedException": return [3, 2];
144
+ case "InternalServerError": return [3, 4];
145
+ case "com.amazonaws.migrationhubconfig#InternalServerError": return [3, 4];
146
+ case "InvalidInputException": return [3, 6];
147
+ case "com.amazonaws.migrationhubconfig#InvalidInputException": return [3, 6];
148
+ case "ServiceUnavailableException": return [3, 8];
149
+ case "com.amazonaws.migrationhubconfig#ServiceUnavailableException": return [3, 8];
150
+ case "ThrottlingException": return [3, 10];
151
+ case "com.amazonaws.migrationhubconfig#ThrottlingException": return [3, 10];
152
+ }
153
+ return [3, 12];
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();
164
+ case 12:
165
+ parsedBody = parsedOutput.body;
166
+ throwDefaultError({
167
+ output: output,
168
+ parsedBody: parsedBody,
169
+ exceptionCtor: __BaseException,
170
+ errorCode: errorCode,
171
+ });
172
+ _d.label = 13;
173
+ case 13: return [2];
174
+ }
175
+ });
176
+ }); };
177
+ export var deserializeAws_json1_1GetHomeRegionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
178
+ var data, contents, response;
179
+ return __generator(this, function (_a) {
180
+ switch (_a.label) {
181
+ case 0:
182
+ if (output.statusCode >= 300) {
183
+ return [2, deserializeAws_json1_1GetHomeRegionCommandError(output, context)];
184
+ }
185
+ return [4, parseBody(output.body, context)];
186
+ case 1:
187
+ data = _a.sent();
188
+ contents = {};
189
+ contents = deserializeAws_json1_1GetHomeRegionResult(data, context);
190
+ response = __assign({ $metadata: deserializeMetadata(output) }, contents);
191
+ return [2, Promise.resolve(response)];
192
+ }
193
+ });
194
+ }); };
195
+ var deserializeAws_json1_1GetHomeRegionCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
196
+ var parsedOutput, _a, errorCode, _b, parsedBody;
197
+ var _c;
198
+ return __generator(this, function (_d) {
199
+ switch (_d.label) {
200
+ case 0:
201
+ _a = [__assign({}, output)];
202
+ _c = {};
203
+ return [4, parseErrorBody(output.body, context)];
204
+ case 1:
205
+ parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
206
+ errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
207
+ _b = errorCode;
208
+ switch (_b) {
209
+ case "AccessDeniedException": return [3, 2];
210
+ case "com.amazonaws.migrationhubconfig#AccessDeniedException": return [3, 2];
211
+ case "InternalServerError": return [3, 4];
212
+ case "com.amazonaws.migrationhubconfig#InternalServerError": return [3, 4];
213
+ case "InvalidInputException": return [3, 6];
214
+ case "com.amazonaws.migrationhubconfig#InvalidInputException": return [3, 6];
215
+ case "ServiceUnavailableException": return [3, 8];
216
+ case "com.amazonaws.migrationhubconfig#ServiceUnavailableException": return [3, 8];
217
+ case "ThrottlingException": return [3, 10];
218
+ case "com.amazonaws.migrationhubconfig#ThrottlingException": return [3, 10];
219
+ }
220
+ return [3, 12];
221
+ case 2: return [4, deserializeAws_json1_1AccessDeniedExceptionResponse(parsedOutput, context)];
222
+ case 3: throw _d.sent();
223
+ case 4: return [4, deserializeAws_json1_1InternalServerErrorResponse(parsedOutput, context)];
224
+ case 5: throw _d.sent();
225
+ case 6: return [4, deserializeAws_json1_1InvalidInputExceptionResponse(parsedOutput, context)];
226
+ case 7: throw _d.sent();
227
+ case 8: return [4, deserializeAws_json1_1ServiceUnavailableExceptionResponse(parsedOutput, context)];
228
+ case 9: throw _d.sent();
229
+ case 10: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
230
+ case 11: throw _d.sent();
231
+ case 12:
232
+ parsedBody = parsedOutput.body;
233
+ throwDefaultError({
234
+ output: output,
235
+ parsedBody: parsedBody,
236
+ exceptionCtor: __BaseException,
237
+ errorCode: errorCode,
238
+ });
239
+ _d.label = 13;
240
+ case 13: return [2];
241
+ }
242
+ });
243
+ }); };
244
+ var deserializeAws_json1_1AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
245
+ var body, deserialized, exception;
246
+ return __generator(this, function (_a) {
247
+ body = parsedOutput.body;
248
+ deserialized = deserializeAws_json1_1AccessDeniedException(body, context);
249
+ exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
250
+ return [2, __decorateServiceException(exception, body)];
251
+ });
252
+ }); };
253
+ var deserializeAws_json1_1DryRunOperationResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
254
+ var body, deserialized, exception;
255
+ return __generator(this, function (_a) {
256
+ body = parsedOutput.body;
257
+ deserialized = deserializeAws_json1_1DryRunOperation(body, context);
258
+ exception = new DryRunOperation(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
259
+ return [2, __decorateServiceException(exception, body)];
260
+ });
261
+ }); };
262
+ var deserializeAws_json1_1InternalServerErrorResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
263
+ var body, deserialized, exception;
264
+ return __generator(this, function (_a) {
265
+ body = parsedOutput.body;
266
+ deserialized = deserializeAws_json1_1InternalServerError(body, context);
267
+ exception = new InternalServerError(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
268
+ return [2, __decorateServiceException(exception, body)];
269
+ });
270
+ }); };
271
+ var deserializeAws_json1_1InvalidInputExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
272
+ var body, deserialized, exception;
273
+ return __generator(this, function (_a) {
274
+ body = parsedOutput.body;
275
+ deserialized = deserializeAws_json1_1InvalidInputException(body, context);
276
+ exception = new InvalidInputException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
277
+ return [2, __decorateServiceException(exception, body)];
278
+ });
279
+ }); };
280
+ var deserializeAws_json1_1ServiceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
281
+ var body, deserialized, exception;
282
+ return __generator(this, function (_a) {
283
+ body = parsedOutput.body;
284
+ deserialized = deserializeAws_json1_1ServiceUnavailableException(body, context);
285
+ exception = new ServiceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
286
+ return [2, __decorateServiceException(exception, body)];
287
+ });
288
+ }); };
289
+ var deserializeAws_json1_1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
290
+ var body, deserialized, exception;
291
+ return __generator(this, function (_a) {
292
+ body = parsedOutput.body;
293
+ deserialized = deserializeAws_json1_1ThrottlingException(body, context);
294
+ exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
295
+ return [2, __decorateServiceException(exception, body)];
296
+ });
297
+ }); };
298
+ var serializeAws_json1_1CreateHomeRegionControlRequest = function (input, context) {
299
+ return __assign(__assign(__assign({}, (input.DryRun != null && { DryRun: input.DryRun })), (input.HomeRegion != null && { HomeRegion: input.HomeRegion })), (input.Target != null && { Target: serializeAws_json1_1Target(input.Target, context) }));
230
300
  };
231
- const serializeAws_json1_1DescribeHomeRegionControlsRequest = (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: serializeAws_json1_1Target(input.Target, context) }),
238
- };
301
+ var serializeAws_json1_1DescribeHomeRegionControlsRequest = function (input, context) {
302
+ return __assign(__assign(__assign(__assign(__assign({}, (input.ControlId != null && { ControlId: input.ControlId })), (input.HomeRegion != null && { HomeRegion: input.HomeRegion })), (input.MaxResults != null && { MaxResults: input.MaxResults })), (input.NextToken != null && { NextToken: input.NextToken })), (input.Target != null && { Target: serializeAws_json1_1Target(input.Target, context) }));
239
303
  };
240
- const serializeAws_json1_1GetHomeRegionRequest = (input, context) => {
304
+ var serializeAws_json1_1GetHomeRegionRequest = function (input, context) {
241
305
  return {};
242
306
  };
243
- const serializeAws_json1_1Target = (input, context) => {
244
- return {
245
- ...(input.Id != null && { Id: input.Id }),
246
- ...(input.Type != null && { Type: input.Type }),
247
- };
307
+ var serializeAws_json1_1Target = function (input, context) {
308
+ return __assign(__assign({}, (input.Id != null && { Id: input.Id })), (input.Type != null && { Type: input.Type }));
248
309
  };
249
- const deserializeAws_json1_1AccessDeniedException = (output, context) => {
310
+ var deserializeAws_json1_1AccessDeniedException = function (output, context) {
250
311
  return {
251
312
  Message: __expectString(output.Message),
252
313
  };
253
314
  };
254
- const deserializeAws_json1_1CreateHomeRegionControlResult = (output, context) => {
315
+ var deserializeAws_json1_1CreateHomeRegionControlResult = function (output, context) {
255
316
  return {
256
317
  HomeRegionControl: output.HomeRegionControl != null
257
318
  ? deserializeAws_json1_1HomeRegionControl(output.HomeRegionControl, context)
258
319
  : undefined,
259
320
  };
260
321
  };
261
- const deserializeAws_json1_1DescribeHomeRegionControlsResult = (output, context) => {
322
+ var deserializeAws_json1_1DescribeHomeRegionControlsResult = function (output, context) {
262
323
  return {
263
324
  HomeRegionControls: output.HomeRegionControls != null
264
325
  ? deserializeAws_json1_1HomeRegionControls(output.HomeRegionControls, context)
@@ -266,17 +327,17 @@ const deserializeAws_json1_1DescribeHomeRegionControlsResult = (output, context)
266
327
  NextToken: __expectString(output.NextToken),
267
328
  };
268
329
  };
269
- const deserializeAws_json1_1DryRunOperation = (output, context) => {
330
+ var deserializeAws_json1_1DryRunOperation = function (output, context) {
270
331
  return {
271
332
  Message: __expectString(output.Message),
272
333
  };
273
334
  };
274
- const deserializeAws_json1_1GetHomeRegionResult = (output, context) => {
335
+ var deserializeAws_json1_1GetHomeRegionResult = function (output, context) {
275
336
  return {
276
337
  HomeRegion: __expectString(output.HomeRegion),
277
338
  };
278
339
  };
279
- const deserializeAws_json1_1HomeRegionControl = (output, context) => {
340
+ var deserializeAws_json1_1HomeRegionControl = function (output, context) {
280
341
  return {
281
342
  ControlId: __expectString(output.ControlId),
282
343
  HomeRegion: __expectString(output.HomeRegion),
@@ -286,10 +347,10 @@ const deserializeAws_json1_1HomeRegionControl = (output, context) => {
286
347
  Target: output.Target != null ? deserializeAws_json1_1Target(output.Target, context) : undefined,
287
348
  };
288
349
  };
289
- const deserializeAws_json1_1HomeRegionControls = (output, context) => {
290
- const retVal = (output || [])
291
- .filter((e) => e != null)
292
- .map((entry) => {
350
+ var deserializeAws_json1_1HomeRegionControls = function (output, context) {
351
+ var retVal = (output || [])
352
+ .filter(function (e) { return e != null; })
353
+ .map(function (entry) {
293
354
  if (entry === null) {
294
355
  return null;
295
356
  }
@@ -297,79 +358,102 @@ const deserializeAws_json1_1HomeRegionControls = (output, context) => {
297
358
  });
298
359
  return retVal;
299
360
  };
300
- const deserializeAws_json1_1InternalServerError = (output, context) => {
361
+ var deserializeAws_json1_1InternalServerError = function (output, context) {
301
362
  return {
302
363
  Message: __expectString(output.Message),
303
364
  };
304
365
  };
305
- const deserializeAws_json1_1InvalidInputException = (output, context) => {
366
+ var deserializeAws_json1_1InvalidInputException = function (output, context) {
306
367
  return {
307
368
  Message: __expectString(output.Message),
308
369
  };
309
370
  };
310
- const deserializeAws_json1_1ServiceUnavailableException = (output, context) => {
371
+ var deserializeAws_json1_1ServiceUnavailableException = function (output, context) {
311
372
  return {
312
373
  Message: __expectString(output.Message),
313
374
  };
314
375
  };
315
- const deserializeAws_json1_1Target = (output, context) => {
376
+ var deserializeAws_json1_1Target = function (output, context) {
316
377
  return {
317
378
  Id: __expectString(output.Id),
318
379
  Type: __expectString(output.Type),
319
380
  };
320
381
  };
321
- const deserializeAws_json1_1ThrottlingException = (output, context) => {
382
+ var deserializeAws_json1_1ThrottlingException = function (output, context) {
322
383
  return {
323
384
  Message: __expectString(output.Message),
324
385
  RetryAfterSeconds: __expectInt32(output.RetryAfterSeconds),
325
386
  };
326
387
  };
327
- const deserializeMetadata = (output) => ({
328
- httpStatusCode: output.statusCode,
329
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
330
- extendedRequestId: output.headers["x-amz-id-2"],
331
- cfId: output.headers["x-amz-cf-id"],
332
- });
333
- const collectBody = (streamBody = new Uint8Array(), context) => {
388
+ var deserializeMetadata = function (output) {
389
+ var _a, _b;
390
+ return ({
391
+ httpStatusCode: output.statusCode,
392
+ requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
393
+ extendedRequestId: output.headers["x-amz-id-2"],
394
+ cfId: output.headers["x-amz-cf-id"],
395
+ });
396
+ };
397
+ var collectBody = function (streamBody, context) {
398
+ if (streamBody === void 0) { streamBody = new Uint8Array(); }
334
399
  if (streamBody instanceof Uint8Array) {
335
400
  return Promise.resolve(streamBody);
336
401
  }
337
402
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
338
403
  };
339
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
340
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
341
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
342
- const contents = {
343
- protocol,
344
- hostname,
345
- port,
346
- method: "POST",
347
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
348
- headers,
349
- };
350
- if (resolvedHostname !== undefined) {
351
- contents.hostname = resolvedHostname;
352
- }
353
- if (body !== undefined) {
354
- contents.body = body;
355
- }
356
- return new __HttpRequest(contents);
357
- };
358
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
359
- if (encoded.length) {
360
- return JSON.parse(encoded);
361
- }
362
- return {};
363
- });
364
- const parseErrorBody = async (errorBody, context) => {
365
- const value = await parseBody(errorBody, context);
366
- value.message = value.message ?? value.Message;
367
- return value;
404
+ var collectBodyString = function (streamBody, context) {
405
+ return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
406
+ };
407
+ var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
408
+ var _a, hostname, _b, protocol, port, basePath, contents;
409
+ return __generator(this, function (_c) {
410
+ switch (_c.label) {
411
+ case 0: return [4, context.endpoint()];
412
+ case 1:
413
+ _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
414
+ contents = {
415
+ protocol: protocol,
416
+ hostname: hostname,
417
+ port: port,
418
+ method: "POST",
419
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
420
+ headers: headers,
421
+ };
422
+ if (resolvedHostname !== undefined) {
423
+ contents.hostname = resolvedHostname;
424
+ }
425
+ if (body !== undefined) {
426
+ contents.body = body;
427
+ }
428
+ return [2, new __HttpRequest(contents)];
429
+ }
430
+ });
431
+ }); };
432
+ var parseBody = function (streamBody, context) {
433
+ return collectBodyString(streamBody, context).then(function (encoded) {
434
+ if (encoded.length) {
435
+ return JSON.parse(encoded);
436
+ }
437
+ return {};
438
+ });
368
439
  };
369
- const loadRestJsonErrorCode = (output, data) => {
370
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
371
- const sanitizeErrorCode = (rawValue) => {
372
- let cleanValue = rawValue;
440
+ var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
441
+ var value;
442
+ var _a;
443
+ return __generator(this, function (_b) {
444
+ switch (_b.label) {
445
+ case 0: return [4, parseBody(errorBody, context)];
446
+ case 1:
447
+ value = _b.sent();
448
+ value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
449
+ return [2, value];
450
+ }
451
+ });
452
+ }); };
453
+ var loadRestJsonErrorCode = function (output, data) {
454
+ var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
455
+ var sanitizeErrorCode = function (rawValue) {
456
+ var cleanValue = rawValue;
373
457
  if (typeof cleanValue === "number") {
374
458
  cleanValue = cleanValue.toString();
375
459
  }
@@ -384,7 +468,7 @@ const loadRestJsonErrorCode = (output, data) => {
384
468
  }
385
469
  return cleanValue;
386
470
  };
387
- const headerKey = findKey(output.headers, "x-amzn-errortype");
471
+ var headerKey = findKey(output.headers, "x-amzn-errortype");
388
472
  if (headerKey !== undefined) {
389
473
  return sanitizeErrorCode(output.headers[headerKey]);
390
474
  }