@aws-sdk/client-cognito-identity 3.926.0 → 3.928.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 (47) hide show
  1. package/dist-cjs/index.js +721 -882
  2. package/dist-cjs/runtimeConfig.shared.js +7 -0
  3. package/dist-es/CognitoIdentityClient.js +2 -0
  4. package/dist-es/commands/CreateIdentityPoolCommand.js +3 -9
  5. package/dist-es/commands/DeleteIdentitiesCommand.js +3 -9
  6. package/dist-es/commands/DeleteIdentityPoolCommand.js +3 -9
  7. package/dist-es/commands/DescribeIdentityCommand.js +3 -9
  8. package/dist-es/commands/DescribeIdentityPoolCommand.js +3 -9
  9. package/dist-es/commands/GetCredentialsForIdentityCommand.js +3 -10
  10. package/dist-es/commands/GetIdCommand.js +3 -10
  11. package/dist-es/commands/GetIdentityPoolRolesCommand.js +3 -9
  12. package/dist-es/commands/GetOpenIdTokenCommand.js +3 -10
  13. package/dist-es/commands/GetOpenIdTokenForDeveloperIdentityCommand.js +3 -10
  14. package/dist-es/commands/GetPrincipalTagAttributeMapCommand.js +3 -9
  15. package/dist-es/commands/ListIdentitiesCommand.js +3 -9
  16. package/dist-es/commands/ListIdentityPoolsCommand.js +3 -9
  17. package/dist-es/commands/ListTagsForResourceCommand.js +3 -9
  18. package/dist-es/commands/LookupDeveloperIdentityCommand.js +3 -9
  19. package/dist-es/commands/MergeDeveloperIdentitiesCommand.js +3 -9
  20. package/dist-es/commands/SetIdentityPoolRolesCommand.js +3 -9
  21. package/dist-es/commands/SetPrincipalTagAttributeMapCommand.js +3 -9
  22. package/dist-es/commands/TagResourceCommand.js +3 -9
  23. package/dist-es/commands/UnlinkDeveloperIdentityCommand.js +3 -9
  24. package/dist-es/commands/UnlinkIdentityCommand.js +3 -10
  25. package/dist-es/commands/UntagResourceCommand.js +3 -9
  26. package/dist-es/commands/UpdateIdentityPoolCommand.js +3 -9
  27. package/dist-es/models/models_0.js +0 -37
  28. package/dist-es/runtimeConfig.shared.js +7 -0
  29. package/dist-es/schemas/schemas_0.js +650 -0
  30. package/dist-types/CognitoIdentityClient.d.ts +10 -1
  31. package/dist-types/models/models_0.d.ts +0 -36
  32. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  33. package/dist-types/runtimeConfig.d.ts +1 -0
  34. package/dist-types/runtimeConfig.native.d.ts +1 -0
  35. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  36. package/dist-types/schemas/schemas_0.d.ts +103 -0
  37. package/dist-types/ts3.4/CognitoIdentityClient.d.ts +4 -0
  38. package/dist-types/ts3.4/models/models_0.d.ts +0 -23
  39. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  40. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  41. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  42. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  43. package/dist-types/ts3.4/schemas/schemas_0.d.ts +110 -0
  44. package/package.json +6 -6
  45. package/dist-es/protocols/Aws_json1_1.js +0 -647
  46. package/dist-types/protocols/Aws_json1_1.d.ts +0 -209
  47. package/dist-types/ts3.4/protocols/Aws_json1_1.d.ts +0 -281
