@aws-sdk/client-route53-recovery-cluster 3.35.0 → 3.36.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.
Files changed (78) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist-cjs/Route53RecoveryCluster.js +0 -1
  3. package/dist-cjs/Route53RecoveryClusterClient.js +0 -1
  4. package/dist-cjs/commands/GetRoutingControlStateCommand.js +0 -1
  5. package/dist-cjs/commands/UpdateRoutingControlStateCommand.js +0 -1
  6. package/dist-cjs/commands/UpdateRoutingControlStatesCommand.js +0 -1
  7. package/dist-cjs/endpoints.js +0 -1
  8. package/dist-cjs/index.js +0 -1
  9. package/dist-cjs/models/index.js +0 -1
  10. package/dist-cjs/models/models_0.js +0 -1
  11. package/dist-cjs/protocols/Aws_json1_0.js +0 -1
  12. package/dist-cjs/runtimeConfig.browser.js +2 -3
  13. package/dist-cjs/runtimeConfig.js +3 -4
  14. package/dist-cjs/runtimeConfig.native.js +0 -1
  15. package/dist-cjs/runtimeConfig.shared.js +0 -1
  16. package/dist-es/Route53RecoveryCluster.js +0 -1
  17. package/dist-es/Route53RecoveryClusterClient.js +0 -1
  18. package/dist-es/commands/GetRoutingControlStateCommand.js +0 -1
  19. package/dist-es/commands/UpdateRoutingControlStateCommand.js +0 -1
  20. package/dist-es/commands/UpdateRoutingControlStatesCommand.js +0 -1
  21. package/dist-es/endpoints.js +0 -1
  22. package/dist-es/index.js +0 -1
  23. package/dist-es/models/index.js +0 -1
  24. package/dist-es/models/models_0.js +0 -1
  25. package/dist-es/protocols/Aws_json1_0.js +0 -1
  26. package/dist-es/runtimeConfig.browser.js +1 -2
  27. package/dist-es/runtimeConfig.js +2 -3
  28. package/dist-es/runtimeConfig.native.js +0 -1
  29. package/dist-es/runtimeConfig.shared.js +0 -1
  30. package/dist-types/runtimeConfig.browser.d.ts +3 -1
  31. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +3 -1
  32. package/package.json +33 -30
  33. package/dist-cjs/Route53RecoveryCluster.js.map +0 -1
  34. package/dist-cjs/Route53RecoveryClusterClient.js.map +0 -1
  35. package/dist-cjs/commands/GetRoutingControlStateCommand.js.map +0 -1
  36. package/dist-cjs/commands/UpdateRoutingControlStateCommand.js.map +0 -1
  37. package/dist-cjs/commands/UpdateRoutingControlStatesCommand.js.map +0 -1
  38. package/dist-cjs/endpoints.js.map +0 -1
  39. package/dist-cjs/index.js.map +0 -1
  40. package/dist-cjs/models/index.js.map +0 -1
  41. package/dist-cjs/models/models_0.js.map +0 -1
  42. package/dist-cjs/protocols/Aws_json1_0.js.map +0 -1
  43. package/dist-cjs/runtimeConfig.browser.js.map +0 -1
  44. package/dist-cjs/runtimeConfig.js.map +0 -1
  45. package/dist-cjs/runtimeConfig.native.js.map +0 -1
  46. package/dist-cjs/runtimeConfig.shared.js.map +0 -1
  47. package/dist-es/Route53RecoveryCluster.js.map +0 -1
  48. package/dist-es/Route53RecoveryClusterClient.js.map +0 -1
  49. package/dist-es/commands/GetRoutingControlStateCommand.js.map +0 -1
  50. package/dist-es/commands/UpdateRoutingControlStateCommand.js.map +0 -1
  51. package/dist-es/commands/UpdateRoutingControlStatesCommand.js.map +0 -1
  52. package/dist-es/endpoints.js.map +0 -1
  53. package/dist-es/index.js.map +0 -1
  54. package/dist-es/models/index.js.map +0 -1
  55. package/dist-es/models/models_0.js.map +0 -1
  56. package/dist-es/protocols/Aws_json1_0.js.map +0 -1
  57. package/dist-es/runtimeConfig.browser.js.map +0 -1
  58. package/dist-es/runtimeConfig.js.map +0 -1
  59. package/dist-es/runtimeConfig.native.js.map +0 -1
  60. package/dist-es/runtimeConfig.shared.js.map +0 -1
  61. package/jest.config.js +0 -4
  62. package/src/Route53RecoveryCluster.ts +0 -157
  63. package/src/Route53RecoveryClusterClient.ts +0 -275
  64. package/src/commands/GetRoutingControlStateCommand.ts +0 -108
  65. package/src/commands/UpdateRoutingControlStateCommand.ts +0 -106
  66. package/src/commands/UpdateRoutingControlStatesCommand.ts +0 -106
  67. package/src/endpoints.ts +0 -57
  68. package/src/index.ts +0 -6
  69. package/src/models/index.ts +0 -1
  70. package/src/models/models_0.ts +0 -322
  71. package/src/protocols/Aws_json1_0.ts +0 -740
  72. package/src/runtimeConfig.browser.ts +0 -41
  73. package/src/runtimeConfig.native.ts +0 -17
  74. package/src/runtimeConfig.shared.ts +0 -17
  75. package/src/runtimeConfig.ts +0 -46
  76. package/tsconfig.es.json +0 -10
  77. package/tsconfig.json +0 -33
  78. package/tsconfig.types.json +0 -9
