@aws-sdk/client-route53-recovery-cluster 3.310.0 → 3.315.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -6,42 +6,30 @@ const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const models_0_1 = require("../models/models_0");
7
7
  const Route53RecoveryClusterServiceException_1 = require("../models/Route53RecoveryClusterServiceException");
8
8
  const se_GetRoutingControlStateCommand = async (input, context) => {
9
- const headers = {
10
- "content-type": "application/x-amz-json-1.0",
11
- "x-amz-target": "ToggleCustomerAPI.GetRoutingControlState",
12
- };
9
+ const headers = sharedHeaders("GetRoutingControlState");
13
10
  let body;
14
- body = JSON.stringify(se_GetRoutingControlStateRequest(input, context));
11
+ body = JSON.stringify((0, smithy_client_1._json)(input));
15
12
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
13
  };
17
14
  exports.se_GetRoutingControlStateCommand = se_GetRoutingControlStateCommand;
18
15
  const se_ListRoutingControlsCommand = async (input, context) => {
19
- const headers = {
20
- "content-type": "application/x-amz-json-1.0",
21
- "x-amz-target": "ToggleCustomerAPI.ListRoutingControls",
22
- };
16
+ const headers = sharedHeaders("ListRoutingControls");
23
17
  let body;
24
- body = JSON.stringify(se_ListRoutingControlsRequest(input, context));
18
+ body = JSON.stringify((0, smithy_client_1._json)(input));
25
19
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
26
20
  };
27
21
  exports.se_ListRoutingControlsCommand = se_ListRoutingControlsCommand;
28
22
  const se_UpdateRoutingControlStateCommand = async (input, context) => {
29
- const headers = {
30
- "content-type": "application/x-amz-json-1.0",
31
- "x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlState",
32
- };
23
+ const headers = sharedHeaders("UpdateRoutingControlState");
33
24
  let body;
34
- body = JSON.stringify(se_UpdateRoutingControlStateRequest(input, context));
25
+ body = JSON.stringify((0, smithy_client_1._json)(input));
35
26
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
36
27
  };
37
28
  exports.se_UpdateRoutingControlStateCommand = se_UpdateRoutingControlStateCommand;
38
29
  const se_UpdateRoutingControlStatesCommand = async (input, context) => {
39
- const headers = {
40
- "content-type": "application/x-amz-json-1.0",
41
- "x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlStates",
42
- };
30
+ const headers = sharedHeaders("UpdateRoutingControlStates");
43
31
  let body;
44
- body = JSON.stringify(se_UpdateRoutingControlStatesRequest(input, context));
32
+ body = JSON.stringify((0, smithy_client_1._json)(input));
45
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
46
34
  };
47
35
  exports.se_UpdateRoutingControlStatesCommand = se_UpdateRoutingControlStatesCommand;
@@ -51,12 +39,12 @@ const de_GetRoutingControlStateCommand = async (output, context) => {
51
39
  }
52
40
  const data = await parseBody(output.body, context);
53
41
  let contents = {};
54
- contents = de_GetRoutingControlStateResponse(data, context);
42
+ contents = (0, smithy_client_1._json)(data);
55
43
  const response = {
56
44
  $metadata: deserializeMetadata(output),
57
45
  ...contents,
58
46
  };
59
- return Promise.resolve(response);
47
+ return response;
60
48
  };
61
49
  exports.de_GetRoutingControlStateCommand = de_GetRoutingControlStateCommand;
