@aws-sdk/client-cloudcontrol 3.52.0 → 3.53.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,8 @@ exports.deserializeAws_json1_0UpdateResourceCommand = exports.deserializeAws_jso
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
6
  const uuid_1 = require("uuid");
7
+ const CloudControlServiceException_1 = require("../models/CloudControlServiceException");
8
+ const models_0_1 = require("../models/models_0");
7
9
  const serializeAws_json1_0CancelResourceRequestCommand = async (input, context) => {
8
10
  const headers = {
9
11
  "content-type": "application/x-amz-json-1.0",
@@ -109,35 +111,19 @@ const deserializeAws_json1_0CancelResourceRequestCommandError = async (output, c
109
111
  switch (errorCode) {
110
112
  case "ConcurrentModificationException":
111
113
  case "com.amazonaws.cloudcontrol#ConcurrentModificationException":
112
- response = {
113
- ...(await deserializeAws_json1_0ConcurrentModificationExceptionResponse(parsedOutput, context)),
114
- name: errorCode,
115
- $metadata: deserializeMetadata(output),
116
- };
117
- break;
114
+ throw await deserializeAws_json1_0ConcurrentModificationExceptionResponse(parsedOutput, context);
118
115
  case "RequestTokenNotFoundException":
119
116
  case "com.amazonaws.cloudcontrol#RequestTokenNotFoundException":
120
- response = {
121
- ...(await deserializeAws_json1_0RequestTokenNotFoundExceptionResponse(parsedOutput, context)),
122
- name: errorCode,
123
- $metadata: deserializeMetadata(output),
124
- };
125
- break;
117
+ throw await deserializeAws_json1_0RequestTokenNotFoundExceptionResponse(parsedOutput, context);
126
118
  default:
127
119
  const parsedBody = parsedOutput.body;
128
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
129
- response = {
130
- ...parsedBody,
131
- name: `${errorCode}`,
132
- message: parsedBody.message || parsedBody.Message || errorCode,
120
+ response = new CloudControlServiceException_1.CloudControlServiceException({
121
+ name: parsedBody.code || parsedBody.Code || errorCode,
133
122
  $fault: "client",
134
123
  $metadata: deserializeMetadata(output),
135
- };
124
+ });
125
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
136
126
  }
137
- const message = response.message || response.Message || errorCode;
138
- response.message = message;
139
- delete response.Message;
140
- return Promise.reject(Object.assign(new Error(message), response));
141
127
  };
142
128
  const deserializeAws_json1_0CreateResourceCommand = async (output, context) => {
143
129
  if (output.statusCode >= 300) {
@@ -164,171 +150,70 @@ const deserializeAws_json1_0CreateResourceCommandError = async (output, context)
164
150
  switch (errorCode) {
165
151
  case "AlreadyExistsException":
166
152
  case "com.amazonaws.cloudcontrol#AlreadyExistsException":
167
- response = {
168
- ...(await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context)),
169
- name: errorCode,
170
- $metadata: deserializeMetadata(output),
171
- };
172
- break;
153
+ throw await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context);
173
154
  case "ClientTokenConflictException":
174
155
  case "com.amazonaws.cloudcontrol#ClientTokenConflictException":
175
- response = {
176
- ...(await deserializeAws_json1_0ClientTokenConflictExceptionResponse(parsedOutput, context)),
177
- name: errorCode,
178
- $metadata: deserializeMetadata(output),
179
- };
180
- break;
156
+ throw await deserializeAws_json1_0ClientTokenConflictExceptionResponse(parsedOutput, context);
181
157
  case "ConcurrentOperationException":
182
158
  case "com.amazonaws.cloudcontrol#ConcurrentOperationException":
183
- response = {
184
- ...(await deserializeAws_json1_0ConcurrentOperationExceptionResponse(parsedOutput, context)),
185
- name: errorCode,
186
- $metadata: deserializeMetadata(output),
187
- };
188
- break;
159
+ throw await deserializeAws_json1_0ConcurrentOperationExceptionResponse(parsedOutput, context);
189
160
  case "GeneralServiceException":
190
161
  case "com.amazonaws.cloudcontrol#GeneralServiceException":
191
- response = {
192
- ...(await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context)),
193
- name: errorCode,
194
- $metadata: deserializeMetadata(output),
195
- };
196
- break;
162
+ throw await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context);
197
163
  case "HandlerFailureException":
198
164
  case "com.amazonaws.cloudcontrol#HandlerFailureException":
199
- response = {
200
- ...(await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context)),
201
- name: errorCode,
202
- $metadata: deserializeMetadata(output),
203
- };
204
- break;
165
+ throw await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context);
205
166
  case "HandlerInternalFailureException":
206
167
  case "com.amazonaws.cloudcontrol#HandlerInternalFailureException":
207
- response = {
208
- ...(await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context)),
209
- name: errorCode,
210
- $metadata: deserializeMetadata(output),
211
- };
212
- break;
168
+ throw await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context);
213
169
  case "InvalidCredentialsException":
214
170
  case "com.amazonaws.cloudcontrol#InvalidCredentialsException":
215
- response = {
216
- ...(await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context)),
217
- name: errorCode,
218
- $metadata: deserializeMetadata(output),
219
- };
220
- break;
171
+ throw await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context);
221
172
  case "InvalidRequestException":
222
173
  case "com.amazonaws.cloudcontrol#InvalidRequestException":
223
- response = {
224
- ...(await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context)),
225
- name: errorCode,
226
- $metadata: deserializeMetadata(output),
227
- };
228
- break;
174
+ throw await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context);
229
175
  case "NetworkFailureException":
230
176
  case "com.amazonaws.cloudcontrol#NetworkFailureException":
231
- response = {
232
- ...(await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context)),
233
- name: errorCode,
234
- $metadata: deserializeMetadata(output),
235
- };
236
- break;
177
+ throw await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context);
237
178
  case "NotStabilizedException":
238
179
  case "com.amazonaws.cloudcontrol#NotStabilizedException":
239
- response = {
240
- ...(await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context)),
241
- name: errorCode,
242
- $metadata: deserializeMetadata(output),
243
- };
244
- break;
180
+ throw await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context);
245
181
  case "NotUpdatableException":
246
182
  case "com.amazonaws.cloudcontrol#NotUpdatableException":
247
- response = {
248
- ...(await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context)),
249
- name: errorCode,
250
- $metadata: deserializeMetadata(output),
251
- };
252
- break;
183
+ throw await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context);
253
184
  case "PrivateTypeException":
254
185
  case "com.amazonaws.cloudcontrol#PrivateTypeException":
255
- response = {
256
- ...(await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context)),
257
- name: errorCode,
258
- $metadata: deserializeMetadata(output),
259
- };
260
- break;
186
+ throw await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context);
261
187
  case "ResourceConflictException":
262
188
  case "com.amazonaws.cloudcontrol#ResourceConflictException":
263
- response = {
264
- ...(await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context)),
265
- name: errorCode,
266
- $metadata: deserializeMetadata(output),
267
- };
268
- break;
189
+ throw await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context);
269
190
  case "ResourceNotFoundException":
