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