@@ -1,647 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectString as __expectString, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
4
- import { CognitoIdentityServiceException as __BaseException } from "../models/CognitoIdentityServiceException";
5
- import { ConcurrentModificationException, DeveloperUserAlreadyRegisteredException, ExternalServiceException, InternalErrorException, InvalidIdentityPoolConfigurationException, InvalidParameterException, LimitExceededException, NotAuthorizedException, ResourceConflictException, ResourceNotFoundException, TooManyRequestsException, } from "../models/models_0";
6
- export const se_CreateIdentityPoolCommand = async (input, context) => {
7
- const headers = sharedHeaders("CreateIdentityPool");
8
- let body;
9
- body = JSON.stringify(_json(input));
10
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
11
- };
12
- export const se_DeleteIdentitiesCommand = async (input, context) => {
13
- const headers = sharedHeaders("DeleteIdentities");
14
- let body;
15
- body = JSON.stringify(_json(input));
16
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
17
- };
18
- export const se_DeleteIdentityPoolCommand = async (input, context) => {
19
- const headers = sharedHeaders("DeleteIdentityPool");
20
- let body;
21
- body = JSON.stringify(_json(input));
22
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
23
- };
24
- export const se_DescribeIdentityCommand = async (input, context) => {
25
- const headers = sharedHeaders("DescribeIdentity");
26
- let body;
27
- body = JSON.stringify(_json(input));
28
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
29
- };
30
- export const se_DescribeIdentityPoolCommand = async (input, context) => {
31
- const headers = sharedHeaders("DescribeIdentityPool");
32
- let body;
33
- body = JSON.stringify(_json(input));
34
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
35
- };
36
- export const se_GetCredentialsForIdentityCommand = async (input, context) => {
37
- const headers = sharedHeaders("GetCredentialsForIdentity");
38
- let body;
39
- body = JSON.stringify(_json(input));
40
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
41
- };
42
- export const se_GetIdCommand = async (input, context) => {
43
- const headers = sharedHeaders("GetId");
44
- let body;
45
- body = JSON.stringify(_json(input));
46
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
47
- };
48
- export const se_GetIdentityPoolRolesCommand = async (input, context) => {
49
- const headers = sharedHeaders("GetIdentityPoolRoles");
50
- let body;
51
- body = JSON.stringify(_json(input));
52
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
53
- };
54
- export const se_GetOpenIdTokenCommand = async (input, context) => {
55
- const headers = sharedHeaders("GetOpenIdToken");
56
- let body;
57
- body = JSON.stringify(_json(input));
58
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
59
- };
60
- export const se_GetOpenIdTokenForDeveloperIdentityCommand = async (input, context) => {
61
- const headers = sharedHeaders("GetOpenIdTokenForDeveloperIdentity");
62
- let body;
63
- body = JSON.stringify(_json(input));
64
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
65
- };
66
- export const se_GetPrincipalTagAttributeMapCommand = async (input, context) => {
67
- const headers = sharedHeaders("GetPrincipalTagAttributeMap");
68
- let body;
69
- body = JSON.stringify(_json(input));
70
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
71
- };
72
- export const se_ListIdentitiesCommand = async (input, context) => {
73
- const headers = sharedHeaders("ListIdentities");
74
- let body;
75
- body = JSON.stringify(_json(input));
76
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
77
- };
78
- export const se_ListIdentityPoolsCommand = async (input, context) => {
79
- const headers = sharedHeaders("ListIdentityPools");
80
- let body;
81
- body = JSON.stringify(_json(input));
82
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
83
- };
84
- export const se_ListTagsForResourceCommand = async (input, context) => {
85
- const headers = sharedHeaders("ListTagsForResource");
86
- let body;
87
- body = JSON.stringify(_json(input));
88
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
89
- };
90
- export const se_LookupDeveloperIdentityCommand = async (input, context) => {
91
- const headers = sharedHeaders("LookupDeveloperIdentity");
92
- let body;
93
- body = JSON.stringify(_json(input));
94
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
95
- };
96
- export const se_MergeDeveloperIdentitiesCommand = async (input, context) => {
97
- const headers = sharedHeaders("MergeDeveloperIdentities");
98
- let body;
99
- body = JSON.stringify(_json(input));
100
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
101
- };
102
- export const se_SetIdentityPoolRolesCommand = async (input, context) => {
103
- const headers = sharedHeaders("SetIdentityPoolRoles");
104
- let body;
105
- body = JSON.stringify(_json(input));
106
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
107
- };
108
- export const se_SetPrincipalTagAttributeMapCommand = async (input, context) => {
109
- const headers = sharedHeaders("SetPrincipalTagAttributeMap");
110
- let body;
111
- body = JSON.stringify(_json(input));
112
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
113
- };
114
- export const se_TagResourceCommand = async (input, context) => {
115
- const headers = sharedHeaders("TagResource");
116
- let body;
117
- body = JSON.stringify(_json(input));
118
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
119
- };
120
- export const se_UnlinkDeveloperIdentityCommand = async (input, context) => {
121
- const headers = sharedHeaders("UnlinkDeveloperIdentity");
122
- let body;
123
- body = JSON.stringify(_json(input));
124
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
125
- };
126
- export const se_UnlinkIdentityCommand = async (input, context) => {
127
- const headers = sharedHeaders("UnlinkIdentity");
128
- let body;
129
- body = JSON.stringify(_json(input));
130
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
131
- };
132
- export const se_UntagResourceCommand = async (input, context) => {
133
- const headers = sharedHeaders("UntagResource");
134
- let body;
135
- body = JSON.stringify(_json(input));
136
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
137
- };
138
- export const se_UpdateIdentityPoolCommand = async (input, context) => {
139
- const headers = sharedHeaders("UpdateIdentityPool");
140
- let body;
141
- body = JSON.stringify(_json(input));
142
- return buildHttpRpcRequest(context, headers, "/", undefined, body);
143
- };
144
- export const de_CreateIdentityPoolCommand = async (output, context) => {
145
- if (output.statusCode >= 300) {
146
- return de_CommandError(output, context);
147
- }
148
- const data = await parseBody(output.body, context);
149
- let contents = {};
150
- contents = _json(data);
151
- const response = {
152
- $metadata: deserializeMetadata(output),
153
- ...contents,
154
- };
155
- return response;
156
- };
157
- export const de_DeleteIdentitiesCommand = async (output, context) => {
158
- if (output.statusCode >= 300) {
159
- return de_CommandError(output, context);
160
- }
161
- const data = await parseBody(output.body, context);
162
- let contents = {};
163
- contents = _json(data);
164
- const response = {
165
- $metadata: deserializeMetadata(output),
166
- ...contents,
167
- };
168
- return response;
169
- };
170
- export const de_DeleteIdentityPoolCommand = async (output, context) => {
171
- if (output.statusCode >= 300) {
172
- return de_CommandError(output, context);
173
- }
174
- await collectBody(output.body, context);
175
- const response = {
176
- $metadata: deserializeMetadata(output),
177
- };
178
- return response;
179
- };
180
- export const de_DescribeIdentityCommand = async (output, context) => {
181
- if (output.statusCode >= 300) {
182
- return de_CommandError(output, context);
183
- }
184
- const data = await parseBody(output.body, context);
185
- let contents = {};
186
- contents = de_IdentityDescription(data, context);
187
- const response = {
188
- $metadata: deserializeMetadata(output),
189
- ...contents,
190
- };
191
- return response;
192
- };
193
- export const de_DescribeIdentityPoolCommand = async (output, context) => {
194
- if (output.statusCode >= 300) {
195
- return de_CommandError(output, context);
196
- }
197
- const data = await parseBody(output.body, context);
198
- let contents = {};
199
- contents = _json(data);
200
- const response = {
201
- $metadata: deserializeMetadata(output),
202
- ...contents,
203
- };
204
- return response;
205
- };
206
- export const de_GetCredentialsForIdentityCommand = async (output, context) => {
207
- if (output.statusCode >= 300) {
208
- return de_CommandError(output, context);
209
- }
210
- const data = await parseBody(output.body, context);
211
- let contents = {};
212
- contents = de_GetCredentialsForIdentityResponse(data, context);
213
- const response = {
214
- $metadata: deserializeMetadata(output),
215
- ...contents,
216
- };
217
- return response;
218
- };
219
- export const de_GetIdCommand = async (output, context) => {
220
- if (output.statusCode >= 300) {
221
- return de_CommandError(output, context);
222
- }
223
- const data = await parseBody(output.body, context);
224
- let contents = {};
225
- contents = _json(data);
226
- const response = {
227
- $metadata: deserializeMetadata(output),
228
- ...contents,
229
- };
230
- return response;
231
- };
232
- export const de_GetIdentityPoolRolesCommand = async (output, context) => {
233
- if (output.statusCode >= 300) {
234
- return de_CommandError(output, context);
235
- }
236
- const data = await parseBody(output.body, context);
237
- let contents = {};
238
- contents = _json(data);
239
- const response = {
240
- $metadata: deserializeMetadata(output),
241
- ...contents,
242
- };
243
- return response;
244
- };
245
- export const de_GetOpenIdTokenCommand = async (output, context) => {
246
- if (output.statusCode >= 300) {
247
- return de_CommandError(output, context);
248
- }
249
- const data = await parseBody(output.body, context);
250
- let contents = {};
251
- contents = _json(data);
252
- const response = {
253
- $metadata: deserializeMetadata(output),
254
- ...contents,
255
- };
256
- return response;
257
- };
258
- export const de_GetOpenIdTokenForDeveloperIdentityCommand = async (output, context) => {
259
- if (output.statusCode >= 300) {
260
- return de_CommandError(output, context);
261
- }
262
- const data = await parseBody(output.body, context);
263
- let contents = {};
264
- contents = _json(data);
265
- const response = {
266
- $metadata: deserializeMetadata(output),
267
- ...contents,
268
- };
269
- return response;
270
- };
271
- export const de_GetPrincipalTagAttributeMapCommand = async (output, context) => {
272
- if (output.statusCode >= 300) {
273
- return de_CommandError(output, context);
274
- }
275
- const data = await parseBody(output.body, context);
276
- let contents = {};
277
- contents = _json(data);
278
- const response = {
279
- $metadata: deserializeMetadata(output),
280
- ...contents,
281
- };
282
- return response;
283
- };
284
- export const de_ListIdentitiesCommand = async (output, context) => {
285
- if (output.statusCode >= 300) {
286
- return de_CommandError(output, context);
287
- }
288
- const data = await parseBody(output.body, context);
289
- let contents = {};
290
- contents = de_ListIdentitiesResponse(data, context);
291
- const response = {
292
- $metadata: deserializeMetadata(output),
293
- ...contents,
294
- };
295
- return response;
296
- };
297
- export const de_ListIdentityPoolsCommand = async (output, context) => {
298
- if (output.statusCode >= 300) {
299
- return de_CommandError(output, context);
300
- }
301
- const data = await parseBody(output.body, context);
302
- let contents = {};
303
- contents = _json(data);
304
- const response = {
305
- $metadata: deserializeMetadata(output),
306
- ...contents,
307
- };
308
- return response;
309
- };
310
- export const de_ListTagsForResourceCommand = async (output, context) => {
311
- if (output.statusCode >= 300) {
312
- return de_CommandError(output, context);
313
- }
314
- const data = await parseBody(output.body, context);
315
- let contents = {};
316
- contents = _json(data);
317
- const response = {
318
- $metadata: deserializeMetadata(output),
319
- ...contents,
320
- };
321
- return response;
322
- };
323
- export const de_LookupDeveloperIdentityCommand = async (output, context) => {
324
- if (output.statusCode >= 300) {
325
- return de_CommandError(output, context);
326
- }
327
- const data = await parseBody(output.body, context);
328
- let contents = {};
329
- contents = _json(data);
330
- const response = {
331
- $metadata: deserializeMetadata(output),
332
- ...contents,
333
- };
334
- return response;
335
- };
336
- export const de_MergeDeveloperIdentitiesCommand = async (output, context) => {
337
- if (output.statusCode >= 300) {
338
- return de_CommandError(output, context);
339
- }
340
- const data = await parseBody(output.body, context);
341
- let contents = {};
342
- contents = _json(data);
343
- const response = {
344
- $metadata: deserializeMetadata(output),
345
- ...contents,
346
- };
347
- return response;
348
- };
349
- export const de_SetIdentityPoolRolesCommand = async (output, context) => {
350
- if (output.statusCode >= 300) {
351
- return de_CommandError(output, context);
352
- }
353
- await collectBody(output.body, context);
354
- const response = {
355
- $metadata: deserializeMetadata(output),
356
- };
357
- return response;
358
- };
359
- export const de_SetPrincipalTagAttributeMapCommand = async (output, context) => {
360
- if (output.statusCode >= 300) {
361
- return de_CommandError(output, context);
362
- }
363
- const data = await parseBody(output.body, context);
364
- let contents = {};
365
- contents = _json(data);
366
- const response = {
367
- $metadata: deserializeMetadata(output),
368
- ...contents,
369
- };
370
- return response;
371
- };
372
- export const de_TagResourceCommand = async (output, context) => {
373
- if (output.statusCode >= 300) {
374
- return de_CommandError(output, context);
375
- }
376
- const data = await parseBody(output.body, context);
377
- let contents = {};
378
- contents = _json(data);
379
- const response = {
380
- $metadata: deserializeMetadata(output),
381
- ...contents,
382
- };
383
- return response;
384
- };
385
- export const de_UnlinkDeveloperIdentityCommand = async (output, context) => {
386
- if (output.statusCode >= 300) {
387
- return de_CommandError(output, context);
388
- }
389
- await collectBody(output.body, context);
390
- const response = {
391
- $metadata: deserializeMetadata(output),
392
- };
393
- return response;
394
- };
395
- export const de_UnlinkIdentityCommand = async (output, context) => {
396
- if (output.statusCode >= 300) {
397
- return de_CommandError(output, context);
398
- }
399
- await collectBody(output.body, context);
400
- const response = {
401
- $metadata: deserializeMetadata(output),
402
- };
403
- return response;
404
- };
405
- export const de_UntagResourceCommand = async (output, context) => {
406
- if (output.statusCode >= 300) {
407
- return de_CommandError(output, context);
408
- }
409
- const data = await parseBody(output.body, context);
410
- let contents = {};
411
- contents = _json(data);
412
- const response = {
413
- $metadata: deserializeMetadata(output),
414
- ...contents,
415
- };
416
- return response;
417
- };
418
- export const de_UpdateIdentityPoolCommand = async (output, context) => {
419
- if (output.statusCode >= 300) {
420
- return de_CommandError(output, context);
421
- }
422
- const data = await parseBody(output.body, context);
423
- let contents = {};
424
- contents = _json(data);
425
- const response = {
426
- $metadata: deserializeMetadata(output),
427
- ...contents,
428
- };
429
- return response;
430
- };
431
- const de_CommandError = async (output, context) => {
432
- const parsedOutput = {
433
- ...output,
434
- body: await parseErrorBody(output.body, context),
435
- };
436
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
437
- switch (errorCode) {
438
- case "InternalErrorException":
439
- case "com.amazonaws.cognitoidentity#InternalErrorException":
440
- throw await de_InternalErrorExceptionRes(parsedOutput, context);
441
- case "InvalidParameterException":
442
- case "com.amazonaws.cognitoidentity#InvalidParameterException":
443
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
444
- case "LimitExceededException":
445
- case "com.amazonaws.cognitoidentity#LimitExceededException":
446
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
447
- case "NotAuthorizedException":
448
- case "com.amazonaws.cognitoidentity#NotAuthorizedException":
449
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
450
- case "ResourceConflictException":
451
- case "com.amazonaws.cognitoidentity#ResourceConflictException":
452
- throw await de_ResourceConflictExceptionRes(parsedOutput, context);
453
- case "TooManyRequestsException":
454
- case "com.amazonaws.cognitoidentity#TooManyRequestsException":
455
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
456
- case "ResourceNotFoundException":
457
- case "com.amazonaws.cognitoidentity#ResourceNotFoundException":
458
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
459
- case "ExternalServiceException":
460
- case "com.amazonaws.cognitoidentity#ExternalServiceException":
461
- throw await de_ExternalServiceExceptionRes(parsedOutput, context);
462
- case "InvalidIdentityPoolConfigurationException":
463
- case "com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":
464
- throw await de_InvalidIdentityPoolConfigurationExceptionRes(parsedOutput, context);
465
- case "DeveloperUserAlreadyRegisteredException":
466
- case "com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException":
467
- throw await de_DeveloperUserAlreadyRegisteredExceptionRes(parsedOutput, context);
468
- case "ConcurrentModificationException":
469
- case "com.amazonaws.cognitoidentity#ConcurrentModificationException":
470
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
471
- default:
472
- const parsedBody = parsedOutput.body;
473
- return throwDefaultError({
474
- output,
475
- parsedBody,
476
- errorCode,
477
- });
478
- }
479
- };
480
- const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
481
- const body = parsedOutput.body;
482
- const deserialized = _json(body);
483
- const exception = new ConcurrentModificationException({
484
- $metadata: deserializeMetadata(parsedOutput),
485
- ...deserialized,
486
- });
487
- return __decorateServiceException(exception, body);
488
- };
489
- const de_DeveloperUserAlreadyRegisteredExceptionRes = async (parsedOutput, context) => {
490
- const body = parsedOutput.body;
491
- const deserialized = _json(body);
492
- const exception = new DeveloperUserAlreadyRegisteredException({
493
- $metadata: deserializeMetadata(parsedOutput),
494
- ...deserialized,
495
- });
496
- return __decorateServiceException(exception, body);
497
- };
498
- const de_ExternalServiceExceptionRes = async (parsedOutput, context) => {
499
- const body = parsedOutput.body;
500
- const deserialized = _json(body);
501
- const exception = new ExternalServiceException({
502
- $metadata: deserializeMetadata(parsedOutput),
503
- ...deserialized,
504
- });
505
- return __decorateServiceException(exception, body);
506
- };
507
- const de_InternalErrorExceptionRes = async (parsedOutput, context) => {
508
- const body = parsedOutput.body;
509
- const deserialized = _json(body);
510
- const exception = new InternalErrorException({
511
- $metadata: deserializeMetadata(parsedOutput),
512
- ...deserialized,
513
- });
514
- return __decorateServiceException(exception, body);
515
- };
516
- const de_InvalidIdentityPoolConfigurationExceptionRes = async (parsedOutput, context) => {
517
- const body = parsedOutput.body;
518
- const deserialized = _json(body);
519
- const exception = new InvalidIdentityPoolConfigurationException({
520
- $metadata: deserializeMetadata(parsedOutput),
521
- ...deserialized,
522
- });
523
- return __decorateServiceException(exception, body);
524
- };
525
- const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
526
- const body = parsedOutput.body;
527
- const deserialized = _json(body);
528
- const exception = new InvalidParameterException({
529
- $metadata: deserializeMetadata(parsedOutput),
530
- ...deserialized,
531
- });
532
- return __decorateServiceException(exception, body);
533
- };
534
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
535
- const body = parsedOutput.body;
536
- const deserialized = _json(body);
537
- const exception = new LimitExceededException({
538
- $metadata: deserializeMetadata(parsedOutput),
539
- ...deserialized,
540
- });
541
- return __decorateServiceException(exception, body);
542
- };
543
- const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
544
- const body = parsedOutput.body;
545
- const deserialized = _json(body);
546
- const exception = new NotAuthorizedException({
547
- $metadata: deserializeMetadata(parsedOutput),
548
- ...deserialized,
549
- });
550
- return __decorateServiceException(exception, body);
551
- };
552
- const de_ResourceConflictExceptionRes = async (parsedOutput, context) => {
553
- const body = parsedOutput.body;
554
- const deserialized = _json(body);
555
- const exception = new ResourceConflictException({
556
- $metadata: deserializeMetadata(parsedOutput),
557
- ...deserialized,
558
- });
559
- return __decorateServiceException(exception, body);
560
- };
561
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
562
- const body = parsedOutput.body;
563
- const deserialized = _json(body);
564
- const exception = new ResourceNotFoundException({
565
- $metadata: deserializeMetadata(parsedOutput),
566
- ...deserialized,
567
- });
568
- return __decorateServiceException(exception, body);
569
- };
570
- const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
571
- const body = parsedOutput.body;
572
- const deserialized = _json(body);
573
- const exception = new TooManyRequestsException({
574
- $metadata: deserializeMetadata(parsedOutput),
575
- ...deserialized,
576
- });
577
- return __decorateServiceException(exception, body);
578
- };
579
- const de_Credentials = (output, context) => {
580
- return take(output, {
581
- AccessKeyId: __expectString,
582
- Expiration: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
583
- SecretKey: __expectString,
584
- SessionToken: __expectString,
585
- });
586
- };
587
- const de_GetCredentialsForIdentityResponse = (output, context) => {
588
- return take(output, {
589
- Credentials: (_) => de_Credentials(_, context),
590
- IdentityId: __expectString,
591
- });
592
- };
593
- const de_IdentitiesList = (output, context) => {
594
- const retVal = (output || [])
595
- .filter((e) => e != null)
596
- .map((entry) => {
597
- return de_IdentityDescription(entry, context);
598
- });
599
- return retVal;
600
- };
601
- const de_IdentityDescription = (output, context) => {
602
- return take(output, {
603
- CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
604
- IdentityId: __expectString,
605
- LastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
606
- Logins: _json,
607
- });
608
- };
609
- const de_ListIdentitiesResponse = (output, context) => {
610
- return take(output, {
611
- Identities: (_) => de_IdentitiesList(_, context),
612
- IdentityPoolId: __expectString,
613
- NextToken: __expectString,
614
- });
615
- };
616
- const deserializeMetadata = (output) => ({
617
- httpStatusCode: output.statusCode,
618
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
619
- extendedRequestId: output.headers["x-amz-id-2"],
620
- cfId: output.headers["x-amz-cf-id"],
621
- });
622
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
623
- const throwDefaultError = withBaseException(__BaseException);
624
- const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
625
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
626
- const contents = {
627
- protocol,
628
- hostname,
629
- port,
630
- method: "POST",
631
- path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
632
- headers,
633
- };
634
- if (resolvedHostname !== undefined) {
635
- contents.hostname = resolvedHostname;
636
- }
637
- if (body !== undefined) {
638
- contents.body = body;
639
- }
640
- return new __HttpRequest(contents);
641
- };
642
- function sharedHeaders(operation) {
643
- return {
644
- "content-type": "application/x-amz-json-1.1",
645
- "x-amz-target": `AWSCognitoIdentityService.${operation}`,
646
- };
647
- }