270
191
  case "com.amazonaws.cloudcontrol#ResourceNotFoundException":
271
- response = {
272
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
273
- name: errorCode,
274
- $metadata: deserializeMetadata(output),
275
- };
276
- break;
192
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
277
193
  case "ServiceInternalErrorException":
278
194
  case "com.amazonaws.cloudcontrol#ServiceInternalErrorException":
279
- response = {
280
- ...(await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context)),
281
- name: errorCode,
282
- $metadata: deserializeMetadata(output),
283
- };
284
- break;
195
+ throw await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context);
285
196
  case "ServiceLimitExceededException":
286
197
  case "com.amazonaws.cloudcontrol#ServiceLimitExceededException":
287
- response = {
288
- ...(await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context)),
289
- name: errorCode,
290
- $metadata: deserializeMetadata(output),
291
- };
292
- break;
198
+ throw await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context);
293
199
  case "ThrottlingException":
294
200
  case "com.amazonaws.cloudcontrol#ThrottlingException":
295
- response = {
296
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
297
- name: errorCode,
298
- $metadata: deserializeMetadata(output),
299
- };
300
- break;
201
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
301
202
  case "TypeNotFoundException":
302
203
  case "com.amazonaws.cloudcontrol#TypeNotFoundException":
303
- response = {
304
- ...(await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context)),
305
- name: errorCode,
306
- $metadata: deserializeMetadata(output),
307
- };
308
- break;
204
+ throw await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context);
309
205
  case "UnsupportedActionException":
310
206
  case "com.amazonaws.cloudcontrol#UnsupportedActionException":
311
- response = {
312
- ...(await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context)),
313
- name: errorCode,
314
- $metadata: deserializeMetadata(output),
315
- };
316
- break;
207
+ throw await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context);
317
208
  default:
318
209
  const parsedBody = parsedOutput.body;
319
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
320
- response = {
321
- ...parsedBody,
322
- name: `${errorCode}`,
323
- message: parsedBody.message || parsedBody.Message || errorCode,
210
+ response = new CloudControlServiceException_1.CloudControlServiceException({
211
+ name: parsedBody.code || parsedBody.Code || errorCode,
324
212
  $fault: "client",
325
213
  $metadata: deserializeMetadata(output),
326
- };
214
+ });
215
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
327
216
  }
328
- const message = response.message || response.Message || errorCode;
329
- response.message = message;
330
- delete response.Message;
331
- return Promise.reject(Object.assign(new Error(message), response));
332
217
  };
333
218
  const deserializeAws_json1_0DeleteResourceCommand = async (output, context) => {
334
219
  if (output.statusCode >= 300) {
@@ -355,171 +240,70 @@ const deserializeAws_json1_0DeleteResourceCommandError = async (output, context)
355
240
  switch (errorCode) {
356
241
  case "AlreadyExistsException":
357
242
  case "com.amazonaws.cloudcontrol#AlreadyExistsException":
358
- response = {
359
- ...(await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context)),
360
- name: errorCode,
361
- $metadata: deserializeMetadata(output),
362
- };
363
- break;
243
+ throw await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context);
364
244
  case "ClientTokenConflictException":
365
245
  case "com.amazonaws.cloudcontrol#ClientTokenConflictException":
366
- response = {
367
- ...(await deserializeAws_json1_0ClientTokenConflictExceptionResponse(parsedOutput, context)),
368
- name: errorCode,
369
- $metadata: deserializeMetadata(output),
370
- };
371
- break;
246
+ throw await deserializeAws_json1_0ClientTokenConflictExceptionResponse(parsedOutput, context);
372
247
  case "ConcurrentOperationException":
373
248
  case "com.amazonaws.cloudcontrol#ConcurrentOperationException":
374
- response = {
375
- ...(await deserializeAws_json1_0ConcurrentOperationExceptionResponse(parsedOutput, context)),
376
- name: errorCode,
377
- $metadata: deserializeMetadata(output),
378
- };
379
- break;
249
+ throw await deserializeAws_json1_0ConcurrentOperationExceptionResponse(parsedOutput, context);
380
250
  case "GeneralServiceException":
381
251
  case "com.amazonaws.cloudcontrol#GeneralServiceException":
382
- response = {
383
- ...(await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context)),
384
- name: errorCode,
385
- $metadata: deserializeMetadata(output),
386
- };
387
- break;
252
+ throw await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context);
388
253
  case "HandlerFailureException":
389
254
  case "com.amazonaws.cloudcontrol#HandlerFailureException":
390
- response = {
391
- ...(await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context)),
392
- name: errorCode,
393
- $metadata: deserializeMetadata(output),
394
- };
395
- break;
255
+ throw await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context);
396
256
  case "HandlerInternalFailureException":
397
257
  case "com.amazonaws.cloudcontrol#HandlerInternalFailureException":
398
- response = {
399
- ...(await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context)),
400
- name: errorCode,
401
- $metadata: deserializeMetadata(output),
402
- };
403
- break;
258
+ throw await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context);
404
259
  case "InvalidCredentialsException":
405
260
  case "com.amazonaws.cloudcontrol#InvalidCredentialsException":
406
- response = {
407
- ...(await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context)),
408
- name: errorCode,
409
- $metadata: deserializeMetadata(output),
410
- };
411
- break;
261
+ throw await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context);
412
262
  case "InvalidRequestException":
413
263
  case "com.amazonaws.cloudcontrol#InvalidRequestException":
414
- response = {
415
- ...(await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context)),
416
- name: errorCode,
417
- $metadata: deserializeMetadata(output),
418
- };
419
- break;
264
+ throw await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context);
420
265
  case "NetworkFailureException":
421
266
  case "com.amazonaws.cloudcontrol#NetworkFailureException":
422
- response = {
423
- ...(await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context)),
424
- name: errorCode,
425
- $metadata: deserializeMetadata(output),
426
- };
427
- break;
267
+ throw await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context);
428
268
  case "NotStabilizedException":
429
269
  case "com.amazonaws.cloudcontrol#NotStabilizedException":
430
- response = {
431
- ...(await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context)),
432
- name: errorCode,
433
- $metadata: deserializeMetadata(output),
434
- };
435
- break;
270
+ throw await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context);
436
271
  case "NotUpdatableException":
437
272
  case "com.amazonaws.cloudcontrol#NotUpdatableException":
438
- response = {
439
- ...(await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context)),
440
- name: errorCode,
441
- $metadata: deserializeMetadata(output),
442
- };
443
- break;
273
+ throw await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context);
444
274
  case "PrivateTypeException":
445
275
  case "com.amazonaws.cloudcontrol#PrivateTypeException":
446
- response = {
447
- ...(await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context)),
448
- name: errorCode,
449
- $metadata: deserializeMetadata(output),
450
- };
451
- break;
276
+ throw await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context);
452
277
  case "ResourceConflictException":
453
278
  case "com.amazonaws.cloudcontrol#ResourceConflictException":
