@aws-sdk/client-kafkaconnect 3.489.0 → 3.495.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/dist-cjs/KafkaConnect.js +1 -35
- package/dist-cjs/KafkaConnectClient.js +1 -43
- package/dist-cjs/commands/CreateConnectorCommand.js +1 -29
- package/dist-cjs/commands/CreateCustomPluginCommand.js +1 -28
- package/dist-cjs/commands/CreateWorkerConfigurationCommand.js +1 -29
- package/dist-cjs/commands/DeleteConnectorCommand.js +1 -28
- package/dist-cjs/commands/DeleteCustomPluginCommand.js +1 -28
- package/dist-cjs/commands/DescribeConnectorCommand.js +1 -29
- package/dist-cjs/commands/DescribeCustomPluginCommand.js +1 -28
- package/dist-cjs/commands/DescribeWorkerConfigurationCommand.js +1 -29
- package/dist-cjs/commands/ListConnectorsCommand.js +1 -28
- package/dist-cjs/commands/ListCustomPluginsCommand.js +1 -28
- package/dist-cjs/commands/ListWorkerConfigurationsCommand.js +1 -28
- package/dist-cjs/commands/UpdateConnectorCommand.js +1 -28
- package/dist-cjs/commands/index.js +1 -15
- package/dist-cjs/endpoint/EndpointParameters.js +1 -18
- package/dist-cjs/extensionConfiguration.js +1 -2
- package/dist-cjs/index.js +1702 -11
- package/dist-cjs/models/KafkaConnectServiceException.js +1 -12
- package/dist-cjs/models/index.js +1 -4
- package/dist-cjs/models/models_0.js +1 -163
- package/dist-cjs/pagination/Interfaces.js +1 -2
- package/dist-cjs/pagination/ListConnectorsPaginator.js +1 -7
- package/dist-cjs/pagination/ListCustomPluginsPaginator.js +1 -7
- package/dist-cjs/pagination/ListWorkerConfigurationsPaginator.js +1 -7
- package/dist-cjs/pagination/index.js +1 -7
- package/dist-cjs/protocols/Aws_restJson1.js +1 -1097
- package/dist-cjs/runtimeExtensions.js +1 -22
- package/package.json +40 -40
|
@@ -1,1097 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_UpdateConnectorCommand = exports.de_ListWorkerConfigurationsCommand = exports.de_ListCustomPluginsCommand = exports.de_ListConnectorsCommand = exports.de_DescribeWorkerConfigurationCommand = exports.de_DescribeCustomPluginCommand = exports.de_DescribeConnectorCommand = exports.de_DeleteCustomPluginCommand = exports.de_DeleteConnectorCommand = exports.de_CreateWorkerConfigurationCommand = exports.de_CreateCustomPluginCommand = exports.de_CreateConnectorCommand = exports.se_UpdateConnectorCommand = exports.se_ListWorkerConfigurationsCommand = exports.se_ListCustomPluginsCommand = exports.se_ListConnectorsCommand = exports.se_DescribeWorkerConfigurationCommand = exports.se_DescribeCustomPluginCommand = exports.se_DescribeConnectorCommand = exports.se_DeleteCustomPluginCommand = exports.se_DeleteConnectorCommand = exports.se_CreateWorkerConfigurationCommand = exports.se_CreateCustomPluginCommand = exports.se_CreateConnectorCommand = void 0;
|
|
4
|
-
const core_1 = require("@smithy/core");
|
|
5
|
-
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
|
-
const KafkaConnectServiceException_1 = require("../models/KafkaConnectServiceException");
|
|
7
|
-
const models_0_1 = require("../models/models_0");
|
|
8
|
-
const se_CreateConnectorCommand = async (input, context) => {
|
|
9
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
10
|
-
const headers = {
|
|
11
|
-
"content-type": "application/json",
|
|
12
|
-
};
|
|
13
|
-
b.bp("/v1/connectors");
|
|
14
|
-
let body;
|
|
15
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
16
|
-
capacity: (_) => (0, smithy_client_1._json)(_),
|
|
17
|
-
connectorConfiguration: (_) => (0, smithy_client_1._json)(_),
|
|
18
|
-
connectorDescription: [],
|
|
19
|
-
connectorName: [],
|
|
20
|
-
kafkaCluster: (_) => (0, smithy_client_1._json)(_),
|
|
21
|
-
kafkaClusterClientAuthentication: (_) => (0, smithy_client_1._json)(_),
|
|
22
|
-
kafkaClusterEncryptionInTransit: (_) => (0, smithy_client_1._json)(_),
|
|
23
|
-
kafkaConnectVersion: [],
|
|
24
|
-
logDelivery: (_) => (0, smithy_client_1._json)(_),
|
|
25
|
-
plugins: (_) => (0, smithy_client_1._json)(_),
|
|
26
|
-
serviceExecutionRoleArn: [],
|
|
27
|
-
workerConfiguration: (_) => (0, smithy_client_1._json)(_),
|
|
28
|
-
}));
|
|
29
|
-
b.m("POST").h(headers).b(body);
|
|
30
|
-
return b.build();
|
|
31
|
-
};
|
|
32
|
-
exports.se_CreateConnectorCommand = se_CreateConnectorCommand;
|
|
33
|
-
const se_CreateCustomPluginCommand = async (input, context) => {
|
|
34
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
35
|
-
const headers = {
|
|
36
|
-
"content-type": "application/json",
|
|
37
|
-
};
|
|
38
|
-
b.bp("/v1/custom-plugins");
|
|
39
|
-
let body;
|
|
40
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
41
|
-
contentType: [],
|
|
42
|
-
description: [],
|
|
43
|
-
location: (_) => (0, smithy_client_1._json)(_),
|
|
44
|
-
name: [],
|
|
45
|
-
}));
|
|
46
|
-
b.m("POST").h(headers).b(body);
|
|
47
|
-
return b.build();
|
|
48
|
-
};
|
|
49
|
-
exports.se_CreateCustomPluginCommand = se_CreateCustomPluginCommand;
|
|
50
|
-
const se_CreateWorkerConfigurationCommand = async (input, context) => {
|
|
51
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
52
|
-
const headers = {
|
|
53
|
-
"content-type": "application/json",
|
|
54
|
-
};
|
|
55
|
-
b.bp("/v1/worker-configurations");
|
|
56
|
-
let body;
|
|
57
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
58
|
-
description: [],
|
|
59
|
-
name: [],
|
|
60
|
-
propertiesFileContent: [],
|
|
61
|
-
}));
|
|
62
|
-
b.m("POST").h(headers).b(body);
|
|
63
|
-
return b.build();
|
|
64
|
-
};
|
|
65
|
-
exports.se_CreateWorkerConfigurationCommand = se_CreateWorkerConfigurationCommand;
|
|
66
|
-
const se_DeleteConnectorCommand = async (input, context) => {
|
|
67
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
68
|
-
const headers = {};
|
|
69
|
-
b.bp("/v1/connectors/{connectorArn}");
|
|
70
|
-
b.p("connectorArn", () => input.connectorArn, "{connectorArn}", false);
|
|
71
|
-
const query = (0, smithy_client_1.map)({
|
|
72
|
-
[_cV]: [, input[_cV]],
|
|
73
|
-
});
|
|
74
|
-
let body;
|
|
75
|
-
b.m("DELETE").h(headers).q(query).b(body);
|
|
76
|
-
return b.build();
|
|
77
|
-
};
|
|
78
|
-
exports.se_DeleteConnectorCommand = se_DeleteConnectorCommand;
|
|
79
|
-
const se_DeleteCustomPluginCommand = async (input, context) => {
|
|
80
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
81
|
-
const headers = {};
|
|
82
|
-
b.bp("/v1/custom-plugins/{customPluginArn}");
|
|
83
|
-
b.p("customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
|
|
84
|
-
let body;
|
|
85
|
-
b.m("DELETE").h(headers).b(body);
|
|
86
|
-
return b.build();
|
|
87
|
-
};
|
|
88
|
-
exports.se_DeleteCustomPluginCommand = se_DeleteCustomPluginCommand;
|
|
89
|
-
const se_DescribeConnectorCommand = async (input, context) => {
|
|
90
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
91
|
-
const headers = {};
|
|
92
|
-
b.bp("/v1/connectors/{connectorArn}");
|
|
93
|
-
b.p("connectorArn", () => input.connectorArn, "{connectorArn}", false);
|
|
94
|
-
let body;
|
|
95
|
-
b.m("GET").h(headers).b(body);
|
|
96
|
-
return b.build();
|
|
97
|
-
};
|
|
98
|
-
exports.se_DescribeConnectorCommand = se_DescribeConnectorCommand;
|
|
99
|
-
const se_DescribeCustomPluginCommand = async (input, context) => {
|
|
100
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
101
|
-
const headers = {};
|
|
102
|
-
b.bp("/v1/custom-plugins/{customPluginArn}");
|
|
103
|
-
b.p("customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
|
|
104
|
-
let body;
|
|
105
|
-
b.m("GET").h(headers).b(body);
|
|
106
|
-
return b.build();
|
|
107
|
-
};
|
|
108
|
-
exports.se_DescribeCustomPluginCommand = se_DescribeCustomPluginCommand;
|
|
109
|
-
const se_DescribeWorkerConfigurationCommand = async (input, context) => {
|
|
110
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
111
|
-
const headers = {};
|
|
112
|
-
b.bp("/v1/worker-configurations/{workerConfigurationArn}");
|
|
113
|
-
b.p("workerConfigurationArn", () => input.workerConfigurationArn, "{workerConfigurationArn}", false);
|
|
114
|
-
let body;
|
|
115
|
-
b.m("GET").h(headers).b(body);
|
|
116
|
-
return b.build();
|
|
117
|
-
};
|
|
118
|
-
exports.se_DescribeWorkerConfigurationCommand = se_DescribeWorkerConfigurationCommand;
|
|
119
|
-
const se_ListConnectorsCommand = async (input, context) => {
|
|
120
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
121
|
-
const headers = {};
|
|
122
|
-
b.bp("/v1/connectors");
|
|
123
|
-
const query = (0, smithy_client_1.map)({
|
|
124
|
-
[_cNP]: [, input[_cNP]],
|
|
125
|
-
[_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
|
|
126
|
-
[_nT]: [, input[_nT]],
|
|
127
|
-
});
|
|
128
|
-
let body;
|
|
129
|
-
b.m("GET").h(headers).q(query).b(body);
|
|
130
|
-
return b.build();
|
|
131
|
-
};
|
|
132
|
-
exports.se_ListConnectorsCommand = se_ListConnectorsCommand;
|
|
133
|
-
const se_ListCustomPluginsCommand = async (input, context) => {
|
|
134
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
135
|
-
const headers = {};
|
|
136
|
-
b.bp("/v1/custom-plugins");
|
|
137
|
-
const query = (0, smithy_client_1.map)({
|
|
138
|
-
[_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
|
|
139
|
-
[_nT]: [, input[_nT]],
|
|
140
|
-
});
|
|
141
|
-
let body;
|
|
142
|
-
b.m("GET").h(headers).q(query).b(body);
|
|
143
|
-
return b.build();
|
|
144
|
-
};
|
|
145
|
-
exports.se_ListCustomPluginsCommand = se_ListCustomPluginsCommand;
|
|
146
|
-
const se_ListWorkerConfigurationsCommand = async (input, context) => {
|
|
147
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
148
|
-
const headers = {};
|
|
149
|
-
b.bp("/v1/worker-configurations");
|
|
150
|
-
const query = (0, smithy_client_1.map)({
|
|
151
|
-
[_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
|
|
152
|
-
[_nT]: [, input[_nT]],
|
|
153
|
-
});
|
|
154
|
-
let body;
|
|
155
|
-
b.m("GET").h(headers).q(query).b(body);
|
|
156
|
-
return b.build();
|
|
157
|
-
};
|
|
158
|
-
exports.se_ListWorkerConfigurationsCommand = se_ListWorkerConfigurationsCommand;
|
|
159
|
-
const se_UpdateConnectorCommand = async (input, context) => {
|
|
160
|
-
const b = (0, core_1.requestBuilder)(input, context);
|
|
161
|
-
const headers = {
|
|
162
|
-
"content-type": "application/json",
|
|
163
|
-
};
|
|
164
|
-
b.bp("/v1/connectors/{connectorArn}");
|
|
165
|
-
b.p("connectorArn", () => input.connectorArn, "{connectorArn}", false);
|
|
166
|
-
const query = (0, smithy_client_1.map)({
|
|
167
|
-
[_cV]: [, (0, smithy_client_1.expectNonNull)(input[_cV], `currentVersion`)],
|
|
168
|
-
});
|
|
169
|
-
let body;
|
|
170
|
-
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
171
|
-
capacity: (_) => (0, smithy_client_1._json)(_),
|
|
172
|
-
}));
|
|
173
|
-
b.m("PUT").h(headers).q(query).b(body);
|
|
174
|
-
return b.build();
|
|
175
|
-
};
|
|
176
|
-
exports.se_UpdateConnectorCommand = se_UpdateConnectorCommand;
|
|
177
|
-
const de_CreateConnectorCommand = async (output, context) => {
|
|
178
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
179
|
-
return de_CreateConnectorCommandError(output, context);
|
|
180
|
-
}
|
|
181
|
-
const contents = (0, smithy_client_1.map)({
|
|
182
|
-
$metadata: deserializeMetadata(output),
|
|
183
|
-
});
|
|
184
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
185
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
186
|
-
connectorArn: smithy_client_1.expectString,
|
|
187
|
-
connectorName: smithy_client_1.expectString,
|
|
188
|
-
connectorState: smithy_client_1.expectString,
|
|
189
|
-
});
|
|
190
|
-
Object.assign(contents, doc);
|
|
191
|
-
return contents;
|
|
192
|
-
};
|
|
193
|
-
exports.de_CreateConnectorCommand = de_CreateConnectorCommand;
|
|
194
|
-
const de_CreateConnectorCommandError = async (output, context) => {
|
|
195
|
-
const parsedOutput = {
|
|
196
|
-
...output,
|
|
197
|
-
body: await parseErrorBody(output.body, context),
|
|
198
|
-
};
|
|
199
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
200
|
-
switch (errorCode) {
|
|
201
|
-
case "BadRequestException":
|
|
202
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
203
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
204
|
-
case "ConflictException":
|
|
205
|
-
case "com.amazonaws.kafkaconnect#ConflictException":
|
|
206
|
-
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
207
|
-
case "ForbiddenException":
|
|
208
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
209
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
210
|
-
case "InternalServerErrorException":
|
|
211
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
212
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
213
|
-
case "NotFoundException":
|
|
214
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
215
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
216
|
-
case "ServiceUnavailableException":
|
|
217
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
218
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
219
|
-
case "TooManyRequestsException":
|
|
220
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
221
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
222
|
-
case "UnauthorizedException":
|
|
223
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
224
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
225
|
-
default:
|
|
226
|
-
const parsedBody = parsedOutput.body;
|
|
227
|
-
return throwDefaultError({
|
|
228
|
-
output,
|
|
229
|
-
parsedBody,
|
|
230
|
-
errorCode,
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
const de_CreateCustomPluginCommand = async (output, context) => {
|
|
235
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
236
|
-
return de_CreateCustomPluginCommandError(output, context);
|
|
237
|
-
}
|
|
238
|
-
const contents = (0, smithy_client_1.map)({
|
|
239
|
-
$metadata: deserializeMetadata(output),
|
|
240
|
-
});
|
|
241
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
242
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
243
|
-
customPluginArn: smithy_client_1.expectString,
|
|
244
|
-
customPluginState: smithy_client_1.expectString,
|
|
245
|
-
name: smithy_client_1.expectString,
|
|
246
|
-
revision: smithy_client_1.expectLong,
|
|
247
|
-
});
|
|
248
|
-
Object.assign(contents, doc);
|
|
249
|
-
return contents;
|
|
250
|
-
};
|
|
251
|
-
exports.de_CreateCustomPluginCommand = de_CreateCustomPluginCommand;
|
|
252
|
-
const de_CreateCustomPluginCommandError = async (output, context) => {
|
|
253
|
-
const parsedOutput = {
|
|
254
|
-
...output,
|
|
255
|
-
body: await parseErrorBody(output.body, context),
|
|
256
|
-
};
|
|
257
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
258
|
-
switch (errorCode) {
|
|
259
|
-
case "BadRequestException":
|
|
260
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
261
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
262
|
-
case "ConflictException":
|
|
263
|
-
case "com.amazonaws.kafkaconnect#ConflictException":
|
|
264
|
-
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
265
|
-
case "ForbiddenException":
|
|
266
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
267
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
268
|
-
case "InternalServerErrorException":
|
|
269
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
270
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
271
|
-
case "NotFoundException":
|
|
272
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
273
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
274
|
-
case "ServiceUnavailableException":
|
|
275
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
276
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
277
|
-
case "TooManyRequestsException":
|
|
278
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
279
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
280
|
-
case "UnauthorizedException":
|
|
281
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
282
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
283
|
-
default:
|
|
284
|
-
const parsedBody = parsedOutput.body;
|
|
285
|
-
return throwDefaultError({
|
|
286
|
-
output,
|
|
287
|
-
parsedBody,
|
|
288
|
-
errorCode,
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
};
|
|
292
|
-
const de_CreateWorkerConfigurationCommand = async (output, context) => {
|
|
293
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
294
|
-
return de_CreateWorkerConfigurationCommandError(output, context);
|
|
295
|
-
}
|
|
296
|
-
const contents = (0, smithy_client_1.map)({
|
|
297
|
-
$metadata: deserializeMetadata(output),
|
|
298
|
-
});
|
|
299
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
300
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
301
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
302
|
-
latestRevision: (_) => de_WorkerConfigurationRevisionSummary(_, context),
|
|
303
|
-
name: smithy_client_1.expectString,
|
|
304
|
-
workerConfigurationArn: smithy_client_1.expectString,
|
|
305
|
-
});
|
|
306
|
-
Object.assign(contents, doc);
|
|
307
|
-
return contents;
|
|
308
|
-
};
|
|
309
|
-
exports.de_CreateWorkerConfigurationCommand = de_CreateWorkerConfigurationCommand;
|
|
310
|
-
const de_CreateWorkerConfigurationCommandError = async (output, context) => {
|
|
311
|
-
const parsedOutput = {
|
|
312
|
-
...output,
|
|
313
|
-
body: await parseErrorBody(output.body, context),
|
|
314
|
-
};
|
|
315
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
316
|
-
switch (errorCode) {
|
|
317
|
-
case "BadRequestException":
|
|
318
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
319
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
320
|
-
case "ConflictException":
|
|
321
|
-
case "com.amazonaws.kafkaconnect#ConflictException":
|
|
322
|
-
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
323
|
-
case "ForbiddenException":
|
|
324
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
325
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
326
|
-
case "InternalServerErrorException":
|
|
327
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
328
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
329
|
-
case "NotFoundException":
|
|
330
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
331
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
332
|
-
case "ServiceUnavailableException":
|
|
333
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
334
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
335
|
-
case "TooManyRequestsException":
|
|
336
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
337
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
338
|
-
case "UnauthorizedException":
|
|
339
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
340
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
341
|
-
default:
|
|
342
|
-
const parsedBody = parsedOutput.body;
|
|
343
|
-
return throwDefaultError({
|
|
344
|
-
output,
|
|
345
|
-
parsedBody,
|
|
346
|
-
errorCode,
|
|
347
|
-
});
|
|
348
|
-
}
|
|
349
|
-
};
|
|
350
|
-
const de_DeleteConnectorCommand = async (output, context) => {
|
|
351
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
352
|
-
return de_DeleteConnectorCommandError(output, context);
|
|
353
|
-
}
|
|
354
|
-
const contents = (0, smithy_client_1.map)({
|
|
355
|
-
$metadata: deserializeMetadata(output),
|
|
356
|
-
});
|
|
357
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
358
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
359
|
-
connectorArn: smithy_client_1.expectString,
|
|
360
|
-
connectorState: smithy_client_1.expectString,
|
|
361
|
-
});
|
|
362
|
-
Object.assign(contents, doc);
|
|
363
|
-
return contents;
|
|
364
|
-
};
|
|
365
|
-
exports.de_DeleteConnectorCommand = de_DeleteConnectorCommand;
|
|
366
|
-
const de_DeleteConnectorCommandError = async (output, context) => {
|
|
367
|
-
const parsedOutput = {
|
|
368
|
-
...output,
|
|
369
|
-
body: await parseErrorBody(output.body, context),
|
|
370
|
-
};
|
|
371
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
372
|
-
switch (errorCode) {
|
|
373
|
-
case "BadRequestException":
|
|
374
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
375
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
376
|
-
case "ForbiddenException":
|
|
377
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
378
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
379
|
-
case "InternalServerErrorException":
|
|
380
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
381
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
382
|
-
case "NotFoundException":
|
|
383
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
384
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
385
|
-
case "ServiceUnavailableException":
|
|
386
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
387
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
388
|
-
case "TooManyRequestsException":
|
|
389
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
390
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
391
|
-
case "UnauthorizedException":
|
|
392
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
393
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
394
|
-
default:
|
|
395
|
-
const parsedBody = parsedOutput.body;
|
|
396
|
-
return throwDefaultError({
|
|
397
|
-
output,
|
|
398
|
-
parsedBody,
|
|
399
|
-
errorCode,
|
|
400
|
-
});
|
|
401
|
-
}
|
|
402
|
-
};
|
|
403
|
-
const de_DeleteCustomPluginCommand = async (output, context) => {
|
|
404
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
405
|
-
return de_DeleteCustomPluginCommandError(output, context);
|
|
406
|
-
}
|
|
407
|
-
const contents = (0, smithy_client_1.map)({
|
|
408
|
-
$metadata: deserializeMetadata(output),
|
|
409
|
-
});
|
|
410
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
411
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
412
|
-
customPluginArn: smithy_client_1.expectString,
|
|
413
|
-
customPluginState: smithy_client_1.expectString,
|
|
414
|
-
});
|
|
415
|
-
Object.assign(contents, doc);
|
|
416
|
-
return contents;
|
|
417
|
-
};
|
|
418
|
-
exports.de_DeleteCustomPluginCommand = de_DeleteCustomPluginCommand;
|
|
419
|
-
const de_DeleteCustomPluginCommandError = async (output, context) => {
|
|
420
|
-
const parsedOutput = {
|
|
421
|
-
...output,
|
|
422
|
-
body: await parseErrorBody(output.body, context),
|
|
423
|
-
};
|
|
424
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
425
|
-
switch (errorCode) {
|
|
426
|
-
case "BadRequestException":
|
|
427
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
428
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
429
|
-
case "ForbiddenException":
|
|
430
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
431
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
432
|
-
case "InternalServerErrorException":
|
|
433
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
434
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
435
|
-
case "NotFoundException":
|
|
436
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
437
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
438
|
-
case "ServiceUnavailableException":
|
|
439
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
440
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
441
|
-
case "TooManyRequestsException":
|
|
442
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
443
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
444
|
-
case "UnauthorizedException":
|
|
445
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
446
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
447
|
-
default:
|
|
448
|
-
const parsedBody = parsedOutput.body;
|
|
449
|
-
return throwDefaultError({
|
|
450
|
-
output,
|
|
451
|
-
parsedBody,
|
|
452
|
-
errorCode,
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
};
|
|
456
|
-
const de_DescribeConnectorCommand = async (output, context) => {
|
|
457
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
458
|
-
return de_DescribeConnectorCommandError(output, context);
|
|
459
|
-
}
|
|
460
|
-
const contents = (0, smithy_client_1.map)({
|
|
461
|
-
$metadata: deserializeMetadata(output),
|
|
462
|
-
});
|
|
463
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
464
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
465
|
-
capacity: smithy_client_1._json,
|
|
466
|
-
connectorArn: smithy_client_1.expectString,
|
|
467
|
-
connectorConfiguration: smithy_client_1._json,
|
|
468
|
-
connectorDescription: smithy_client_1.expectString,
|
|
469
|
-
connectorName: smithy_client_1.expectString,
|
|
470
|
-
connectorState: smithy_client_1.expectString,
|
|
471
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
472
|
-
currentVersion: smithy_client_1.expectString,
|
|
473
|
-
kafkaCluster: smithy_client_1._json,
|
|
474
|
-
kafkaClusterClientAuthentication: smithy_client_1._json,
|
|
475
|
-
kafkaClusterEncryptionInTransit: smithy_client_1._json,
|
|
476
|
-
kafkaConnectVersion: smithy_client_1.expectString,
|
|
477
|
-
logDelivery: smithy_client_1._json,
|
|
478
|
-
plugins: smithy_client_1._json,
|
|
479
|
-
serviceExecutionRoleArn: smithy_client_1.expectString,
|
|
480
|
-
stateDescription: smithy_client_1._json,
|
|
481
|
-
workerConfiguration: smithy_client_1._json,
|
|
482
|
-
});
|
|
483
|
-
Object.assign(contents, doc);
|
|
484
|
-
return contents;
|
|
485
|
-
};
|
|
486
|
-
exports.de_DescribeConnectorCommand = de_DescribeConnectorCommand;
|
|
487
|
-
const de_DescribeConnectorCommandError = async (output, context) => {
|
|
488
|
-
const parsedOutput = {
|
|
489
|
-
...output,
|
|
490
|
-
body: await parseErrorBody(output.body, context),
|
|
491
|
-
};
|
|
492
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
493
|
-
switch (errorCode) {
|
|
494
|
-
case "BadRequestException":
|
|
495
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
496
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
497
|
-
case "ForbiddenException":
|
|
498
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
499
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
500
|
-
case "InternalServerErrorException":
|
|
501
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
502
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
503
|
-
case "NotFoundException":
|
|
504
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
505
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
506
|
-
case "ServiceUnavailableException":
|
|
507
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
508
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
509
|
-
case "TooManyRequestsException":
|
|
510
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
511
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
512
|
-
case "UnauthorizedException":
|
|
513
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
514
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
515
|
-
default:
|
|
516
|
-
const parsedBody = parsedOutput.body;
|
|
517
|
-
return throwDefaultError({
|
|
518
|
-
output,
|
|
519
|
-
parsedBody,
|
|
520
|
-
errorCode,
|
|
521
|
-
});
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
const de_DescribeCustomPluginCommand = async (output, context) => {
|
|
525
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
526
|
-
return de_DescribeCustomPluginCommandError(output, context);
|
|
527
|
-
}
|
|
528
|
-
const contents = (0, smithy_client_1.map)({
|
|
529
|
-
$metadata: deserializeMetadata(output),
|
|
530
|
-
});
|
|
531
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
532
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
533
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
534
|
-
customPluginArn: smithy_client_1.expectString,
|
|
535
|
-
customPluginState: smithy_client_1.expectString,
|
|
536
|
-
description: smithy_client_1.expectString,
|
|
537
|
-
latestRevision: (_) => de_CustomPluginRevisionSummary(_, context),
|
|
538
|
-
name: smithy_client_1.expectString,
|
|
539
|
-
stateDescription: smithy_client_1._json,
|
|
540
|
-
});
|
|
541
|
-
Object.assign(contents, doc);
|
|
542
|
-
return contents;
|
|
543
|
-
};
|
|
544
|
-
exports.de_DescribeCustomPluginCommand = de_DescribeCustomPluginCommand;
|
|
545
|
-
const de_DescribeCustomPluginCommandError = async (output, context) => {
|
|
546
|
-
const parsedOutput = {
|
|
547
|
-
...output,
|
|
548
|
-
body: await parseErrorBody(output.body, context),
|
|
549
|
-
};
|
|
550
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
551
|
-
switch (errorCode) {
|
|
552
|
-
case "BadRequestException":
|
|
553
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
554
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
555
|
-
case "ForbiddenException":
|
|
556
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
557
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
558
|
-
case "InternalServerErrorException":
|
|
559
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
560
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
561
|
-
case "NotFoundException":
|
|
562
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
563
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
564
|
-
case "ServiceUnavailableException":
|
|
565
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
566
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
567
|
-
case "TooManyRequestsException":
|
|
568
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
569
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
570
|
-
case "UnauthorizedException":
|
|
571
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
572
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
573
|
-
default:
|
|
574
|
-
const parsedBody = parsedOutput.body;
|
|
575
|
-
return throwDefaultError({
|
|
576
|
-
output,
|
|
577
|
-
parsedBody,
|
|
578
|
-
errorCode,
|
|
579
|
-
});
|
|
580
|
-
}
|
|
581
|
-
};
|
|
582
|
-
const de_DescribeWorkerConfigurationCommand = async (output, context) => {
|
|
583
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
584
|
-
return de_DescribeWorkerConfigurationCommandError(output, context);
|
|
585
|
-
}
|
|
586
|
-
const contents = (0, smithy_client_1.map)({
|
|
587
|
-
$metadata: deserializeMetadata(output),
|
|
588
|
-
});
|
|
589
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
590
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
591
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
592
|
-
description: smithy_client_1.expectString,
|
|
593
|
-
latestRevision: (_) => de_WorkerConfigurationRevisionDescription(_, context),
|
|
594
|
-
name: smithy_client_1.expectString,
|
|
595
|
-
workerConfigurationArn: smithy_client_1.expectString,
|
|
596
|
-
});
|
|
597
|
-
Object.assign(contents, doc);
|
|
598
|
-
return contents;
|
|
599
|
-
};
|
|
600
|
-
exports.de_DescribeWorkerConfigurationCommand = de_DescribeWorkerConfigurationCommand;
|
|
601
|
-
const de_DescribeWorkerConfigurationCommandError = async (output, context) => {
|
|
602
|
-
const parsedOutput = {
|
|
603
|
-
...output,
|
|
604
|
-
body: await parseErrorBody(output.body, context),
|
|
605
|
-
};
|
|
606
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
607
|
-
switch (errorCode) {
|
|
608
|
-
case "BadRequestException":
|
|
609
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
610
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
611
|
-
case "ForbiddenException":
|
|
612
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
613
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
614
|
-
case "InternalServerErrorException":
|
|
615
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
616
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
617
|
-
case "NotFoundException":
|
|
618
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
619
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
620
|
-
case "ServiceUnavailableException":
|
|
621
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
622
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
623
|
-
case "TooManyRequestsException":
|
|
624
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
625
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
626
|
-
case "UnauthorizedException":
|
|
627
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
628
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
629
|
-
default:
|
|
630
|
-
const parsedBody = parsedOutput.body;
|
|
631
|
-
return throwDefaultError({
|
|
632
|
-
output,
|
|
633
|
-
parsedBody,
|
|
634
|
-
errorCode,
|
|
635
|
-
});
|
|
636
|
-
}
|
|
637
|
-
};
|
|
638
|
-
const de_ListConnectorsCommand = async (output, context) => {
|
|
639
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
640
|
-
return de_ListConnectorsCommandError(output, context);
|
|
641
|
-
}
|
|
642
|
-
const contents = (0, smithy_client_1.map)({
|
|
643
|
-
$metadata: deserializeMetadata(output),
|
|
644
|
-
});
|
|
645
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
646
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
647
|
-
connectors: (_) => de___listOfConnectorSummary(_, context),
|
|
648
|
-
nextToken: smithy_client_1.expectString,
|
|
649
|
-
});
|
|
650
|
-
Object.assign(contents, doc);
|
|
651
|
-
return contents;
|
|
652
|
-
};
|
|
653
|
-
exports.de_ListConnectorsCommand = de_ListConnectorsCommand;
|
|
654
|
-
const de_ListConnectorsCommandError = async (output, context) => {
|
|
655
|
-
const parsedOutput = {
|
|
656
|
-
...output,
|
|
657
|
-
body: await parseErrorBody(output.body, context),
|
|
658
|
-
};
|
|
659
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
660
|
-
switch (errorCode) {
|
|
661
|
-
case "BadRequestException":
|
|
662
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
663
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
664
|
-
case "ForbiddenException":
|
|
665
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
666
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
667
|
-
case "InternalServerErrorException":
|
|
668
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
669
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
670
|
-
case "NotFoundException":
|
|
671
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
672
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
673
|
-
case "ServiceUnavailableException":
|
|
674
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
675
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
676
|
-
case "TooManyRequestsException":
|
|
677
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
678
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
679
|
-
case "UnauthorizedException":
|
|
680
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
681
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
682
|
-
default:
|
|
683
|
-
const parsedBody = parsedOutput.body;
|
|
684
|
-
return throwDefaultError({
|
|
685
|
-
output,
|
|
686
|
-
parsedBody,
|
|
687
|
-
errorCode,
|
|
688
|
-
});
|
|
689
|
-
}
|
|
690
|
-
};
|
|
691
|
-
const de_ListCustomPluginsCommand = async (output, context) => {
|
|
692
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
693
|
-
return de_ListCustomPluginsCommandError(output, context);
|
|
694
|
-
}
|
|
695
|
-
const contents = (0, smithy_client_1.map)({
|
|
696
|
-
$metadata: deserializeMetadata(output),
|
|
697
|
-
});
|
|
698
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
699
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
700
|
-
customPlugins: (_) => de___listOfCustomPluginSummary(_, context),
|
|
701
|
-
nextToken: smithy_client_1.expectString,
|
|
702
|
-
});
|
|
703
|
-
Object.assign(contents, doc);
|
|
704
|
-
return contents;
|
|
705
|
-
};
|
|
706
|
-
exports.de_ListCustomPluginsCommand = de_ListCustomPluginsCommand;
|
|
707
|
-
const de_ListCustomPluginsCommandError = async (output, context) => {
|
|
708
|
-
const parsedOutput = {
|
|
709
|
-
...output,
|
|
710
|
-
body: await parseErrorBody(output.body, context),
|
|
711
|
-
};
|
|
712
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
713
|
-
switch (errorCode) {
|
|
714
|
-
case "BadRequestException":
|
|
715
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
716
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
717
|
-
case "ForbiddenException":
|
|
718
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
719
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
720
|
-
case "InternalServerErrorException":
|
|
721
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
722
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
723
|
-
case "NotFoundException":
|
|
724
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
725
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
726
|
-
case "ServiceUnavailableException":
|
|
727
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
728
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
729
|
-
case "TooManyRequestsException":
|
|
730
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
731
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
732
|
-
case "UnauthorizedException":
|
|
733
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
734
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
735
|
-
default:
|
|
736
|
-
const parsedBody = parsedOutput.body;
|
|
737
|
-
return throwDefaultError({
|
|
738
|
-
output,
|
|
739
|
-
parsedBody,
|
|
740
|
-
errorCode,
|
|
741
|
-
});
|
|
742
|
-
}
|
|
743
|
-
};
|
|
744
|
-
const de_ListWorkerConfigurationsCommand = async (output, context) => {
|
|
745
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
746
|
-
return de_ListWorkerConfigurationsCommandError(output, context);
|
|
747
|
-
}
|
|
748
|
-
const contents = (0, smithy_client_1.map)({
|
|
749
|
-
$metadata: deserializeMetadata(output),
|
|
750
|
-
});
|
|
751
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
752
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
753
|
-
nextToken: smithy_client_1.expectString,
|
|
754
|
-
workerConfigurations: (_) => de___listOfWorkerConfigurationSummary(_, context),
|
|
755
|
-
});
|
|
756
|
-
Object.assign(contents, doc);
|
|
757
|
-
return contents;
|
|
758
|
-
};
|
|
759
|
-
exports.de_ListWorkerConfigurationsCommand = de_ListWorkerConfigurationsCommand;
|
|
760
|
-
const de_ListWorkerConfigurationsCommandError = async (output, context) => {
|
|
761
|
-
const parsedOutput = {
|
|
762
|
-
...output,
|
|
763
|
-
body: await parseErrorBody(output.body, context),
|
|
764
|
-
};
|
|
765
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
766
|
-
switch (errorCode) {
|
|
767
|
-
case "BadRequestException":
|
|
768
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
769
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
770
|
-
case "ForbiddenException":
|
|
771
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
772
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
773
|
-
case "InternalServerErrorException":
|
|
774
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
775
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
776
|
-
case "NotFoundException":
|
|
777
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
778
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
779
|
-
case "ServiceUnavailableException":
|
|
780
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
781
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
782
|
-
case "TooManyRequestsException":
|
|
783
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
784
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
785
|
-
case "UnauthorizedException":
|
|
786
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
787
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
788
|
-
default:
|
|
789
|
-
const parsedBody = parsedOutput.body;
|
|
790
|
-
return throwDefaultError({
|
|
791
|
-
output,
|
|
792
|
-
parsedBody,
|
|
793
|
-
errorCode,
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
const de_UpdateConnectorCommand = async (output, context) => {
|
|
798
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
799
|
-
return de_UpdateConnectorCommandError(output, context);
|
|
800
|
-
}
|
|
801
|
-
const contents = (0, smithy_client_1.map)({
|
|
802
|
-
$metadata: deserializeMetadata(output),
|
|
803
|
-
});
|
|
804
|
-
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
805
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
806
|
-
connectorArn: smithy_client_1.expectString,
|
|
807
|
-
connectorState: smithy_client_1.expectString,
|
|
808
|
-
});
|
|
809
|
-
Object.assign(contents, doc);
|
|
810
|
-
return contents;
|
|
811
|
-
};
|
|
812
|
-
exports.de_UpdateConnectorCommand = de_UpdateConnectorCommand;
|
|
813
|
-
const de_UpdateConnectorCommandError = async (output, context) => {
|
|
814
|
-
const parsedOutput = {
|
|
815
|
-
...output,
|
|
816
|
-
body: await parseErrorBody(output.body, context),
|
|
817
|
-
};
|
|
818
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
819
|
-
switch (errorCode) {
|
|
820
|
-
case "BadRequestException":
|
|
821
|
-
case "com.amazonaws.kafkaconnect#BadRequestException":
|
|
822
|
-
throw await de_BadRequestExceptionRes(parsedOutput, context);
|
|
823
|
-
case "ForbiddenException":
|
|
824
|
-
case "com.amazonaws.kafkaconnect#ForbiddenException":
|
|
825
|
-
throw await de_ForbiddenExceptionRes(parsedOutput, context);
|
|
826
|
-
case "InternalServerErrorException":
|
|
827
|
-
case "com.amazonaws.kafkaconnect#InternalServerErrorException":
|
|
828
|
-
throw await de_InternalServerErrorExceptionRes(parsedOutput, context);
|
|
829
|
-
case "NotFoundException":
|
|
830
|
-
case "com.amazonaws.kafkaconnect#NotFoundException":
|
|
831
|
-
throw await de_NotFoundExceptionRes(parsedOutput, context);
|
|
832
|
-
case "ServiceUnavailableException":
|
|
833
|
-
case "com.amazonaws.kafkaconnect#ServiceUnavailableException":
|
|
834
|
-
throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
|
|
835
|
-
case "TooManyRequestsException":
|
|
836
|
-
case "com.amazonaws.kafkaconnect#TooManyRequestsException":
|
|
837
|
-
throw await de_TooManyRequestsExceptionRes(parsedOutput, context);
|
|
838
|
-
case "UnauthorizedException":
|
|
839
|
-
case "com.amazonaws.kafkaconnect#UnauthorizedException":
|
|
840
|
-
throw await de_UnauthorizedExceptionRes(parsedOutput, context);
|
|
841
|
-
default:
|
|
842
|
-
const parsedBody = parsedOutput.body;
|
|
843
|
-
return throwDefaultError({
|
|
844
|
-
output,
|
|
845
|
-
parsedBody,
|
|
846
|
-
errorCode,
|
|
847
|
-
});
|
|
848
|
-
}
|
|
849
|
-
};
|
|
850
|
-
const throwDefaultError = (0, smithy_client_1.withBaseException)(KafkaConnectServiceException_1.KafkaConnectServiceException);
|
|
851
|
-
const de_BadRequestExceptionRes = async (parsedOutput, context) => {
|
|
852
|
-
const contents = (0, smithy_client_1.map)({});
|
|
853
|
-
const data = parsedOutput.body;
|
|
854
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
855
|
-
message: smithy_client_1.expectString,
|
|
856
|
-
});
|
|
857
|
-
Object.assign(contents, doc);
|
|
858
|
-
const exception = new models_0_1.BadRequestException({
|
|
859
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
860
|
-
...contents,
|
|
861
|
-
});
|
|
862
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
863
|
-
};
|
|
864
|
-
const de_ConflictExceptionRes = async (parsedOutput, context) => {
|
|
865
|
-
const contents = (0, smithy_client_1.map)({});
|
|
866
|
-
const data = parsedOutput.body;
|
|
867
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
868
|
-
message: smithy_client_1.expectString,
|
|
869
|
-
});
|
|
870
|
-
Object.assign(contents, doc);
|
|
871
|
-
const exception = new models_0_1.ConflictException({
|
|
872
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
873
|
-
...contents,
|
|
874
|
-
});
|
|
875
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
876
|
-
};
|
|
877
|
-
const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
|
|
878
|
-
const contents = (0, smithy_client_1.map)({});
|
|
879
|
-
const data = parsedOutput.body;
|
|
880
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
881
|
-
message: smithy_client_1.expectString,
|
|
882
|
-
});
|
|
883
|
-
Object.assign(contents, doc);
|
|
884
|
-
const exception = new models_0_1.ForbiddenException({
|
|
885
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
886
|
-
...contents,
|
|
887
|
-
});
|
|
888
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
889
|
-
};
|
|
890
|
-
const de_InternalServerErrorExceptionRes = async (parsedOutput, context) => {
|
|
891
|
-
const contents = (0, smithy_client_1.map)({});
|
|
892
|
-
const data = parsedOutput.body;
|
|
893
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
894
|
-
message: smithy_client_1.expectString,
|
|
895
|
-
});
|
|
896
|
-
Object.assign(contents, doc);
|
|
897
|
-
const exception = new models_0_1.InternalServerErrorException({
|
|
898
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
899
|
-
...contents,
|
|
900
|
-
});
|
|
901
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
902
|
-
};
|
|
903
|
-
const de_NotFoundExceptionRes = async (parsedOutput, context) => {
|
|
904
|
-
const contents = (0, smithy_client_1.map)({});
|
|
905
|
-
const data = parsedOutput.body;
|
|
906
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
907
|
-
message: smithy_client_1.expectString,
|
|
908
|
-
});
|
|
909
|
-
Object.assign(contents, doc);
|
|
910
|
-
const exception = new models_0_1.NotFoundException({
|
|
911
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
912
|
-
...contents,
|
|
913
|
-
});
|
|
914
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
915
|
-
};
|
|
916
|
-
const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
|
|
917
|
-
const contents = (0, smithy_client_1.map)({});
|
|
918
|
-
const data = parsedOutput.body;
|
|
919
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
920
|
-
message: smithy_client_1.expectString,
|
|
921
|
-
});
|
|
922
|
-
Object.assign(contents, doc);
|
|
923
|
-
const exception = new models_0_1.ServiceUnavailableException({
|
|
924
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
925
|
-
...contents,
|
|
926
|
-
});
|
|
927
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
928
|
-
};
|
|
929
|
-
const de_TooManyRequestsExceptionRes = async (parsedOutput, context) => {
|
|
930
|
-
const contents = (0, smithy_client_1.map)({});
|
|
931
|
-
const data = parsedOutput.body;
|
|
932
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
933
|
-
message: smithy_client_1.expectString,
|
|
934
|
-
});
|
|
935
|
-
Object.assign(contents, doc);
|
|
936
|
-
const exception = new models_0_1.TooManyRequestsException({
|
|
937
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
938
|
-
...contents,
|
|
939
|
-
});
|
|
940
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
941
|
-
};
|
|
942
|
-
const de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
|
|
943
|
-
const contents = (0, smithy_client_1.map)({});
|
|
944
|
-
const data = parsedOutput.body;
|
|
945
|
-
const doc = (0, smithy_client_1.take)(data, {
|
|
946
|
-
message: smithy_client_1.expectString,
|
|
947
|
-
});
|
|
948
|
-
Object.assign(contents, doc);
|
|
949
|
-
const exception = new models_0_1.UnauthorizedException({
|
|
950
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
951
|
-
...contents,
|
|
952
|
-
});
|
|
953
|
-
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
954
|
-
};
|
|
955
|
-
const de___listOfConnectorSummary = (output, context) => {
|
|
956
|
-
const retVal = (output || [])
|
|
957
|
-
.filter((e) => e != null)
|
|
958
|
-
.map((entry) => {
|
|
959
|
-
return de_ConnectorSummary(entry, context);
|
|
960
|
-
});
|
|
961
|
-
return retVal;
|
|
962
|
-
};
|
|
963
|
-
const de___listOfCustomPluginSummary = (output, context) => {
|
|
964
|
-
const retVal = (output || [])
|
|
965
|
-
.filter((e) => e != null)
|
|
966
|
-
.map((entry) => {
|
|
967
|
-
return de_CustomPluginSummary(entry, context);
|
|
968
|
-
});
|
|
969
|
-
return retVal;
|
|
970
|
-
};
|
|
971
|
-
const de___listOfWorkerConfigurationSummary = (output, context) => {
|
|
972
|
-
const retVal = (output || [])
|
|
973
|
-
.filter((e) => e != null)
|
|
974
|
-
.map((entry) => {
|
|
975
|
-
return de_WorkerConfigurationSummary(entry, context);
|
|
976
|
-
});
|
|
977
|
-
return retVal;
|
|
978
|
-
};
|
|
979
|
-
const de_ConnectorSummary = (output, context) => {
|
|
980
|
-
return (0, smithy_client_1.take)(output, {
|
|
981
|
-
capacity: smithy_client_1._json,
|
|
982
|
-
connectorArn: smithy_client_1.expectString,
|
|
983
|
-
connectorDescription: smithy_client_1.expectString,
|
|
984
|
-
connectorName: smithy_client_1.expectString,
|
|
985
|
-
connectorState: smithy_client_1.expectString,
|
|
986
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
987
|
-
currentVersion: smithy_client_1.expectString,
|
|
988
|
-
kafkaCluster: smithy_client_1._json,
|
|
989
|
-
kafkaClusterClientAuthentication: smithy_client_1._json,
|
|
990
|
-
kafkaClusterEncryptionInTransit: smithy_client_1._json,
|
|
991
|
-
kafkaConnectVersion: smithy_client_1.expectString,
|
|
992
|
-
logDelivery: smithy_client_1._json,
|
|
993
|
-
plugins: smithy_client_1._json,
|
|
994
|
-
serviceExecutionRoleArn: smithy_client_1.expectString,
|
|
995
|
-
workerConfiguration: smithy_client_1._json,
|
|
996
|
-
});
|
|
997
|
-
};
|
|
998
|
-
const de_CustomPluginRevisionSummary = (output, context) => {
|
|
999
|
-
return (0, smithy_client_1.take)(output, {
|
|
1000
|
-
contentType: smithy_client_1.expectString,
|
|
1001
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
1002
|
-
description: smithy_client_1.expectString,
|
|
1003
|
-
fileDescription: smithy_client_1._json,
|
|
1004
|
-
location: smithy_client_1._json,
|
|
1005
|
-
revision: smithy_client_1.expectLong,
|
|
1006
|
-
});
|
|
1007
|
-
};
|
|
1008
|
-
const de_CustomPluginSummary = (output, context) => {
|
|
1009
|
-
return (0, smithy_client_1.take)(output, {
|
|
1010
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
1011
|
-
customPluginArn: smithy_client_1.expectString,
|
|
1012
|
-
customPluginState: smithy_client_1.expectString,
|
|
1013
|
-
description: smithy_client_1.expectString,
|
|
1014
|
-
latestRevision: (_) => de_CustomPluginRevisionSummary(_, context),
|
|
1015
|
-
name: smithy_client_1.expectString,
|
|
1016
|
-
});
|
|
1017
|
-
};
|
|
1018
|
-
const de_WorkerConfigurationRevisionDescription = (output, context) => {
|
|
1019
|
-
return (0, smithy_client_1.take)(output, {
|
|
1020
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
1021
|
-
description: smithy_client_1.expectString,
|
|
1022
|
-
propertiesFileContent: smithy_client_1.expectString,
|
|
1023
|
-
revision: smithy_client_1.expectLong,
|
|
1024
|
-
});
|
|
1025
|
-
};
|
|
1026
|
-
const de_WorkerConfigurationRevisionSummary = (output, context) => {
|
|
1027
|
-
return (0, smithy_client_1.take)(output, {
|
|
1028
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
1029
|
-
description: smithy_client_1.expectString,
|
|
1030
|
-
revision: smithy_client_1.expectLong,
|
|
1031
|
-
});
|
|
1032
|
-
};
|
|
1033
|
-
const de_WorkerConfigurationSummary = (output, context) => {
|
|
1034
|
-
return (0, smithy_client_1.take)(output, {
|
|
1035
|
-
creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
|
|
1036
|
-
description: smithy_client_1.expectString,
|
|
1037
|
-
latestRevision: (_) => de_WorkerConfigurationRevisionSummary(_, context),
|
|
1038
|
-
name: smithy_client_1.expectString,
|
|
1039
|
-
workerConfigurationArn: smithy_client_1.expectString,
|
|
1040
|
-
});
|
|
1041
|
-
};
|
|
1042
|
-
const deserializeMetadata = (output) => ({
|
|
1043
|
-
httpStatusCode: output.statusCode,
|
|
1044
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
1045
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
1046
|
-
cfId: output.headers["x-amz-cf-id"],
|
|
1047
|
-
});
|
|
1048
|
-
const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
|
|
1049
|
-
const isSerializableHeaderValue = (value) => value !== undefined &&
|
|
1050
|
-
value !== null &&
|
|
1051
|
-
value !== "" &&
|
|
1052
|
-
(!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
|
|
1053
|
-
(!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
|
|
1054
|
-
const _cNP = "connectorNamePrefix";
|
|
1055
|
-
const _cV = "currentVersion";
|
|
1056
|
-
const _mR = "maxResults";
|
|
1057
|
-
const _nT = "nextToken";
|
|
1058
|
-
const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
|
|
1059
|
-
if (encoded.length) {
|
|
1060
|
-
return JSON.parse(encoded);
|
|
1061
|
-
}
|
|
1062
|
-
return {};
|
|
1063
|
-
});
|
|
1064
|
-
const parseErrorBody = async (errorBody, context) => {
|
|
1065
|
-
const value = await parseBody(errorBody, context);
|
|
1066
|
-
value.message = value.message ?? value.Message;
|
|
1067
|
-
return value;
|
|
1068
|
-
};
|
|
1069
|
-
const loadRestJsonErrorCode = (output, data) => {
|
|
1070
|
-
const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
|
|
1071
|
-
const sanitizeErrorCode = (rawValue) => {
|
|
1072
|
-
let cleanValue = rawValue;
|
|
1073
|
-
if (typeof cleanValue === "number") {
|
|
1074
|
-
cleanValue = cleanValue.toString();
|
|
1075
|
-
}
|
|
1076
|
-
if (cleanValue.indexOf(",") >= 0) {
|
|
1077
|
-
cleanValue = cleanValue.split(",")[0];
|
|
1078
|
-
}
|
|
1079
|
-
if (cleanValue.indexOf(":") >= 0) {
|
|
1080
|
-
cleanValue = cleanValue.split(":")[0];
|
|
1081
|
-
}
|
|
1082
|
-
if (cleanValue.indexOf("#") >= 0) {
|
|
1083
|
-
cleanValue = cleanValue.split("#")[1];
|
|
1084
|
-
}
|
|
1085
|
-
return cleanValue;
|
|
1086
|
-
};
|
|
1087
|
-
const headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
1088
|
-
if (headerKey !== undefined) {
|
|
1089
|
-
return sanitizeErrorCode(output.headers[headerKey]);
|
|
1090
|
-
}
|
|
1091
|
-
if (data.code !== undefined) {
|
|
1092
|
-
return sanitizeErrorCode(data.code);
|
|
1093
|
-
}
|
|
1094
|
-
if (data["__type"] !== undefined) {
|
|
1095
|
-
return sanitizeErrorCode(data["__type"]);
|
|
1096
|
-
}
|
|
1097
|
-
};
|
|
1
|
+
module.exports = require("../index.js");
|