62
50
  const de_GetRoutingControlStateCommandError = async (output, context) => {
@@ -86,10 +74,9 @@ const de_GetRoutingControlStateCommandError = async (output, context) => {
86
74
  throw await de_ValidationExceptionRes(parsedOutput, context);
87
75
  default:
88
76
  const parsedBody = parsedOutput.body;
89
- (0, smithy_client_1.throwDefaultError)({
77
+ return throwDefaultError({
90
78
  output,
91
79
  parsedBody,
92
- exceptionCtor: Route53RecoveryClusterServiceException_1.Route53RecoveryClusterServiceException,
93
80
  errorCode,
94
81
  });
95
82
  }
@@ -100,12 +87,12 @@ const de_ListRoutingControlsCommand = async (output, context) => {
100
87
  }
101
88
  const data = await parseBody(output.body, context);
102
89
  let contents = {};
103
- contents = de_ListRoutingControlsResponse(data, context);
90
+ contents = (0, smithy_client_1._json)(data);
104
91
  const response = {
105
92
  $metadata: deserializeMetadata(output),
106
93
  ...contents,
107
94
  };
108
- return Promise.resolve(response);
95
+ return response;
109
96
  };
110
97
  exports.de_ListRoutingControlsCommand = de_ListRoutingControlsCommand;
111
98
  const de_ListRoutingControlsCommandError = async (output, context) => {
@@ -135,10 +122,9 @@ const de_ListRoutingControlsCommandError = async (output, context) => {
135
122
  throw await de_ValidationExceptionRes(parsedOutput, context);
136
123
  default:
137
124
  const parsedBody = parsedOutput.body;
138
- (0, smithy_client_1.throwDefaultError)({
125
+ return throwDefaultError({
139
126
  output,
140
127
  parsedBody,
141
- exceptionCtor: Route53RecoveryClusterServiceException_1.Route53RecoveryClusterServiceException,
142
128
  errorCode,
143
129
  });
144
130
  }
@@ -149,12 +135,12 @@ const de_UpdateRoutingControlStateCommand = async (output, context) => {
149
135
  }
150
136
  const data = await parseBody(output.body, context);
151
137
  let contents = {};
152
- contents = de_UpdateRoutingControlStateResponse(data, context);
138
+ contents = (0, smithy_client_1._json)(data);
153
139
  const response = {
154
140
  $metadata: deserializeMetadata(output),
155
141
  ...contents,
156
142
  };
157
- return Promise.resolve(response);
143
+ return response;
158
144
  };
159
145
  exports.de_UpdateRoutingControlStateCommand = de_UpdateRoutingControlStateCommand;
160
146
  const de_UpdateRoutingControlStateCommandError = async (output, context) => {
@@ -187,10 +173,9 @@ const de_UpdateRoutingControlStateCommandError = async (output, context) => {
187
173
  throw await de_ValidationExceptionRes(parsedOutput, context);
188
174
  default:
189
175
  const parsedBody = parsedOutput.body;
190
- (0, smithy_client_1.throwDefaultError)({
176
+ return throwDefaultError({
191
177
  output,
192
178
  parsedBody,
193
- exceptionCtor: Route53RecoveryClusterServiceException_1.Route53RecoveryClusterServiceException,
194
179
  errorCode,
195
180
  });
196
181
  }
@@ -201,12 +186,12 @@ const de_UpdateRoutingControlStatesCommand = async (output, context) => {
201
186
  }
202
187
  const data = await parseBody(output.body, context);
203
188
  let contents = {};
204
- contents = de_UpdateRoutingControlStatesResponse(data, context);
189
+ contents = (0, smithy_client_1._json)(data);
205
190
  const response = {
206
191
  $metadata: deserializeMetadata(output),
207
192
  ...contents,
208
193
  };
209
- return Promise.resolve(response);
194
+ return response;
210
195
  };
211
196
  exports.de_UpdateRoutingControlStatesCommand = de_UpdateRoutingControlStatesCommand;
212
197
  const de_UpdateRoutingControlStatesCommandError = async (output, context) => {
@@ -242,17 +227,16 @@ const de_UpdateRoutingControlStatesCommandError = async (output, context) => {
242
227
  throw await de_ValidationExceptionRes(parsedOutput, context);
243
228
  default:
244
229
  const parsedBody = parsedOutput.body;
245
- (0, smithy_client_1.throwDefaultError)({
230
+ return throwDefaultError({
246
231
  output,
247
232
  parsedBody,
248
- exceptionCtor: Route53RecoveryClusterServiceException_1.Route53RecoveryClusterServiceException,
249
233
  errorCode,
250
234
  });
251
235
  }
252
236
  };
253
237
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
254
238
  const body = parsedOutput.body;
255
- const deserialized = de_AccessDeniedException(body, context);
239
+ const deserialized = (0, smithy_client_1._json)(body);
256
240
  const exception = new models_0_1.AccessDeniedException({
257
241
  $metadata: deserializeMetadata(parsedOutput),
258
242
  ...deserialized,
@@ -261,7 +245,7 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
261
245
  };
262
246
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
263
247
  const body = parsedOutput.body;
264
- const deserialized = de_ConflictException(body, context);
248
+ const deserialized = (0, smithy_client_1._json)(body);
265
249
  const exception = new models_0_1.ConflictException({
266
250
  $metadata: deserializeMetadata(parsedOutput),
267
251
  ...deserialized,
@@ -270,7 +254,7 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
270
254
  };
271
255
  const de_EndpointTemporarilyUnavailableExceptionRes = async (parsedOutput, context) => {
272
256
  const body = parsedOutput.body;
273
- const deserialized = de_EndpointTemporarilyUnavailableException(body, context);
257
+ const deserialized = (0, smithy_client_1._json)(body);
274
258
  const exception = new models_0_1.EndpointTemporarilyUnavailableException({
275
259
  $metadata: deserializeMetadata(parsedOutput),
276
260
  ...deserialized,
@@ -279,7 +263,7 @@ const de_EndpointTemporarilyUnavailableExceptionRes = async (parsedOutput, conte
279
263
  };
280
264
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
281
265
  const body = parsedOutput.body;
282
- const deserialized = de_InternalServerException(body, context);
266
+ const deserialized = (0, smithy_client_1._json)(body);
283
267
  const exception = new models_0_1.InternalServerException({
284
268
  $metadata: deserializeMetadata(parsedOutput),
285
269
  ...deserialized,
@@ -288,7 +272,7 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
288
272
  };
289
273
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
290
274
  const body = parsedOutput.body;
291
- const deserialized = de_ResourceNotFoundException(body, context);
275
+ const deserialized = (0, smithy_client_1._json)(body);
292
276
  const exception = new models_0_1.ResourceNotFoundException({
293
277
  $metadata: deserializeMetadata(parsedOutput),
294
278
  ...deserialized,
@@ -297,7 +281,7 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
297
281
  };
298
282
  const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
299
283
  const body = parsedOutput.body;
300
- const deserialized = de_ServiceLimitExceededException(body, context);
284
+ const deserialized = (0, smithy_client_1._json)(body);
301
285
  const exception = new models_0_1.ServiceLimitExceededException({
302
286
  $metadata: deserializeMetadata(parsedOutput),
303
287
  ...deserialized,
@@ -306,7 +290,7 @@ const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
306
290
  };
307
291
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
308
292
  const body = parsedOutput.body;
309
- const deserialized = de_ThrottlingException(body, context);
293
+ const deserialized = (0, smithy_client_1._json)(body);
310
294
  const exception = new models_0_1.ThrottlingException({
311
295
  $metadata: deserializeMetadata(parsedOutput),
312
296
  ...deserialized,
@@ -315,172 +299,13 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
315
299
  };
316
300
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
317
301
  const body = parsedOutput.body;
318
- const deserialized = de_ValidationException(body, context);
302
+ const deserialized = (0, smithy_client_1._json)(body);
319
303
  const exception = new models_0_1.ValidationException({
320
304
  $metadata: deserializeMetadata(parsedOutput),
321
305
  ...deserialized,
322
306
  });
323
307
  return (0, smithy_client_1.decorateServiceException)(exception, body);
324
308
  };
325
- const se_Arns = (input, context) => {
326
- return input
327
- .filter((e) => e != null)
328
- .map((entry) => {
329
- return entry;
330
- });
331
- };
332
- const se_GetRoutingControlStateRequest = (input, context) => {
333
- return {
334
- ...(input.RoutingControlArn != null && { RoutingControlArn: input.RoutingControlArn }),
335
- };
336
- };
337
- const se_ListRoutingControlsRequest = (input, context) => {
338
- return {
339
- ...(input.ControlPanelArn != null && { ControlPanelArn: input.ControlPanelArn }),
340
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
341
- ...(input.NextToken != null && { NextToken: input.NextToken }),
342
- };
343
- };
344
- const se_UpdateRoutingControlStateEntries = (input, context) => {
345
- return input
346
- .filter((e) => e != null)
347
- .map((entry) => {
348
- return se_UpdateRoutingControlStateEntry(entry, context);
349
- });
350
- };
351
- const se_UpdateRoutingControlStateEntry = (input, context) => {
352
- return {
353
- ...(input.RoutingControlArn != null && { RoutingControlArn: input.RoutingControlArn }),
354
- ...(input.RoutingControlState != null && { RoutingControlState: input.RoutingControlState }),
355
- };
356
- };
357
- const se_UpdateRoutingControlStateRequest = (input, context) => {
358
- return {
359
- ...(input.RoutingControlArn != null && { RoutingControlArn: input.RoutingControlArn }),
360
- ...(input.RoutingControlState != null && { RoutingControlState: input.RoutingControlState }),
361
- ...(input.SafetyRulesToOverride != null && {
362
- SafetyRulesToOverride: se_Arns(input.SafetyRulesToOverride, context),
363
- }),
364
- };
365
- };
366
- const se_UpdateRoutingControlStatesRequest = (input, context) => {
367
- return {
368
- ...(input.SafetyRulesToOverride != null && {
369
- SafetyRulesToOverride: se_Arns(input.SafetyRulesToOverride, context),
370
- }),
371
- ...(input.UpdateRoutingControlStateEntries != null && {
372
- UpdateRoutingControlStateEntries: se_UpdateRoutingControlStateEntries(input.UpdateRoutingControlStateEntries, context),
373
- }),
374
- };
375
- };
376
- const de_AccessDeniedException = (output, context) => {
377
- return {
378
- message: (0, smithy_client_1.expectString)(output.message),
379
- };
380
- };
381
- const de_ConflictException = (output, context) => {
382
- return {
383
- message: (0, smithy_client_1.expectString)(output.message),
384
- resourceId: (0, smithy_client_1.expectString)(output.resourceId),
385
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
386
- };
387
- };
388
- const de_EndpointTemporarilyUnavailableException = (output, context) => {
389
- return {
390
- message: (0, smithy_client_1.expectString)(output.message),
391
- };
392
- };
393
- const de_GetRoutingControlStateResponse = (output, context) => {
394
- return {
395
- RoutingControlArn: (0, smithy_client_1.expectString)(output.RoutingControlArn),
396
- RoutingControlName: (0, smithy_client_1.expectString)(output.RoutingControlName),
397
- RoutingControlState: (0, smithy_client_1.expectString)(output.RoutingControlState),
398
- };
399
- };
400
- const de_InternalServerException = (output, context) => {
401
- return {
402
- message: (0, smithy_client_1.expectString)(output.message),
403
- retryAfterSeconds: (0, smithy_client_1.expectInt32)(output.retryAfterSeconds),
404
- };
405
- };
406
- const de_ListRoutingControlsResponse = (output, context) => {
407
- return {
408
- NextToken: (0, smithy_client_1.expectString)(output.NextToken),
409
- RoutingControls: output.RoutingControls != null ? de_RoutingControls(output.RoutingControls, context) : undefined,
410
- };
411
- };
412
- const de_ResourceNotFoundException = (output, context) => {
413
- return {
414
- message: (0, smithy_client_1.expectString)(output.message),
415
- resourceId: (0, smithy_client_1.expectString)(output.resourceId),
416
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
417
- };
418
- };
419
- const de_RoutingControl = (output, context) => {
420
- return {
421
- ControlPanelArn: (0, smithy_client_1.expectString)(output.ControlPanelArn),
422
- ControlPanelName: (0, smithy_client_1.expectString)(output.ControlPanelName),
423
- RoutingControlArn: (0, smithy_client_1.expectString)(output.RoutingControlArn),
424
- RoutingControlName: (0, smithy_client_1.expectString)(output.RoutingControlName),
425
- RoutingControlState: (0, smithy_client_1.expectString)(output.RoutingControlState),
426
- };
427
- };
428
- const de_RoutingControls = (output, context) => {
429
- const retVal = (output || [])
430
- .filter((e) => e != null)
431
- .map((entry) => {
432
- if (entry === null) {
433
- return null;
434
- }
435
- return de_RoutingControl(entry, context);
436
- });
437
- return retVal;
438
- };
439
- const de_ServiceLimitExceededException = (output, context) => {
440
- return {
441
- limitCode: (0, smithy_client_1.expectString)(output.limitCode),
442
- message: (0, smithy_client_1.expectString)(output.message),
443
- resourceId: (0, smithy_client_1.expectString)(output.resourceId),
444
- resourceType: (0, smithy_client_1.expectString)(output.resourceType),
445
- serviceCode: (0, smithy_client_1.expectString)(output.serviceCode),
446
- };
447
- };
448
- const de_ThrottlingException = (output, context) => {
449
- return {
450
- message: (0, smithy_client_1.expectString)(output.message),
451
- retryAfterSeconds: (0, smithy_client_1.expectInt32)(output.retryAfterSeconds),
452
- };
453
- };
454
- const de_UpdateRoutingControlStateResponse = (output, context) => {
455
- return {};
456
- };
457
- const de_UpdateRoutingControlStatesResponse = (output, context) => {
458
- return {};
459
- };
460
- const de_ValidationException = (output, context) => {
461
- return {
462
- fields: output.fields != null ? de_ValidationExceptionFieldList(output.fields, context) : undefined,
463
- message: (0, smithy_client_1.expectString)(output.message),
464
- reason: (0, smithy_client_1.expectString)(output.reason),
465
- };
466
- };
467
- const de_ValidationExceptionField = (output, context) => {
468
- return {
469
- message: (0, smithy_client_1.expectString)(output.message),
470
- name: (0, smithy_client_1.expectString)(output.name),
471
- };
472
- };
473
- const de_ValidationExceptionFieldList = (output, context) => {
474
- const retVal = (output || [])
475
- .filter((e) => e != null)
476
- .map((entry) => {
477
- if (entry === null) {
478
- return null;
479
- }
480
- return de_ValidationExceptionField(entry, context);
481
- });
482
- return retVal;
483
- };
484
309
  const deserializeMetadata = (output) => ({
485
310
  httpStatusCode: output.statusCode,
486
311
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -494,6 +319,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
494
319
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
495
320
  };
496
321
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
322
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(Route53RecoveryClusterServiceException_1.Route53RecoveryClusterServiceException);
497
323
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
498
324
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
499
325
  const contents = {
@@ -512,6 +338,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
512
338
  }
513
339
  return new protocol_http_1.HttpRequest(contents);
514
340
  };
341
+ function sharedHeaders(operation) {
342
+ return {
343
+ "content-type": "application/x-amz-json-1.0",
344
+ "x-amz-target": `ToggleCustomerAPI.${operation}`,
345
+ };
346
+ }
515
347
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
516
348
  if (encoded.length) {
517
349
  return JSON.parse(encoded);
@@ -1,41 +1,29 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectString as __expectString, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { AccessDeniedException, ConflictException, EndpointTemporarilyUnavailableException, InternalServerException, ResourceNotFoundException, ServiceLimitExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
4
4
  import { Route53RecoveryClusterServiceException as __BaseException } from "../models/Route53RecoveryClusterServiceException";
5
5
  export const se_GetRoutingControlStateCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.0",
8
- "x-amz-target": "ToggleCustomerAPI.GetRoutingControlState",
9
- };
6
+ const headers = sharedHeaders("GetRoutingControlState");
10
7
  let body;
11
- body = JSON.stringify(se_GetRoutingControlStateRequest(input, context));
8
+ body = JSON.stringify(_json(input));
12
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
10
  };
14
11
  export const se_ListRoutingControlsCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.0",
17
- "x-amz-target": "ToggleCustomerAPI.ListRoutingControls",
18
- };
12
+ const headers = sharedHeaders("ListRoutingControls");
19
13
  let body;
20
- body = JSON.stringify(se_ListRoutingControlsRequest(input, context));
14
+ body = JSON.stringify(_json(input));
21
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
16
  };
23
17
  export const se_UpdateRoutingControlStateCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.0",
26
- "x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlState",
27
- };
18
+ const headers = sharedHeaders("UpdateRoutingControlState");
28
19
  let body;
29
- body = JSON.stringify(se_UpdateRoutingControlStateRequest(input, context));
20
+ body = JSON.stringify(_json(input));
30
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
22
  };
32
23
  export const se_UpdateRoutingControlStatesCommand = async (input, context) => {
33
- const headers = {
34
- "content-type": "application/x-amz-json-1.0",
35
- "x-amz-target": "ToggleCustomerAPI.UpdateRoutingControlStates",
36
- };
24
+ const headers = sharedHeaders("UpdateRoutingControlStates");
37
25
  let body;
38
- body = JSON.stringify(se_UpdateRoutingControlStatesRequest(input, context));
26
+ body = JSON.stringify(_json(input));
39
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
28
  };
41
29
  export const de_GetRoutingControlStateCommand = async (output, context) => {
@@ -44,12 +32,12 @@ export const de_GetRoutingControlStateCommand = async (output, context) => {
44
32
  }
45
33
  const data = await parseBody(output.body, context);
46
34
  let contents = {};
47
- contents = de_GetRoutingControlStateResponse(data, context);
35
+ contents = _json(data);
48
36
  const response = {
49
37
  $metadata: deserializeMetadata(output),
50
38
  ...contents,
51
39
  };
52
- return Promise.resolve(response);
40
+ return response;
53
41
  };
54
42
  const de_GetRoutingControlStateCommandError = async (output, context) => {
55
43
  const parsedOutput = {
@@ -78,10 +66,9 @@ const de_GetRoutingControlStateCommandError = async (output, context) => {
78
66
  throw await de_ValidationExceptionRes(parsedOutput, context);
79
67
  default:
80
68
  const parsedBody = parsedOutput.body;
81
- throwDefaultError({
69
+ return throwDefaultError({
82
70
  output,
83
71
  parsedBody,
84
- exceptionCtor: __BaseException,
85
72
  errorCode,
86
73
  });
87
74
  }
@@ -92,12 +79,12 @@ export const de_ListRoutingControlsCommand = async (output, context) => {
92
79
  }
93
80
  const data = await parseBody(output.body, context);
94
81
  let contents = {};
95
- contents = de_ListRoutingControlsResponse(data, context);
82
+ contents = _json(data);
96
83
  const response = {
97
84
  $metadata: deserializeMetadata(output),
98
85
  ...contents,
99
86
  };
100
- return Promise.resolve(response);
87
+ return response;
101
88
  };
102
89
  const de_ListRoutingControlsCommandError = async (output, context) => {
103
90
  const parsedOutput = {
@@ -126,10 +113,9 @@ const de_ListRoutingControlsCommandError = async (output, context) => {
126
113
  throw await de_ValidationExceptionRes(parsedOutput, context);
127
114
  default:
128
115
  const parsedBody = parsedOutput.body;
129
- throwDefaultError({
116
+ return throwDefaultError({
130
117
  output,
131
118
  parsedBody,
132
- exceptionCtor: __BaseException,
133
119
  errorCode,
134
120
  });
135
121
  }
@@ -140,12 +126,12 @@ export const de_UpdateRoutingControlStateCommand = async (output, context) => {
140
126
  }
141
127
  const data = await parseBody(output.body, context);
142
128
  let contents = {};
143
- contents = de_UpdateRoutingControlStateResponse(data, context);
129
+ contents = _json(data);
144
130
  const response = {
145
131
  $metadata: deserializeMetadata(output),
146
132
  ...contents,
147
133
  };
148
- return Promise.resolve(response);
134
+ return response;
149
135
  };
150
136
  const de_UpdateRoutingControlStateCommandError = async (output, context) => {
151
137
  const parsedOutput = {
@@ -177,10 +163,9 @@ const de_UpdateRoutingControlStateCommandError = async (output, context) => {
177
163
  throw await de_ValidationExceptionRes(parsedOutput, context);
178
164
  default:
179
165
  const parsedBody = parsedOutput.body;
180
- throwDefaultError({
166
+ return throwDefaultError({
181
167
  output,
182
168
  parsedBody,
183
- exceptionCtor: __BaseException,
184
169
  errorCode,
185
170
  });
186
171
  }
@@ -191,12 +176,12 @@ export const de_UpdateRoutingControlStatesCommand = async (output, context) => {
191
176
  }
192
177
  const data = await parseBody(output.body, context);
193
178
  let contents = {};
194
- contents = de_UpdateRoutingControlStatesResponse(data, context);
179
+ contents = _json(data);
195
180
  const response = {
196
181
  $metadata: deserializeMetadata(output),
197
182
  ...contents,
198
183
  };
199
- return Promise.resolve(response);
184
+ return response;
200
185
  };
201
186
  const de_UpdateRoutingControlStatesCommandError = async (output, context) => {
202
187
  const parsedOutput = {
@@ -231,17 +216,16 @@ const de_UpdateRoutingControlStatesCommandError = async (output, context) => {
231
216
  throw await de_ValidationExceptionRes(parsedOutput, context);
232
217
  default:
233
218
  const parsedBody = parsedOutput.body;
234
- throwDefaultError({
219
+ return throwDefaultError({
235
220
  output,
236
221
  parsedBody,
237
- exceptionCtor: __BaseException,
238
222
  errorCode,
239
223
  });
240
224
  }
241
225
  };
242
226
  const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
243
227
  const body = parsedOutput.body;
244
- const deserialized = de_AccessDeniedException(body, context);
228
+ const deserialized = _json(body);
245
229
  const exception = new AccessDeniedException({
246
230
  $metadata: deserializeMetadata(parsedOutput),
247
231
  ...deserialized,
@@ -250,7 +234,7 @@ const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
250
234
  };
251
235
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
252
236
  const body = parsedOutput.body;
253
- const deserialized = de_ConflictException(body, context);
237
+ const deserialized = _json(body);
254
238
  const exception = new ConflictException({
255
239
  $metadata: deserializeMetadata(parsedOutput),
256
240
  ...deserialized,
@@ -259,7 +243,7 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
259
243
  };
260
244
  const de_EndpointTemporarilyUnavailableExceptionRes = async (parsedOutput, context) => {
261
245
  const body = parsedOutput.body;
262
- const deserialized = de_EndpointTemporarilyUnavailableException(body, context);
246
+ const deserialized = _json(body);
263
247
  const exception = new EndpointTemporarilyUnavailableException({
264
248
  $metadata: deserializeMetadata(parsedOutput),
265
249
  ...deserialized,
@@ -268,7 +252,7 @@ const de_EndpointTemporarilyUnavailableExceptionRes = async (parsedOutput, conte
268
252
  };
269
253
  const de_InternalServerExceptionRes = async (parsedOutput, context) => {
270
254
  const body = parsedOutput.body;
271
- const deserialized = de_InternalServerException(body, context);
255
+ const deserialized = _json(body);
272
256
  const exception = new InternalServerException({
273
257
  $metadata: deserializeMetadata(parsedOutput),
274
258
  ...deserialized,
@@ -277,7 +261,7 @@ const de_InternalServerExceptionRes = async (parsedOutput, context) => {
277
261
  };
278
262
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
279
263
  const body = parsedOutput.body;
280
- const deserialized = de_ResourceNotFoundException(body, context);
264
+ const deserialized = _json(body);
281
265
  const exception = new ResourceNotFoundException({
282
266
  $metadata: deserializeMetadata(parsedOutput),
283
267
  ...deserialized,
@@ -286,7 +270,7 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
286
270
  };
287
271
  const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
288
272
  const body = parsedOutput.body;
289
- const deserialized = de_ServiceLimitExceededException(body, context);
273
+ const deserialized = _json(body);
290
274
  const exception = new ServiceLimitExceededException({
291
275
  $metadata: deserializeMetadata(parsedOutput),
292
276
  ...deserialized,
@@ -295,7 +279,7 @@ const de_ServiceLimitExceededExceptionRes = async (parsedOutput, context) => {
295
279
  };
296
280
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
297
281
  const body = parsedOutput.body;
298
- const deserialized = de_ThrottlingException(body, context);
282
+ const deserialized = _json(body);
299
283
  const exception = new ThrottlingException({
300
284
  $metadata: deserializeMetadata(parsedOutput),
301
285
  ...deserialized,
@@ -304,172 +288,13 @@ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
304
288
  };
305
289
  const de_ValidationExceptionRes = async (parsedOutput, context) => {
306
290
  const body = parsedOutput.body;
307
- const deserialized = de_ValidationException(body, context);
291
+ const deserialized = _json(body);
308
292
  const exception = new ValidationException({
309
293
  $metadata: deserializeMetadata(parsedOutput),
310
294
  ...deserialized,
311
295
  });
312
296
  return __decorateServiceException(exception, body);
313
297
  };
314
- const se_Arns = (input, context) => {
315
- return input
316
- .filter((e) => e != null)
317
- .map((entry) => {
318
- return entry;
319
- });
320
- };
321
- const se_GetRoutingControlStateRequest = (input, context) => {
322
- return {
323
- ...(input.RoutingControlArn != null && { RoutingControlArn: input.RoutingControlArn }),
324
- };
325
- };
326
- const se_ListRoutingControlsRequest = (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
- };
332
- };
333
- const se_UpdateRoutingControlStateEntries = (input, context) => {
334
- return input
335
- .filter((e) => e != null)
336
- .map((entry) => {
337
- return se_UpdateRoutingControlStateEntry(entry, context);
338
- });
339
- };
340
- const se_UpdateRoutingControlStateEntry = (input, context) => {
341
- return {
342
- ...(input.RoutingControlArn != null && { RoutingControlArn: input.RoutingControlArn }),
343
- ...(input.RoutingControlState != null && { RoutingControlState: input.RoutingControlState }),
344
- };
345
- };
346
- const se_UpdateRoutingControlStateRequest = (input, context) => {
347
- return {
348
- ...(input.RoutingControlArn != null && { RoutingControlArn: input.RoutingControlArn }),
349
- ...(input.RoutingControlState != null && { RoutingControlState: input.RoutingControlState }),
350
- ...(input.SafetyRulesToOverride != null && {
351
- SafetyRulesToOverride: se_Arns(input.SafetyRulesToOverride, context),
352
- }),
353
- };
354
- };
355
- const se_UpdateRoutingControlStatesRequest = (input, context) => {
356
- return {
357
- ...(input.SafetyRulesToOverride != null && {
358
- SafetyRulesToOverride: se_Arns(input.SafetyRulesToOverride, context),
359
- }),
360
- ...(input.UpdateRoutingControlStateEntries != null && {
361
- UpdateRoutingControlStateEntries: se_UpdateRoutingControlStateEntries(input.UpdateRoutingControlStateEntries, context),
362
- }),
363
- };
364
- };
365
- const de_AccessDeniedException = (output, context) => {
366
- return {
367
- message: __expectString(output.message),
368
- };
369
- };
370
- const de_ConflictException = (output, context) => {
371
- return {
372
- message: __expectString(output.message),
373
- resourceId: __expectString(output.resourceId),
374
- resourceType: __expectString(output.resourceType),
375
- };
376
- };
377
- const de_EndpointTemporarilyUnavailableException = (output, context) => {
378
- return {
379
- message: __expectString(output.message),
380
- };
381
- };
382
- const de_GetRoutingControlStateResponse = (output, context) => {
383
- return {
384
- RoutingControlArn: __expectString(output.RoutingControlArn),
385
- RoutingControlName: __expectString(output.RoutingControlName),
386
- RoutingControlState: __expectString(output.RoutingControlState),
387
- };
388
- };
389
- const de_InternalServerException = (output, context) => {
390
- return {
391
- message: __expectString(output.message),
392
- retryAfterSeconds: __expectInt32(output.retryAfterSeconds),
393
- };
394
- };
395
- const de_ListRoutingControlsResponse = (output, context) => {
396
- return {
397
- NextToken: __expectString(output.NextToken),
398
- RoutingControls: output.RoutingControls != null ? de_RoutingControls(output.RoutingControls, context) : undefined,
399
- };
400
- };
401
- const de_ResourceNotFoundException = (output, context) => {
402
- return {
403
- message: __expectString(output.message),
404
- resourceId: __expectString(output.resourceId),
405
- resourceType: __expectString(output.resourceType),
406
- };
407
- };
408
- const de_RoutingControl = (output, context) => {
409
- return {
410
- ControlPanelArn: __expectString(output.ControlPanelArn),
411
- ControlPanelName: __expectString(output.ControlPanelName),
412
- RoutingControlArn: __expectString(output.RoutingControlArn),
413
- RoutingControlName: __expectString(output.RoutingControlName),
414
- RoutingControlState: __expectString(output.RoutingControlState),
415
- };
416
- };
417
- const de_RoutingControls = (output, context) => {
418
- const retVal = (output || [])
419
- .filter((e) => e != null)
420
- .map((entry) => {
421
- if (entry === null) {
422
- return null;
423
- }
424
- return de_RoutingControl(entry, context);
425
- });
426
- return retVal;
427
- };
428
- const de_ServiceLimitExceededException = (output, context) => {
429
- return {
430
- limitCode: __expectString(output.limitCode),
431
- message: __expectString(output.message),
432
- resourceId: __expectString(output.resourceId),
433
- resourceType: __expectString(output.resourceType),
434
- serviceCode: __expectString(output.serviceCode),
435
- };
436
- };
437
- const de_ThrottlingException = (output, context) => {
438
- return {
439
- message: __expectString(output.message),
440
- retryAfterSeconds: __expectInt32(output.retryAfterSeconds),
441
- };
442
- };
443
- const de_UpdateRoutingControlStateResponse = (output, context) => {
444
- return {};
445
- };
446
- const de_UpdateRoutingControlStatesResponse = (output, context) => {
447
- return {};
448
- };
449
- const de_ValidationException = (output, context) => {
450
- return {
451
- fields: output.fields != null ? de_ValidationExceptionFieldList(output.fields, context) : undefined,
452
- message: __expectString(output.message),
453
- reason: __expectString(output.reason),
454
- };
455
- };
456
- const de_ValidationExceptionField = (output, context) => {
457
- return {
458
- message: __expectString(output.message),
459
- name: __expectString(output.name),
460
- };
461
- };
462
- const de_ValidationExceptionFieldList = (output, context) => {
463
- const retVal = (output || [])
464
- .filter((e) => e != null)
465
- .map((entry) => {
466
- if (entry === null) {
467
- return null;
468
- }
469
- return de_ValidationExceptionField(entry, context);
470
- });
471
- return retVal;
472
- };
473
298
  const deserializeMetadata = (output) => ({
474
299
  httpStatusCode: output.statusCode,
475
300
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -483,6 +308,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
483
308
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
484
309
  };
485
310
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
311
+ const throwDefaultError = withBaseException(__BaseException);
486
312
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
487
313
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
488
314
  const contents = {
@@ -501,6 +327,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
501
327
  }
502
328
  return new __HttpRequest(contents);
503
329
  };
330
+ function sharedHeaders(operation) {
331
+ return {
332
+ "content-type": "application/x-amz-json-1.0",
333
+ "x-amz-target": `ToggleCustomerAPI.${operation}`,
334
+ };
335
+ }
504
336
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
505
337
  if (encoded.length) {
506
338
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-route53-recovery-cluster",
3
3
  "description": "AWS SDK for JavaScript Route53 Recovery Cluster Client for Node.js, Browser and React Native",
4
- "version": "3.310.0",
4
+ "version": "3.315.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.310.0",
24
+ "@aws-sdk/client-sts": "3.315.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.315.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.315.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.315.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.315.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",