@aws-sdk/client-account 3.185.0 → 3.188.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 +16 -0
- package/dist-es/Account.js +22 -29
- package/dist-es/AccountClient.js +22 -28
- package/dist-es/commands/DeleteAlternateContactCommand.js +22 -29
- package/dist-es/commands/GetAlternateContactCommand.js +21 -28
- package/dist-es/commands/GetContactInformationCommand.js +21 -28
- package/dist-es/commands/PutAlternateContactCommand.js +22 -29
- package/dist-es/commands/PutContactInformationCommand.js +22 -29
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/AccountServiceException.js +5 -10
- package/dist-es/models/models_0.js +107 -67
- package/dist-es/protocols/Aws_restJson1.js +406 -551
- package/dist-es/runtimeConfig.browser.js +26 -12
- package/dist-es/runtimeConfig.js +30 -12
- package/dist-es/runtimeConfig.native.js +8 -5
- package/dist-es/runtimeConfig.shared.js +8 -11
- package/package.json +33 -33
|
@@ -1,532 +1,405 @@
|
|
|
1
|
-
import { __assign, __awaiter, __generator } from "tslib";
|
|
2
1
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
3
2
|
import { decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map as __map, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { AccountServiceException as __BaseException } from "../models/AccountServiceException";
|
|
5
4
|
import { AccessDeniedException, InternalServerException, ResourceNotFoundException, TooManyRequestsException, ValidationException, } from "../models/models_0";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/deleteAlternateContact";
|
|
17
|
-
body = JSON.stringify(__assign(__assign({}, (input.AccountId != null && { AccountId: input.AccountId })), (input.AlternateContactType != null && { AlternateContactType: input.AlternateContactType })));
|
|
18
|
-
return [2, new __HttpRequest({
|
|
19
|
-
protocol: protocol,
|
|
20
|
-
hostname: hostname,
|
|
21
|
-
port: port,
|
|
22
|
-
method: "POST",
|
|
23
|
-
headers: headers,
|
|
24
|
-
path: resolvedPath,
|
|
25
|
-
body: body,
|
|
26
|
-
})];
|
|
27
|
-
}
|
|
5
|
+
export const serializeAws_restJson1DeleteAlternateContactCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {
|
|
8
|
+
"content-type": "application/json",
|
|
9
|
+
};
|
|
10
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/deleteAlternateContact";
|
|
11
|
+
let body;
|
|
12
|
+
body = JSON.stringify({
|
|
13
|
+
...(input.AccountId != null && { AccountId: input.AccountId }),
|
|
14
|
+
...(input.AlternateContactType != null && { AlternateContactType: input.AlternateContactType }),
|
|
28
15
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
headers = {
|
|
38
|
-
"content-type": "application/json",
|
|
39
|
-
};
|
|
40
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/getAlternateContact";
|
|
41
|
-
body = JSON.stringify(__assign(__assign({}, (input.AccountId != null && { AccountId: input.AccountId })), (input.AlternateContactType != null && { AlternateContactType: input.AlternateContactType })));
|
|
42
|
-
return [2, new __HttpRequest({
|
|
43
|
-
protocol: protocol,
|
|
44
|
-
hostname: hostname,
|
|
45
|
-
port: port,
|
|
46
|
-
method: "POST",
|
|
47
|
-
headers: headers,
|
|
48
|
-
path: resolvedPath,
|
|
49
|
-
body: body,
|
|
50
|
-
})];
|
|
51
|
-
}
|
|
16
|
+
return new __HttpRequest({
|
|
17
|
+
protocol,
|
|
18
|
+
hostname,
|
|
19
|
+
port,
|
|
20
|
+
method: "POST",
|
|
21
|
+
headers,
|
|
22
|
+
path: resolvedPath,
|
|
23
|
+
body,
|
|
52
24
|
});
|
|
53
|
-
}
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/getContactInformation";
|
|
65
|
-
body = JSON.stringify(__assign({}, (input.AccountId != null && { AccountId: input.AccountId })));
|
|
66
|
-
return [2, new __HttpRequest({
|
|
67
|
-
protocol: protocol,
|
|
68
|
-
hostname: hostname,
|
|
69
|
-
port: port,
|
|
70
|
-
method: "POST",
|
|
71
|
-
headers: headers,
|
|
72
|
-
path: resolvedPath,
|
|
73
|
-
body: body,
|
|
74
|
-
})];
|
|
75
|
-
}
|
|
25
|
+
};
|
|
26
|
+
export const serializeAws_restJson1GetAlternateContactCommand = async (input, context) => {
|
|
27
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
28
|
+
const headers = {
|
|
29
|
+
"content-type": "application/json",
|
|
30
|
+
};
|
|
31
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getAlternateContact";
|
|
32
|
+
let body;
|
|
33
|
+
body = JSON.stringify({
|
|
34
|
+
...(input.AccountId != null && { AccountId: input.AccountId }),
|
|
35
|
+
...(input.AlternateContactType != null && { AlternateContactType: input.AlternateContactType }),
|
|
76
36
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
headers = {
|
|
86
|
-
"content-type": "application/json",
|
|
87
|
-
};
|
|
88
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/putAlternateContact";
|
|
89
|
-
body = JSON.stringify(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AccountId != null && { AccountId: input.AccountId })), (input.AlternateContactType != null && { AlternateContactType: input.AlternateContactType })), (input.EmailAddress != null && { EmailAddress: input.EmailAddress })), (input.Name != null && { Name: input.Name })), (input.PhoneNumber != null && { PhoneNumber: input.PhoneNumber })), (input.Title != null && { Title: input.Title })));
|
|
90
|
-
return [2, new __HttpRequest({
|
|
91
|
-
protocol: protocol,
|
|
92
|
-
hostname: hostname,
|
|
93
|
-
port: port,
|
|
94
|
-
method: "POST",
|
|
95
|
-
headers: headers,
|
|
96
|
-
path: resolvedPath,
|
|
97
|
-
body: body,
|
|
98
|
-
})];
|
|
99
|
-
}
|
|
37
|
+
return new __HttpRequest({
|
|
38
|
+
protocol,
|
|
39
|
+
hostname,
|
|
40
|
+
port,
|
|
41
|
+
method: "POST",
|
|
42
|
+
headers,
|
|
43
|
+
path: resolvedPath,
|
|
44
|
+
body,
|
|
100
45
|
});
|
|
101
|
-
}
|
|
102
|
-
export
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
};
|
|
112
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/putContactInformation";
|
|
113
|
-
body = JSON.stringify(__assign(__assign({}, (input.AccountId != null && { AccountId: input.AccountId })), (input.ContactInformation != null && {
|
|
114
|
-
ContactInformation: serializeAws_restJson1ContactInformation(input.ContactInformation, context),
|
|
115
|
-
})));
|
|
116
|
-
return [2, new __HttpRequest({
|
|
117
|
-
protocol: protocol,
|
|
118
|
-
hostname: hostname,
|
|
119
|
-
port: port,
|
|
120
|
-
method: "POST",
|
|
121
|
-
headers: headers,
|
|
122
|
-
path: resolvedPath,
|
|
123
|
-
body: body,
|
|
124
|
-
})];
|
|
125
|
-
}
|
|
46
|
+
};
|
|
47
|
+
export const serializeAws_restJson1GetContactInformationCommand = async (input, context) => {
|
|
48
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
49
|
+
const headers = {
|
|
50
|
+
"content-type": "application/json",
|
|
51
|
+
};
|
|
52
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/getContactInformation";
|
|
53
|
+
let body;
|
|
54
|
+
body = JSON.stringify({
|
|
55
|
+
...(input.AccountId != null && { AccountId: input.AccountId }),
|
|
126
56
|
});
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
136
|
-
contents = map({
|
|
137
|
-
$metadata: deserializeMetadata(output),
|
|
138
|
-
});
|
|
139
|
-
return [4, collectBody(output.body, context)];
|
|
140
|
-
case 1:
|
|
141
|
-
_a.sent();
|
|
142
|
-
return [2, contents];
|
|
143
|
-
}
|
|
57
|
+
return new __HttpRequest({
|
|
58
|
+
protocol,
|
|
59
|
+
hostname,
|
|
60
|
+
port,
|
|
61
|
+
method: "POST",
|
|
62
|
+
headers,
|
|
63
|
+
path: resolvedPath,
|
|
64
|
+
body,
|
|
144
65
|
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
case "AccessDeniedException": return [3, 2];
|
|
161
|
-
case "com.amazonaws.account#AccessDeniedException": return [3, 2];
|
|
162
|
-
case "InternalServerException": return [3, 4];
|
|
163
|
-
case "com.amazonaws.account#InternalServerException": return [3, 4];
|
|
164
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
165
|
-
case "com.amazonaws.account#ResourceNotFoundException": return [3, 6];
|
|
166
|
-
case "TooManyRequestsException": return [3, 8];
|
|
167
|
-
case "com.amazonaws.account#TooManyRequestsException": return [3, 8];
|
|
168
|
-
case "ValidationException": return [3, 10];
|
|
169
|
-
case "com.amazonaws.account#ValidationException": return [3, 10];
|
|
170
|
-
}
|
|
171
|
-
return [3, 12];
|
|
172
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
173
|
-
case 3: throw _d.sent();
|
|
174
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
175
|
-
case 5: throw _d.sent();
|
|
176
|
-
case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
177
|
-
case 7: throw _d.sent();
|
|
178
|
-
case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
179
|
-
case 9: throw _d.sent();
|
|
180
|
-
case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
181
|
-
case 11: throw _d.sent();
|
|
182
|
-
case 12:
|
|
183
|
-
parsedBody = parsedOutput.body;
|
|
184
|
-
throwDefaultError({
|
|
185
|
-
output: output,
|
|
186
|
-
parsedBody: parsedBody,
|
|
187
|
-
exceptionCtor: __BaseException,
|
|
188
|
-
errorCode: errorCode,
|
|
189
|
-
});
|
|
190
|
-
_d.label = 13;
|
|
191
|
-
case 13: return [2];
|
|
192
|
-
}
|
|
66
|
+
};
|
|
67
|
+
export const serializeAws_restJson1PutAlternateContactCommand = async (input, context) => {
|
|
68
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
69
|
+
const headers = {
|
|
70
|
+
"content-type": "application/json",
|
|
71
|
+
};
|
|
72
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/putAlternateContact";
|
|
73
|
+
let body;
|
|
74
|
+
body = JSON.stringify({
|
|
75
|
+
...(input.AccountId != null && { AccountId: input.AccountId }),
|
|
76
|
+
...(input.AlternateContactType != null && { AlternateContactType: input.AlternateContactType }),
|
|
77
|
+
...(input.EmailAddress != null && { EmailAddress: input.EmailAddress }),
|
|
78
|
+
...(input.Name != null && { Name: input.Name }),
|
|
79
|
+
...(input.PhoneNumber != null && { PhoneNumber: input.PhoneNumber }),
|
|
80
|
+
...(input.Title != null && { Title: input.Title }),
|
|
193
81
|
});
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
contents = map({
|
|
204
|
-
$metadata: deserializeMetadata(output),
|
|
205
|
-
});
|
|
206
|
-
_a = __expectNonNull;
|
|
207
|
-
_b = __expectObject;
|
|
208
|
-
return [4, parseBody(output.body, context)];
|
|
209
|
-
case 1:
|
|
210
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
211
|
-
if (data.AlternateContact != null) {
|
|
212
|
-
contents.AlternateContact = deserializeAws_restJson1AlternateContact(data.AlternateContact, context);
|
|
213
|
-
}
|
|
214
|
-
return [2, contents];
|
|
215
|
-
}
|
|
82
|
+
return new __HttpRequest({
|
|
83
|
+
protocol,
|
|
84
|
+
hostname,
|
|
85
|
+
port,
|
|
86
|
+
method: "POST",
|
|
87
|
+
headers,
|
|
88
|
+
path: resolvedPath,
|
|
89
|
+
body,
|
|
216
90
|
});
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
_b = errorCode;
|
|
231
|
-
switch (_b) {
|
|
232
|
-
case "AccessDeniedException": return [3, 2];
|
|
233
|
-
case "com.amazonaws.account#AccessDeniedException": return [3, 2];
|
|
234
|
-
case "InternalServerException": return [3, 4];
|
|
235
|
-
case "com.amazonaws.account#InternalServerException": return [3, 4];
|
|
236
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
237
|
-
case "com.amazonaws.account#ResourceNotFoundException": return [3, 6];
|
|
238
|
-
case "TooManyRequestsException": return [3, 8];
|
|
239
|
-
case "com.amazonaws.account#TooManyRequestsException": return [3, 8];
|
|
240
|
-
case "ValidationException": return [3, 10];
|
|
241
|
-
case "com.amazonaws.account#ValidationException": return [3, 10];
|
|
242
|
-
}
|
|
243
|
-
return [3, 12];
|
|
244
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
245
|
-
case 3: throw _d.sent();
|
|
246
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
247
|
-
case 5: throw _d.sent();
|
|
248
|
-
case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
249
|
-
case 7: throw _d.sent();
|
|
250
|
-
case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
251
|
-
case 9: throw _d.sent();
|
|
252
|
-
case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
253
|
-
case 11: throw _d.sent();
|
|
254
|
-
case 12:
|
|
255
|
-
parsedBody = parsedOutput.body;
|
|
256
|
-
throwDefaultError({
|
|
257
|
-
output: output,
|
|
258
|
-
parsedBody: parsedBody,
|
|
259
|
-
exceptionCtor: __BaseException,
|
|
260
|
-
errorCode: errorCode,
|
|
261
|
-
});
|
|
262
|
-
_d.label = 13;
|
|
263
|
-
case 13: return [2];
|
|
264
|
-
}
|
|
91
|
+
};
|
|
92
|
+
export const serializeAws_restJson1PutContactInformationCommand = async (input, context) => {
|
|
93
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
94
|
+
const headers = {
|
|
95
|
+
"content-type": "application/json",
|
|
96
|
+
};
|
|
97
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/putContactInformation";
|
|
98
|
+
let body;
|
|
99
|
+
body = JSON.stringify({
|
|
100
|
+
...(input.AccountId != null && { AccountId: input.AccountId }),
|
|
101
|
+
...(input.ContactInformation != null && {
|
|
102
|
+
ContactInformation: serializeAws_restJson1ContactInformation(input.ContactInformation, context),
|
|
103
|
+
}),
|
|
265
104
|
});
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
}
|
|
275
|
-
contents = map({
|
|
276
|
-
$metadata: deserializeMetadata(output),
|
|
277
|
-
});
|
|
278
|
-
_a = __expectNonNull;
|
|
279
|
-
_b = __expectObject;
|
|
280
|
-
return [4, parseBody(output.body, context)];
|
|
281
|
-
case 1:
|
|
282
|
-
data = _a.apply(void 0, [_b.apply(void 0, [_c.sent()]), "body"]);
|
|
283
|
-
if (data.ContactInformation != null) {
|
|
284
|
-
contents.ContactInformation = deserializeAws_restJson1ContactInformation(data.ContactInformation, context);
|
|
285
|
-
}
|
|
286
|
-
return [2, contents];
|
|
287
|
-
}
|
|
105
|
+
return new __HttpRequest({
|
|
106
|
+
protocol,
|
|
107
|
+
hostname,
|
|
108
|
+
port,
|
|
109
|
+
method: "POST",
|
|
110
|
+
headers,
|
|
111
|
+
path: resolvedPath,
|
|
112
|
+
body,
|
|
288
113
|
});
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
_a = [__assign({}, output)];
|
|
297
|
-
_c = {};
|
|
298
|
-
return [4, parseErrorBody(output.body, context)];
|
|
299
|
-
case 1:
|
|
300
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
301
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
302
|
-
_b = errorCode;
|
|
303
|
-
switch (_b) {
|
|
304
|
-
case "AccessDeniedException": return [3, 2];
|
|
305
|
-
case "com.amazonaws.account#AccessDeniedException": return [3, 2];
|
|
306
|
-
case "InternalServerException": return [3, 4];
|
|
307
|
-
case "com.amazonaws.account#InternalServerException": return [3, 4];
|
|
308
|
-
case "ResourceNotFoundException": return [3, 6];
|
|
309
|
-
case "com.amazonaws.account#ResourceNotFoundException": return [3, 6];
|
|
310
|
-
case "TooManyRequestsException": return [3, 8];
|
|
311
|
-
case "com.amazonaws.account#TooManyRequestsException": return [3, 8];
|
|
312
|
-
case "ValidationException": return [3, 10];
|
|
313
|
-
case "com.amazonaws.account#ValidationException": return [3, 10];
|
|
314
|
-
}
|
|
315
|
-
return [3, 12];
|
|
316
|
-
case 2: return [4, deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context)];
|
|
317
|
-
case 3: throw _d.sent();
|
|
318
|
-
case 4: return [4, deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context)];
|
|
319
|
-
case 5: throw _d.sent();
|
|
320
|
-
case 6: return [4, deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context)];
|
|
321
|
-
case 7: throw _d.sent();
|
|
322
|
-
case 8: return [4, deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context)];
|
|
323
|
-
case 9: throw _d.sent();
|
|
324
|
-
case 10: return [4, deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context)];
|
|
325
|
-
case 11: throw _d.sent();
|
|
326
|
-
case 12:
|
|
327
|
-
parsedBody = parsedOutput.body;
|
|
328
|
-
throwDefaultError({
|
|
329
|
-
output: output,
|
|
330
|
-
parsedBody: parsedBody,
|
|
331
|
-
exceptionCtor: __BaseException,
|
|
332
|
-
errorCode: errorCode,
|
|
333
|
-
});
|
|
334
|
-
_d.label = 13;
|
|
335
|
-
case 13: return [2];
|
|
336
|
-
}
|
|
114
|
+
};
|
|
115
|
+
export const deserializeAws_restJson1DeleteAlternateContactCommand = async (output, context) => {
|
|
116
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
117
|
+
return deserializeAws_restJson1DeleteAlternateContactCommandError(output, context);
|
|
118
|
+
}
|
|
119
|
+
const contents = map({
|
|
120
|
+
$metadata: deserializeMetadata(output),
|
|
337
121
|
});
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
122
|
+
await collectBody(output.body, context);
|
|
123
|
+
return contents;
|
|
124
|
+
};
|
|
125
|
+
const deserializeAws_restJson1DeleteAlternateContactCommandError = async (output, context) => {
|
|
126
|
+
const parsedOutput = {
|
|
127
|
+
...output,
|
|
128
|
+
body: await parseErrorBody(output.body, context),
|
|
129
|
+
};
|
|
130
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
131
|
+
switch (errorCode) {
|
|
132
|
+
case "AccessDeniedException":
|
|
133
|
+
case "com.amazonaws.account#AccessDeniedException":
|
|
134
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
135
|
+
case "InternalServerException":
|
|
136
|
+
case "com.amazonaws.account#InternalServerException":
|
|
137
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
138
|
+
case "ResourceNotFoundException":
|
|
139
|
+
case "com.amazonaws.account#ResourceNotFoundException":
|
|
140
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
141
|
+
case "TooManyRequestsException":
|
|
142
|
+
case "com.amazonaws.account#TooManyRequestsException":
|
|
143
|
+
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
144
|
+
case "ValidationException":
|
|
145
|
+
case "com.amazonaws.account#ValidationException":
|
|
146
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
147
|
+
default:
|
|
148
|
+
const parsedBody = parsedOutput.body;
|
|
149
|
+
throwDefaultError({
|
|
150
|
+
output,
|
|
151
|
+
parsedBody,
|
|
152
|
+
exceptionCtor: __BaseException,
|
|
153
|
+
errorCode,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
};
|
|
157
|
+
export const deserializeAws_restJson1GetAlternateContactCommand = async (output, context) => {
|
|
158
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
159
|
+
return deserializeAws_restJson1GetAlternateContactCommandError(output, context);
|
|
160
|
+
}
|
|
161
|
+
const contents = map({
|
|
162
|
+
$metadata: deserializeMetadata(output),
|
|
355
163
|
});
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
return
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
164
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
165
|
+
if (data.AlternateContact != null) {
|
|
166
|
+
contents.AlternateContact = deserializeAws_restJson1AlternateContact(data.AlternateContact, context);
|
|
167
|
+
}
|
|
168
|
+
return contents;
|
|
169
|
+
};
|
|
170
|
+
const deserializeAws_restJson1GetAlternateContactCommandError = async (output, context) => {
|
|
171
|
+
const parsedOutput = {
|
|
172
|
+
...output,
|
|
173
|
+
body: await parseErrorBody(output.body, context),
|
|
174
|
+
};
|
|
175
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
176
|
+
switch (errorCode) {
|
|
177
|
+
case "AccessDeniedException":
|
|
178
|
+
case "com.amazonaws.account#AccessDeniedException":
|
|
179
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
180
|
+
case "InternalServerException":
|
|
181
|
+
case "com.amazonaws.account#InternalServerException":
|
|
182
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
183
|
+
case "ResourceNotFoundException":
|
|
184
|
+
case "com.amazonaws.account#ResourceNotFoundException":
|
|
185
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
186
|
+
case "TooManyRequestsException":
|
|
187
|
+
case "com.amazonaws.account#TooManyRequestsException":
|
|
188
|
+
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
189
|
+
case "ValidationException":
|
|
190
|
+
case "com.amazonaws.account#ValidationException":
|
|
191
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
192
|
+
default:
|
|
193
|
+
const parsedBody = parsedOutput.body;
|
|
194
|
+
throwDefaultError({
|
|
195
|
+
output,
|
|
196
|
+
parsedBody,
|
|
197
|
+
exceptionCtor: __BaseException,
|
|
198
|
+
errorCode,
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
export const deserializeAws_restJson1GetContactInformationCommand = async (output, context) => {
|
|
203
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
204
|
+
return deserializeAws_restJson1GetContactInformationCommandError(output, context);
|
|
205
|
+
}
|
|
206
|
+
const contents = map({
|
|
207
|
+
$metadata: deserializeMetadata(output),
|
|
400
208
|
});
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
209
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
210
|
+
if (data.ContactInformation != null) {
|
|
211
|
+
contents.ContactInformation = deserializeAws_restJson1ContactInformation(data.ContactInformation, context);
|
|
212
|
+
}
|
|
213
|
+
return contents;
|
|
214
|
+
};
|
|
215
|
+
const deserializeAws_restJson1GetContactInformationCommandError = async (output, context) => {
|
|
216
|
+
const parsedOutput = {
|
|
217
|
+
...output,
|
|
218
|
+
body: await parseErrorBody(output.body, context),
|
|
219
|
+
};
|
|
220
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
221
|
+
switch (errorCode) {
|
|
222
|
+
case "AccessDeniedException":
|
|
223
|
+
case "com.amazonaws.account#AccessDeniedException":
|
|
224
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
225
|
+
case "InternalServerException":
|
|
226
|
+
case "com.amazonaws.account#InternalServerException":
|
|
227
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
228
|
+
case "ResourceNotFoundException":
|
|
229
|
+
case "com.amazonaws.account#ResourceNotFoundException":
|
|
230
|
+
throw await deserializeAws_restJson1ResourceNotFoundExceptionResponse(parsedOutput, context);
|
|
231
|
+
case "TooManyRequestsException":
|
|
232
|
+
case "com.amazonaws.account#TooManyRequestsException":
|
|
233
|
+
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
234
|
+
case "ValidationException":
|
|
235
|
+
case "com.amazonaws.account#ValidationException":
|
|
236
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
237
|
+
default:
|
|
238
|
+
const parsedBody = parsedOutput.body;
|
|
239
|
+
throwDefaultError({
|
|
240
|
+
output,
|
|
241
|
+
parsedBody,
|
|
242
|
+
exceptionCtor: __BaseException,
|
|
243
|
+
errorCode,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
};
|
|
247
|
+
export const deserializeAws_restJson1PutAlternateContactCommand = async (output, context) => {
|
|
248
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
249
|
+
return deserializeAws_restJson1PutAlternateContactCommandError(output, context);
|
|
250
|
+
}
|
|
251
|
+
const contents = map({
|
|
252
|
+
$metadata: deserializeMetadata(output),
|
|
418
253
|
});
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
exceptionCtor: __BaseException,
|
|
458
|
-
errorCode: errorCode,
|
|
459
|
-
});
|
|
460
|
-
_d.label = 11;
|
|
461
|
-
case 11: return [2];
|
|
462
|
-
}
|
|
254
|
+
await collectBody(output.body, context);
|
|
255
|
+
return contents;
|
|
256
|
+
};
|
|
257
|
+
const deserializeAws_restJson1PutAlternateContactCommandError = async (output, context) => {
|
|
258
|
+
const parsedOutput = {
|
|
259
|
+
...output,
|
|
260
|
+
body: await parseErrorBody(output.body, context),
|
|
261
|
+
};
|
|
262
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
263
|
+
switch (errorCode) {
|
|
264
|
+
case "AccessDeniedException":
|
|
265
|
+
case "com.amazonaws.account#AccessDeniedException":
|
|
266
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
267
|
+
case "InternalServerException":
|
|
268
|
+
case "com.amazonaws.account#InternalServerException":
|
|
269
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
270
|
+
case "TooManyRequestsException":
|
|
271
|
+
case "com.amazonaws.account#TooManyRequestsException":
|
|
272
|
+
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
273
|
+
case "ValidationException":
|
|
274
|
+
case "com.amazonaws.account#ValidationException":
|
|
275
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
276
|
+
default:
|
|
277
|
+
const parsedBody = parsedOutput.body;
|
|
278
|
+
throwDefaultError({
|
|
279
|
+
output,
|
|
280
|
+
parsedBody,
|
|
281
|
+
exceptionCtor: __BaseException,
|
|
282
|
+
errorCode,
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
export const deserializeAws_restJson1PutContactInformationCommand = async (output, context) => {
|
|
287
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
288
|
+
return deserializeAws_restJson1PutContactInformationCommandError(output, context);
|
|
289
|
+
}
|
|
290
|
+
const contents = map({
|
|
291
|
+
$metadata: deserializeMetadata(output),
|
|
463
292
|
});
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
293
|
+
await collectBody(output.body, context);
|
|
294
|
+
return contents;
|
|
295
|
+
};
|
|
296
|
+
const deserializeAws_restJson1PutContactInformationCommandError = async (output, context) => {
|
|
297
|
+
const parsedOutput = {
|
|
298
|
+
...output,
|
|
299
|
+
body: await parseErrorBody(output.body, context),
|
|
300
|
+
};
|
|
301
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
302
|
+
switch (errorCode) {
|
|
303
|
+
case "AccessDeniedException":
|
|
304
|
+
case "com.amazonaws.account#AccessDeniedException":
|
|
305
|
+
throw await deserializeAws_restJson1AccessDeniedExceptionResponse(parsedOutput, context);
|
|
306
|
+
case "InternalServerException":
|
|
307
|
+
case "com.amazonaws.account#InternalServerException":
|
|
308
|
+
throw await deserializeAws_restJson1InternalServerExceptionResponse(parsedOutput, context);
|
|
309
|
+
case "TooManyRequestsException":
|
|
310
|
+
case "com.amazonaws.account#TooManyRequestsException":
|
|
311
|
+
throw await deserializeAws_restJson1TooManyRequestsExceptionResponse(parsedOutput, context);
|
|
312
|
+
case "ValidationException":
|
|
313
|
+
case "com.amazonaws.account#ValidationException":
|
|
314
|
+
throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
|
|
315
|
+
default:
|
|
316
|
+
const parsedBody = parsedOutput.body;
|
|
317
|
+
throwDefaultError({
|
|
318
|
+
output,
|
|
319
|
+
parsedBody,
|
|
320
|
+
exceptionCtor: __BaseException,
|
|
321
|
+
errorCode,
|
|
322
|
+
});
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
const map = __map;
|
|
326
|
+
const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
|
|
327
|
+
const contents = map({});
|
|
328
|
+
const data = parsedOutput.body;
|
|
329
|
+
if (data.message != null) {
|
|
330
|
+
contents.message = __expectString(data.message);
|
|
331
|
+
}
|
|
332
|
+
const exception = new AccessDeniedException({
|
|
333
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
334
|
+
...contents,
|
|
476
335
|
});
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
336
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
337
|
+
};
|
|
338
|
+
const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
|
|
339
|
+
const contents = map({});
|
|
340
|
+
const data = parsedOutput.body;
|
|
341
|
+
if (data.message != null) {
|
|
342
|
+
contents.message = __expectString(data.message);
|
|
343
|
+
}
|
|
344
|
+
const exception = new InternalServerException({
|
|
345
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
346
|
+
...contents,
|
|
488
347
|
});
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
348
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
349
|
+
};
|
|
350
|
+
const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
|
|
351
|
+
const contents = map({});
|
|
352
|
+
const data = parsedOutput.body;
|
|
353
|
+
if (data.message != null) {
|
|
354
|
+
contents.message = __expectString(data.message);
|
|
355
|
+
}
|
|
356
|
+
const exception = new ResourceNotFoundException({
|
|
357
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
358
|
+
...contents,
|
|
500
359
|
});
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
360
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
361
|
+
};
|
|
362
|
+
const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
|
|
363
|
+
const contents = map({});
|
|
364
|
+
const data = parsedOutput.body;
|
|
365
|
+
if (data.message != null) {
|
|
366
|
+
contents.message = __expectString(data.message);
|
|
367
|
+
}
|
|
368
|
+
const exception = new TooManyRequestsException({
|
|
369
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
370
|
+
...contents,
|
|
512
371
|
});
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
372
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
373
|
+
};
|
|
374
|
+
const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
|
|
375
|
+
const contents = map({});
|
|
376
|
+
const data = parsedOutput.body;
|
|
377
|
+
if (data.message != null) {
|
|
378
|
+
contents.message = __expectString(data.message);
|
|
379
|
+
}
|
|
380
|
+
const exception = new ValidationException({
|
|
381
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
382
|
+
...contents,
|
|
524
383
|
});
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
384
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
385
|
+
};
|
|
386
|
+
const serializeAws_restJson1ContactInformation = (input, context) => {
|
|
387
|
+
return {
|
|
388
|
+
...(input.AddressLine1 != null && { AddressLine1: input.AddressLine1 }),
|
|
389
|
+
...(input.AddressLine2 != null && { AddressLine2: input.AddressLine2 }),
|
|
390
|
+
...(input.AddressLine3 != null && { AddressLine3: input.AddressLine3 }),
|
|
391
|
+
...(input.City != null && { City: input.City }),
|
|
392
|
+
...(input.CompanyName != null && { CompanyName: input.CompanyName }),
|
|
393
|
+
...(input.CountryCode != null && { CountryCode: input.CountryCode }),
|
|
394
|
+
...(input.DistrictOrCounty != null && { DistrictOrCounty: input.DistrictOrCounty }),
|
|
395
|
+
...(input.FullName != null && { FullName: input.FullName }),
|
|
396
|
+
...(input.PhoneNumber != null && { PhoneNumber: input.PhoneNumber }),
|
|
397
|
+
...(input.PostalCode != null && { PostalCode: input.PostalCode }),
|
|
398
|
+
...(input.StateOrRegion != null && { StateOrRegion: input.StateOrRegion }),
|
|
399
|
+
...(input.WebsiteUrl != null && { WebsiteUrl: input.WebsiteUrl }),
|
|
400
|
+
};
|
|
528
401
|
};
|
|
529
|
-
|
|
402
|
+
const deserializeAws_restJson1AlternateContact = (output, context) => {
|
|
530
403
|
return {
|
|
531
404
|
AlternateContactType: __expectString(output.AlternateContactType),
|
|
532
405
|
EmailAddress: __expectString(output.EmailAddress),
|
|
@@ -535,7 +408,7 @@ var deserializeAws_restJson1AlternateContact = function (output, context) {
|
|
|
535
408
|
Title: __expectString(output.Title),
|
|
536
409
|
};
|
|
537
410
|
};
|
|
538
|
-
|
|
411
|
+
const deserializeAws_restJson1ContactInformation = (output, context) => {
|
|
539
412
|
return {
|
|
540
413
|
AddressLine1: __expectString(output.AddressLine1),
|
|
541
414
|
AddressLine2: __expectString(output.AddressLine2),
|
|
@@ -551,57 +424,39 @@ var deserializeAws_restJson1ContactInformation = function (output, context) {
|
|
|
551
424
|
WebsiteUrl: __expectString(output.WebsiteUrl),
|
|
552
425
|
};
|
|
553
426
|
};
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
});
|
|
562
|
-
};
|
|
563
|
-
var collectBody = function (streamBody, context) {
|
|
564
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
427
|
+
const deserializeMetadata = (output) => ({
|
|
428
|
+
httpStatusCode: output.statusCode,
|
|
429
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
430
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
431
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
432
|
+
});
|
|
433
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
565
434
|
if (streamBody instanceof Uint8Array) {
|
|
566
435
|
return Promise.resolve(streamBody);
|
|
567
436
|
}
|
|
568
437
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
569
438
|
};
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
}
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
});
|
|
439
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
440
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
441
|
+
value !== null &&
|
|
442
|
+
value !== "" &&
|
|
443
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
444
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
445
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
446
|
+
if (encoded.length) {
|
|
447
|
+
return JSON.parse(encoded);
|
|
448
|
+
}
|
|
449
|
+
return {};
|
|
450
|
+
});
|
|
451
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
452
|
+
const value = await parseBody(errorBody, context);
|
|
453
|
+
value.message = value.message ?? value.Message;
|
|
454
|
+
return value;
|
|
587
455
|
};
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
switch (_b.label) {
|
|
593
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
594
|
-
case 1:
|
|
595
|
-
value = _b.sent();
|
|
596
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
597
|
-
return [2, value];
|
|
598
|
-
}
|
|
599
|
-
});
|
|
600
|
-
}); };
|
|
601
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
602
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
603
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
604
|
-
var cleanValue = rawValue;
|
|
456
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
457
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
458
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
459
|
+
let cleanValue = rawValue;
|
|
605
460
|
if (typeof cleanValue === "number") {
|
|
606
461
|
cleanValue = cleanValue.toString();
|
|
607
462
|
}
|
|
@@ -616,7 +471,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
616
471
|
}
|
|
617
472
|
return cleanValue;
|
|
618
473
|
};
|
|
619
|
-
|
|
474
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
620
475
|
if (headerKey !== undefined) {
|
|
621
476
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
622
477
|
}
|