@aws-sdk/client-sso-oidc 3.50.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.
Files changed (29) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist-cjs/index.js +3 -0
  3. package/dist-cjs/models/SSOOIDCServiceException.js +11 -0
  4. package/dist-cjs/models/models_0.js +182 -1
  5. package/dist-cjs/protocols/Aws_restJson1.js +106 -246
  6. package/dist-es/index.js +1 -0
  7. package/dist-es/models/SSOOIDCServiceException.js +12 -0
  8. package/dist-es/models/models_0.js +170 -1
  9. package/dist-es/protocols/Aws_restJson1.js +127 -271
  10. package/dist-types/index.d.ts +1 -0
  11. package/dist-types/models/SSOOIDCServiceException.d.ts +10 -0
  12. package/dist-types/models/models_0.d.ts +86 -37
  13. package/dist-types/ts3.4/SSOOIDC.d.ts +20 -0
  14. package/dist-types/ts3.4/SSOOIDCClient.d.ts +73 -0
  15. package/dist-types/ts3.4/commands/CreateTokenCommand.d.ts +17 -0
  16. package/dist-types/ts3.4/commands/RegisterClientCommand.d.ts +17 -0
  17. package/dist-types/ts3.4/commands/StartDeviceAuthorizationCommand.d.ts +17 -0
  18. package/dist-types/ts3.4/commands/index.d.ts +3 -0
  19. package/dist-types/ts3.4/endpoints.d.ts +2 -0
  20. package/dist-types/ts3.4/index.d.ts +5 -0
  21. package/dist-types/ts3.4/models/SSOOIDCServiceException.d.ts +6 -0
  22. package/dist-types/ts3.4/models/index.d.ts +1 -0
  23. package/dist-types/ts3.4/models/models_0.d.ts +208 -0
  24. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +11 -0
  25. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +31 -0
  26. package/dist-types/ts3.4/runtimeConfig.d.ts +31 -0
  27. package/dist-types/ts3.4/runtimeConfig.native.d.ts +30 -0
  28. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +11 -0
  29. package/package.json +30 -30
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.deserializeAws_restJson1StartDeviceAuthorizationCommand = exports.deserializeAws_restJson1RegisterClientCommand = exports.deserializeAws_restJson1CreateTokenCommand = exports.serializeAws_restJson1StartDeviceAuthorizationCommand = exports.serializeAws_restJson1RegisterClientCommand = exports.serializeAws_restJson1CreateTokenCommand = void 0;
4
4
  const protocol_http_1 = require("@aws-sdk/protocol-http");
5
5
  const smithy_client_1 = require("@aws-sdk/smithy-client");
6
+ const models_0_1 = require("../models/models_0");
7
+ const SSOOIDCServiceException_1 = require("../models/SSOOIDCServiceException");
6
8
  const serializeAws_restJson1CreateTokenCommand = async (input, context) => {
7
9
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
10
  const headers = {
@@ -121,107 +123,46 @@ const deserializeAws_restJson1CreateTokenCommandError = async (output, context)
121
123
  switch (errorCode) {
122
124
  case "AccessDeniedException":
123
125
  case "com.amazonaws.ssooidc#AccessDeniedException":
124
- response = {
125
- ...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
126
- name: errorCode,
127
- $metadata: deserializeMetadata(output),
128
- };
129
- break;
126
+ throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
130
127
  case "AuthorizationPendingException":
131
128
  case "com.amazonaws.ssooidc#AuthorizationPendingException":
132
- response = {
133
- ...(await deserializeAws_restJson1AuthorizationPendingExceptionResponse(parsedOutput, context)),
134
- name: errorCode,
135
- $metadata: deserializeMetadata(output),
136
- };
137
- break;
129
+ throw await deserializeAws_restJson1AuthorizationPendingExceptionResponse(parsedOutput, context);
138
130
  case "ExpiredTokenException":
139
131
  case "com.amazonaws.ssooidc#ExpiredTokenException":
140
- response = {
141
- ...(await deserializeAws_restJson1ExpiredTokenExceptionResponse(parsedOutput, context)),
142
- name: errorCode,
143
- $metadata: deserializeMetadata(output),
144
- };
145
- break;
132
+ throw await deserializeAws_restJson1ExpiredTokenExceptionResponse(parsedOutput, context);
146
133
  case "InternalServerException":
147
134
  case "com.amazonaws.ssooidc#InternalServerException":
148
- response = {
149
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
150
- name: errorCode,
151
- $metadata: deserializeMetadata(output),
152
- };
153
- break;
135
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
154
136
  case "InvalidClientException":
155
137
  case "com.amazonaws.ssooidc#InvalidClientException":
156
- response = {
157
- ...(await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context)),
158
- name: errorCode,
159
- $metadata: deserializeMetadata(output),
160
- };
161
- break;
138
+ throw await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context);
162
139
  case "InvalidGrantException":
163
140
  case "com.amazonaws.ssooidc#InvalidGrantException":
164
- response = {
165
- ...(await deserializeAws_restJson1InvalidGrantExceptionResponse(parsedOutput, context)),
166
- name: errorCode,
167
- $metadata: deserializeMetadata(output),
168
- };
169
- break;
141
+ throw await deserializeAws_restJson1InvalidGrantExceptionResponse(parsedOutput, context);
170
142
  case "InvalidRequestException":
171
143
  case "com.amazonaws.ssooidc#InvalidRequestException":
172
- response = {
173
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
174
- name: errorCode,
175
- $metadata: deserializeMetadata(output),
176
- };
177
- break;
144
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
178
145
  case "InvalidScopeException":
179
146
  case "com.amazonaws.ssooidc#InvalidScopeException":
180
- response = {
181
- ...(await deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context)),
182
- name: errorCode,
183
- $metadata: deserializeMetadata(output),
184
- };
185
- break;
147
+ throw await deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context);
186
148
  case "SlowDownException":