454
- response = {
455
- ...(await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context)),
456
- name: errorCode,
457
- $metadata: deserializeMetadata(output),
458
- };
459
- break;
279
+ throw await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context);
460
280
  case "ResourceNotFoundException":
461
281
  case "com.amazonaws.cloudcontrol#ResourceNotFoundException":
462
- response = {
463
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
464
- name: errorCode,
465
- $metadata: deserializeMetadata(output),
466
- };
467
- break;
282
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
468
283
  case "ServiceInternalErrorException":
469
284
  case "com.amazonaws.cloudcontrol#ServiceInternalErrorException":
470
- response = {
471
- ...(await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context)),
472
- name: errorCode,
473
- $metadata: deserializeMetadata(output),
474
- };
475
- break;
285
+ throw await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context);
476
286
  case "ServiceLimitExceededException":
477
287
  case "com.amazonaws.cloudcontrol#ServiceLimitExceededException":
478
- response = {
479
- ...(await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context)),
480
- name: errorCode,
481
- $metadata: deserializeMetadata(output),
482
- };
483
- break;
288
+ throw await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context);
484
289
  case "ThrottlingException":
485
290
  case "com.amazonaws.cloudcontrol#ThrottlingException":
486
- response = {
487
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
488
- name: errorCode,
489
- $metadata: deserializeMetadata(output),
490
- };
491
- break;
291
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
492
292
  case "TypeNotFoundException":
493
293
  case "com.amazonaws.cloudcontrol#TypeNotFoundException":
494
- response = {
495
- ...(await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context)),
496
- name: errorCode,
497
- $metadata: deserializeMetadata(output),
498
- };
499
- break;
294
+ throw await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context);
500
295
  case "UnsupportedActionException":
501
296
  case "com.amazonaws.cloudcontrol#UnsupportedActionException":
502
- response = {
503
- ...(await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context)),
504
- name: errorCode,
505
- $metadata: deserializeMetadata(output),
506
- };
507
- break;
297
+ throw await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context);
508
298
  default:
509
299
  const parsedBody = parsedOutput.body;
510
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
511
- response = {
512
- ...parsedBody,
513
- name: `${errorCode}`,
514
- message: parsedBody.message || parsedBody.Message || errorCode,
300
+ response = new CloudControlServiceException_1.CloudControlServiceException({
301
+ name: parsedBody.code || parsedBody.Code || errorCode,
515
302
  $fault: "client",
516
303
  $metadata: deserializeMetadata(output),
517
- };
304
+ });
305
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
518
306
  }
519
- const message = response.message || response.Message || errorCode;
520
- response.message = message;
521
- delete response.Message;
522
- return Promise.reject(Object.assign(new Error(message), response));
523
307
  };
524
308
  const deserializeAws_json1_0GetResourceCommand = async (output, context) => {
525
309
  if (output.statusCode >= 300) {
@@ -546,155 +330,64 @@ const deserializeAws_json1_0GetResourceCommandError = async (output, context) =>
546
330
  switch (errorCode) {
547
331
  case "AlreadyExistsException":
548
332
  case "com.amazonaws.cloudcontrol#AlreadyExistsException":
549
- response = {
550
- ...(await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context)),
551
- name: errorCode,
552
- $metadata: deserializeMetadata(output),
553
- };
554
- break;
333
+ throw await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context);
555
334
  case "GeneralServiceException":
556
335
  case "com.amazonaws.cloudcontrol#GeneralServiceException":
557
- response = {
558
- ...(await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context)),
559
- name: errorCode,
560
- $metadata: deserializeMetadata(output),
561
- };
562
- break;
336
+ throw await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context);
563
337
  case "HandlerFailureException":
564
338
  case "com.amazonaws.cloudcontrol#HandlerFailureException":
565
- response = {
566
- ...(await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context)),
567
- name: errorCode,
568
- $metadata: deserializeMetadata(output),
569
- };
570
- break;
339
+ throw await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context);
571
340
  case "HandlerInternalFailureException":
572
341
  case "com.amazonaws.cloudcontrol#HandlerInternalFailureException":
573
- response = {
574
- ...(await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context)),
575
- name: errorCode,
576
- $metadata: deserializeMetadata(output),
577
- };
578
- break;
342
+ throw await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context);
579
343
  case "InvalidCredentialsException":
580
344
  case "com.amazonaws.cloudcontrol#InvalidCredentialsException":
581
- response = {
582
- ...(await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context)),
583
- name: errorCode,
584
- $metadata: deserializeMetadata(output),
585
- };
586
- break;
345
+ throw await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context);
587
346
  case "InvalidRequestException":
588
347
  case "com.amazonaws.cloudcontrol#InvalidRequestException":
589
- response = {
590
- ...(await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context)),
591
- name: errorCode,
592
- $metadata: deserializeMetadata(output),
593
- };
594
- break;
348
+ throw await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context);
595
349
  case "NetworkFailureException":
596
350
  case "com.amazonaws.cloudcontrol#NetworkFailureException":
597
- response = {
598
- ...(await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context)),
599
- name: errorCode,
600
- $metadata: deserializeMetadata(output),
601
- };
602
- break;
351
+ throw await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context);
603
352
  case "NotStabilizedException":
604
353
  case "com.amazonaws.cloudcontrol#NotStabilizedException":
605
- response = {
606
- ...(await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context)),
607
- name: errorCode,
608
- $metadata: deserializeMetadata(output),
609
- };
610
- break;
354
+ throw await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context);
611
355
  case "NotUpdatableException":
612
356
  case "com.amazonaws.cloudcontrol#NotUpdatableException":
613
- response = {
614
- ...(await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context)),
615
- name: errorCode,
616
- $metadata: deserializeMetadata(output),
617
- };
618
- break;
357
+ throw await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context);
619
358
  case "PrivateTypeException":
620
359
  case "com.amazonaws.cloudcontrol#PrivateTypeException":
621
- response = {
622
- ...(await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context)),
623
- name: errorCode,
624
- $metadata: deserializeMetadata(output),
625
- };
626
- break;
360
+ throw await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context);
627
361
  case "ResourceConflictException":
628
362
  case "com.amazonaws.cloudcontrol#ResourceConflictException":
629
- response = {
630
- ...(await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context)),
631
- name: errorCode,
632
- $metadata: deserializeMetadata(output),
633
- };
634
- break;
363
+ throw await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context);
635
364
  case "ResourceNotFoundException":
636
365
  case "com.amazonaws.cloudcontrol#ResourceNotFoundException":
637
- response = {
638
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
639
- name: errorCode,
640
- $metadata: deserializeMetadata(output),
641
- };
642
- break;
366
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
643
367
  case "ServiceInternalErrorException":
644
368
  case "com.amazonaws.cloudcontrol#ServiceInternalErrorException":
645
- response = {
646
- ...(await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context)),
647
- name: errorCode,
648
- $metadata: deserializeMetadata(output),
649
- };
650
- break;
369
+ throw await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context);
651
370
  case "ServiceLimitExceededException":
652
371
  case "com.amazonaws.cloudcontrol#ServiceLimitExceededException":
