@aws-sdk/client-cognito-sync 3.928.0 → 3.930.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 (38) hide show
  1. package/dist-cjs/index.js +803 -928
  2. package/dist-cjs/runtimeConfig.shared.js +2 -0
  3. package/dist-es/CognitoSyncClient.js +2 -0
  4. package/dist-es/commands/BulkPublishCommand.js +3 -9
  5. package/dist-es/commands/DeleteDatasetCommand.js +3 -9
  6. package/dist-es/commands/DescribeDatasetCommand.js +3 -9
  7. package/dist-es/commands/DescribeIdentityPoolUsageCommand.js +3 -9
  8. package/dist-es/commands/DescribeIdentityUsageCommand.js +3 -9
  9. package/dist-es/commands/GetBulkPublishDetailsCommand.js +3 -9
  10. package/dist-es/commands/GetCognitoEventsCommand.js +3 -9
  11. package/dist-es/commands/GetIdentityPoolConfigurationCommand.js +3 -9
  12. package/dist-es/commands/ListDatasetsCommand.js +3 -9
  13. package/dist-es/commands/ListIdentityPoolUsageCommand.js +3 -9
  14. package/dist-es/commands/ListRecordsCommand.js +3 -9
  15. package/dist-es/commands/RegisterDeviceCommand.js +3 -9
  16. package/dist-es/commands/SetCognitoEventsCommand.js +3 -9
  17. package/dist-es/commands/SetIdentityPoolConfigurationCommand.js +3 -9
  18. package/dist-es/commands/SubscribeToDatasetCommand.js +3 -9
  19. package/dist-es/commands/UnsubscribeFromDatasetCommand.js +3 -9
  20. package/dist-es/commands/UpdateRecordsCommand.js +3 -9
  21. package/dist-es/runtimeConfig.shared.js +2 -0
  22. package/dist-es/schemas/schemas_0.js +740 -0
  23. package/dist-types/CognitoSyncClient.d.ts +10 -1
  24. package/dist-types/runtimeConfig.browser.d.ts +1 -0
  25. package/dist-types/runtimeConfig.d.ts +1 -0
  26. package/dist-types/runtimeConfig.native.d.ts +1 -0
  27. package/dist-types/runtimeConfig.shared.d.ts +1 -0
  28. package/dist-types/schemas/schemas_0.d.ts +80 -0
  29. package/dist-types/ts3.4/CognitoSyncClient.d.ts +4 -0
  30. package/dist-types/ts3.4/runtimeConfig.browser.d.ts +4 -0
  31. package/dist-types/ts3.4/runtimeConfig.d.ts +4 -0
  32. package/dist-types/ts3.4/runtimeConfig.native.d.ts +4 -0
  33. package/dist-types/ts3.4/runtimeConfig.shared.d.ts +4 -0
  34. package/dist-types/ts3.4/schemas/schemas_0.d.ts +85 -0
  35. package/package.json +33 -33
  36. package/dist-es/protocols/Aws_restJson1.js +0 -780
  37. package/dist-types/protocols/Aws_restJson1.d.ts +0 -155
  38. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +0 -209
