@aws-sdk/client-finspace 3.35.0 → 3.36.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 +13 -0
- package/dist-cjs/Finspace.js +0 -1
- package/dist-cjs/FinspaceClient.js +0 -1
- package/dist-cjs/commands/CreateEnvironmentCommand.js +0 -1
- package/dist-cjs/commands/DeleteEnvironmentCommand.js +0 -1
- package/dist-cjs/commands/GetEnvironmentCommand.js +0 -1
- package/dist-cjs/commands/ListEnvironmentsCommand.js +0 -1
- package/dist-cjs/commands/ListTagsForResourceCommand.js +0 -1
- package/dist-cjs/commands/TagResourceCommand.js +0 -1
- package/dist-cjs/commands/UntagResourceCommand.js +0 -1
- package/dist-cjs/commands/UpdateEnvironmentCommand.js +0 -1
- package/dist-cjs/endpoints.js +0 -1
- package/dist-cjs/index.js +0 -1
- package/dist-cjs/models/index.js +0 -1
- package/dist-cjs/models/models_0.js +0 -1
- package/dist-cjs/protocols/Aws_restJson1.js +0 -1
- package/dist-cjs/runtimeConfig.browser.js +2 -3
- package/dist-cjs/runtimeConfig.js +3 -4
- package/dist-cjs/runtimeConfig.native.js +0 -1
- package/dist-cjs/runtimeConfig.shared.js +0 -1
- package/dist-es/Finspace.js +0 -1
- package/dist-es/FinspaceClient.js +0 -1
- package/dist-es/commands/CreateEnvironmentCommand.js +0 -1
- package/dist-es/commands/DeleteEnvironmentCommand.js +0 -1
- package/dist-es/commands/GetEnvironmentCommand.js +0 -1
- package/dist-es/commands/ListEnvironmentsCommand.js +0 -1
- package/dist-es/commands/ListTagsForResourceCommand.js +0 -1
- package/dist-es/commands/TagResourceCommand.js +0 -1
- package/dist-es/commands/UntagResourceCommand.js +0 -1
- package/dist-es/commands/UpdateEnvironmentCommand.js +0 -1
- package/dist-es/endpoints.js +0 -1
- package/dist-es/index.js +0 -1
- package/dist-es/models/index.js +0 -1
- package/dist-es/models/models_0.js +0 -1
- package/dist-es/protocols/Aws_restJson1.js +0 -1
- package/dist-es/runtimeConfig.browser.js +1 -2
- package/dist-es/runtimeConfig.js +2 -3
- package/dist-es/runtimeConfig.native.js +0 -1
- package/dist-es/runtimeConfig.shared.js +0 -1
- package/package.json +33 -30
- package/dist-cjs/Finspace.js.map +0 -1
- package/dist-cjs/FinspaceClient.js.map +0 -1
- package/dist-cjs/commands/CreateEnvironmentCommand.js.map +0 -1
- package/dist-cjs/commands/DeleteEnvironmentCommand.js.map +0 -1
- package/dist-cjs/commands/GetEnvironmentCommand.js.map +0 -1
- package/dist-cjs/commands/ListEnvironmentsCommand.js.map +0 -1
- package/dist-cjs/commands/ListTagsForResourceCommand.js.map +0 -1
- package/dist-cjs/commands/TagResourceCommand.js.map +0 -1
- package/dist-cjs/commands/UntagResourceCommand.js.map +0 -1
- package/dist-cjs/commands/UpdateEnvironmentCommand.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/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/Finspace.js.map +0 -1
- package/dist-es/FinspaceClient.js.map +0 -1
- package/dist-es/commands/CreateEnvironmentCommand.js.map +0 -1
- package/dist-es/commands/DeleteEnvironmentCommand.js.map +0 -1
- package/dist-es/commands/GetEnvironmentCommand.js.map +0 -1
- package/dist-es/commands/ListEnvironmentsCommand.js.map +0 -1
- package/dist-es/commands/ListTagsForResourceCommand.js.map +0 -1
- package/dist-es/commands/TagResourceCommand.js.map +0 -1
- package/dist-es/commands/UntagResourceCommand.js.map +0 -1
- package/dist-es/commands/UpdateEnvironmentCommand.js.map +0 -1
- package/dist-es/endpoints.js.map +0 -1
- package/dist-es/index.js.map +0 -1
- package/dist-es/models/index.js.map +0 -1
- package/dist-es/models/models_0.js.map +0 -1
- 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/jest.config.js +0 -4
- package/src/Finspace.ts +0 -295
- package/src/FinspaceClient.ts +0 -264
- package/src/commands/CreateEnvironmentCommand.ts +0 -95
- package/src/commands/DeleteEnvironmentCommand.ts +0 -95
- package/src/commands/GetEnvironmentCommand.ts +0 -95
- package/src/commands/ListEnvironmentsCommand.ts +0 -95
- package/src/commands/ListTagsForResourceCommand.ts +0 -95
- package/src/commands/TagResourceCommand.ts +0 -95
- package/src/commands/UntagResourceCommand.ts +0 -95
- package/src/commands/UpdateEnvironmentCommand.ts +0 -95
- package/src/endpoints.ts +0 -57
- package/src/index.ts +0 -11
- package/src/models/index.ts +0 -1
- package/src/models/models_0.ts +0 -626
- package/src/protocols/Aws_restJson1.ts +0 -1215
- package/src/runtimeConfig.browser.ts +0 -41
- package/src/runtimeConfig.native.ts +0 -17
- package/src/runtimeConfig.shared.ts +0 -17
- package/src/runtimeConfig.ts +0 -46
- package/tsconfig.es.json +0 -10
- package/tsconfig.json +0 -33
- package/tsconfig.types.json +0 -9
|
@@ -1,1215 +0,0 @@
|
|
|
1
|
-
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http";
|
|
2
|
-
import {
|
|
3
|
-
expectNonNull as __expectNonNull,
|
|
4
|
-
expectObject as __expectObject,
|
|
5
|
-
expectString as __expectString,
|
|
6
|
-
extendedEncodeURIComponent as __extendedEncodeURIComponent,
|
|
7
|
-
} from "@aws-sdk/smithy-client";
|
|
8
|
-
import {
|
|
9
|
-
Endpoint as __Endpoint,
|
|
10
|
-
MetadataBearer as __MetadataBearer,
|
|
11
|
-
ResponseMetadata as __ResponseMetadata,
|
|
12
|
-
SerdeContext as __SerdeContext,
|
|
13
|
-
SmithyException as __SmithyException,
|
|
14
|
-
} from "@aws-sdk/types";
|
|
15
|
-
|
|
16
|
-
import { CreateEnvironmentCommandInput, CreateEnvironmentCommandOutput } from "../commands/CreateEnvironmentCommand";
|
|
17
|
-
import { DeleteEnvironmentCommandInput, DeleteEnvironmentCommandOutput } from "../commands/DeleteEnvironmentCommand";
|
|
18
|
-
import { GetEnvironmentCommandInput, GetEnvironmentCommandOutput } from "../commands/GetEnvironmentCommand";
|
|
19
|
-
import { ListEnvironmentsCommandInput, ListEnvironmentsCommandOutput } from "../commands/ListEnvironmentsCommand";
|
|
20
|
-
import {
|
|
21
|
-
ListTagsForResourceCommandInput,
|
|
22
|
-
ListTagsForResourceCommandOutput,
|
|
23
|
-
} from "../commands/ListTagsForResourceCommand";
|
|
24
|
-
import { TagResourceCommandInput, TagResourceCommandOutput } from "../commands/TagResourceCommand";
|
|
25
|
-
import { UntagResourceCommandInput, UntagResourceCommandOutput } from "../commands/UntagResourceCommand";
|
|
26
|
-
import { UpdateEnvironmentCommandInput, UpdateEnvironmentCommandOutput } from "../commands/UpdateEnvironmentCommand";
|
|
27
|
-
import {
|
|
28
|
-
AccessDeniedException,
|
|
29
|
-
Environment,
|
|
30
|
-
FederationParameters,
|
|
31
|
-
InternalServerException,
|
|
32
|
-
InvalidRequestException,
|
|
33
|
-
LimitExceededException,
|
|
34
|
-
ResourceNotFoundException,
|
|
35
|
-
ServiceQuotaExceededException,
|
|
36
|
-
ThrottlingException,
|
|
37
|
-
ValidationException,
|
|
38
|
-
} from "../models/models_0";
|
|
39
|
-
|
|
40
|
-
export const serializeAws_restJson1CreateEnvironmentCommand = async (
|
|
41
|
-
input: CreateEnvironmentCommandInput,
|
|
42
|
-
context: __SerdeContext
|
|
43
|
-
): Promise<__HttpRequest> => {
|
|
44
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
45
|
-
const headers: any = {
|
|
46
|
-
"content-type": "application/json",
|
|
47
|
-
};
|
|
48
|
-
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment";
|
|
49
|
-
let body: any;
|
|
50
|
-
body = JSON.stringify({
|
|
51
|
-
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
52
|
-
...(input.federationMode !== undefined &&
|
|
53
|
-
input.federationMode !== null && { federationMode: input.federationMode }),
|
|
54
|
-
...(input.federationParameters !== undefined &&
|
|
55
|
-
input.federationParameters !== null && {
|
|
56
|
-
federationParameters: serializeAws_restJson1FederationParameters(input.federationParameters, context),
|
|
57
|
-
}),
|
|
58
|
-
...(input.kmsKeyId !== undefined && input.kmsKeyId !== null && { kmsKeyId: input.kmsKeyId }),
|
|
59
|
-
...(input.name !== undefined && input.name !== null && { name: input.name }),
|
|
60
|
-
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
61
|
-
});
|
|
62
|
-
return new __HttpRequest({
|
|
63
|
-
protocol,
|
|
64
|
-
hostname,
|
|
65
|
-
port,
|
|
66
|
-
method: "POST",
|
|
67
|
-
headers,
|
|
68
|
-
path: resolvedPath,
|
|
69
|
-
body,
|
|
70
|
-
});
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const serializeAws_restJson1DeleteEnvironmentCommand = async (
|
|
74
|
-
input: DeleteEnvironmentCommandInput,
|
|
75
|
-
context: __SerdeContext
|
|
76
|
-
): Promise<__HttpRequest> => {
|
|
77
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
78
|
-
const headers: any = {};
|
|
79
|
-
let resolvedPath =
|
|
80
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
|
|
81
|
-
if (input.environmentId !== undefined) {
|
|
82
|
-
const labelValue: string = input.environmentId;
|
|
83
|
-
if (labelValue.length <= 0) {
|
|
84
|
-
throw new Error("Empty value provided for input HTTP label: environmentId.");
|
|
85
|
-
}
|
|
86
|
-
resolvedPath = resolvedPath.replace("{environmentId}", __extendedEncodeURIComponent(labelValue));
|
|
87
|
-
} else {
|
|
88
|
-
throw new Error("No value provided for input HTTP label: environmentId.");
|
|
89
|
-
}
|
|
90
|
-
let body: any;
|
|
91
|
-
return new __HttpRequest({
|
|
92
|
-
protocol,
|
|
93
|
-
hostname,
|
|
94
|
-
port,
|
|
95
|
-
method: "DELETE",
|
|
96
|
-
headers,
|
|
97
|
-
path: resolvedPath,
|
|
98
|
-
body,
|
|
99
|
-
});
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export const serializeAws_restJson1GetEnvironmentCommand = async (
|
|
103
|
-
input: GetEnvironmentCommandInput,
|
|
104
|
-
context: __SerdeContext
|
|
105
|
-
): Promise<__HttpRequest> => {
|
|
106
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
107
|
-
const headers: any = {};
|
|
108
|
-
let resolvedPath =
|
|
109
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
|
|
110
|
-
if (input.environmentId !== undefined) {
|
|
111
|
-
const labelValue: string = input.environmentId;
|
|
112
|
-
if (labelValue.length <= 0) {
|
|
113
|
-
throw new Error("Empty value provided for input HTTP label: environmentId.");
|
|
114
|
-
}
|
|
115
|
-
resolvedPath = resolvedPath.replace("{environmentId}", __extendedEncodeURIComponent(labelValue));
|
|
116
|
-
} else {
|
|
117
|
-
throw new Error("No value provided for input HTTP label: environmentId.");
|
|
118
|
-
}
|
|
119
|
-
let body: any;
|
|
120
|
-
return new __HttpRequest({
|
|
121
|
-
protocol,
|
|
122
|
-
hostname,
|
|
123
|
-
port,
|
|
124
|
-
method: "GET",
|
|
125
|
-
headers,
|
|
126
|
-
path: resolvedPath,
|
|
127
|
-
body,
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
|
|
131
|
-
export const serializeAws_restJson1ListEnvironmentsCommand = async (
|
|
132
|
-
input: ListEnvironmentsCommandInput,
|
|
133
|
-
context: __SerdeContext
|
|
134
|
-
): Promise<__HttpRequest> => {
|
|
135
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
136
|
-
const headers: any = {};
|
|
137
|
-
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment";
|
|
138
|
-
const query: any = {
|
|
139
|
-
...(input.nextToken !== undefined && { nextToken: input.nextToken }),
|
|
140
|
-
...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
|
|
141
|
-
};
|
|
142
|
-
let body: any;
|
|
143
|
-
return new __HttpRequest({
|
|
144
|
-
protocol,
|
|
145
|
-
hostname,
|
|
146
|
-
port,
|
|
147
|
-
method: "GET",
|
|
148
|
-
headers,
|
|
149
|
-
path: resolvedPath,
|
|
150
|
-
query,
|
|
151
|
-
body,
|
|
152
|
-
});
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
export const serializeAws_restJson1ListTagsForResourceCommand = async (
|
|
156
|
-
input: ListTagsForResourceCommandInput,
|
|
157
|
-
context: __SerdeContext
|
|
158
|
-
): Promise<__HttpRequest> => {
|
|
159
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
160
|
-
const headers: any = {};
|
|
161
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
162
|
-
if (input.resourceArn !== undefined) {
|
|
163
|
-
const labelValue: string = input.resourceArn;
|
|
164
|
-
if (labelValue.length <= 0) {
|
|
165
|
-
throw new Error("Empty value provided for input HTTP label: resourceArn.");
|
|
166
|
-
}
|
|
167
|
-
resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
|
|
168
|
-
} else {
|
|
169
|
-
throw new Error("No value provided for input HTTP label: resourceArn.");
|
|
170
|
-
}
|
|
171
|
-
let body: any;
|
|
172
|
-
return new __HttpRequest({
|
|
173
|
-
protocol,
|
|
174
|
-
hostname,
|
|
175
|
-
port,
|
|
176
|
-
method: "GET",
|
|
177
|
-
headers,
|
|
178
|
-
path: resolvedPath,
|
|
179
|
-
body,
|
|
180
|
-
});
|
|
181
|
-
};
|
|
182
|
-
|
|
183
|
-
export const serializeAws_restJson1TagResourceCommand = async (
|
|
184
|
-
input: TagResourceCommandInput,
|
|
185
|
-
context: __SerdeContext
|
|
186
|
-
): Promise<__HttpRequest> => {
|
|
187
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
188
|
-
const headers: any = {
|
|
189
|
-
"content-type": "application/json",
|
|
190
|
-
};
|
|
191
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
192
|
-
if (input.resourceArn !== undefined) {
|
|
193
|
-
const labelValue: string = input.resourceArn;
|
|
194
|
-
if (labelValue.length <= 0) {
|
|
195
|
-
throw new Error("Empty value provided for input HTTP label: resourceArn.");
|
|
196
|
-
}
|
|
197
|
-
resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
|
|
198
|
-
} else {
|
|
199
|
-
throw new Error("No value provided for input HTTP label: resourceArn.");
|
|
200
|
-
}
|
|
201
|
-
let body: any;
|
|
202
|
-
body = JSON.stringify({
|
|
203
|
-
...(input.tags !== undefined && input.tags !== null && { tags: serializeAws_restJson1TagMap(input.tags, context) }),
|
|
204
|
-
});
|
|
205
|
-
return new __HttpRequest({
|
|
206
|
-
protocol,
|
|
207
|
-
hostname,
|
|
208
|
-
port,
|
|
209
|
-
method: "POST",
|
|
210
|
-
headers,
|
|
211
|
-
path: resolvedPath,
|
|
212
|
-
body,
|
|
213
|
-
});
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
export const serializeAws_restJson1UntagResourceCommand = async (
|
|
217
|
-
input: UntagResourceCommandInput,
|
|
218
|
-
context: __SerdeContext
|
|
219
|
-
): Promise<__HttpRequest> => {
|
|
220
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
221
|
-
const headers: any = {};
|
|
222
|
-
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{resourceArn}";
|
|
223
|
-
if (input.resourceArn !== undefined) {
|
|
224
|
-
const labelValue: string = input.resourceArn;
|
|
225
|
-
if (labelValue.length <= 0) {
|
|
226
|
-
throw new Error("Empty value provided for input HTTP label: resourceArn.");
|
|
227
|
-
}
|
|
228
|
-
resolvedPath = resolvedPath.replace("{resourceArn}", __extendedEncodeURIComponent(labelValue));
|
|
229
|
-
} else {
|
|
230
|
-
throw new Error("No value provided for input HTTP label: resourceArn.");
|
|
231
|
-
}
|
|
232
|
-
const query: any = {
|
|
233
|
-
...(input.tagKeys !== undefined && { tagKeys: (input.tagKeys || []).map((_entry) => _entry as any) }),
|
|
234
|
-
};
|
|
235
|
-
let body: any;
|
|
236
|
-
return new __HttpRequest({
|
|
237
|
-
protocol,
|
|
238
|
-
hostname,
|
|
239
|
-
port,
|
|
240
|
-
method: "DELETE",
|
|
241
|
-
headers,
|
|
242
|
-
path: resolvedPath,
|
|
243
|
-
query,
|
|
244
|
-
body,
|
|
245
|
-
});
|
|
246
|
-
};
|
|
247
|
-
|
|
248
|
-
export const serializeAws_restJson1UpdateEnvironmentCommand = async (
|
|
249
|
-
input: UpdateEnvironmentCommandInput,
|
|
250
|
-
context: __SerdeContext
|
|
251
|
-
): Promise<__HttpRequest> => {
|
|
252
|
-
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
253
|
-
const headers: any = {
|
|
254
|
-
"content-type": "application/json",
|
|
255
|
-
};
|
|
256
|
-
let resolvedPath =
|
|
257
|
-
`${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/environment/{environmentId}";
|
|
258
|
-
if (input.environmentId !== undefined) {
|
|
259
|
-
const labelValue: string = input.environmentId;
|
|
260
|
-
if (labelValue.length <= 0) {
|
|
261
|
-
throw new Error("Empty value provided for input HTTP label: environmentId.");
|
|
262
|
-
}
|
|
263
|
-
resolvedPath = resolvedPath.replace("{environmentId}", __extendedEncodeURIComponent(labelValue));
|
|
264
|
-
} else {
|
|
265
|
-
throw new Error("No value provided for input HTTP label: environmentId.");
|
|
266
|
-
}
|
|
267
|
-
let body: any;
|
|
268
|
-
body = JSON.stringify({
|
|
269
|
-
...(input.description !== undefined && input.description !== null && { description: input.description }),
|
|
270
|
-
...(input.federationMode !== undefined &&
|
|
271
|
-
input.federationMode !== null && { federationMode: input.federationMode }),
|
|
272
|
-
...(input.federationParameters !== undefined &&
|
|
273
|
-
input.federationParameters !== null && {
|
|
274
|
-
federationParameters: serializeAws_restJson1FederationParameters(input.federationParameters, context),
|
|
275
|
-
}),
|
|
276
|
-
...(input.name !== undefined && input.name !== null && { name: input.name }),
|
|
277
|
-
});
|
|
278
|
-
return new __HttpRequest({
|
|
279
|
-
protocol,
|
|
280
|
-
hostname,
|
|
281
|
-
port,
|
|
282
|
-
method: "PUT",
|
|
283
|
-
headers,
|
|
284
|
-
path: resolvedPath,
|
|
285
|
-
body,
|
|
286
|
-
});
|
|
287
|
-
};
|
|
288
|
-
|
|
289
|
-
export const deserializeAws_restJson1CreateEnvironmentCommand = async (
|
|
290
|
-
output: __HttpResponse,
|
|
291
|
-
context: __SerdeContext
|
|
292
|
-
): Promise<CreateEnvironmentCommandOutput> => {
|
|
293
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
294
|
-
return deserializeAws_restJson1CreateEnvironmentCommandError(output, context);
|
|
295
|
-
}
|
|
296
|
-
const contents: CreateEnvironmentCommandOutput = {
|
|
297
|
-
$metadata: deserializeMetadata(output),
|
|
298
|
-
environmentArn: undefined,
|
|
299
|
-
environmentId: undefined,
|
|
300
|
-
environmentUrl: undefined,
|
|
301
|
-
};
|
|
302
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
303
|
-
if (data.environmentArn !== undefined && data.environmentArn !== null) {
|
|
304
|
-
contents.environmentArn = __expectString(data.environmentArn);
|
|
305
|
-
}
|
|
306
|
-
if (data.environmentId !== undefined && data.environmentId !== null) {
|
|
307
|
-
contents.environmentId = __expectString(data.environmentId);
|
|
308
|
-
}
|
|
309
|
-
if (data.environmentUrl !== undefined && data.environmentUrl !== null) {
|
|
310
|
-
contents.environmentUrl = __expectString(data.environmentUrl);
|
|
311
|
-
}
|
|
312
|
-
return Promise.resolve(contents);
|
|
313
|
-
};
|
|
314
|
-
|
|
315
|
-
const deserializeAws_restJson1CreateEnvironmentCommandError = async (
|
|
316
|
-
output: __HttpResponse,
|
|
317
|
-
context: __SerdeContext
|
|
318
|
-
): Promise<CreateEnvironmentCommandOutput> => {
|
|
319
|
-
const parsedOutput: any = {
|
|
320
|
-
...output,
|
|
321
|
-
body: await parseBody(output.body, context),
|
|
322
|
-
};
|
|
323
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
324
|
-
let errorCode = "UnknownError";
|
|
325
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
326
|
-
switch (errorCode) {
|
|
327
|
-
case "AccessDeniedException":
|
|
328
|
-
case "com.amazonaws.finspace#AccessDeniedException":
|
|
329
|
-
response = {
|
|
330
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
331
|
-
name: errorCode,
|
|
332
|
-
$metadata: deserializeMetadata(output),
|
|
333
|
-
};
|
|
334
|
-
break;
|
|
335
|
-
case "InternalServerException":
|
|
336
|
-
case "com.amazonaws.finspace#InternalServerException":
|
|
337
|
-
response = {
|
|
338
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
339
|
-
name: errorCode,
|
|
340
|
-
$metadata: deserializeMetadata(output),
|
|
341
|
-
};
|
|
342
|
-
break;
|
|
343
|
-
case "LimitExceededException":
|
|
344
|
-
case "com.amazonaws.finspace#LimitExceededException":
|
|
345
|
-
response = {
|
|
346
|
-
...(await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)),
|
|
347
|
-
name: errorCode,
|
|
348
|
-
$metadata: deserializeMetadata(output),
|
|
349
|
-
};
|
|
350
|
-
break;
|
|
351
|
-
case "ServiceQuotaExceededException":
|
|
352
|
-
case "com.amazonaws.finspace#ServiceQuotaExceededException":
|
|
353
|
-
response = {
|
|
354
|
-
...(await deserializeAws_restJson1ServiceQuotaExceededExceptionResponse(parsedOutput, context)),
|
|
355
|
-
name: errorCode,
|
|
356
|
-
$metadata: deserializeMetadata(output),
|
|
357
|
-
};
|
|
358
|
-
break;
|
|
359
|
-
case "ThrottlingException":
|
|
360
|
-
case "com.amazonaws.finspace#ThrottlingException":
|
|
361
|
-
response = {
|
|
362
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
363
|
-
name: errorCode,
|
|
364
|
-
$metadata: deserializeMetadata(output),
|
|
365
|
-
};
|
|
366
|
-
break;
|
|
367
|
-
case "ValidationException":
|
|
368
|
-
case "com.amazonaws.finspace#ValidationException":
|
|
369
|
-
response = {
|
|
370
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
371
|
-
name: errorCode,
|
|
372
|
-
$metadata: deserializeMetadata(output),
|
|
373
|
-
};
|
|
374
|
-
break;
|
|
375
|
-
default:
|
|
376
|
-
const parsedBody = parsedOutput.body;
|
|
377
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
378
|
-
response = {
|
|
379
|
-
...parsedBody,
|
|
380
|
-
name: `${errorCode}`,
|
|
381
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
382
|
-
$fault: "client",
|
|
383
|
-
$metadata: deserializeMetadata(output),
|
|
384
|
-
} as any;
|
|
385
|
-
}
|
|
386
|
-
const message = response.message || response.Message || errorCode;
|
|
387
|
-
response.message = message;
|
|
388
|
-
delete response.Message;
|
|
389
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
390
|
-
};
|
|
391
|
-
|
|
392
|
-
export const deserializeAws_restJson1DeleteEnvironmentCommand = async (
|
|
393
|
-
output: __HttpResponse,
|
|
394
|
-
context: __SerdeContext
|
|
395
|
-
): Promise<DeleteEnvironmentCommandOutput> => {
|
|
396
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
397
|
-
return deserializeAws_restJson1DeleteEnvironmentCommandError(output, context);
|
|
398
|
-
}
|
|
399
|
-
const contents: DeleteEnvironmentCommandOutput = {
|
|
400
|
-
$metadata: deserializeMetadata(output),
|
|
401
|
-
};
|
|
402
|
-
await collectBody(output.body, context);
|
|
403
|
-
return Promise.resolve(contents);
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
const deserializeAws_restJson1DeleteEnvironmentCommandError = async (
|
|
407
|
-
output: __HttpResponse,
|
|
408
|
-
context: __SerdeContext
|
|
409
|
-
): Promise<DeleteEnvironmentCommandOutput> => {
|
|
410
|
-
const parsedOutput: any = {
|
|
411
|
-
...output,
|
|
412
|
-
body: await parseBody(output.body, context),
|
|
413
|
-
};
|
|
414
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
415
|
-
let errorCode = "UnknownError";
|
|
416
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
417
|
-
switch (errorCode) {
|
|
418
|
-
case "AccessDeniedException":
|
|
419
|
-
case "com.amazonaws.finspace#AccessDeniedException":
|
|
420
|
-
response = {
|
|
421
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
422
|
-
name: errorCode,
|
|
423
|
-
$metadata: deserializeMetadata(output),
|
|
424
|
-
};
|
|
425
|
-
break;
|
|
426
|
-
case "InternalServerException":
|
|
427
|
-
case "com.amazonaws.finspace#InternalServerException":
|
|
428
|
-
response = {
|
|
429
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
430
|
-
name: errorCode,
|
|
431
|
-
$metadata: deserializeMetadata(output),
|
|
432
|
-
};
|
|
433
|
-
break;
|
|
434
|
-
case "ResourceNotFoundException":
|
|
435
|
-
case "com.amazonaws.finspace#ResourceNotFoundException":
|
|
436
|
-
response = {
|
|
437
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
438
|
-
name: errorCode,
|
|
439
|
-
$metadata: deserializeMetadata(output),
|
|
440
|
-
};
|
|
441
|
-
break;
|
|
442
|
-
case "ThrottlingException":
|
|
443
|
-
case "com.amazonaws.finspace#ThrottlingException":
|
|
444
|
-
response = {
|
|
445
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
446
|
-
name: errorCode,
|
|
447
|
-
$metadata: deserializeMetadata(output),
|
|
448
|
-
};
|
|
449
|
-
break;
|
|
450
|
-
case "ValidationException":
|
|
451
|
-
case "com.amazonaws.finspace#ValidationException":
|
|
452
|
-
response = {
|
|
453
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
454
|
-
name: errorCode,
|
|
455
|
-
$metadata: deserializeMetadata(output),
|
|
456
|
-
};
|
|
457
|
-
break;
|
|
458
|
-
default:
|
|
459
|
-
const parsedBody = parsedOutput.body;
|
|
460
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
461
|
-
response = {
|
|
462
|
-
...parsedBody,
|
|
463
|
-
name: `${errorCode}`,
|
|
464
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
465
|
-
$fault: "client",
|
|
466
|
-
$metadata: deserializeMetadata(output),
|
|
467
|
-
} as any;
|
|
468
|
-
}
|
|
469
|
-
const message = response.message || response.Message || errorCode;
|
|
470
|
-
response.message = message;
|
|
471
|
-
delete response.Message;
|
|
472
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
473
|
-
};
|
|
474
|
-
|
|
475
|
-
export const deserializeAws_restJson1GetEnvironmentCommand = async (
|
|
476
|
-
output: __HttpResponse,
|
|
477
|
-
context: __SerdeContext
|
|
478
|
-
): Promise<GetEnvironmentCommandOutput> => {
|
|
479
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
480
|
-
return deserializeAws_restJson1GetEnvironmentCommandError(output, context);
|
|
481
|
-
}
|
|
482
|
-
const contents: GetEnvironmentCommandOutput = {
|
|
483
|
-
$metadata: deserializeMetadata(output),
|
|
484
|
-
environment: undefined,
|
|
485
|
-
};
|
|
486
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
487
|
-
if (data.environment !== undefined && data.environment !== null) {
|
|
488
|
-
contents.environment = deserializeAws_restJson1Environment(data.environment, context);
|
|
489
|
-
}
|
|
490
|
-
return Promise.resolve(contents);
|
|
491
|
-
};
|
|
492
|
-
|
|
493
|
-
const deserializeAws_restJson1GetEnvironmentCommandError = async (
|
|
494
|
-
output: __HttpResponse,
|
|
495
|
-
context: __SerdeContext
|
|
496
|
-
): Promise<GetEnvironmentCommandOutput> => {
|
|
497
|
-
const parsedOutput: any = {
|
|
498
|
-
...output,
|
|
499
|
-
body: await parseBody(output.body, context),
|
|
500
|
-
};
|
|
501
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
502
|
-
let errorCode = "UnknownError";
|
|
503
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
504
|
-
switch (errorCode) {
|
|
505
|
-
case "AccessDeniedException":
|
|
506
|
-
case "com.amazonaws.finspace#AccessDeniedException":
|
|
507
|
-
response = {
|
|
508
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
509
|
-
name: errorCode,
|
|
510
|
-
$metadata: deserializeMetadata(output),
|
|
511
|
-
};
|
|
512
|
-
break;
|
|
513
|
-
case "InternalServerException":
|
|
514
|
-
case "com.amazonaws.finspace#InternalServerException":
|
|
515
|
-
response = {
|
|
516
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
517
|
-
name: errorCode,
|
|
518
|
-
$metadata: deserializeMetadata(output),
|
|
519
|
-
};
|
|
520
|
-
break;
|
|
521
|
-
case "ResourceNotFoundException":
|
|
522
|
-
case "com.amazonaws.finspace#ResourceNotFoundException":
|
|
523
|
-
response = {
|
|
524
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
525
|
-
name: errorCode,
|
|
526
|
-
$metadata: deserializeMetadata(output),
|
|
527
|
-
};
|
|
528
|
-
break;
|
|
529
|
-
case "ValidationException":
|
|
530
|
-
case "com.amazonaws.finspace#ValidationException":
|
|
531
|
-
response = {
|
|
532
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
533
|
-
name: errorCode,
|
|
534
|
-
$metadata: deserializeMetadata(output),
|
|
535
|
-
};
|
|
536
|
-
break;
|
|
537
|
-
default:
|
|
538
|
-
const parsedBody = parsedOutput.body;
|
|
539
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
540
|
-
response = {
|
|
541
|
-
...parsedBody,
|
|
542
|
-
name: `${errorCode}`,
|
|
543
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
544
|
-
$fault: "client",
|
|
545
|
-
$metadata: deserializeMetadata(output),
|
|
546
|
-
} as any;
|
|
547
|
-
}
|
|
548
|
-
const message = response.message || response.Message || errorCode;
|
|
549
|
-
response.message = message;
|
|
550
|
-
delete response.Message;
|
|
551
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
552
|
-
};
|
|
553
|
-
|
|
554
|
-
export const deserializeAws_restJson1ListEnvironmentsCommand = async (
|
|
555
|
-
output: __HttpResponse,
|
|
556
|
-
context: __SerdeContext
|
|
557
|
-
): Promise<ListEnvironmentsCommandOutput> => {
|
|
558
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
559
|
-
return deserializeAws_restJson1ListEnvironmentsCommandError(output, context);
|
|
560
|
-
}
|
|
561
|
-
const contents: ListEnvironmentsCommandOutput = {
|
|
562
|
-
$metadata: deserializeMetadata(output),
|
|
563
|
-
environments: undefined,
|
|
564
|
-
nextToken: undefined,
|
|
565
|
-
};
|
|
566
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
567
|
-
if (data.environments !== undefined && data.environments !== null) {
|
|
568
|
-
contents.environments = deserializeAws_restJson1EnvironmentList(data.environments, context);
|
|
569
|
-
}
|
|
570
|
-
if (data.nextToken !== undefined && data.nextToken !== null) {
|
|
571
|
-
contents.nextToken = __expectString(data.nextToken);
|
|
572
|
-
}
|
|
573
|
-
return Promise.resolve(contents);
|
|
574
|
-
};
|
|
575
|
-
|
|
576
|
-
const deserializeAws_restJson1ListEnvironmentsCommandError = async (
|
|
577
|
-
output: __HttpResponse,
|
|
578
|
-
context: __SerdeContext
|
|
579
|
-
): Promise<ListEnvironmentsCommandOutput> => {
|
|
580
|
-
const parsedOutput: any = {
|
|
581
|
-
...output,
|
|
582
|
-
body: await parseBody(output.body, context),
|
|
583
|
-
};
|
|
584
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
585
|
-
let errorCode = "UnknownError";
|
|
586
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
587
|
-
switch (errorCode) {
|
|
588
|
-
case "InternalServerException":
|
|
589
|
-
case "com.amazonaws.finspace#InternalServerException":
|
|
590
|
-
response = {
|
|
591
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
592
|
-
name: errorCode,
|
|
593
|
-
$metadata: deserializeMetadata(output),
|
|
594
|
-
};
|
|
595
|
-
break;
|
|
596
|
-
case "ValidationException":
|
|
597
|
-
case "com.amazonaws.finspace#ValidationException":
|
|
598
|
-
response = {
|
|
599
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
600
|
-
name: errorCode,
|
|
601
|
-
$metadata: deserializeMetadata(output),
|
|
602
|
-
};
|
|
603
|
-
break;
|
|
604
|
-
default:
|
|
605
|
-
const parsedBody = parsedOutput.body;
|
|
606
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
607
|
-
response = {
|
|
608
|
-
...parsedBody,
|
|
609
|
-
name: `${errorCode}`,
|
|
610
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
611
|
-
$fault: "client",
|
|
612
|
-
$metadata: deserializeMetadata(output),
|
|
613
|
-
} as any;
|
|
614
|
-
}
|
|
615
|
-
const message = response.message || response.Message || errorCode;
|
|
616
|
-
response.message = message;
|
|
617
|
-
delete response.Message;
|
|
618
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
619
|
-
};
|
|
620
|
-
|
|
621
|
-
export const deserializeAws_restJson1ListTagsForResourceCommand = async (
|
|
622
|
-
output: __HttpResponse,
|
|
623
|
-
context: __SerdeContext
|
|
624
|
-
): Promise<ListTagsForResourceCommandOutput> => {
|
|
625
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
626
|
-
return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
|
|
627
|
-
}
|
|
628
|
-
const contents: ListTagsForResourceCommandOutput = {
|
|
629
|
-
$metadata: deserializeMetadata(output),
|
|
630
|
-
tags: undefined,
|
|
631
|
-
};
|
|
632
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
633
|
-
if (data.tags !== undefined && data.tags !== null) {
|
|
634
|
-
contents.tags = deserializeAws_restJson1TagMap(data.tags, context);
|
|
635
|
-
}
|
|
636
|
-
return Promise.resolve(contents);
|
|
637
|
-
};
|
|
638
|
-
|
|
639
|
-
const deserializeAws_restJson1ListTagsForResourceCommandError = async (
|
|
640
|
-
output: __HttpResponse,
|
|
641
|
-
context: __SerdeContext
|
|
642
|
-
): Promise<ListTagsForResourceCommandOutput> => {
|
|
643
|
-
const parsedOutput: any = {
|
|
644
|
-
...output,
|
|
645
|
-
body: await parseBody(output.body, context),
|
|
646
|
-
};
|
|
647
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
648
|
-
let errorCode = "UnknownError";
|
|
649
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
650
|
-
switch (errorCode) {
|
|
651
|
-
case "InternalServerException":
|
|
652
|
-
case "com.amazonaws.finspace#InternalServerException":
|
|
653
|
-
response = {
|
|
654
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
655
|
-
name: errorCode,
|
|
656
|
-
$metadata: deserializeMetadata(output),
|
|
657
|
-
};
|
|
658
|
-
break;
|
|
659
|
-
case "InvalidRequestException":
|
|
660
|
-
case "com.amazonaws.finspace#InvalidRequestException":
|
|
661
|
-
response = {
|
|
662
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
663
|
-
name: errorCode,
|
|
664
|
-
$metadata: deserializeMetadata(output),
|
|
665
|
-
};
|
|
666
|
-
break;
|
|
667
|
-
case "ResourceNotFoundException":
|
|
668
|
-
case "com.amazonaws.finspace#ResourceNotFoundException":
|
|
669
|
-
response = {
|
|
670
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
671
|
-
name: errorCode,
|
|
672
|
-
$metadata: deserializeMetadata(output),
|
|
673
|
-
};
|
|
674
|
-
break;
|
|
675
|
-
default:
|
|
676
|
-
const parsedBody = parsedOutput.body;
|
|
677
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
678
|
-
response = {
|
|
679
|
-
...parsedBody,
|
|
680
|
-
name: `${errorCode}`,
|
|
681
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
682
|
-
$fault: "client",
|
|
683
|
-
$metadata: deserializeMetadata(output),
|
|
684
|
-
} as any;
|
|
685
|
-
}
|
|
686
|
-
const message = response.message || response.Message || errorCode;
|
|
687
|
-
response.message = message;
|
|
688
|
-
delete response.Message;
|
|
689
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
690
|
-
};
|
|
691
|
-
|
|
692
|
-
export const deserializeAws_restJson1TagResourceCommand = async (
|
|
693
|
-
output: __HttpResponse,
|
|
694
|
-
context: __SerdeContext
|
|
695
|
-
): Promise<TagResourceCommandOutput> => {
|
|
696
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
697
|
-
return deserializeAws_restJson1TagResourceCommandError(output, context);
|
|
698
|
-
}
|
|
699
|
-
const contents: TagResourceCommandOutput = {
|
|
700
|
-
$metadata: deserializeMetadata(output),
|
|
701
|
-
};
|
|
702
|
-
await collectBody(output.body, context);
|
|
703
|
-
return Promise.resolve(contents);
|
|
704
|
-
};
|
|
705
|
-
|
|
706
|
-
const deserializeAws_restJson1TagResourceCommandError = async (
|
|
707
|
-
output: __HttpResponse,
|
|
708
|
-
context: __SerdeContext
|
|
709
|
-
): Promise<TagResourceCommandOutput> => {
|
|
710
|
-
const parsedOutput: any = {
|
|
711
|
-
...output,
|
|
712
|
-
body: await parseBody(output.body, context),
|
|
713
|
-
};
|
|
714
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
715
|
-
let errorCode = "UnknownError";
|
|
716
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
717
|
-
switch (errorCode) {
|
|
718
|
-
case "InternalServerException":
|
|
719
|
-
case "com.amazonaws.finspace#InternalServerException":
|
|
720
|
-
response = {
|
|
721
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
722
|
-
name: errorCode,
|
|
723
|
-
$metadata: deserializeMetadata(output),
|
|
724
|
-
};
|
|
725
|
-
break;
|
|
726
|
-
case "InvalidRequestException":
|
|
727
|
-
case "com.amazonaws.finspace#InvalidRequestException":
|
|
728
|
-
response = {
|
|
729
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
730
|
-
name: errorCode,
|
|
731
|
-
$metadata: deserializeMetadata(output),
|
|
732
|
-
};
|
|
733
|
-
break;
|
|
734
|
-
case "ResourceNotFoundException":
|
|
735
|
-
case "com.amazonaws.finspace#ResourceNotFoundException":
|
|
736
|
-
response = {
|
|
737
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
738
|
-
name: errorCode,
|
|
739
|
-
$metadata: deserializeMetadata(output),
|
|
740
|
-
};
|
|
741
|
-
break;
|
|
742
|
-
default:
|
|
743
|
-
const parsedBody = parsedOutput.body;
|
|
744
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
745
|
-
response = {
|
|
746
|
-
...parsedBody,
|
|
747
|
-
name: `${errorCode}`,
|
|
748
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
749
|
-
$fault: "client",
|
|
750
|
-
$metadata: deserializeMetadata(output),
|
|
751
|
-
} as any;
|
|
752
|
-
}
|
|
753
|
-
const message = response.message || response.Message || errorCode;
|
|
754
|
-
response.message = message;
|
|
755
|
-
delete response.Message;
|
|
756
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
757
|
-
};
|
|
758
|
-
|
|
759
|
-
export const deserializeAws_restJson1UntagResourceCommand = async (
|
|
760
|
-
output: __HttpResponse,
|
|
761
|
-
context: __SerdeContext
|
|
762
|
-
): Promise<UntagResourceCommandOutput> => {
|
|
763
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
764
|
-
return deserializeAws_restJson1UntagResourceCommandError(output, context);
|
|
765
|
-
}
|
|
766
|
-
const contents: UntagResourceCommandOutput = {
|
|
767
|
-
$metadata: deserializeMetadata(output),
|
|
768
|
-
};
|
|
769
|
-
await collectBody(output.body, context);
|
|
770
|
-
return Promise.resolve(contents);
|
|
771
|
-
};
|
|
772
|
-
|
|
773
|
-
const deserializeAws_restJson1UntagResourceCommandError = async (
|
|
774
|
-
output: __HttpResponse,
|
|
775
|
-
context: __SerdeContext
|
|
776
|
-
): Promise<UntagResourceCommandOutput> => {
|
|
777
|
-
const parsedOutput: any = {
|
|
778
|
-
...output,
|
|
779
|
-
body: await parseBody(output.body, context),
|
|
780
|
-
};
|
|
781
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
782
|
-
let errorCode = "UnknownError";
|
|
783
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
784
|
-
switch (errorCode) {
|
|
785
|
-
case "InternalServerException":
|
|
786
|
-
case "com.amazonaws.finspace#InternalServerException":
|
|
787
|
-
response = {
|
|
788
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
789
|
-
name: errorCode,
|
|
790
|
-
$metadata: deserializeMetadata(output),
|
|
791
|
-
};
|
|
792
|
-
break;
|
|
793
|
-
case "InvalidRequestException":
|
|
794
|
-
case "com.amazonaws.finspace#InvalidRequestException":
|
|
795
|
-
response = {
|
|
796
|
-
...(await deserializeAws_restJson1InvalidRequestExceptionResponse(parsedOutput, context)),
|
|
797
|
-
name: errorCode,
|
|
798
|
-
$metadata: deserializeMetadata(output),
|
|
799
|
-
};
|
|
800
|
-
break;
|
|
801
|
-
case "ResourceNotFoundException":
|
|
802
|
-
case "com.amazonaws.finspace#ResourceNotFoundException":
|
|
803
|
-
response = {
|
|
804
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
805
|
-
name: errorCode,
|
|
806
|
-
$metadata: deserializeMetadata(output),
|
|
807
|
-
};
|
|
808
|
-
break;
|
|
809
|
-
default:
|
|
810
|
-
const parsedBody = parsedOutput.body;
|
|
811
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
812
|
-
response = {
|
|
813
|
-
...parsedBody,
|
|
814
|
-
name: `${errorCode}`,
|
|
815
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
816
|
-
$fault: "client",
|
|
817
|
-
$metadata: deserializeMetadata(output),
|
|
818
|
-
} as any;
|
|
819
|
-
}
|
|
820
|
-
const message = response.message || response.Message || errorCode;
|
|
821
|
-
response.message = message;
|
|
822
|
-
delete response.Message;
|
|
823
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
824
|
-
};
|
|
825
|
-
|
|
826
|
-
export const deserializeAws_restJson1UpdateEnvironmentCommand = async (
|
|
827
|
-
output: __HttpResponse,
|
|
828
|
-
context: __SerdeContext
|
|
829
|
-
): Promise<UpdateEnvironmentCommandOutput> => {
|
|
830
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
831
|
-
return deserializeAws_restJson1UpdateEnvironmentCommandError(output, context);
|
|
832
|
-
}
|
|
833
|
-
const contents: UpdateEnvironmentCommandOutput = {
|
|
834
|
-
$metadata: deserializeMetadata(output),
|
|
835
|
-
environment: undefined,
|
|
836
|
-
};
|
|
837
|
-
const data: { [key: string]: any } = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
838
|
-
if (data.environment !== undefined && data.environment !== null) {
|
|
839
|
-
contents.environment = deserializeAws_restJson1Environment(data.environment, context);
|
|
840
|
-
}
|
|
841
|
-
return Promise.resolve(contents);
|
|
842
|
-
};
|
|
843
|
-
|
|
844
|
-
const deserializeAws_restJson1UpdateEnvironmentCommandError = async (
|
|
845
|
-
output: __HttpResponse,
|
|
846
|
-
context: __SerdeContext
|
|
847
|
-
): Promise<UpdateEnvironmentCommandOutput> => {
|
|
848
|
-
const parsedOutput: any = {
|
|
849
|
-
...output,
|
|
850
|
-
body: await parseBody(output.body, context),
|
|
851
|
-
};
|
|
852
|
-
let response: __SmithyException & __MetadataBearer & { [key: string]: any };
|
|
853
|
-
let errorCode = "UnknownError";
|
|
854
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
855
|
-
switch (errorCode) {
|
|
856
|
-
case "AccessDeniedException":
|
|
857
|
-
case "com.amazonaws.finspace#AccessDeniedException":
|
|
858
|
-
response = {
|
|
859
|
-
...(await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)),
|
|
860
|
-
name: errorCode,
|
|
861
|
-
$metadata: deserializeMetadata(output),
|
|
862
|
-
};
|
|
863
|
-
break;
|
|
864
|
-
case "InternalServerException":
|
|
865
|
-
case "com.amazonaws.finspace#InternalServerException":
|
|
866
|
-
response = {
|
|
867
|
-
...(await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)),
|
|
868
|
-
name: errorCode,
|
|
869
|
-
$metadata: deserializeMetadata(output),
|
|
870
|
-
};
|
|
871
|
-
break;
|
|
872
|
-
case "ResourceNotFoundException":
|
|
873
|
-
case "com.amazonaws.finspace#ResourceNotFoundException":
|
|
874
|
-
response = {
|
|
875
|
-
...(await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)),
|
|
876
|
-
name: errorCode,
|
|
877
|
-
$metadata: deserializeMetadata(output),
|
|
878
|
-
};
|
|
879
|
-
break;
|
|
880
|
-
case "ThrottlingException":
|
|
881
|
-
case "com.amazonaws.finspace#ThrottlingException":
|
|
882
|
-
response = {
|
|
883
|
-
...(await deserializeAws_restJson1ThrottlingExceptionResponse(parsedOutput, context)),
|
|
884
|
-
name: errorCode,
|
|
885
|
-
$metadata: deserializeMetadata(output),
|
|
886
|
-
};
|
|
887
|
-
break;
|
|
888
|
-
case "ValidationException":
|
|
889
|
-
case "com.amazonaws.finspace#ValidationException":
|
|
890
|
-
response = {
|
|
891
|
-
...(await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)),
|
|
892
|
-
name: errorCode,
|
|
893
|
-
$metadata: deserializeMetadata(output),
|
|
894
|
-
};
|
|
895
|
-
break;
|
|
896
|
-
default:
|
|
897
|
-
const parsedBody = parsedOutput.body;
|
|
898
|
-
errorCode = parsedBody.code || parsedBody.Code || errorCode;
|
|
899
|
-
response = {
|
|
900
|
-
...parsedBody,
|
|
901
|
-
name: `${errorCode}`,
|
|
902
|
-
message: parsedBody.message || parsedBody.Message || errorCode,
|
|
903
|
-
$fault: "client",
|
|
904
|
-
$metadata: deserializeMetadata(output),
|
|
905
|
-
} as any;
|
|
906
|
-
}
|
|
907
|
-
const message = response.message || response.Message || errorCode;
|
|
908
|
-
response.message = message;
|
|
909
|
-
delete response.Message;
|
|
910
|
-
return Promise.reject(Object.assign(new Error(message), response));
|
|
911
|
-
};
|
|
912
|
-
|
|
913
|
-
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (
|
|
914
|
-
parsedOutput: any,
|
|
915
|
-
context: __SerdeContext
|
|
916
|
-
): Promise<AccessDeniedException> => {
|
|
917
|
-
const contents: AccessDeniedException = {
|
|
918
|
-
name: "AccessDeniedException",
|
|
919
|
-
$fault: "client",
|
|
920
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
921
|
-
};
|
|
922
|
-
const data: any = parsedOutput.body;
|
|
923
|
-
return contents;
|
|
924
|
-
};
|
|
925
|
-
|
|
926
|
-
const deserializeAws_restJson1InternalServerExceptionResponse = async (
|
|
927
|
-
parsedOutput: any,
|
|
928
|
-
context: __SerdeContext
|
|
929
|
-
): Promise<InternalServerException> => {
|
|
930
|
-
const contents: InternalServerException = {
|
|
931
|
-
name: "InternalServerException",
|
|
932
|
-
$fault: "server",
|
|
933
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
934
|
-
message: undefined,
|
|
935
|
-
};
|
|
936
|
-
const data: any = parsedOutput.body;
|
|
937
|
-
if (data.message !== undefined && data.message !== null) {
|
|
938
|
-
contents.message = __expectString(data.message);
|
|
939
|
-
}
|
|
940
|
-
return contents;
|
|
941
|
-
};
|
|
942
|
-
|
|
943
|
-
const deserializeAws_restJson1InvalidRequestExceptionResponse = async (
|
|
944
|
-
parsedOutput: any,
|
|
945
|
-
context: __SerdeContext
|
|
946
|
-
): Promise<InvalidRequestException> => {
|
|
947
|
-
const contents: InvalidRequestException = {
|
|
948
|
-
name: "InvalidRequestException",
|
|
949
|
-
$fault: "client",
|
|
950
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
951
|
-
message: undefined,
|
|
952
|
-
};
|
|
953
|
-
const data: any = parsedOutput.body;
|
|
954
|
-
if (data.message !== undefined && data.message !== null) {
|
|
955
|
-
contents.message = __expectString(data.message);
|
|
956
|
-
}
|
|
957
|
-
return contents;
|
|
958
|
-
};
|
|
959
|
-
|
|
960
|
-
const deserializeAws_restJson1LimitExceededExceptionResponse = async (
|
|
961
|
-
parsedOutput: any,
|
|
962
|
-
context: __SerdeContext
|
|
963
|
-
): Promise<LimitExceededException> => {
|
|
964
|
-
const contents: LimitExceededException = {
|
|
965
|
-
name: "LimitExceededException",
|
|
966
|
-
$fault: "client",
|
|
967
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
968
|
-
message: undefined,
|
|
969
|
-
};
|
|
970
|
-
const data: any = parsedOutput.body;
|
|
971
|
-
if (data.message !== undefined && data.message !== null) {
|
|
972
|
-
contents.message = __expectString(data.message);
|
|
973
|
-
}
|
|
974
|
-
return contents;
|
|
975
|
-
};
|
|
976
|
-
|
|
977
|
-
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (
|
|
978
|
-
parsedOutput: any,
|
|
979
|
-
context: __SerdeContext
|
|
980
|
-
): Promise<ResourceNotFoundException> => {
|
|
981
|
-
const contents: ResourceNotFoundException = {
|
|
982
|
-
name: "ResourceNotFoundException",
|
|
983
|
-
$fault: "client",
|
|
984
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
985
|
-
message: undefined,
|
|
986
|
-
};
|
|
987
|
-
const data: any = parsedOutput.body;
|
|
988
|
-
if (data.message !== undefined && data.message !== null) {
|
|
989
|
-
contents.message = __expectString(data.message);
|
|
990
|
-
}
|
|
991
|
-
return contents;
|
|
992
|
-
};
|
|
993
|
-
|
|
994
|
-
const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (
|
|
995
|
-
parsedOutput: any,
|
|
996
|
-
context: __SerdeContext
|
|
997
|
-
): Promise<ServiceQuotaExceededException> => {
|
|
998
|
-
const contents: ServiceQuotaExceededException = {
|
|
999
|
-
name: "ServiceQuotaExceededException",
|
|
1000
|
-
$fault: "client",
|
|
1001
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1002
|
-
message: undefined,
|
|
1003
|
-
};
|
|
1004
|
-
const data: any = parsedOutput.body;
|
|
1005
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1006
|
-
contents.message = __expectString(data.message);
|
|
1007
|
-
}
|
|
1008
|
-
return contents;
|
|
1009
|
-
};
|
|
1010
|
-
|
|
1011
|
-
const deserializeAws_restJson1ThrottlingExceptionResponse = async (
|
|
1012
|
-
parsedOutput: any,
|
|
1013
|
-
context: __SerdeContext
|
|
1014
|
-
): Promise<ThrottlingException> => {
|
|
1015
|
-
const contents: ThrottlingException = {
|
|
1016
|
-
name: "ThrottlingException",
|
|
1017
|
-
$fault: "client",
|
|
1018
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1019
|
-
};
|
|
1020
|
-
const data: any = parsedOutput.body;
|
|
1021
|
-
return contents;
|
|
1022
|
-
};
|
|
1023
|
-
|
|
1024
|
-
const deserializeAws_restJson1ValidationExceptionResponse = async (
|
|
1025
|
-
parsedOutput: any,
|
|
1026
|
-
context: __SerdeContext
|
|
1027
|
-
): Promise<ValidationException> => {
|
|
1028
|
-
const contents: ValidationException = {
|
|
1029
|
-
name: "ValidationException",
|
|
1030
|
-
$fault: "client",
|
|
1031
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
1032
|
-
message: undefined,
|
|
1033
|
-
};
|
|
1034
|
-
const data: any = parsedOutput.body;
|
|
1035
|
-
if (data.message !== undefined && data.message !== null) {
|
|
1036
|
-
contents.message = __expectString(data.message);
|
|
1037
|
-
}
|
|
1038
|
-
return contents;
|
|
1039
|
-
};
|
|
1040
|
-
|
|
1041
|
-
const serializeAws_restJson1AttributeMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
|
|
1042
|
-
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
|
|
1043
|
-
if (value === null) {
|
|
1044
|
-
return acc;
|
|
1045
|
-
}
|
|
1046
|
-
return {
|
|
1047
|
-
...acc,
|
|
1048
|
-
[key]: value,
|
|
1049
|
-
};
|
|
1050
|
-
}, {});
|
|
1051
|
-
};
|
|
1052
|
-
|
|
1053
|
-
const serializeAws_restJson1FederationParameters = (input: FederationParameters, context: __SerdeContext): any => {
|
|
1054
|
-
return {
|
|
1055
|
-
...(input.applicationCallBackURL !== undefined &&
|
|
1056
|
-
input.applicationCallBackURL !== null && { applicationCallBackURL: input.applicationCallBackURL }),
|
|
1057
|
-
...(input.attributeMap !== undefined &&
|
|
1058
|
-
input.attributeMap !== null && { attributeMap: serializeAws_restJson1AttributeMap(input.attributeMap, context) }),
|
|
1059
|
-
...(input.federationProviderName !== undefined &&
|
|
1060
|
-
input.federationProviderName !== null && { federationProviderName: input.federationProviderName }),
|
|
1061
|
-
...(input.federationURN !== undefined && input.federationURN !== null && { federationURN: input.federationURN }),
|
|
1062
|
-
...(input.samlMetadataDocument !== undefined &&
|
|
1063
|
-
input.samlMetadataDocument !== null && { samlMetadataDocument: input.samlMetadataDocument }),
|
|
1064
|
-
...(input.samlMetadataURL !== undefined &&
|
|
1065
|
-
input.samlMetadataURL !== null && { samlMetadataURL: input.samlMetadataURL }),
|
|
1066
|
-
};
|
|
1067
|
-
};
|
|
1068
|
-
|
|
1069
|
-
const serializeAws_restJson1TagMap = (input: { [key: string]: string }, context: __SerdeContext): any => {
|
|
1070
|
-
return Object.entries(input).reduce((acc: { [key: string]: any }, [key, value]: [string, any]) => {
|
|
1071
|
-
if (value === null) {
|
|
1072
|
-
return acc;
|
|
1073
|
-
}
|
|
1074
|
-
return {
|
|
1075
|
-
...acc,
|
|
1076
|
-
[key]: value,
|
|
1077
|
-
};
|
|
1078
|
-
}, {});
|
|
1079
|
-
};
|
|
1080
|
-
|
|
1081
|
-
const deserializeAws_restJson1AttributeMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
|
|
1082
|
-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
1083
|
-
if (value === null) {
|
|
1084
|
-
return acc;
|
|
1085
|
-
}
|
|
1086
|
-
return {
|
|
1087
|
-
...acc,
|
|
1088
|
-
[key]: __expectString(value) as any,
|
|
1089
|
-
};
|
|
1090
|
-
}, {});
|
|
1091
|
-
};
|
|
1092
|
-
|
|
1093
|
-
const deserializeAws_restJson1Environment = (output: any, context: __SerdeContext): Environment => {
|
|
1094
|
-
return {
|
|
1095
|
-
awsAccountId: __expectString(output.awsAccountId),
|
|
1096
|
-
dedicatedServiceAccountId: __expectString(output.dedicatedServiceAccountId),
|
|
1097
|
-
description: __expectString(output.description),
|
|
1098
|
-
environmentArn: __expectString(output.environmentArn),
|
|
1099
|
-
environmentId: __expectString(output.environmentId),
|
|
1100
|
-
environmentUrl: __expectString(output.environmentUrl),
|
|
1101
|
-
federationMode: __expectString(output.federationMode),
|
|
1102
|
-
federationParameters:
|
|
1103
|
-
output.federationParameters !== undefined && output.federationParameters !== null
|
|
1104
|
-
? deserializeAws_restJson1FederationParameters(output.federationParameters, context)
|
|
1105
|
-
: undefined,
|
|
1106
|
-
kmsKeyId: __expectString(output.kmsKeyId),
|
|
1107
|
-
name: __expectString(output.name),
|
|
1108
|
-
sageMakerStudioDomainUrl: __expectString(output.sageMakerStudioDomainUrl),
|
|
1109
|
-
status: __expectString(output.status),
|
|
1110
|
-
} as any;
|
|
1111
|
-
};
|
|
1112
|
-
|
|
1113
|
-
const deserializeAws_restJson1EnvironmentList = (output: any, context: __SerdeContext): Environment[] => {
|
|
1114
|
-
return (output || [])
|
|
1115
|
-
.filter((e: any) => e != null)
|
|
1116
|
-
.map((entry: any) => {
|
|
1117
|
-
if (entry === null) {
|
|
1118
|
-
return null as any;
|
|
1119
|
-
}
|
|
1120
|
-
return deserializeAws_restJson1Environment(entry, context);
|
|
1121
|
-
});
|
|
1122
|
-
};
|
|
1123
|
-
|
|
1124
|
-
const deserializeAws_restJson1FederationParameters = (output: any, context: __SerdeContext): FederationParameters => {
|
|
1125
|
-
return {
|
|
1126
|
-
applicationCallBackURL: __expectString(output.applicationCallBackURL),
|
|
1127
|
-
attributeMap:
|
|
1128
|
-
output.attributeMap !== undefined && output.attributeMap !== null
|
|
1129
|
-
? deserializeAws_restJson1AttributeMap(output.attributeMap, context)
|
|
1130
|
-
: undefined,
|
|
1131
|
-
federationProviderName: __expectString(output.federationProviderName),
|
|
1132
|
-
federationURN: __expectString(output.federationURN),
|
|
1133
|
-
samlMetadataDocument: __expectString(output.samlMetadataDocument),
|
|
1134
|
-
samlMetadataURL: __expectString(output.samlMetadataURL),
|
|
1135
|
-
} as any;
|
|
1136
|
-
};
|
|
1137
|
-
|
|
1138
|
-
const deserializeAws_restJson1TagMap = (output: any, context: __SerdeContext): { [key: string]: string } => {
|
|
1139
|
-
return Object.entries(output).reduce((acc: { [key: string]: string }, [key, value]: [string, any]) => {
|
|
1140
|
-
if (value === null) {
|
|
1141
|
-
return acc;
|
|
1142
|
-
}
|
|
1143
|
-
return {
|
|
1144
|
-
...acc,
|
|
1145
|
-
[key]: __expectString(value) as any,
|
|
1146
|
-
};
|
|
1147
|
-
}, {});
|
|
1148
|
-
};
|
|
1149
|
-
|
|
1150
|
-
const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({
|
|
1151
|
-
httpStatusCode: output.statusCode,
|
|
1152
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
1153
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1154
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
1155
|
-
});
|
|
1156
|
-
|
|
1157
|
-
// Collect low-level response body stream to Uint8Array.
|
|
1158
|
-
const collectBody = (streamBody: any = new Uint8Array(), context: __SerdeContext): Promise<Uint8Array> => {
|
|
1159
|
-
if (streamBody instanceof Uint8Array) {
|
|
1160
|
-
return Promise.resolve(streamBody);
|
|
1161
|
-
}
|
|
1162
|
-
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
1163
|
-
};
|
|
1164
|
-
|
|
1165
|
-
// Encode Uint8Array data into string with utf-8.
|
|
1166
|
-
const collectBodyString = (streamBody: any, context: __SerdeContext): Promise<string> =>
|
|
1167
|
-
collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1168
|
-
|
|
1169
|
-
const isSerializableHeaderValue = (value: any): boolean =>
|
|
1170
|
-
value !== undefined &&
|
|
1171
|
-
value !== null &&
|
|
1172
|
-
value !== "" &&
|
|
1173
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
1174
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
1175
|
-
|
|
1176
|
-
const parseBody = (streamBody: any, context: __SerdeContext): any =>
|
|
1177
|
-
collectBodyString(streamBody, context).then((encoded) => {
|
|
1178
|
-
if (encoded.length) {
|
|
1179
|
-
return JSON.parse(encoded);
|
|
1180
|
-
}
|
|
1181
|
-
return {};
|
|
1182
|
-
});
|
|
1183
|
-
|
|
1184
|
-
/**
|
|
1185
|
-
* Load an error code for the aws.rest-json-1.1 protocol.
|
|
1186
|
-
*/
|
|
1187
|
-
const loadRestJsonErrorCode = (output: __HttpResponse, data: any): string => {
|
|
1188
|
-
const findKey = (object: any, key: string) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1189
|
-
|
|
1190
|
-
const sanitizeErrorCode = (rawValue: string): string => {
|
|
1191
|
-
let cleanValue = rawValue;
|
|
1192
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
1193
|
-
cleanValue = cleanValue.split(":")[0];
|
|
1194
|
-
}
|
|
1195
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
1196
|
-
cleanValue = cleanValue.split("#")[1];
|
|
1197
|
-
}
|
|
1198
|
-
return cleanValue;
|
|
1199
|
-
};
|
|
1200
|
-
|
|
1201
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1202
|
-
if (headerKey !== undefined) {
|
|
1203
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1204
|
-
}
|
|
1205
|
-
|
|
1206
|
-
if (data.code !== undefined) {
|
|
1207
|
-
return sanitizeErrorCode(data.code);
|
|
1208
|
-
}
|
|
1209
|
-
|
|
1210
|
-
if (data["__type"] !== undefined) {
|
|
1211
|
-
return sanitizeErrorCode(data["__type"]);
|
|
1212
|
-
}
|
|
1213
|
-
|
|
1214
|
-
return "";
|
|
1215
|
-
};
|