187
149
  case "com.amazonaws.ssooidc#SlowDownException":
188
- response = {
189
- ...(await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context)),
190
- name: errorCode,
191
- $metadata: deserializeMetadata(output),
192
- };
193
- break;
150
+ throw await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context);
194
151
  case "UnauthorizedClientException":
195
152
  case "com.amazonaws.ssooidc#UnauthorizedClientException":
196
- response = {
197
- ...(await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)),
198
- name: errorCode,
199
- $metadata: deserializeMetadata(output),
200
- };
201
- break;
153
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
202
154
  case "UnsupportedGrantTypeException":
203
155
  case "com.amazonaws.ssooidc#UnsupportedGrantTypeException":
204
- response = {
205
- ...(await deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse(parsedOutput, context)),
206
- name: errorCode,
207
- $metadata: deserializeMetadata(output),
208
- };
209
- break;
156
+ throw await deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse(parsedOutput, context);
210
157
  default:
211
158
  const parsedBody = parsedOutput.body;
212
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
213
- response = {
214
- ...parsedBody,
215
- name: `${errorCode}`,
216
- message: parsedBody.message || parsedBody.Message || errorCode,
159
+ response = new SSOOIDCServiceException_1.SSOOIDCServiceException({
160
+ name: parsedBody.code || parsedBody.Code || errorCode,
217
161
  $fault: "client",
218
162
  $metadata: deserializeMetadata(output),
219
- };
163
+ });
164
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
220
165
  }
221
- const message = response.message || response.Message || errorCode;
222
- response.message = message;
223
- delete response.Message;
224
- return Promise.reject(Object.assign(new Error(message), response));
225
166
  };