653
- response = {
654
- ...(await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context)),
655
- name: errorCode,
656
- $metadata: deserializeMetadata(output),
657
- };
658
- break;
372
+ throw await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context);
659
373
  case "ThrottlingException":
660
374
  case "com.amazonaws.cloudcontrol#ThrottlingException":
661
- response = {
662
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
663
- name: errorCode,
664
- $metadata: deserializeMetadata(output),
665
- };
666
- break;
375
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
667
376
  case "TypeNotFoundException":
668
377
  case "com.amazonaws.cloudcontrol#TypeNotFoundException":
669
- response = {
670
- ...(await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context)),
671
- name: errorCode,
672
- $metadata: deserializeMetadata(output),
673
- };
674
- break;
378
+ throw await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context);
675
379
  case "UnsupportedActionException":
676
380
  case "com.amazonaws.cloudcontrol#UnsupportedActionException":
677
- response = {
678
- ...(await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context)),
679
- name: errorCode,
680
- $metadata: deserializeMetadata(output),
681
- };
682
- break;
381
+ throw await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context);
683
382
  default:
684
383
  const parsedBody = parsedOutput.body;
685
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
686
- response = {
687
- ...parsedBody,
688
- name: `${errorCode}`,
689
- message: parsedBody.message || parsedBody.Message || errorCode,
384
+ response = new CloudControlServiceException_1.CloudControlServiceException({
385
+ name: parsedBody.code || parsedBody.Code || errorCode,
690
386
  $fault: "client",
691
387
  $metadata: deserializeMetadata(output),
692
- };
388
+ });
389
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
693
390
  }
694
- const message = response.message || response.Message || errorCode;
695
- response.message = message;
696
- delete response.Message;
697
- return Promise.reject(Object.assign(new Error(message), response));
698
391
  };
699
392
  const deserializeAws_json1_0GetResourceRequestStatusCommand = async (output, context) => {
700
393
  if (output.statusCode >= 300) {
@@ -721,27 +414,16 @@ const deserializeAws_json1_0GetResourceRequestStatusCommandError = async (output
721
414
  switch (errorCode) {
722
415
  case "RequestTokenNotFoundException":
723
416
  case "com.amazonaws.cloudcontrol#RequestTokenNotFoundException":
724
- response = {
725
- ...(await deserializeAws_json1_0RequestTokenNotFoundExceptionResponse(parsedOutput, context)),
726
- name: errorCode,
727
- $metadata: deserializeMetadata(output),
728
- };
729
- break;
417
+ throw await deserializeAws_json1_0RequestTokenNotFoundExceptionResponse(parsedOutput, context);
730
418
  default:
731
419
  const parsedBody = parsedOutput.body;
732
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
733
- response = {
734
- ...parsedBody,
735
- name: `${errorCode}`,
736
- message: parsedBody.message || parsedBody.Message || errorCode,
420
+ response = new CloudControlServiceException_1.CloudControlServiceException({
421
+ name: parsedBody.code || parsedBody.Code || errorCode,
737
422
  $fault: "client",
738
423
  $metadata: deserializeMetadata(output),
739
- };
424
+ });
425
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
740
426
  }
741
- const message = response.message || response.Message || errorCode;
742
- response.message = message;
743
- delete response.Message;
744
- return Promise.reject(Object.assign(new Error(message), response));
745
427
  };
746
428
  const deserializeAws_json1_0ListResourceRequestsCommand = async (output, context) => {
747
429
  if (output.statusCode >= 300) {
@@ -768,19 +450,13 @@ const deserializeAws_json1_0ListResourceRequestsCommandError = async (output, co
768
450
  switch (errorCode) {
769
451
  default:
770
452
  const parsedBody = parsedOutput.body;
771
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
772
- response = {
773
- ...parsedBody,
774
- name: `${errorCode}`,
775
- message: parsedBody.message || parsedBody.Message || errorCode,
453
+ response = new CloudControlServiceException_1.CloudControlServiceException({
454
+ name: parsedBody.code || parsedBody.Code || errorCode,
776
455
  $fault: "client",
777
456
  $metadata: deserializeMetadata(output),
778
- };
457
+ });
458
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
779
459
  }
780
- const message = response.message || response.Message || errorCode;
781
- response.message = message;
782
- delete response.Message;
783
- return Promise.reject(Object.assign(new Error(message), response));
784
460
  };
785
461
  const deserializeAws_json1_0ListResourcesCommand = async (output, context) => {
786
462
  if (output.statusCode >= 300) {
@@ -807,155 +483,64 @@ const deserializeAws_json1_0ListResourcesCommandError = async (output, context)
807
483
  switch (errorCode) {
808
484
  case "AlreadyExistsException":
809
485
  case "com.amazonaws.cloudcontrol#AlreadyExistsException":
810
- response = {
811
- ...(await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context)),
812
- name: errorCode,
813
- $metadata: deserializeMetadata(output),
814
- };
815
- break;
486
+ throw await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context);
816
487
  case "GeneralServiceException":
817
488
  case "com.amazonaws.cloudcontrol#GeneralServiceException":
818
- response = {
819
- ...(await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context)),
820
- name: errorCode,
821
- $metadata: deserializeMetadata(output),
822
- };
823
- break;
489
+ throw await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context);
824
490
  case "HandlerFailureException":
825
491
  case "com.amazonaws.cloudcontrol#HandlerFailureException":
826
- response = {
827
- ...(await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context)),
828
- name: errorCode,
829
- $metadata: deserializeMetadata(output),
830
- };
831
- break;
492
+ throw await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context);
832
493
  case "HandlerInternalFailureException":
833
494
  case "com.amazonaws.cloudcontrol#HandlerInternalFailureException":
834
- response = {
835
- ...(await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context)),
836
- name: errorCode,
837
- $metadata: deserializeMetadata(output),
838
- };
839
- break;
495
+ throw await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context);
840
496
  case "InvalidCredentialsException":
841
497
  case "com.amazonaws.cloudcontrol#InvalidCredentialsException":
842
- response = {
843
- ...(await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context)),
844
- name: errorCode,
845
- $metadata: deserializeMetadata(output),
846
- };
847
- break;
498
+ throw await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context);
848
499
  case "InvalidRequestException":
849
500
  case "com.amazonaws.cloudcontrol#InvalidRequestException":
850
- response = {
851
- ...(await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context)),
852
- name: errorCode,
853
- $metadata: deserializeMetadata(output),
854
- };
855
- break;
501
+ throw await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context);
856
502
  case "NetworkFailureException":
857
503
  case "com.amazonaws.cloudcontrol#NetworkFailureException":
858
- response = {
859
- ...(await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context)),
860
- name: errorCode,
861
- $metadata: deserializeMetadata(output),
862
- };
863
- break;
504
+ throw await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context);
864
505
  case "NotStabilizedException":
865
506
  case "com.amazonaws.cloudcontrol#NotStabilizedException":
866
- response = {
867
- ...(await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context)),
868
- name: errorCode,
869
- $metadata: deserializeMetadata(output),
870
- };
871
- break;
507
+ throw await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context);
872
508
  case "NotUpdatableException":
