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