@aws-sdk/client-route53-recovery-cluster 3.180.0 → 3.183.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 +20 -0
- package/dist-cjs/protocols/Aws_json1_0.js +10 -4
- package/dist-es/Route53RecoveryCluster.js +18 -25
- package/dist-es/Route53RecoveryClusterClient.js +22 -28
- package/dist-es/commands/GetRoutingControlStateCommand.js +21 -28
- package/dist-es/commands/ListRoutingControlsCommand.js +21 -28
- package/dist-es/commands/UpdateRoutingControlStateCommand.js +21 -28
- package/dist-es/commands/UpdateRoutingControlStatesCommand.js +21 -28
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/Route53RecoveryClusterServiceException.js +5 -10
- package/dist-es/models/models_0.js +133 -112
- package/dist-es/pagination/ListRoutingControlsPaginator.js +25 -68
- package/dist-es/protocols/Aws_json1_0.js +402 -500
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,486 +1,398 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectString as __expectString, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { AccessDeniedException, ConflictException, EndpointTemporarilyUnavailableException, InternalServerException, ResourceNotFoundException, ServiceLimitExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
|
|
5
4
|
import { Route53RecoveryClusterServiceException as __BaseException } from "../models/Route53RecoveryClusterServiceException";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
case 11: throw _d.sent();
|
|
250
|
-
case 12: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
|
|
251
|
-
case 13: throw _d.sent();
|
|
252
|
-
case 14: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
|
|
253
|
-
case 15: throw _d.sent();
|
|
254
|
-
case 16:
|
|
255
|
-
parsedBody = parsedOutput.body;
|
|
256
|
-
throwDefaultError({
|
|
257
|
-
output: output,
|
|
258
|
-
parsedBody: parsedBody,
|
|
259
|
-
exceptionCtor: __BaseException,
|
|
260
|
-
errorCode: errorCode,
|
|
261
|
-
});
|
|
262
|
-
_d.label = 17;
|
|
263
|
-
case 17: return [2];
|
|
264
|
-
}
|
|
265
|
-
});
|
|
266
|
-
}); };
|
|
267
|
-
export var deserializeAws_json1_0UpdateRoutingControlStatesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
268
|
-
var data, contents, response;
|
|
269
|
-
return __generator(this, function (_a) {
|
|
270
|
-
switch (_a.label) {
|
|
271
|
-
case 0:
|
|
272
|
-
if (output.statusCode >= 300) {
|
|
273
|
-
return [2, deserializeAws_json1_0UpdateRoutingControlStatesCommandError(output, context)];
|
|
274
|
-
}
|
|
275
|
-
return [4, parseBody(output.body, context)];
|
|
276
|
-
case 1:
|
|
277
|
-
data = _a.sent();
|
|
278
|
-
contents = {};
|
|
279
|
-
contents = deserializeAws_json1_0UpdateRoutingControlStatesResponse(data, context);
|
|
280
|
-
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
281
|
-
return [2, Promise.resolve(response)];
|
|
282
|
-
}
|
|
283
|
-
});
|
|
284
|
-
}); };
|
|
285
|
-
var deserializeAws_json1_0UpdateRoutingControlStatesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
286
|
-
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
287
|
-
var _c;
|
|
288
|
-
return __generator(this, function (_d) {
|
|
289
|
-
switch (_d.label) {
|
|
290
|
-
case 0:
|
|
291
|
-
_a = [__assign({}, output)];
|
|
292
|
-
_c = {};
|
|
293
|
-
return [4, parseBody(output.body, context)];
|
|
294
|
-
case 1:
|
|
295
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
296
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
297
|
-
_b = errorCode;
|
|
298
|
-
switch (_b) {
|
|
299
|
-
case "AccessDeniedException": return [3, 2];
|
|
300
|
-
case "com.amazonaws.route53recoverycluster#AccessDeniedException": return [3, 2];
|
|
301
|
-
case "ConflictException": return [3, 4];
|
|
302
|
-
case "com.amazonaws.route53recoverycluster#ConflictException": return [3, 4];
|
|
303
|
-
case "EndpointTemporarilyUnavailableException": return [3, 6];
|
|
304
|
-
case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException": return [3, 6];
|
|
305
|
-
case "InternalServerException": return [3, 8];
|
|
306
|
-
case "com.amazonaws.route53recoverycluster#InternalServerException": return [3, 8];
|
|
307
|
-
case "ResourceNotFoundException": return [3, 10];
|
|
308
|
-
case "com.amazonaws.route53recoverycluster#ResourceNotFoundException": return [3, 10];
|
|
309
|
-
case "ServiceLimitExceededException": return [3, 12];
|
|
310
|
-
case "com.amazonaws.route53recoverycluster#ServiceLimitExceededException": return [3, 12];
|
|
311
|
-
case "ThrottlingException": return [3, 14];
|
|
312
|
-
case "com.amazonaws.route53recoverycluster#ThrottlingException": return [3, 14];
|
|
313
|
-
case "ValidationException": return [3, 16];
|
|
314
|
-
case "com.amazonaws.route53recoverycluster#ValidationException": return [3, 16];
|
|
315
|
-
}
|
|
316
|
-
return [3, 18];
|
|
317
|
-
case 2: return [4, deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
318
|
-
case 3: throw _d.sent();
|
|
319
|
-
case 4: return [4, deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)];
|
|
320
|
-
case 5: throw _d.sent();
|
|
321
|
-
case 6: return [4, deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse(parsedOutput, context)];
|
|
322
|
-
case 7: throw _d.sent();
|
|
323
|
-
case 8: return [4, deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)];
|
|
324
|
-
case 9: throw _d.sent();
|
|
325
|
-
case 10: return [4, deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
326
|
-
case 11: throw _d.sent();
|
|
327
|
-
case 12: return [4, deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context)];
|
|
328
|
-
case 13: throw _d.sent();
|
|
329
|
-
case 14: return [4, deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)];
|
|
330
|
-
case 15: throw _d.sent();
|
|
331
|
-
case 16: return [4, deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)];
|
|
332
|
-
case 17: throw _d.sent();
|
|
333
|
-
case 18:
|
|
334
|
-
parsedBody = parsedOutput.body;
|
|
335
|
-
throwDefaultError({
|
|
336
|
-
output: output,
|
|
337
|
-
parsedBody: parsedBody,
|
|
338
|
-
exceptionCtor: __BaseException,
|
|
339
|
-
errorCode: errorCode,
|
|
340
|
-
});
|
|
341
|
-
_d.label = 19;
|
|
342
|
-
case 19: return [2];
|
|
343
|
-
}
|
|
344
|
-
});
|
|
345
|
-
}); };
|
|
346
|
-
var deserializeAws_json1_0AccessDeniedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
347
|
-
var body, deserialized, exception;
|
|
348
|
-
return __generator(this, function (_a) {
|
|
349
|
-
body = parsedOutput.body;
|
|
350
|
-
deserialized = deserializeAws_json1_0AccessDeniedException(body, context);
|
|
351
|
-
exception = new AccessDeniedException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
352
|
-
return [2, __decorateServiceException(exception, body)];
|
|
5
|
+
export const serializeAws_json1_0GetRoutingControlStateCommand = async (input, context) => {
|
|
6
|
+
const headers = {
|
|
7
|
+
"content-type": "application/x-amz-json-1.0",
|
|
8
|
+
"x-amz-target": "ToggleCustomerAPI.GetRoutingControlState",
|
|
9
|
+
};
|
|
10
|
+
let body;
|
|
11
|
+
body = JSON.stringify(serializeAws_json1_0GetRoutingControlStateRequest(input, context));
|
|
12
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
13
|
+
};
|
|
14
|
+
export const serializeAws_json1_0ListRoutingControlsCommand = async (input, context) => {
|
|
15
|
+
const headers = {
|
|
16
|
+
"content-type": "application/x-amz-json-1.0",
|
|
17
|
+
"x-amz-target": "ToggleCustomerAPI.ListRoutingControls",
|
|
18
|
+
};
|
|
19
|
+
let body;
|
|
20
|
+
body = JSON.stringify(serializeAws_json1_0ListRoutingControlsRequest(input, context));
|
|
21
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
22
|
+
};
|
|
23
|
+
export const serializeAws_json1_0UpdateRoutingControlStateCommand = async (input, context) => {
|
|
24
|
+
const headers = {
|
|
25
|
+
"content-type": "application/x-amz-json-1.0",
|
|
26
|
+
"x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlState",
|
|
27
|
+
};
|
|
28
|
+
let body;
|
|
29
|
+
body = JSON.stringify(serializeAws_json1_0UpdateRoutingControlStateRequest(input, context));
|
|
30
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
31
|
+
};
|
|
32
|
+
export const serializeAws_json1_0UpdateRoutingControlStatesCommand = async (input, context) => {
|
|
33
|
+
const headers = {
|
|
34
|
+
"content-type": "application/x-amz-json-1.0",
|
|
35
|
+
"x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlStates",
|
|
36
|
+
};
|
|
37
|
+
let body;
|
|
38
|
+
body = JSON.stringify(serializeAws_json1_0UpdateRoutingControlStatesRequest(input, context));
|
|
39
|
+
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
40
|
+
};
|
|
41
|
+
export const deserializeAws_json1_0GetRoutingControlStateCommand = async (output, context) => {
|
|
42
|
+
if (output.statusCode >= 300) {
|
|
43
|
+
return deserializeAws_json1_0GetRoutingControlStateCommandError(output, context);
|
|
44
|
+
}
|
|
45
|
+
const data = await parseBody(output.body, context);
|
|
46
|
+
let contents = {};
|
|
47
|
+
contents = deserializeAws_json1_0GetRoutingControlStateResponse(data, context);
|
|
48
|
+
const response = {
|
|
49
|
+
$metadata: deserializeMetadata(output),
|
|
50
|
+
...contents,
|
|
51
|
+
};
|
|
52
|
+
return Promise.resolve(response);
|
|
53
|
+
};
|
|
54
|
+
const deserializeAws_json1_0GetRoutingControlStateCommandError = async (output, context) => {
|
|
55
|
+
const parsedOutput = {
|
|
56
|
+
...output,
|
|
57
|
+
body: await parseErrorBody(output.body, context),
|
|
58
|
+
};
|
|
59
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
60
|
+
switch (errorCode) {
|
|
61
|
+
case "AccessDeniedException":
|
|
62
|
+
case "com.amazonaws.route53recoverycluster#AccessDeniedException":
|
|
63
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
64
|
+
case "EndpointTemporarilyUnavailableException":
|
|
65
|
+
case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException":
|
|
66
|
+
throw await deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse(parsedOutput, context);
|
|
67
|
+
case "InternalServerException":
|
|
68
|
+
case "com.amazonaws.route53recoverycluster#InternalServerException":
|
|
69
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
70
|
+
case "ResourceNotFoundException":
|
|
71
|
+
case "com.amazonaws.route53recoverycluster#ResourceNotFoundException":
|
|
72
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
73
|
+
case "ThrottlingException":
|
|
74
|
+
case "com.amazonaws.route53recoverycluster#ThrottlingException":
|
|
75
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
76
|
+
case "ValidationException":
|
|
77
|
+
case "com.amazonaws.route53recoverycluster#ValidationException":
|
|
78
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
79
|
+
default:
|
|
80
|
+
const parsedBody = parsedOutput.body;
|
|
81
|
+
throwDefaultError({
|
|
82
|
+
output,
|
|
83
|
+
parsedBody,
|
|
84
|
+
exceptionCtor: __BaseException,
|
|
85
|
+
errorCode,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
export const deserializeAws_json1_0ListRoutingControlsCommand = async (output, context) => {
|
|
90
|
+
if (output.statusCode >= 300) {
|
|
91
|
+
return deserializeAws_json1_0ListRoutingControlsCommandError(output, context);
|
|
92
|
+
}
|
|
93
|
+
const data = await parseBody(output.body, context);
|
|
94
|
+
let contents = {};
|
|
95
|
+
contents = deserializeAws_json1_0ListRoutingControlsResponse(data, context);
|
|
96
|
+
const response = {
|
|
97
|
+
$metadata: deserializeMetadata(output),
|
|
98
|
+
...contents,
|
|
99
|
+
};
|
|
100
|
+
return Promise.resolve(response);
|
|
101
|
+
};
|
|
102
|
+
const deserializeAws_json1_0ListRoutingControlsCommandError = async (output, context) => {
|
|
103
|
+
const parsedOutput = {
|
|
104
|
+
...output,
|
|
105
|
+
body: await parseErrorBody(output.body, context),
|
|
106
|
+
};
|
|
107
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
108
|
+
switch (errorCode) {
|
|
109
|
+
case "AccessDeniedException":
|
|
110
|
+
case "com.amazonaws.route53recoverycluster#AccessDeniedException":
|
|
111
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
112
|
+
case "EndpointTemporarilyUnavailableException":
|
|
113
|
+
case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException":
|
|
114
|
+
throw await deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse(parsedOutput, context);
|
|
115
|
+
case "InternalServerException":
|
|
116
|
+
case "com.amazonaws.route53recoverycluster#InternalServerException":
|
|
117
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
118
|
+
case "ResourceNotFoundException":
|
|
119
|
+
case "com.amazonaws.route53recoverycluster#ResourceNotFoundException":
|
|
120
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
121
|
+
case "ThrottlingException":
|
|
122
|
+
case "com.amazonaws.route53recoverycluster#ThrottlingException":
|
|
123
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
124
|
+
case "ValidationException":
|
|
125
|
+
case "com.amazonaws.route53recoverycluster#ValidationException":
|
|
126
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
127
|
+
default:
|
|
128
|
+
const parsedBody = parsedOutput.body;
|
|
129
|
+
throwDefaultError({
|
|
130
|
+
output,
|
|
131
|
+
parsedBody,
|
|
132
|
+
exceptionCtor: __BaseException,
|
|
133
|
+
errorCode,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
export const deserializeAws_json1_0UpdateRoutingControlStateCommand = async (output, context) => {
|
|
138
|
+
if (output.statusCode >= 300) {
|
|
139
|
+
return deserializeAws_json1_0UpdateRoutingControlStateCommandError(output, context);
|
|
140
|
+
}
|
|
141
|
+
const data = await parseBody(output.body, context);
|
|
142
|
+
let contents = {};
|
|
143
|
+
contents = deserializeAws_json1_0UpdateRoutingControlStateResponse(data, context);
|
|
144
|
+
const response = {
|
|
145
|
+
$metadata: deserializeMetadata(output),
|
|
146
|
+
...contents,
|
|
147
|
+
};
|
|
148
|
+
return Promise.resolve(response);
|
|
149
|
+
};
|
|
150
|
+
const deserializeAws_json1_0UpdateRoutingControlStateCommandError = async (output, context) => {
|
|
151
|
+
const parsedOutput = {
|
|
152
|
+
...output,
|
|
153
|
+
body: await parseErrorBody(output.body, context),
|
|
154
|
+
};
|
|
155
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
156
|
+
switch (errorCode) {
|
|
157
|
+
case "AccessDeniedException":
|
|
158
|
+
case "com.amazonaws.route53recoverycluster#AccessDeniedException":
|
|
159
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
160
|
+
case "ConflictException":
|
|
161
|
+
case "com.amazonaws.route53recoverycluster#ConflictException":
|
|
162
|
+
throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
|
|
163
|
+
case "EndpointTemporarilyUnavailableException":
|
|
164
|
+
case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException":
|
|
165
|
+
throw await deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse(parsedOutput, context);
|
|
166
|
+
case "InternalServerException":
|
|
167
|
+
case "com.amazonaws.route53recoverycluster#InternalServerException":
|
|
168
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
169
|
+
case "ResourceNotFoundException":
|
|
170
|
+
case "com.amazonaws.route53recoverycluster#ResourceNotFoundException":
|
|
171
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
172
|
+
case "ThrottlingException":
|
|
173
|
+
case "com.amazonaws.route53recoverycluster#ThrottlingException":
|
|
174
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
175
|
+
case "ValidationException":
|
|
176
|
+
case "com.amazonaws.route53recoverycluster#ValidationException":
|
|
177
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
178
|
+
default:
|
|
179
|
+
const parsedBody = parsedOutput.body;
|
|
180
|
+
throwDefaultError({
|
|
181
|
+
output,
|
|
182
|
+
parsedBody,
|
|
183
|
+
exceptionCtor: __BaseException,
|
|
184
|
+
errorCode,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
export const deserializeAws_json1_0UpdateRoutingControlStatesCommand = async (output, context) => {
|
|
189
|
+
if (output.statusCode >= 300) {
|
|
190
|
+
return deserializeAws_json1_0UpdateRoutingControlStatesCommandError(output, context);
|
|
191
|
+
}
|
|
192
|
+
const data = await parseBody(output.body, context);
|
|
193
|
+
let contents = {};
|
|
194
|
+
contents = deserializeAws_json1_0UpdateRoutingControlStatesResponse(data, context);
|
|
195
|
+
const response = {
|
|
196
|
+
$metadata: deserializeMetadata(output),
|
|
197
|
+
...contents,
|
|
198
|
+
};
|
|
199
|
+
return Promise.resolve(response);
|
|
200
|
+
};
|
|
201
|
+
const deserializeAws_json1_0UpdateRoutingControlStatesCommandError = async (output, context) => {
|
|
202
|
+
const parsedOutput = {
|
|
203
|
+
...output,
|
|
204
|
+
body: await parseErrorBody(output.body, context),
|
|
205
|
+
};
|
|
206
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
207
|
+
switch (errorCode) {
|
|
208
|
+
case "AccessDeniedException":
|
|
209
|
+
case "com.amazonaws.route53recoverycluster#AccessDeniedException":
|
|
210
|
+
throw await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context);
|
|
211
|
+
case "ConflictException":
|
|
212
|
+
case "com.amazonaws.route53recoverycluster#ConflictException":
|
|
213
|
+
throw await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context);
|
|
214
|
+
case "EndpointTemporarilyUnavailableException":
|
|
215
|
+
case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException":
|
|
216
|
+
throw await deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse(parsedOutput, context);
|
|
217
|
+
case "InternalServerException":
|
|
218
|
+
case "com.amazonaws.route53recoverycluster#InternalServerException":
|
|
219
|
+
throw await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context);
|
|
220
|
+
case "ResourceNotFoundException":
|
|
221
|
+
case "com.amazonaws.route53recoverycluster#ResourceNotFoundException":
|
|
222
|
+
throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
223
|
+
case "ServiceLimitExceededException":
|
|
224
|
+
case "com.amazonaws.route53recoverycluster#ServiceLimitExceededException":
|
|
225
|
+
throw await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context);
|
|
226
|
+
case "ThrottlingException":
|
|
227
|
+
case "com.amazonaws.route53recoverycluster#ThrottlingException":
|
|
228
|
+
throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
|
|
229
|
+
case "ValidationException":
|
|
230
|
+
case "com.amazonaws.route53recoverycluster#ValidationException":
|
|
231
|
+
throw await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context);
|
|
232
|
+
default:
|
|
233
|
+
const parsedBody = parsedOutput.body;
|
|
234
|
+
throwDefaultError({
|
|
235
|
+
output,
|
|
236
|
+
parsedBody,
|
|
237
|
+
exceptionCtor: __BaseException,
|
|
238
|
+
errorCode,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
const deserializeAws_json1_0AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
243
|
+
const body = parsedOutput.body;
|
|
244
|
+
const deserialized = deserializeAws_json1_0AccessDeniedException(body, context);
|
|
245
|
+
const exception = new AccessDeniedException({
|
|
246
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
247
|
+
...deserialized,
|
|
353
248
|
});
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
249
|
+
return __decorateServiceException(exception, body);
|
|
250
|
+
};
|
|
251
|
+
const deserializeAws_json1_0ConflictExceptionResponse = async (parsedOutput, context) => {
|
|
252
|
+
const body = parsedOutput.body;
|
|
253
|
+
const deserialized = deserializeAws_json1_0ConflictException(body, context);
|
|
254
|
+
const exception = new ConflictException({
|
|
255
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
256
|
+
...deserialized,
|
|
362
257
|
});
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
258
|
+
return __decorateServiceException(exception, body);
|
|
259
|
+
};
|
|
260
|
+
const deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse = async (parsedOutput, context) => {
|
|
261
|
+
const body = parsedOutput.body;
|
|
262
|
+
const deserialized = deserializeAws_json1_0EndpointTemporarilyUnavailableException(body, context);
|
|
263
|
+
const exception = new EndpointTemporarilyUnavailableException({
|
|
264
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
265
|
+
...deserialized,
|
|
371
266
|
});
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
267
|
+
return __decorateServiceException(exception, body);
|
|
268
|
+
};
|
|
269
|
+
const deserializeAws_json1_0InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
270
|
+
const body = parsedOutput.body;
|
|
271
|
+
const deserialized = deserializeAws_json1_0InternalServerException(body, context);
|
|
272
|
+
const exception = new InternalServerException({
|
|
273
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
274
|
+
...deserialized,
|
|
380
275
|
});
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
276
|
+
return __decorateServiceException(exception, body);
|
|
277
|
+
};
|
|
278
|
+
const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
279
|
+
const body = parsedOutput.body;
|
|
280
|
+
const deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
|
|
281
|
+
const exception = new ResourceNotFoundException({
|
|
282
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
283
|
+
...deserialized,
|
|
389
284
|
});
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
285
|
+
return __decorateServiceException(exception, body);
|
|
286
|
+
};
|
|
287
|
+
const deserializeAws_json1_0ServiceLimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
288
|
+
const body = parsedOutput.body;
|
|
289
|
+
const deserialized = deserializeAws_json1_0ServiceLimitExceededException(body, context);
|
|
290
|
+
const exception = new ServiceLimitExceededException({
|
|
291
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
292
|
+
...deserialized,
|
|
398
293
|
});
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
294
|
+
return __decorateServiceException(exception, body);
|
|
295
|
+
};
|
|
296
|
+
const deserializeAws_json1_0ThrottlingExceptionResponse = async (parsedOutput, context) => {
|
|
297
|
+
const body = parsedOutput.body;
|
|
298
|
+
const deserialized = deserializeAws_json1_0ThrottlingException(body, context);
|
|
299
|
+
const exception = new ThrottlingException({
|
|
300
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
301
|
+
...deserialized,
|
|
407
302
|
});
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
303
|
+
return __decorateServiceException(exception, body);
|
|
304
|
+
};
|
|
305
|
+
const deserializeAws_json1_0ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
306
|
+
const body = parsedOutput.body;
|
|
307
|
+
const deserialized = deserializeAws_json1_0ValidationException(body, context);
|
|
308
|
+
const exception = new ValidationException({
|
|
309
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
310
|
+
...deserialized,
|
|
416
311
|
});
|
|
417
|
-
|
|
418
|
-
|
|
312
|
+
return __decorateServiceException(exception, body);
|
|
313
|
+
};
|
|
314
|
+
const serializeAws_json1_0Arns = (input, context) => {
|
|
419
315
|
return input
|
|
420
|
-
.filter(
|
|
421
|
-
.map(
|
|
316
|
+
.filter((e) => e != null)
|
|
317
|
+
.map((entry) => {
|
|
422
318
|
return entry;
|
|
423
319
|
});
|
|
424
320
|
};
|
|
425
|
-
|
|
426
|
-
return
|
|
321
|
+
const serializeAws_json1_0GetRoutingControlStateRequest = (input, context) => {
|
|
322
|
+
return {
|
|
323
|
+
...(input.RoutingControlArn != null && { RoutingControlArn: input.RoutingControlArn }),
|
|
324
|
+
};
|
|
427
325
|
};
|
|
428
|
-
|
|
429
|
-
return
|
|
326
|
+
const serializeAws_json1_0ListRoutingControlsRequest = (input, context) => {
|
|
327
|
+
return {
|
|
328
|
+
...(input.ControlPanelArn != null && { ControlPanelArn: input.ControlPanelArn }),
|
|
329
|
+
...(input.MaxResults != null && { MaxResults: input.MaxResults }),
|
|
330
|
+
...(input.NextToken != null && { NextToken: input.NextToken }),
|
|
331
|
+
};
|
|
430
332
|
};
|
|
431
|
-
|
|
333
|
+
const serializeAws_json1_0UpdateRoutingControlStateEntries = (input, context) => {
|
|
432
334
|
return input
|
|
433
|
-
.filter(
|
|
434
|
-
.map(
|
|
335
|
+
.filter((e) => e != null)
|
|
336
|
+
.map((entry) => {
|
|
435
337
|
return serializeAws_json1_0UpdateRoutingControlStateEntry(entry, context);
|
|
436
338
|
});
|
|
437
339
|
};
|
|
438
|
-
|
|
439
|
-
return
|
|
340
|
+
const serializeAws_json1_0UpdateRoutingControlStateEntry = (input, context) => {
|
|
341
|
+
return {
|
|
342
|
+
...(input.RoutingControlArn != null && { RoutingControlArn: input.RoutingControlArn }),
|
|
343
|
+
...(input.RoutingControlState != null && { RoutingControlState: input.RoutingControlState }),
|
|
344
|
+
};
|
|
440
345
|
};
|
|
441
|
-
|
|
442
|
-
return
|
|
443
|
-
|
|
444
|
-
|
|
346
|
+
const serializeAws_json1_0UpdateRoutingControlStateRequest = (input, context) => {
|
|
347
|
+
return {
|
|
348
|
+
...(input.RoutingControlArn != null && { RoutingControlArn: input.RoutingControlArn }),
|
|
349
|
+
...(input.RoutingControlState != null && { RoutingControlState: input.RoutingControlState }),
|
|
350
|
+
...(input.SafetyRulesToOverride != null && {
|
|
351
|
+
SafetyRulesToOverride: serializeAws_json1_0Arns(input.SafetyRulesToOverride, context),
|
|
352
|
+
}),
|
|
353
|
+
};
|
|
445
354
|
};
|
|
446
|
-
|
|
447
|
-
return
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
355
|
+
const serializeAws_json1_0UpdateRoutingControlStatesRequest = (input, context) => {
|
|
356
|
+
return {
|
|
357
|
+
...(input.SafetyRulesToOverride != null && {
|
|
358
|
+
SafetyRulesToOverride: serializeAws_json1_0Arns(input.SafetyRulesToOverride, context),
|
|
359
|
+
}),
|
|
360
|
+
...(input.UpdateRoutingControlStateEntries != null && {
|
|
361
|
+
UpdateRoutingControlStateEntries: serializeAws_json1_0UpdateRoutingControlStateEntries(input.UpdateRoutingControlStateEntries, context),
|
|
362
|
+
}),
|
|
363
|
+
};
|
|
452
364
|
};
|
|
453
|
-
|
|
365
|
+
const deserializeAws_json1_0AccessDeniedException = (output, context) => {
|
|
454
366
|
return {
|
|
455
367
|
message: __expectString(output.message),
|
|
456
368
|
};
|
|
457
369
|
};
|
|
458
|
-
|
|
370
|
+
const deserializeAws_json1_0ConflictException = (output, context) => {
|
|
459
371
|
return {
|
|
460
372
|
message: __expectString(output.message),
|
|
461
373
|
resourceId: __expectString(output.resourceId),
|
|
462
374
|
resourceType: __expectString(output.resourceType),
|
|
463
375
|
};
|
|
464
376
|
};
|
|
465
|
-
|
|
377
|
+
const deserializeAws_json1_0EndpointTemporarilyUnavailableException = (output, context) => {
|
|
466
378
|
return {
|
|
467
379
|
message: __expectString(output.message),
|
|
468
380
|
};
|
|
469
381
|
};
|
|
470
|
-
|
|
382
|
+
const deserializeAws_json1_0GetRoutingControlStateResponse = (output, context) => {
|
|
471
383
|
return {
|
|
472
384
|
RoutingControlArn: __expectString(output.RoutingControlArn),
|
|
473
385
|
RoutingControlName: __expectString(output.RoutingControlName),
|
|
474
386
|
RoutingControlState: __expectString(output.RoutingControlState),
|
|
475
387
|
};
|
|
476
388
|
};
|
|
477
|
-
|
|
389
|
+
const deserializeAws_json1_0InternalServerException = (output, context) => {
|
|
478
390
|
return {
|
|
479
391
|
message: __expectString(output.message),
|
|
480
392
|
retryAfterSeconds: __expectInt32(output.retryAfterSeconds),
|
|
481
393
|
};
|
|
482
394
|
};
|
|
483
|
-
|
|
395
|
+
const deserializeAws_json1_0ListRoutingControlsResponse = (output, context) => {
|
|
484
396
|
return {
|
|
485
397
|
NextToken: __expectString(output.NextToken),
|
|
486
398
|
RoutingControls: output.RoutingControls != null
|
|
@@ -488,14 +400,14 @@ var deserializeAws_json1_0ListRoutingControlsResponse = function (output, contex
|
|
|
488
400
|
: undefined,
|
|
489
401
|
};
|
|
490
402
|
};
|
|
491
|
-
|
|
403
|
+
const deserializeAws_json1_0ResourceNotFoundException = (output, context) => {
|
|
492
404
|
return {
|
|
493
405
|
message: __expectString(output.message),
|
|
494
406
|
resourceId: __expectString(output.resourceId),
|
|
495
407
|
resourceType: __expectString(output.resourceType),
|
|
496
408
|
};
|
|
497
409
|
};
|
|
498
|
-
|
|
410
|
+
const deserializeAws_json1_0RoutingControl = (output, context) => {
|
|
499
411
|
return {
|
|
500
412
|
ControlPanelArn: __expectString(output.ControlPanelArn),
|
|
501
413
|
ControlPanelName: __expectString(output.ControlPanelName),
|
|
@@ -504,10 +416,10 @@ var deserializeAws_json1_0RoutingControl = function (output, context) {
|
|
|
504
416
|
RoutingControlState: __expectString(output.RoutingControlState),
|
|
505
417
|
};
|
|
506
418
|
};
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
.filter(
|
|
510
|
-
.map(
|
|
419
|
+
const deserializeAws_json1_0RoutingControls = (output, context) => {
|
|
420
|
+
const retVal = (output || [])
|
|
421
|
+
.filter((e) => e != null)
|
|
422
|
+
.map((entry) => {
|
|
511
423
|
if (entry === null) {
|
|
512
424
|
return null;
|
|
513
425
|
}
|
|
@@ -515,7 +427,7 @@ var deserializeAws_json1_0RoutingControls = function (output, context) {
|
|
|
515
427
|
});
|
|
516
428
|
return retVal;
|
|
517
429
|
};
|
|
518
|
-
|
|
430
|
+
const deserializeAws_json1_0ServiceLimitExceededException = (output, context) => {
|
|
519
431
|
return {
|
|
520
432
|
limitCode: __expectString(output.limitCode),
|
|
521
433
|
message: __expectString(output.message),
|
|
@@ -524,35 +436,35 @@ var deserializeAws_json1_0ServiceLimitExceededException = function (output, cont
|
|
|
524
436
|
serviceCode: __expectString(output.serviceCode),
|
|
525
437
|
};
|
|
526
438
|
};
|
|
527
|
-
|
|
439
|
+
const deserializeAws_json1_0ThrottlingException = (output, context) => {
|
|
528
440
|
return {
|
|
529
441
|
message: __expectString(output.message),
|
|
530
442
|
retryAfterSeconds: __expectInt32(output.retryAfterSeconds),
|
|
531
443
|
};
|
|
532
444
|
};
|
|
533
|
-
|
|
445
|
+
const deserializeAws_json1_0UpdateRoutingControlStateResponse = (output, context) => {
|
|
534
446
|
return {};
|
|
535
447
|
};
|
|
536
|
-
|
|
448
|
+
const deserializeAws_json1_0UpdateRoutingControlStatesResponse = (output, context) => {
|
|
537
449
|
return {};
|
|
538
450
|
};
|
|
539
|
-
|
|
451
|
+
const deserializeAws_json1_0ValidationException = (output, context) => {
|
|
540
452
|
return {
|
|
541
453
|
fields: output.fields != null ? deserializeAws_json1_0ValidationExceptionFieldList(output.fields, context) : undefined,
|
|
542
454
|
message: __expectString(output.message),
|
|
543
455
|
reason: __expectString(output.reason),
|
|
544
456
|
};
|
|
545
457
|
};
|
|
546
|
-
|
|
458
|
+
const deserializeAws_json1_0ValidationExceptionField = (output, context) => {
|
|
547
459
|
return {
|
|
548
460
|
message: __expectString(output.message),
|
|
549
461
|
name: __expectString(output.name),
|
|
550
462
|
};
|
|
551
463
|
};
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
.filter(
|
|
555
|
-
.map(
|
|
464
|
+
const deserializeAws_json1_0ValidationExceptionFieldList = (output, context) => {
|
|
465
|
+
const retVal = (output || [])
|
|
466
|
+
.filter((e) => e != null)
|
|
467
|
+
.map((entry) => {
|
|
556
468
|
if (entry === null) {
|
|
557
469
|
return null;
|
|
558
470
|
}
|
|
@@ -560,62 +472,52 @@ var deserializeAws_json1_0ValidationExceptionFieldList = function (output, conte
|
|
|
560
472
|
});
|
|
561
473
|
return retVal;
|
|
562
474
|
};
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
});
|
|
571
|
-
};
|
|
572
|
-
var collectBody = function (streamBody, context) {
|
|
573
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
475
|
+
const deserializeMetadata = (output) => ({
|
|
476
|
+
httpStatusCode: output.statusCode,
|
|
477
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
478
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
479
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
480
|
+
});
|
|
481
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
574
482
|
if (streamBody instanceof Uint8Array) {
|
|
575
483
|
return Promise.resolve(streamBody);
|
|
576
484
|
}
|
|
577
485
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
578
486
|
};
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
};
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
609
|
-
if (encoded.length) {
|
|
610
|
-
return JSON.parse(encoded);
|
|
611
|
-
}
|
|
612
|
-
return {};
|
|
613
|
-
});
|
|
487
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
488
|
+
const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
|
|
489
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
490
|
+
const contents = {
|
|
491
|
+
protocol,
|
|
492
|
+
hostname,
|
|
493
|
+
port,
|
|
494
|
+
method: "POST",
|
|
495
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
496
|
+
headers,
|
|
497
|
+
};
|
|
498
|
+
if (resolvedHostname !== undefined) {
|
|
499
|
+
contents.hostname = resolvedHostname;
|
|
500
|
+
}
|
|
501
|
+
if (body !== undefined) {
|
|
502
|
+
contents.body = body;
|
|
503
|
+
}
|
|
504
|
+
return new __HttpRequest(contents);
|
|
505
|
+
};
|
|
506
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
507
|
+
if (encoded.length) {
|
|
508
|
+
return JSON.parse(encoded);
|
|
509
|
+
}
|
|
510
|
+
return {};
|
|
511
|
+
});
|
|
512
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
513
|
+
const value = await parseBody(errorBody, context);
|
|
514
|
+
value.message = value.message ?? value.Message;
|
|
515
|
+
return value;
|
|
614
516
|
};
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
517
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
518
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
519
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
520
|
+
let cleanValue = rawValue;
|
|
619
521
|
if (typeof cleanValue === "number") {
|
|
620
522
|
cleanValue = cleanValue.toString();
|
|
621
523
|
}
|
|
@@ -630,7 +532,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
630
532
|
}
|
|
631
533
|
return cleanValue;
|
|
632
534
|
};
|
|
633
|
-
|
|
535
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
634
536
|
if (headerKey !== undefined) {
|
|
635
537
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
636
538
|
}
|