@aws-sdk/client-apigatewaymanagementapi 3.181.0 → 3.183.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 +8 -0
- package/dist-es/ApiGatewayManagementApi.js +14 -21
- package/dist-es/ApiGatewayManagementApiClient.js +22 -28
- package/dist-es/commands/DeleteConnectionCommand.js +22 -29
- package/dist-es/commands/GetConnectionCommand.js +21 -28
- package/dist-es/commands/PostToConnectionCommand.js +22 -29
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/ApiGatewayManagementApiServiceException.js +5 -10
- package/dist-es/models/models_0.js +60 -51
- package/dist-es/protocols/Aws_restJson1.js +232 -341
- 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,368 +1,259 @@
|
|
|
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, parseRfc3339DateTime as __parseRfc3339DateTime, resolvedPath as __resolvedPath, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
4
3
|
import { ApiGatewayManagementApiServiceException as __BaseException } from "../models/ApiGatewayManagementApiServiceException";
|
|
5
4
|
import { ForbiddenException, GoneException, LimitExceededException, PayloadTooLargeException, } from "../models/models_0";
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
method: "DELETE",
|
|
21
|
-
headers: headers,
|
|
22
|
-
path: resolvedPath,
|
|
23
|
-
body: body,
|
|
24
|
-
})];
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
}); };
|
|
28
|
-
export var serializeAws_restJson1GetConnectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
29
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
30
|
-
return __generator(this, function (_c) {
|
|
31
|
-
switch (_c.label) {
|
|
32
|
-
case 0: return [4, context.endpoint()];
|
|
33
|
-
case 1:
|
|
34
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
35
|
-
headers = {};
|
|
36
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/@connections/{ConnectionId}";
|
|
37
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "ConnectionId", function () { return input.ConnectionId; }, "{ConnectionId}", false);
|
|
38
|
-
return [2, new __HttpRequest({
|
|
39
|
-
protocol: protocol,
|
|
40
|
-
hostname: hostname,
|
|
41
|
-
port: port,
|
|
42
|
-
method: "GET",
|
|
43
|
-
headers: headers,
|
|
44
|
-
path: resolvedPath,
|
|
45
|
-
body: body,
|
|
46
|
-
})];
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
}); };
|
|
50
|
-
export var serializeAws_restJson1PostToConnectionCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
51
|
-
var _a, hostname, _b, protocol, port, basePath, headers, resolvedPath, body;
|
|
52
|
-
return __generator(this, function (_c) {
|
|
53
|
-
switch (_c.label) {
|
|
54
|
-
case 0: return [4, context.endpoint()];
|
|
55
|
-
case 1:
|
|
56
|
-
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
57
|
-
headers = {
|
|
58
|
-
"content-type": "application/octet-stream",
|
|
59
|
-
};
|
|
60
|
-
resolvedPath = "".concat((basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || "") + "/@connections/{ConnectionId}";
|
|
61
|
-
resolvedPath = __resolvedPath(resolvedPath, input, "ConnectionId", function () { return input.ConnectionId; }, "{ConnectionId}", false);
|
|
62
|
-
if (input.Data !== undefined) {
|
|
63
|
-
body = input.Data;
|
|
64
|
-
}
|
|
65
|
-
return [2, new __HttpRequest({
|
|
66
|
-
protocol: protocol,
|
|
67
|
-
hostname: hostname,
|
|
68
|
-
port: port,
|
|
69
|
-
method: "POST",
|
|
70
|
-
headers: headers,
|
|
71
|
-
path: resolvedPath,
|
|
72
|
-
body: body,
|
|
73
|
-
})];
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}); };
|
|
77
|
-
export var deserializeAws_restJson1DeleteConnectionCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
78
|
-
var contents;
|
|
79
|
-
return __generator(this, function (_a) {
|
|
80
|
-
switch (_a.label) {
|
|
81
|
-
case 0:
|
|
82
|
-
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
83
|
-
return [2, deserializeAws_restJson1DeleteConnectionCommandError(output, context)];
|
|
84
|
-
}
|
|
85
|
-
contents = map({
|
|
86
|
-
$metadata: deserializeMetadata(output),
|
|
87
|
-
});
|
|
88
|
-
return [4, collectBody(output.body, context)];
|
|
89
|
-
case 1:
|
|
90
|
-
_a.sent();
|
|
91
|
-
return [2, contents];
|
|
92
|
-
}
|
|
5
|
+
export const serializeAws_restJson1DeleteConnectionCommand = async (input, context) => {
|
|
6
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
7
|
+
const headers = {};
|
|
8
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/@connections/{ConnectionId}";
|
|
9
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
|
|
10
|
+
let body;
|
|
11
|
+
return new __HttpRequest({
|
|
12
|
+
protocol,
|
|
13
|
+
hostname,
|
|
14
|
+
port,
|
|
15
|
+
method: "DELETE",
|
|
16
|
+
headers,
|
|
17
|
+
path: resolvedPath,
|
|
18
|
+
body,
|
|
93
19
|
});
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
case "ForbiddenException": return [3, 2];
|
|
110
|
-
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException": return [3, 2];
|
|
111
|
-
case "GoneException": return [3, 4];
|
|
112
|
-
case "com.amazonaws.apigatewaymanagementapi#GoneException": return [3, 4];
|
|
113
|
-
case "LimitExceededException": return [3, 6];
|
|
114
|
-
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException": return [3, 6];
|
|
115
|
-
}
|
|
116
|
-
return [3, 8];
|
|
117
|
-
case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
|
|
118
|
-
case 3: throw _d.sent();
|
|
119
|
-
case 4: return [4, deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context)];
|
|
120
|
-
case 5: throw _d.sent();
|
|
121
|
-
case 6: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
122
|
-
case 7: throw _d.sent();
|
|
123
|
-
case 8:
|
|
124
|
-
parsedBody = parsedOutput.body;
|
|
125
|
-
throwDefaultError({
|
|
126
|
-
output: output,
|
|
127
|
-
parsedBody: parsedBody,
|
|
128
|
-
exceptionCtor: __BaseException,
|
|
129
|
-
errorCode: errorCode,
|
|
130
|
-
});
|
|
131
|
-
_d.label = 9;
|
|
132
|
-
case 9: return [2];
|
|
133
|
-
}
|
|
20
|
+
};
|
|
21
|
+
export const serializeAws_restJson1GetConnectionCommand = async (input, context) => {
|
|
22
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
23
|
+
const headers = {};
|
|
24
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/@connections/{ConnectionId}";
|
|
25
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
|
|
26
|
+
let body;
|
|
27
|
+
return new __HttpRequest({
|
|
28
|
+
protocol,
|
|
29
|
+
hostname,
|
|
30
|
+
port,
|
|
31
|
+
method: "GET",
|
|
32
|
+
headers,
|
|
33
|
+
path: resolvedPath,
|
|
34
|
+
body,
|
|
134
35
|
});
|
|
135
|
-
}
|
|
136
|
-
export
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if (data.identity != null) {
|
|
156
|
-
contents.Identity = deserializeAws_restJson1Identity(data.identity, context);
|
|
157
|
-
}
|
|
158
|
-
if (data.lastActiveAt != null) {
|
|
159
|
-
contents.LastActiveAt = __expectNonNull(__parseRfc3339DateTime(data.lastActiveAt));
|
|
160
|
-
}
|
|
161
|
-
return [2, contents];
|
|
162
|
-
}
|
|
36
|
+
};
|
|
37
|
+
export const serializeAws_restJson1PostToConnectionCommand = async (input, context) => {
|
|
38
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
39
|
+
const headers = {
|
|
40
|
+
"content-type": "application/octet-stream",
|
|
41
|
+
};
|
|
42
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/@connections/{ConnectionId}";
|
|
43
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "ConnectionId", () => input.ConnectionId, "{ConnectionId}", false);
|
|
44
|
+
let body;
|
|
45
|
+
if (input.Data !== undefined) {
|
|
46
|
+
body = input.Data;
|
|
47
|
+
}
|
|
48
|
+
return new __HttpRequest({
|
|
49
|
+
protocol,
|
|
50
|
+
hostname,
|
|
51
|
+
port,
|
|
52
|
+
method: "POST",
|
|
53
|
+
headers,
|
|
54
|
+
path: resolvedPath,
|
|
55
|
+
body,
|
|
163
56
|
});
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
_a = [__assign({}, output)];
|
|
172
|
-
_c = {};
|
|
173
|
-
return [4, parseErrorBody(output.body, context)];
|
|
174
|
-
case 1:
|
|
175
|
-
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
176
|
-
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
177
|
-
_b = errorCode;
|
|
178
|
-
switch (_b) {
|
|
179
|
-
case "ForbiddenException": return [3, 2];
|
|
180
|
-
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException": return [3, 2];
|
|
181
|
-
case "GoneException": return [3, 4];
|
|
182
|
-
case "com.amazonaws.apigatewaymanagementapi#GoneException": return [3, 4];
|
|
183
|
-
case "LimitExceededException": return [3, 6];
|
|
184
|
-
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException": return [3, 6];
|
|
185
|
-
}
|
|
186
|
-
return [3, 8];
|
|
187
|
-
case 2: return [4, deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context)];
|
|
188
|
-
case 3: throw _d.sent();
|
|
189
|
-
case 4: return [4, deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context)];
|
|
190
|
-
case 5: throw _d.sent();
|
|
191
|
-
case 6: return [4, deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context)];
|
|
192
|
-
case 7: throw _d.sent();
|
|
193
|
-
case 8:
|
|
194
|
-
parsedBody = parsedOutput.body;
|
|
195
|
-
throwDefaultError({
|
|
196
|
-
output: output,
|
|
197
|
-
parsedBody: parsedBody,
|
|
198
|
-
exceptionCtor: __BaseException,
|
|
199
|
-
errorCode: errorCode,
|
|
200
|
-
});
|
|
201
|
-
_d.label = 9;
|
|
202
|
-
case 9: return [2];
|
|
203
|
-
}
|
|
57
|
+
};
|
|
58
|
+
export const deserializeAws_restJson1DeleteConnectionCommand = async (output, context) => {
|
|
59
|
+
if (output.statusCode !== 204 && output.statusCode >= 300) {
|
|
60
|
+
return deserializeAws_restJson1DeleteConnectionCommandError(output, context);
|
|
61
|
+
}
|
|
62
|
+
const contents = map({
|
|
63
|
+
$metadata: deserializeMetadata(output),
|
|
204
64
|
});
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
65
|
+
await collectBody(output.body, context);
|
|
66
|
+
return contents;
|
|
67
|
+
};
|
|
68
|
+
const deserializeAws_restJson1DeleteConnectionCommandError = async (output, context) => {
|
|
69
|
+
const parsedOutput = {
|
|
70
|
+
...output,
|
|
71
|
+
body: await parseErrorBody(output.body, context),
|
|
72
|
+
};
|
|
73
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
74
|
+
switch (errorCode) {
|
|
75
|
+
case "ForbiddenException":
|
|
76
|
+
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
|
|
77
|
+
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
|
|
78
|
+
case "GoneException":
|
|
79
|
+
case "com.amazonaws.apigatewaymanagementapi#GoneException":
|
|
80
|
+
throw await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context);
|
|
81
|
+
case "LimitExceededException":
|
|
82
|
+
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
|
|
83
|
+
throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
|
|
84
|
+
default:
|
|
85
|
+
const parsedBody = parsedOutput.body;
|
|
86
|
+
throwDefaultError({
|
|
87
|
+
output,
|
|
88
|
+
parsedBody,
|
|
89
|
+
exceptionCtor: __BaseException,
|
|
90
|
+
errorCode,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
export const deserializeAws_restJson1GetConnectionCommand = async (output, context) => {
|
|
95
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
96
|
+
return deserializeAws_restJson1GetConnectionCommandError(output, context);
|
|
97
|
+
}
|
|
98
|
+
const contents = map({
|
|
99
|
+
$metadata: deserializeMetadata(output),
|
|
222
100
|
});
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
101
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
102
|
+
if (data.connectedAt != null) {
|
|
103
|
+
contents.ConnectedAt = __expectNonNull(__parseRfc3339DateTime(data.connectedAt));
|
|
104
|
+
}
|
|
105
|
+
if (data.identity != null) {
|
|
106
|
+
contents.Identity = deserializeAws_restJson1Identity(data.identity, context);
|
|
107
|
+
}
|
|
108
|
+
if (data.lastActiveAt != null) {
|
|
109
|
+
contents.LastActiveAt = __expectNonNull(__parseRfc3339DateTime(data.lastActiveAt));
|
|
110
|
+
}
|
|
111
|
+
return contents;
|
|
112
|
+
};
|
|
113
|
+
const deserializeAws_restJson1GetConnectionCommandError = async (output, context) => {
|
|
114
|
+
const parsedOutput = {
|
|
115
|
+
...output,
|
|
116
|
+
body: await parseErrorBody(output.body, context),
|
|
117
|
+
};
|
|
118
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
119
|
+
switch (errorCode) {
|
|
120
|
+
case "ForbiddenException":
|
|
121
|
+
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
|
|
122
|
+
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
|
|
123
|
+
case "GoneException":
|
|
124
|
+
case "com.amazonaws.apigatewaymanagementapi#GoneException":
|
|
125
|
+
throw await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context);
|
|
126
|
+
case "LimitExceededException":
|
|
127
|
+
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
|
|
128
|
+
throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
|
|
129
|
+
default:
|
|
130
|
+
const parsedBody = parsedOutput.body;
|
|
131
|
+
throwDefaultError({
|
|
132
|
+
output,
|
|
133
|
+
parsedBody,
|
|
134
|
+
exceptionCtor: __BaseException,
|
|
135
|
+
errorCode,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
export const deserializeAws_restJson1PostToConnectionCommand = async (output, context) => {
|
|
140
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
141
|
+
return deserializeAws_restJson1PostToConnectionCommandError(output, context);
|
|
142
|
+
}
|
|
143
|
+
const contents = map({
|
|
144
|
+
$metadata: deserializeMetadata(output),
|
|
267
145
|
});
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
146
|
+
await collectBody(output.body, context);
|
|
147
|
+
return contents;
|
|
148
|
+
};
|
|
149
|
+
const deserializeAws_restJson1PostToConnectionCommandError = async (output, context) => {
|
|
150
|
+
const parsedOutput = {
|
|
151
|
+
...output,
|
|
152
|
+
body: await parseErrorBody(output.body, context),
|
|
153
|
+
};
|
|
154
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
155
|
+
switch (errorCode) {
|
|
156
|
+
case "ForbiddenException":
|
|
157
|
+
case "com.amazonaws.apigatewaymanagementapi#ForbiddenException":
|
|
158
|
+
throw await deserializeAws_restJson1ForbiddenExceptionResponse(parsedOutput, context);
|
|
159
|
+
case "GoneException":
|
|
160
|
+
case "com.amazonaws.apigatewaymanagementapi#GoneException":
|
|
161
|
+
throw await deserializeAws_restJson1GoneExceptionResponse(parsedOutput, context);
|
|
162
|
+
case "LimitExceededException":
|
|
163
|
+
case "com.amazonaws.apigatewaymanagementapi#LimitExceededException":
|
|
164
|
+
throw await deserializeAws_restJson1LimitExceededExceptionResponse(parsedOutput, context);
|
|
165
|
+
case "PayloadTooLargeException":
|
|
166
|
+
case "com.amazonaws.apigatewaymanagementapi#PayloadTooLargeException":
|
|
167
|
+
throw await deserializeAws_restJson1PayloadTooLargeExceptionResponse(parsedOutput, context);
|
|
168
|
+
default:
|
|
169
|
+
const parsedBody = parsedOutput.body;
|
|
170
|
+
throwDefaultError({
|
|
171
|
+
output,
|
|
172
|
+
parsedBody,
|
|
173
|
+
exceptionCtor: __BaseException,
|
|
174
|
+
errorCode,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
const map = __map;
|
|
179
|
+
const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
|
|
180
|
+
const contents = map({});
|
|
181
|
+
const data = parsedOutput.body;
|
|
182
|
+
const exception = new ForbiddenException({
|
|
183
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
184
|
+
...contents,
|
|
277
185
|
});
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
186
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
187
|
+
};
|
|
188
|
+
const deserializeAws_restJson1GoneExceptionResponse = async (parsedOutput, context) => {
|
|
189
|
+
const contents = map({});
|
|
190
|
+
const data = parsedOutput.body;
|
|
191
|
+
const exception = new GoneException({
|
|
192
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
193
|
+
...contents,
|
|
286
194
|
});
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
195
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
196
|
+
};
|
|
197
|
+
const deserializeAws_restJson1LimitExceededExceptionResponse = async (parsedOutput, context) => {
|
|
198
|
+
const contents = map({});
|
|
199
|
+
const data = parsedOutput.body;
|
|
200
|
+
const exception = new LimitExceededException({
|
|
201
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
202
|
+
...contents,
|
|
295
203
|
});
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
204
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
205
|
+
};
|
|
206
|
+
const deserializeAws_restJson1PayloadTooLargeExceptionResponse = async (parsedOutput, context) => {
|
|
207
|
+
const contents = map({});
|
|
208
|
+
const data = parsedOutput.body;
|
|
209
|
+
if (data.message != null) {
|
|
210
|
+
contents.Message = __expectString(data.message);
|
|
211
|
+
}
|
|
212
|
+
const exception = new PayloadTooLargeException({
|
|
213
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
214
|
+
...contents,
|
|
307
215
|
});
|
|
308
|
-
|
|
309
|
-
|
|
216
|
+
return __decorateServiceException(exception, parsedOutput.body);
|
|
217
|
+
};
|
|
218
|
+
const deserializeAws_restJson1Identity = (output, context) => {
|
|
310
219
|
return {
|
|
311
220
|
SourceIp: __expectString(output.sourceIp),
|
|
312
221
|
UserAgent: __expectString(output.userAgent),
|
|
313
222
|
};
|
|
314
223
|
};
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
});
|
|
323
|
-
};
|
|
324
|
-
var collectBody = function (streamBody, context) {
|
|
325
|
-
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
224
|
+
const deserializeMetadata = (output) => ({
|
|
225
|
+
httpStatusCode: output.statusCode,
|
|
226
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"],
|
|
227
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
228
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
229
|
+
});
|
|
230
|
+
const collectBody = (streamBody = new Uint8Array(), context) => {
|
|
326
231
|
if (streamBody instanceof Uint8Array) {
|
|
327
232
|
return Promise.resolve(streamBody);
|
|
328
233
|
}
|
|
329
234
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
330
235
|
};
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
});
|
|
236
|
+
const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
237
|
+
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
238
|
+
value !== null &&
|
|
239
|
+
value !== "" &&
|
|
240
|
+
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
241
|
+
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
242
|
+
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
243
|
+
if (encoded.length) {
|
|
244
|
+
return JSON.parse(encoded);
|
|
245
|
+
}
|
|
246
|
+
return {};
|
|
247
|
+
});
|
|
248
|
+
const parseErrorBody = async (errorBody, context) => {
|
|
249
|
+
const value = await parseBody(errorBody, context);
|
|
250
|
+
value.message = value.message ?? value.Message;
|
|
251
|
+
return value;
|
|
348
252
|
};
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
switch (_b.label) {
|
|
354
|
-
case 0: return [4, parseBody(errorBody, context)];
|
|
355
|
-
case 1:
|
|
356
|
-
value = _b.sent();
|
|
357
|
-
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
358
|
-
return [2, value];
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
}); };
|
|
362
|
-
var loadRestJsonErrorCode = function (output, data) {
|
|
363
|
-
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
364
|
-
var sanitizeErrorCode = function (rawValue) {
|
|
365
|
-
var cleanValue = rawValue;
|
|
253
|
+
const loadRestJsonErrorCode = (output, data) => {
|
|
254
|
+
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
255
|
+
const sanitizeErrorCode = (rawValue) => {
|
|
256
|
+
let cleanValue = rawValue;
|
|
366
257
|
if (typeof cleanValue === "number") {
|
|
367
258
|
cleanValue = cleanValue.toString();
|
|
368
259
|
}
|
|
@@ -377,7 +268,7 @@ var loadRestJsonErrorCode = function (output, data) {
|
|
|
377
268
|
}
|
|
378
269
|
return cleanValue;
|
|
379
270
|
};
|
|
380
|
-
|
|
271
|
+
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
381
272
|
if (headerKey !== undefined) {
|
|
382
273
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
383
274
|
}
|