@@ -1,740 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
2
- import { expectInt32 as __expectInt32, expectString as __expectString } from "@aws-sdk/smithy-client";
3
- import {
4
- Endpoint as __Endpoint,
5
- HeaderBag as __HeaderBag,
6
- MetadataBearer as __MetadataBearer,
7
- ResponseMetadata as __ResponseMetadata,
8
- SerdeContext as __SerdeContext,
9
- SmithyException as __SmithyException,
10
- } from "@aws-sdk/types";
11
-
12
- import {
13
- GetRoutingControlStateCommandInput,
14
- GetRoutingControlStateCommandOutput,
15
- } from "../commands/GetRoutingControlStateCommand";
16
- import {
17
- UpdateRoutingControlStateCommandInput,
18
- UpdateRoutingControlStateCommandOutput,
19
- } from "../commands/UpdateRoutingControlStateCommand";
20
- import {
21
- UpdateRoutingControlStatesCommandInput,
22
- UpdateRoutingControlStatesCommandOutput,
23
- } from "../commands/UpdateRoutingControlStatesCommand";
24
- import {
25
- AccessDeniedException,
26
- ConflictException,
27
- EndpointTemporarilyUnavailableException,
28
- GetRoutingControlStateRequest,
29
- GetRoutingControlStateResponse,
30
- InternalServerException,
31
- ResourceNotFoundException,
32
- ThrottlingException,
33
- UpdateRoutingControlStateEntry,
34
- UpdateRoutingControlStateRequest,
35
- UpdateRoutingControlStateResponse,
36
- UpdateRoutingControlStatesRequest,
37
- UpdateRoutingControlStatesResponse,
38
- ValidationException,
39
- ValidationExceptionField,
40
- } from "../models/models_0";
41
-
42
- export const serializeAws_json1_0GetRoutingControlStateCommand = async (
43
- input: GetRoutingControlStateCommandInput,
44
- context: __SerdeContext
45
- ): Promise<__HttpRequest> => {
46
- const headers: __HeaderBag = {
47
- "content-type": "application/x-amz-json-1.0",
48
- "x-amz-target": "ToggleCustomerAPI.GetRoutingControlState",
49
- };
50
- let body: any;
51
- body = JSON.stringify(serializeAws_json1_0GetRoutingControlStateRequest(input, context));
52
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
53
- };
54
-
55
- export const serializeAws_json1_0UpdateRoutingControlStateCommand = async (
56
- input: UpdateRoutingControlStateCommandInput,
57
- context: __SerdeContext
58
- ): Promise<__HttpRequest> => {
59
- const headers: __HeaderBag = {
60
- "content-type": "application/x-amz-json-1.0",
61
- "x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlState",
62
- };
63
- let body: any;
64
- body = JSON.stringify(serializeAws_json1_0UpdateRoutingControlStateRequest(input, context));
65
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
66
- };
67
-
68
- export const serializeAws_json1_0UpdateRoutingControlStatesCommand = async (
69
- input: UpdateRoutingControlStatesCommandInput,
70
- context: __SerdeContext
71
- ): Promise<__HttpRequest> => {
72
- const headers: __HeaderBag = {
73
- "content-type": "application/x-amz-json-1.0",
74
- "x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlStates",
75
- };
76
- let body: any;
77
- body = JSON.stringify(serializeAws_json1_0UpdateRoutingControlStatesRequest(input, context));
78
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
79
- };
80
-
81
- export const deserializeAws_json1_0GetRoutingControlStateCommand = async (
82
- output: __HttpResponse,
83
- context: __SerdeContext
84
- ): Promise<GetRoutingControlStateCommandOutput> => {
85
- if (output.statusCode >= 300) {
86
- return deserializeAws_json1_0GetRoutingControlStateCommandError(output, context);
87
- }
88
- const data: any = await parseBody(output.body, context);
89
- let contents: any = {};
90
- contents = deserializeAws_json1_0GetRoutingControlStateResponse(data, context);
91
- const response: GetRoutingControlStateCommandOutput = {
92
- $metadata: deserializeMetadata(output),
93
- ...contents,
94
- };
95
- return Promise.resolve(response);
96
- };
97
-
98
- const deserializeAws_json1_0GetRoutingControlStateCommandError = async (
99
- output: __HttpResponse,
100
- context: __SerdeContext
101
- ): Promise<GetRoutingControlStateCommandOutput> => {
102
- const parsedOutput: any = {
103
- ...output,
104
- body: await parseBody(output.body, context),
105
- };
106
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
107
- let errorCode = "UnknownError";
108
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
109
- switch (errorCode) {
110
- case "AccessDeniedException":
111
- case "com.amazonaws.route53recoverycluster#AccessDeniedException":
112
- response = {
113
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
114
- name: errorCode,
115
- $metadata: deserializeMetadata(output),
116
- };
117
- break;
118
- case "EndpointTemporarilyUnavailableException":
119
- case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException":
120
- response = {
121
- ...(await deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
122
- name: errorCode,
123
- $metadata: deserializeMetadata(output),
124
- };
125
- break;
126
- case "InternalServerException":
127
- case "com.amazonaws.route53recoverycluster#InternalServerException":
128
- response = {
129
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
130
- name: errorCode,
131
- $metadata: deserializeMetadata(output),
132
- };
133
- break;
134
- case "ResourceNotFoundException":
135
- case "com.amazonaws.route53recoverycluster#ResourceNotFoundException":
136
- response = {
137
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
138
- name: errorCode,
139
- $metadata: deserializeMetadata(output),
140
- };
141
- break;
142
- case "ThrottlingException":
143
- case "com.amazonaws.route53recoverycluster#ThrottlingException":
144
- response = {
145
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
146
- name: errorCode,
147
- $metadata: deserializeMetadata(output),
148
- };
149
- break;
150
- case "ValidationException":
151
- case "com.amazonaws.route53recoverycluster#ValidationException":
152
- response = {
153
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
154
- name: errorCode,
155
- $metadata: deserializeMetadata(output),
156
- };
157
- break;
158
- default:
159
- const parsedBody = parsedOutput.body;
160
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
161
- response = {
162
- ...parsedBody,
163
- name: `${errorCode}`,
164
- message: parsedBody.message || parsedBody.Message || errorCode,
165
- $fault: "client",
166
- $metadata: deserializeMetadata(output),
167
- } as any;
168
- }
169
- const message = response.message || response.Message || errorCode;
170
- response.message = message;
171
- delete response.Message;
172
- return Promise.reject(Object.assign(new Error(message), response));
173
- };
174
-
175
- export const deserializeAws_json1_0UpdateRoutingControlStateCommand = async (
176
- output: __HttpResponse,
177
- context: __SerdeContext
178
- ): Promise<UpdateRoutingControlStateCommandOutput> => {
179
- if (output.statusCode >= 300) {
180
- return deserializeAws_json1_0UpdateRoutingControlStateCommandError(output, context);
181
- }
182
- const data: any = await parseBody(output.body, context);
183
- let contents: any = {};
184
- contents = deserializeAws_json1_0UpdateRoutingControlStateResponse(data, context);
185
- const response: UpdateRoutingControlStateCommandOutput = {
186
- $metadata: deserializeMetadata(output),
187
- ...contents,
188
- };
189
- return Promise.resolve(response);
190
- };
191
-
192
- const deserializeAws_json1_0UpdateRoutingControlStateCommandError = async (
193
- output: __HttpResponse,
194
- context: __SerdeContext
195
- ): Promise<UpdateRoutingControlStateCommandOutput> => {
196
- const parsedOutput: any = {
197
- ...output,
198
- body: await parseBody(output.body, context),
199
- };
200
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
201
- let errorCode = "UnknownError";
202
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
203
- switch (errorCode) {
204
- case "AccessDeniedException":
205
- case "com.amazonaws.route53recoverycluster#AccessDeniedException":
206
- response = {
207
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
208
- name: errorCode,
209
- $metadata: deserializeMetadata(output),
210
- };
211
- break;
212
- case "ConflictException":
213
- case "com.amazonaws.route53recoverycluster#ConflictException":
214
- response = {
215
- ...(await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)),
216
- name: errorCode,
217
- $metadata: deserializeMetadata(output),
218
- };
219
- break;
220
- case "EndpointTemporarilyUnavailableException":
221
- case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException":
222
- response = {
223
- ...(await deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
224
- name: errorCode,
225
- $metadata: deserializeMetadata(output),
226
- };
227
- break;
228
- case "InternalServerException":
229
- case "com.amazonaws.route53recoverycluster#InternalServerException":
230
- response = {
231
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
232
- name: errorCode,
233
- $metadata: deserializeMetadata(output),
234
- };
235
- break;
236
- case "ResourceNotFoundException":
237
- case "com.amazonaws.route53recoverycluster#ResourceNotFoundException":
238
- response = {
239
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
240
- name: errorCode,
241
- $metadata: deserializeMetadata(output),
242
- };
243
- break;
244
- case "ThrottlingException":
245
- case "com.amazonaws.route53recoverycluster#ThrottlingException":
246
- response = {
247
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
248
- name: errorCode,
249
- $metadata: deserializeMetadata(output),
250
- };
251
- break;
252
- case "ValidationException":
253
- case "com.amazonaws.route53recoverycluster#ValidationException":
254
- response = {
255
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
256
- name: errorCode,
257
- $metadata: deserializeMetadata(output),
258
- };
259
- break;
260
- default:
261
- const parsedBody = parsedOutput.body;
262
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
263
- response = {
264
- ...parsedBody,
265
- name: `${errorCode}`,
266
- message: parsedBody.message || parsedBody.Message || errorCode,
267
- $fault: "client",
268
- $metadata: deserializeMetadata(output),
269
- } as any;
270
- }
271
- const message = response.message || response.Message || errorCode;
272
- response.message = message;
273
- delete response.Message;
274
- return Promise.reject(Object.assign(new Error(message), response));
275
- };
276
-
277
- export const deserializeAws_json1_0UpdateRoutingControlStatesCommand = async (
278
- output: __HttpResponse,
279
- context: __SerdeContext
280
- ): Promise<UpdateRoutingControlStatesCommandOutput> => {
281
- if (output.statusCode >= 300) {
282
- return deserializeAws_json1_0UpdateRoutingControlStatesCommandError(output, context);
283
- }
284
- const data: any = await parseBody(output.body, context);
285
- let contents: any = {};
286
- contents = deserializeAws_json1_0UpdateRoutingControlStatesResponse(data, context);
287
- const response: UpdateRoutingControlStatesCommandOutput = {
288
- $metadata: deserializeMetadata(output),
289
- ...contents,
290
- };
291
- return Promise.resolve(response);
292
- };
293
-
294
- const deserializeAws_json1_0UpdateRoutingControlStatesCommandError = async (
295
- output: __HttpResponse,
296
- context: __SerdeContext
297
- ): Promise<UpdateRoutingControlStatesCommandOutput> => {
298
- const parsedOutput: any = {
299
- ...output,
300
- body: await parseBody(output.body, context),
301
- };
302
- let response: __SmithyException & __MetadataBearer & { [key: string]: any };
303
- let errorCode = "UnknownError";
304
- errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
305
- switch (errorCode) {
306
- case "AccessDeniedException":
307
- case "com.amazonaws.route53recoverycluster#AccessDeniedException":
308
- response = {
309
- ...(await deserializeAws_json1_0AccessDeniedExceptionResponse(parsedOutput, context)),
310
- name: errorCode,
311
- $metadata: deserializeMetadata(output),
312
- };
313
- break;
314
- case "ConflictException":
315
- case "com.amazonaws.route53recoverycluster#ConflictException":
316
- response = {
317
- ...(await deserializeAws_json1_0ConflictExceptionResponse(parsedOutput, context)),
318
- name: errorCode,
319
- $metadata: deserializeMetadata(output),
320
- };
321
- break;
322
- case "EndpointTemporarilyUnavailableException":
323
- case "com.amazonaws.route53recoverycluster#EndpointTemporarilyUnavailableException":
324
- response = {
325
- ...(await deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse(parsedOutput, context)),
326
- name: errorCode,
327
- $metadata: deserializeMetadata(output),
328
- };
329
- break;
330
- case "InternalServerException":
331
- case "com.amazonaws.route53recoverycluster#InternalServerException":
332
- response = {
333
- ...(await deserializeAws_json1_0InternalServerExceptionResponse(parsedOutput, context)),
334
- name: errorCode,
335
- $metadata: deserializeMetadata(output),
336
- };
337
- break;
338
- case "ResourceNotFoundException":
339
- case "com.amazonaws.route53recoverycluster#ResourceNotFoundException":
340
- response = {
341
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
342
- name: errorCode,
343
- $metadata: deserializeMetadata(output),
344
- };
345
- break;
346
- case "ThrottlingException":
347
- case "com.amazonaws.route53recoverycluster#ThrottlingException":
348
- response = {
349
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
350
- name: errorCode,
351
- $metadata: deserializeMetadata(output),
352
- };
353
- break;
354
- case "ValidationException":
355
- case "com.amazonaws.route53recoverycluster#ValidationException":
356
- response = {
357
- ...(await deserializeAws_json1_0ValidationExceptionResponse(parsedOutput, context)),
358
- name: errorCode,
359
- $metadata: deserializeMetadata(output),
360
- };
361
- break;
362
- default:
363
- const parsedBody = parsedOutput.body;
364
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
365
- response = {
366
- ...parsedBody,
367
- name: `${errorCode}`,
368
- message: parsedBody.message || parsedBody.Message || errorCode,
369
- $fault: "client",
370
- $metadata: deserializeMetadata(output),
371
- } as any;
372
- }
373
- const message = response.message || response.Message || errorCode;
374
- response.message = message;
375
- delete response.Message;
376
- return Promise.reject(Object.assign(new Error(message), response));
377
- };
378
-
379
- const deserializeAws_json1_0AccessDeniedExceptionResponse = async (
380
- parsedOutput: any,
381
- context: __SerdeContext
382
- ): Promise<AccessDeniedException> => {
383
- const body = parsedOutput.body;
384
- const deserialized: any = deserializeAws_json1_0AccessDeniedException(body, context);
385
- const contents: AccessDeniedException = {
386
- name: "AccessDeniedException",
387
- $fault: "client",
388
- $metadata: deserializeMetadata(parsedOutput),
389
- ...deserialized,
390
- };
391
- return contents;
392
- };
393
-
394
- const deserializeAws_json1_0ConflictExceptionResponse = async (
395
- parsedOutput: any,
396
- context: __SerdeContext
397
- ): Promise<ConflictException> => {
398
- const body = parsedOutput.body;
399
- const deserialized: any = deserializeAws_json1_0ConflictException(body, context);
400
- const contents: ConflictException = {
401
- name: "ConflictException",
402
- $fault: "client",
403
- $metadata: deserializeMetadata(parsedOutput),
404
- ...deserialized,
405
- };
406
- return contents;
407
- };
408
-
409
- const deserializeAws_json1_0EndpointTemporarilyUnavailableExceptionResponse = async (
410
- parsedOutput: any,
411
- context: __SerdeContext
412
- ): Promise<EndpointTemporarilyUnavailableException> => {
413
- const body = parsedOutput.body;
414
- const deserialized: any = deserializeAws_json1_0EndpointTemporarilyUnavailableException(body, context);
415
- const contents: EndpointTemporarilyUnavailableException = {
416
- name: "EndpointTemporarilyUnavailableException",
417
- $fault: "server",
418
- $metadata: deserializeMetadata(parsedOutput),
419
- ...deserialized,
420
- };
421
- return contents;
422
- };
423
-
424
- const deserializeAws_json1_0InternalServerExceptionResponse = async (
425
- parsedOutput: any,
426
- context: __SerdeContext
427
- ): Promise<InternalServerException> => {
428
- const body = parsedOutput.body;
429
- const deserialized: any = deserializeAws_json1_0InternalServerException(body, context);
430
- const contents: InternalServerException = {
431
- name: "InternalServerException",
432
- $fault: "server",
433
- $metadata: deserializeMetadata(parsedOutput),
434
- ...deserialized,
435
- };
436
- return contents;
437
- };
438
-
439
- const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (
440
- parsedOutput: any,
441
- context: __SerdeContext
442
- ): Promise<ResourceNotFoundException> => {
443
- const body = parsedOutput.body;
444
- const deserialized: any = deserializeAws_json1_0ResourceNotFoundException(body, context);
445
- const contents: ResourceNotFoundException = {
446
- name: "ResourceNotFoundException",
447
- $fault: "client",
448
- $metadata: deserializeMetadata(parsedOutput),
449
- ...deserialized,
450
- };
451
- return contents;
452
- };
453
-
454
- const deserializeAws_json1_0ThrottlingExceptionResponse = async (
455
- parsedOutput: any,
456
- context: __SerdeContext
457
- ): Promise<ThrottlingException> => {
458
- const body = parsedOutput.body;
459
- const deserialized: any = deserializeAws_json1_0ThrottlingException(body, context);
460
- const contents: ThrottlingException = {
461
- name: "ThrottlingException",
462
- $fault: "client",
463
- $metadata: deserializeMetadata(parsedOutput),
464
- ...deserialized,
465
- };
466
- return contents;
467
- };
468
-
469
- const deserializeAws_json1_0ValidationExceptionResponse = async (
470
- parsedOutput: any,
471
- context: __SerdeContext
472
- ): Promise<ValidationException> => {
473
- const body = parsedOutput.body;
474
- const deserialized: any = deserializeAws_json1_0ValidationException(body, context);
475
- const contents: ValidationException = {
476
- name: "ValidationException",
477
- $fault: "client",
478
- $metadata: deserializeMetadata(parsedOutput),
479
- ...deserialized,
480
- };
481
- return contents;
482
- };
483
-
484
- const serializeAws_json1_0GetRoutingControlStateRequest = (
485
- input: GetRoutingControlStateRequest,
486
- context: __SerdeContext
487
- ): any => {
488
- return {
489
- ...(input.RoutingControlArn !== undefined &&
490
- input.RoutingControlArn !== null && { RoutingControlArn: input.RoutingControlArn }),
491
- };
492
- };
493
-
494
- const serializeAws_json1_0UpdateRoutingControlStateEntries = (
495
- input: UpdateRoutingControlStateEntry[],
496
- context: __SerdeContext
497
- ): any => {
498
- return input
499
- .filter((e: any) => e != null)
500
- .map((entry) => {
501
- if (entry === null) {
502
- return null as any;
503
- }
504
- return serializeAws_json1_0UpdateRoutingControlStateEntry(entry, context);
505
- });
506
- };
507
-
508
- const serializeAws_json1_0UpdateRoutingControlStateEntry = (
509
- input: UpdateRoutingControlStateEntry,
510
- context: __SerdeContext
511
- ): any => {
512
- return {
513
- ...(input.RoutingControlArn !== undefined &&
514
- input.RoutingControlArn !== null && { RoutingControlArn: input.RoutingControlArn }),
515
- ...(input.RoutingControlState !== undefined &&
516
- input.RoutingControlState !== null && { RoutingControlState: input.RoutingControlState }),
517
- };
518
- };
519
-
520
- const serializeAws_json1_0UpdateRoutingControlStateRequest = (
521
- input: UpdateRoutingControlStateRequest,
522
- context: __SerdeContext
523
- ): any => {
524
- return {
525
- ...(input.RoutingControlArn !== undefined &&
526
- input.RoutingControlArn !== null && { RoutingControlArn: input.RoutingControlArn }),
527
- ...(input.RoutingControlState !== undefined &&
528
- input.RoutingControlState !== null && { RoutingControlState: input.RoutingControlState }),
529
- };
530
- };
531
-
532
- const serializeAws_json1_0UpdateRoutingControlStatesRequest = (
533
- input: UpdateRoutingControlStatesRequest,
534
- context: __SerdeContext
535
- ): any => {
536
- return {
537
- ...(input.UpdateRoutingControlStateEntries !== undefined &&
538
- input.UpdateRoutingControlStateEntries !== null && {
539
- UpdateRoutingControlStateEntries: serializeAws_json1_0UpdateRoutingControlStateEntries(
540
- input.UpdateRoutingControlStateEntries,
541
- context
542
- ),
543
- }),
544
- };
545
- };
546
-
547
- const deserializeAws_json1_0AccessDeniedException = (output: any, context: __SerdeContext): AccessDeniedException => {
548
- return {
549
- message: __expectString(output.message),
550
- } as any;
551
- };
552
-
553
- const deserializeAws_json1_0ConflictException = (output: any, context: __SerdeContext): ConflictException => {
554
- return {
555
- message: __expectString(output.message),
556
- resourceId: __expectString(output.resourceId),
557
- resourceType: __expectString(output.resourceType),
558
- } as any;
559
- };
560
-
561
- const deserializeAws_json1_0EndpointTemporarilyUnavailableException = (
562
- output: any,
563
- context: __SerdeContext
564
- ): EndpointTemporarilyUnavailableException => {
565
- return {
566
- message: __expectString(output.message),
567
- } as any;
568
- };
569
-
570
- const deserializeAws_json1_0GetRoutingControlStateResponse = (
571
- output: any,
572
- context: __SerdeContext
573
- ): GetRoutingControlStateResponse => {
574
- return {
575
- RoutingControlArn: __expectString(output.RoutingControlArn),
576
- RoutingControlState: __expectString(output.RoutingControlState),
577
- } as any;
578
- };
579
-
580
- const deserializeAws_json1_0InternalServerException = (
581
- output: any,
582
- context: __SerdeContext
583
- ): InternalServerException => {
584
- return {
585
- message: __expectString(output.message),
586
- retryAfterSeconds: __expectInt32(output.retryAfterSeconds),
587
- } as any;
588
- };
589
-
590
- const deserializeAws_json1_0ResourceNotFoundException = (
591
- output: any,
592
- context: __SerdeContext
593
- ): ResourceNotFoundException => {
594
- return {
595
- message: __expectString(output.message),
596
- resourceId: __expectString(output.resourceId),
597
- resourceType: __expectString(output.resourceType),
598
- } as any;
599
- };
600
-
601
- const deserializeAws_json1_0ThrottlingException = (output: any, context: __SerdeContext): ThrottlingException => {
602
- return {
603
- message: __expectString(output.message),
604
- retryAfterSeconds: __expectInt32(output.retryAfterSeconds),
605
- } as any;
606
- };
607
-
608
- const deserializeAws_json1_0UpdateRoutingControlStateResponse = (
609
- output: any,
610
- context: __SerdeContext
611
- ): UpdateRoutingControlStateResponse => {
612
- return {} as any;
613
- };
614
-
615
- const deserializeAws_json1_0UpdateRoutingControlStatesResponse = (
616
- output: any,
617
- context: __SerdeContext
618
- ): UpdateRoutingControlStatesResponse => {
619
- return {} as any;
620
- };
621
-
622
- const deserializeAws_json1_0ValidationException = (output: any, context: __SerdeContext): ValidationException => {
623
- return {
624
- fields:
625
- output.fields !== undefined && output.fields !== null
626
- ? deserializeAws_json1_0ValidationExceptionFieldList(output.fields, context)
627
- : undefined,
628
- message: __expectString(output.message),
629
- reason: __expectString(output.reason),
630
- } as any;
631
- };
632
-
633
- const deserializeAws_json1_0ValidationExceptionField = (
634
- output: any,
635
- context: __SerdeContext
636
- ): ValidationExceptionField => {
637
- return {
638
- message: __expectString(output.message),
639
- name: __expectString(output.name),
640
- } as any;
641
- };
642
-
643
- const deserializeAws_json1_0ValidationExceptionFieldList = (
644
- output: any,
645
- context: __SerdeContext
646
- ): ValidationExceptionField[] => {
647
- return (output || [])
648
- .filter((e: any) => e != null)
649
- .map((entry: any) => {
650
- if (entry === null) {
651
- return null as any;
652
- }
653
- return deserializeAws_json1_0ValidationExceptionField(entry, context);
654
- });
655
- };
656
-
657
- const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
658
- httpStatusCode: output.statusCode,
659
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
660
- extendedRequestId: output.headers["x-amz-id-2"],
661
- cfId: output.headers["x-amz-cf-id"],
662
- });
663
-
664
- // Collect low-level response body stream to Uint8Array.
665
- const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
666
- if (streamBody instanceof Uint8Array) {
667
- return Promise.resolve(streamBody);
668
- }
669
- return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
670
- };
671
-
672
- // Encode Uint8Array data into string with utf-8.
673
- const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
674
- collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
675
-
676
- const buildHttpRpcRequest = async (
677
- context: __SerdeContext,
678
- headers: __HeaderBag,
679
- path: string,
680
- resolvedHostname: string | undefined,
681
- body: any
682
- ): Promise<__HttpRequest> => {
683
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
684
- const contents: any = {
685
- protocol,
686
- hostname,
687
- port,
688
- method: "POST",
689
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
690
- headers,
691
- };
692
- if (resolvedHostname !== undefined) {
693
- contents.hostname = resolvedHostname;
694
- }
695
- if (body !== undefined) {
696
- contents.body = body;
697
- }
698
- return new __HttpRequest(contents);
699
- };
700
-
701
- const parseBody = (streamBody: any, context: __SerdeContext): any =>
702
- collectBodyString(streamBody, context).then((encoded) => {
703
- if (encoded.length) {
704
- return JSON.parse(encoded);
705
- }
706
- return {};
707
- });
708
-
709
- /**
710
- * Load an error code for the aws.rest-json-1.1 protocol.
711
- */
712
- const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
713
- const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
714
-
715
- const sanitizeErrorCode = (rawValue: string): string => {
716
- let cleanValue = rawValue;
717
- if (cleanValue.indexOf(":") >= 0) {
718
- cleanValue = cleanValue.split(":")[0];
719
- }
720
- if (cleanValue.indexOf("#") >= 0) {
721
- cleanValue = cleanValue.split("#")[1];
722
- }
723
- return cleanValue;
724
- };
725
-
726
- const headerKey = findKey(output.headers, "x-amzn-errortype");
727
- if (headerKey !== undefined) {
728
- return sanitizeErrorCode(output.headers[headerKey]);
729
- }
730
-
731
- if (data.code !== undefined) {
732
- return sanitizeErrorCode(data.code);
733
- }
734
-
735
- if (data["__type"] !== undefined) {
736
- return sanitizeErrorCode(data["__type"]);
737
- }
738
-
739
- return "";
740
- };