873
509
  case "com.amazonaws.cloudcontrol#NotUpdatableException":
874
- response = {
875
- ...(await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context)),
876
- name: errorCode,
877
- $metadata: deserializeMetadata(output),
878
- };
879
- break;
510
+ throw await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context);
880
511
  case "PrivateTypeException":
881
512
  case "com.amazonaws.cloudcontrol#PrivateTypeException":
882
- response = {
883
- ...(await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context)),
884
- name: errorCode,
885
- $metadata: deserializeMetadata(output),
886
- };
887
- break;
513
+ throw await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context);
888
514
  case "ResourceConflictException":
889
515
  case "com.amazonaws.cloudcontrol#ResourceConflictException":
890
- response = {
891
- ...(await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context)),
892
- name: errorCode,
893
- $metadata: deserializeMetadata(output),
894
- };
895
- break;
516
+ throw await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context);
896
517
  case "ResourceNotFoundException":
897
518
  case "com.amazonaws.cloudcontrol#ResourceNotFoundException":
898
- response = {
899
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
900
- name: errorCode,
901
- $metadata: deserializeMetadata(output),
902
- };
903
- break;
519
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
904
520
  case "ServiceInternalErrorException":
905
521
  case "com.amazonaws.cloudcontrol#ServiceInternalErrorException":
906
- response = {
907
- ...(await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context)),
908
- name: errorCode,
909
- $metadata: deserializeMetadata(output),
910
- };
911
- break;
522
+ throw await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context);
912
523
  case "ServiceLimitExceededException":
913
524
  case "com.amazonaws.cloudcontrol#ServiceLimitExceededException":
914
- response = {
915
- ...(await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context)),
916
- name: errorCode,
917
- $metadata: deserializeMetadata(output),
918
- };
919
- break;
525
+ throw await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context);
920
526
  case "ThrottlingException":
921
527
  case "com.amazonaws.cloudcontrol#ThrottlingException":
922
- response = {
923
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
924
- name: errorCode,
925
- $metadata: deserializeMetadata(output),
926
- };
927
- break;
528
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
928
529
  case "TypeNotFoundException":
929
530
  case "com.amazonaws.cloudcontrol#TypeNotFoundException":
930
- response = {
931
- ...(await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context)),
932
- name: errorCode,
933
- $metadata: deserializeMetadata(output),
934
- };
935
- break;
531
+ throw await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context);
936
532
  case "UnsupportedActionException":
937
533
  case "com.amazonaws.cloudcontrol#UnsupportedActionException":
938
- response = {
939
- ...(await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context)),
940
- name: errorCode,
941
- $metadata: deserializeMetadata(output),
942
- };
943
- break;
534
+ throw await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context);
944
535
  default:
945
536
  const parsedBody = parsedOutput.body;
946
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
947
- response = {
948
- ...parsedBody,
949
- name: `${errorCode}`,
950
- message: parsedBody.message || parsedBody.Message || errorCode,
537
+ response = new CloudControlServiceException_1.CloudControlServiceException({
538
+ name: parsedBody.code || parsedBody.Code || errorCode,
951
539
  $fault: "client",
952
540
  $metadata: deserializeMetadata(output),
953
- };
541
+ });
542
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
954
543
  }
955
- const message = response.message || response.Message || errorCode;
956
- response.message = message;
957
- delete response.Message;
958
- return Promise.reject(Object.assign(new Error(message), response));
959
544
  };
960
545
  const deserializeAws_json1_0UpdateResourceCommand = async (output, context) => {
961
546
  if (output.statusCode >= 300) {
@@ -982,402 +567,259 @@ const deserializeAws_json1_0UpdateResourceCommandError = async (output, context)
982
567
  switch (errorCode) {
983
568
  case "AlreadyExistsException":
984
569
  case "com.amazonaws.cloudcontrol#AlreadyExistsException":
985
- response = {
986
- ...(await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context)),
987
- name: errorCode,
988
- $metadata: deserializeMetadata(output),
989
- };
990
- break;
570
+ throw await deserializeAws_json1_0AlreadyExistsExceptionResponse(parsedOutput, context);
991
571
  case "ClientTokenConflictException":
992
572
  case "com.amazonaws.cloudcontrol#ClientTokenConflictException":
993
- response = {
994
- ...(await deserializeAws_json1_0ClientTokenConflictExceptionResponse(parsedOutput, context)),
995
- name: errorCode,
996
- $metadata: deserializeMetadata(output),
997
- };
998
- break;
573
+ throw await deserializeAws_json1_0ClientTokenConflictExceptionResponse(parsedOutput, context);
999
574
  case "ConcurrentOperationException":
1000
575
  case "com.amazonaws.cloudcontrol#ConcurrentOperationException":
1001
- response = {
1002
- ...(await deserializeAws_json1_0ConcurrentOperationExceptionResponse(parsedOutput, context)),
1003
- name: errorCode,
1004
- $metadata: deserializeMetadata(output),
1005
- };
1006
- break;
576
+ throw await deserializeAws_json1_0ConcurrentOperationExceptionResponse(parsedOutput, context);
1007
577
  case "GeneralServiceException":
1008
578
  case "com.amazonaws.cloudcontrol#GeneralServiceException":
1009
- response = {
1010
- ...(await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context)),
1011
- name: errorCode,
1012
- $metadata: deserializeMetadata(output),
1013
- };
1014
- break;
579
+ throw await deserializeAws_json1_0GeneralServiceExceptionResponse(parsedOutput, context);
1015
580
  case "HandlerFailureException":
1016
581
  case "com.amazonaws.cloudcontrol#HandlerFailureException":
1017
- response = {
1018
- ...(await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context)),
1019
- name: errorCode,
1020
- $metadata: deserializeMetadata(output),
1021
- };
1022
- break;
582
+ throw await deserializeAws_json1_0HandlerFailureExceptionResponse(parsedOutput, context);
1023
583
  case "HandlerInternalFailureException":
1024
584
  case "com.amazonaws.cloudcontrol#HandlerInternalFailureException":
1025
- response = {
1026
- ...(await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context)),
1027
- name: errorCode,
1028
- $metadata: deserializeMetadata(output),
1029
- };
1030
- break;
585
+ throw await deserializeAws_json1_0HandlerInternalFailureExceptionResponse(parsedOutput, context);
1031
586
  case "InvalidCredentialsException":
1032
587
  case "com.amazonaws.cloudcontrol#InvalidCredentialsException":
1033
- response = {
1034
- ...(await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context)),
1035
- name: errorCode,
1036
- $metadata: deserializeMetadata(output),
1037
- };
1038
- break;
588
+ throw await deserializeAws_json1_0InvalidCredentialsExceptionResponse(parsedOutput, context);
1039
589
  case "InvalidRequestException":
1040
590
  case "com.amazonaws.cloudcontrol#InvalidRequestException":
1041
- response = {
1042
- ...(await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context)),
1043
- name: errorCode,
1044
- $metadata: deserializeMetadata(output),
1045
- };
1046
- break;
591
+ throw await deserializeAws_json1_0InvalidRequestExceptionResponse(parsedOutput, context);
1047
592
  case "NetworkFailureException":