226
167
  const deserializeAws_restJson1RegisterClientCommand = async (output, context) => {
227
168
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -269,51 +210,25 @@ const deserializeAws_restJson1RegisterClientCommandError = async (output, contex
269
210
  switch (errorCode) {
270
211
  case "InternalServerException":
271
212
  case "com.amazonaws.ssooidc#InternalServerException":
272
- response = {
273
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
274
- name: errorCode,
275
- $metadata: deserializeMetadata(output),
276
- };
277
- break;
213
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
278
214
  case "InvalidClientMetadataException":
279
215
  case "com.amazonaws.ssooidc#InvalidClientMetadataException":
280
- response = {
281
- ...(await deserializeAws_restJson1InvalidClientMetadataExceptionResponse(parsedOutput, context)),
282
- name: errorCode,
283
- $metadata: deserializeMetadata(output),
284
- };
285
- break;
216
+ throw await deserializeAws_restJson1InvalidClientMetadataExceptionResponse(parsedOutput, context);
286
217
  case "InvalidRequestException":
287
218
  case "com.amazonaws.ssooidc#InvalidRequestException":
288
- response = {
289
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
290
- name: errorCode,
291
- $metadata: deserializeMetadata(output),
292
- };
293
- break;
219
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
294
220
  case "InvalidScopeException":
295
221
  case "com.amazonaws.ssooidc#InvalidScopeException":
296
- response = {
297
- ...(await deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context)),
298
- name: errorCode,
299
- $metadata: deserializeMetadata(output),
300
- };
301
- break;
222
+ throw await deserializeAws_restJson1InvalidScopeExceptionResponse(parsedOutput, context);
302
223
  default:
303
224
  const parsedBody = parsedOutput.body;
304
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
305
- response = {
306
- ...parsedBody,
307
- name: `${errorCode}`,
308
- message: parsedBody.message || parsedBody.Message || errorCode,
225
+ response = new SSOOIDCServiceException_1.SSOOIDCServiceException({
226
+ name: parsedBody.code || parsedBody.Code || errorCode,
309
227
  $fault: "client",
310
228
  $metadata: deserializeMetadata(output),
311
- };
229
+ });
230
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
312
231
  }
313
- const message = response.message || response.Message || errorCode;
314
- response.message = message;
315
- delete response.Message;
316
- return Promise.reject(Object.assign(new Error(message), response));
317
232
  };
318
233
  const deserializeAws_restJson1StartDeviceAuthorizationCommand = async (output, context) => {
319
234
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -361,68 +276,31 @@ const deserializeAws_restJson1StartDeviceAuthorizationCommandError = async (outp
361
276
  switch (errorCode) {
362
277
  case "InternalServerException":
363
278
  case "com.amazonaws.ssooidc#InternalServerException":
364
- response = {
365
- ...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
366
- name: errorCode,
367
- $metadata: deserializeMetadata(output),
368
- };
369
- break;
279
+ throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
370
280
  case "InvalidClientException":
371
281
  case "com.amazonaws.ssooidc#InvalidClientException":
372
- response = {
373
- ...(await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context)),
374
- name: errorCode,
375
- $metadata: deserializeMetadata(output),
376
- };
377
- break;
282
+ throw await deserializeAws_restJson1InvalidClientExceptionResponse(parsedOutput, context);
378
283
  case "InvalidRequestException":
379
284
  case "com.amazonaws.ssooidc#InvalidRequestException":
380
- response = {
381
- ...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
382
- name: errorCode,
383
- $metadata: deserializeMetadata(output),
384
- };
385
- break;
285
+ throw await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context);
386
286
  case "SlowDownException":
387
287
  case "com.amazonaws.ssooidc#SlowDownException":
388
- response = {
389
- ...(await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context)),
390
- name: errorCode,
391
- $metadata: deserializeMetadata(output),
392
- };
393
- break;
288
+ throw await deserializeAws_restJson1SlowDownExceptionResponse(parsedOutput, context);
394
289
  case "UnauthorizedClientException":
395
290
  case "com.amazonaws.ssooidc#UnauthorizedClientException":
396
- response = {
397
- ...(await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context)),
398
- name: errorCode,
399
- $metadata: deserializeMetadata(output),
400
- };
401
- break;
291
+ throw await deserializeAws_restJson1UnauthorizedClientExceptionResponse(parsedOutput, context);
402
292
  default:
403
293
  const parsedBody = parsedOutput.body;
404
- errorCode = parsedBody.code || parsedBody.Code || errorCode;
405
- response = {
406
- ...parsedBody,
407
- name: `${errorCode}`,
408
- message: parsedBody.message || parsedBody.Message || errorCode,
294
+ response = new SSOOIDCServiceException_1.SSOOIDCServiceException({
295
+ name: parsedBody.code || parsedBody.Code || errorCode,
409
296
  $fault: "client",
410
297
  $metadata: deserializeMetadata(output),
411
- };
298
+ });
299
+ throw smithy_client_1.decorateServiceException(response, parsedBody);
412
300
  }
413
- const message = response.message || response.Message || errorCode;
414
- response.message = message;
415
- delete response.Message;
416
- return Promise.reject(Object.assign(new Error(message), response));
417
301
  };
418
302
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
419
- const contents = {
420
- name: "AccessDeniedException",
421
- $fault: "client",
422
- $metadata: deserializeMetadata(parsedOutput),
423
- error: undefined,
424
- error_description: undefined,
425
- };
303
+ const contents = {};
426
304
  const data = parsedOutput.body;
