@aws-sdk/client-cognito-sync 3.34.0 → 3.37.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.
- package/CHANGELOG.md +47 -0
- package/{dist/cjs → dist-cjs}/CognitoSync.js +0 -16
- package/dist-cjs/CognitoSyncClient.js +35 -0
- package/{dist/cjs → dist-cjs}/commands/BulkPublishCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/DeleteDatasetCommand.js +2 -31
- package/{dist/cjs → dist-cjs}/commands/DescribeDatasetCommand.js +2 -30
- package/dist-cjs/commands/DescribeIdentityPoolUsageCommand.js +36 -0
- package/dist-cjs/commands/DescribeIdentityUsageCommand.js +36 -0
- package/{dist/cjs → dist-cjs}/commands/GetBulkPublishDetailsCommand.js +2 -27
- package/{dist/cjs → dist-cjs}/commands/GetCognitoEventsCommand.js +2 -27
- package/dist-cjs/commands/GetIdentityPoolConfigurationCommand.js +36 -0
- package/dist-cjs/commands/ListDatasetsCommand.js +36 -0
- package/dist-cjs/commands/ListIdentityPoolUsageCommand.js +36 -0
- package/dist-cjs/commands/ListRecordsCommand.js +36 -0
- package/dist-cjs/commands/RegisterDeviceCommand.js +36 -0
- package/{dist/cjs → dist-cjs}/commands/SetCognitoEventsCommand.js +2 -27
- package/dist-cjs/commands/SetIdentityPoolConfigurationCommand.js +36 -0
- package/dist-cjs/commands/SubscribeToDatasetCommand.js +36 -0
- package/dist-cjs/commands/UnsubscribeFromDatasetCommand.js +36 -0
- package/dist-cjs/commands/UpdateRecordsCommand.js +36 -0
- package/{dist/cjs → dist-cjs}/endpoints.js +1 -2
- package/{dist/cjs → dist-cjs}/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/index.js +0 -1
- package/{dist/cjs → dist-cjs}/models/models_0.js +0 -160
- package/{dist/cjs → dist-cjs}/protocols/Aws_restJson1.js +1 -7
- package/{dist/cjs → dist-cjs}/runtimeConfig.browser.js +1 -5
- package/{dist/cjs → dist-cjs}/runtimeConfig.js +1 -5
- package/{dist/cjs → dist-cjs}/runtimeConfig.native.js +0 -4
- package/{dist/cjs → dist-cjs}/runtimeConfig.shared.js +1 -5
- package/{dist/es → dist-es}/CognitoSync.js +0 -1
- package/{dist/es → dist-es}/CognitoSyncClient.js +1 -2
- package/{dist/es → dist-es}/commands/BulkPublishCommand.js +2 -3
- package/{dist/es → dist-es}/commands/DeleteDatasetCommand.js +2 -3
- package/{dist/es → dist-es}/commands/DescribeDatasetCommand.js +2 -3
- package/{dist/es → dist-es}/commands/DescribeIdentityPoolUsageCommand.js +2 -3
- package/{dist/es → dist-es}/commands/DescribeIdentityUsageCommand.js +2 -3
- package/{dist/es → dist-es}/commands/GetBulkPublishDetailsCommand.js +2 -3
- package/{dist/es → dist-es}/commands/GetCognitoEventsCommand.js +2 -3
- package/{dist/es → dist-es}/commands/GetIdentityPoolConfigurationCommand.js +2 -3
- package/{dist/es → dist-es}/commands/ListDatasetsCommand.js +2 -3
- package/{dist/es → dist-es}/commands/ListIdentityPoolUsageCommand.js +2 -3
- package/{dist/es → dist-es}/commands/ListRecordsCommand.js +2 -3
- package/{dist/es → dist-es}/commands/RegisterDeviceCommand.js +2 -3
- package/{dist/es → dist-es}/commands/SetCognitoEventsCommand.js +2 -3
- package/{dist/es → dist-es}/commands/SetIdentityPoolConfigurationCommand.js +2 -3
- package/{dist/es → dist-es}/commands/SubscribeToDatasetCommand.js +2 -3
- package/{dist/es → dist-es}/commands/UnsubscribeFromDatasetCommand.js +2 -3
- package/{dist/es → dist-es}/commands/UpdateRecordsCommand.js +2 -3
- package/{dist/es → dist-es}/endpoints.js +1 -2
- package/{dist/types/index.d.ts → dist-es/index.js} +0 -0
- package/{dist/types/models/index.d.ts → dist-es/models/index.js} +0 -0
- package/{dist/es → dist-es}/models/models_0.js +0 -1
- package/{dist/es → dist-es}/protocols/Aws_restJson1.js +0 -1
- package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -2
- package/{dist/es → dist-es}/runtimeConfig.js +1 -2
- package/{dist/es → dist-es}/runtimeConfig.native.js +0 -1
- package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -2
- package/{dist/types → dist-types}/CognitoSync.d.ts +1 -1
- package/{dist/types → dist-types}/CognitoSyncClient.d.ts +8 -8
- package/{dist/types → dist-types}/commands/BulkPublishCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/DeleteDatasetCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/DescribeDatasetCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/DescribeIdentityPoolUsageCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/DescribeIdentityUsageCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/GetBulkPublishDetailsCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/GetCognitoEventsCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/GetIdentityPoolConfigurationCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/ListDatasetsCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/ListIdentityPoolUsageCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/ListRecordsCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/RegisterDeviceCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/SetCognitoEventsCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/SetIdentityPoolConfigurationCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/SubscribeToDatasetCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/UnsubscribeFromDatasetCommand.d.ts +2 -2
- package/{dist/types → dist-types}/commands/UpdateRecordsCommand.d.ts +2 -2
- package/{dist/types → dist-types}/endpoints.d.ts +0 -0
- package/{index.ts → dist-types/index.d.ts} +0 -0
- package/{models/index.ts → dist-types/models/index.d.ts} +0 -0
- package/{dist/types → dist-types}/models/models_0.d.ts +0 -0
- package/{dist/types → dist-types}/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.d.ts +1 -1
- package/{dist/types → dist-types}/runtimeConfig.native.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.shared.d.ts +0 -0
- package/dist-types/ts3.4/CognitoSync.d.ts +90 -0
- package/{dist/types → dist-types}/ts3.4/CognitoSyncClient.d.ts +32 -109
- package/dist-types/ts3.4/commands/BulkPublishCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DeleteDatasetCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DescribeDatasetCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DescribeIdentityPoolUsageCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DescribeIdentityUsageCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetBulkPublishDetailsCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetCognitoEventsCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetIdentityPoolConfigurationCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListDatasetsCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListIdentityPoolUsageCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/ListRecordsCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/RegisterDeviceCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/SetCognitoEventsCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/SetIdentityPoolConfigurationCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/SubscribeToDatasetCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UnsubscribeFromDatasetCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/UpdateRecordsCommand.d.ts +17 -0
- package/{dist/types → dist-types}/ts3.4/endpoints.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/index.d.ts +0 -0
- package/{dist/types → dist-types}/ts3.4/models/index.d.ts +0 -0
- package/dist-types/ts3.4/models/models_0.d.ts +670 -0
- package/{dist/types → dist-types}/ts3.4/protocols/Aws_restJson1.d.ts +2 -2
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.browser.d.ts +1 -3
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.d.ts +2 -4
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.native.d.ts +1 -3
- package/{dist/types → dist-types}/ts3.4/runtimeConfig.shared.d.ts +1 -3
- package/package.json +45 -42
- package/CognitoSync.ts +0 -1129
- package/CognitoSyncClient.ts +0 -319
- package/commands/BulkPublishCommand.ts +0 -94
- package/commands/DeleteDatasetCommand.ts +0 -98
- package/commands/DescribeDatasetCommand.ts +0 -97
- package/commands/DescribeIdentityPoolUsageCommand.ts +0 -145
- package/commands/DescribeIdentityUsageCommand.ts +0 -143
- package/commands/GetBulkPublishDetailsCommand.ts +0 -94
- package/commands/GetCognitoEventsCommand.ts +0 -94
- package/commands/GetIdentityPoolConfigurationCommand.ts +0 -145
- package/commands/ListDatasetsCommand.ts +0 -152
- package/commands/ListIdentityPoolUsageCommand.ts +0 -152
- package/commands/ListRecordsCommand.ts +0 -149
- package/commands/RegisterDeviceCommand.ts +0 -138
- package/commands/SetCognitoEventsCommand.ts +0 -94
- package/commands/SetIdentityPoolConfigurationCommand.ts +0 -149
- package/commands/SubscribeToDatasetCommand.ts +0 -137
- package/commands/UnsubscribeFromDatasetCommand.ts +0 -138
- package/commands/UpdateRecordsCommand.ts +0 -96
- package/dist/cjs/CognitoSync.js.map +0 -1
- package/dist/cjs/CognitoSyncClient.js +0 -56
- package/dist/cjs/CognitoSyncClient.js.map +0 -1
- package/dist/cjs/commands/BulkPublishCommand.js.map +0 -1
- package/dist/cjs/commands/DeleteDatasetCommand.js.map +0 -1
- package/dist/cjs/commands/DescribeDatasetCommand.js.map +0 -1
- package/dist/cjs/commands/DescribeIdentityPoolUsageCommand.js +0 -109
- package/dist/cjs/commands/DescribeIdentityPoolUsageCommand.js.map +0 -1
- package/dist/cjs/commands/DescribeIdentityUsageCommand.js +0 -110
- package/dist/cjs/commands/DescribeIdentityUsageCommand.js.map +0 -1
- package/dist/cjs/commands/GetBulkPublishDetailsCommand.js.map +0 -1
- package/dist/cjs/commands/GetCognitoEventsCommand.js.map +0 -1
- package/dist/cjs/commands/GetIdentityPoolConfigurationCommand.js +0 -107
- package/dist/cjs/commands/GetIdentityPoolConfigurationCommand.js.map +0 -1
- package/dist/cjs/commands/ListDatasetsCommand.js +0 -119
- package/dist/cjs/commands/ListDatasetsCommand.js.map +0 -1
- package/dist/cjs/commands/ListIdentityPoolUsageCommand.js +0 -119
- package/dist/cjs/commands/ListIdentityPoolUsageCommand.js.map +0 -1
- package/dist/cjs/commands/ListRecordsCommand.js +0 -116
- package/dist/cjs/commands/ListRecordsCommand.js.map +0 -1
- package/dist/cjs/commands/RegisterDeviceCommand.js +0 -105
- package/dist/cjs/commands/RegisterDeviceCommand.js.map +0 -1
- package/dist/cjs/commands/SetCognitoEventsCommand.js.map +0 -1
- package/dist/cjs/commands/SetIdentityPoolConfigurationCommand.js +0 -111
- package/dist/cjs/commands/SetIdentityPoolConfigurationCommand.js.map +0 -1
- package/dist/cjs/commands/SubscribeToDatasetCommand.js +0 -104
- package/dist/cjs/commands/SubscribeToDatasetCommand.js.map +0 -1
- package/dist/cjs/commands/UnsubscribeFromDatasetCommand.js +0 -105
- package/dist/cjs/commands/UnsubscribeFromDatasetCommand.js.map +0 -1
- package/dist/cjs/commands/UpdateRecordsCommand.js +0 -63
- package/dist/cjs/commands/UpdateRecordsCommand.js.map +0 -1
- package/dist/cjs/endpoints.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/models/index.js.map +0 -1
- package/dist/cjs/models/models_0.js.map +0 -1
- package/dist/cjs/package.json +0 -91
- package/dist/cjs/protocols/Aws_restJson1.js.map +0 -1
- package/dist/cjs/runtimeConfig.browser.js.map +0 -1
- package/dist/cjs/runtimeConfig.js.map +0 -1
- package/dist/cjs/runtimeConfig.native.js.map +0 -1
- package/dist/cjs/runtimeConfig.shared.js.map +0 -1
- package/dist/es/CognitoSync.js.map +0 -1
- package/dist/es/CognitoSyncClient.js.map +0 -1
- package/dist/es/commands/BulkPublishCommand.js.map +0 -1
- package/dist/es/commands/DeleteDatasetCommand.js.map +0 -1
- package/dist/es/commands/DescribeDatasetCommand.js.map +0 -1
- package/dist/es/commands/DescribeIdentityPoolUsageCommand.js.map +0 -1
- package/dist/es/commands/DescribeIdentityUsageCommand.js.map +0 -1
- package/dist/es/commands/GetBulkPublishDetailsCommand.js.map +0 -1
- package/dist/es/commands/GetCognitoEventsCommand.js.map +0 -1
- package/dist/es/commands/GetIdentityPoolConfigurationCommand.js.map +0 -1
- package/dist/es/commands/ListDatasetsCommand.js.map +0 -1
- package/dist/es/commands/ListIdentityPoolUsageCommand.js.map +0 -1
- package/dist/es/commands/ListRecordsCommand.js.map +0 -1
- package/dist/es/commands/RegisterDeviceCommand.js.map +0 -1
- package/dist/es/commands/SetCognitoEventsCommand.js.map +0 -1
- package/dist/es/commands/SetIdentityPoolConfigurationCommand.js.map +0 -1
- package/dist/es/commands/SubscribeToDatasetCommand.js.map +0 -1
- package/dist/es/commands/UnsubscribeFromDatasetCommand.js.map +0 -1
- package/dist/es/commands/UpdateRecordsCommand.js.map +0 -1
- package/dist/es/endpoints.js.map +0 -1
- package/dist/es/index.js +0 -21
- package/dist/es/index.js.map +0 -1
- package/dist/es/models/index.js +0 -2
- package/dist/es/models/index.js.map +0 -1
- package/dist/es/models/models_0.js.map +0 -1
- package/dist/es/package.json +0 -91
- package/dist/es/protocols/Aws_restJson1.js.map +0 -1
- package/dist/es/runtimeConfig.browser.js.map +0 -1
- package/dist/es/runtimeConfig.js.map +0 -1
- package/dist/es/runtimeConfig.native.js.map +0 -1
- package/dist/es/runtimeConfig.shared.js.map +0 -1
- package/dist/types/ts3.4/CognitoSync.d.ts +0 -642
- package/dist/types/ts3.4/commands/BulkPublishCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/DeleteDatasetCommand.d.ts +0 -39
- package/dist/types/ts3.4/commands/DescribeDatasetCommand.d.ts +0 -38
- package/dist/types/ts3.4/commands/DescribeIdentityPoolUsageCommand.d.ts +0 -83
- package/dist/types/ts3.4/commands/DescribeIdentityUsageCommand.d.ts +0 -84
- package/dist/types/ts3.4/commands/GetBulkPublishDetailsCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/GetCognitoEventsCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/GetIdentityPoolConfigurationCommand.d.ts +0 -81
- package/dist/types/ts3.4/commands/ListDatasetsCommand.d.ts +0 -93
- package/dist/types/ts3.4/commands/ListIdentityPoolUsageCommand.d.ts +0 -93
- package/dist/types/ts3.4/commands/ListRecordsCommand.d.ts +0 -90
- package/dist/types/ts3.4/commands/RegisterDeviceCommand.d.ts +0 -79
- package/dist/types/ts3.4/commands/SetCognitoEventsCommand.d.ts +0 -35
- package/dist/types/ts3.4/commands/SetIdentityPoolConfigurationCommand.d.ts +0 -85
- package/dist/types/ts3.4/commands/SubscribeToDatasetCommand.d.ts +0 -78
- package/dist/types/ts3.4/commands/UnsubscribeFromDatasetCommand.d.ts +0 -79
- package/dist/types/ts3.4/commands/UpdateRecordsCommand.d.ts +0 -37
- package/dist/types/ts3.4/models/models_0.d.ts +0 -1289
- package/endpoints.ts +0 -57
- package/jest.config.js +0 -4
- package/models/models_0.ts +0 -1578
- package/protocols/Aws_restJson1.ts +0 -2879
- package/runtimeConfig.browser.ts +0 -40
- package/runtimeConfig.native.ts +0 -16
- package/runtimeConfig.shared.ts +0 -16
- package/runtimeConfig.ts +0 -45
- package/tsconfig.es.json +0 -10
- package/tsconfig.json +0 -31
- package/tsconfig.types.json +0 -8
|
@@ -1,2879 +0,0 @@
|
|
|
1
|
-
import { BulkPublishCommandInput, BulkPublishCommandOutput } from "../commands/BulkPublishCommand";
|
|
2
|
-
import { DeleteDatasetCommandInput, DeleteDatasetCommandOutput } from "../commands/DeleteDatasetCommand";
|
|
3
|
-
import { DescribeDatasetCommandInput, DescribeDatasetCommandOutput } from "../commands/DescribeDatasetCommand";
|
|
4
|
-
import {
|
|
5
|
-
DescribeIdentityPoolUsageCommandInput,
|
|
6
|
-
DescribeIdentityPoolUsageCommandOutput,
|
|
7
|
-
} from "../commands/DescribeIdentityPoolUsageCommand";
|
|
8
|
-
import {
|
|
9
|
-
DescribeIdentityUsageCommandInput,
|
|
10
|
-
DescribeIdentityUsageCommandOutput,
|
|
11
|
-
} from "../commands/DescribeIdentityUsageCommand";
|
|
12
|
-
import {
|
|
13
|
-
GetBulkPublishDetailsCommandInput,
|
|
14
|
-
GetBulkPublishDetailsCommandOutput,
|
|
15
|
-
} from "../commands/GetBulkPublishDetailsCommand";
|
|
16
|
-
import { GetCognitoEventsCommandInput, GetCognitoEventsCommandOutput } from "../commands/GetCognitoEventsCommand";
|
|
17
|
-
import {
|
|
18
|
-
GetIdentityPoolConfigurationCommandInput,
|
|
19
|
-
GetIdentityPoolConfigurationCommandOutput,
|
|
20
|
-
} from "../commands/GetIdentityPoolConfigurationCommand";
|
|
21
|
-
import { ListDatasetsCommandInput, ListDatasetsCommandOutput } from "../commands/ListDatasetsCommand";
|
|
22
|
-
import {
|
|
23
|
-
ListIdentityPoolUsageCommandInput,
|
|
24
|
-
ListIdentityPoolUsageCommandOutput,
|
|
25
|
-
} from "../commands/ListIdentityPoolUsageCommand";
|
|
26
|
-
import { ListRecordsCommandInput, ListRecordsCommandOutput } from "../commands/ListRecordsCommand";
|
|
27
|
-
import { RegisterDeviceCommandInput, RegisterDeviceCommandOutput } from "../commands/RegisterDeviceCommand";
|
|
28
|
-
import { SetCognitoEventsCommandInput, SetCognitoEventsCommandOutput } from "../commands/SetCognitoEventsCommand";
|
|
29
|
-
import {
|
|
30
|
-
SetIdentityPoolConfigurationCommandInput,
|
|
31
|
-
SetIdentityPoolConfigurationCommandOutput,
|
|
32
|
-
} from "../commands/SetIdentityPoolConfigurationCommand";
|
|
33
|
-
import { SubscribeToDatasetCommandInput, SubscribeToDatasetCommandOutput } from "../commands/SubscribeToDatasetCommand";
|
|
34
|
-
import {
|
|
35
|
-
UnsubscribeFromDatasetCommandInput,
|
|
36
|
-
UnsubscribeFromDatasetCommandOutput,
|
|
37
|
-
} from "../commands/UnsubscribeFromDatasetCommand";
|
|
38
|
-
import { UpdateRecordsCommandInput, UpdateRecordsCommandOutput } from "../commands/UpdateRecordsCommand";
|
|
39
|
-
import {
|
|
40
|
-
AlreadyStreamedException,
|
|
41
|
-
CognitoStreams,
|
|
42
|
-
ConcurrentModificationException,
|
|
43
|
-
Dataset,
|
|
44
|
-
DuplicateRequestException,
|
|
45
|
-
IdentityPoolUsage,
|
|
46
|
-
IdentityUsage,
|
|
47
|
-
InternalErrorException,
|
|
48
|
-
InvalidConfigurationException,
|
|
49
|
-
InvalidLambdaFunctionOutputException,
|
|
50
|
-
InvalidParameterException,
|
|
51
|
-
LambdaThrottledException,
|
|
52
|
-
LimitExceededException,
|
|
53
|
-
NotAuthorizedException,
|
|
54
|
-
PushSync,
|
|
55
|
-
RecordPatch,
|
|
56
|
-
ResourceConflictException,
|
|
57
|
-
ResourceNotFoundException,
|
|
58
|
-
TooManyRequestsException,
|
|
59
|
-
_Record,
|
|
60
|
-
} from "../models/models_0";
|
|
61
|
-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
62
|
-
import {
|
|
63
|
-
expectBoolean as __expectBoolean,
|
|
64
|
-
expectInt32 as __expectInt32,
|
|
65
|
-
expectLong as __expectLong,
|
|
66
|
-
expectNonNull as __expectNonNull,
|
|
67
|
-
expectNumber as __expectNumber,
|
|
68
|
-
expectObject as __expectObject,
|
|
69
|
-
expectString as __expectString,
|
|
70
|
-
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
71
|
-
parseEpochTimestamp as __parseEpochTimestamp,
|
|
72
|
-
} from "@aws-sdk/smithy-client";
|
|
73
|
-
import {
|
|
74
|
-
Endpoint as __Endpoint,
|
|
75
|
-
MetadataBearer as __MetadataBearer,
|
|
76
|
-
ResponseMetadata as __ResponseMetadata,
|
|
77
|
-
SerdeContext as __SerdeContext,
|
|
78
|
-
SmithyException as __SmithyException,
|
|
79
|
-
} from "@aws-sdk/types";
|
|
80
|
-
|
|
81
|
-
export const serializeAws_restJson1BulkPublishCommand = async (
|
|
82
|
-
input: BulkPublishCommandInput,
|
|
83
|
-
context: __SerdeContext
|
|
84
|
-
): Promise<__HttpRequest> => {
|
|
85
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
86
|
-
const headers: any = {};
|
|
87
|
-
let resolvedPath =
|
|
88
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
89
|
-
"/identitypools/{IdentityPoolId}/bulkpublish";
|
|
90
|
-
if (input.IdentityPoolId !== undefined) {
|
|
91
|
-
const labelValue: string = input.IdentityPoolId;
|
|
92
|
-
if (labelValue.length <= 0) {
|
|
93
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
94
|
-
}
|
|
95
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
96
|
-
} else {
|
|
97
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
98
|
-
}
|
|
99
|
-
let body: any;
|
|
100
|
-
return new __HttpRequest({
|
|
101
|
-
protocol,
|
|
102
|
-
hostname,
|
|
103
|
-
port,
|
|
104
|
-
method: "POST",
|
|
105
|
-
headers,
|
|
106
|
-
path: resolvedPath,
|
|
107
|
-
body,
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
export const serializeAws_restJson1DeleteDatasetCommand = async (
|
|
112
|
-
input: DeleteDatasetCommandInput,
|
|
113
|
-
context: __SerdeContext
|
|
114
|
-
): Promise<__HttpRequest> => {
|
|
115
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
116
|
-
const headers: any = {};
|
|
117
|
-
let resolvedPath =
|
|
118
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
119
|
-
"/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}";
|
|
120
|
-
if (input.IdentityPoolId !== undefined) {
|
|
121
|
-
const labelValue: string = input.IdentityPoolId;
|
|
122
|
-
if (labelValue.length <= 0) {
|
|
123
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
124
|
-
}
|
|
125
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
126
|
-
} else {
|
|
127
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
128
|
-
}
|
|
129
|
-
if (input.IdentityId !== undefined) {
|
|
130
|
-
const labelValue: string = input.IdentityId;
|
|
131
|
-
if (labelValue.length <= 0) {
|
|
132
|
-
throw new Error("Empty value provided for input HTTP label: IdentityId.");
|
|
133
|
-
}
|
|
134
|
-
resolvedPath = resolvedPath.replace("{IdentityId}", __extendedEncodeURIComponent(labelValue));
|
|
135
|
-
} else {
|
|
136
|
-
throw new Error("No value provided for input HTTP label: IdentityId.");
|
|
137
|
-
}
|
|
138
|
-
if (input.DatasetName !== undefined) {
|
|
139
|
-
const labelValue: string = input.DatasetName;
|
|
140
|
-
if (labelValue.length <= 0) {
|
|
141
|
-
throw new Error("Empty value provided for input HTTP label: DatasetName.");
|
|
142
|
-
}
|
|
143
|
-
resolvedPath = resolvedPath.replace("{DatasetName}", __extendedEncodeURIComponent(labelValue));
|
|
144
|
-
} else {
|
|
145
|
-
throw new Error("No value provided for input HTTP label: DatasetName.");
|
|
146
|
-
}
|
|
147
|
-
let body: any;
|
|
148
|
-
return new __HttpRequest({
|
|
149
|
-
protocol,
|
|
150
|
-
hostname,
|
|
151
|
-
port,
|
|
152
|
-
method: "DELETE",
|
|
153
|
-
headers,
|
|
154
|
-
path: resolvedPath,
|
|
155
|
-
body,
|
|
156
|
-
});
|
|
157
|
-
};
|
|
158
|
-
|
|
159
|
-
export const serializeAws_restJson1DescribeDatasetCommand = async (
|
|
160
|
-
input: DescribeDatasetCommandInput,
|
|
161
|
-
context: __SerdeContext
|
|
162
|
-
): Promise<__HttpRequest> => {
|
|
163
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
164
|
-
const headers: any = {};
|
|
165
|
-
let resolvedPath =
|
|
166
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
167
|
-
"/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}";
|
|
168
|
-
if (input.IdentityPoolId !== undefined) {
|
|
169
|
-
const labelValue: string = input.IdentityPoolId;
|
|
170
|
-
if (labelValue.length <= 0) {
|
|
171
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
172
|
-
}
|
|
173
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
174
|
-
} else {
|
|
175
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
176
|
-
}
|
|
177
|
-
if (input.IdentityId !== undefined) {
|
|
178
|
-
const labelValue: string = input.IdentityId;
|
|
179
|
-
if (labelValue.length <= 0) {
|
|
180
|
-
throw new Error("Empty value provided for input HTTP label: IdentityId.");
|
|
181
|
-
}
|
|
182
|
-
resolvedPath = resolvedPath.replace("{IdentityId}", __extendedEncodeURIComponent(labelValue));
|
|
183
|
-
} else {
|
|
184
|
-
throw new Error("No value provided for input HTTP label: IdentityId.");
|
|
185
|
-
}
|
|
186
|
-
if (input.DatasetName !== undefined) {
|
|
187
|
-
const labelValue: string = input.DatasetName;
|
|
188
|
-
if (labelValue.length <= 0) {
|
|
189
|
-
throw new Error("Empty value provided for input HTTP label: DatasetName.");
|
|
190
|
-
}
|
|
191
|
-
resolvedPath = resolvedPath.replace("{DatasetName}", __extendedEncodeURIComponent(labelValue));
|
|
192
|
-
} else {
|
|
193
|
-
throw new Error("No value provided for input HTTP label: DatasetName.");
|
|
194
|
-
}
|
|
195
|
-
let body: any;
|
|
196
|
-
return new __HttpRequest({
|
|
197
|
-
protocol,
|
|
198
|
-
hostname,
|
|
199
|
-
port,
|
|
200
|
-
method: "GET",
|
|
201
|
-
headers,
|
|
202
|
-
path: resolvedPath,
|
|
203
|
-
body,
|
|
204
|
-
});
|
|
205
|
-
};
|
|
206
|
-
|
|
207
|
-
export const serializeAws_restJson1DescribeIdentityPoolUsageCommand = async (
|
|
208
|
-
input: DescribeIdentityPoolUsageCommandInput,
|
|
209
|
-
context: __SerdeContext
|
|
210
|
-
): Promise<__HttpRequest> => {
|
|
211
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
212
|
-
const headers: any = {};
|
|
213
|
-
let resolvedPath =
|
|
214
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/identitypools/{IdentityPoolId}";
|
|
215
|
-
if (input.IdentityPoolId !== undefined) {
|
|
216
|
-
const labelValue: string = input.IdentityPoolId;
|
|
217
|
-
if (labelValue.length <= 0) {
|
|
218
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
219
|
-
}
|
|
220
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
221
|
-
} else {
|
|
222
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
223
|
-
}
|
|
224
|
-
let body: any;
|
|
225
|
-
return new __HttpRequest({
|
|
226
|
-
protocol,
|
|
227
|
-
hostname,
|
|
228
|
-
port,
|
|
229
|
-
method: "GET",
|
|
230
|
-
headers,
|
|
231
|
-
path: resolvedPath,
|
|
232
|
-
body,
|
|
233
|
-
});
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
export const serializeAws_restJson1DescribeIdentityUsageCommand = async (
|
|
237
|
-
input: DescribeIdentityUsageCommandInput,
|
|
238
|
-
context: __SerdeContext
|
|
239
|
-
): Promise<__HttpRequest> => {
|
|
240
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
241
|
-
const headers: any = {};
|
|
242
|
-
let resolvedPath =
|
|
243
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
244
|
-
"/identitypools/{IdentityPoolId}/identities/{IdentityId}";
|
|
245
|
-
if (input.IdentityPoolId !== undefined) {
|
|
246
|
-
const labelValue: string = input.IdentityPoolId;
|
|
247
|
-
if (labelValue.length <= 0) {
|
|
248
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
249
|
-
}
|
|
250
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
251
|
-
} else {
|
|
252
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
253
|
-
}
|
|
254
|
-
if (input.IdentityId !== undefined) {
|
|
255
|
-
const labelValue: string = input.IdentityId;
|
|
256
|
-
if (labelValue.length <= 0) {
|
|
257
|
-
throw new Error("Empty value provided for input HTTP label: IdentityId.");
|
|
258
|
-
}
|
|
259
|
-
resolvedPath = resolvedPath.replace("{IdentityId}", __extendedEncodeURIComponent(labelValue));
|
|
260
|
-
} else {
|
|
261
|
-
throw new Error("No value provided for input HTTP label: IdentityId.");
|
|
262
|
-
}
|
|
263
|
-
let body: any;
|
|
264
|
-
return new __HttpRequest({
|
|
265
|
-
protocol,
|
|
266
|
-
hostname,
|
|
267
|
-
port,
|
|
268
|
-
method: "GET",
|
|
269
|
-
headers,
|
|
270
|
-
path: resolvedPath,
|
|
271
|
-
body,
|
|
272
|
-
});
|
|
273
|
-
};
|
|
274
|
-
|
|
275
|
-
export const serializeAws_restJson1GetBulkPublishDetailsCommand = async (
|
|
276
|
-
input: GetBulkPublishDetailsCommandInput,
|
|
277
|
-
context: __SerdeContext
|
|
278
|
-
): Promise<__HttpRequest> => {
|
|
279
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
280
|
-
const headers: any = {};
|
|
281
|
-
let resolvedPath =
|
|
282
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
283
|
-
"/identitypools/{IdentityPoolId}/getBulkPublishDetails";
|
|
284
|
-
if (input.IdentityPoolId !== undefined) {
|
|
285
|
-
const labelValue: string = input.IdentityPoolId;
|
|
286
|
-
if (labelValue.length <= 0) {
|
|
287
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
288
|
-
}
|
|
289
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
290
|
-
} else {
|
|
291
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
292
|
-
}
|
|
293
|
-
let body: any;
|
|
294
|
-
return new __HttpRequest({
|
|
295
|
-
protocol,
|
|
296
|
-
hostname,
|
|
297
|
-
port,
|
|
298
|
-
method: "POST",
|
|
299
|
-
headers,
|
|
300
|
-
path: resolvedPath,
|
|
301
|
-
body,
|
|
302
|
-
});
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
export const serializeAws_restJson1GetCognitoEventsCommand = async (
|
|
306
|
-
input: GetCognitoEventsCommandInput,
|
|
307
|
-
context: __SerdeContext
|
|
308
|
-
): Promise<__HttpRequest> => {
|
|
309
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
310
|
-
const headers: any = {};
|
|
311
|
-
let resolvedPath =
|
|
312
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/identitypools/{IdentityPoolId}/events";
|
|
313
|
-
if (input.IdentityPoolId !== undefined) {
|
|
314
|
-
const labelValue: string = input.IdentityPoolId;
|
|
315
|
-
if (labelValue.length <= 0) {
|
|
316
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
317
|
-
}
|
|
318
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
319
|
-
} else {
|
|
320
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
321
|
-
}
|
|
322
|
-
let body: any;
|
|
323
|
-
return new __HttpRequest({
|
|
324
|
-
protocol,
|
|
325
|
-
hostname,
|
|
326
|
-
port,
|
|
327
|
-
method: "GET",
|
|
328
|
-
headers,
|
|
329
|
-
path: resolvedPath,
|
|
330
|
-
body,
|
|
331
|
-
});
|
|
332
|
-
};
|
|
333
|
-
|
|
334
|
-
export const serializeAws_restJson1GetIdentityPoolConfigurationCommand = async (
|
|
335
|
-
input: GetIdentityPoolConfigurationCommandInput,
|
|
336
|
-
context: __SerdeContext
|
|
337
|
-
): Promise<__HttpRequest> => {
|
|
338
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
339
|
-
const headers: any = {};
|
|
340
|
-
let resolvedPath =
|
|
341
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
342
|
-
"/identitypools/{IdentityPoolId}/configuration";
|
|
343
|
-
if (input.IdentityPoolId !== undefined) {
|
|
344
|
-
const labelValue: string = input.IdentityPoolId;
|
|
345
|
-
if (labelValue.length <= 0) {
|
|
346
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
347
|
-
}
|
|
348
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
349
|
-
} else {
|
|
350
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
351
|
-
}
|
|
352
|
-
let body: any;
|
|
353
|
-
return new __HttpRequest({
|
|
354
|
-
protocol,
|
|
355
|
-
hostname,
|
|
356
|
-
port,
|
|
357
|
-
method: "GET",
|
|
358
|
-
headers,
|
|
359
|
-
path: resolvedPath,
|
|
360
|
-
body,
|
|
361
|
-
});
|
|
362
|
-
};
|
|
363
|
-
|
|
364
|
-
export const serializeAws_restJson1ListDatasetsCommand = async (
|
|
365
|
-
input: ListDatasetsCommandInput,
|
|
366
|
-
context: __SerdeContext
|
|
367
|
-
): Promise<__HttpRequest> => {
|
|
368
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
369
|
-
const headers: any = {};
|
|
370
|
-
let resolvedPath =
|
|
371
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
372
|
-
"/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets";
|
|
373
|
-
if (input.IdentityPoolId !== undefined) {
|
|
374
|
-
const labelValue: string = input.IdentityPoolId;
|
|
375
|
-
if (labelValue.length <= 0) {
|
|
376
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
377
|
-
}
|
|
378
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
379
|
-
} else {
|
|
380
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
381
|
-
}
|
|
382
|
-
if (input.IdentityId !== undefined) {
|
|
383
|
-
const labelValue: string = input.IdentityId;
|
|
384
|
-
if (labelValue.length <= 0) {
|
|
385
|
-
throw new Error("Empty value provided for input HTTP label: IdentityId.");
|
|
386
|
-
}
|
|
387
|
-
resolvedPath = resolvedPath.replace("{IdentityId}", __extendedEncodeURIComponent(labelValue));
|
|
388
|
-
} else {
|
|
389
|
-
throw new Error("No value provided for input HTTP label: IdentityId.");
|
|
390
|
-
}
|
|
391
|
-
const query: any = {
|
|
392
|
-
...(input.NextToken !== undefined && { nextToken: input.NextToken }),
|
|
393
|
-
...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
|
|
394
|
-
};
|
|
395
|
-
let body: any;
|
|
396
|
-
return new __HttpRequest({
|
|
397
|
-
protocol,
|
|
398
|
-
hostname,
|
|
399
|
-
port,
|
|
400
|
-
method: "GET",
|
|
401
|
-
headers,
|
|
402
|
-
path: resolvedPath,
|
|
403
|
-
query,
|
|
404
|
-
body,
|
|
405
|
-
});
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
export const serializeAws_restJson1ListIdentityPoolUsageCommand = async (
|
|
409
|
-
input: ListIdentityPoolUsageCommandInput,
|
|
410
|
-
context: __SerdeContext
|
|
411
|
-
): Promise<__HttpRequest> => {
|
|
412
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
413
|
-
const headers: any = {};
|
|
414
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/identitypools";
|
|
415
|
-
const query: any = {
|
|
416
|
-
...(input.NextToken !== undefined && { nextToken: input.NextToken }),
|
|
417
|
-
...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
|
|
418
|
-
};
|
|
419
|
-
let body: any;
|
|
420
|
-
return new __HttpRequest({
|
|
421
|
-
protocol,
|
|
422
|
-
hostname,
|
|
423
|
-
port,
|
|
424
|
-
method: "GET",
|
|
425
|
-
headers,
|
|
426
|
-
path: resolvedPath,
|
|
427
|
-
query,
|
|
428
|
-
body,
|
|
429
|
-
});
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
export const serializeAws_restJson1ListRecordsCommand = async (
|
|
433
|
-
input: ListRecordsCommandInput,
|
|
434
|
-
context: __SerdeContext
|
|
435
|
-
): Promise<__HttpRequest> => {
|
|
436
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
437
|
-
const headers: any = {};
|
|
438
|
-
let resolvedPath =
|
|
439
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
440
|
-
"/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/records";
|
|
441
|
-
if (input.IdentityPoolId !== undefined) {
|
|
442
|
-
const labelValue: string = input.IdentityPoolId;
|
|
443
|
-
if (labelValue.length <= 0) {
|
|
444
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
445
|
-
}
|
|
446
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
447
|
-
} else {
|
|
448
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
449
|
-
}
|
|
450
|
-
if (input.IdentityId !== undefined) {
|
|
451
|
-
const labelValue: string = input.IdentityId;
|
|
452
|
-
if (labelValue.length <= 0) {
|
|
453
|
-
throw new Error("Empty value provided for input HTTP label: IdentityId.");
|
|
454
|
-
}
|
|
455
|
-
resolvedPath = resolvedPath.replace("{IdentityId}", __extendedEncodeURIComponent(labelValue));
|
|
456
|
-
} else {
|
|
457
|
-
throw new Error("No value provided for input HTTP label: IdentityId.");
|
|
458
|
-
}
|
|
459
|
-
if (input.DatasetName !== undefined) {
|
|
460
|
-
const labelValue: string = input.DatasetName;
|
|
461
|
-
if (labelValue.length <= 0) {
|
|
462
|
-
throw new Error("Empty value provided for input HTTP label: DatasetName.");
|
|
463
|
-
}
|
|
464
|
-
resolvedPath = resolvedPath.replace("{DatasetName}", __extendedEncodeURIComponent(labelValue));
|
|
465
|
-
} else {
|
|
466
|
-
throw new Error("No value provided for input HTTP label: DatasetName.");
|
|
467
|
-
}
|
|
468
|
-
const query: any = {
|
|
469
|
-
...(input.LastSyncCount !== undefined && { lastSyncCount: input.LastSyncCount.toString() }),
|
|
470
|
-
...(input.NextToken !== undefined && { nextToken: input.NextToken }),
|
|
471
|
-
...(input.MaxResults !== undefined && { maxResults: input.MaxResults.toString() }),
|
|
472
|
-
...(input.SyncSessionToken !== undefined && { syncSessionToken: input.SyncSessionToken }),
|
|
473
|
-
};
|
|
474
|
-
let body: any;
|
|
475
|
-
return new __HttpRequest({
|
|
476
|
-
protocol,
|
|
477
|
-
hostname,
|
|
478
|
-
port,
|
|
479
|
-
method: "GET",
|
|
480
|
-
headers,
|
|
481
|
-
path: resolvedPath,
|
|
482
|
-
query,
|
|
483
|
-
body,
|
|
484
|
-
});
|
|
485
|
-
};
|
|
486
|
-
|
|
487
|
-
export const serializeAws_restJson1RegisterDeviceCommand = async (
|
|
488
|
-
input: RegisterDeviceCommandInput,
|
|
489
|
-
context: __SerdeContext
|
|
490
|
-
): Promise<__HttpRequest> => {
|
|
491
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
492
|
-
const headers: any = {
|
|
493
|
-
"content-type": "application/json",
|
|
494
|
-
};
|
|
495
|
-
let resolvedPath =
|
|
496
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
497
|
-
"/identitypools/{IdentityPoolId}/identity/{IdentityId}/device";
|
|
498
|
-
if (input.IdentityPoolId !== undefined) {
|
|
499
|
-
const labelValue: string = input.IdentityPoolId;
|
|
500
|
-
if (labelValue.length <= 0) {
|
|
501
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
502
|
-
}
|
|
503
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
504
|
-
} else {
|
|
505
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
506
|
-
}
|
|
507
|
-
if (input.IdentityId !== undefined) {
|
|
508
|
-
const labelValue: string = input.IdentityId;
|
|
509
|
-
if (labelValue.length <= 0) {
|
|
510
|
-
throw new Error("Empty value provided for input HTTP label: IdentityId.");
|
|
511
|
-
}
|
|
512
|
-
resolvedPath = resolvedPath.replace("{IdentityId}", __extendedEncodeURIComponent(labelValue));
|
|
513
|
-
} else {
|
|
514
|
-
throw new Error("No value provided for input HTTP label: IdentityId.");
|
|
515
|
-
}
|
|
516
|
-
let body: any;
|
|
517
|
-
body = JSON.stringify({
|
|
518
|
-
...(input.Platform !== undefined && input.Platform !== null && { Platform: input.Platform }),
|
|
519
|
-
...(input.Token !== undefined && input.Token !== null && { Token: input.Token }),
|
|
520
|
-
});
|
|
521
|
-
return new __HttpRequest({
|
|
522
|
-
protocol,
|
|
523
|
-
hostname,
|
|
524
|
-
port,
|
|
525
|
-
method: "POST",
|
|
526
|
-
headers,
|
|
527
|
-
path: resolvedPath,
|
|
528
|
-
body,
|
|
529
|
-
});
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
export const serializeAws_restJson1SetCognitoEventsCommand = async (
|
|
533
|
-
input: SetCognitoEventsCommandInput,
|
|
534
|
-
context: __SerdeContext
|
|
535
|
-
): Promise<__HttpRequest> => {
|
|
536
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
537
|
-
const headers: any = {
|
|
538
|
-
"content-type": "application/json",
|
|
539
|
-
};
|
|
540
|
-
let resolvedPath =
|
|
541
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/identitypools/{IdentityPoolId}/events";
|
|
542
|
-
if (input.IdentityPoolId !== undefined) {
|
|
543
|
-
const labelValue: string = input.IdentityPoolId;
|
|
544
|
-
if (labelValue.length <= 0) {
|
|
545
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
546
|
-
}
|
|
547
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
548
|
-
} else {
|
|
549
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
550
|
-
}
|
|
551
|
-
let body: any;
|
|
552
|
-
body = JSON.stringify({
|
|
553
|
-
...(input.Events !== undefined &&
|
|
554
|
-
input.Events !== null && { Events: serializeAws_restJson1Events(input.Events, context) }),
|
|
555
|
-
});
|
|
556
|
-
return new __HttpRequest({
|
|
557
|
-
protocol,
|
|
558
|
-
hostname,
|
|
559
|
-
port,
|
|
560
|
-
method: "POST",
|
|
561
|
-
headers,
|
|
562
|
-
path: resolvedPath,
|
|
563
|
-
body,
|
|
564
|
-
});
|
|
565
|
-
};
|
|
566
|
-
|
|
567
|
-
export const serializeAws_restJson1SetIdentityPoolConfigurationCommand = async (
|
|
568
|
-
input: SetIdentityPoolConfigurationCommandInput,
|
|
569
|
-
context: __SerdeContext
|
|
570
|
-
): Promise<__HttpRequest> => {
|
|
571
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
572
|
-
const headers: any = {
|
|
573
|
-
"content-type": "application/json",
|
|
574
|
-
};
|
|
575
|
-
let resolvedPath =
|
|
576
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
577
|
-
"/identitypools/{IdentityPoolId}/configuration";
|
|
578
|
-
if (input.IdentityPoolId !== undefined) {
|
|
579
|
-
const labelValue: string = input.IdentityPoolId;
|
|
580
|
-
if (labelValue.length <= 0) {
|
|
581
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
582
|
-
}
|
|
583
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
584
|
-
} else {
|
|
585
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
586
|
-
}
|
|
587
|
-
let body: any;
|
|
588
|
-
body = JSON.stringify({
|
|
589
|
-
...(input.CognitoStreams !== undefined &&
|
|
590
|
-
input.CognitoStreams !== null && {
|
|
591
|
-
CognitoStreams: serializeAws_restJson1CognitoStreams(input.CognitoStreams, context),
|
|
592
|
-
}),
|
|
593
|
-
...(input.PushSync !== undefined &&
|
|
594
|
-
input.PushSync !== null && { PushSync: serializeAws_restJson1PushSync(input.PushSync, context) }),
|
|
595
|
-
});
|
|
596
|
-
return new __HttpRequest({
|
|
597
|
-
protocol,
|
|
598
|
-
hostname,
|
|
599
|
-
port,
|
|
600
|
-
method: "POST",
|
|
601
|
-
headers,
|
|
602
|
-
path: resolvedPath,
|
|
603
|
-
body,
|
|
604
|
-
});
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
export const serializeAws_restJson1SubscribeToDatasetCommand = async (
|
|
608
|
-
input: SubscribeToDatasetCommandInput,
|
|
609
|
-
context: __SerdeContext
|
|
610
|
-
): Promise<__HttpRequest> => {
|
|
611
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
612
|
-
const headers: any = {};
|
|
613
|
-
let resolvedPath =
|
|
614
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
615
|
-
"/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}";
|
|
616
|
-
if (input.IdentityPoolId !== undefined) {
|
|
617
|
-
const labelValue: string = input.IdentityPoolId;
|
|
618
|
-
if (labelValue.length <= 0) {
|
|
619
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
620
|
-
}
|
|
621
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
622
|
-
} else {
|
|
623
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
624
|
-
}
|
|
625
|
-
if (input.IdentityId !== undefined) {
|
|
626
|
-
const labelValue: string = input.IdentityId;
|
|
627
|
-
if (labelValue.length <= 0) {
|
|
628
|
-
throw new Error("Empty value provided for input HTTP label: IdentityId.");
|
|
629
|
-
}
|
|
630
|
-
resolvedPath = resolvedPath.replace("{IdentityId}", __extendedEncodeURIComponent(labelValue));
|
|
631
|
-
} else {
|
|
632
|
-
throw new Error("No value provided for input HTTP label: IdentityId.");
|
|
633
|
-
}
|
|
634
|
-
if (input.DatasetName !== undefined) {
|
|
635
|
-
const labelValue: string = input.DatasetName;
|
|
636
|
-
if (labelValue.length <= 0) {
|
|
637
|
-
throw new Error("Empty value provided for input HTTP label: DatasetName.");
|
|
638
|
-
}
|
|
639
|
-
resolvedPath = resolvedPath.replace("{DatasetName}", __extendedEncodeURIComponent(labelValue));
|
|
640
|
-
} else {
|
|
641
|
-
throw new Error("No value provided for input HTTP label: DatasetName.");
|
|
642
|
-
}
|
|
643
|
-
if (input.DeviceId !== undefined) {
|
|
644
|
-
const labelValue: string = input.DeviceId;
|
|
645
|
-
if (labelValue.length <= 0) {
|
|
646
|
-
throw new Error("Empty value provided for input HTTP label: DeviceId.");
|
|
647
|
-
}
|
|
648
|
-
resolvedPath = resolvedPath.replace("{DeviceId}", __extendedEncodeURIComponent(labelValue));
|
|
649
|
-
} else {
|
|
650
|
-
throw new Error("No value provided for input HTTP label: DeviceId.");
|
|
651
|
-
}
|
|
652
|
-
let body: any;
|
|
653
|
-
return new __HttpRequest({
|
|
654
|
-
protocol,
|
|
655
|
-
hostname,
|
|
656
|
-
port,
|
|
657
|
-
method: "POST",
|
|
658
|
-
headers,
|
|
659
|
-
path: resolvedPath,
|
|
660
|
-
body,
|
|
661
|
-
});
|
|
662
|
-
};
|
|
663
|
-
|
|
664
|
-
export const serializeAws_restJson1UnsubscribeFromDatasetCommand = async (
|
|
665
|
-
input: UnsubscribeFromDatasetCommandInput,
|
|
666
|
-
context: __SerdeContext
|
|
667
|
-
): Promise<__HttpRequest> => {
|
|
668
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
669
|
-
const headers: any = {};
|
|
670
|
-
let resolvedPath =
|
|
671
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
672
|
-
"/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}";
|
|
673
|
-
if (input.IdentityPoolId !== undefined) {
|
|
674
|
-
const labelValue: string = input.IdentityPoolId;
|
|
675
|
-
if (labelValue.length <= 0) {
|
|
676
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
677
|
-
}
|
|
678
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
679
|
-
} else {
|
|
680
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
681
|
-
}
|
|
682
|
-
if (input.IdentityId !== undefined) {
|
|
683
|
-
const labelValue: string = input.IdentityId;
|
|
684
|
-
if (labelValue.length <= 0) {
|
|
685
|
-
throw new Error("Empty value provided for input HTTP label: IdentityId.");
|
|
686
|
-
}
|
|
687
|
-
resolvedPath = resolvedPath.replace("{IdentityId}", __extendedEncodeURIComponent(labelValue));
|
|
688
|
-
} else {
|
|
689
|
-
throw new Error("No value provided for input HTTP label: IdentityId.");
|
|
690
|
-
}
|
|
691
|
-
if (input.DatasetName !== undefined) {
|
|
692
|
-
const labelValue: string = input.DatasetName;
|
|
693
|
-
if (labelValue.length <= 0) {
|
|
694
|
-
throw new Error("Empty value provided for input HTTP label: DatasetName.");
|
|
695
|
-
}
|
|
696
|
-
resolvedPath = resolvedPath.replace("{DatasetName}", __extendedEncodeURIComponent(labelValue));
|
|
697
|
-
} else {
|
|
698
|
-
throw new Error("No value provided for input HTTP label: DatasetName.");
|
|
699
|
-
}
|
|
700
|
-
if (input.DeviceId !== undefined) {
|
|
701
|
-
const labelValue: string = input.DeviceId;
|
|
702
|
-
if (labelValue.length <= 0) {
|
|
703
|
-
throw new Error("Empty value provided for input HTTP label: DeviceId.");
|
|
704
|
-
}
|
|
705
|
-
resolvedPath = resolvedPath.replace("{DeviceId}", __extendedEncodeURIComponent(labelValue));
|
|
706
|
-
} else {
|
|
707
|
-
throw new Error("No value provided for input HTTP label: DeviceId.");
|
|
708
|
-
}
|
|
709
|
-
let body: any;
|
|
710
|
-
return new __HttpRequest({
|
|
711
|
-
protocol,
|
|
712
|
-
hostname,
|
|
713
|
-
port,
|
|
714
|
-
method: "DELETE",
|
|
715
|
-
headers,
|
|
716
|
-
path: resolvedPath,
|
|
717
|
-
body,
|
|
718
|
-
});
|
|
719
|
-
};
|
|
720
|
-
|
|
721
|
-
export const serializeAws_restJson1UpdateRecordsCommand = async (
|
|
722
|
-
input: UpdateRecordsCommandInput,
|
|
723
|
-
context: __SerdeContext
|
|
724
|
-
): Promise<__HttpRequest> => {
|
|
725
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
726
|
-
const headers: any = {
|
|
727
|
-
"content-type": "application/json",
|
|
728
|
-
...(isSerializableHeaderValue(input.ClientContext) && { "x-amz-client-context": input.ClientContext! }),
|
|
729
|
-
};
|
|
730
|
-
let resolvedPath =
|
|
731
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
732
|
-
"/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}";
|
|
733
|
-
if (input.IdentityPoolId !== undefined) {
|
|
734
|
-
const labelValue: string = input.IdentityPoolId;
|
|
735
|
-
if (labelValue.length <= 0) {
|
|
736
|
-
throw new Error("Empty value provided for input HTTP label: IdentityPoolId.");
|
|
737
|
-
}
|
|
738
|
-
resolvedPath = resolvedPath.replace("{IdentityPoolId}", __extendedEncodeURIComponent(labelValue));
|
|
739
|
-
} else {
|
|
740
|
-
throw new Error("No value provided for input HTTP label: IdentityPoolId.");
|
|
741
|
-
}
|
|
742
|
-
if (input.IdentityId !== undefined) {
|
|
743
|
-
const labelValue: string = input.IdentityId;
|
|
744
|
-
if (labelValue.length <= 0) {
|
|
745
|
-
throw new Error("Empty value provided for input HTTP label: IdentityId.");
|
|
746
|
-
}
|
|
747
|
-
resolvedPath = resolvedPath.replace("{IdentityId}", __extendedEncodeURIComponent(labelValue));
|
|
748
|
-
} else {
|
|
749
|
-
throw new Error("No value provided for input HTTP label: IdentityId.");
|
|
750
|
-
}
|
|
751
|
-
if (input.DatasetName !== undefined) {
|
|
752
|
-
const labelValue: string = input.DatasetName;
|
|
753
|
-
if (labelValue.length <= 0) {
|
|
754
|
-
throw new Error("Empty value provided for input HTTP label: DatasetName.");
|
|
755
|
-
}
|
|
756
|
-
resolvedPath = resolvedPath.replace("{DatasetName}", __extendedEncodeURIComponent(labelValue));
|
|
757
|
-
} else {
|
|
758
|
-
throw new Error("No value provided for input HTTP label: DatasetName.");
|
|
759
|
-
}
|
|
760
|
-
let body: any;
|
|
761
|
-
body = JSON.stringify({
|
|
762
|
-
...(input.DeviceId !== undefined && input.DeviceId !== null && { DeviceId: input.DeviceId }),
|
|
763
|
-
...(input.RecordPatches !== undefined &&
|
|
764
|
-
input.RecordPatches !== null && {
|
|
765
|
-
RecordPatches: serializeAws_restJson1RecordPatchList(input.RecordPatches, context),
|
|
766
|
-
}),
|
|
767
|
-
...(input.SyncSessionToken !== undefined &&
|
|
768
|
-
input.SyncSessionToken !== null && { SyncSessionToken: input.SyncSessionToken }),
|
|
769
|
-
});
|
|
770
|
-
return new __HttpRequest({
|
|
771
|
-
protocol,
|
|
772
|
-
hostname,
|
|
773
|
-
port,
|
|
774
|
-
method: "POST",
|
|
775
|
-
headers,
|
|
776
|
-
path: resolvedPath,
|
|
777
|
-
body,
|
|
778
|
-
});
|
|
779
|
-
};
|
|
780
|
-
|
|
781
|
-
export const deserializeAws_restJson1BulkPublishCommand = async (
|
|
782
|
-
output: __HttpResponse,
|
|
783
|
-
context: __SerdeContext
|
|
784
|
-
): Promise<BulkPublishCommandOutput> => {
|
|
785
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
786
|
-
return deserializeAws_restJson1BulkPublishCommandError(output, context);
|
|
787
|
-
}
|
|
788
|
-
const contents: BulkPublishCommandOutput = {
|
|
789
|
-
$metadata: deserializeMetadata(output),
|
|
790
|
-
IdentityPoolId: undefined,
|
|
791
|
-
};
|
|
792
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
793
|
-
if (data.IdentityPoolId !== undefined && data.IdentityPoolId !== null) {
|
|
794
|
-
contents.IdentityPoolId = __expectString(data.IdentityPoolId);
|
|
795
|
-
}
|
|
796
|
-
return Promise.resolve(contents);
|
|
797
|
-
};
|
|
798
|
-
|
|
799
|
-
const deserializeAws_restJson1BulkPublishCommandError = async (
|
|
800
|
-
output: __HttpResponse,
|
|
801
|
-
context: __SerdeContext
|
|
802
|
-
): Promise<BulkPublishCommandOutput> => {
|
|
803
|
-
const parsedOutput: any = {
|
|
804
|
-
...output,
|
|
805
|
-
body: await parseBody(output.body, context),
|
|
806
|
-
};
|
|
807
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
808
|
-
let errorCode: string = "UnknownError";
|
|
809
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
810
|
-
switch (errorCode) {
|
|
811
|
-
case "AlreadyStreamedException":
|
|
812
|
-
case "com.amazonaws.cognitosync#AlreadyStreamedException":
|
|
813
|
-
response = {
|
|
814
|
-
...(await deserializeAws_restJson1AlreadyStreamedExceptionResponse(parsedOutput, context)),
|
|
815
|
-
name: errorCode,
|
|
816
|
-
$metadata: deserializeMetadata(output),
|
|
817
|
-
};
|
|
818
|
-
break;
|
|
819
|
-
case "DuplicateRequestException":
|
|
820
|
-
case "com.amazonaws.cognitosync#DuplicateRequestException":
|
|
821
|
-
response = {
|
|
822
|
-
...(await deserializeAws_restJson1DuplicateRequestExceptionResponse(parsedOutput, context)),
|
|
823
|
-
name: errorCode,
|
|
824
|
-
$metadata: deserializeMetadata(output),
|
|
825
|
-
};
|
|
826
|
-
break;
|
|
827
|
-
case "InternalErrorException":
|
|
828
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
829
|
-
response = {
|
|
830
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
831
|
-
name: errorCode,
|
|
832
|
-
$metadata: deserializeMetadata(output),
|
|
833
|
-
};
|
|
834
|
-
break;
|
|
835
|
-
case "InvalidParameterException":
|
|
836
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
837
|
-
response = {
|
|
838
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
839
|
-
name: errorCode,
|
|
840
|
-
$metadata: deserializeMetadata(output),
|
|
841
|
-
};
|
|
842
|
-
break;
|
|
843
|
-
case "NotAuthorizedException":
|
|
844
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
845
|
-
response = {
|
|
846
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
847
|
-
name: errorCode,
|
|
848
|
-
$metadata: deserializeMetadata(output),
|
|
849
|
-
};
|
|
850
|
-
break;
|
|
851
|
-
case "ResourceNotFoundException":
|
|
852
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
853
|
-
response = {
|
|
854
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
855
|
-
name: errorCode,
|
|
856
|
-
$metadata: deserializeMetadata(output),
|
|
857
|
-
};
|
|
858
|
-
break;
|
|
859
|
-
default:
|
|
860
|
-
const parsedBody = parsedOutput.body;
|
|
861
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
862
|
-
response = {
|
|
863
|
-
...parsedBody,
|
|
864
|
-
name: `${errorCode}`,
|
|
865
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
866
|
-
$fault: "client",
|
|
867
|
-
$metadata: deserializeMetadata(output),
|
|
868
|
-
} as any;
|
|
869
|
-
}
|
|
870
|
-
const message = response.message || response.Message || errorCode;
|
|
871
|
-
response.message = message;
|
|
872
|
-
delete response.Message;
|
|
873
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
874
|
-
};
|
|
875
|
-
|
|
876
|
-
export const deserializeAws_restJson1DeleteDatasetCommand = async (
|
|
877
|
-
output: __HttpResponse,
|
|
878
|
-
context: __SerdeContext
|
|
879
|
-
): Promise<DeleteDatasetCommandOutput> => {
|
|
880
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
881
|
-
return deserializeAws_restJson1DeleteDatasetCommandError(output, context);
|
|
882
|
-
}
|
|
883
|
-
const contents: DeleteDatasetCommandOutput = {
|
|
884
|
-
$metadata: deserializeMetadata(output),
|
|
885
|
-
Dataset: undefined,
|
|
886
|
-
};
|
|
887
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
888
|
-
if (data.Dataset !== undefined && data.Dataset !== null) {
|
|
889
|
-
contents.Dataset = deserializeAws_restJson1Dataset(data.Dataset, context);
|
|
890
|
-
}
|
|
891
|
-
return Promise.resolve(contents);
|
|
892
|
-
};
|
|
893
|
-
|
|
894
|
-
const deserializeAws_restJson1DeleteDatasetCommandError = async (
|
|
895
|
-
output: __HttpResponse,
|
|
896
|
-
context: __SerdeContext
|
|
897
|
-
): Promise<DeleteDatasetCommandOutput> => {
|
|
898
|
-
const parsedOutput: any = {
|
|
899
|
-
...output,
|
|
900
|
-
body: await parseBody(output.body, context),
|
|
901
|
-
};
|
|
902
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
903
|
-
let errorCode: string = "UnknownError";
|
|
904
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
905
|
-
switch (errorCode) {
|
|
906
|
-
case "InternalErrorException":
|
|
907
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
908
|
-
response = {
|
|
909
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
910
|
-
name: errorCode,
|
|
911
|
-
$metadata: deserializeMetadata(output),
|
|
912
|
-
};
|
|
913
|
-
break;
|
|
914
|
-
case "InvalidParameterException":
|
|
915
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
916
|
-
response = {
|
|
917
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
918
|
-
name: errorCode,
|
|
919
|
-
$metadata: deserializeMetadata(output),
|
|
920
|
-
};
|
|
921
|
-
break;
|
|
922
|
-
case "NotAuthorizedException":
|
|
923
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
924
|
-
response = {
|
|
925
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
926
|
-
name: errorCode,
|
|
927
|
-
$metadata: deserializeMetadata(output),
|
|
928
|
-
};
|
|
929
|
-
break;
|
|
930
|
-
case "ResourceConflictException":
|
|
931
|
-
case "com.amazonaws.cognitosync#ResourceConflictException":
|
|
932
|
-
response = {
|
|
933
|
-
...(await deserializeAws_restJson1ResourceConflictExceptionResponse(parsedOutput, context)),
|
|
934
|
-
name: errorCode,
|
|
935
|
-
$metadata: deserializeMetadata(output),
|
|
936
|
-
};
|
|
937
|
-
break;
|
|
938
|
-
case "ResourceNotFoundException":
|
|
939
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
940
|
-
response = {
|
|
941
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
942
|
-
name: errorCode,
|
|
943
|
-
$metadata: deserializeMetadata(output),
|
|
944
|
-
};
|
|
945
|
-
break;
|
|
946
|
-
case "TooManyRequestsException":
|
|
947
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
948
|
-
response = {
|
|
949
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
950
|
-
name: errorCode,
|
|
951
|
-
$metadata: deserializeMetadata(output),
|
|
952
|
-
};
|
|
953
|
-
break;
|
|
954
|
-
default:
|
|
955
|
-
const parsedBody = parsedOutput.body;
|
|
956
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
957
|
-
response = {
|
|
958
|
-
...parsedBody,
|
|
959
|
-
name: `${errorCode}`,
|
|
960
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
961
|
-
$fault: "client",
|
|
962
|
-
$metadata: deserializeMetadata(output),
|
|
963
|
-
} as any;
|
|
964
|
-
}
|
|
965
|
-
const message = response.message || response.Message || errorCode;
|
|
966
|
-
response.message = message;
|
|
967
|
-
delete response.Message;
|
|
968
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
969
|
-
};
|
|
970
|
-
|
|
971
|
-
export const deserializeAws_restJson1DescribeDatasetCommand = async (
|
|
972
|
-
output: __HttpResponse,
|
|
973
|
-
context: __SerdeContext
|
|
974
|
-
): Promise<DescribeDatasetCommandOutput> => {
|
|
975
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
976
|
-
return deserializeAws_restJson1DescribeDatasetCommandError(output, context);
|
|
977
|
-
}
|
|
978
|
-
const contents: DescribeDatasetCommandOutput = {
|
|
979
|
-
$metadata: deserializeMetadata(output),
|
|
980
|
-
Dataset: undefined,
|
|
981
|
-
};
|
|
982
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
983
|
-
if (data.Dataset !== undefined && data.Dataset !== null) {
|
|
984
|
-
contents.Dataset = deserializeAws_restJson1Dataset(data.Dataset, context);
|
|
985
|
-
}
|
|
986
|
-
return Promise.resolve(contents);
|
|
987
|
-
};
|
|
988
|
-
|
|
989
|
-
const deserializeAws_restJson1DescribeDatasetCommandError = async (
|
|
990
|
-
output: __HttpResponse,
|
|
991
|
-
context: __SerdeContext
|
|
992
|
-
): Promise<DescribeDatasetCommandOutput> => {
|
|
993
|
-
const parsedOutput: any = {
|
|
994
|
-
...output,
|
|
995
|
-
body: await parseBody(output.body, context),
|
|
996
|
-
};
|
|
997
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
998
|
-
let errorCode: string = "UnknownError";
|
|
999
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1000
|
-
switch (errorCode) {
|
|
1001
|
-
case "InternalErrorException":
|
|
1002
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1003
|
-
response = {
|
|
1004
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1005
|
-
name: errorCode,
|
|
1006
|
-
$metadata: deserializeMetadata(output),
|
|
1007
|
-
};
|
|
1008
|
-
break;
|
|
1009
|
-
case "InvalidParameterException":
|
|
1010
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1011
|
-
response = {
|
|
1012
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1013
|
-
name: errorCode,
|
|
1014
|
-
$metadata: deserializeMetadata(output),
|
|
1015
|
-
};
|
|
1016
|
-
break;
|
|
1017
|
-
case "NotAuthorizedException":
|
|
1018
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1019
|
-
response = {
|
|
1020
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1021
|
-
name: errorCode,
|
|
1022
|
-
$metadata: deserializeMetadata(output),
|
|
1023
|
-
};
|
|
1024
|
-
break;
|
|
1025
|
-
case "ResourceNotFoundException":
|
|
1026
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
1027
|
-
response = {
|
|
1028
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1029
|
-
name: errorCode,
|
|
1030
|
-
$metadata: deserializeMetadata(output),
|
|
1031
|
-
};
|
|
1032
|
-
break;
|
|
1033
|
-
case "TooManyRequestsException":
|
|
1034
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1035
|
-
response = {
|
|
1036
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1037
|
-
name: errorCode,
|
|
1038
|
-
$metadata: deserializeMetadata(output),
|
|
1039
|
-
};
|
|
1040
|
-
break;
|
|
1041
|
-
default:
|
|
1042
|
-
const parsedBody = parsedOutput.body;
|
|
1043
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1044
|
-
response = {
|
|
1045
|
-
...parsedBody,
|
|
1046
|
-
name: `${errorCode}`,
|
|
1047
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1048
|
-
$fault: "client",
|
|
1049
|
-
$metadata: deserializeMetadata(output),
|
|
1050
|
-
} as any;
|
|
1051
|
-
}
|
|
1052
|
-
const message = response.message || response.Message || errorCode;
|
|
1053
|
-
response.message = message;
|
|
1054
|
-
delete response.Message;
|
|
1055
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1056
|
-
};
|
|
1057
|
-
|
|
1058
|
-
export const deserializeAws_restJson1DescribeIdentityPoolUsageCommand = async (
|
|
1059
|
-
output: __HttpResponse,
|
|
1060
|
-
context: __SerdeContext
|
|
1061
|
-
): Promise<DescribeIdentityPoolUsageCommandOutput> => {
|
|
1062
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1063
|
-
return deserializeAws_restJson1DescribeIdentityPoolUsageCommandError(output, context);
|
|
1064
|
-
}
|
|
1065
|
-
const contents: DescribeIdentityPoolUsageCommandOutput = {
|
|
1066
|
-
$metadata: deserializeMetadata(output),
|
|
1067
|
-
IdentityPoolUsage: undefined,
|
|
1068
|
-
};
|
|
1069
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1070
|
-
if (data.IdentityPoolUsage !== undefined && data.IdentityPoolUsage !== null) {
|
|
1071
|
-
contents.IdentityPoolUsage = deserializeAws_restJson1IdentityPoolUsage(data.IdentityPoolUsage, context);
|
|
1072
|
-
}
|
|
1073
|
-
return Promise.resolve(contents);
|
|
1074
|
-
};
|
|
1075
|
-
|
|
1076
|
-
const deserializeAws_restJson1DescribeIdentityPoolUsageCommandError = async (
|
|
1077
|
-
output: __HttpResponse,
|
|
1078
|
-
context: __SerdeContext
|
|
1079
|
-
): Promise<DescribeIdentityPoolUsageCommandOutput> => {
|
|
1080
|
-
const parsedOutput: any = {
|
|
1081
|
-
...output,
|
|
1082
|
-
body: await parseBody(output.body, context),
|
|
1083
|
-
};
|
|
1084
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1085
|
-
let errorCode: string = "UnknownError";
|
|
1086
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1087
|
-
switch (errorCode) {
|
|
1088
|
-
case "InternalErrorException":
|
|
1089
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1090
|
-
response = {
|
|
1091
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1092
|
-
name: errorCode,
|
|
1093
|
-
$metadata: deserializeMetadata(output),
|
|
1094
|
-
};
|
|
1095
|
-
break;
|
|
1096
|
-
case "InvalidParameterException":
|
|
1097
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1098
|
-
response = {
|
|
1099
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1100
|
-
name: errorCode,
|
|
1101
|
-
$metadata: deserializeMetadata(output),
|
|
1102
|
-
};
|
|
1103
|
-
break;
|
|
1104
|
-
case "NotAuthorizedException":
|
|
1105
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1106
|
-
response = {
|
|
1107
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1108
|
-
name: errorCode,
|
|
1109
|
-
$metadata: deserializeMetadata(output),
|
|
1110
|
-
};
|
|
1111
|
-
break;
|
|
1112
|
-
case "ResourceNotFoundException":
|
|
1113
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
1114
|
-
response = {
|
|
1115
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1116
|
-
name: errorCode,
|
|
1117
|
-
$metadata: deserializeMetadata(output),
|
|
1118
|
-
};
|
|
1119
|
-
break;
|
|
1120
|
-
case "TooManyRequestsException":
|
|
1121
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1122
|
-
response = {
|
|
1123
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1124
|
-
name: errorCode,
|
|
1125
|
-
$metadata: deserializeMetadata(output),
|
|
1126
|
-
};
|
|
1127
|
-
break;
|
|
1128
|
-
default:
|
|
1129
|
-
const parsedBody = parsedOutput.body;
|
|
1130
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1131
|
-
response = {
|
|
1132
|
-
...parsedBody,
|
|
1133
|
-
name: `${errorCode}`,
|
|
1134
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1135
|
-
$fault: "client",
|
|
1136
|
-
$metadata: deserializeMetadata(output),
|
|
1137
|
-
} as any;
|
|
1138
|
-
}
|
|
1139
|
-
const message = response.message || response.Message || errorCode;
|
|
1140
|
-
response.message = message;
|
|
1141
|
-
delete response.Message;
|
|
1142
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1143
|
-
};
|
|
1144
|
-
|
|
1145
|
-
export const deserializeAws_restJson1DescribeIdentityUsageCommand = async (
|
|
1146
|
-
output: __HttpResponse,
|
|
1147
|
-
context: __SerdeContext
|
|
1148
|
-
): Promise<DescribeIdentityUsageCommandOutput> => {
|
|
1149
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1150
|
-
return deserializeAws_restJson1DescribeIdentityUsageCommandError(output, context);
|
|
1151
|
-
}
|
|
1152
|
-
const contents: DescribeIdentityUsageCommandOutput = {
|
|
1153
|
-
$metadata: deserializeMetadata(output),
|
|
1154
|
-
IdentityUsage: undefined,
|
|
1155
|
-
};
|
|
1156
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1157
|
-
if (data.IdentityUsage !== undefined && data.IdentityUsage !== null) {
|
|
1158
|
-
contents.IdentityUsage = deserializeAws_restJson1IdentityUsage(data.IdentityUsage, context);
|
|
1159
|
-
}
|
|
1160
|
-
return Promise.resolve(contents);
|
|
1161
|
-
};
|
|
1162
|
-
|
|
1163
|
-
const deserializeAws_restJson1DescribeIdentityUsageCommandError = async (
|
|
1164
|
-
output: __HttpResponse,
|
|
1165
|
-
context: __SerdeContext
|
|
1166
|
-
): Promise<DescribeIdentityUsageCommandOutput> => {
|
|
1167
|
-
const parsedOutput: any = {
|
|
1168
|
-
...output,
|
|
1169
|
-
body: await parseBody(output.body, context),
|
|
1170
|
-
};
|
|
1171
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1172
|
-
let errorCode: string = "UnknownError";
|
|
1173
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1174
|
-
switch (errorCode) {
|
|
1175
|
-
case "InternalErrorException":
|
|
1176
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1177
|
-
response = {
|
|
1178
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1179
|
-
name: errorCode,
|
|
1180
|
-
$metadata: deserializeMetadata(output),
|
|
1181
|
-
};
|
|
1182
|
-
break;
|
|
1183
|
-
case "InvalidParameterException":
|
|
1184
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1185
|
-
response = {
|
|
1186
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1187
|
-
name: errorCode,
|
|
1188
|
-
$metadata: deserializeMetadata(output),
|
|
1189
|
-
};
|
|
1190
|
-
break;
|
|
1191
|
-
case "NotAuthorizedException":
|
|
1192
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1193
|
-
response = {
|
|
1194
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1195
|
-
name: errorCode,
|
|
1196
|
-
$metadata: deserializeMetadata(output),
|
|
1197
|
-
};
|
|
1198
|
-
break;
|
|
1199
|
-
case "ResourceNotFoundException":
|
|
1200
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
1201
|
-
response = {
|
|
1202
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1203
|
-
name: errorCode,
|
|
1204
|
-
$metadata: deserializeMetadata(output),
|
|
1205
|
-
};
|
|
1206
|
-
break;
|
|
1207
|
-
case "TooManyRequestsException":
|
|
1208
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1209
|
-
response = {
|
|
1210
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1211
|
-
name: errorCode,
|
|
1212
|
-
$metadata: deserializeMetadata(output),
|
|
1213
|
-
};
|
|
1214
|
-
break;
|
|
1215
|
-
default:
|
|
1216
|
-
const parsedBody = parsedOutput.body;
|
|
1217
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1218
|
-
response = {
|
|
1219
|
-
...parsedBody,
|
|
1220
|
-
name: `${errorCode}`,
|
|
1221
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1222
|
-
$fault: "client",
|
|
1223
|
-
$metadata: deserializeMetadata(output),
|
|
1224
|
-
} as any;
|
|
1225
|
-
}
|
|
1226
|
-
const message = response.message || response.Message || errorCode;
|
|
1227
|
-
response.message = message;
|
|
1228
|
-
delete response.Message;
|
|
1229
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1230
|
-
};
|
|
1231
|
-
|
|
1232
|
-
export const deserializeAws_restJson1GetBulkPublishDetailsCommand = async (
|
|
1233
|
-
output: __HttpResponse,
|
|
1234
|
-
context: __SerdeContext
|
|
1235
|
-
): Promise<GetBulkPublishDetailsCommandOutput> => {
|
|
1236
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1237
|
-
return deserializeAws_restJson1GetBulkPublishDetailsCommandError(output, context);
|
|
1238
|
-
}
|
|
1239
|
-
const contents: GetBulkPublishDetailsCommandOutput = {
|
|
1240
|
-
$metadata: deserializeMetadata(output),
|
|
1241
|
-
BulkPublishCompleteTime: undefined,
|
|
1242
|
-
BulkPublishStartTime: undefined,
|
|
1243
|
-
BulkPublishStatus: undefined,
|
|
1244
|
-
FailureMessage: undefined,
|
|
1245
|
-
IdentityPoolId: undefined,
|
|
1246
|
-
};
|
|
1247
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1248
|
-
if (data.BulkPublishCompleteTime !== undefined && data.BulkPublishCompleteTime !== null) {
|
|
1249
|
-
contents.BulkPublishCompleteTime = __expectNonNull(
|
|
1250
|
-
__parseEpochTimestamp(__expectNumber(data.BulkPublishCompleteTime))
|
|
1251
|
-
);
|
|
1252
|
-
}
|
|
1253
|
-
if (data.BulkPublishStartTime !== undefined && data.BulkPublishStartTime !== null) {
|
|
1254
|
-
contents.BulkPublishStartTime = __expectNonNull(__parseEpochTimestamp(__expectNumber(data.BulkPublishStartTime)));
|
|
1255
|
-
}
|
|
1256
|
-
if (data.BulkPublishStatus !== undefined && data.BulkPublishStatus !== null) {
|
|
1257
|
-
contents.BulkPublishStatus = __expectString(data.BulkPublishStatus);
|
|
1258
|
-
}
|
|
1259
|
-
if (data.FailureMessage !== undefined && data.FailureMessage !== null) {
|
|
1260
|
-
contents.FailureMessage = __expectString(data.FailureMessage);
|
|
1261
|
-
}
|
|
1262
|
-
if (data.IdentityPoolId !== undefined && data.IdentityPoolId !== null) {
|
|
1263
|
-
contents.IdentityPoolId = __expectString(data.IdentityPoolId);
|
|
1264
|
-
}
|
|
1265
|
-
return Promise.resolve(contents);
|
|
1266
|
-
};
|
|
1267
|
-
|
|
1268
|
-
const deserializeAws_restJson1GetBulkPublishDetailsCommandError = async (
|
|
1269
|
-
output: __HttpResponse,
|
|
1270
|
-
context: __SerdeContext
|
|
1271
|
-
): Promise<GetBulkPublishDetailsCommandOutput> => {
|
|
1272
|
-
const parsedOutput: any = {
|
|
1273
|
-
...output,
|
|
1274
|
-
body: await parseBody(output.body, context),
|
|
1275
|
-
};
|
|
1276
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1277
|
-
let errorCode: string = "UnknownError";
|
|
1278
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1279
|
-
switch (errorCode) {
|
|
1280
|
-
case "InternalErrorException":
|
|
1281
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1282
|
-
response = {
|
|
1283
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1284
|
-
name: errorCode,
|
|
1285
|
-
$metadata: deserializeMetadata(output),
|
|
1286
|
-
};
|
|
1287
|
-
break;
|
|
1288
|
-
case "InvalidParameterException":
|
|
1289
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1290
|
-
response = {
|
|
1291
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1292
|
-
name: errorCode,
|
|
1293
|
-
$metadata: deserializeMetadata(output),
|
|
1294
|
-
};
|
|
1295
|
-
break;
|
|
1296
|
-
case "NotAuthorizedException":
|
|
1297
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1298
|
-
response = {
|
|
1299
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1300
|
-
name: errorCode,
|
|
1301
|
-
$metadata: deserializeMetadata(output),
|
|
1302
|
-
};
|
|
1303
|
-
break;
|
|
1304
|
-
case "ResourceNotFoundException":
|
|
1305
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
1306
|
-
response = {
|
|
1307
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1308
|
-
name: errorCode,
|
|
1309
|
-
$metadata: deserializeMetadata(output),
|
|
1310
|
-
};
|
|
1311
|
-
break;
|
|
1312
|
-
default:
|
|
1313
|
-
const parsedBody = parsedOutput.body;
|
|
1314
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1315
|
-
response = {
|
|
1316
|
-
...parsedBody,
|
|
1317
|
-
name: `${errorCode}`,
|
|
1318
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1319
|
-
$fault: "client",
|
|
1320
|
-
$metadata: deserializeMetadata(output),
|
|
1321
|
-
} as any;
|
|
1322
|
-
}
|
|
1323
|
-
const message = response.message || response.Message || errorCode;
|
|
1324
|
-
response.message = message;
|
|
1325
|
-
delete response.Message;
|
|
1326
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1327
|
-
};
|
|
1328
|
-
|
|
1329
|
-
export const deserializeAws_restJson1GetCognitoEventsCommand = async (
|
|
1330
|
-
output: __HttpResponse,
|
|
1331
|
-
context: __SerdeContext
|
|
1332
|
-
): Promise<GetCognitoEventsCommandOutput> => {
|
|
1333
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1334
|
-
return deserializeAws_restJson1GetCognitoEventsCommandError(output, context);
|
|
1335
|
-
}
|
|
1336
|
-
const contents: GetCognitoEventsCommandOutput = {
|
|
1337
|
-
$metadata: deserializeMetadata(output),
|
|
1338
|
-
Events: undefined,
|
|
1339
|
-
};
|
|
1340
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1341
|
-
if (data.Events !== undefined && data.Events !== null) {
|
|
1342
|
-
contents.Events = deserializeAws_restJson1Events(data.Events, context);
|
|
1343
|
-
}
|
|
1344
|
-
return Promise.resolve(contents);
|
|
1345
|
-
};
|
|
1346
|
-
|
|
1347
|
-
const deserializeAws_restJson1GetCognitoEventsCommandError = async (
|
|
1348
|
-
output: __HttpResponse,
|
|
1349
|
-
context: __SerdeContext
|
|
1350
|
-
): Promise<GetCognitoEventsCommandOutput> => {
|
|
1351
|
-
const parsedOutput: any = {
|
|
1352
|
-
...output,
|
|
1353
|
-
body: await parseBody(output.body, context),
|
|
1354
|
-
};
|
|
1355
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1356
|
-
let errorCode: string = "UnknownError";
|
|
1357
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1358
|
-
switch (errorCode) {
|
|
1359
|
-
case "InternalErrorException":
|
|
1360
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1361
|
-
response = {
|
|
1362
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1363
|
-
name: errorCode,
|
|
1364
|
-
$metadata: deserializeMetadata(output),
|
|
1365
|
-
};
|
|
1366
|
-
break;
|
|
1367
|
-
case "InvalidParameterException":
|
|
1368
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1369
|
-
response = {
|
|
1370
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1371
|
-
name: errorCode,
|
|
1372
|
-
$metadata: deserializeMetadata(output),
|
|
1373
|
-
};
|
|
1374
|
-
break;
|
|
1375
|
-
case "NotAuthorizedException":
|
|
1376
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1377
|
-
response = {
|
|
1378
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1379
|
-
name: errorCode,
|
|
1380
|
-
$metadata: deserializeMetadata(output),
|
|
1381
|
-
};
|
|
1382
|
-
break;
|
|
1383
|
-
case "ResourceNotFoundException":
|
|
1384
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
1385
|
-
response = {
|
|
1386
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1387
|
-
name: errorCode,
|
|
1388
|
-
$metadata: deserializeMetadata(output),
|
|
1389
|
-
};
|
|
1390
|
-
break;
|
|
1391
|
-
case "TooManyRequestsException":
|
|
1392
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1393
|
-
response = {
|
|
1394
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1395
|
-
name: errorCode,
|
|
1396
|
-
$metadata: deserializeMetadata(output),
|
|
1397
|
-
};
|
|
1398
|
-
break;
|
|
1399
|
-
default:
|
|
1400
|
-
const parsedBody = parsedOutput.body;
|
|
1401
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1402
|
-
response = {
|
|
1403
|
-
...parsedBody,
|
|
1404
|
-
name: `${errorCode}`,
|
|
1405
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1406
|
-
$fault: "client",
|
|
1407
|
-
$metadata: deserializeMetadata(output),
|
|
1408
|
-
} as any;
|
|
1409
|
-
}
|
|
1410
|
-
const message = response.message || response.Message || errorCode;
|
|
1411
|
-
response.message = message;
|
|
1412
|
-
delete response.Message;
|
|
1413
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1414
|
-
};
|
|
1415
|
-
|
|
1416
|
-
export const deserializeAws_restJson1GetIdentityPoolConfigurationCommand = async (
|
|
1417
|
-
output: __HttpResponse,
|
|
1418
|
-
context: __SerdeContext
|
|
1419
|
-
): Promise<GetIdentityPoolConfigurationCommandOutput> => {
|
|
1420
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1421
|
-
return deserializeAws_restJson1GetIdentityPoolConfigurationCommandError(output, context);
|
|
1422
|
-
}
|
|
1423
|
-
const contents: GetIdentityPoolConfigurationCommandOutput = {
|
|
1424
|
-
$metadata: deserializeMetadata(output),
|
|
1425
|
-
CognitoStreams: undefined,
|
|
1426
|
-
IdentityPoolId: undefined,
|
|
1427
|
-
PushSync: undefined,
|
|
1428
|
-
};
|
|
1429
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1430
|
-
if (data.CognitoStreams !== undefined && data.CognitoStreams !== null) {
|
|
1431
|
-
contents.CognitoStreams = deserializeAws_restJson1CognitoStreams(data.CognitoStreams, context);
|
|
1432
|
-
}
|
|
1433
|
-
if (data.IdentityPoolId !== undefined && data.IdentityPoolId !== null) {
|
|
1434
|
-
contents.IdentityPoolId = __expectString(data.IdentityPoolId);
|
|
1435
|
-
}
|
|
1436
|
-
if (data.PushSync !== undefined && data.PushSync !== null) {
|
|
1437
|
-
contents.PushSync = deserializeAws_restJson1PushSync(data.PushSync, context);
|
|
1438
|
-
}
|
|
1439
|
-
return Promise.resolve(contents);
|
|
1440
|
-
};
|
|
1441
|
-
|
|
1442
|
-
const deserializeAws_restJson1GetIdentityPoolConfigurationCommandError = async (
|
|
1443
|
-
output: __HttpResponse,
|
|
1444
|
-
context: __SerdeContext
|
|
1445
|
-
): Promise<GetIdentityPoolConfigurationCommandOutput> => {
|
|
1446
|
-
const parsedOutput: any = {
|
|
1447
|
-
...output,
|
|
1448
|
-
body: await parseBody(output.body, context),
|
|
1449
|
-
};
|
|
1450
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1451
|
-
let errorCode: string = "UnknownError";
|
|
1452
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1453
|
-
switch (errorCode) {
|
|
1454
|
-
case "InternalErrorException":
|
|
1455
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1456
|
-
response = {
|
|
1457
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1458
|
-
name: errorCode,
|
|
1459
|
-
$metadata: deserializeMetadata(output),
|
|
1460
|
-
};
|
|
1461
|
-
break;
|
|
1462
|
-
case "InvalidParameterException":
|
|
1463
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1464
|
-
response = {
|
|
1465
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1466
|
-
name: errorCode,
|
|
1467
|
-
$metadata: deserializeMetadata(output),
|
|
1468
|
-
};
|
|
1469
|
-
break;
|
|
1470
|
-
case "NotAuthorizedException":
|
|
1471
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1472
|
-
response = {
|
|
1473
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1474
|
-
name: errorCode,
|
|
1475
|
-
$metadata: deserializeMetadata(output),
|
|
1476
|
-
};
|
|
1477
|
-
break;
|
|
1478
|
-
case "ResourceNotFoundException":
|
|
1479
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
1480
|
-
response = {
|
|
1481
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1482
|
-
name: errorCode,
|
|
1483
|
-
$metadata: deserializeMetadata(output),
|
|
1484
|
-
};
|
|
1485
|
-
break;
|
|
1486
|
-
case "TooManyRequestsException":
|
|
1487
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1488
|
-
response = {
|
|
1489
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1490
|
-
name: errorCode,
|
|
1491
|
-
$metadata: deserializeMetadata(output),
|
|
1492
|
-
};
|
|
1493
|
-
break;
|
|
1494
|
-
default:
|
|
1495
|
-
const parsedBody = parsedOutput.body;
|
|
1496
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1497
|
-
response = {
|
|
1498
|
-
...parsedBody,
|
|
1499
|
-
name: `${errorCode}`,
|
|
1500
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1501
|
-
$fault: "client",
|
|
1502
|
-
$metadata: deserializeMetadata(output),
|
|
1503
|
-
} as any;
|
|
1504
|
-
}
|
|
1505
|
-
const message = response.message || response.Message || errorCode;
|
|
1506
|
-
response.message = message;
|
|
1507
|
-
delete response.Message;
|
|
1508
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1509
|
-
};
|
|
1510
|
-
|
|
1511
|
-
export const deserializeAws_restJson1ListDatasetsCommand = async (
|
|
1512
|
-
output: __HttpResponse,
|
|
1513
|
-
context: __SerdeContext
|
|
1514
|
-
): Promise<ListDatasetsCommandOutput> => {
|
|
1515
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1516
|
-
return deserializeAws_restJson1ListDatasetsCommandError(output, context);
|
|
1517
|
-
}
|
|
1518
|
-
const contents: ListDatasetsCommandOutput = {
|
|
1519
|
-
$metadata: deserializeMetadata(output),
|
|
1520
|
-
Count: undefined,
|
|
1521
|
-
Datasets: undefined,
|
|
1522
|
-
NextToken: undefined,
|
|
1523
|
-
};
|
|
1524
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1525
|
-
if (data.Count !== undefined && data.Count !== null) {
|
|
1526
|
-
contents.Count = __expectInt32(data.Count);
|
|
1527
|
-
}
|
|
1528
|
-
if (data.Datasets !== undefined && data.Datasets !== null) {
|
|
1529
|
-
contents.Datasets = deserializeAws_restJson1DatasetList(data.Datasets, context);
|
|
1530
|
-
}
|
|
1531
|
-
if (data.NextToken !== undefined && data.NextToken !== null) {
|
|
1532
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
1533
|
-
}
|
|
1534
|
-
return Promise.resolve(contents);
|
|
1535
|
-
};
|
|
1536
|
-
|
|
1537
|
-
const deserializeAws_restJson1ListDatasetsCommandError = async (
|
|
1538
|
-
output: __HttpResponse,
|
|
1539
|
-
context: __SerdeContext
|
|
1540
|
-
): Promise<ListDatasetsCommandOutput> => {
|
|
1541
|
-
const parsedOutput: any = {
|
|
1542
|
-
...output,
|
|
1543
|
-
body: await parseBody(output.body, context),
|
|
1544
|
-
};
|
|
1545
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1546
|
-
let errorCode: string = "UnknownError";
|
|
1547
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1548
|
-
switch (errorCode) {
|
|
1549
|
-
case "InternalErrorException":
|
|
1550
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1551
|
-
response = {
|
|
1552
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1553
|
-
name: errorCode,
|
|
1554
|
-
$metadata: deserializeMetadata(output),
|
|
1555
|
-
};
|
|
1556
|
-
break;
|
|
1557
|
-
case "InvalidParameterException":
|
|
1558
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1559
|
-
response = {
|
|
1560
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1561
|
-
name: errorCode,
|
|
1562
|
-
$metadata: deserializeMetadata(output),
|
|
1563
|
-
};
|
|
1564
|
-
break;
|
|
1565
|
-
case "NotAuthorizedException":
|
|
1566
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1567
|
-
response = {
|
|
1568
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1569
|
-
name: errorCode,
|
|
1570
|
-
$metadata: deserializeMetadata(output),
|
|
1571
|
-
};
|
|
1572
|
-
break;
|
|
1573
|
-
case "TooManyRequestsException":
|
|
1574
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1575
|
-
response = {
|
|
1576
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1577
|
-
name: errorCode,
|
|
1578
|
-
$metadata: deserializeMetadata(output),
|
|
1579
|
-
};
|
|
1580
|
-
break;
|
|
1581
|
-
default:
|
|
1582
|
-
const parsedBody = parsedOutput.body;
|
|
1583
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1584
|
-
response = {
|
|
1585
|
-
...parsedBody,
|
|
1586
|
-
name: `${errorCode}`,
|
|
1587
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1588
|
-
$fault: "client",
|
|
1589
|
-
$metadata: deserializeMetadata(output),
|
|
1590
|
-
} as any;
|
|
1591
|
-
}
|
|
1592
|
-
const message = response.message || response.Message || errorCode;
|
|
1593
|
-
response.message = message;
|
|
1594
|
-
delete response.Message;
|
|
1595
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1596
|
-
};
|
|
1597
|
-
|
|
1598
|
-
export const deserializeAws_restJson1ListIdentityPoolUsageCommand = async (
|
|
1599
|
-
output: __HttpResponse,
|
|
1600
|
-
context: __SerdeContext
|
|
1601
|
-
): Promise<ListIdentityPoolUsageCommandOutput> => {
|
|
1602
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1603
|
-
return deserializeAws_restJson1ListIdentityPoolUsageCommandError(output, context);
|
|
1604
|
-
}
|
|
1605
|
-
const contents: ListIdentityPoolUsageCommandOutput = {
|
|
1606
|
-
$metadata: deserializeMetadata(output),
|
|
1607
|
-
Count: undefined,
|
|
1608
|
-
IdentityPoolUsages: undefined,
|
|
1609
|
-
MaxResults: undefined,
|
|
1610
|
-
NextToken: undefined,
|
|
1611
|
-
};
|
|
1612
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1613
|
-
if (data.Count !== undefined && data.Count !== null) {
|
|
1614
|
-
contents.Count = __expectInt32(data.Count);
|
|
1615
|
-
}
|
|
1616
|
-
if (data.IdentityPoolUsages !== undefined && data.IdentityPoolUsages !== null) {
|
|
1617
|
-
contents.IdentityPoolUsages = deserializeAws_restJson1IdentityPoolUsageList(data.IdentityPoolUsages, context);
|
|
1618
|
-
}
|
|
1619
|
-
if (data.MaxResults !== undefined && data.MaxResults !== null) {
|
|
1620
|
-
contents.MaxResults = __expectInt32(data.MaxResults);
|
|
1621
|
-
}
|
|
1622
|
-
if (data.NextToken !== undefined && data.NextToken !== null) {
|
|
1623
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
1624
|
-
}
|
|
1625
|
-
return Promise.resolve(contents);
|
|
1626
|
-
};
|
|
1627
|
-
|
|
1628
|
-
const deserializeAws_restJson1ListIdentityPoolUsageCommandError = async (
|
|
1629
|
-
output: __HttpResponse,
|
|
1630
|
-
context: __SerdeContext
|
|
1631
|
-
): Promise<ListIdentityPoolUsageCommandOutput> => {
|
|
1632
|
-
const parsedOutput: any = {
|
|
1633
|
-
...output,
|
|
1634
|
-
body: await parseBody(output.body, context),
|
|
1635
|
-
};
|
|
1636
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1637
|
-
let errorCode: string = "UnknownError";
|
|
1638
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1639
|
-
switch (errorCode) {
|
|
1640
|
-
case "InternalErrorException":
|
|
1641
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1642
|
-
response = {
|
|
1643
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1644
|
-
name: errorCode,
|
|
1645
|
-
$metadata: deserializeMetadata(output),
|
|
1646
|
-
};
|
|
1647
|
-
break;
|
|
1648
|
-
case "InvalidParameterException":
|
|
1649
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1650
|
-
response = {
|
|
1651
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1652
|
-
name: errorCode,
|
|
1653
|
-
$metadata: deserializeMetadata(output),
|
|
1654
|
-
};
|
|
1655
|
-
break;
|
|
1656
|
-
case "NotAuthorizedException":
|
|
1657
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1658
|
-
response = {
|
|
1659
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1660
|
-
name: errorCode,
|
|
1661
|
-
$metadata: deserializeMetadata(output),
|
|
1662
|
-
};
|
|
1663
|
-
break;
|
|
1664
|
-
case "TooManyRequestsException":
|
|
1665
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1666
|
-
response = {
|
|
1667
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1668
|
-
name: errorCode,
|
|
1669
|
-
$metadata: deserializeMetadata(output),
|
|
1670
|
-
};
|
|
1671
|
-
break;
|
|
1672
|
-
default:
|
|
1673
|
-
const parsedBody = parsedOutput.body;
|
|
1674
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1675
|
-
response = {
|
|
1676
|
-
...parsedBody,
|
|
1677
|
-
name: `${errorCode}`,
|
|
1678
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1679
|
-
$fault: "client",
|
|
1680
|
-
$metadata: deserializeMetadata(output),
|
|
1681
|
-
} as any;
|
|
1682
|
-
}
|
|
1683
|
-
const message = response.message || response.Message || errorCode;
|
|
1684
|
-
response.message = message;
|
|
1685
|
-
delete response.Message;
|
|
1686
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1687
|
-
};
|
|
1688
|
-
|
|
1689
|
-
export const deserializeAws_restJson1ListRecordsCommand = async (
|
|
1690
|
-
output: __HttpResponse,
|
|
1691
|
-
context: __SerdeContext
|
|
1692
|
-
): Promise<ListRecordsCommandOutput> => {
|
|
1693
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1694
|
-
return deserializeAws_restJson1ListRecordsCommandError(output, context);
|
|
1695
|
-
}
|
|
1696
|
-
const contents: ListRecordsCommandOutput = {
|
|
1697
|
-
$metadata: deserializeMetadata(output),
|
|
1698
|
-
Count: undefined,
|
|
1699
|
-
DatasetDeletedAfterRequestedSyncCount: undefined,
|
|
1700
|
-
DatasetExists: undefined,
|
|
1701
|
-
DatasetSyncCount: undefined,
|
|
1702
|
-
LastModifiedBy: undefined,
|
|
1703
|
-
MergedDatasetNames: undefined,
|
|
1704
|
-
NextToken: undefined,
|
|
1705
|
-
Records: undefined,
|
|
1706
|
-
SyncSessionToken: undefined,
|
|
1707
|
-
};
|
|
1708
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1709
|
-
if (data.Count !== undefined && data.Count !== null) {
|
|
1710
|
-
contents.Count = __expectInt32(data.Count);
|
|
1711
|
-
}
|
|
1712
|
-
if (data.DatasetDeletedAfterRequestedSyncCount !== undefined && data.DatasetDeletedAfterRequestedSyncCount !== null) {
|
|
1713
|
-
contents.DatasetDeletedAfterRequestedSyncCount = __expectBoolean(data.DatasetDeletedAfterRequestedSyncCount);
|
|
1714
|
-
}
|
|
1715
|
-
if (data.DatasetExists !== undefined && data.DatasetExists !== null) {
|
|
1716
|
-
contents.DatasetExists = __expectBoolean(data.DatasetExists);
|
|
1717
|
-
}
|
|
1718
|
-
if (data.DatasetSyncCount !== undefined && data.DatasetSyncCount !== null) {
|
|
1719
|
-
contents.DatasetSyncCount = __expectLong(data.DatasetSyncCount);
|
|
1720
|
-
}
|
|
1721
|
-
if (data.LastModifiedBy !== undefined && data.LastModifiedBy !== null) {
|
|
1722
|
-
contents.LastModifiedBy = __expectString(data.LastModifiedBy);
|
|
1723
|
-
}
|
|
1724
|
-
if (data.MergedDatasetNames !== undefined && data.MergedDatasetNames !== null) {
|
|
1725
|
-
contents.MergedDatasetNames = deserializeAws_restJson1MergedDatasetNameList(data.MergedDatasetNames, context);
|
|
1726
|
-
}
|
|
1727
|
-
if (data.NextToken !== undefined && data.NextToken !== null) {
|
|
1728
|
-
contents.NextToken = __expectString(data.NextToken);
|
|
1729
|
-
}
|
|
1730
|
-
if (data.Records !== undefined && data.Records !== null) {
|
|
1731
|
-
contents.Records = deserializeAws_restJson1RecordList(data.Records, context);
|
|
1732
|
-
}
|
|
1733
|
-
if (data.SyncSessionToken !== undefined && data.SyncSessionToken !== null) {
|
|
1734
|
-
contents.SyncSessionToken = __expectString(data.SyncSessionToken);
|
|
1735
|
-
}
|
|
1736
|
-
return Promise.resolve(contents);
|
|
1737
|
-
};
|
|
1738
|
-
|
|
1739
|
-
const deserializeAws_restJson1ListRecordsCommandError = async (
|
|
1740
|
-
output: __HttpResponse,
|
|
1741
|
-
context: __SerdeContext
|
|
1742
|
-
): Promise<ListRecordsCommandOutput> => {
|
|
1743
|
-
const parsedOutput: any = {
|
|
1744
|
-
...output,
|
|
1745
|
-
body: await parseBody(output.body, context),
|
|
1746
|
-
};
|
|
1747
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1748
|
-
let errorCode: string = "UnknownError";
|
|
1749
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1750
|
-
switch (errorCode) {
|
|
1751
|
-
case "InternalErrorException":
|
|
1752
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1753
|
-
response = {
|
|
1754
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1755
|
-
name: errorCode,
|
|
1756
|
-
$metadata: deserializeMetadata(output),
|
|
1757
|
-
};
|
|
1758
|
-
break;
|
|
1759
|
-
case "InvalidParameterException":
|
|
1760
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1761
|
-
response = {
|
|
1762
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1763
|
-
name: errorCode,
|
|
1764
|
-
$metadata: deserializeMetadata(output),
|
|
1765
|
-
};
|
|
1766
|
-
break;
|
|
1767
|
-
case "NotAuthorizedException":
|
|
1768
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1769
|
-
response = {
|
|
1770
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1771
|
-
name: errorCode,
|
|
1772
|
-
$metadata: deserializeMetadata(output),
|
|
1773
|
-
};
|
|
1774
|
-
break;
|
|
1775
|
-
case "TooManyRequestsException":
|
|
1776
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1777
|
-
response = {
|
|
1778
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1779
|
-
name: errorCode,
|
|
1780
|
-
$metadata: deserializeMetadata(output),
|
|
1781
|
-
};
|
|
1782
|
-
break;
|
|
1783
|
-
default:
|
|
1784
|
-
const parsedBody = parsedOutput.body;
|
|
1785
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1786
|
-
response = {
|
|
1787
|
-
...parsedBody,
|
|
1788
|
-
name: `${errorCode}`,
|
|
1789
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1790
|
-
$fault: "client",
|
|
1791
|
-
$metadata: deserializeMetadata(output),
|
|
1792
|
-
} as any;
|
|
1793
|
-
}
|
|
1794
|
-
const message = response.message || response.Message || errorCode;
|
|
1795
|
-
response.message = message;
|
|
1796
|
-
delete response.Message;
|
|
1797
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1798
|
-
};
|
|
1799
|
-
|
|
1800
|
-
export const deserializeAws_restJson1RegisterDeviceCommand = async (
|
|
1801
|
-
output: __HttpResponse,
|
|
1802
|
-
context: __SerdeContext
|
|
1803
|
-
): Promise<RegisterDeviceCommandOutput> => {
|
|
1804
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1805
|
-
return deserializeAws_restJson1RegisterDeviceCommandError(output, context);
|
|
1806
|
-
}
|
|
1807
|
-
const contents: RegisterDeviceCommandOutput = {
|
|
1808
|
-
$metadata: deserializeMetadata(output),
|
|
1809
|
-
DeviceId: undefined,
|
|
1810
|
-
};
|
|
1811
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1812
|
-
if (data.DeviceId !== undefined && data.DeviceId !== null) {
|
|
1813
|
-
contents.DeviceId = __expectString(data.DeviceId);
|
|
1814
|
-
}
|
|
1815
|
-
return Promise.resolve(contents);
|
|
1816
|
-
};
|
|
1817
|
-
|
|
1818
|
-
const deserializeAws_restJson1RegisterDeviceCommandError = async (
|
|
1819
|
-
output: __HttpResponse,
|
|
1820
|
-
context: __SerdeContext
|
|
1821
|
-
): Promise<RegisterDeviceCommandOutput> => {
|
|
1822
|
-
const parsedOutput: any = {
|
|
1823
|
-
...output,
|
|
1824
|
-
body: await parseBody(output.body, context),
|
|
1825
|
-
};
|
|
1826
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1827
|
-
let errorCode: string = "UnknownError";
|
|
1828
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1829
|
-
switch (errorCode) {
|
|
1830
|
-
case "InternalErrorException":
|
|
1831
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1832
|
-
response = {
|
|
1833
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1834
|
-
name: errorCode,
|
|
1835
|
-
$metadata: deserializeMetadata(output),
|
|
1836
|
-
};
|
|
1837
|
-
break;
|
|
1838
|
-
case "InvalidConfigurationException":
|
|
1839
|
-
case "com.amazonaws.cognitosync#InvalidConfigurationException":
|
|
1840
|
-
response = {
|
|
1841
|
-
...(await deserializeAws_restJson1InvalidConfigurationExceptionResponse(parsedOutput, context)),
|
|
1842
|
-
name: errorCode,
|
|
1843
|
-
$metadata: deserializeMetadata(output),
|
|
1844
|
-
};
|
|
1845
|
-
break;
|
|
1846
|
-
case "InvalidParameterException":
|
|
1847
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1848
|
-
response = {
|
|
1849
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1850
|
-
name: errorCode,
|
|
1851
|
-
$metadata: deserializeMetadata(output),
|
|
1852
|
-
};
|
|
1853
|
-
break;
|
|
1854
|
-
case "NotAuthorizedException":
|
|
1855
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1856
|
-
response = {
|
|
1857
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1858
|
-
name: errorCode,
|
|
1859
|
-
$metadata: deserializeMetadata(output),
|
|
1860
|
-
};
|
|
1861
|
-
break;
|
|
1862
|
-
case "ResourceNotFoundException":
|
|
1863
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
1864
|
-
response = {
|
|
1865
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1866
|
-
name: errorCode,
|
|
1867
|
-
$metadata: deserializeMetadata(output),
|
|
1868
|
-
};
|
|
1869
|
-
break;
|
|
1870
|
-
case "TooManyRequestsException":
|
|
1871
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1872
|
-
response = {
|
|
1873
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1874
|
-
name: errorCode,
|
|
1875
|
-
$metadata: deserializeMetadata(output),
|
|
1876
|
-
};
|
|
1877
|
-
break;
|
|
1878
|
-
default:
|
|
1879
|
-
const parsedBody = parsedOutput.body;
|
|
1880
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1881
|
-
response = {
|
|
1882
|
-
...parsedBody,
|
|
1883
|
-
name: `${errorCode}`,
|
|
1884
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1885
|
-
$fault: "client",
|
|
1886
|
-
$metadata: deserializeMetadata(output),
|
|
1887
|
-
} as any;
|
|
1888
|
-
}
|
|
1889
|
-
const message = response.message || response.Message || errorCode;
|
|
1890
|
-
response.message = message;
|
|
1891
|
-
delete response.Message;
|
|
1892
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1893
|
-
};
|
|
1894
|
-
|
|
1895
|
-
export const deserializeAws_restJson1SetCognitoEventsCommand = async (
|
|
1896
|
-
output: __HttpResponse,
|
|
1897
|
-
context: __SerdeContext
|
|
1898
|
-
): Promise<SetCognitoEventsCommandOutput> => {
|
|
1899
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1900
|
-
return deserializeAws_restJson1SetCognitoEventsCommandError(output, context);
|
|
1901
|
-
}
|
|
1902
|
-
const contents: SetCognitoEventsCommandOutput = {
|
|
1903
|
-
$metadata: deserializeMetadata(output),
|
|
1904
|
-
};
|
|
1905
|
-
await collectBody(output.body, context);
|
|
1906
|
-
return Promise.resolve(contents);
|
|
1907
|
-
};
|
|
1908
|
-
|
|
1909
|
-
const deserializeAws_restJson1SetCognitoEventsCommandError = async (
|
|
1910
|
-
output: __HttpResponse,
|
|
1911
|
-
context: __SerdeContext
|
|
1912
|
-
): Promise<SetCognitoEventsCommandOutput> => {
|
|
1913
|
-
const parsedOutput: any = {
|
|
1914
|
-
...output,
|
|
1915
|
-
body: await parseBody(output.body, context),
|
|
1916
|
-
};
|
|
1917
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
1918
|
-
let errorCode: string = "UnknownError";
|
|
1919
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1920
|
-
switch (errorCode) {
|
|
1921
|
-
case "InternalErrorException":
|
|
1922
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
1923
|
-
response = {
|
|
1924
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
1925
|
-
name: errorCode,
|
|
1926
|
-
$metadata: deserializeMetadata(output),
|
|
1927
|
-
};
|
|
1928
|
-
break;
|
|
1929
|
-
case "InvalidParameterException":
|
|
1930
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
1931
|
-
response = {
|
|
1932
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
1933
|
-
name: errorCode,
|
|
1934
|
-
$metadata: deserializeMetadata(output),
|
|
1935
|
-
};
|
|
1936
|
-
break;
|
|
1937
|
-
case "NotAuthorizedException":
|
|
1938
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
1939
|
-
response = {
|
|
1940
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
1941
|
-
name: errorCode,
|
|
1942
|
-
$metadata: deserializeMetadata(output),
|
|
1943
|
-
};
|
|
1944
|
-
break;
|
|
1945
|
-
case "ResourceNotFoundException":
|
|
1946
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
1947
|
-
response = {
|
|
1948
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
1949
|
-
name: errorCode,
|
|
1950
|
-
$metadata: deserializeMetadata(output),
|
|
1951
|
-
};
|
|
1952
|
-
break;
|
|
1953
|
-
case "TooManyRequestsException":
|
|
1954
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
1955
|
-
response = {
|
|
1956
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
1957
|
-
name: errorCode,
|
|
1958
|
-
$metadata: deserializeMetadata(output),
|
|
1959
|
-
};
|
|
1960
|
-
break;
|
|
1961
|
-
default:
|
|
1962
|
-
const parsedBody = parsedOutput.body;
|
|
1963
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
1964
|
-
response = {
|
|
1965
|
-
...parsedBody,
|
|
1966
|
-
name: `${errorCode}`,
|
|
1967
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
1968
|
-
$fault: "client",
|
|
1969
|
-
$metadata: deserializeMetadata(output),
|
|
1970
|
-
} as any;
|
|
1971
|
-
}
|
|
1972
|
-
const message = response.message || response.Message || errorCode;
|
|
1973
|
-
response.message = message;
|
|
1974
|
-
delete response.Message;
|
|
1975
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
1976
|
-
};
|
|
1977
|
-
|
|
1978
|
-
export const deserializeAws_restJson1SetIdentityPoolConfigurationCommand = async (
|
|
1979
|
-
output: __HttpResponse,
|
|
1980
|
-
context: __SerdeContext
|
|
1981
|
-
): Promise<SetIdentityPoolConfigurationCommandOutput> => {
|
|
1982
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1983
|
-
return deserializeAws_restJson1SetIdentityPoolConfigurationCommandError(output, context);
|
|
1984
|
-
}
|
|
1985
|
-
const contents: SetIdentityPoolConfigurationCommandOutput = {
|
|
1986
|
-
$metadata: deserializeMetadata(output),
|
|
1987
|
-
CognitoStreams: undefined,
|
|
1988
|
-
IdentityPoolId: undefined,
|
|
1989
|
-
PushSync: undefined,
|
|
1990
|
-
};
|
|
1991
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1992
|
-
if (data.CognitoStreams !== undefined && data.CognitoStreams !== null) {
|
|
1993
|
-
contents.CognitoStreams = deserializeAws_restJson1CognitoStreams(data.CognitoStreams, context);
|
|
1994
|
-
}
|
|
1995
|
-
if (data.IdentityPoolId !== undefined && data.IdentityPoolId !== null) {
|
|
1996
|
-
contents.IdentityPoolId = __expectString(data.IdentityPoolId);
|
|
1997
|
-
}
|
|
1998
|
-
if (data.PushSync !== undefined && data.PushSync !== null) {
|
|
1999
|
-
contents.PushSync = deserializeAws_restJson1PushSync(data.PushSync, context);
|
|
2000
|
-
}
|
|
2001
|
-
return Promise.resolve(contents);
|
|
2002
|
-
};
|
|
2003
|
-
|
|
2004
|
-
const deserializeAws_restJson1SetIdentityPoolConfigurationCommandError = async (
|
|
2005
|
-
output: __HttpResponse,
|
|
2006
|
-
context: __SerdeContext
|
|
2007
|
-
): Promise<SetIdentityPoolConfigurationCommandOutput> => {
|
|
2008
|
-
const parsedOutput: any = {
|
|
2009
|
-
...output,
|
|
2010
|
-
body: await parseBody(output.body, context),
|
|
2011
|
-
};
|
|
2012
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
2013
|
-
let errorCode: string = "UnknownError";
|
|
2014
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2015
|
-
switch (errorCode) {
|
|
2016
|
-
case "ConcurrentModificationException":
|
|
2017
|
-
case "com.amazonaws.cognitosync#ConcurrentModificationException":
|
|
2018
|
-
response = {
|
|
2019
|
-
...(await deserializeAws_restJson1ConcurrentModificationExceptionResponse(parsedOutput, context)),
|
|
2020
|
-
name: errorCode,
|
|
2021
|
-
$metadata: deserializeMetadata(output),
|
|
2022
|
-
};
|
|
2023
|
-
break;
|
|
2024
|
-
case "InternalErrorException":
|
|
2025
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
2026
|
-
response = {
|
|
2027
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
2028
|
-
name: errorCode,
|
|
2029
|
-
$metadata: deserializeMetadata(output),
|
|
2030
|
-
};
|
|
2031
|
-
break;
|
|
2032
|
-
case "InvalidParameterException":
|
|
2033
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
2034
|
-
response = {
|
|
2035
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
2036
|
-
name: errorCode,
|
|
2037
|
-
$metadata: deserializeMetadata(output),
|
|
2038
|
-
};
|
|
2039
|
-
break;
|
|
2040
|
-
case "NotAuthorizedException":
|
|
2041
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
2042
|
-
response = {
|
|
2043
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
2044
|
-
name: errorCode,
|
|
2045
|
-
$metadata: deserializeMetadata(output),
|
|
2046
|
-
};
|
|
2047
|
-
break;
|
|
2048
|
-
case "ResourceNotFoundException":
|
|
2049
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
2050
|
-
response = {
|
|
2051
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2052
|
-
name: errorCode,
|
|
2053
|
-
$metadata: deserializeMetadata(output),
|
|
2054
|
-
};
|
|
2055
|
-
break;
|
|
2056
|
-
case "TooManyRequestsException":
|
|
2057
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
2058
|
-
response = {
|
|
2059
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
2060
|
-
name: errorCode,
|
|
2061
|
-
$metadata: deserializeMetadata(output),
|
|
2062
|
-
};
|
|
2063
|
-
break;
|
|
2064
|
-
default:
|
|
2065
|
-
const parsedBody = parsedOutput.body;
|
|
2066
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2067
|
-
response = {
|
|
2068
|
-
...parsedBody,
|
|
2069
|
-
name: `${errorCode}`,
|
|
2070
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2071
|
-
$fault: "client",
|
|
2072
|
-
$metadata: deserializeMetadata(output),
|
|
2073
|
-
} as any;
|
|
2074
|
-
}
|
|
2075
|
-
const message = response.message || response.Message || errorCode;
|
|
2076
|
-
response.message = message;
|
|
2077
|
-
delete response.Message;
|
|
2078
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
2079
|
-
};
|
|
2080
|
-
|
|
2081
|
-
export const deserializeAws_restJson1SubscribeToDatasetCommand = async (
|
|
2082
|
-
output: __HttpResponse,
|
|
2083
|
-
context: __SerdeContext
|
|
2084
|
-
): Promise<SubscribeToDatasetCommandOutput> => {
|
|
2085
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2086
|
-
return deserializeAws_restJson1SubscribeToDatasetCommandError(output, context);
|
|
2087
|
-
}
|
|
2088
|
-
const contents: SubscribeToDatasetCommandOutput = {
|
|
2089
|
-
$metadata: deserializeMetadata(output),
|
|
2090
|
-
};
|
|
2091
|
-
await collectBody(output.body, context);
|
|
2092
|
-
return Promise.resolve(contents);
|
|
2093
|
-
};
|
|
2094
|
-
|
|
2095
|
-
const deserializeAws_restJson1SubscribeToDatasetCommandError = async (
|
|
2096
|
-
output: __HttpResponse,
|
|
2097
|
-
context: __SerdeContext
|
|
2098
|
-
): Promise<SubscribeToDatasetCommandOutput> => {
|
|
2099
|
-
const parsedOutput: any = {
|
|
2100
|
-
...output,
|
|
2101
|
-
body: await parseBody(output.body, context),
|
|
2102
|
-
};
|
|
2103
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
2104
|
-
let errorCode: string = "UnknownError";
|
|
2105
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2106
|
-
switch (errorCode) {
|
|
2107
|
-
case "InternalErrorException":
|
|
2108
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
2109
|
-
response = {
|
|
2110
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
2111
|
-
name: errorCode,
|
|
2112
|
-
$metadata: deserializeMetadata(output),
|
|
2113
|
-
};
|
|
2114
|
-
break;
|
|
2115
|
-
case "InvalidConfigurationException":
|
|
2116
|
-
case "com.amazonaws.cognitosync#InvalidConfigurationException":
|
|
2117
|
-
response = {
|
|
2118
|
-
...(await deserializeAws_restJson1InvalidConfigurationExceptionResponse(parsedOutput, context)),
|
|
2119
|
-
name: errorCode,
|
|
2120
|
-
$metadata: deserializeMetadata(output),
|
|
2121
|
-
};
|
|
2122
|
-
break;
|
|
2123
|
-
case "InvalidParameterException":
|
|
2124
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
2125
|
-
response = {
|
|
2126
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
2127
|
-
name: errorCode,
|
|
2128
|
-
$metadata: deserializeMetadata(output),
|
|
2129
|
-
};
|
|
2130
|
-
break;
|
|
2131
|
-
case "NotAuthorizedException":
|
|
2132
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
2133
|
-
response = {
|
|
2134
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
2135
|
-
name: errorCode,
|
|
2136
|
-
$metadata: deserializeMetadata(output),
|
|
2137
|
-
};
|
|
2138
|
-
break;
|
|
2139
|
-
case "ResourceNotFoundException":
|
|
2140
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
2141
|
-
response = {
|
|
2142
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2143
|
-
name: errorCode,
|
|
2144
|
-
$metadata: deserializeMetadata(output),
|
|
2145
|
-
};
|
|
2146
|
-
break;
|
|
2147
|
-
case "TooManyRequestsException":
|
|
2148
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
2149
|
-
response = {
|
|
2150
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
2151
|
-
name: errorCode,
|
|
2152
|
-
$metadata: deserializeMetadata(output),
|
|
2153
|
-
};
|
|
2154
|
-
break;
|
|
2155
|
-
default:
|
|
2156
|
-
const parsedBody = parsedOutput.body;
|
|
2157
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2158
|
-
response = {
|
|
2159
|
-
...parsedBody,
|
|
2160
|
-
name: `${errorCode}`,
|
|
2161
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2162
|
-
$fault: "client",
|
|
2163
|
-
$metadata: deserializeMetadata(output),
|
|
2164
|
-
} as any;
|
|
2165
|
-
}
|
|
2166
|
-
const message = response.message || response.Message || errorCode;
|
|
2167
|
-
response.message = message;
|
|
2168
|
-
delete response.Message;
|
|
2169
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
2170
|
-
};
|
|
2171
|
-
|
|
2172
|
-
export const deserializeAws_restJson1UnsubscribeFromDatasetCommand = async (
|
|
2173
|
-
output: __HttpResponse,
|
|
2174
|
-
context: __SerdeContext
|
|
2175
|
-
): Promise<UnsubscribeFromDatasetCommandOutput> => {
|
|
2176
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2177
|
-
return deserializeAws_restJson1UnsubscribeFromDatasetCommandError(output, context);
|
|
2178
|
-
}
|
|
2179
|
-
const contents: UnsubscribeFromDatasetCommandOutput = {
|
|
2180
|
-
$metadata: deserializeMetadata(output),
|
|
2181
|
-
};
|
|
2182
|
-
await collectBody(output.body, context);
|
|
2183
|
-
return Promise.resolve(contents);
|
|
2184
|
-
};
|
|
2185
|
-
|
|
2186
|
-
const deserializeAws_restJson1UnsubscribeFromDatasetCommandError = async (
|
|
2187
|
-
output: __HttpResponse,
|
|
2188
|
-
context: __SerdeContext
|
|
2189
|
-
): Promise<UnsubscribeFromDatasetCommandOutput> => {
|
|
2190
|
-
const parsedOutput: any = {
|
|
2191
|
-
...output,
|
|
2192
|
-
body: await parseBody(output.body, context),
|
|
2193
|
-
};
|
|
2194
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
2195
|
-
let errorCode: string = "UnknownError";
|
|
2196
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2197
|
-
switch (errorCode) {
|
|
2198
|
-
case "InternalErrorException":
|
|
2199
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
2200
|
-
response = {
|
|
2201
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
2202
|
-
name: errorCode,
|
|
2203
|
-
$metadata: deserializeMetadata(output),
|
|
2204
|
-
};
|
|
2205
|
-
break;
|
|
2206
|
-
case "InvalidConfigurationException":
|
|
2207
|
-
case "com.amazonaws.cognitosync#InvalidConfigurationException":
|
|
2208
|
-
response = {
|
|
2209
|
-
...(await deserializeAws_restJson1InvalidConfigurationExceptionResponse(parsedOutput, context)),
|
|
2210
|
-
name: errorCode,
|
|
2211
|
-
$metadata: deserializeMetadata(output),
|
|
2212
|
-
};
|
|
2213
|
-
break;
|
|
2214
|
-
case "InvalidParameterException":
|
|
2215
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
2216
|
-
response = {
|
|
2217
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
2218
|
-
name: errorCode,
|
|
2219
|
-
$metadata: deserializeMetadata(output),
|
|
2220
|
-
};
|
|
2221
|
-
break;
|
|
2222
|
-
case "NotAuthorizedException":
|
|
2223
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
2224
|
-
response = {
|
|
2225
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
2226
|
-
name: errorCode,
|
|
2227
|
-
$metadata: deserializeMetadata(output),
|
|
2228
|
-
};
|
|
2229
|
-
break;
|
|
2230
|
-
case "ResourceNotFoundException":
|
|
2231
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
2232
|
-
response = {
|
|
2233
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2234
|
-
name: errorCode,
|
|
2235
|
-
$metadata: deserializeMetadata(output),
|
|
2236
|
-
};
|
|
2237
|
-
break;
|
|
2238
|
-
case "TooManyRequestsException":
|
|
2239
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
2240
|
-
response = {
|
|
2241
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
2242
|
-
name: errorCode,
|
|
2243
|
-
$metadata: deserializeMetadata(output),
|
|
2244
|
-
};
|
|
2245
|
-
break;
|
|
2246
|
-
default:
|
|
2247
|
-
const parsedBody = parsedOutput.body;
|
|
2248
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2249
|
-
response = {
|
|
2250
|
-
...parsedBody,
|
|
2251
|
-
name: `${errorCode}`,
|
|
2252
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2253
|
-
$fault: "client",
|
|
2254
|
-
$metadata: deserializeMetadata(output),
|
|
2255
|
-
} as any;
|
|
2256
|
-
}
|
|
2257
|
-
const message = response.message || response.Message || errorCode;
|
|
2258
|
-
response.message = message;
|
|
2259
|
-
delete response.Message;
|
|
2260
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
2261
|
-
};
|
|
2262
|
-
|
|
2263
|
-
export const deserializeAws_restJson1UpdateRecordsCommand = async (
|
|
2264
|
-
output: __HttpResponse,
|
|
2265
|
-
context: __SerdeContext
|
|
2266
|
-
): Promise<UpdateRecordsCommandOutput> => {
|
|
2267
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
2268
|
-
return deserializeAws_restJson1UpdateRecordsCommandError(output, context);
|
|
2269
|
-
}
|
|
2270
|
-
const contents: UpdateRecordsCommandOutput = {
|
|
2271
|
-
$metadata: deserializeMetadata(output),
|
|
2272
|
-
Records: undefined,
|
|
2273
|
-
};
|
|
2274
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
2275
|
-
if (data.Records !== undefined && data.Records !== null) {
|
|
2276
|
-
contents.Records = deserializeAws_restJson1RecordList(data.Records, context);
|
|
2277
|
-
}
|
|
2278
|
-
return Promise.resolve(contents);
|
|
2279
|
-
};
|
|
2280
|
-
|
|
2281
|
-
const deserializeAws_restJson1UpdateRecordsCommandError = async (
|
|
2282
|
-
output: __HttpResponse,
|
|
2283
|
-
context: __SerdeContext
|
|
2284
|
-
): Promise<UpdateRecordsCommandOutput> => {
|
|
2285
|
-
const parsedOutput: any = {
|
|
2286
|
-
...output,
|
|
2287
|
-
body: await parseBody(output.body, context),
|
|
2288
|
-
};
|
|
2289
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
2290
|
-
let errorCode: string = "UnknownError";
|
|
2291
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
2292
|
-
switch (errorCode) {
|
|
2293
|
-
case "InternalErrorException":
|
|
2294
|
-
case "com.amazonaws.cognitosync#InternalErrorException":
|
|
2295
|
-
response = {
|
|
2296
|
-
...(await deserializeAws_restJson1InternalErrorExceptionResponse(parsedOutput, context)),
|
|
2297
|
-
name: errorCode,
|
|
2298
|
-
$metadata: deserializeMetadata(output),
|
|
2299
|
-
};
|
|
2300
|
-
break;
|
|
2301
|
-
case "InvalidLambdaFunctionOutputException":
|
|
2302
|
-
case "com.amazonaws.cognitosync#InvalidLambdaFunctionOutputException":
|
|
2303
|
-
response = {
|
|
2304
|
-
...(await deserializeAws_restJson1InvalidLambdaFunctionOutputExceptionResponse(parsedOutput, context)),
|
|
2305
|
-
name: errorCode,
|
|
2306
|
-
$metadata: deserializeMetadata(output),
|
|
2307
|
-
};
|
|
2308
|
-
break;
|
|
2309
|
-
case "InvalidParameterException":
|
|
2310
|
-
case "com.amazonaws.cognitosync#InvalidParameterException":
|
|
2311
|
-
response = {
|
|
2312
|
-
...(await deserializeAws_restJson1InvalidParameterExceptionResponse(parsedOutput, context)),
|
|
2313
|
-
name: errorCode,
|
|
2314
|
-
$metadata: deserializeMetadata(output),
|
|
2315
|
-
};
|
|
2316
|
-
break;
|
|
2317
|
-
case "LambdaThrottledException":
|
|
2318
|
-
case "com.amazonaws.cognitosync#LambdaThrottledException":
|
|
2319
|
-
response = {
|
|
2320
|
-
...(await deserializeAws_restJson1LambdaThrottledExceptionResponse(parsedOutput, context)),
|
|
2321
|
-
name: errorCode,
|
|
2322
|
-
$metadata: deserializeMetadata(output),
|
|
2323
|
-
};
|
|
2324
|
-
break;
|
|
2325
|
-
case "LimitExceededException":
|
|
2326
|
-
case "com.amazonaws.cognitosync#LimitExceededException":
|
|
2327
|
-
response = {
|
|
2328
|
-
...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
2329
|
-
name: errorCode,
|
|
2330
|
-
$metadata: deserializeMetadata(output),
|
|
2331
|
-
};
|
|
2332
|
-
break;
|
|
2333
|
-
case "NotAuthorizedException":
|
|
2334
|
-
case "com.amazonaws.cognitosync#NotAuthorizedException":
|
|
2335
|
-
response = {
|
|
2336
|
-
...(await deserializeAws_restJson1NotAuthorizedExceptionResponse(parsedOutput, context)),
|
|
2337
|
-
name: errorCode,
|
|
2338
|
-
$metadata: deserializeMetadata(output),
|
|
2339
|
-
};
|
|
2340
|
-
break;
|
|
2341
|
-
case "ResourceConflictException":
|
|
2342
|
-
case "com.amazonaws.cognitosync#ResourceConflictException":
|
|
2343
|
-
response = {
|
|
2344
|
-
...(await deserializeAws_restJson1ResourceConflictExceptionResponse(parsedOutput, context)),
|
|
2345
|
-
name: errorCode,
|
|
2346
|
-
$metadata: deserializeMetadata(output),
|
|
2347
|
-
};
|
|
2348
|
-
break;
|
|
2349
|
-
case "ResourceNotFoundException":
|
|
2350
|
-
case "com.amazonaws.cognitosync#ResourceNotFoundException":
|
|
2351
|
-
response = {
|
|
2352
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
2353
|
-
name: errorCode,
|
|
2354
|
-
$metadata: deserializeMetadata(output),
|
|
2355
|
-
};
|
|
2356
|
-
break;
|
|
2357
|
-
case "TooManyRequestsException":
|
|
2358
|
-
case "com.amazonaws.cognitosync#TooManyRequestsException":
|
|
2359
|
-
response = {
|
|
2360
|
-
...(await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)),
|
|
2361
|
-
name: errorCode,
|
|
2362
|
-
$metadata: deserializeMetadata(output),
|
|
2363
|
-
};
|
|
2364
|
-
break;
|
|
2365
|
-
default:
|
|
2366
|
-
const parsedBody = parsedOutput.body;
|
|
2367
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
2368
|
-
response = {
|
|
2369
|
-
...parsedBody,
|
|
2370
|
-
name: `${errorCode}`,
|
|
2371
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
2372
|
-
$fault: "client",
|
|
2373
|
-
$metadata: deserializeMetadata(output),
|
|
2374
|
-
} as any;
|
|
2375
|
-
}
|
|
2376
|
-
const message = response.message || response.Message || errorCode;
|
|
2377
|
-
response.message = message;
|
|
2378
|
-
delete response.Message;
|
|
2379
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
2380
|
-
};
|
|
2381
|
-
|
|
2382
|
-
const deserializeAws_restJson1AlreadyStreamedExceptionResponse = async (
|
|
2383
|
-
parsedOutput: any,
|
|
2384
|
-
context: __SerdeContext
|
|
2385
|
-
): Promise<AlreadyStreamedException> => {
|
|
2386
|
-
const contents: AlreadyStreamedException = {
|
|
2387
|
-
name: "AlreadyStreamedException",
|
|
2388
|
-
$fault: "client",
|
|
2389
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2390
|
-
message: undefined,
|
|
2391
|
-
};
|
|
2392
|
-
const data: any = parsedOutput.body;
|
|
2393
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2394
|
-
contents.message = __expectString(data.message);
|
|
2395
|
-
}
|
|
2396
|
-
return contents;
|
|
2397
|
-
};
|
|
2398
|
-
|
|
2399
|
-
const deserializeAws_restJson1ConcurrentModificationExceptionResponse = async (
|
|
2400
|
-
parsedOutput: any,
|
|
2401
|
-
context: __SerdeContext
|
|
2402
|
-
): Promise<ConcurrentModificationException> => {
|
|
2403
|
-
const contents: ConcurrentModificationException = {
|
|
2404
|
-
name: "ConcurrentModificationException",
|
|
2405
|
-
$fault: "client",
|
|
2406
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2407
|
-
message: undefined,
|
|
2408
|
-
};
|
|
2409
|
-
const data: any = parsedOutput.body;
|
|
2410
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2411
|
-
contents.message = __expectString(data.message);
|
|
2412
|
-
}
|
|
2413
|
-
return contents;
|
|
2414
|
-
};
|
|
2415
|
-
|
|
2416
|
-
const deserializeAws_restJson1DuplicateRequestExceptionResponse = async (
|
|
2417
|
-
parsedOutput: any,
|
|
2418
|
-
context: __SerdeContext
|
|
2419
|
-
): Promise<DuplicateRequestException> => {
|
|
2420
|
-
const contents: DuplicateRequestException = {
|
|
2421
|
-
name: "DuplicateRequestException",
|
|
2422
|
-
$fault: "client",
|
|
2423
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2424
|
-
message: undefined,
|
|
2425
|
-
};
|
|
2426
|
-
const data: any = parsedOutput.body;
|
|
2427
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2428
|
-
contents.message = __expectString(data.message);
|
|
2429
|
-
}
|
|
2430
|
-
return contents;
|
|
2431
|
-
};
|
|
2432
|
-
|
|
2433
|
-
const deserializeAws_restJson1InternalErrorExceptionResponse = async (
|
|
2434
|
-
parsedOutput: any,
|
|
2435
|
-
context: __SerdeContext
|
|
2436
|
-
): Promise<InternalErrorException> => {
|
|
2437
|
-
const contents: InternalErrorException = {
|
|
2438
|
-
name: "InternalErrorException",
|
|
2439
|
-
$fault: "server",
|
|
2440
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2441
|
-
message: undefined,
|
|
2442
|
-
};
|
|
2443
|
-
const data: any = parsedOutput.body;
|
|
2444
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2445
|
-
contents.message = __expectString(data.message);
|
|
2446
|
-
}
|
|
2447
|
-
return contents;
|
|
2448
|
-
};
|
|
2449
|
-
|
|
2450
|
-
const deserializeAws_restJson1InvalidConfigurationExceptionResponse = async (
|
|
2451
|
-
parsedOutput: any,
|
|
2452
|
-
context: __SerdeContext
|
|
2453
|
-
): Promise<InvalidConfigurationException> => {
|
|
2454
|
-
const contents: InvalidConfigurationException = {
|
|
2455
|
-
name: "InvalidConfigurationException",
|
|
2456
|
-
$fault: "client",
|
|
2457
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2458
|
-
message: undefined,
|
|
2459
|
-
};
|
|
2460
|
-
const data: any = parsedOutput.body;
|
|
2461
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2462
|
-
contents.message = __expectString(data.message);
|
|
2463
|
-
}
|
|
2464
|
-
return contents;
|
|
2465
|
-
};
|
|
2466
|
-
|
|
2467
|
-
const deserializeAws_restJson1InvalidLambdaFunctionOutputExceptionResponse = async (
|
|
2468
|
-
parsedOutput: any,
|
|
2469
|
-
context: __SerdeContext
|
|
2470
|
-
): Promise<InvalidLambdaFunctionOutputException> => {
|
|
2471
|
-
const contents: InvalidLambdaFunctionOutputException = {
|
|
2472
|
-
name: "InvalidLambdaFunctionOutputException",
|
|
2473
|
-
$fault: "client",
|
|
2474
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2475
|
-
message: undefined,
|
|
2476
|
-
};
|
|
2477
|
-
const data: any = parsedOutput.body;
|
|
2478
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2479
|
-
contents.message = __expectString(data.message);
|
|
2480
|
-
}
|
|
2481
|
-
return contents;
|
|
2482
|
-
};
|
|
2483
|
-
|
|
2484
|
-
const deserializeAws_restJson1InvalidParameterExceptionResponse = async (
|
|
2485
|
-
parsedOutput: any,
|
|
2486
|
-
context: __SerdeContext
|
|
2487
|
-
): Promise<InvalidParameterException> => {
|
|
2488
|
-
const contents: InvalidParameterException = {
|
|
2489
|
-
name: "InvalidParameterException",
|
|
2490
|
-
$fault: "client",
|
|
2491
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2492
|
-
message: undefined,
|
|
2493
|
-
};
|
|
2494
|
-
const data: any = parsedOutput.body;
|
|
2495
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2496
|
-
contents.message = __expectString(data.message);
|
|
2497
|
-
}
|
|
2498
|
-
return contents;
|
|
2499
|
-
};
|
|
2500
|
-
|
|
2501
|
-
const deserializeAws_restJson1LambdaThrottledExceptionResponse = async (
|
|
2502
|
-
parsedOutput: any,
|
|
2503
|
-
context: __SerdeContext
|
|
2504
|
-
): Promise<LambdaThrottledException> => {
|
|
2505
|
-
const contents: LambdaThrottledException = {
|
|
2506
|
-
name: "LambdaThrottledException",
|
|
2507
|
-
$fault: "client",
|
|
2508
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2509
|
-
message: undefined,
|
|
2510
|
-
};
|
|
2511
|
-
const data: any = parsedOutput.body;
|
|
2512
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2513
|
-
contents.message = __expectString(data.message);
|
|
2514
|
-
}
|
|
2515
|
-
return contents;
|
|
2516
|
-
};
|
|
2517
|
-
|
|
2518
|
-
const deserializeAws_restJson1LimitExceededExceptionResponse = async (
|
|
2519
|
-
parsedOutput: any,
|
|
2520
|
-
context: __SerdeContext
|
|
2521
|
-
): Promise<LimitExceededException> => {
|
|
2522
|
-
const contents: LimitExceededException = {
|
|
2523
|
-
name: "LimitExceededException",
|
|
2524
|
-
$fault: "client",
|
|
2525
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2526
|
-
message: undefined,
|
|
2527
|
-
};
|
|
2528
|
-
const data: any = parsedOutput.body;
|
|
2529
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2530
|
-
contents.message = __expectString(data.message);
|
|
2531
|
-
}
|
|
2532
|
-
return contents;
|
|
2533
|
-
};
|
|
2534
|
-
|
|
2535
|
-
const deserializeAws_restJson1NotAuthorizedExceptionResponse = async (
|
|
2536
|
-
parsedOutput: any,
|
|
2537
|
-
context: __SerdeContext
|
|
2538
|
-
): Promise<NotAuthorizedException> => {
|
|
2539
|
-
const contents: NotAuthorizedException = {
|
|
2540
|
-
name: "NotAuthorizedException",
|
|
2541
|
-
$fault: "client",
|
|
2542
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2543
|
-
message: undefined,
|
|
2544
|
-
};
|
|
2545
|
-
const data: any = parsedOutput.body;
|
|
2546
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2547
|
-
contents.message = __expectString(data.message);
|
|
2548
|
-
}
|
|
2549
|
-
return contents;
|
|
2550
|
-
};
|
|
2551
|
-
|
|
2552
|
-
const deserializeAws_restJson1ResourceConflictExceptionResponse = async (
|
|
2553
|
-
parsedOutput: any,
|
|
2554
|
-
context: __SerdeContext
|
|
2555
|
-
): Promise<ResourceConflictException> => {
|
|
2556
|
-
const contents: ResourceConflictException = {
|
|
2557
|
-
name: "ResourceConflictException",
|
|
2558
|
-
$fault: "client",
|
|
2559
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2560
|
-
message: undefined,
|
|
2561
|
-
};
|
|
2562
|
-
const data: any = parsedOutput.body;
|
|
2563
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2564
|
-
contents.message = __expectString(data.message);
|
|
2565
|
-
}
|
|
2566
|
-
return contents;
|
|
2567
|
-
};
|
|
2568
|
-
|
|
2569
|
-
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
|
|
2570
|
-
parsedOutput: any,
|
|
2571
|
-
context: __SerdeContext
|
|
2572
|
-
): Promise<ResourceNotFoundException> => {
|
|
2573
|
-
const contents: ResourceNotFoundException = {
|
|
2574
|
-
name: "ResourceNotFoundException",
|
|
2575
|
-
$fault: "client",
|
|
2576
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2577
|
-
message: undefined,
|
|
2578
|
-
};
|
|
2579
|
-
const data: any = parsedOutput.body;
|
|
2580
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2581
|
-
contents.message = __expectString(data.message);
|
|
2582
|
-
}
|
|
2583
|
-
return contents;
|
|
2584
|
-
};
|
|
2585
|
-
|
|
2586
|
-
const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (
|
|
2587
|
-
parsedOutput: any,
|
|
2588
|
-
context: __SerdeContext
|
|
2589
|
-
): Promise<TooManyRequestsException> => {
|
|
2590
|
-
const contents: TooManyRequestsException = {
|
|
2591
|
-
name: "TooManyRequestsException",
|
|
2592
|
-
$fault: "client",
|
|
2593
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
2594
|
-
message: undefined,
|
|
2595
|
-
};
|
|
2596
|
-
const data: any = parsedOutput.body;
|
|
2597
|
-
if (data.message !== undefined && data.message !== null) {
|
|
2598
|
-
contents.message = __expectString(data.message);
|
|
2599
|
-
}
|
|
2600
|
-
return contents;
|
|
2601
|
-
};
|
|
2602
|
-
|
|
2603
|
-
const serializeAws_restJson1ApplicationArnList = (input: string[], context: __SerdeContext): any => {
|
|
2604
|
-
return input
|
|
2605
|
-
.filter((e: any) => e != null)
|
|
2606
|
-
.map((entry) => {
|
|
2607
|
-
if (entry === null) {
|
|
2608
|
-
return null as any;
|
|
2609
|
-
}
|
|
2610
|
-
return entry;
|
|
2611
|
-
});
|
|
2612
|
-
};
|
|
2613
|
-
|
|
2614
|
-
const serializeAws_restJson1CognitoStreams = (input: CognitoStreams, context: __SerdeContext): any => {
|
|
2615
|
-
return {
|
|
2616
|
-
...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }),
|
|
2617
|
-
...(input.StreamName !== undefined && input.StreamName !== null && { StreamName: input.StreamName }),
|
|
2618
|
-
...(input.StreamingStatus !== undefined &&
|
|
2619
|
-
input.StreamingStatus !== null && { StreamingStatus: input.StreamingStatus }),
|
|
2620
|
-
};
|
|
2621
|
-
};
|
|
2622
|
-
|
|
2623
|
-
const serializeAws_restJson1Events = (input: { [key: string]: string }, context: __SerdeContext): any => {
|
|
2624
|
-
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
|
|
2625
|
-
if (value === null) {
|
|
2626
|
-
return acc;
|
|
2627
|
-
}
|
|
2628
|
-
return {
|
|
2629
|
-
...acc,
|
|
2630
|
-
[key]: value,
|
|
2631
|
-
};
|
|
2632
|
-
}, {});
|
|
2633
|
-
};
|
|
2634
|
-
|
|
2635
|
-
const serializeAws_restJson1PushSync = (input: PushSync, context: __SerdeContext): any => {
|
|
2636
|
-
return {
|
|
2637
|
-
...(input.ApplicationArns !== undefined &&
|
|
2638
|
-
input.ApplicationArns !== null && {
|
|
2639
|
-
ApplicationArns: serializeAws_restJson1ApplicationArnList(input.ApplicationArns, context),
|
|
2640
|
-
}),
|
|
2641
|
-
...(input.RoleArn !== undefined && input.RoleArn !== null && { RoleArn: input.RoleArn }),
|
|
2642
|
-
};
|
|
2643
|
-
};
|
|
2644
|
-
|
|
2645
|
-
const serializeAws_restJson1RecordPatch = (input: RecordPatch, context: __SerdeContext): any => {
|
|
2646
|
-
return {
|
|
2647
|
-
...(input.DeviceLastModifiedDate !== undefined &&
|
|
2648
|
-
input.DeviceLastModifiedDate !== null && {
|
|
2649
|
-
DeviceLastModifiedDate: Math.round(input.DeviceLastModifiedDate.getTime() / 1000),
|
|
2650
|
-
}),
|
|
2651
|
-
...(input.Key !== undefined && input.Key !== null && { Key: input.Key }),
|
|
2652
|
-
...(input.Op !== undefined && input.Op !== null && { Op: input.Op }),
|
|
2653
|
-
...(input.SyncCount !== undefined && input.SyncCount !== null && { SyncCount: input.SyncCount }),
|
|
2654
|
-
...(input.Value !== undefined && input.Value !== null && { Value: input.Value }),
|
|
2655
|
-
};
|
|
2656
|
-
};
|
|
2657
|
-
|
|
2658
|
-
const serializeAws_restJson1RecordPatchList = (input: RecordPatch[], context: __SerdeContext): any => {
|
|
2659
|
-
return input
|
|
2660
|
-
.filter((e: any) => e != null)
|
|
2661
|
-
.map((entry) => {
|
|
2662
|
-
if (entry === null) {
|
|
2663
|
-
return null as any;
|
|
2664
|
-
}
|
|
2665
|
-
return serializeAws_restJson1RecordPatch(entry, context);
|
|
2666
|
-
});
|
|
2667
|
-
};
|
|
2668
|
-
|
|
2669
|
-
const deserializeAws_restJson1ApplicationArnList = (output: any, context: __SerdeContext): string[] => {
|
|
2670
|
-
return (output || [])
|
|
2671
|
-
.filter((e: any) => e != null)
|
|
2672
|
-
.map((entry: any) => {
|
|
2673
|
-
if (entry === null) {
|
|
2674
|
-
return null as any;
|
|
2675
|
-
}
|
|
2676
|
-
return __expectString(entry) as any;
|
|
2677
|
-
});
|
|
2678
|
-
};
|
|
2679
|
-
|
|
2680
|
-
const deserializeAws_restJson1CognitoStreams = (output: any, context: __SerdeContext): CognitoStreams => {
|
|
2681
|
-
return {
|
|
2682
|
-
RoleArn: __expectString(output.RoleArn),
|
|
2683
|
-
StreamName: __expectString(output.StreamName),
|
|
2684
|
-
StreamingStatus: __expectString(output.StreamingStatus),
|
|
2685
|
-
} as any;
|
|
2686
|
-
};
|
|
2687
|
-
|
|
2688
|
-
const deserializeAws_restJson1Dataset = (output: any, context: __SerdeContext): Dataset => {
|
|
2689
|
-
return {
|
|
2690
|
-
CreationDate:
|
|
2691
|
-
output.CreationDate !== undefined && output.CreationDate !== null
|
|
2692
|
-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreationDate)))
|
|
2693
|
-
: undefined,
|
|
2694
|
-
DataStorage: __expectLong(output.DataStorage),
|
|
2695
|
-
DatasetName: __expectString(output.DatasetName),
|
|
2696
|
-
IdentityId: __expectString(output.IdentityId),
|
|
2697
|
-
LastModifiedBy: __expectString(output.LastModifiedBy),
|
|
2698
|
-
LastModifiedDate:
|
|
2699
|
-
output.LastModifiedDate !== undefined && output.LastModifiedDate !== null
|
|
2700
|
-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastModifiedDate)))
|
|
2701
|
-
: undefined,
|
|
2702
|
-
NumRecords: __expectLong(output.NumRecords),
|
|
2703
|
-
} as any;
|
|
2704
|
-
};
|
|
2705
|
-
|
|
2706
|
-
const deserializeAws_restJson1DatasetList = (output: any, context: __SerdeContext): Dataset[] => {
|
|
2707
|
-
return (output || [])
|
|
2708
|
-
.filter((e: any) => e != null)
|
|
2709
|
-
.map((entry: any) => {
|
|
2710
|
-
if (entry === null) {
|
|
2711
|
-
return null as any;
|
|
2712
|
-
}
|
|
2713
|
-
return deserializeAws_restJson1Dataset(entry, context);
|
|
2714
|
-
});
|
|
2715
|
-
};
|
|
2716
|
-
|
|
2717
|
-
const deserializeAws_restJson1Events = (output: any, context: __SerdeContext): { [key: string]: string } => {
|
|
2718
|
-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
2719
|
-
if (value === null) {
|
|
2720
|
-
return acc;
|
|
2721
|
-
}
|
|
2722
|
-
return {
|
|
2723
|
-
...acc,
|
|
2724
|
-
[key]: __expectString(value) as any,
|
|
2725
|
-
};
|
|
2726
|
-
}, {});
|
|
2727
|
-
};
|
|
2728
|
-
|
|
2729
|
-
const deserializeAws_restJson1IdentityPoolUsage = (output: any, context: __SerdeContext): IdentityPoolUsage => {
|
|
2730
|
-
return {
|
|
2731
|
-
DataStorage: __expectLong(output.DataStorage),
|
|
2732
|
-
IdentityPoolId: __expectString(output.IdentityPoolId),
|
|
2733
|
-
LastModifiedDate:
|
|
2734
|
-
output.LastModifiedDate !== undefined && output.LastModifiedDate !== null
|
|
2735
|
-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastModifiedDate)))
|
|
2736
|
-
: undefined,
|
|
2737
|
-
SyncSessionsCount: __expectLong(output.SyncSessionsCount),
|
|
2738
|
-
} as any;
|
|
2739
|
-
};
|
|
2740
|
-
|
|
2741
|
-
const deserializeAws_restJson1IdentityPoolUsageList = (output: any, context: __SerdeContext): IdentityPoolUsage[] => {
|
|
2742
|
-
return (output || [])
|
|
2743
|
-
.filter((e: any) => e != null)
|
|
2744
|
-
.map((entry: any) => {
|
|
2745
|
-
if (entry === null) {
|
|
2746
|
-
return null as any;
|
|
2747
|
-
}
|
|
2748
|
-
return deserializeAws_restJson1IdentityPoolUsage(entry, context);
|
|
2749
|
-
});
|
|
2750
|
-
};
|
|
2751
|
-
|
|
2752
|
-
const deserializeAws_restJson1IdentityUsage = (output: any, context: __SerdeContext): IdentityUsage => {
|
|
2753
|
-
return {
|
|
2754
|
-
DataStorage: __expectLong(output.DataStorage),
|
|
2755
|
-
DatasetCount: __expectInt32(output.DatasetCount),
|
|
2756
|
-
IdentityId: __expectString(output.IdentityId),
|
|
2757
|
-
IdentityPoolId: __expectString(output.IdentityPoolId),
|
|
2758
|
-
LastModifiedDate:
|
|
2759
|
-
output.LastModifiedDate !== undefined && output.LastModifiedDate !== null
|
|
2760
|
-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastModifiedDate)))
|
|
2761
|
-
: undefined,
|
|
2762
|
-
} as any;
|
|
2763
|
-
};
|
|
2764
|
-
|
|
2765
|
-
const deserializeAws_restJson1MergedDatasetNameList = (output: any, context: __SerdeContext): string[] => {
|
|
2766
|
-
return (output || [])
|
|
2767
|
-
.filter((e: any) => e != null)
|
|
2768
|
-
.map((entry: any) => {
|
|
2769
|
-
if (entry === null) {
|
|
2770
|
-
return null as any;
|
|
2771
|
-
}
|
|
2772
|
-
return __expectString(entry) as any;
|
|
2773
|
-
});
|
|
2774
|
-
};
|
|
2775
|
-
|
|
2776
|
-
const deserializeAws_restJson1PushSync = (output: any, context: __SerdeContext): PushSync => {
|
|
2777
|
-
return {
|
|
2778
|
-
ApplicationArns:
|
|
2779
|
-
output.ApplicationArns !== undefined && output.ApplicationArns !== null
|
|
2780
|
-
? deserializeAws_restJson1ApplicationArnList(output.ApplicationArns, context)
|
|
2781
|
-
: undefined,
|
|
2782
|
-
RoleArn: __expectString(output.RoleArn),
|
|
2783
|
-
} as any;
|
|
2784
|
-
};
|
|
2785
|
-
|
|
2786
|
-
const deserializeAws_restJson1_Record = (output: any, context: __SerdeContext): _Record => {
|
|
2787
|
-
return {
|
|
2788
|
-
DeviceLastModifiedDate:
|
|
2789
|
-
output.DeviceLastModifiedDate !== undefined && output.DeviceLastModifiedDate !== null
|
|
2790
|
-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.DeviceLastModifiedDate)))
|
|
2791
|
-
: undefined,
|
|
2792
|
-
Key: __expectString(output.Key),
|
|
2793
|
-
LastModifiedBy: __expectString(output.LastModifiedBy),
|
|
2794
|
-
LastModifiedDate:
|
|
2795
|
-
output.LastModifiedDate !== undefined && output.LastModifiedDate !== null
|
|
2796
|
-
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastModifiedDate)))
|
|
2797
|
-
: undefined,
|
|
2798
|
-
SyncCount: __expectLong(output.SyncCount),
|
|
2799
|
-
Value: __expectString(output.Value),
|
|
2800
|
-
} as any;
|
|
2801
|
-
};
|
|
2802
|
-
|
|
2803
|
-
const deserializeAws_restJson1RecordList = (output: any, context: __SerdeContext): _Record[] => {
|
|
2804
|
-
return (output || [])
|
|
2805
|
-
.filter((e: any) => e != null)
|
|
2806
|
-
.map((entry: any) => {
|
|
2807
|
-
if (entry === null) {
|
|
2808
|
-
return null as any;
|
|
2809
|
-
}
|
|
2810
|
-
return deserializeAws_restJson1_Record(entry, context);
|
|
2811
|
-
});
|
|
2812
|
-
};
|
|
2813
|
-
|
|
2814
|
-
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
|
|
2815
|
-
httpStatusCode: output.statusCode,
|
|
2816
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
2817
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
2818
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
2819
|
-
});
|
|
2820
|
-
|
|
2821
|
-
// Collect low-level response body stream to Uint8Array.
|
|
2822
|
-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
|
|
2823
|
-
if (streamBody instanceof Uint8Array) {
|
|
2824
|
-
return Promise.resolve(streamBody);
|
|
2825
|
-
}
|
|
2826
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
2827
|
-
};
|
|
2828
|
-
|
|
2829
|
-
// Encode Uint8Array data into string with utf-8.
|
|
2830
|
-
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
|
|
2831
|
-
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
2832
|
-
|
|
2833
|
-
const isSerializableHeaderValue = (value: any): boolean =>
|
|
2834
|
-
value !== undefined &&
|
|
2835
|
-
value !== null &&
|
|
2836
|
-
value !== "" &&
|
|
2837
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
2838
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
2839
|
-
|
|
2840
|
-
const parseBody = (streamBody: any, context: __SerdeContext): any =>
|
|
2841
|
-
collectBodyString(streamBody, context).then((encoded) => {
|
|
2842
|
-
if (encoded.length) {
|
|
2843
|
-
return JSON.parse(encoded);
|
|
2844
|
-
}
|
|
2845
|
-
return {};
|
|
2846
|
-
});
|
|
2847
|
-
|
|
2848
|
-
/**
|
|
2849
|
-
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
2850
|
-
*/
|
|
2851
|
-
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
|
|
2852
|
-
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
2853
|
-
|
|
2854
|
-
const sanitizeErrorCode = (rawValue: string): string => {
|
|
2855
|
-
let cleanValue = rawValue;
|
|
2856
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
2857
|
-
cleanValue = cleanValue.split(":")[0];
|
|
2858
|
-
}
|
|
2859
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
2860
|
-
cleanValue = cleanValue.split("#")[1];
|
|
2861
|
-
}
|
|
2862
|
-
return cleanValue;
|
|
2863
|
-
};
|
|
2864
|
-
|
|
2865
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
2866
|
-
if (headerKey !== undefined) {
|
|
2867
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
2868
|
-
}
|
|
2869
|
-
|
|
2870
|
-
if (data.code !== undefined) {
|
|
2871
|
-
return sanitizeErrorCode(data.code);
|
|
2872
|
-
}
|
|
2873
|
-
|
|
2874
|
-
if (data["__type"] !== undefined) {
|
|
2875
|
-
return sanitizeErrorCode(data["__type"]);
|
|
2876
|
-
}
|
|
2877
|
-
|
|
2878
|
-
return "";
|
|
2879
|
-
};
|