1048
593
  case "com.amazonaws.cloudcontrol#NetworkFailureException":
1049
- response = {
1050
- ...(await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context)),
1051
- name: errorCode,
1052
- $metadata: deserializeMetadata(output),
1053
- };
1054
- break;
594
+ throw await deserializeAws_json1_0NetworkFailureExceptionResponse(parsedOutput, context);
1055
595
  case "NotStabilizedException":
1056
596
  case "com.amazonaws.cloudcontrol#NotStabilizedException":
1057
- response = {
1058
- ...(await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context)),
1059
- name: errorCode,
1060
- $metadata: deserializeMetadata(output),
1061
- };
1062
- break;
597
+ throw await deserializeAws_json1_0NotStabilizedExceptionResponse(parsedOutput, context);
1063
598
  case "NotUpdatableException":
1064
599
  case "com.amazonaws.cloudcontrol#NotUpdatableException":
1065
- response = {
1066
- ...(await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context)),
1067
- name: errorCode,
1068
- $metadata: deserializeMetadata(output),
1069
- };
1070
- break;
600
+ throw await deserializeAws_json1_0NotUpdatableExceptionResponse(parsedOutput, context);
1071
601
  case "PrivateTypeException":
1072
602
  case "com.amazonaws.cloudcontrol#PrivateTypeException":
1073
- response = {
1074
- ...(await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context)),
1075
- name: errorCode,
1076
- $metadata: deserializeMetadata(output),
1077
- };
1078
- break;
603
+ throw await deserializeAws_json1_0PrivateTypeExceptionResponse(parsedOutput, context);
1079
604
  case "ResourceConflictException":
1080
605
  case "com.amazonaws.cloudcontrol#ResourceConflictException":
1081
- response = {
1082
- ...(await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context)),
1083
- name: errorCode,
1084
- $metadata: deserializeMetadata(output),
1085
- };
1086
- break;
606
+ throw await deserializeAws_json1_0ResourceConflictExceptionResponse(parsedOutput, context);
1087
607
  case "ResourceNotFoundException":
1088
608
  case "com.amazonaws.cloudcontrol#ResourceNotFoundException":
1089
- response = {
1090
- ...(await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context)),
1091
- name: errorCode,
1092
- $metadata: deserializeMetadata(output),
1093
- };
1094
- break;
609
+ throw await deserializeAws_json1_0ResourceNotFoundExceptionResponse(parsedOutput, context);
1095
610
  case "ServiceInternalErrorException":
1096
611
  case "com.amazonaws.cloudcontrol#ServiceInternalErrorException":
1097
- response = {
1098
- ...(await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context)),
1099
- name: errorCode,
1100
- $metadata: deserializeMetadata(output),
1101
- };
1102
- break;
612
+ throw await deserializeAws_json1_0ServiceInternalErrorExceptionResponse(parsedOutput, context);
1103
613
  case "ServiceLimitExceededException":
1104
614
  case "com.amazonaws.cloudcontrol#ServiceLimitExceededException":
1105
- response = {
1106
- ...(await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context)),
1107
- name: errorCode,
1108
- $metadata: deserializeMetadata(output),
1109
- };
1110
- break;
615
+ throw await deserializeAws_json1_0ServiceLimitExceededExceptionResponse(parsedOutput, context);
1111
616
  case "ThrottlingException":
1112
617
  case "com.amazonaws.cloudcontrol#ThrottlingException":
1113
- response = {
1114
- ...(await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context)),
1115
- name: errorCode,
1116
- $metadata: deserializeMetadata(output),
1117
- };
1118
- break;
618
+ throw await deserializeAws_json1_0ThrottlingExceptionResponse(parsedOutput, context);
1119
619
  case "TypeNotFoundException":
1120
620
  case "com.amazonaws.cloudcontrol#TypeNotFoundException":
1121
- response = {
1122
- ...(await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context)),
1123
- name: errorCode,
1124
- $metadata: deserializeMetadata(output),
1125
- };
1126
- break;
621
+ throw await deserializeAws_json1_0TypeNotFoundExceptionResponse(parsedOutput, context);
1127
622
  case "UnsupportedActionException":
1128
623
  case "com.amazonaws.cloudcontrol#UnsupportedActionException":
1129
- response = {
1130
- ...(await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context)),
1131
- name: errorCode,
1132
- $metadata: deserializeMetadata(output),
1133
- };
1134
- break;
624
+ throw await deserializeAws_json1_0UnsupportedActionExceptionResponse(parsedOutput, context);
1135
625
  default:
1136
626
  const parsedBody = parsedOutput.body;
1137
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
1138
- response = {
1139
- ...parsedBody,
1140
- name: `${errorCode}`,
1141
- message: parsedBody.message || parsedBody.Message || errorCode,
627
+ response = new CloudControlServiceException_1.CloudControlServiceException({
628
+ name: parsedBody.code || parsedBody.Code || errorCode,
1142
629
  $fault: "client",
1143
630
  $metadata: deserializeMetadata(output),
1144
- };
631
+ });
632
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
1145
633
  }
1146
- const message = response.message || response.Message || errorCode;
1147
- response.message = message;
1148
- delete response.Message;
1149
- return Promise.reject(Object.assign(new Error(message), response));
1150
634
  };
1151
635
  const deserializeAws_json1_0AlreadyExistsExceptionResponse = async (parsedOutput, context) => {
1152
636
  const body = parsedOutput.body;
1153
637
  const deserialized = deserializeAws_json1_0AlreadyExistsException(body, context);
1154
- const contents = {
1155
- name: "AlreadyExistsException",
1156
- $fault: "client",
638
+ const exception = new models_0_1.AlreadyExistsException({
1157
639
  $metadata: deserializeMetadata(parsedOutput),
1158
640
  ...deserialized,
1159
- };
1160
- return contents;
641
+ });
642
+ return smithy_client_1.decorateServiceException(exception, body);
1161
643
  };
1162
644
  const deserializeAws_json1_0ClientTokenConflictExceptionResponse = async (parsedOutput, context) => {
1163
645
  const body = parsedOutput.body;
1164
646
  const deserialized = deserializeAws_json1_0ClientTokenConflictException(body, context);
1165
- const contents = {
1166
- name: "ClientTokenConflictException",
1167
- $fault: "client",
647
+ const exception = new models_0_1.ClientTokenConflictException({
1168
648
  $metadata: deserializeMetadata(parsedOutput),
1169
649
  ...deserialized,
1170
- };
1171
- return contents;
650
+ });
651
+ return smithy_client_1.decorateServiceException(exception, body);
1172
652
  };
1173
653
  const deserializeAws_json1_0ConcurrentModificationExceptionResponse = async (parsedOutput, context) => {
1174
654
  const body = parsedOutput.body;
1175
655
  const deserialized = deserializeAws_json1_0ConcurrentModificationException(body, context);
1176
- const contents = {
1177
- name: "ConcurrentModificationException",
1178
- $fault: "server",
656
+ const exception = new models_0_1.ConcurrentModificationException({
1179
657
  $metadata: deserializeMetadata(parsedOutput),
1180
658
  ...deserialized,
1181
- };
1182
- return contents;
659
+ });
660
+ return smithy_client_1.decorateServiceException(exception, body);
1183
661
  };