@@ -1,780 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, isSerializableHeaderValue, map, parseEpochTimestamp as __parseEpochTimestamp, take, withBaseException, } from "@smithy/smithy-client";
4
- import { CognitoSyncServiceException as __BaseException } from "../models/CognitoSyncServiceException";
5
- import { AlreadyStreamedException, ConcurrentModificationException, DuplicateRequestException, InternalErrorException, InvalidConfigurationException, InvalidLambdaFunctionOutputException, InvalidParameterException, LambdaThrottledException, LimitExceededException, NotAuthorizedException, ResourceConflictException, ResourceNotFoundException, TooManyRequestsException, } from "../models/models_0";
6
- export const se_BulkPublishCommand = async (input, context) => {
7
- const b = rb(input, context);
8
- const headers = {};
9
- b.bp("/identitypools/{IdentityPoolId}/bulkpublish");
10
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
11
- let body;
12
- b.m("POST").h(headers).b(body);
13
- return b.build();
14
- };
15
- export const se_DeleteDatasetCommand = async (input, context) => {
16
- const b = rb(input, context);
17
- const headers = {};
18
- b.bp("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}");
19
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
20
- b.p("IdentityId", () => input.IdentityId, "{IdentityId}", false);
21
- b.p("DatasetName", () => input.DatasetName, "{DatasetName}", false);
22
- let body;
23
- b.m("DELETE").h(headers).b(body);
24
- return b.build();
25
- };
26
- export const se_DescribeDatasetCommand = async (input, context) => {
27
- const b = rb(input, context);
28
- const headers = {};
29
- b.bp("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}");
30
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
31
- b.p("IdentityId", () => input.IdentityId, "{IdentityId}", false);
32
- b.p("DatasetName", () => input.DatasetName, "{DatasetName}", false);
33
- let body;
34
- b.m("GET").h(headers).b(body);
35
- return b.build();
36
- };
37
- export const se_DescribeIdentityPoolUsageCommand = async (input, context) => {
38
- const b = rb(input, context);
39
- const headers = {};
40
- b.bp("/identitypools/{IdentityPoolId}");
41
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
42
- let body;
43
- b.m("GET").h(headers).b(body);
44
- return b.build();
45
- };
46
- export const se_DescribeIdentityUsageCommand = async (input, context) => {
47
- const b = rb(input, context);
48
- const headers = {};
49
- b.bp("/identitypools/{IdentityPoolId}/identities/{IdentityId}");
50
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
51
- b.p("IdentityId", () => input.IdentityId, "{IdentityId}", false);
52
- let body;
53
- b.m("GET").h(headers).b(body);
54
- return b.build();
55
- };
56
- export const se_GetBulkPublishDetailsCommand = async (input, context) => {
57
- const b = rb(input, context);
58
- const headers = {};
59
- b.bp("/identitypools/{IdentityPoolId}/getBulkPublishDetails");
60
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
61
- let body;
62
- b.m("POST").h(headers).b(body);
63
- return b.build();
64
- };
65
- export const se_GetCognitoEventsCommand = async (input, context) => {
66
- const b = rb(input, context);
67
- const headers = {};
68
- b.bp("/identitypools/{IdentityPoolId}/events");
69
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
70
- let body;
71
- b.m("GET").h(headers).b(body);
72
- return b.build();
73
- };
74
- export const se_GetIdentityPoolConfigurationCommand = async (input, context) => {
75
- const b = rb(input, context);
76
- const headers = {};
77
- b.bp("/identitypools/{IdentityPoolId}/configuration");
78
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
79
- let body;
80
- b.m("GET").h(headers).b(body);
81
- return b.build();
82
- };
83
- export const se_ListDatasetsCommand = async (input, context) => {
84
- const b = rb(input, context);
85
- const headers = {};
86
- b.bp("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets");
87
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
88
- b.p("IdentityId", () => input.IdentityId, "{IdentityId}", false);
89
- const query = map({
90
- [_nT]: [, input[_NT]],
91
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
92
- });
93
- let body;
94
- b.m("GET").h(headers).q(query).b(body);
95
- return b.build();
96
- };
97
- export const se_ListIdentityPoolUsageCommand = async (input, context) => {
98
- const b = rb(input, context);
99
- const headers = {};
100
- b.bp("/identitypools");
101
- const query = map({
102
- [_nT]: [, input[_NT]],
103
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
104
- });
105
- let body;
106
- b.m("GET").h(headers).q(query).b(body);
107
- return b.build();
108
- };
109
- export const se_ListRecordsCommand = async (input, context) => {
110
- const b = rb(input, context);
111
- const headers = {};
112
- b.bp("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/records");
113
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
114
- b.p("IdentityId", () => input.IdentityId, "{IdentityId}", false);
115
- b.p("DatasetName", () => input.DatasetName, "{DatasetName}", false);
116
- const query = map({
117
- [_lSC]: [() => input.LastSyncCount !== void 0, () => input[_LSC].toString()],
118
- [_nT]: [, input[_NT]],
119
- [_mR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
120
- [_sST]: [, input[_SST]],
121
- });
122
- let body;
123
- b.m("GET").h(headers).q(query).b(body);
124
- return b.build();
125
- };
126
- export const se_RegisterDeviceCommand = async (input, context) => {
127
- const b = rb(input, context);
128
- const headers = {
129
- "content-type": "application/json",
130
- };
131
- b.bp("/identitypools/{IdentityPoolId}/identity/{IdentityId}/device");
132
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
133
- b.p("IdentityId", () => input.IdentityId, "{IdentityId}", false);
134
- let body;
135
- body = JSON.stringify(take(input, {
136
- Platform: [],
137
- Token: [],
138
- }));
139
- b.m("POST").h(headers).b(body);
140
- return b.build();
141
- };
142
- export const se_SetCognitoEventsCommand = async (input, context) => {
143
- const b = rb(input, context);
144
- const headers = {
145
- "content-type": "application/json",
146
- };
147
- b.bp("/identitypools/{IdentityPoolId}/events");
148
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
149
- let body;
150
- body = JSON.stringify(take(input, {
151
- Events: (_) => _json(_),
152
- }));
153
- b.m("POST").h(headers).b(body);
154
- return b.build();
155
- };
156
- export const se_SetIdentityPoolConfigurationCommand = async (input, context) => {
157
- const b = rb(input, context);
158
- const headers = {
159
- "content-type": "application/json",
160
- };
161
- b.bp("/identitypools/{IdentityPoolId}/configuration");
162
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
163
- let body;
164
- body = JSON.stringify(take(input, {
165
- CognitoStreams: (_) => _json(_),
166
- PushSync: (_) => _json(_),
167
- }));
168
- b.m("POST").h(headers).b(body);
169
- return b.build();
170
- };
171
- export const se_SubscribeToDatasetCommand = async (input, context) => {
172
- const b = rb(input, context);
173
- const headers = {};
174
- b.bp("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}");
175
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
176
- b.p("IdentityId", () => input.IdentityId, "{IdentityId}", false);
177
- b.p("DatasetName", () => input.DatasetName, "{DatasetName}", false);
178
- b.p("DeviceId", () => input.DeviceId, "{DeviceId}", false);
179
- let body;
180
- b.m("POST").h(headers).b(body);
181
- return b.build();
182
- };
183
- export const se_UnsubscribeFromDatasetCommand = async (input, context) => {
184
- const b = rb(input, context);
185
- const headers = {};
186
- b.bp("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}");
187
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
188
- b.p("IdentityId", () => input.IdentityId, "{IdentityId}", false);
189
- b.p("DatasetName", () => input.DatasetName, "{DatasetName}", false);
190
- b.p("DeviceId", () => input.DeviceId, "{DeviceId}", false);
191
- let body;
192
- b.m("DELETE").h(headers).b(body);
193
- return b.build();
194
- };
195
- export const se_UpdateRecordsCommand = async (input, context) => {
196
- const b = rb(input, context);
197
- const headers = map({}, isSerializableHeaderValue, {
198
- "content-type": "application/json",
199
- [_xacc]: input[_CC],
200
- });
201
- b.bp("/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}");
202
- b.p("IdentityPoolId", () => input.IdentityPoolId, "{IdentityPoolId}", false);
203
- b.p("IdentityId", () => input.IdentityId, "{IdentityId}", false);
204
- b.p("DatasetName", () => input.DatasetName, "{DatasetName}", false);
205
- let body;
206
- body = JSON.stringify(take(input, {
207
- DeviceId: [],
208
- RecordPatches: (_) => se_RecordPatchList(_, context),
209
- SyncSessionToken: [],
210
- }));
211
- b.m("POST").h(headers).b(body);
212
- return b.build();
213
- };
214
- export const de_BulkPublishCommand = async (output, context) => {
215
- if (output.statusCode !== 200 && output.statusCode >= 300) {
216
- return de_CommandError(output, context);
217
- }
218
- const contents = map({
219
- $metadata: deserializeMetadata(output),
220
- });
221
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
222
- const doc = take(data, {
223
- IdentityPoolId: __expectString,
224
- });
225
- Object.assign(contents, doc);
226
- return contents;
227
- };
228
- export const de_DeleteDatasetCommand = async (output, context) => {
229
- if (output.statusCode !== 200 && output.statusCode >= 300) {
230
- return de_CommandError(output, context);
231
- }
232
- const contents = map({
233
- $metadata: deserializeMetadata(output),
234
- });
235
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
236
- const doc = take(data, {
237
- Dataset: (_) => de_Dataset(_, context),
238
- });
239
- Object.assign(contents, doc);
240
- return contents;
241
- };
242
- export const de_DescribeDatasetCommand = async (output, context) => {
243
- if (output.statusCode !== 200 && output.statusCode >= 300) {
244
- return de_CommandError(output, context);
245
- }
246
- const contents = map({
247
- $metadata: deserializeMetadata(output),
248
- });
249
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
250
- const doc = take(data, {
251
- Dataset: (_) => de_Dataset(_, context),
252
- });
253
- Object.assign(contents, doc);
254
- return contents;
255
- };
256
- export const de_DescribeIdentityPoolUsageCommand = async (output, context) => {
257
- if (output.statusCode !== 200 && output.statusCode >= 300) {
258
- return de_CommandError(output, context);
259
- }
260
- const contents = map({
261
- $metadata: deserializeMetadata(output),
262
- });
263
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
264
- const doc = take(data, {
265
- IdentityPoolUsage: (_) => de_IdentityPoolUsage(_, context),
266
- });
267
- Object.assign(contents, doc);
268
- return contents;
269
- };
270
- export const de_DescribeIdentityUsageCommand = async (output, context) => {
271
- if (output.statusCode !== 200 && output.statusCode >= 300) {
272
- return de_CommandError(output, context);
273
- }
274
- const contents = map({
275
- $metadata: deserializeMetadata(output),
276
- });
277
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
278
- const doc = take(data, {
279
- IdentityUsage: (_) => de_IdentityUsage(_, context),
280
- });
281
- Object.assign(contents, doc);
282
- return contents;
283
- };
284
- export const de_GetBulkPublishDetailsCommand = async (output, context) => {
285
- if (output.statusCode !== 200 && output.statusCode >= 300) {
286
- return de_CommandError(output, context);
287
- }
288
- const contents = map({
289
- $metadata: deserializeMetadata(output),
290
- });
291
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
292
- const doc = take(data, {
293
- BulkPublishCompleteTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
294
- BulkPublishStartTime: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
295
- BulkPublishStatus: __expectString,
296
- FailureMessage: __expectString,
297
- IdentityPoolId: __expectString,
298
- });
299
- Object.assign(contents, doc);
300
- return contents;
301
- };
302
- export const de_GetCognitoEventsCommand = async (output, context) => {
303
- if (output.statusCode !== 200 && output.statusCode >= 300) {
304
- return de_CommandError(output, context);
305
- }
306
- const contents = map({
307
- $metadata: deserializeMetadata(output),
308
- });
309
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
310
- const doc = take(data, {
311
- Events: _json,
312
- });
313
- Object.assign(contents, doc);
314
- return contents;
315
- };
316
- export const de_GetIdentityPoolConfigurationCommand = async (output, context) => {
317
- if (output.statusCode !== 200 && output.statusCode >= 300) {
318
- return de_CommandError(output, context);
319
- }
320
- const contents = map({
321
- $metadata: deserializeMetadata(output),
322
- });
323
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
324
- const doc = take(data, {
325
- CognitoStreams: _json,
326
- IdentityPoolId: __expectString,
327
- PushSync: _json,
328
- });
329
- Object.assign(contents, doc);
330
- return contents;
331
- };
332
- export const de_ListDatasetsCommand = async (output, context) => {
333
- if (output.statusCode !== 200 && output.statusCode >= 300) {
334
- return de_CommandError(output, context);
335
- }
336
- const contents = map({
337
- $metadata: deserializeMetadata(output),
338
- });
339
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
340
- const doc = take(data, {
341
- Count: __expectInt32,
342
- Datasets: (_) => de_DatasetList(_, context),
343
- NextToken: __expectString,
344
- });
345
- Object.assign(contents, doc);
346
- return contents;
347
- };
348
- export const de_ListIdentityPoolUsageCommand = async (output, context) => {
349
- if (output.statusCode !== 200 && output.statusCode >= 300) {
350
- return de_CommandError(output, context);
351
- }
352
- const contents = map({
353
- $metadata: deserializeMetadata(output),
354
- });
355
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
356
- const doc = take(data, {
357
- Count: __expectInt32,
358
- IdentityPoolUsages: (_) => de_IdentityPoolUsageList(_, context),
359
- MaxResults: __expectInt32,
360
- NextToken: __expectString,
361
- });
362
- Object.assign(contents, doc);
363
- return contents;
364
- };
365
- export const de_ListRecordsCommand = async (output, context) => {
366
- if (output.statusCode !== 200 && output.statusCode >= 300) {
367
- return de_CommandError(output, context);
368
- }
369
- const contents = map({
370
- $metadata: deserializeMetadata(output),
371
- });
372
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
373
- const doc = take(data, {
374
- Count: __expectInt32,
375
- DatasetDeletedAfterRequestedSyncCount: __expectBoolean,
376
- DatasetExists: __expectBoolean,
377
- DatasetSyncCount: __expectLong,
378
- LastModifiedBy: __expectString,
379
- MergedDatasetNames: _json,
380
- NextToken: __expectString,
381
- Records: (_) => de_RecordList(_, context),
382
- SyncSessionToken: __expectString,
383
- });
384
- Object.assign(contents, doc);
385
- return contents;
386
- };
387
- export const de_RegisterDeviceCommand = async (output, context) => {
388
- if (output.statusCode !== 200 && output.statusCode >= 300) {
389
- return de_CommandError(output, context);
390
- }
391
- const contents = map({
392
- $metadata: deserializeMetadata(output),
393
- });
394
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
395
- const doc = take(data, {
396
- DeviceId: __expectString,
397
- });
398
- Object.assign(contents, doc);
399
- return contents;
400
- };
401
- export const de_SetCognitoEventsCommand = async (output, context) => {
402
- if (output.statusCode !== 200 && output.statusCode >= 300) {
403
- return de_CommandError(output, context);
404
- }
405
- const contents = map({
406
- $metadata: deserializeMetadata(output),
407
- });
408
- await collectBody(output.body, context);
409
- return contents;
410
- };
411
- export const de_SetIdentityPoolConfigurationCommand = async (output, context) => {
412
- if (output.statusCode !== 200 && output.statusCode >= 300) {
413
- return de_CommandError(output, context);
414
- }
415
- const contents = map({
416
- $metadata: deserializeMetadata(output),
417
- });
418
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
419
- const doc = take(data, {
420
- CognitoStreams: _json,
421
- IdentityPoolId: __expectString,
422
- PushSync: _json,
423
- });
424
- Object.assign(contents, doc);
425
- return contents;
426
- };
427
- export const de_SubscribeToDatasetCommand = async (output, context) => {
428
- if (output.statusCode !== 200 && output.statusCode >= 300) {
429
- return de_CommandError(output, context);
430
- }
431
- const contents = map({
432
- $metadata: deserializeMetadata(output),
433
- });
434
- await collectBody(output.body, context);
435
- return contents;
436
- };
437
- export const de_UnsubscribeFromDatasetCommand = async (output, context) => {
438
- if (output.statusCode !== 200 && output.statusCode >= 300) {
439
- return de_CommandError(output, context);
440
- }
441
- const contents = map({
442
- $metadata: deserializeMetadata(output),
443
- });
444
- await collectBody(output.body, context);
445
- return contents;
446
- };
447
- export const de_UpdateRecordsCommand = async (output, context) => {
448
- if (output.statusCode !== 200 && output.statusCode >= 300) {
449
- return de_CommandError(output, context);
450
- }
451
- const contents = map({
452
- $metadata: deserializeMetadata(output),
453
- });
454
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
455
- const doc = take(data, {
456
- Records: (_) => de_RecordList(_, context),
457
- });
458
- Object.assign(contents, doc);
459
- return contents;
460
- };
461
- const de_CommandError = async (output, context) => {
462
- const parsedOutput = {
463
- ...output,
464
- body: await parseErrorBody(output.body, context),
465
- };
466
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
467
- switch (errorCode) {
468
- case "AlreadyStreamedException":
469
- case "com.amazonaws.cognitosync#AlreadyStreamedException":
470
- throw await de_AlreadyStreamedExceptionRes(parsedOutput, context);
471
- case "DuplicateRequestException":
472
- case "com.amazonaws.cognitosync#DuplicateRequestException":
473
- throw await de_DuplicateRequestExceptionRes(parsedOutput, context);
474
- case "InternalErrorException":
475
- case "com.amazonaws.cognitosync#InternalErrorException":
476
- throw await de_InternalErrorExceptionRes(parsedOutput, context);
477
- case "InvalidParameterException":
478
- case "com.amazonaws.cognitosync#InvalidParameterException":
479
- throw await de_InvalidParameterExceptionRes(parsedOutput, context);
480
- case "NotAuthorizedException":
481
- case "com.amazonaws.cognitosync#NotAuthorizedException":
482
- throw await de_NotAuthorizedExceptionRes(parsedOutput, context);
483
- case "ResourceNotFoundException":
484
- case "com.amazonaws.cognitosync#ResourceNotFoundException":
485
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
486
- case "ResourceConflictException":
487
- case "com.amazonaws.cognitosync#ResourceConflictException":
488
- throw await de_ResourceConflictExceptionRes(parsedOutput, context);
489
- case "TooManyRequestsException":
490
- case "com.amazonaws.cognitosync#TooManyRequestsException":
491
- throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
492
- case "InvalidConfigurationException":
493
- case "com.amazonaws.cognitosync#InvalidConfigurationException":
494
- throw await de_InvalidConfigurationExceptionRes(parsedOutput, context);
495
- case "ConcurrentModificationException":
496
- case "com.amazonaws.cognitosync#ConcurrentModificationException":
497
- throw await de_ConcurrentModificationExceptionRes(parsedOutput, context);
498
- case "InvalidLambdaFunctionOutputException":
499
- case "com.amazonaws.cognitosync#InvalidLambdaFunctionOutputException":
500
- throw await de_InvalidLambdaFunctionOutputExceptionRes(parsedOutput, context);
501
- case "LambdaThrottledException":
502
- case "com.amazonaws.cognitosync#LambdaThrottledException":
503
- throw await de_LambdaThrottledExceptionRes(parsedOutput, context);
504
- case "LimitExceededException":
505
- case "com.amazonaws.cognitosync#LimitExceededException":
506
- throw await de_LimitExceededExceptionRes(parsedOutput, context);
507
- default:
508
- const parsedBody = parsedOutput.body;
509
- return throwDefaultError({
510
- output,
511
- parsedBody,
512
- errorCode,
513
- });
514
- }
515
- };
516
- const throwDefaultError = withBaseException(__BaseException);
517
- const de_AlreadyStreamedExceptionRes = async (parsedOutput, context) => {
518
- const contents = map({});
519
- const data = parsedOutput.body;
520
- const doc = take(data, {
521
- message: __expectString,
522
- });
523
- Object.assign(contents, doc);
524
- const exception = new AlreadyStreamedException({
525
- $metadata: deserializeMetadata(parsedOutput),
526
- ...contents,
527
- });
528
- return __decorateServiceException(exception, parsedOutput.body);
529
- };
530
- const de_ConcurrentModificationExceptionRes = async (parsedOutput, context) => {
531
- const contents = map({});
532
- const data = parsedOutput.body;
533
- const doc = take(data, {
534
- message: __expectString,
535
- });
536
- Object.assign(contents, doc);
537
- const exception = new ConcurrentModificationException({
538
- $metadata: deserializeMetadata(parsedOutput),
539
- ...contents,
540
- });
541
- return __decorateServiceException(exception, parsedOutput.body);
542
- };
543
- const de_DuplicateRequestExceptionRes = async (parsedOutput, context) => {
544
- const contents = map({});
545
- const data = parsedOutput.body;
546
- const doc = take(data, {
547
- message: __expectString,
548
- });
549
- Object.assign(contents, doc);
550
- const exception = new DuplicateRequestException({
551
- $metadata: deserializeMetadata(parsedOutput),
552
- ...contents,
553
- });
554
- return __decorateServiceException(exception, parsedOutput.body);
555
- };
556
- const de_InternalErrorExceptionRes = async (parsedOutput, context) => {
557
- const contents = map({});
558
- const data = parsedOutput.body;
559
- const doc = take(data, {
560
- message: __expectString,
561
- });
562
- Object.assign(contents, doc);
563
- const exception = new InternalErrorException({
564
- $metadata: deserializeMetadata(parsedOutput),
565
- ...contents,
566
- });
567
- return __decorateServiceException(exception, parsedOutput.body);
568
- };
569
- const de_InvalidConfigurationExceptionRes = async (parsedOutput, context) => {
570
- const contents = map({});
571
- const data = parsedOutput.body;
572
- const doc = take(data, {
573
- message: __expectString,
574
- });
575
- Object.assign(contents, doc);
576
- const exception = new InvalidConfigurationException({
577
- $metadata: deserializeMetadata(parsedOutput),
578
- ...contents,
579
- });
580
- return __decorateServiceException(exception, parsedOutput.body);
581
- };
582
- const de_InvalidLambdaFunctionOutputExceptionRes = async (parsedOutput, context) => {
583
- const contents = map({});
584
- const data = parsedOutput.body;
585
- const doc = take(data, {
586
- message: __expectString,
587
- });
588
- Object.assign(contents, doc);
589
- const exception = new InvalidLambdaFunctionOutputException({
590
- $metadata: deserializeMetadata(parsedOutput),
591
- ...contents,
592
- });
593
- return __decorateServiceException(exception, parsedOutput.body);
594
- };
595
- const de_InvalidParameterExceptionRes = async (parsedOutput, context) => {
596
- const contents = map({});
597
- const data = parsedOutput.body;
598
- const doc = take(data, {
599
- message: __expectString,
600
- });
601
- Object.assign(contents, doc);
602
- const exception = new InvalidParameterException({
603
- $metadata: deserializeMetadata(parsedOutput),
604
- ...contents,
605
- });
606
- return __decorateServiceException(exception, parsedOutput.body);
607
- };
608
- const de_LambdaThrottledExceptionRes = async (parsedOutput, context) => {
609
- const contents = map({});
610
- const data = parsedOutput.body;
611
- const doc = take(data, {
612
- message: __expectString,
613
- });
614
- Object.assign(contents, doc);
615
- const exception = new LambdaThrottledException({
616
- $metadata: deserializeMetadata(parsedOutput),
617
- ...contents,
618
- });
619
- return __decorateServiceException(exception, parsedOutput.body);
620
- };
621
- const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
622
- const contents = map({});
623
- const data = parsedOutput.body;
624
- const doc = take(data, {
625
- message: __expectString,
626
- });
627
- Object.assign(contents, doc);
628
- const exception = new LimitExceededException({
629
- $metadata: deserializeMetadata(parsedOutput),
630
- ...contents,
631
- });
632
- return __decorateServiceException(exception, parsedOutput.body);
633
- };
634
- const de_NotAuthorizedExceptionRes = async (parsedOutput, context) => {
635
- const contents = map({});
636
- const data = parsedOutput.body;
637
- const doc = take(data, {
638
- message: __expectString,
639
- });
640
- Object.assign(contents, doc);
641
- const exception = new NotAuthorizedException({
642
- $metadata: deserializeMetadata(parsedOutput),
643
- ...contents,
644
- });
645
- return __decorateServiceException(exception, parsedOutput.body);
646
- };
647
- const de_ResourceConflictExceptionRes = async (parsedOutput, context) => {
648
- const contents = map({});
649
- const data = parsedOutput.body;
650
- const doc = take(data, {
651
- message: __expectString,
652
- });
653
- Object.assign(contents, doc);
654
- const exception = new ResourceConflictException({
655
- $metadata: deserializeMetadata(parsedOutput),
656
- ...contents,
657
- });
658
- return __decorateServiceException(exception, parsedOutput.body);
659
- };
660
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
661
- const contents = map({});
662
- const data = parsedOutput.body;
663
- const doc = take(data, {
664
- message: __expectString,
665
- });
666
- Object.assign(contents, doc);
667
- const exception = new ResourceNotFoundException({
668
- $metadata: deserializeMetadata(parsedOutput),
669
- ...contents,
670
- });
671
- return __decorateServiceException(exception, parsedOutput.body);
672
- };
673
- const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
674
- const contents = map({});
675
- const data = parsedOutput.body;
676
- const doc = take(data, {
677
- message: __expectString,
678
- });
679
- Object.assign(contents, doc);
680
- const exception = new TooManyRequestsException({
681
- $metadata: deserializeMetadata(parsedOutput),
682
- ...contents,
683
- });
684
- return __decorateServiceException(exception, parsedOutput.body);
685
- };
686
- const se_RecordPatch = (input, context) => {
687
- return take(input, {
688
- DeviceLastModifiedDate: (_) => _.getTime() / 1_000,
689
- Key: [],
690
- Op: [],
691
- SyncCount: [],
692
- Value: [],
693
- });
694
- };
695
- const se_RecordPatchList = (input, context) => {
696
- return input
697
- .filter((e) => e != null)
698
- .map((entry) => {
699
- return se_RecordPatch(entry, context);
700
- });
701
- };
702
- const de_Dataset = (output, context) => {
703
- return take(output, {
704
- CreationDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
705
- DataStorage: __expectLong,
706
- DatasetName: __expectString,
707
- IdentityId: __expectString,
708
- LastModifiedBy: __expectString,
709
- LastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
710
- NumRecords: __expectLong,
711
- });
712
- };
713
- const de_DatasetList = (output, context) => {
714
- const retVal = (output || [])
715
- .filter((e) => e != null)
716
- .map((entry) => {
717
- return de_Dataset(entry, context);
718
- });
719
- return retVal;
720
- };
721
- const de_IdentityPoolUsage = (output, context) => {
722
- return take(output, {
723
- DataStorage: __expectLong,
724
- IdentityPoolId: __expectString,
725
- LastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
726
- SyncSessionsCount: __expectLong,
727
- });
728
- };
729
- const de_IdentityPoolUsageList = (output, context) => {
730
- const retVal = (output || [])
731
- .filter((e) => e != null)
732
- .map((entry) => {
733
- return de_IdentityPoolUsage(entry, context);
734
- });
735
- return retVal;
736
- };
737
- const de_IdentityUsage = (output, context) => {
738
- return take(output, {
739
- DataStorage: __expectLong,
740
- DatasetCount: __expectInt32,
741
- IdentityId: __expectString,
742
- IdentityPoolId: __expectString,
743
- LastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
744
- });
745
- };
746
- const de__Record = (output, context) => {
747
- return take(output, {
748
- DeviceLastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
749
- Key: __expectString,
750
- LastModifiedBy: __expectString,
751
- LastModifiedDate: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
752
- SyncCount: __expectLong,
753
- Value: __expectString,
754
- });
755
- };
756
- const de_RecordList = (output, context) => {
757
- const retVal = (output || [])
758
- .filter((e) => e != null)
759
- .map((entry) => {
760
- return de__Record(entry, context);
761
- });
762
- return retVal;
763
- };
764
- const deserializeMetadata = (output) => ({
765
- httpStatusCode: output.statusCode,
766
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
767
- extendedRequestId: output.headers["x-amz-id-2"],
768
- cfId: output.headers["x-amz-cf-id"],
769
- });
770
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
771
- const _CC = "ClientContext";
772
- const _LSC = "LastSyncCount";
773
- const _MR = "MaxResults";
774
- const _NT = "NextToken";
775
- const _SST = "SyncSessionToken";
776
- const _lSC = "lastSyncCount";
777
- const _mR = "maxResults";
778
- const _nT = "nextToken";
779
- const _sST = "syncSessionToken";
780
- const _xacc = "x-amz-client-context";