@aws-sdk/client-sts 3.33.0 → 3.36.1
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}/STS.js +1 -9
- package/dist-cjs/STSClient.js +34 -0
- package/dist-cjs/commands/AssumeRoleCommand.js +38 -0
- package/dist-cjs/commands/AssumeRoleWithSAMLCommand.js +36 -0
- package/dist-cjs/commands/AssumeRoleWithWebIdentityCommand.js +36 -0
- package/dist-cjs/commands/DecodeAuthorizationMessageCommand.js +38 -0
- package/dist-cjs/commands/GetAccessKeyInfoCommand.js +38 -0
- package/dist-cjs/commands/GetCallerIdentityCommand.js +38 -0
- package/dist-cjs/commands/GetFederationTokenCommand.js +38 -0
- package/dist-cjs/commands/GetSessionTokenCommand.js +38 -0
- package/{dist/cjs → dist-cjs}/defaultRoleAssumers.js +0 -17
- package/{dist/cjs → dist-cjs}/defaultStsRoleAssumers.js +0 -21
- package/{dist/cjs → dist-cjs}/endpoints.js +0 -1
- 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 -88
- package/{dist/cjs → dist-cjs}/protocols/Aws_query.js +22 -25
- 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}/STS.js +2 -10
- package/{dist/es → dist-es}/STSClient.js +2 -15
- package/dist-es/commands/AssumeRoleCommand.js +41 -0
- package/dist-es/commands/AssumeRoleWithSAMLCommand.js +39 -0
- package/dist-es/commands/AssumeRoleWithWebIdentityCommand.js +39 -0
- package/dist-es/commands/DecodeAuthorizationMessageCommand.js +41 -0
- package/dist-es/commands/GetAccessKeyInfoCommand.js +41 -0
- package/{dist/es → dist-es}/commands/GetCallerIdentityCommand.js +4 -39
- package/dist-es/commands/GetFederationTokenCommand.js +41 -0
- package/dist-es/commands/GetSessionTokenCommand.js +41 -0
- package/dist-es/defaultRoleAssumers.js +16 -0
- package/{dist/es → dist-es}/defaultStsRoleAssumers.js +10 -32
- 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 -88
- package/{dist/es → dist-es}/protocols/Aws_query.js +152 -155
- package/{dist/es → dist-es}/runtimeConfig.browser.js +1 -5
- package/{dist/es → dist-es}/runtimeConfig.js +1 -5
- package/{dist/es → dist-es}/runtimeConfig.native.js +0 -4
- package/{dist/es → dist-es}/runtimeConfig.shared.js +1 -5
- package/{dist/types → dist-types}/STS.d.ts +2 -2
- package/{dist/types → dist-types}/STSClient.d.ts +8 -8
- package/{dist/types → dist-types}/commands/AssumeRoleCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/AssumeRoleWithSAMLCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/AssumeRoleWithWebIdentityCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/DecodeAuthorizationMessageCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/GetAccessKeyInfoCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/GetCallerIdentityCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/GetFederationTokenCommand.d.ts +3 -3
- package/{dist/types → dist-types}/commands/GetSessionTokenCommand.d.ts +3 -3
- package/{dist/types → dist-types}/defaultRoleAssumers.d.ts +0 -0
- package/{dist/types → dist-types}/defaultStsRoleAssumers.d.ts +0 -0
- 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_query.d.ts +2 -2
- package/{dist/types → dist-types}/runtimeConfig.browser.d.ts +0 -0
- package/{dist/types → dist-types}/runtimeConfig.d.ts +0 -0
- 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/STS.d.ts +45 -0
- package/{dist/types → dist-types}/ts3.4/STSClient.d.ts +32 -101
- package/dist-types/ts3.4/commands/AssumeRoleCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetCallerIdentityCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetFederationTokenCommand.d.ts +17 -0
- package/dist-types/ts3.4/commands/GetSessionTokenCommand.d.ts +17 -0
- package/dist-types/ts3.4/defaultRoleAssumers.d.ts +8 -0
- package/{dist/types → dist-types}/ts3.4/defaultStsRoleAssumers.d.ts +6 -25
- 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 +367 -0
- package/{dist/types → dist-types}/ts3.4/protocols/Aws_query.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 +1 -3
- 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 +52 -49
- package/STS.ts +0 -896
- package/STSClient.ts +0 -263
- package/commands/AssumeRoleCommand.ts +0 -176
- package/commands/AssumeRoleWithSAMLCommand.ts +0 -225
- package/commands/AssumeRoleWithWebIdentityCommand.ts +0 -232
- package/commands/DecodeAuthorizationMessageCommand.ts +0 -134
- package/commands/GetAccessKeyInfoCommand.ts +0 -113
- package/commands/GetCallerIdentityCommand.ts +0 -105
- package/commands/GetFederationTokenCommand.ts +0 -234
- package/commands/GetSessionTokenCommand.ts +0 -147
- package/defaultRoleAssumers.spec.ts +0 -148
- package/defaultRoleAssumers.ts +0 -41
- package/defaultStsRoleAssumers.ts +0 -126
- package/dist/cjs/STS.js.map +0 -1
- package/dist/cjs/STSClient.js +0 -47
- package/dist/cjs/STSClient.js.map +0 -1
- package/dist/cjs/commands/AssumeRoleCommand.js +0 -146
- package/dist/cjs/commands/AssumeRoleCommand.js.map +0 -1
- package/dist/cjs/commands/AssumeRoleWithSAMLCommand.js +0 -192
- package/dist/cjs/commands/AssumeRoleWithSAMLCommand.js.map +0 -1
- package/dist/cjs/commands/AssumeRoleWithWebIdentityCommand.js +0 -196
- package/dist/cjs/commands/AssumeRoleWithWebIdentityCommand.js.map +0 -1
- package/dist/cjs/commands/DecodeAuthorizationMessageCommand.js +0 -98
- package/dist/cjs/commands/DecodeAuthorizationMessageCommand.js.map +0 -1
- package/dist/cjs/commands/GetAccessKeyInfoCommand.js +0 -80
- package/dist/cjs/commands/GetAccessKeyInfoCommand.js.map +0 -1
- package/dist/cjs/commands/GetCallerIdentityCommand.js +0 -72
- package/dist/cjs/commands/GetCallerIdentityCommand.js.map +0 -1
- package/dist/cjs/commands/GetFederationTokenCommand.js +0 -201
- package/dist/cjs/commands/GetFederationTokenCommand.js.map +0 -1
- package/dist/cjs/commands/GetSessionTokenCommand.js +0 -114
- package/dist/cjs/commands/GetSessionTokenCommand.js.map +0 -1
- package/dist/cjs/defaultRoleAssumers.js.map +0 -1
- package/dist/cjs/defaultRoleAssumers.spec.js +0 -135
- package/dist/cjs/defaultRoleAssumers.spec.js.map +0 -1
- package/dist/cjs/defaultStsRoleAssumers.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 -93
- package/dist/cjs/protocols/Aws_query.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/STS.js.map +0 -1
- package/dist/es/STSClient.js.map +0 -1
- package/dist/es/commands/AssumeRoleCommand.js +0 -150
- package/dist/es/commands/AssumeRoleCommand.js.map +0 -1
- package/dist/es/commands/AssumeRoleWithSAMLCommand.js +0 -196
- package/dist/es/commands/AssumeRoleWithSAMLCommand.js.map +0 -1
- package/dist/es/commands/AssumeRoleWithWebIdentityCommand.js +0 -200
- package/dist/es/commands/AssumeRoleWithWebIdentityCommand.js.map +0 -1
- package/dist/es/commands/DecodeAuthorizationMessageCommand.js +0 -102
- package/dist/es/commands/DecodeAuthorizationMessageCommand.js.map +0 -1
- package/dist/es/commands/GetAccessKeyInfoCommand.js +0 -84
- package/dist/es/commands/GetAccessKeyInfoCommand.js.map +0 -1
- package/dist/es/commands/GetCallerIdentityCommand.js.map +0 -1
- package/dist/es/commands/GetFederationTokenCommand.js +0 -205
- package/dist/es/commands/GetFederationTokenCommand.js.map +0 -1
- package/dist/es/commands/GetSessionTokenCommand.js +0 -118
- package/dist/es/commands/GetSessionTokenCommand.js.map +0 -1
- package/dist/es/defaultRoleAssumers.js +0 -33
- package/dist/es/defaultRoleAssumers.js.map +0 -1
- package/dist/es/defaultRoleAssumers.spec.js +0 -142
- package/dist/es/defaultRoleAssumers.spec.js.map +0 -1
- package/dist/es/defaultStsRoleAssumers.js.map +0 -1
- package/dist/es/endpoints.js.map +0 -1
- package/dist/es/index.js +0 -13
- 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 -93
- package/dist/es/protocols/Aws_query.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/defaultRoleAssumers.spec.d.ts +0 -1
- package/dist/types/ts3.4/STS.d.ts +0 -666
- package/dist/types/ts3.4/commands/AssumeRoleCommand.d.ts +0 -118
- package/dist/types/ts3.4/commands/AssumeRoleWithSAMLCommand.d.ts +0 -166
- package/dist/types/ts3.4/commands/AssumeRoleWithWebIdentityCommand.d.ts +0 -170
- package/dist/types/ts3.4/commands/DecodeAuthorizationMessageCommand.d.ts +0 -70
- package/dist/types/ts3.4/commands/GetAccessKeyInfoCommand.d.ts +0 -52
- package/dist/types/ts3.4/commands/GetCallerIdentityCommand.d.ts +0 -44
- package/dist/types/ts3.4/commands/GetFederationTokenCommand.d.ts +0 -173
- package/dist/types/ts3.4/commands/GetSessionTokenCommand.d.ts +0 -86
- package/dist/types/ts3.4/defaultRoleAssumers.d.ts +0 -19
- package/dist/types/ts3.4/defaultRoleAssumers.spec.d.ts +0 -1
- package/dist/types/ts3.4/models/models_0.d.ts +0 -1192
- package/endpoints.ts +0 -91
- package/jest.config.js +0 -4
- package/models/models_0.ts +0 -1361
- package/protocols/Aws_query.ts +0 -1513
- 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 -12
- package/tsconfig.json +0 -32
package/protocols/Aws_query.ts
DELETED
|
@@ -1,1513 +0,0 @@
|
|
|
1
|
-
import { AssumeRoleCommandInput, AssumeRoleCommandOutput } from "../commands/AssumeRoleCommand";
|
|
2
|
-
import { AssumeRoleWithSAMLCommandInput, AssumeRoleWithSAMLCommandOutput } from "../commands/AssumeRoleWithSAMLCommand";
|
|
3
|
-
import {
|
|
4
|
-
AssumeRoleWithWebIdentityCommandInput,
|
|
5
|
-
AssumeRoleWithWebIdentityCommandOutput,
|
|
6
|
-
} from "../commands/AssumeRoleWithWebIdentityCommand";
|
|
7
|
-
import {
|
|
8
|
-
DecodeAuthorizationMessageCommandInput,
|
|
9
|
-
DecodeAuthorizationMessageCommandOutput,
|
|
10
|
-
} from "../commands/DecodeAuthorizationMessageCommand";
|
|
11
|
-
import { GetAccessKeyInfoCommandInput, GetAccessKeyInfoCommandOutput } from "../commands/GetAccessKeyInfoCommand";
|
|
12
|
-
import { GetCallerIdentityCommandInput, GetCallerIdentityCommandOutput } from "../commands/GetCallerIdentityCommand";
|
|
13
|
-
import { GetFederationTokenCommandInput, GetFederationTokenCommandOutput } from "../commands/GetFederationTokenCommand";
|
|
14
|
-
import { GetSessionTokenCommandInput, GetSessionTokenCommandOutput } from "../commands/GetSessionTokenCommand";
|
|
15
|
-
import {
|
|
16
|
-
AssumeRoleRequest,
|
|
17
|
-
AssumeRoleResponse,
|
|
18
|
-
AssumeRoleWithSAMLRequest,
|
|
19
|
-
AssumeRoleWithSAMLResponse,
|
|
20
|
-
AssumeRoleWithWebIdentityRequest,
|
|
21
|
-
AssumeRoleWithWebIdentityResponse,
|
|
22
|
-
AssumedRoleUser,
|
|
23
|
-
Credentials,
|
|
24
|
-
DecodeAuthorizationMessageRequest,
|
|
25
|
-
DecodeAuthorizationMessageResponse,
|
|
26
|
-
ExpiredTokenException,
|
|
27
|
-
FederatedUser,
|
|
28
|
-
GetAccessKeyInfoRequest,
|
|
29
|
-
GetAccessKeyInfoResponse,
|
|
30
|
-
GetCallerIdentityRequest,
|
|
31
|
-
GetCallerIdentityResponse,
|
|
32
|
-
GetFederationTokenRequest,
|
|
33
|
-
GetFederationTokenResponse,
|
|
34
|
-
GetSessionTokenRequest,
|
|
35
|
-
GetSessionTokenResponse,
|
|
36
|
-
IDPCommunicationErrorException,
|
|
37
|
-
IDPRejectedClaimException,
|
|
38
|
-
InvalidAuthorizationMessageException,
|
|
39
|
-
InvalidIdentityTokenException,
|
|
40
|
-
MalformedPolicyDocumentException,
|
|
41
|
-
PackedPolicyTooLargeException,
|
|
42
|
-
PolicyDescriptorType,
|
|
43
|
-
RegionDisabledException,
|
|
44
|
-
Tag,
|
|
45
|
-
} from "../models/models_0";
|
|
46
|
-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
47
|
-
import {
|
|
48
|
-
expectNonNull as __expectNonNull,
|
|
49
|
-
expectString as __expectString,
|
|
50
|
-
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
51
|
-
getValueFromTextNode as __getValueFromTextNode,
|
|
52
|
-
parseRfc3339DateTime as __parseRfc3339DateTime,
|
|
53
|
-
strictParseInt32 as __strictParseInt32,
|
|
54
|
-
} from "@aws-sdk/smithy-client";
|
|
55
|
-
import {
|
|
56
|
-
Endpoint as __Endpoint,
|
|
57
|
-
HeaderBag as __HeaderBag,
|
|
58
|
-
MetadataBearer as __MetadataBearer,
|
|
59
|
-
ResponseMetadata as __ResponseMetadata,
|
|
60
|
-
SerdeContext as __SerdeContext,
|
|
61
|
-
SmithyException as __SmithyException,
|
|
62
|
-
} from "@aws-sdk/types";
|
|
63
|
-
import { decodeHTML } from "entities";
|
|
64
|
-
import { parse as xmlParse } from "fast-xml-parser";
|
|
65
|
-
|
|
66
|
-
export const serializeAws_queryAssumeRoleCommand = async (
|
|
67
|
-
input: AssumeRoleCommandInput,
|
|
68
|
-
context: __SerdeContext
|
|
69
|
-
): Promise<__HttpRequest> => {
|
|
70
|
-
const headers: __HeaderBag = {
|
|
71
|
-
"content-type": "application/x-www-form-urlencoded",
|
|
72
|
-
};
|
|
73
|
-
let body: any;
|
|
74
|
-
body = buildFormUrlencodedString({
|
|
75
|
-
...serializeAws_queryAssumeRoleRequest(input, context),
|
|
76
|
-
Action: "AssumeRole",
|
|
77
|
-
Version: "2011-06-15",
|
|
78
|
-
});
|
|
79
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const serializeAws_queryAssumeRoleWithSAMLCommand = async (
|
|
83
|
-
input: AssumeRoleWithSAMLCommandInput,
|
|
84
|
-
context: __SerdeContext
|
|
85
|
-
): Promise<__HttpRequest> => {
|
|
86
|
-
const headers: __HeaderBag = {
|
|
87
|
-
"content-type": "application/x-www-form-urlencoded",
|
|
88
|
-
};
|
|
89
|
-
let body: any;
|
|
90
|
-
body = buildFormUrlencodedString({
|
|
91
|
-
...serializeAws_queryAssumeRoleWithSAMLRequest(input, context),
|
|
92
|
-
Action: "AssumeRoleWithSAML",
|
|
93
|
-
Version: "2011-06-15",
|
|
94
|
-
});
|
|
95
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
export const serializeAws_queryAssumeRoleWithWebIdentityCommand = async (
|
|
99
|
-
input: AssumeRoleWithWebIdentityCommandInput,
|
|
100
|
-
context: __SerdeContext
|
|
101
|
-
): Promise<__HttpRequest> => {
|
|
102
|
-
const headers: __HeaderBag = {
|
|
103
|
-
"content-type": "application/x-www-form-urlencoded",
|
|
104
|
-
};
|
|
105
|
-
let body: any;
|
|
106
|
-
body = buildFormUrlencodedString({
|
|
107
|
-
...serializeAws_queryAssumeRoleWithWebIdentityRequest(input, context),
|
|
108
|
-
Action: "AssumeRoleWithWebIdentity",
|
|
109
|
-
Version: "2011-06-15",
|
|
110
|
-
});
|
|
111
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export const serializeAws_queryDecodeAuthorizationMessageCommand = async (
|
|
115
|
-
input: DecodeAuthorizationMessageCommandInput,
|
|
116
|
-
context: __SerdeContext
|
|
117
|
-
): Promise<__HttpRequest> => {
|
|
118
|
-
const headers: __HeaderBag = {
|
|
119
|
-
"content-type": "application/x-www-form-urlencoded",
|
|
120
|
-
};
|
|
121
|
-
let body: any;
|
|
122
|
-
body = buildFormUrlencodedString({
|
|
123
|
-
...serializeAws_queryDecodeAuthorizationMessageRequest(input, context),
|
|
124
|
-
Action: "DecodeAuthorizationMessage",
|
|
125
|
-
Version: "2011-06-15",
|
|
126
|
-
});
|
|
127
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const serializeAws_queryGetAccessKeyInfoCommand = async (
|
|
131
|
-
input: GetAccessKeyInfoCommandInput,
|
|
132
|
-
context: __SerdeContext
|
|
133
|
-
): Promise<__HttpRequest> => {
|
|
134
|
-
const headers: __HeaderBag = {
|
|
135
|
-
"content-type": "application/x-www-form-urlencoded",
|
|
136
|
-
};
|
|
137
|
-
let body: any;
|
|
138
|
-
body = buildFormUrlencodedString({
|
|
139
|
-
...serializeAws_queryGetAccessKeyInfoRequest(input, context),
|
|
140
|
-
Action: "GetAccessKeyInfo",
|
|
141
|
-
Version: "2011-06-15",
|
|
142
|
-
});
|
|
143
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
export const serializeAws_queryGetCallerIdentityCommand = async (
|
|
147
|
-
input: GetCallerIdentityCommandInput,
|
|
148
|
-
context: __SerdeContext
|
|
149
|
-
): Promise<__HttpRequest> => {
|
|
150
|
-
const headers: __HeaderBag = {
|
|
151
|
-
"content-type": "application/x-www-form-urlencoded",
|
|
152
|
-
};
|
|
153
|
-
let body: any;
|
|
154
|
-
body = buildFormUrlencodedString({
|
|
155
|
-
...serializeAws_queryGetCallerIdentityRequest(input, context),
|
|
156
|
-
Action: "GetCallerIdentity",
|
|
157
|
-
Version: "2011-06-15",
|
|
158
|
-
});
|
|
159
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
160
|
-
};
|
|
161
|
-
|
|
162
|
-
export const serializeAws_queryGetFederationTokenCommand = async (
|
|
163
|
-
input: GetFederationTokenCommandInput,
|
|
164
|
-
context: __SerdeContext
|
|
165
|
-
): Promise<__HttpRequest> => {
|
|
166
|
-
const headers: __HeaderBag = {
|
|
167
|
-
"content-type": "application/x-www-form-urlencoded",
|
|
168
|
-
};
|
|
169
|
-
let body: any;
|
|
170
|
-
body = buildFormUrlencodedString({
|
|
171
|
-
...serializeAws_queryGetFederationTokenRequest(input, context),
|
|
172
|
-
Action: "GetFederationToken",
|
|
173
|
-
Version: "2011-06-15",
|
|
174
|
-
});
|
|
175
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
export const serializeAws_queryGetSessionTokenCommand = async (
|
|
179
|
-
input: GetSessionTokenCommandInput,
|
|
180
|
-
context: __SerdeContext
|
|
181
|
-
): Promise<__HttpRequest> => {
|
|
182
|
-
const headers: __HeaderBag = {
|
|
183
|
-
"content-type": "application/x-www-form-urlencoded",
|
|
184
|
-
};
|
|
185
|
-
let body: any;
|
|
186
|
-
body = buildFormUrlencodedString({
|
|
187
|
-
...serializeAws_queryGetSessionTokenRequest(input, context),
|
|
188
|
-
Action: "GetSessionToken",
|
|
189
|
-
Version: "2011-06-15",
|
|
190
|
-
});
|
|
191
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
export const deserializeAws_queryAssumeRoleCommand = async (
|
|
195
|
-
output: __HttpResponse,
|
|
196
|
-
context: __SerdeContext
|
|
197
|
-
): Promise<AssumeRoleCommandOutput> => {
|
|
198
|
-
if (output.statusCode >= 300) {
|
|
199
|
-
return deserializeAws_queryAssumeRoleCommandError(output, context);
|
|
200
|
-
}
|
|
201
|
-
const data: any = await parseBody(output.body, context);
|
|
202
|
-
let contents: any = {};
|
|
203
|
-
contents = deserializeAws_queryAssumeRoleResponse(data.AssumeRoleResult, context);
|
|
204
|
-
const response: AssumeRoleCommandOutput = {
|
|
205
|
-
$metadata: deserializeMetadata(output),
|
|
206
|
-
...contents,
|
|
207
|
-
};
|
|
208
|
-
return Promise.resolve(response);
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
const deserializeAws_queryAssumeRoleCommandError = async (
|
|
212
|
-
output: __HttpResponse,
|
|
213
|
-
context: __SerdeContext
|
|
214
|
-
): Promise<AssumeRoleCommandOutput> => {
|
|
215
|
-
const parsedOutput: any = {
|
|
216
|
-
...output,
|
|
217
|
-
body: await parseBody(output.body, context),
|
|
218
|
-
};
|
|
219
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
220
|
-
let errorCode: string = "UnknownError";
|
|
221
|
-
errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
222
|
-
switch (errorCode) {
|
|
223
|
-
case "ExpiredTokenException":
|
|
224
|
-
case "com.amazonaws.sts#ExpiredTokenException":
|
|
225
|
-
response = {
|
|
226
|
-
...(await deserializeAws_queryExpiredTokenExceptionResponse(parsedOutput, context)),
|
|
227
|
-
name: errorCode,
|
|
228
|
-
$metadata: deserializeMetadata(output),
|
|
229
|
-
};
|
|
230
|
-
break;
|
|
231
|
-
case "MalformedPolicyDocumentException":
|
|
232
|
-
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
|
233
|
-
response = {
|
|
234
|
-
...(await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context)),
|
|
235
|
-
name: errorCode,
|
|
236
|
-
$metadata: deserializeMetadata(output),
|
|
237
|
-
};
|
|
238
|
-
break;
|
|
239
|
-
case "PackedPolicyTooLargeException":
|
|
240
|
-
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
|
241
|
-
response = {
|
|
242
|
-
...(await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context)),
|
|
243
|
-
name: errorCode,
|
|
244
|
-
$metadata: deserializeMetadata(output),
|
|
245
|
-
};
|
|
246
|
-
break;
|
|
247
|
-
case "RegionDisabledException":
|
|
248
|
-
case "com.amazonaws.sts#RegionDisabledException":
|
|
249
|
-
response = {
|
|
250
|
-
...(await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context)),
|
|
251
|
-
name: errorCode,
|
|
252
|
-
$metadata: deserializeMetadata(output),
|
|
253
|
-
};
|
|
254
|
-
break;
|
|
255
|
-
default:
|
|
256
|
-
const parsedBody = parsedOutput.body;
|
|
257
|
-
errorCode = parsedBody.Error.code || parsedBody.Error.Code || errorCode;
|
|
258
|
-
response = {
|
|
259
|
-
...parsedBody.Error,
|
|
260
|
-
name: `${errorCode}`,
|
|
261
|
-
message: parsedBody.Error.message || parsedBody.Error.Message || errorCode,
|
|
262
|
-
$fault: "client",
|
|
263
|
-
$metadata: deserializeMetadata(output),
|
|
264
|
-
} as any;
|
|
265
|
-
}
|
|
266
|
-
const message = response.message || response.Message || errorCode;
|
|
267
|
-
response.message = message;
|
|
268
|
-
delete response.Message;
|
|
269
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
270
|
-
};
|
|
271
|
-
|
|
272
|
-
export const deserializeAws_queryAssumeRoleWithSAMLCommand = async (
|
|
273
|
-
output: __HttpResponse,
|
|
274
|
-
context: __SerdeContext
|
|
275
|
-
): Promise<AssumeRoleWithSAMLCommandOutput> => {
|
|
276
|
-
if (output.statusCode >= 300) {
|
|
277
|
-
return deserializeAws_queryAssumeRoleWithSAMLCommandError(output, context);
|
|
278
|
-
}
|
|
279
|
-
const data: any = await parseBody(output.body, context);
|
|
280
|
-
let contents: any = {};
|
|
281
|
-
contents = deserializeAws_queryAssumeRoleWithSAMLResponse(data.AssumeRoleWithSAMLResult, context);
|
|
282
|
-
const response: AssumeRoleWithSAMLCommandOutput = {
|
|
283
|
-
$metadata: deserializeMetadata(output),
|
|
284
|
-
...contents,
|
|
285
|
-
};
|
|
286
|
-
return Promise.resolve(response);
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
const deserializeAws_queryAssumeRoleWithSAMLCommandError = async (
|
|
290
|
-
output: __HttpResponse,
|
|
291
|
-
context: __SerdeContext
|
|
292
|
-
): Promise<AssumeRoleWithSAMLCommandOutput> => {
|
|
293
|
-
const parsedOutput: any = {
|
|
294
|
-
...output,
|
|
295
|
-
body: await parseBody(output.body, context),
|
|
296
|
-
};
|
|
297
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
298
|
-
let errorCode: string = "UnknownError";
|
|
299
|
-
errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
300
|
-
switch (errorCode) {
|
|
301
|
-
case "ExpiredTokenException":
|
|
302
|
-
case "com.amazonaws.sts#ExpiredTokenException":
|
|
303
|
-
response = {
|
|
304
|
-
...(await deserializeAws_queryExpiredTokenExceptionResponse(parsedOutput, context)),
|
|
305
|
-
name: errorCode,
|
|
306
|
-
$metadata: deserializeMetadata(output),
|
|
307
|
-
};
|
|
308
|
-
break;
|
|
309
|
-
case "IDPRejectedClaimException":
|
|
310
|
-
case "com.amazonaws.sts#IDPRejectedClaimException":
|
|
311
|
-
response = {
|
|
312
|
-
...(await deserializeAws_queryIDPRejectedClaimExceptionResponse(parsedOutput, context)),
|
|
313
|
-
name: errorCode,
|
|
314
|
-
$metadata: deserializeMetadata(output),
|
|
315
|
-
};
|
|
316
|
-
break;
|
|
317
|
-
case "InvalidIdentityTokenException":
|
|
318
|
-
case "com.amazonaws.sts#InvalidIdentityTokenException":
|
|
319
|
-
response = {
|
|
320
|
-
...(await deserializeAws_queryInvalidIdentityTokenExceptionResponse(parsedOutput, context)),
|
|
321
|
-
name: errorCode,
|
|
322
|
-
$metadata: deserializeMetadata(output),
|
|
323
|
-
};
|
|
324
|
-
break;
|
|
325
|
-
case "MalformedPolicyDocumentException":
|
|
326
|
-
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
|
327
|
-
response = {
|
|
328
|
-
...(await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context)),
|
|
329
|
-
name: errorCode,
|
|
330
|
-
$metadata: deserializeMetadata(output),
|
|
331
|
-
};
|
|
332
|
-
break;
|
|
333
|
-
case "PackedPolicyTooLargeException":
|
|
334
|
-
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
|
335
|
-
response = {
|
|
336
|
-
...(await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context)),
|
|
337
|
-
name: errorCode,
|
|
338
|
-
$metadata: deserializeMetadata(output),
|
|
339
|
-
};
|
|
340
|
-
break;
|
|
341
|
-
case "RegionDisabledException":
|
|
342
|
-
case "com.amazonaws.sts#RegionDisabledException":
|
|
343
|
-
response = {
|
|
344
|
-
...(await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context)),
|
|
345
|
-
name: errorCode,
|
|
346
|
-
$metadata: deserializeMetadata(output),
|
|
347
|
-
};
|
|
348
|
-
break;
|
|
349
|
-
default:
|
|
350
|
-
const parsedBody = parsedOutput.body;
|
|
351
|
-
errorCode = parsedBody.Error.code || parsedBody.Error.Code || errorCode;
|
|
352
|
-
response = {
|
|
353
|
-
...parsedBody.Error,
|
|
354
|
-
name: `${errorCode}`,
|
|
355
|
-
message: parsedBody.Error.message || parsedBody.Error.Message || errorCode,
|
|
356
|
-
$fault: "client",
|
|
357
|
-
$metadata: deserializeMetadata(output),
|
|
358
|
-
} as any;
|
|
359
|
-
}
|
|
360
|
-
const message = response.message || response.Message || errorCode;
|
|
361
|
-
response.message = message;
|
|
362
|
-
delete response.Message;
|
|
363
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
364
|
-
};
|
|
365
|
-
|
|
366
|
-
export const deserializeAws_queryAssumeRoleWithWebIdentityCommand = async (
|
|
367
|
-
output: __HttpResponse,
|
|
368
|
-
context: __SerdeContext
|
|
369
|
-
): Promise<AssumeRoleWithWebIdentityCommandOutput> => {
|
|
370
|
-
if (output.statusCode >= 300) {
|
|
371
|
-
return deserializeAws_queryAssumeRoleWithWebIdentityCommandError(output, context);
|
|
372
|
-
}
|
|
373
|
-
const data: any = await parseBody(output.body, context);
|
|
374
|
-
let contents: any = {};
|
|
375
|
-
contents = deserializeAws_queryAssumeRoleWithWebIdentityResponse(data.AssumeRoleWithWebIdentityResult, context);
|
|
376
|
-
const response: AssumeRoleWithWebIdentityCommandOutput = {
|
|
377
|
-
$metadata: deserializeMetadata(output),
|
|
378
|
-
...contents,
|
|
379
|
-
};
|
|
380
|
-
return Promise.resolve(response);
|
|
381
|
-
};
|
|
382
|
-
|
|
383
|
-
const deserializeAws_queryAssumeRoleWithWebIdentityCommandError = async (
|
|
384
|
-
output: __HttpResponse,
|
|
385
|
-
context: __SerdeContext
|
|
386
|
-
): Promise<AssumeRoleWithWebIdentityCommandOutput> => {
|
|
387
|
-
const parsedOutput: any = {
|
|
388
|
-
...output,
|
|
389
|
-
body: await parseBody(output.body, context),
|
|
390
|
-
};
|
|
391
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
392
|
-
let errorCode: string = "UnknownError";
|
|
393
|
-
errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
394
|
-
switch (errorCode) {
|
|
395
|
-
case "ExpiredTokenException":
|
|
396
|
-
case "com.amazonaws.sts#ExpiredTokenException":
|
|
397
|
-
response = {
|
|
398
|
-
...(await deserializeAws_queryExpiredTokenExceptionResponse(parsedOutput, context)),
|
|
399
|
-
name: errorCode,
|
|
400
|
-
$metadata: deserializeMetadata(output),
|
|
401
|
-
};
|
|
402
|
-
break;
|
|
403
|
-
case "IDPCommunicationErrorException":
|
|
404
|
-
case "com.amazonaws.sts#IDPCommunicationErrorException":
|
|
405
|
-
response = {
|
|
406
|
-
...(await deserializeAws_queryIDPCommunicationErrorExceptionResponse(parsedOutput, context)),
|
|
407
|
-
name: errorCode,
|
|
408
|
-
$metadata: deserializeMetadata(output),
|
|
409
|
-
};
|
|
410
|
-
break;
|
|
411
|
-
case "IDPRejectedClaimException":
|
|
412
|
-
case "com.amazonaws.sts#IDPRejectedClaimException":
|
|
413
|
-
response = {
|
|
414
|
-
...(await deserializeAws_queryIDPRejectedClaimExceptionResponse(parsedOutput, context)),
|
|
415
|
-
name: errorCode,
|
|
416
|
-
$metadata: deserializeMetadata(output),
|
|
417
|
-
};
|
|
418
|
-
break;
|
|
419
|
-
case "InvalidIdentityTokenException":
|
|
420
|
-
case "com.amazonaws.sts#InvalidIdentityTokenException":
|
|
421
|
-
response = {
|
|
422
|
-
...(await deserializeAws_queryInvalidIdentityTokenExceptionResponse(parsedOutput, context)),
|
|
423
|
-
name: errorCode,
|
|
424
|
-
$metadata: deserializeMetadata(output),
|
|
425
|
-
};
|
|
426
|
-
break;
|
|
427
|
-
case "MalformedPolicyDocumentException":
|
|
428
|
-
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
|
429
|
-
response = {
|
|
430
|
-
...(await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context)),
|
|
431
|
-
name: errorCode,
|
|
432
|
-
$metadata: deserializeMetadata(output),
|
|
433
|
-
};
|
|
434
|
-
break;
|
|
435
|
-
case "PackedPolicyTooLargeException":
|
|
436
|
-
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
|
437
|
-
response = {
|
|
438
|
-
...(await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context)),
|
|
439
|
-
name: errorCode,
|
|
440
|
-
$metadata: deserializeMetadata(output),
|
|
441
|
-
};
|
|
442
|
-
break;
|
|
443
|
-
case "RegionDisabledException":
|
|
444
|
-
case "com.amazonaws.sts#RegionDisabledException":
|
|
445
|
-
response = {
|
|
446
|
-
...(await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context)),
|
|
447
|
-
name: errorCode,
|
|
448
|
-
$metadata: deserializeMetadata(output),
|
|
449
|
-
};
|
|
450
|
-
break;
|
|
451
|
-
default:
|
|
452
|
-
const parsedBody = parsedOutput.body;
|
|
453
|
-
errorCode = parsedBody.Error.code || parsedBody.Error.Code || errorCode;
|
|
454
|
-
response = {
|
|
455
|
-
...parsedBody.Error,
|
|
456
|
-
name: `${errorCode}`,
|
|
457
|
-
message: parsedBody.Error.message || parsedBody.Error.Message || errorCode,
|
|
458
|
-
$fault: "client",
|
|
459
|
-
$metadata: deserializeMetadata(output),
|
|
460
|
-
} as any;
|
|
461
|
-
}
|
|
462
|
-
const message = response.message || response.Message || errorCode;
|
|
463
|
-
response.message = message;
|
|
464
|
-
delete response.Message;
|
|
465
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
export const deserializeAws_queryDecodeAuthorizationMessageCommand = async (
|
|
469
|
-
output: __HttpResponse,
|
|
470
|
-
context: __SerdeContext
|
|
471
|
-
): Promise<DecodeAuthorizationMessageCommandOutput> => {
|
|
472
|
-
if (output.statusCode >= 300) {
|
|
473
|
-
return deserializeAws_queryDecodeAuthorizationMessageCommandError(output, context);
|
|
474
|
-
}
|
|
475
|
-
const data: any = await parseBody(output.body, context);
|
|
476
|
-
let contents: any = {};
|
|
477
|
-
contents = deserializeAws_queryDecodeAuthorizationMessageResponse(data.DecodeAuthorizationMessageResult, context);
|
|
478
|
-
const response: DecodeAuthorizationMessageCommandOutput = {
|
|
479
|
-
$metadata: deserializeMetadata(output),
|
|
480
|
-
...contents,
|
|
481
|
-
};
|
|
482
|
-
return Promise.resolve(response);
|
|
483
|
-
};
|
|
484
|
-
|
|
485
|
-
const deserializeAws_queryDecodeAuthorizationMessageCommandError = async (
|
|
486
|
-
output: __HttpResponse,
|
|
487
|
-
context: __SerdeContext
|
|
488
|
-
): Promise<DecodeAuthorizationMessageCommandOutput> => {
|
|
489
|
-
const parsedOutput: any = {
|
|
490
|
-
...output,
|
|
491
|
-
body: await parseBody(output.body, context),
|
|
492
|
-
};
|
|
493
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
494
|
-
let errorCode: string = "UnknownError";
|
|
495
|
-
errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
496
|
-
switch (errorCode) {
|
|
497
|
-
case "InvalidAuthorizationMessageException":
|
|
498
|
-
case "com.amazonaws.sts#InvalidAuthorizationMessageException":
|
|
499
|
-
response = {
|
|
500
|
-
...(await deserializeAws_queryInvalidAuthorizationMessageExceptionResponse(parsedOutput, context)),
|
|
501
|
-
name: errorCode,
|
|
502
|
-
$metadata: deserializeMetadata(output),
|
|
503
|
-
};
|
|
504
|
-
break;
|
|
505
|
-
default:
|
|
506
|
-
const parsedBody = parsedOutput.body;
|
|
507
|
-
errorCode = parsedBody.Error.code || parsedBody.Error.Code || errorCode;
|
|
508
|
-
response = {
|
|
509
|
-
...parsedBody.Error,
|
|
510
|
-
name: `${errorCode}`,
|
|
511
|
-
message: parsedBody.Error.message || parsedBody.Error.Message || errorCode,
|
|
512
|
-
$fault: "client",
|
|
513
|
-
$metadata: deserializeMetadata(output),
|
|
514
|
-
} as any;
|
|
515
|
-
}
|
|
516
|
-
const message = response.message || response.Message || errorCode;
|
|
517
|
-
response.message = message;
|
|
518
|
-
delete response.Message;
|
|
519
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
520
|
-
};
|
|
521
|
-
|
|
522
|
-
export const deserializeAws_queryGetAccessKeyInfoCommand = async (
|
|
523
|
-
output: __HttpResponse,
|
|
524
|
-
context: __SerdeContext
|
|
525
|
-
): Promise<GetAccessKeyInfoCommandOutput> => {
|
|
526
|
-
if (output.statusCode >= 300) {
|
|
527
|
-
return deserializeAws_queryGetAccessKeyInfoCommandError(output, context);
|
|
528
|
-
}
|
|
529
|
-
const data: any = await parseBody(output.body, context);
|
|
530
|
-
let contents: any = {};
|
|
531
|
-
contents = deserializeAws_queryGetAccessKeyInfoResponse(data.GetAccessKeyInfoResult, context);
|
|
532
|
-
const response: GetAccessKeyInfoCommandOutput = {
|
|
533
|
-
$metadata: deserializeMetadata(output),
|
|
534
|
-
...contents,
|
|
535
|
-
};
|
|
536
|
-
return Promise.resolve(response);
|
|
537
|
-
};
|
|
538
|
-
|
|
539
|
-
const deserializeAws_queryGetAccessKeyInfoCommandError = async (
|
|
540
|
-
output: __HttpResponse,
|
|
541
|
-
context: __SerdeContext
|
|
542
|
-
): Promise<GetAccessKeyInfoCommandOutput> => {
|
|
543
|
-
const parsedOutput: any = {
|
|
544
|
-
...output,
|
|
545
|
-
body: await parseBody(output.body, context),
|
|
546
|
-
};
|
|
547
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
548
|
-
let errorCode: string = "UnknownError";
|
|
549
|
-
errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
550
|
-
switch (errorCode) {
|
|
551
|
-
default:
|
|
552
|
-
const parsedBody = parsedOutput.body;
|
|
553
|
-
errorCode = parsedBody.Error.code || parsedBody.Error.Code || errorCode;
|
|
554
|
-
response = {
|
|
555
|
-
...parsedBody.Error,
|
|
556
|
-
name: `${errorCode}`,
|
|
557
|
-
message: parsedBody.Error.message || parsedBody.Error.Message || errorCode,
|
|
558
|
-
$fault: "client",
|
|
559
|
-
$metadata: deserializeMetadata(output),
|
|
560
|
-
} as any;
|
|
561
|
-
}
|
|
562
|
-
const message = response.message || response.Message || errorCode;
|
|
563
|
-
response.message = message;
|
|
564
|
-
delete response.Message;
|
|
565
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
566
|
-
};
|
|
567
|
-
|
|
568
|
-
export const deserializeAws_queryGetCallerIdentityCommand = async (
|
|
569
|
-
output: __HttpResponse,
|
|
570
|
-
context: __SerdeContext
|
|
571
|
-
): Promise<GetCallerIdentityCommandOutput> => {
|
|
572
|
-
if (output.statusCode >= 300) {
|
|
573
|
-
return deserializeAws_queryGetCallerIdentityCommandError(output, context);
|
|
574
|
-
}
|
|
575
|
-
const data: any = await parseBody(output.body, context);
|
|
576
|
-
let contents: any = {};
|
|
577
|
-
contents = deserializeAws_queryGetCallerIdentityResponse(data.GetCallerIdentityResult, context);
|
|
578
|
-
const response: GetCallerIdentityCommandOutput = {
|
|
579
|
-
$metadata: deserializeMetadata(output),
|
|
580
|
-
...contents,
|
|
581
|
-
};
|
|
582
|
-
return Promise.resolve(response);
|
|
583
|
-
};
|
|
584
|
-
|
|
585
|
-
const deserializeAws_queryGetCallerIdentityCommandError = async (
|
|
586
|
-
output: __HttpResponse,
|
|
587
|
-
context: __SerdeContext
|
|
588
|
-
): Promise<GetCallerIdentityCommandOutput> => {
|
|
589
|
-
const parsedOutput: any = {
|
|
590
|
-
...output,
|
|
591
|
-
body: await parseBody(output.body, context),
|
|
592
|
-
};
|
|
593
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
594
|
-
let errorCode: string = "UnknownError";
|
|
595
|
-
errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
596
|
-
switch (errorCode) {
|
|
597
|
-
default:
|
|
598
|
-
const parsedBody = parsedOutput.body;
|
|
599
|
-
errorCode = parsedBody.Error.code || parsedBody.Error.Code || errorCode;
|
|
600
|
-
response = {
|
|
601
|
-
...parsedBody.Error,
|
|
602
|
-
name: `${errorCode}`,
|
|
603
|
-
message: parsedBody.Error.message || parsedBody.Error.Message || errorCode,
|
|
604
|
-
$fault: "client",
|
|
605
|
-
$metadata: deserializeMetadata(output),
|
|
606
|
-
} as any;
|
|
607
|
-
}
|
|
608
|
-
const message = response.message || response.Message || errorCode;
|
|
609
|
-
response.message = message;
|
|
610
|
-
delete response.Message;
|
|
611
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
612
|
-
};
|
|
613
|
-
|
|
614
|
-
export const deserializeAws_queryGetFederationTokenCommand = async (
|
|
615
|
-
output: __HttpResponse,
|
|
616
|
-
context: __SerdeContext
|
|
617
|
-
): Promise<GetFederationTokenCommandOutput> => {
|
|
618
|
-
if (output.statusCode >= 300) {
|
|
619
|
-
return deserializeAws_queryGetFederationTokenCommandError(output, context);
|
|
620
|
-
}
|
|
621
|
-
const data: any = await parseBody(output.body, context);
|
|
622
|
-
let contents: any = {};
|
|
623
|
-
contents = deserializeAws_queryGetFederationTokenResponse(data.GetFederationTokenResult, context);
|
|
624
|
-
const response: GetFederationTokenCommandOutput = {
|
|
625
|
-
$metadata: deserializeMetadata(output),
|
|
626
|
-
...contents,
|
|
627
|
-
};
|
|
628
|
-
return Promise.resolve(response);
|
|
629
|
-
};
|
|
630
|
-
|
|
631
|
-
const deserializeAws_queryGetFederationTokenCommandError = async (
|
|
632
|
-
output: __HttpResponse,
|
|
633
|
-
context: __SerdeContext
|
|
634
|
-
): Promise<GetFederationTokenCommandOutput> => {
|
|
635
|
-
const parsedOutput: any = {
|
|
636
|
-
...output,
|
|
637
|
-
body: await parseBody(output.body, context),
|
|
638
|
-
};
|
|
639
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
640
|
-
let errorCode: string = "UnknownError";
|
|
641
|
-
errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
642
|
-
switch (errorCode) {
|
|
643
|
-
case "MalformedPolicyDocumentException":
|
|
644
|
-
case "com.amazonaws.sts#MalformedPolicyDocumentException":
|
|
645
|
-
response = {
|
|
646
|
-
...(await deserializeAws_queryMalformedPolicyDocumentExceptionResponse(parsedOutput, context)),
|
|
647
|
-
name: errorCode,
|
|
648
|
-
$metadata: deserializeMetadata(output),
|
|
649
|
-
};
|
|
650
|
-
break;
|
|
651
|
-
case "PackedPolicyTooLargeException":
|
|
652
|
-
case "com.amazonaws.sts#PackedPolicyTooLargeException":
|
|
653
|
-
response = {
|
|
654
|
-
...(await deserializeAws_queryPackedPolicyTooLargeExceptionResponse(parsedOutput, context)),
|
|
655
|
-
name: errorCode,
|
|
656
|
-
$metadata: deserializeMetadata(output),
|
|
657
|
-
};
|
|
658
|
-
break;
|
|
659
|
-
case "RegionDisabledException":
|
|
660
|
-
case "com.amazonaws.sts#RegionDisabledException":
|
|
661
|
-
response = {
|
|
662
|
-
...(await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context)),
|
|
663
|
-
name: errorCode,
|
|
664
|
-
$metadata: deserializeMetadata(output),
|
|
665
|
-
};
|
|
666
|
-
break;
|
|
667
|
-
default:
|
|
668
|
-
const parsedBody = parsedOutput.body;
|
|
669
|
-
errorCode = parsedBody.Error.code || parsedBody.Error.Code || errorCode;
|
|
670
|
-
response = {
|
|
671
|
-
...parsedBody.Error,
|
|
672
|
-
name: `${errorCode}`,
|
|
673
|
-
message: parsedBody.Error.message || parsedBody.Error.Message || errorCode,
|
|
674
|
-
$fault: "client",
|
|
675
|
-
$metadata: deserializeMetadata(output),
|
|
676
|
-
} as any;
|
|
677
|
-
}
|
|
678
|
-
const message = response.message || response.Message || errorCode;
|
|
679
|
-
response.message = message;
|
|
680
|
-
delete response.Message;
|
|
681
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
682
|
-
};
|
|
683
|
-
|
|
684
|
-
export const deserializeAws_queryGetSessionTokenCommand = async (
|
|
685
|
-
output: __HttpResponse,
|
|
686
|
-
context: __SerdeContext
|
|
687
|
-
): Promise<GetSessionTokenCommandOutput> => {
|
|
688
|
-
if (output.statusCode >= 300) {
|
|
689
|
-
return deserializeAws_queryGetSessionTokenCommandError(output, context);
|
|
690
|
-
}
|
|
691
|
-
const data: any = await parseBody(output.body, context);
|
|
692
|
-
let contents: any = {};
|
|
693
|
-
contents = deserializeAws_queryGetSessionTokenResponse(data.GetSessionTokenResult, context);
|
|
694
|
-
const response: GetSessionTokenCommandOutput = {
|
|
695
|
-
$metadata: deserializeMetadata(output),
|
|
696
|
-
...contents,
|
|
697
|
-
};
|
|
698
|
-
return Promise.resolve(response);
|
|
699
|
-
};
|
|
700
|
-
|
|
701
|
-
const deserializeAws_queryGetSessionTokenCommandError = async (
|
|
702
|
-
output: __HttpResponse,
|
|
703
|
-
context: __SerdeContext
|
|
704
|
-
): Promise<GetSessionTokenCommandOutput> => {
|
|
705
|
-
const parsedOutput: any = {
|
|
706
|
-
...output,
|
|
707
|
-
body: await parseBody(output.body, context),
|
|
708
|
-
};
|
|
709
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
710
|
-
let errorCode: string = "UnknownError";
|
|
711
|
-
errorCode = loadQueryErrorCode(output, parsedOutput.body);
|
|
712
|
-
switch (errorCode) {
|
|
713
|
-
case "RegionDisabledException":
|
|
714
|
-
case "com.amazonaws.sts#RegionDisabledException":
|
|
715
|
-
response = {
|
|
716
|
-
...(await deserializeAws_queryRegionDisabledExceptionResponse(parsedOutput, context)),
|
|
717
|
-
name: errorCode,
|
|
718
|
-
$metadata: deserializeMetadata(output),
|
|
719
|
-
};
|
|
720
|
-
break;
|
|
721
|
-
default:
|
|
722
|
-
const parsedBody = parsedOutput.body;
|
|
723
|
-
errorCode = parsedBody.Error.code || parsedBody.Error.Code || errorCode;
|
|
724
|
-
response = {
|
|
725
|
-
...parsedBody.Error,
|
|
726
|
-
name: `${errorCode}`,
|
|
727
|
-
message: parsedBody.Error.message || parsedBody.Error.Message || errorCode,
|
|
728
|
-
$fault: "client",
|
|
729
|
-
$metadata: deserializeMetadata(output),
|
|
730
|
-
} as any;
|
|
731
|
-
}
|
|
732
|
-
const message = response.message || response.Message || errorCode;
|
|
733
|
-
response.message = message;
|
|
734
|
-
delete response.Message;
|
|
735
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
736
|
-
};
|
|
737
|
-
|
|
738
|
-
const deserializeAws_queryExpiredTokenExceptionResponse = async (
|
|
739
|
-
parsedOutput: any,
|
|
740
|
-
context: __SerdeContext
|
|
741
|
-
): Promise<ExpiredTokenException> => {
|
|
742
|
-
const body = parsedOutput.body;
|
|
743
|
-
const deserialized: any = deserializeAws_queryExpiredTokenException(body.Error, context);
|
|
744
|
-
const contents: ExpiredTokenException = {
|
|
745
|
-
name: "ExpiredTokenException",
|
|
746
|
-
$fault: "client",
|
|
747
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
748
|
-
...deserialized,
|
|
749
|
-
};
|
|
750
|
-
return contents;
|
|
751
|
-
};
|
|
752
|
-
|
|
753
|
-
const deserializeAws_queryIDPCommunicationErrorExceptionResponse = async (
|
|
754
|
-
parsedOutput: any,
|
|
755
|
-
context: __SerdeContext
|
|
756
|
-
): Promise<IDPCommunicationErrorException> => {
|
|
757
|
-
const body = parsedOutput.body;
|
|
758
|
-
const deserialized: any = deserializeAws_queryIDPCommunicationErrorException(body.Error, context);
|
|
759
|
-
const contents: IDPCommunicationErrorException = {
|
|
760
|
-
name: "IDPCommunicationErrorException",
|
|
761
|
-
$fault: "client",
|
|
762
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
763
|
-
...deserialized,
|
|
764
|
-
};
|
|
765
|
-
return contents;
|
|
766
|
-
};
|
|
767
|
-
|
|
768
|
-
const deserializeAws_queryIDPRejectedClaimExceptionResponse = async (
|
|
769
|
-
parsedOutput: any,
|
|
770
|
-
context: __SerdeContext
|
|
771
|
-
): Promise<IDPRejectedClaimException> => {
|
|
772
|
-
const body = parsedOutput.body;
|
|
773
|
-
const deserialized: any = deserializeAws_queryIDPRejectedClaimException(body.Error, context);
|
|
774
|
-
const contents: IDPRejectedClaimException = {
|
|
775
|
-
name: "IDPRejectedClaimException",
|
|
776
|
-
$fault: "client",
|
|
777
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
778
|
-
...deserialized,
|
|
779
|
-
};
|
|
780
|
-
return contents;
|
|
781
|
-
};
|
|
782
|
-
|
|
783
|
-
const deserializeAws_queryInvalidAuthorizationMessageExceptionResponse = async (
|
|
784
|
-
parsedOutput: any,
|
|
785
|
-
context: __SerdeContext
|
|
786
|
-
): Promise<InvalidAuthorizationMessageException> => {
|
|
787
|
-
const body = parsedOutput.body;
|
|
788
|
-
const deserialized: any = deserializeAws_queryInvalidAuthorizationMessageException(body.Error, context);
|
|
789
|
-
const contents: InvalidAuthorizationMessageException = {
|
|
790
|
-
name: "InvalidAuthorizationMessageException",
|
|
791
|
-
$fault: "client",
|
|
792
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
793
|
-
...deserialized,
|
|
794
|
-
};
|
|
795
|
-
return contents;
|
|
796
|
-
};
|
|
797
|
-
|
|
798
|
-
const deserializeAws_queryInvalidIdentityTokenExceptionResponse = async (
|
|
799
|
-
parsedOutput: any,
|
|
800
|
-
context: __SerdeContext
|
|
801
|
-
): Promise<InvalidIdentityTokenException> => {
|
|
802
|
-
const body = parsedOutput.body;
|
|
803
|
-
const deserialized: any = deserializeAws_queryInvalidIdentityTokenException(body.Error, context);
|
|
804
|
-
const contents: InvalidIdentityTokenException = {
|
|
805
|
-
name: "InvalidIdentityTokenException",
|
|
806
|
-
$fault: "client",
|
|
807
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
808
|
-
...deserialized,
|
|
809
|
-
};
|
|
810
|
-
return contents;
|
|
811
|
-
};
|
|
812
|
-
|
|
813
|
-
const deserializeAws_queryMalformedPolicyDocumentExceptionResponse = async (
|
|
814
|
-
parsedOutput: any,
|
|
815
|
-
context: __SerdeContext
|
|
816
|
-
): Promise<MalformedPolicyDocumentException> => {
|
|
817
|
-
const body = parsedOutput.body;
|
|
818
|
-
const deserialized: any = deserializeAws_queryMalformedPolicyDocumentException(body.Error, context);
|
|
819
|
-
const contents: MalformedPolicyDocumentException = {
|
|
820
|
-
name: "MalformedPolicyDocumentException",
|
|
821
|
-
$fault: "client",
|
|
822
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
823
|
-
...deserialized,
|
|
824
|
-
};
|
|
825
|
-
return contents;
|
|
826
|
-
};
|
|
827
|
-
|
|
828
|
-
const deserializeAws_queryPackedPolicyTooLargeExceptionResponse = async (
|
|
829
|
-
parsedOutput: any,
|
|
830
|
-
context: __SerdeContext
|
|
831
|
-
): Promise<PackedPolicyTooLargeException> => {
|
|
832
|
-
const body = parsedOutput.body;
|
|
833
|
-
const deserialized: any = deserializeAws_queryPackedPolicyTooLargeException(body.Error, context);
|
|
834
|
-
const contents: PackedPolicyTooLargeException = {
|
|
835
|
-
name: "PackedPolicyTooLargeException",
|
|
836
|
-
$fault: "client",
|
|
837
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
838
|
-
...deserialized,
|
|
839
|
-
};
|
|
840
|
-
return contents;
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
const deserializeAws_queryRegionDisabledExceptionResponse = async (
|
|
844
|
-
parsedOutput: any,
|
|
845
|
-
context: __SerdeContext
|
|
846
|
-
): Promise<RegionDisabledException> => {
|
|
847
|
-
const body = parsedOutput.body;
|
|
848
|
-
const deserialized: any = deserializeAws_queryRegionDisabledException(body.Error, context);
|
|
849
|
-
const contents: RegionDisabledException = {
|
|
850
|
-
name: "RegionDisabledException",
|
|
851
|
-
$fault: "client",
|
|
852
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
853
|
-
...deserialized,
|
|
854
|
-
};
|
|
855
|
-
return contents;
|
|
856
|
-
};
|
|
857
|
-
|
|
858
|
-
const serializeAws_queryAssumeRoleRequest = (input: AssumeRoleRequest, context: __SerdeContext): any => {
|
|
859
|
-
const entries: any = {};
|
|
860
|
-
if (input.RoleArn !== undefined && input.RoleArn !== null) {
|
|
861
|
-
entries["RoleArn"] = input.RoleArn;
|
|
862
|
-
}
|
|
863
|
-
if (input.RoleSessionName !== undefined && input.RoleSessionName !== null) {
|
|
864
|
-
entries["RoleSessionName"] = input.RoleSessionName;
|
|
865
|
-
}
|
|
866
|
-
if (input.PolicyArns !== undefined && input.PolicyArns !== null) {
|
|
867
|
-
const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context);
|
|
868
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
869
|
-
const loc = `PolicyArns.${key}`;
|
|
870
|
-
entries[loc] = value;
|
|
871
|
-
});
|
|
872
|
-
}
|
|
873
|
-
if (input.Policy !== undefined && input.Policy !== null) {
|
|
874
|
-
entries["Policy"] = input.Policy;
|
|
875
|
-
}
|
|
876
|
-
if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) {
|
|
877
|
-
entries["DurationSeconds"] = input.DurationSeconds;
|
|
878
|
-
}
|
|
879
|
-
if (input.Tags !== undefined && input.Tags !== null) {
|
|
880
|
-
const memberEntries = serializeAws_querytagListType(input.Tags, context);
|
|
881
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
882
|
-
const loc = `Tags.${key}`;
|
|
883
|
-
entries[loc] = value;
|
|
884
|
-
});
|
|
885
|
-
}
|
|
886
|
-
if (input.TransitiveTagKeys !== undefined && input.TransitiveTagKeys !== null) {
|
|
887
|
-
const memberEntries = serializeAws_querytagKeyListType(input.TransitiveTagKeys, context);
|
|
888
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
889
|
-
const loc = `TransitiveTagKeys.${key}`;
|
|
890
|
-
entries[loc] = value;
|
|
891
|
-
});
|
|
892
|
-
}
|
|
893
|
-
if (input.ExternalId !== undefined && input.ExternalId !== null) {
|
|
894
|
-
entries["ExternalId"] = input.ExternalId;
|
|
895
|
-
}
|
|
896
|
-
if (input.SerialNumber !== undefined && input.SerialNumber !== null) {
|
|
897
|
-
entries["SerialNumber"] = input.SerialNumber;
|
|
898
|
-
}
|
|
899
|
-
if (input.TokenCode !== undefined && input.TokenCode !== null) {
|
|
900
|
-
entries["TokenCode"] = input.TokenCode;
|
|
901
|
-
}
|
|
902
|
-
if (input.SourceIdentity !== undefined && input.SourceIdentity !== null) {
|
|
903
|
-
entries["SourceIdentity"] = input.SourceIdentity;
|
|
904
|
-
}
|
|
905
|
-
return entries;
|
|
906
|
-
};
|
|
907
|
-
|
|
908
|
-
const serializeAws_queryAssumeRoleWithSAMLRequest = (
|
|
909
|
-
input: AssumeRoleWithSAMLRequest,
|
|
910
|
-
context: __SerdeContext
|
|
911
|
-
): any => {
|
|
912
|
-
const entries: any = {};
|
|
913
|
-
if (input.RoleArn !== undefined && input.RoleArn !== null) {
|
|
914
|
-
entries["RoleArn"] = input.RoleArn;
|
|
915
|
-
}
|
|
916
|
-
if (input.PrincipalArn !== undefined && input.PrincipalArn !== null) {
|
|
917
|
-
entries["PrincipalArn"] = input.PrincipalArn;
|
|
918
|
-
}
|
|
919
|
-
if (input.SAMLAssertion !== undefined && input.SAMLAssertion !== null) {
|
|
920
|
-
entries["SAMLAssertion"] = input.SAMLAssertion;
|
|
921
|
-
}
|
|
922
|
-
if (input.PolicyArns !== undefined && input.PolicyArns !== null) {
|
|
923
|
-
const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context);
|
|
924
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
925
|
-
const loc = `PolicyArns.${key}`;
|
|
926
|
-
entries[loc] = value;
|
|
927
|
-
});
|
|
928
|
-
}
|
|
929
|
-
if (input.Policy !== undefined && input.Policy !== null) {
|
|
930
|
-
entries["Policy"] = input.Policy;
|
|
931
|
-
}
|
|
932
|
-
if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) {
|
|
933
|
-
entries["DurationSeconds"] = input.DurationSeconds;
|
|
934
|
-
}
|
|
935
|
-
return entries;
|
|
936
|
-
};
|
|
937
|
-
|
|
938
|
-
const serializeAws_queryAssumeRoleWithWebIdentityRequest = (
|
|
939
|
-
input: AssumeRoleWithWebIdentityRequest,
|
|
940
|
-
context: __SerdeContext
|
|
941
|
-
): any => {
|
|
942
|
-
const entries: any = {};
|
|
943
|
-
if (input.RoleArn !== undefined && input.RoleArn !== null) {
|
|
944
|
-
entries["RoleArn"] = input.RoleArn;
|
|
945
|
-
}
|
|
946
|
-
if (input.RoleSessionName !== undefined && input.RoleSessionName !== null) {
|
|
947
|
-
entries["RoleSessionName"] = input.RoleSessionName;
|
|
948
|
-
}
|
|
949
|
-
if (input.WebIdentityToken !== undefined && input.WebIdentityToken !== null) {
|
|
950
|
-
entries["WebIdentityToken"] = input.WebIdentityToken;
|
|
951
|
-
}
|
|
952
|
-
if (input.ProviderId !== undefined && input.ProviderId !== null) {
|
|
953
|
-
entries["ProviderId"] = input.ProviderId;
|
|
954
|
-
}
|
|
955
|
-
if (input.PolicyArns !== undefined && input.PolicyArns !== null) {
|
|
956
|
-
const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context);
|
|
957
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
958
|
-
const loc = `PolicyArns.${key}`;
|
|
959
|
-
entries[loc] = value;
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
if (input.Policy !== undefined && input.Policy !== null) {
|
|
963
|
-
entries["Policy"] = input.Policy;
|
|
964
|
-
}
|
|
965
|
-
if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) {
|
|
966
|
-
entries["DurationSeconds"] = input.DurationSeconds;
|
|
967
|
-
}
|
|
968
|
-
return entries;
|
|
969
|
-
};
|
|
970
|
-
|
|
971
|
-
const serializeAws_queryDecodeAuthorizationMessageRequest = (
|
|
972
|
-
input: DecodeAuthorizationMessageRequest,
|
|
973
|
-
context: __SerdeContext
|
|
974
|
-
): any => {
|
|
975
|
-
const entries: any = {};
|
|
976
|
-
if (input.EncodedMessage !== undefined && input.EncodedMessage !== null) {
|
|
977
|
-
entries["EncodedMessage"] = input.EncodedMessage;
|
|
978
|
-
}
|
|
979
|
-
return entries;
|
|
980
|
-
};
|
|
981
|
-
|
|
982
|
-
const serializeAws_queryGetAccessKeyInfoRequest = (input: GetAccessKeyInfoRequest, context: __SerdeContext): any => {
|
|
983
|
-
const entries: any = {};
|
|
984
|
-
if (input.AccessKeyId !== undefined && input.AccessKeyId !== null) {
|
|
985
|
-
entries["AccessKeyId"] = input.AccessKeyId;
|
|
986
|
-
}
|
|
987
|
-
return entries;
|
|
988
|
-
};
|
|
989
|
-
|
|
990
|
-
const serializeAws_queryGetCallerIdentityRequest = (input: GetCallerIdentityRequest, context: __SerdeContext): any => {
|
|
991
|
-
const entries: any = {};
|
|
992
|
-
return entries;
|
|
993
|
-
};
|
|
994
|
-
|
|
995
|
-
const serializeAws_queryGetFederationTokenRequest = (
|
|
996
|
-
input: GetFederationTokenRequest,
|
|
997
|
-
context: __SerdeContext
|
|
998
|
-
): any => {
|
|
999
|
-
const entries: any = {};
|
|
1000
|
-
if (input.Name !== undefined && input.Name !== null) {
|
|
1001
|
-
entries["Name"] = input.Name;
|
|
1002
|
-
}
|
|
1003
|
-
if (input.Policy !== undefined && input.Policy !== null) {
|
|
1004
|
-
entries["Policy"] = input.Policy;
|
|
1005
|
-
}
|
|
1006
|
-
if (input.PolicyArns !== undefined && input.PolicyArns !== null) {
|
|
1007
|
-
const memberEntries = serializeAws_querypolicyDescriptorListType(input.PolicyArns, context);
|
|
1008
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
1009
|
-
const loc = `PolicyArns.${key}`;
|
|
1010
|
-
entries[loc] = value;
|
|
1011
|
-
});
|
|
1012
|
-
}
|
|
1013
|
-
if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) {
|
|
1014
|
-
entries["DurationSeconds"] = input.DurationSeconds;
|
|
1015
|
-
}
|
|
1016
|
-
if (input.Tags !== undefined && input.Tags !== null) {
|
|
1017
|
-
const memberEntries = serializeAws_querytagListType(input.Tags, context);
|
|
1018
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
1019
|
-
const loc = `Tags.${key}`;
|
|
1020
|
-
entries[loc] = value;
|
|
1021
|
-
});
|
|
1022
|
-
}
|
|
1023
|
-
return entries;
|
|
1024
|
-
};
|
|
1025
|
-
|
|
1026
|
-
const serializeAws_queryGetSessionTokenRequest = (input: GetSessionTokenRequest, context: __SerdeContext): any => {
|
|
1027
|
-
const entries: any = {};
|
|
1028
|
-
if (input.DurationSeconds !== undefined && input.DurationSeconds !== null) {
|
|
1029
|
-
entries["DurationSeconds"] = input.DurationSeconds;
|
|
1030
|
-
}
|
|
1031
|
-
if (input.SerialNumber !== undefined && input.SerialNumber !== null) {
|
|
1032
|
-
entries["SerialNumber"] = input.SerialNumber;
|
|
1033
|
-
}
|
|
1034
|
-
if (input.TokenCode !== undefined && input.TokenCode !== null) {
|
|
1035
|
-
entries["TokenCode"] = input.TokenCode;
|
|
1036
|
-
}
|
|
1037
|
-
return entries;
|
|
1038
|
-
};
|
|
1039
|
-
|
|
1040
|
-
const serializeAws_querypolicyDescriptorListType = (input: PolicyDescriptorType[], context: __SerdeContext): any => {
|
|
1041
|
-
const entries: any = {};
|
|
1042
|
-
let counter = 1;
|
|
1043
|
-
for (let entry of input) {
|
|
1044
|
-
if (entry === null) {
|
|
1045
|
-
continue;
|
|
1046
|
-
}
|
|
1047
|
-
const memberEntries = serializeAws_queryPolicyDescriptorType(entry, context);
|
|
1048
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
1049
|
-
entries[`member.${counter}.${key}`] = value;
|
|
1050
|
-
});
|
|
1051
|
-
counter++;
|
|
1052
|
-
}
|
|
1053
|
-
return entries;
|
|
1054
|
-
};
|
|
1055
|
-
|
|
1056
|
-
const serializeAws_queryPolicyDescriptorType = (input: PolicyDescriptorType, context: __SerdeContext): any => {
|
|
1057
|
-
const entries: any = {};
|
|
1058
|
-
if (input.arn !== undefined && input.arn !== null) {
|
|
1059
|
-
entries["arn"] = input.arn;
|
|
1060
|
-
}
|
|
1061
|
-
return entries;
|
|
1062
|
-
};
|
|
1063
|
-
|
|
1064
|
-
const serializeAws_queryTag = (input: Tag, context: __SerdeContext): any => {
|
|
1065
|
-
const entries: any = {};
|
|
1066
|
-
if (input.Key !== undefined && input.Key !== null) {
|
|
1067
|
-
entries["Key"] = input.Key;
|
|
1068
|
-
}
|
|
1069
|
-
if (input.Value !== undefined && input.Value !== null) {
|
|
1070
|
-
entries["Value"] = input.Value;
|
|
1071
|
-
}
|
|
1072
|
-
return entries;
|
|
1073
|
-
};
|
|
1074
|
-
|
|
1075
|
-
const serializeAws_querytagKeyListType = (input: string[], context: __SerdeContext): any => {
|
|
1076
|
-
const entries: any = {};
|
|
1077
|
-
let counter = 1;
|
|
1078
|
-
for (let entry of input) {
|
|
1079
|
-
if (entry === null) {
|
|
1080
|
-
continue;
|
|
1081
|
-
}
|
|
1082
|
-
entries[`member.${counter}`] = entry;
|
|
1083
|
-
counter++;
|
|
1084
|
-
}
|
|
1085
|
-
return entries;
|
|
1086
|
-
};
|
|
1087
|
-
|
|
1088
|
-
const serializeAws_querytagListType = (input: Tag[], context: __SerdeContext): any => {
|
|
1089
|
-
const entries: any = {};
|
|
1090
|
-
let counter = 1;
|
|
1091
|
-
for (let entry of input) {
|
|
1092
|
-
if (entry === null) {
|
|
1093
|
-
continue;
|
|
1094
|
-
}
|
|
1095
|
-
const memberEntries = serializeAws_queryTag(entry, context);
|
|
1096
|
-
Object.entries(memberEntries).forEach(([key, value]) => {
|
|
1097
|
-
entries[`member.${counter}.${key}`] = value;
|
|
1098
|
-
});
|
|
1099
|
-
counter++;
|
|
1100
|
-
}
|
|
1101
|
-
return entries;
|
|
1102
|
-
};
|
|
1103
|
-
|
|
1104
|
-
const deserializeAws_queryAssumedRoleUser = (output: any, context: __SerdeContext): AssumedRoleUser => {
|
|
1105
|
-
let contents: any = {
|
|
1106
|
-
AssumedRoleId: undefined,
|
|
1107
|
-
Arn: undefined,
|
|
1108
|
-
};
|
|
1109
|
-
if (output["AssumedRoleId"] !== undefined) {
|
|
1110
|
-
contents.AssumedRoleId = __expectString(output["AssumedRoleId"]);
|
|
1111
|
-
}
|
|
1112
|
-
if (output["Arn"] !== undefined) {
|
|
1113
|
-
contents.Arn = __expectString(output["Arn"]);
|
|
1114
|
-
}
|
|
1115
|
-
return contents;
|
|
1116
|
-
};
|
|
1117
|
-
|
|
1118
|
-
const deserializeAws_queryAssumeRoleResponse = (output: any, context: __SerdeContext): AssumeRoleResponse => {
|
|
1119
|
-
let contents: any = {
|
|
1120
|
-
Credentials: undefined,
|
|
1121
|
-
AssumedRoleUser: undefined,
|
|
1122
|
-
PackedPolicySize: undefined,
|
|
1123
|
-
SourceIdentity: undefined,
|
|
1124
|
-
};
|
|
1125
|
-
if (output["Credentials"] !== undefined) {
|
|
1126
|
-
contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context);
|
|
1127
|
-
}
|
|
1128
|
-
if (output["AssumedRoleUser"] !== undefined) {
|
|
1129
|
-
contents.AssumedRoleUser = deserializeAws_queryAssumedRoleUser(output["AssumedRoleUser"], context);
|
|
1130
|
-
}
|
|
1131
|
-
if (output["PackedPolicySize"] !== undefined) {
|
|
1132
|
-
contents.PackedPolicySize = __strictParseInt32(output["PackedPolicySize"]) as number;
|
|
1133
|
-
}
|
|
1134
|
-
if (output["SourceIdentity"] !== undefined) {
|
|
1135
|
-
contents.SourceIdentity = __expectString(output["SourceIdentity"]);
|
|
1136
|
-
}
|
|
1137
|
-
return contents;
|
|
1138
|
-
};
|
|
1139
|
-
|
|
1140
|
-
const deserializeAws_queryAssumeRoleWithSAMLResponse = (
|
|
1141
|
-
output: any,
|
|
1142
|
-
context: __SerdeContext
|
|
1143
|
-
): AssumeRoleWithSAMLResponse => {
|
|
1144
|
-
let contents: any = {
|
|
1145
|
-
Credentials: undefined,
|
|
1146
|
-
AssumedRoleUser: undefined,
|
|
1147
|
-
PackedPolicySize: undefined,
|
|
1148
|
-
Subject: undefined,
|
|
1149
|
-
SubjectType: undefined,
|
|
1150
|
-
Issuer: undefined,
|
|
1151
|
-
Audience: undefined,
|
|
1152
|
-
NameQualifier: undefined,
|
|
1153
|
-
SourceIdentity: undefined,
|
|
1154
|
-
};
|
|
1155
|
-
if (output["Credentials"] !== undefined) {
|
|
1156
|
-
contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context);
|
|
1157
|
-
}
|
|
1158
|
-
if (output["AssumedRoleUser"] !== undefined) {
|
|
1159
|
-
contents.AssumedRoleUser = deserializeAws_queryAssumedRoleUser(output["AssumedRoleUser"], context);
|
|
1160
|
-
}
|
|
1161
|
-
if (output["PackedPolicySize"] !== undefined) {
|
|
1162
|
-
contents.PackedPolicySize = __strictParseInt32(output["PackedPolicySize"]) as number;
|
|
1163
|
-
}
|
|
1164
|
-
if (output["Subject"] !== undefined) {
|
|
1165
|
-
contents.Subject = __expectString(output["Subject"]);
|
|
1166
|
-
}
|
|
1167
|
-
if (output["SubjectType"] !== undefined) {
|
|
1168
|
-
contents.SubjectType = __expectString(output["SubjectType"]);
|
|
1169
|
-
}
|
|
1170
|
-
if (output["Issuer"] !== undefined) {
|
|
1171
|
-
contents.Issuer = __expectString(output["Issuer"]);
|
|
1172
|
-
}
|
|
1173
|
-
if (output["Audience"] !== undefined) {
|
|
1174
|
-
contents.Audience = __expectString(output["Audience"]);
|
|
1175
|
-
}
|
|
1176
|
-
if (output["NameQualifier"] !== undefined) {
|
|
1177
|
-
contents.NameQualifier = __expectString(output["NameQualifier"]);
|
|
1178
|
-
}
|
|
1179
|
-
if (output["SourceIdentity"] !== undefined) {
|
|
1180
|
-
contents.SourceIdentity = __expectString(output["SourceIdentity"]);
|
|
1181
|
-
}
|
|
1182
|
-
return contents;
|
|
1183
|
-
};
|
|
1184
|
-
|
|
1185
|
-
const deserializeAws_queryAssumeRoleWithWebIdentityResponse = (
|
|
1186
|
-
output: any,
|
|
1187
|
-
context: __SerdeContext
|
|
1188
|
-
): AssumeRoleWithWebIdentityResponse => {
|
|
1189
|
-
let contents: any = {
|
|
1190
|
-
Credentials: undefined,
|
|
1191
|
-
SubjectFromWebIdentityToken: undefined,
|
|
1192
|
-
AssumedRoleUser: undefined,
|
|
1193
|
-
PackedPolicySize: undefined,
|
|
1194
|
-
Provider: undefined,
|
|
1195
|
-
Audience: undefined,
|
|
1196
|
-
SourceIdentity: undefined,
|
|
1197
|
-
};
|
|
1198
|
-
if (output["Credentials"] !== undefined) {
|
|
1199
|
-
contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context);
|
|
1200
|
-
}
|
|
1201
|
-
if (output["SubjectFromWebIdentityToken"] !== undefined) {
|
|
1202
|
-
contents.SubjectFromWebIdentityToken = __expectString(output["SubjectFromWebIdentityToken"]);
|
|
1203
|
-
}
|
|
1204
|
-
if (output["AssumedRoleUser"] !== undefined) {
|
|
1205
|
-
contents.AssumedRoleUser = deserializeAws_queryAssumedRoleUser(output["AssumedRoleUser"], context);
|
|
1206
|
-
}
|
|
1207
|
-
if (output["PackedPolicySize"] !== undefined) {
|
|
1208
|
-
contents.PackedPolicySize = __strictParseInt32(output["PackedPolicySize"]) as number;
|
|
1209
|
-
}
|
|
1210
|
-
if (output["Provider"] !== undefined) {
|
|
1211
|
-
contents.Provider = __expectString(output["Provider"]);
|
|
1212
|
-
}
|
|
1213
|
-
if (output["Audience"] !== undefined) {
|
|
1214
|
-
contents.Audience = __expectString(output["Audience"]);
|
|
1215
|
-
}
|
|
1216
|
-
if (output["SourceIdentity"] !== undefined) {
|
|
1217
|
-
contents.SourceIdentity = __expectString(output["SourceIdentity"]);
|
|
1218
|
-
}
|
|
1219
|
-
return contents;
|
|
1220
|
-
};
|
|
1221
|
-
|
|
1222
|
-
const deserializeAws_queryCredentials = (output: any, context: __SerdeContext): Credentials => {
|
|
1223
|
-
let contents: any = {
|
|
1224
|
-
AccessKeyId: undefined,
|
|
1225
|
-
SecretAccessKey: undefined,
|
|
1226
|
-
SessionToken: undefined,
|
|
1227
|
-
Expiration: undefined,
|
|
1228
|
-
};
|
|
1229
|
-
if (output["AccessKeyId"] !== undefined) {
|
|
1230
|
-
contents.AccessKeyId = __expectString(output["AccessKeyId"]);
|
|
1231
|
-
}
|
|
1232
|
-
if (output["SecretAccessKey"] !== undefined) {
|
|
1233
|
-
contents.SecretAccessKey = __expectString(output["SecretAccessKey"]);
|
|
1234
|
-
}
|
|
1235
|
-
if (output["SessionToken"] !== undefined) {
|
|
1236
|
-
contents.SessionToken = __expectString(output["SessionToken"]);
|
|
1237
|
-
}
|
|
1238
|
-
if (output["Expiration"] !== undefined) {
|
|
1239
|
-
contents.Expiration = __expectNonNull(__parseRfc3339DateTime(output["Expiration"]));
|
|
1240
|
-
}
|
|
1241
|
-
return contents;
|
|
1242
|
-
};
|
|
1243
|
-
|
|
1244
|
-
const deserializeAws_queryDecodeAuthorizationMessageResponse = (
|
|
1245
|
-
output: any,
|
|
1246
|
-
context: __SerdeContext
|
|
1247
|
-
): DecodeAuthorizationMessageResponse => {
|
|
1248
|
-
let contents: any = {
|
|
1249
|
-
DecodedMessage: undefined,
|
|
1250
|
-
};
|
|
1251
|
-
if (output["DecodedMessage"] !== undefined) {
|
|
1252
|
-
contents.DecodedMessage = __expectString(output["DecodedMessage"]);
|
|
1253
|
-
}
|
|
1254
|
-
return contents;
|
|
1255
|
-
};
|
|
1256
|
-
|
|
1257
|
-
const deserializeAws_queryExpiredTokenException = (output: any, context: __SerdeContext): ExpiredTokenException => {
|
|
1258
|
-
let contents: any = {
|
|
1259
|
-
message: undefined,
|
|
1260
|
-
};
|
|
1261
|
-
if (output["message"] !== undefined) {
|
|
1262
|
-
contents.message = __expectString(output["message"]);
|
|
1263
|
-
}
|
|
1264
|
-
return contents;
|
|
1265
|
-
};
|
|
1266
|
-
|
|
1267
|
-
const deserializeAws_queryFederatedUser = (output: any, context: __SerdeContext): FederatedUser => {
|
|
1268
|
-
let contents: any = {
|
|
1269
|
-
FederatedUserId: undefined,
|
|
1270
|
-
Arn: undefined,
|
|
1271
|
-
};
|
|
1272
|
-
if (output["FederatedUserId"] !== undefined) {
|
|
1273
|
-
contents.FederatedUserId = __expectString(output["FederatedUserId"]);
|
|
1274
|
-
}
|
|
1275
|
-
if (output["Arn"] !== undefined) {
|
|
1276
|
-
contents.Arn = __expectString(output["Arn"]);
|
|
1277
|
-
}
|
|
1278
|
-
return contents;
|
|
1279
|
-
};
|
|
1280
|
-
|
|
1281
|
-
const deserializeAws_queryGetAccessKeyInfoResponse = (
|
|
1282
|
-
output: any,
|
|
1283
|
-
context: __SerdeContext
|
|
1284
|
-
): GetAccessKeyInfoResponse => {
|
|
1285
|
-
let contents: any = {
|
|
1286
|
-
Account: undefined,
|
|
1287
|
-
};
|
|
1288
|
-
if (output["Account"] !== undefined) {
|
|
1289
|
-
contents.Account = __expectString(output["Account"]);
|
|
1290
|
-
}
|
|
1291
|
-
return contents;
|
|
1292
|
-
};
|
|
1293
|
-
|
|
1294
|
-
const deserializeAws_queryGetCallerIdentityResponse = (
|
|
1295
|
-
output: any,
|
|
1296
|
-
context: __SerdeContext
|
|
1297
|
-
): GetCallerIdentityResponse => {
|
|
1298
|
-
let contents: any = {
|
|
1299
|
-
UserId: undefined,
|
|
1300
|
-
Account: undefined,
|
|
1301
|
-
Arn: undefined,
|
|
1302
|
-
};
|
|
1303
|
-
if (output["UserId"] !== undefined) {
|
|
1304
|
-
contents.UserId = __expectString(output["UserId"]);
|
|
1305
|
-
}
|
|
1306
|
-
if (output["Account"] !== undefined) {
|
|
1307
|
-
contents.Account = __expectString(output["Account"]);
|
|
1308
|
-
}
|
|
1309
|
-
if (output["Arn"] !== undefined) {
|
|
1310
|
-
contents.Arn = __expectString(output["Arn"]);
|
|
1311
|
-
}
|
|
1312
|
-
return contents;
|
|
1313
|
-
};
|
|
1314
|
-
|
|
1315
|
-
const deserializeAws_queryGetFederationTokenResponse = (
|
|
1316
|
-
output: any,
|
|
1317
|
-
context: __SerdeContext
|
|
1318
|
-
): GetFederationTokenResponse => {
|
|
1319
|
-
let contents: any = {
|
|
1320
|
-
Credentials: undefined,
|
|
1321
|
-
FederatedUser: undefined,
|
|
1322
|
-
PackedPolicySize: undefined,
|
|
1323
|
-
};
|
|
1324
|
-
if (output["Credentials"] !== undefined) {
|
|
1325
|
-
contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context);
|
|
1326
|
-
}
|
|
1327
|
-
if (output["FederatedUser"] !== undefined) {
|
|
1328
|
-
contents.FederatedUser = deserializeAws_queryFederatedUser(output["FederatedUser"], context);
|
|
1329
|
-
}
|
|
1330
|
-
if (output["PackedPolicySize"] !== undefined) {
|
|
1331
|
-
contents.PackedPolicySize = __strictParseInt32(output["PackedPolicySize"]) as number;
|
|
1332
|
-
}
|
|
1333
|
-
return contents;
|
|
1334
|
-
};
|
|
1335
|
-
|
|
1336
|
-
const deserializeAws_queryGetSessionTokenResponse = (output: any, context: __SerdeContext): GetSessionTokenResponse => {
|
|
1337
|
-
let contents: any = {
|
|
1338
|
-
Credentials: undefined,
|
|
1339
|
-
};
|
|
1340
|
-
if (output["Credentials"] !== undefined) {
|
|
1341
|
-
contents.Credentials = deserializeAws_queryCredentials(output["Credentials"], context);
|
|
1342
|
-
}
|
|
1343
|
-
return contents;
|
|
1344
|
-
};
|
|
1345
|
-
|
|
1346
|
-
const deserializeAws_queryIDPCommunicationErrorException = (
|
|
1347
|
-
output: any,
|
|
1348
|
-
context: __SerdeContext
|
|
1349
|
-
): IDPCommunicationErrorException => {
|
|
1350
|
-
let contents: any = {
|
|
1351
|
-
message: undefined,
|
|
1352
|
-
};
|
|
1353
|
-
if (output["message"] !== undefined) {
|
|
1354
|
-
contents.message = __expectString(output["message"]);
|
|
1355
|
-
}
|
|
1356
|
-
return contents;
|
|
1357
|
-
};
|
|
1358
|
-
|
|
1359
|
-
const deserializeAws_queryIDPRejectedClaimException = (
|
|
1360
|
-
output: any,
|
|
1361
|
-
context: __SerdeContext
|
|
1362
|
-
): IDPRejectedClaimException => {
|
|
1363
|
-
let contents: any = {
|
|
1364
|
-
message: undefined,
|
|
1365
|
-
};
|
|
1366
|
-
if (output["message"] !== undefined) {
|
|
1367
|
-
contents.message = __expectString(output["message"]);
|
|
1368
|
-
}
|
|
1369
|
-
return contents;
|
|
1370
|
-
};
|
|
1371
|
-
|
|
1372
|
-
const deserializeAws_queryInvalidAuthorizationMessageException = (
|
|
1373
|
-
output: any,
|
|
1374
|
-
context: __SerdeContext
|
|
1375
|
-
): InvalidAuthorizationMessageException => {
|
|
1376
|
-
let contents: any = {
|
|
1377
|
-
message: undefined,
|
|
1378
|
-
};
|
|
1379
|
-
if (output["message"] !== undefined) {
|
|
1380
|
-
contents.message = __expectString(output["message"]);
|
|
1381
|
-
}
|
|
1382
|
-
return contents;
|
|
1383
|
-
};
|
|
1384
|
-
|
|
1385
|
-
const deserializeAws_queryInvalidIdentityTokenException = (
|
|
1386
|
-
output: any,
|
|
1387
|
-
context: __SerdeContext
|
|
1388
|
-
): InvalidIdentityTokenException => {
|
|
1389
|
-
let contents: any = {
|
|
1390
|
-
message: undefined,
|
|
1391
|
-
};
|
|
1392
|
-
if (output["message"] !== undefined) {
|
|
1393
|
-
contents.message = __expectString(output["message"]);
|
|
1394
|
-
}
|
|
1395
|
-
return contents;
|
|
1396
|
-
};
|
|
1397
|
-
|
|
1398
|
-
const deserializeAws_queryMalformedPolicyDocumentException = (
|
|
1399
|
-
output: any,
|
|
1400
|
-
context: __SerdeContext
|
|
1401
|
-
): MalformedPolicyDocumentException => {
|
|
1402
|
-
let contents: any = {
|
|
1403
|
-
message: undefined,
|
|
1404
|
-
};
|
|
1405
|
-
if (output["message"] !== undefined) {
|
|
1406
|
-
contents.message = __expectString(output["message"]);
|
|
1407
|
-
}
|
|
1408
|
-
return contents;
|
|
1409
|
-
};
|
|
1410
|
-
|
|
1411
|
-
const deserializeAws_queryPackedPolicyTooLargeException = (
|
|
1412
|
-
output: any,
|
|
1413
|
-
context: __SerdeContext
|
|
1414
|
-
): PackedPolicyTooLargeException => {
|
|
1415
|
-
let contents: any = {
|
|
1416
|
-
message: undefined,
|
|
1417
|
-
};
|
|
1418
|
-
if (output["message"] !== undefined) {
|
|
1419
|
-
contents.message = __expectString(output["message"]);
|
|
1420
|
-
}
|
|
1421
|
-
return contents;
|
|
1422
|
-
};
|
|
1423
|
-
|
|
1424
|
-
const deserializeAws_queryRegionDisabledException = (output: any, context: __SerdeContext): RegionDisabledException => {
|
|
1425
|
-
let contents: any = {
|
|
1426
|
-
message: undefined,
|
|
1427
|
-
};
|
|
1428
|
-
if (output["message"] !== undefined) {
|
|
1429
|
-
contents.message = __expectString(output["message"]);
|
|
1430
|
-
}
|
|
1431
|
-
return contents;
|
|
1432
|
-
};
|
|
1433
|
-
|
|
1434
|
-
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
|
|
1435
|
-
httpStatusCode: output.statusCode,
|
|
1436
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
1437
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1438
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
1439
|
-
});
|
|
1440
|
-
|
|
1441
|
-
// Collect low-level response body stream to Uint8Array.
|
|
1442
|
-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
|
|
1443
|
-
if (streamBody instanceof Uint8Array) {
|
|
1444
|
-
return Promise.resolve(streamBody);
|
|
1445
|
-
}
|
|
1446
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
1447
|
-
};
|
|
1448
|
-
|
|
1449
|
-
// Encode Uint8Array data into string with utf-8.
|
|
1450
|
-
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
|
|
1451
|
-
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1452
|
-
|
|
1453
|
-
const buildHttpRpcRequest = async (
|
|
1454
|
-
context: __SerdeContext,
|
|
1455
|
-
headers: __HeaderBag,
|
|
1456
|
-
path: string,
|
|
1457
|
-
resolvedHostname: string | undefined,
|
|
1458
|
-
body: any
|
|
1459
|
-
): Promise<__HttpRequest> => {
|
|
1460
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
1461
|
-
const contents: any = {
|
|
1462
|
-
protocol,
|
|
1463
|
-
hostname,
|
|
1464
|
-
port,
|
|
1465
|
-
method: "POST",
|
|
1466
|
-
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
1467
|
-
headers,
|
|
1468
|
-
};
|
|
1469
|
-
if (resolvedHostname !== undefined) {
|
|
1470
|
-
contents.hostname = resolvedHostname;
|
|
1471
|
-
}
|
|
1472
|
-
if (body !== undefined) {
|
|
1473
|
-
contents.body = body;
|
|
1474
|
-
}
|
|
1475
|
-
return new __HttpRequest(contents);
|
|
1476
|
-
};
|
|
1477
|
-
|
|
1478
|
-
const parseBody = (streamBody: any, context: __SerdeContext): any =>
|
|
1479
|
-
collectBodyString(streamBody, context).then((encoded) => {
|
|
1480
|
-
if (encoded.length) {
|
|
1481
|
-
const parsedObj = xmlParse(encoded, {
|
|
1482
|
-
attributeNamePrefix: "",
|
|
1483
|
-
ignoreAttributes: false,
|
|
1484
|
-
parseNodeValue: false,
|
|
1485
|
-
trimValues: false,
|
|
1486
|
-
tagValueProcessor: (val) => (val.trim() === "" && val.includes("\n") ? "" : decodeHTML(val)),
|
|
1487
|
-
});
|
|
1488
|
-
const textNodeName = "#text";
|
|
1489
|
-
const key = Object.keys(parsedObj)[0];
|
|
1490
|
-
const parsedObjToReturn = parsedObj[key];
|
|
1491
|
-
if (parsedObjToReturn[textNodeName]) {
|
|
1492
|
-
parsedObjToReturn[key] = parsedObjToReturn[textNodeName];
|
|
1493
|
-
delete parsedObjToReturn[textNodeName];
|
|
1494
|
-
}
|
|
1495
|
-
return __getValueFromTextNode(parsedObjToReturn);
|
|
1496
|
-
}
|
|
1497
|
-
return {};
|
|
1498
|
-
});
|
|
1499
|
-
|
|
1500
|
-
const buildFormUrlencodedString = (formEntries: { [key: string]: string }): string =>
|
|
1501
|
-
Object.entries(formEntries)
|
|
1502
|
-
.map(([key, value]) => __extendedEncodeURIComponent(key) + "=" + __extendedEncodeURIComponent(value))
|
|
1503
|
-
.join("&");
|
|
1504
|
-
|
|
1505
|
-
const loadQueryErrorCode = (output: __HttpResponse, data: any): string => {
|
|
1506
|
-
if (data.Error.Code !== undefined) {
|
|
1507
|
-
return data.Error.Code;
|
|
1508
|
-
}
|
|
1509
|
-
if (output.statusCode == 404) {
|
|
1510
|
-
return "NotFound";
|
|
1511
|
-
}
|
|
1512
|
-
return "";
|
|
1513
|
-
};
|