1184
662
  const deserializeAws_json1_0ConcurrentOperationExceptionResponse = async (parsedOutput, context) => {
1185
663
  const body = parsedOutput.body;
1186
664
  const deserialized = deserializeAws_json1_0ConcurrentOperationException(body, context);
1187
- const contents = {
1188
- name: "ConcurrentOperationException",
1189
- $fault: "client",
665
+ const exception = new models_0_1.ConcurrentOperationException({
1190
666
  $metadata: deserializeMetadata(parsedOutput),
1191
667
  ...deserialized,
1192
- };
1193
- return contents;
668
+ });
669
+ return smithy_client_1.decorateServiceException(exception, body);
1194
670
  };
1195
671
  const deserializeAws_json1_0GeneralServiceExceptionResponse = async (parsedOutput, context) => {
1196
672
  const body = parsedOutput.body;
1197
673
  const deserialized = deserializeAws_json1_0GeneralServiceException(body, context);
1198
- const contents = {
1199
- name: "GeneralServiceException",
1200
- $fault: "client",
674
+ const exception = new models_0_1.GeneralServiceException({
1201
675
  $metadata: deserializeMetadata(parsedOutput),
1202
676
  ...deserialized,
1203
- };
1204
- return contents;
677
+ });
678
+ return smithy_client_1.decorateServiceException(exception, body);
1205
679
  };
1206
680
  const deserializeAws_json1_0HandlerFailureExceptionResponse = async (parsedOutput, context) => {
1207
681
  const body = parsedOutput.body;
1208
682
  const deserialized = deserializeAws_json1_0HandlerFailureException(body, context);
1209
- const contents = {
1210
- name: "HandlerFailureException",
1211
- $fault: "server",
683
+ const exception = new models_0_1.HandlerFailureException({
1212
684
  $metadata: deserializeMetadata(parsedOutput),
1213
685
  ...deserialized,
1214
- };
1215
- return contents;
686
+ });
687
+ return smithy_client_1.decorateServiceException(exception, body);
1216
688
  };
1217
689
  const deserializeAws_json1_0HandlerInternalFailureExceptionResponse = async (parsedOutput, context) => {
1218
690
  const body = parsedOutput.body;
1219
691
  const deserialized = deserializeAws_json1_0HandlerInternalFailureException(body, context);
1220
- const contents = {
1221
- name: "HandlerInternalFailureException",
1222
- $fault: "server",
692
+ const exception = new models_0_1.HandlerInternalFailureException({
1223
693
  $metadata: deserializeMetadata(parsedOutput),
1224
694
  ...deserialized,
1225
- };
1226
- return contents;
695
+ });
696
+ return smithy_client_1.decorateServiceException(exception, body);
1227
697
  };
1228
698
  const deserializeAws_json1_0InvalidCredentialsExceptionResponse = async (parsedOutput, context) => {
1229
699
  const body = parsedOutput.body;
1230
700
  const deserialized = deserializeAws_json1_0InvalidCredentialsException(body, context);
1231
- const contents = {
1232
- name: "InvalidCredentialsException",
1233
- $fault: "client",
701
+ const exception = new models_0_1.InvalidCredentialsException({
1234
702
  $metadata: deserializeMetadata(parsedOutput),
1235
703
  ...deserialized,
1236
- };
1237
- return contents;
704
+ });
705
+ return smithy_client_1.decorateServiceException(exception, body);
1238
706
  };
1239
707
  const deserializeAws_json1_0InvalidRequestExceptionResponse = async (parsedOutput, context) => {
1240
708
  const body = parsedOutput.body;
1241
709
  const deserialized = deserializeAws_json1_0InvalidRequestException(body, context);
1242
- const contents = {
1243
- name: "InvalidRequestException",
1244
- $fault: "client",
710
+ const exception = new models_0_1.InvalidRequestException({
1245
711
  $metadata: deserializeMetadata(parsedOutput),
1246
712
  ...deserialized,
1247
- };
1248
- return contents;
713
+ });
714
+ return smithy_client_1.decorateServiceException(exception, body);
1249
715
  };
1250
716
  const deserializeAws_json1_0NetworkFailureExceptionResponse = async (parsedOutput, context) => {
1251
717
  const body = parsedOutput.body;
1252
718
  const deserialized = deserializeAws_json1_0NetworkFailureException(body, context);
1253
- const contents = {
1254
- name: "NetworkFailureException",
1255
- $fault: "server",
719
+ const exception = new models_0_1.NetworkFailureException({
1256
720
  $metadata: deserializeMetadata(parsedOutput),
1257
721
  ...deserialized,
1258
- };
1259
- return contents;
722
+ });
723
+ return smithy_client_1.decorateServiceException(exception, body);
1260
724
  };
1261
725
  const deserializeAws_json1_0NotStabilizedExceptionResponse = async (parsedOutput, context) => {
1262
726
  const body = parsedOutput.body;
1263
727
  const deserialized = deserializeAws_json1_0NotStabilizedException(body, context);
1264
- const contents = {
1265
- name: "NotStabilizedException",
1266
- $fault: "client",
728
+ const exception = new models_0_1.NotStabilizedException({
1267
729
  $metadata: deserializeMetadata(parsedOutput),
1268
730
  ...deserialized,
1269
- };
1270
- return contents;
731
+ });
732
+ return smithy_client_1.decorateServiceException(exception, body);
1271
733
  };
1272
734
  const deserializeAws_json1_0NotUpdatableExceptionResponse = async (parsedOutput, context) => {
1273
735
  const body = parsedOutput.body;
1274
736
  const deserialized = deserializeAws_json1_0NotUpdatableException(body, context);
1275
- const contents = {
1276
- name: "NotUpdatableException",
1277
- $fault: "client",
737
+ const exception = new models_0_1.NotUpdatableException({
1278
738
  $metadata: deserializeMetadata(parsedOutput),
1279
739
  ...deserialized,
1280
- };
1281
- return contents;
740
+ });
741
+ return smithy_client_1.decorateServiceException(exception, body);
1282
742
  };
1283
743
  const deserializeAws_json1_0PrivateTypeExceptionResponse = async (parsedOutput, context) => {
1284
744
  const body = parsedOutput.body;
1285
745
  const deserialized = deserializeAws_json1_0PrivateTypeException(body, context);
1286
- const contents = {
1287
- name: "PrivateTypeException",
1288
- $fault: "client",
746
+ const exception = new models_0_1.PrivateTypeException({
1289
747
  $metadata: deserializeMetadata(parsedOutput),
1290
748
  ...deserialized,
1291
- };
1292
- return contents;
749
+ });
750
+ return smithy_client_1.decorateServiceException(exception, body);
1293
751
  };