427
305
  if (data.error !== undefined && data.error !== null) {
428
306
  contents.error = smithy_client_1.expectString(data.error);
@@ -430,16 +308,14 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
430
308
  if (data.error_description !== undefined && data.error_description !== null) {
431
309
  contents.error_description = smithy_client_1.expectString(data.error_description);
432
310
  }
433
- return contents;
311
+ const exception = new models_0_1.AccessDeniedException({
312
+ $metadata: deserializeMetadata(parsedOutput),
313
+ ...contents,
314
+ });
315
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
434
316
  };
435
317
  const deserializeAws_restJson1AuthorizationPendingExceptionResponse = async (parsedOutput, context) => {
436
- const contents = {
437
- name: "AuthorizationPendingException",
438
- $fault: "client",
439
- $metadata: deserializeMetadata(parsedOutput),
440
- error: undefined,
441
- error_description: undefined,
442
- };
318
+ const contents = {};
443
319
  const data = parsedOutput.body;
444
320
  if (data.error !== undefined && data.error !== null) {
445
321
  contents.error = smithy_client_1.expectString(data.error);
@@ -447,16 +323,14 @@ const deserializeAws_restJson1AuthorizationPendingExceptionResponse = async (par
447
323
  if (data.error_description !== undefined && data.error_description !== null) {
448
324
  contents.error_description = smithy_client_1.expectString(data.error_description);
449
325
  }
450
- return contents;
326
+ const exception = new models_0_1.AuthorizationPendingException({
327
+ $metadata: deserializeMetadata(parsedOutput),
328
+ ...contents,
329
+ });
330
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
451
331
  };
452
332
  const deserializeAws_restJson1ExpiredTokenExceptionResponse = async (parsedOutput, context) => {
453
- const contents = {
454
- name: "ExpiredTokenException",
455
- $fault: "client",
456
- $metadata: deserializeMetadata(parsedOutput),
457
- error: undefined,
458
- error_description: undefined,
459
- };
333
+ const contents = {};
460
334
  const data = parsedOutput.body;
461
335
  if (data.error !== undefined && data.error !== null) {
462
336
  contents.error = smithy_client_1.expectString(data.error);
@@ -464,16 +338,14 @@ const deserializeAws_restJson1ExpiredTokenExceptionResponse = async (parsedOutpu
464
338
  if (data.error_description !== undefined && data.error_description !== null) {
465
339
  contents.error_description = smithy_client_1.expectString(data.error_description);
466
340
  }
467
- return contents;
341
+ const exception = new models_0_1.ExpiredTokenException({
342
+ $metadata: deserializeMetadata(parsedOutput),
343
+ ...contents,
344
+ });
345
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
468
346
  };
469
347
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
470
- const contents = {
471
- name: "InternalServerException",
472
- $fault: "server",
473
- $metadata: deserializeMetadata(parsedOutput),
474
- error: undefined,
475
- error_description: undefined,
476
- };
348
+ const contents = {};
477
349
  const data = parsedOutput.body;
478
350
  if (data.error !== undefined && data.error !== null) {
479
351
  contents.error = smithy_client_1.expectString(data.error);
@@ -481,16 +353,14 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
481
353
  if (data.error_description !== undefined && data.error_description !== null) {
482
354
  contents.error_description = smithy_client_1.expectString(data.error_description);
483
355
  }
484
- return contents;
356
+ const exception = new models_0_1.InternalServerException({
357
+ $metadata: deserializeMetadata(parsedOutput),
358
+ ...contents,
359
+ });
360
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
485
361
  };
486
362
  const deserializeAws_restJson1InvalidClientExceptionResponse = async (parsedOutput, context) => {
487
- const contents = {
488
- name: "InvalidClientException",
489
- $fault: "client",
490
- $metadata: deserializeMetadata(parsedOutput),
491
- error: undefined,
492
- error_description: undefined,
493
- };
363
+ const contents = {};
494
364
  const data = parsedOutput.body;
495
365
  if (data.error !== undefined && data.error !== null) {
496
366
  contents.error = smithy_client_1.expectString(data.error);
@@ -498,16 +368,14 @@ const deserializeAws_restJson1InvalidClientExceptionResponse = async (parsedOutp
498
368
  if (data.error_description !== undefined && data.error_description !== null) {
499
369
  contents.error_description = smithy_client_1.expectString(data.error_description);
500
370
  }
501
- return contents;
371
+ const exception = new models_0_1.InvalidClientException({
372
+ $metadata: deserializeMetadata(parsedOutput),
373
+ ...contents,
374
+ });
375
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
502
376
  };
503
377
  const deserializeAws_restJson1InvalidClientMetadataExceptionResponse = async (parsedOutput, context) => {
504
- const contents = {
505
- name: "InvalidClientMetadataException",
506
- $fault: "client",
507
- $metadata: deserializeMetadata(parsedOutput),
508
- error: undefined,
509
- error_description: undefined,
510
- };
378
+ const contents = {};
511
379
  const data = parsedOutput.body;
512
380
  if (data.error !== undefined && data.error !== null) {
513
381
  contents.error = smithy_client_1.expectString(data.error);
@@ -515,16 +383,14 @@ const deserializeAws_restJson1InvalidClientMetadataExceptionResponse = async (pa
515
383
  if (data.error_description !== undefined && data.error_description !== null) {
516
384
  contents.error_description = smithy_client_1.expectString(data.error_description);
517
385
  }
518
- return contents;
386
+ const exception = new models_0_1.InvalidClientMetadataException({
387
+ $metadata: deserializeMetadata(parsedOutput),
388
+ ...contents,
389
+ });
390
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
519
391
  };
520
392
  const deserializeAws_restJson1InvalidGrantExceptionResponse = async (parsedOutput, context) => {
521
- const contents = {
522
- name: "InvalidGrantException",
523
- $fault: "client",
524
- $metadata: deserializeMetadata(parsedOutput),
525
- error: undefined,
526
- error_description: undefined,
527
- };
393
+ const contents = {};
528
394
  const data = parsedOutput.body;
529
395
  if (data.error !== undefined && data.error !== null) {
530
396
  contents.error = smithy_client_1.expectString(data.error);
@@ -532,16 +398,14 @@ const deserializeAws_restJson1InvalidGrantExceptionResponse = async (parsedOutpu
532
398
  if (data.error_description !== undefined && data.error_description !== null) {
533
399
  contents.error_description = smithy_client_1.expectString(data.error_description);
534
400
  }
535
- return contents;
401
+ const exception = new models_0_1.InvalidGrantException({
402
+ $metadata: deserializeMetadata(parsedOutput),
403
+ ...contents,
404
+ });
405
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
536
406
  };
537
407
  const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOutput, context) => {
538
- const contents = {
539
- name: "InvalidRequestException",
540
- $fault: "client",
541
- $metadata: deserializeMetadata(parsedOutput),
542
- error: undefined,
543
- error_description: undefined,
544
- };
408
+ const contents = {};
545
409
  const data = parsedOutput.body;
546
410
  if (data.error !== undefined && data.error !== null) {
547
411
  contents.error = smithy_client_1.expectString(data.error);
@@ -549,16 +413,14 @@ const deserializeAws_restJson1InvalidRequestExceptionResponse = async (parsedOut
549
413
  if (data.error_description !== undefined && data.error_description !== null) {
550
414
  contents.error_description = smithy_client_1.expectString(data.error_description);
551
415
  }
552
- return contents;
416
+ const exception = new models_0_1.InvalidRequestException({
417
+ $metadata: deserializeMetadata(parsedOutput),
418
+ ...contents,
419
+ });
420
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
553
421
  };
554
422
  const deserializeAws_restJson1InvalidScopeExceptionResponse = async (parsedOutput, context) => {
555
- const contents = {
556
- name: "InvalidScopeException",
557
- $fault: "client",
558
- $metadata: deserializeMetadata(parsedOutput),
559
- error: undefined,
560
- error_description: undefined,
561
- };
423
+ const contents = {};
562
424
  const data = parsedOutput.body;
563
425
  if (data.error !== undefined && data.error !== null) {
564
426
  contents.error = smithy_client_1.expectString(data.error);
@@ -566,16 +428,14 @@ const deserializeAws_restJson1InvalidScopeExceptionResponse = async (parsedOutpu
566
428
  if (data.error_description !== undefined && data.error_description !== null) {
567
429
  contents.error_description = smithy_client_1.expectString(data.error_description);
568
430
  }
569
- return contents;
431
+ const exception = new models_0_1.InvalidScopeException({
432
+ $metadata: deserializeMetadata(parsedOutput),
433
+ ...contents,
434
+ });
435
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
570
436
  };
571
437
  const deserializeAws_restJson1SlowDownExceptionResponse = async (parsedOutput, context) => {
572
- const contents = {
573
- name: "SlowDownException",
574
- $fault: "client",
575
- $metadata: deserializeMetadata(parsedOutput),
576
- error: undefined,
577
- error_description: undefined,
578
- };
438
+ const contents = {};
579
439
  const data = parsedOutput.body;
580
440
  if (data.error !== undefined && data.error !== null) {
581
441
  contents.error = smithy_client_1.expectString(data.error);
@@ -583,16 +443,14 @@ const deserializeAws_restJson1SlowDownExceptionResponse = async (parsedOutput, c
583
443
  if (data.error_description !== undefined && data.error_description !== null) {
584
444
  contents.error_description = smithy_client_1.expectString(data.error_description);
585
445
  }
586
- return contents;
446
+ const exception = new models_0_1.SlowDownException({
447
+ $metadata: deserializeMetadata(parsedOutput),
448
+ ...contents,
449
+ });
450
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
587
451
  };
588
452
  const deserializeAws_restJson1UnauthorizedClientExceptionResponse = async (parsedOutput, context) => {
589
- const contents = {
590
- name: "UnauthorizedClientException",
591
- $fault: "client",
592
- $metadata: deserializeMetadata(parsedOutput),
593
- error: undefined,
594
- error_description: undefined,
595
- };
453
+ const contents = {};
596
454
  const data = parsedOutput.body;
597
455
  if (data.error !== undefined && data.error !== null) {
598
456
  contents.error = smithy_client_1.expectString(data.error);
@@ -600,16 +458,14 @@ const deserializeAws_restJson1UnauthorizedClientExceptionResponse = async (parse
600
458
  if (data.error_description !== undefined && data.error_description !== null) {
601
459
  contents.error_description = smithy_client_1.expectString(data.error_description);
602
460
  }
603
- return contents;
461
+ const exception = new models_0_1.UnauthorizedClientException({
462
+ $metadata: deserializeMetadata(parsedOutput),
463
+ ...contents,
464
+ });
465
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
604
466
  };
605
467
  const deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse = async (parsedOutput, context) => {
606
- const contents = {
607
- name: "UnsupportedGrantTypeException",
608
- $fault: "client",
609
- $metadata: deserializeMetadata(parsedOutput),
610
- error: undefined,
611
- error_description: undefined,
612
- };
468
+ const contents = {};
613
469
  const data = parsedOutput.body;
614
470
  if (data.error !== undefined && data.error !== null) {
615
471
  contents.error = smithy_client_1.expectString(data.error);
@@ -617,7 +473,11 @@ const deserializeAws_restJson1UnsupportedGrantTypeExceptionResponse = async (par
617
473
  if (data.error_description !== undefined && data.error_description !== null) {
618
474
  contents.error_description = smithy_client_1.expectString(data.error_description);
619
475
  }
620
- return contents;
476
+ const exception = new models_0_1.UnsupportedGrantTypeException({
477
+ $metadata: deserializeMetadata(parsedOutput),
478
+ ...contents,
479
+ });
480
+ return smithy_client_1.decorateServiceException(exception, parsedOutput.body);
621
481
  };
622
482
  const serializeAws_restJson1Scopes = (input, context) => {
623
483
  return input
package/dist-es/index.js CHANGED
@@ -2,3 +2,4 @@ export * from "./SSOOIDC";
2
2
  export * from "./SSOOIDCClient";
3
3
  export * from "./commands";
4
4
  export * from "./models";
5
+ export { SSOOIDCServiceException } from "./models/SSOOIDCServiceException";
@@ -0,0 +1,12 @@
1
+ import { __extends } from "tslib";
2
+ import { ServiceException as __ServiceException, } from "@aws-sdk/smithy-client";
3
+ var SSOOIDCServiceException = (function (_super) {
4
+ __extends(SSOOIDCServiceException, _super);
5
+ function SSOOIDCServiceException(options) {
6
+ var _this = _super.call(this, options) || this;
7
+ Object.setPrototypeOf(_this, SSOOIDCServiceException.prototype);
8
+ return _this;
9
+ }
10
+ return SSOOIDCServiceException;
11
+ }(__ServiceException));
12
+ export { SSOOIDCServiceException };