1294
752
  const deserializeAws_json1_0RequestTokenNotFoundExceptionResponse = async (parsedOutput, context) => {
1295
753
  const body = parsedOutput.body;
1296
754
  const deserialized = deserializeAws_json1_0RequestTokenNotFoundException(body, context);
1297
- const contents = {
1298
- name: "RequestTokenNotFoundException",
1299
- $fault: "client",
755
+ const exception = new models_0_1.RequestTokenNotFoundException({
1300
756
  $metadata: deserializeMetadata(parsedOutput),
1301
757
  ...deserialized,
1302
- };
1303
- return contents;
758
+ });
759
+ return smithy_client_1.decorateServiceException(exception, body);
1304
760
  };
1305
761
  const deserializeAws_json1_0ResourceConflictExceptionResponse = async (parsedOutput, context) => {
1306
762
  const body = parsedOutput.body;
1307
763
  const deserialized = deserializeAws_json1_0ResourceConflictException(body, context);
1308
- const contents = {
1309
- name: "ResourceConflictException",
1310
- $fault: "client",
764
+ const exception = new models_0_1.ResourceConflictException({
1311
765
  $metadata: deserializeMetadata(parsedOutput),
1312
766
  ...deserialized,
1313
- };
1314
- return contents;
767
+ });
768
+ return smithy_client_1.decorateServiceException(exception, body);
1315
769
  };
1316
770
  const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
1317
771
  const body = parsedOutput.body;
1318
772
  const deserialized = deserializeAws_json1_0ResourceNotFoundException(body, context);
1319
- const contents = {
1320
- name: "ResourceNotFoundException",
1321
- $fault: "client",
773
+ const exception = new models_0_1.ResourceNotFoundException({
1322
774
  $metadata: deserializeMetadata(parsedOutput),
1323
775
  ...deserialized,
1324
- };
1325
- return contents;
776
+ });
777
+ return smithy_client_1.decorateServiceException(exception, body);
1326
778
  };
1327
779
  const deserializeAws_json1_0ServiceInternalErrorExceptionResponse = async (parsedOutput, context) => {
1328
780
  const body = parsedOutput.body;
1329
781
  const deserialized = deserializeAws_json1_0ServiceInternalErrorException(body, context);
1330
- const contents = {
1331
- name: "ServiceInternalErrorException",
1332
- $fault: "server",
782
+ const exception = new models_0_1.ServiceInternalErrorException({
1333
783
  $metadata: deserializeMetadata(parsedOutput),
1334
784
  ...deserialized,
1335
- };
1336
- return contents;
785
+ });
786
+ return smithy_client_1.decorateServiceException(exception, body);
1337
787
  };
1338
788
  const deserializeAws_json1_0ServiceLimitExceededExceptionResponse = async (parsedOutput, context) => {
1339
789
  const body = parsedOutput.body;
1340
790
  const deserialized = deserializeAws_json1_0ServiceLimitExceededException(body, context);
1341
- const contents = {
1342
- name: "ServiceLimitExceededException",
1343
- $fault: "client",
791
+ const exception = new models_0_1.ServiceLimitExceededException({
1344
792
  $metadata: deserializeMetadata(parsedOutput),
1345
793
  ...deserialized,
1346
- };
1347
- return contents;
794
+ });
795
+ return smithy_client_1.decorateServiceException(exception, body);
1348
796
  };
1349
797
  const deserializeAws_json1_0ThrottlingExceptionResponse = async (parsedOutput, context) => {
1350
798
  const body = parsedOutput.body;
1351
799
  const deserialized = deserializeAws_json1_0ThrottlingException(body, context);
1352
- const contents = {
1353
- name: "ThrottlingException",
1354
- $fault: "client",
800
+ const exception = new models_0_1.ThrottlingException({
1355
801
  $metadata: deserializeMetadata(parsedOutput),
1356
802
  ...deserialized,
1357
- };
1358
- return contents;
803
+ });
804
+ return smithy_client_1.decorateServiceException(exception, body);
1359
805
  };
1360
806
  const deserializeAws_json1_0TypeNotFoundExceptionResponse = async (parsedOutput, context) => {
1361
807
  const body = parsedOutput.body;
1362
808
  const deserialized = deserializeAws_json1_0TypeNotFoundException(body, context);
1363
- const contents = {
1364
- name: "TypeNotFoundException",
1365
- $fault: "client",
809
+ const exception = new models_0_1.TypeNotFoundException({
1366
810
  $metadata: deserializeMetadata(parsedOutput),
1367
811
  ...deserialized,
1368
- };
1369
- return contents;
812
+ });
813
+ return smithy_client_1.decorateServiceException(exception, body);
1370
814
  };
1371
815
  const deserializeAws_json1_0UnsupportedActionExceptionResponse = async (parsedOutput, context) => {
1372
816
  const body = parsedOutput.body;
1373
817
  const deserialized = deserializeAws_json1_0UnsupportedActionException(body, context);
1374
- const contents = {
1375
- name: "UnsupportedActionException",
1376
- $fault: "client",
818
+ const exception = new models_0_1.UnsupportedActionException({
1377
819
  $metadata: deserializeMetadata(parsedOutput),
1378
820
  ...deserialized,
1379
- };
1380
- return contents;
821
+ });
822
+ return smithy_client_1.decorateServiceException(exception, body);
1381
823
  };
1382
824
  const serializeAws_json1_0CancelResourceRequestInput = (input, context) => {
1383
825
  return {
@@ -1631,7 +1073,7 @@ const deserializeAws_json1_0ResourceDescription = (output, context) => {
1631
1073
  };
1632
1074
  };
1633
1075
  const deserializeAws_json1_0ResourceDescriptions = (output, context) => {
1634
- return (output || [])
1076
+ const retVal = (output || [])
1635
1077
  .filter((e) => e != null)
1636
1078
  .map((entry) => {
1637
1079
  if (entry === null) {
@@ -1639,6 +1081,7 @@ const deserializeAws_json1_0ResourceDescriptions = (output, context) => {
1639
1081
  }
1640
1082
  return deserializeAws_json1_0ResourceDescription(entry, context);
1641
1083
  });
1084
+ return retVal;
1642
1085
  };
1643
1086
  const deserializeAws_json1_0ResourceNotFoundException = (output, context) => {
1644
1087
  return {
@@ -1646,7 +1089,7 @@ const deserializeAws_json1_0ResourceNotFoundException = (output, context) => {
1646
1089
  };
1647
1090
  };
1648
1091
  const deserializeAws_json1_0ResourceRequestStatusSummaries = (output, context) => {
1649
- return (output || [])
1092
+ const retVal = (output || [])
1650
1093
  .filter((e) => e != null)
1651
1094
  .map((entry) => {
1652
1095
  if (entry === null) {
@@ -1654,6 +1097,7 @@ const deserializeAws_json1_0ResourceRequestStatusSummaries = (output, context) =
1654
1097
  }
1655
1098
  return deserializeAws_json1_0ProgressEvent(entry, context);
1656
1099
  });
1100
+ return retVal;
1657
1101
  };
1658
1102
  const deserializeAws_json1_0ServiceInternalErrorException = (output, context) => {
1659
1103
  return {