@aws-sdk/client-dsql 3.893.0 → 3.895.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.
@@ -1,437 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateClusterCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_ListTagsForResourceCommand = exports.de_ListClustersCommand = exports.de_GetVpcEndpointServiceNameCommand = exports.de_GetClusterCommand = exports.de_DeleteClusterCommand = exports.de_CreateClusterCommand = exports.se_UpdateClusterCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_ListTagsForResourceCommand = exports.se_ListClustersCommand = exports.se_GetVpcEndpointServiceNameCommand = exports.se_GetClusterCommand = exports.se_DeleteClusterCommand = exports.se_CreateClusterCommand = void 0;
4
- const core_1 = require("@aws-sdk/core");
5
- const core_2 = require("@smithy/core");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const uuid_1 = require("uuid");
8
- const DSQLServiceException_1 = require("../models/DSQLServiceException");
9
- const models_0_1 = require("../models/models_0");
10
- const se_CreateClusterCommand = async (input, context) => {
11
- const b = (0, core_2.requestBuilder)(input, context);
12
- const headers = {
13
- "content-type": "application/json",
14
- };
15
- b.bp("/cluster");
16
- let body;
17
- body = JSON.stringify((0, smithy_client_1.take)(input, {
18
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
19
- deletionProtectionEnabled: [],
20
- kmsEncryptionKey: [],
21
- multiRegionProperties: (_) => (0, smithy_client_1._json)(_),
22
- tags: (_) => (0, smithy_client_1._json)(_),
23
- }));
24
- b.m("POST").h(headers).b(body);
25
- return b.build();
26
- };
27
- exports.se_CreateClusterCommand = se_CreateClusterCommand;
28
- const se_DeleteClusterCommand = async (input, context) => {
29
- const b = (0, core_2.requestBuilder)(input, context);
30
- const headers = {};
31
- b.bp("/cluster/{identifier}");
32
- b.p("identifier", () => input.identifier, "{identifier}", false);
33
- const query = (0, smithy_client_1.map)({
34
- [_ct]: [, input[_cT] ?? (0, uuid_1.v4)()],
35
- });
36
- let body;
37
- b.m("DELETE").h(headers).q(query).b(body);
38
- return b.build();
39
- };
40
- exports.se_DeleteClusterCommand = se_DeleteClusterCommand;
41
- const se_GetClusterCommand = async (input, context) => {
42
- const b = (0, core_2.requestBuilder)(input, context);
43
- const headers = {};
44
- b.bp("/cluster/{identifier}");
45
- b.p("identifier", () => input.identifier, "{identifier}", false);
46
- let body;
47
- b.m("GET").h(headers).b(body);
48
- return b.build();
49
- };
50
- exports.se_GetClusterCommand = se_GetClusterCommand;
51
- const se_GetVpcEndpointServiceNameCommand = async (input, context) => {
52
- const b = (0, core_2.requestBuilder)(input, context);
53
- const headers = {};
54
- b.bp("/clusters/{identifier}/vpc-endpoint-service-name");
55
- b.p("identifier", () => input.identifier, "{identifier}", false);
56
- let body;
57
- b.m("GET").h(headers).b(body);
58
- return b.build();
59
- };
60
- exports.se_GetVpcEndpointServiceNameCommand = se_GetVpcEndpointServiceNameCommand;
61
- const se_ListClustersCommand = async (input, context) => {
62
- const b = (0, core_2.requestBuilder)(input, context);
63
- const headers = {};
64
- b.bp("/cluster");
65
- const query = (0, smithy_client_1.map)({
66
- [_mr]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
67
- [_nt]: [, input[_nT]],
68
- });
69
- let body;
70
- b.m("GET").h(headers).q(query).b(body);
71
- return b.build();
72
- };
73
- exports.se_ListClustersCommand = se_ListClustersCommand;
74
- const se_ListTagsForResourceCommand = async (input, context) => {
75
- const b = (0, core_2.requestBuilder)(input, context);
76
- const headers = {};
77
- b.bp("/tags/{resourceArn}");
78
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
79
- let body;
80
- b.m("GET").h(headers).b(body);
81
- return b.build();
82
- };
83
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
84
- const se_TagResourceCommand = async (input, context) => {
85
- const b = (0, core_2.requestBuilder)(input, context);
86
- const headers = {
87
- "content-type": "application/json",
88
- };
89
- b.bp("/tags/{resourceArn}");
90
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
91
- let body;
92
- body = JSON.stringify((0, smithy_client_1.take)(input, {
93
- tags: (_) => (0, smithy_client_1._json)(_),
94
- }));
95
- b.m("POST").h(headers).b(body);
96
- return b.build();
97
- };
98
- exports.se_TagResourceCommand = se_TagResourceCommand;
99
- const se_UntagResourceCommand = async (input, context) => {
100
- const b = (0, core_2.requestBuilder)(input, context);
101
- const headers = {};
102
- b.bp("/tags/{resourceArn}");
103
- b.p("resourceArn", () => input.resourceArn, "{resourceArn}", false);
104
- const query = (0, smithy_client_1.map)({
105
- [_tK]: [(0, smithy_client_1.expectNonNull)(input.tagKeys, `tagKeys`) != null, () => input[_tK] || []],
106
- });
107
- let body;
108
- b.m("DELETE").h(headers).q(query).b(body);
109
- return b.build();
110
- };
111
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
112
- const se_UpdateClusterCommand = async (input, context) => {
113
- const b = (0, core_2.requestBuilder)(input, context);
114
- const headers = {
115
- "content-type": "application/json",
116
- };
117
- b.bp("/cluster/{identifier}");
118
- b.p("identifier", () => input.identifier, "{identifier}", false);
119
- let body;
120
- body = JSON.stringify((0, smithy_client_1.take)(input, {
121
- clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
122
- deletionProtectionEnabled: [],
123
- kmsEncryptionKey: [],
124
- multiRegionProperties: (_) => (0, smithy_client_1._json)(_),
125
- }));
126
- b.m("POST").h(headers).b(body);
127
- return b.build();
128
- };
129
- exports.se_UpdateClusterCommand = se_UpdateClusterCommand;
130
- const de_CreateClusterCommand = async (output, context) => {
131
- if (output.statusCode !== 200 && output.statusCode >= 300) {
132
- return de_CommandError(output, context);
133
- }
134
- const contents = (0, smithy_client_1.map)({
135
- $metadata: deserializeMetadata(output),
136
- });
137
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
138
- const doc = (0, smithy_client_1.take)(data, {
139
- arn: smithy_client_1.expectString,
140
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
141
- deletionProtectionEnabled: smithy_client_1.expectBoolean,
142
- encryptionDetails: smithy_client_1._json,
143
- identifier: smithy_client_1.expectString,
144
- multiRegionProperties: smithy_client_1._json,
145
- status: smithy_client_1.expectString,
146
- });
147
- Object.assign(contents, doc);
148
- return contents;
149
- };
150
- exports.de_CreateClusterCommand = de_CreateClusterCommand;
151
- const de_DeleteClusterCommand = async (output, context) => {
152
- if (output.statusCode !== 200 && output.statusCode >= 300) {
153
- return de_CommandError(output, context);
154
- }
155
- const contents = (0, smithy_client_1.map)({
156
- $metadata: deserializeMetadata(output),
157
- });
158
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
159
- const doc = (0, smithy_client_1.take)(data, {
160
- arn: smithy_client_1.expectString,
161
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
162
- identifier: smithy_client_1.expectString,
163
- status: smithy_client_1.expectString,
164
- });
165
- Object.assign(contents, doc);
166
- return contents;
167
- };
168
- exports.de_DeleteClusterCommand = de_DeleteClusterCommand;
169
- const de_GetClusterCommand = async (output, context) => {
170
- if (output.statusCode !== 200 && output.statusCode >= 300) {
171
- return de_CommandError(output, context);
172
- }
173
- const contents = (0, smithy_client_1.map)({
174
- $metadata: deserializeMetadata(output),
175
- });
176
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
177
- const doc = (0, smithy_client_1.take)(data, {
178
- arn: smithy_client_1.expectString,
179
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
180
- deletionProtectionEnabled: smithy_client_1.expectBoolean,
181
- encryptionDetails: smithy_client_1._json,
182
- identifier: smithy_client_1.expectString,
183
- multiRegionProperties: smithy_client_1._json,
184
- status: smithy_client_1.expectString,
185
- tags: smithy_client_1._json,
186
- });
187
- Object.assign(contents, doc);
188
- return contents;
189
- };
190
- exports.de_GetClusterCommand = de_GetClusterCommand;
191
- const de_GetVpcEndpointServiceNameCommand = async (output, context) => {
192
- if (output.statusCode !== 200 && output.statusCode >= 300) {
193
- return de_CommandError(output, context);
194
- }
195
- const contents = (0, smithy_client_1.map)({
196
- $metadata: deserializeMetadata(output),
197
- });
198
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
199
- const doc = (0, smithy_client_1.take)(data, {
200
- serviceName: smithy_client_1.expectString,
201
- });
202
- Object.assign(contents, doc);
203
- return contents;
204
- };
205
- exports.de_GetVpcEndpointServiceNameCommand = de_GetVpcEndpointServiceNameCommand;
206
- const de_ListClustersCommand = async (output, context) => {
207
- if (output.statusCode !== 200 && output.statusCode >= 300) {
208
- return de_CommandError(output, context);
209
- }
210
- const contents = (0, smithy_client_1.map)({
211
- $metadata: deserializeMetadata(output),
212
- });
213
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
214
- const doc = (0, smithy_client_1.take)(data, {
215
- clusters: smithy_client_1._json,
216
- nextToken: smithy_client_1.expectString,
217
- });
218
- Object.assign(contents, doc);
219
- return contents;
220
- };
221
- exports.de_ListClustersCommand = de_ListClustersCommand;
222
- const de_ListTagsForResourceCommand = async (output, context) => {
223
- if (output.statusCode !== 200 && output.statusCode >= 300) {
224
- return de_CommandError(output, context);
225
- }
226
- const contents = (0, smithy_client_1.map)({
227
- $metadata: deserializeMetadata(output),
228
- });
229
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
230
- const doc = (0, smithy_client_1.take)(data, {
231
- tags: smithy_client_1._json,
232
- });
233
- Object.assign(contents, doc);
234
- return contents;
235
- };
236
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
237
- const de_TagResourceCommand = async (output, context) => {
238
- if (output.statusCode !== 200 && output.statusCode >= 300) {
239
- return de_CommandError(output, context);
240
- }
241
- const contents = (0, smithy_client_1.map)({
242
- $metadata: deserializeMetadata(output),
243
- });
244
- await (0, smithy_client_1.collectBody)(output.body, context);
245
- return contents;
246
- };
247
- exports.de_TagResourceCommand = de_TagResourceCommand;
248
- const de_UntagResourceCommand = async (output, context) => {
249
- if (output.statusCode !== 200 && output.statusCode >= 300) {
250
- return de_CommandError(output, context);
251
- }
252
- const contents = (0, smithy_client_1.map)({
253
- $metadata: deserializeMetadata(output),
254
- });
255
- await (0, smithy_client_1.collectBody)(output.body, context);
256
- return contents;
257
- };
258
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
259
- const de_UpdateClusterCommand = async (output, context) => {
260
- if (output.statusCode !== 200 && output.statusCode >= 300) {
261
- return de_CommandError(output, context);
262
- }
263
- const contents = (0, smithy_client_1.map)({
264
- $metadata: deserializeMetadata(output),
265
- });
266
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await (0, core_1.parseJsonBody)(output.body, context)), "body");
267
- const doc = (0, smithy_client_1.take)(data, {
268
- arn: smithy_client_1.expectString,
269
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
270
- identifier: smithy_client_1.expectString,
271
- status: smithy_client_1.expectString,
272
- });
273
- Object.assign(contents, doc);
274
- return contents;
275
- };
276
- exports.de_UpdateClusterCommand = de_UpdateClusterCommand;
277
- const de_CommandError = async (output, context) => {
278
- const parsedOutput = {
279
- ...output,
280
- body: await (0, core_1.parseJsonErrorBody)(output.body, context),
281
- };
282
- const errorCode = (0, core_1.loadRestJsonErrorCode)(output, parsedOutput.body);
283
- switch (errorCode) {
284
- case "AccessDeniedException":
285
- case "com.amazonaws.dsql#AccessDeniedException":
286
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
287
- case "ConflictException":
288
- case "com.amazonaws.dsql#ConflictException":
289
- throw await de_ConflictExceptionRes(parsedOutput, context);
290
- case "InternalServerException":
291
- case "com.amazonaws.dsql#InternalServerException":
292
- throw await de_InternalServerExceptionRes(parsedOutput, context);
293
- case "ServiceQuotaExceededException":
294
- case "com.amazonaws.dsql#ServiceQuotaExceededException":
295
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
296
- case "ThrottlingException":
297
- case "com.amazonaws.dsql#ThrottlingException":
298
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
299
- case "ValidationException":
300
- case "com.amazonaws.dsql#ValidationException":
301
- throw await de_ValidationExceptionRes(parsedOutput, context);
302
- case "ResourceNotFoundException":
303
- case "com.amazonaws.dsql#ResourceNotFoundException":
304
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
305
- default:
306
- const parsedBody = parsedOutput.body;
307
- return throwDefaultError({
308
- output,
309
- parsedBody,
310
- errorCode,
311
- });
312
- }
313
- };
314
- const throwDefaultError = (0, smithy_client_1.withBaseException)(DSQLServiceException_1.DSQLServiceException);
315
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
316
- const contents = (0, smithy_client_1.map)({});
317
- const data = parsedOutput.body;
318
- const doc = (0, smithy_client_1.take)(data, {
319
- message: smithy_client_1.expectString,
320
- });
321
- Object.assign(contents, doc);
322
- const exception = new models_0_1.AccessDeniedException({
323
- $metadata: deserializeMetadata(parsedOutput),
324
- ...contents,
325
- });
326
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
327
- };
328
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
329
- const contents = (0, smithy_client_1.map)({});
330
- const data = parsedOutput.body;
331
- const doc = (0, smithy_client_1.take)(data, {
332
- message: smithy_client_1.expectString,
333
- resourceId: smithy_client_1.expectString,
334
- resourceType: smithy_client_1.expectString,
335
- });
336
- Object.assign(contents, doc);
337
- const exception = new models_0_1.ConflictException({
338
- $metadata: deserializeMetadata(parsedOutput),
339
- ...contents,
340
- });
341
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
342
- };
343
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
344
- const contents = (0, smithy_client_1.map)({
345
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
346
- });
347
- const data = parsedOutput.body;
348
- const doc = (0, smithy_client_1.take)(data, {
349
- message: smithy_client_1.expectString,
350
- });
351
- Object.assign(contents, doc);
352
- const exception = new models_0_1.InternalServerException({
353
- $metadata: deserializeMetadata(parsedOutput),
354
- ...contents,
355
- });
356
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
357
- };
358
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
359
- const contents = (0, smithy_client_1.map)({});
360
- const data = parsedOutput.body;
361
- const doc = (0, smithy_client_1.take)(data, {
362
- message: smithy_client_1.expectString,
363
- resourceId: smithy_client_1.expectString,
364
- resourceType: smithy_client_1.expectString,
365
- });
366
- Object.assign(contents, doc);
367
- const exception = new models_0_1.ResourceNotFoundException({
368
- $metadata: deserializeMetadata(parsedOutput),
369
- ...contents,
370
- });
371
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
372
- };
373
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
374
- const contents = (0, smithy_client_1.map)({});
375
- const data = parsedOutput.body;
376
- const doc = (0, smithy_client_1.take)(data, {
377
- message: smithy_client_1.expectString,
378
- quotaCode: smithy_client_1.expectString,
379
- resourceId: smithy_client_1.expectString,
380
- resourceType: smithy_client_1.expectString,
381
- serviceCode: smithy_client_1.expectString,
382
- });
383
- Object.assign(contents, doc);
384
- const exception = new models_0_1.ServiceQuotaExceededException({
385
- $metadata: deserializeMetadata(parsedOutput),
386
- ...contents,
387
- });
388
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
389
- };
390
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
391
- const contents = (0, smithy_client_1.map)({
392
- [_rAS]: [() => void 0 !== parsedOutput.headers[_ra], () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers[_ra])],
393
- });
394
- const data = parsedOutput.body;
395
- const doc = (0, smithy_client_1.take)(data, {
396
- message: smithy_client_1.expectString,
397
- quotaCode: smithy_client_1.expectString,
398
- serviceCode: smithy_client_1.expectString,
399
- });
400
- Object.assign(contents, doc);
401
- const exception = new models_0_1.ThrottlingException({
402
- $metadata: deserializeMetadata(parsedOutput),
403
- ...contents,
404
- });
405
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
406
- };
407
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
408
- const contents = (0, smithy_client_1.map)({});
409
- const data = parsedOutput.body;
410
- const doc = (0, smithy_client_1.take)(data, {
411
- fieldList: smithy_client_1._json,
412
- message: smithy_client_1.expectString,
413
- reason: smithy_client_1.expectString,
414
- });
415
- Object.assign(contents, doc);
416
- const exception = new models_0_1.ValidationException({
417
- $metadata: deserializeMetadata(parsedOutput),
418
- ...contents,
419
- });
420
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
421
- };
422
- const deserializeMetadata = (output) => ({
423
- httpStatusCode: output.statusCode,
424
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
425
- extendedRequestId: output.headers["x-amz-id-2"],
426
- cfId: output.headers["x-amz-cf-id"],
427
- });
428
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
429
- const _cT = "clientToken";
430
- const _ct = "client-token";
431
- const _mR = "maxResults";
432
- const _mr = "max-results";
433
- const _nT = "nextToken";
434
- const _nt = "next-token";
435
- const _rAS = "retryAfterSeconds";
436
- const _ra = "retry-after";
437
- const _tK = "tagKeys";
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.resolveRuntimeExtensions = void 0;
4
- const region_config_resolver_1 = require("@aws-sdk/region-config-resolver");
5
- const protocol_http_1 = require("@smithy/protocol-http");
6
- const smithy_client_1 = require("@smithy/smithy-client");
7
- const httpAuthExtensionConfiguration_1 = require("./auth/httpAuthExtensionConfiguration");
8
- const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
9
- const extensionConfiguration = Object.assign((0, region_config_resolver_1.getAwsRegionExtensionConfiguration)(runtimeConfig), (0, smithy_client_1.getDefaultExtensionConfiguration)(runtimeConfig), (0, protocol_http_1.getHttpHandlerExtensionConfiguration)(runtimeConfig), (0, httpAuthExtensionConfiguration_1.getHttpAuthExtensionConfiguration)(runtimeConfig));
10
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
11
- return Object.assign(runtimeConfig, (0, region_config_resolver_1.resolveAwsRegionExtensionConfiguration)(extensionConfiguration), (0, smithy_client_1.resolveDefaultRuntimeConfig)(extensionConfiguration), (0, protocol_http_1.resolveHttpHandlerRuntimeConfig)(extensionConfiguration), (0, httpAuthExtensionConfiguration_1.resolveHttpAuthRuntimeConfig)(extensionConfiguration));
12
- };
13
- exports.resolveRuntimeExtensions = resolveRuntimeExtensions;
@@ -1,5 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
4
- tslib_1.__exportStar(require("./waitForClusterActive"), exports);
5
- tslib_1.__exportStar(require("./waitForClusterNotExists"), exports);
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitUntilClusterActive = exports.waitForClusterActive = void 0;
4
- const util_waiter_1 = require("@smithy/util-waiter");
5
- const GetClusterCommand_1 = require("../commands/GetClusterCommand");
6
- const checkState = async (client, input) => {
7
- let reason;
8
- try {
9
- const result = await client.send(new GetClusterCommand_1.GetClusterCommand(input));
10
- reason = result;
11
- try {
12
- const returnComparator = () => {
13
- return result.status;
14
- };
15
- if (returnComparator() === "ACTIVE") {
16
- return { state: util_waiter_1.WaiterState.SUCCESS, reason };
17
- }
18
- }
19
- catch (e) { }
20
- }
21
- catch (exception) {
22
- reason = exception;
23
- }
24
- return { state: util_waiter_1.WaiterState.RETRY, reason };
25
- };
26
- const waitForClusterActive = async (params, input) => {
27
- const serviceDefaults = { minDelay: 2, maxDelay: 120 };
28
- return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
29
- };
30
- exports.waitForClusterActive = waitForClusterActive;
31
- const waitUntilClusterActive = async (params, input) => {
32
- const serviceDefaults = { minDelay: 2, maxDelay: 120 };
33
- const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
34
- return (0, util_waiter_1.checkExceptions)(result);
35
- };
36
- exports.waitUntilClusterActive = waitUntilClusterActive;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.waitUntilClusterNotExists = exports.waitForClusterNotExists = void 0;
4
- const util_waiter_1 = require("@smithy/util-waiter");
5
- const GetClusterCommand_1 = require("../commands/GetClusterCommand");
6
- const checkState = async (client, input) => {
7
- let reason;
8
- try {
9
- const result = await client.send(new GetClusterCommand_1.GetClusterCommand(input));
10
- reason = result;
11
- }
12
- catch (exception) {
13
- reason = exception;
14
- if (exception.name && exception.name == "ResourceNotFoundException") {
15
- return { state: util_waiter_1.WaiterState.SUCCESS, reason };
16
- }
17
- }
18
- return { state: util_waiter_1.WaiterState.RETRY, reason };
19
- };
20
- const waitForClusterNotExists = async (params, input) => {
21
- const serviceDefaults = { minDelay: 2, maxDelay: 120 };
22
- return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
23
- };
24
- exports.waitForClusterNotExists = waitForClusterNotExists;
25
- const waitUntilClusterNotExists = async (params, input) => {
26
- const serviceDefaults = { minDelay: 2, maxDelay: 120 };
27
- const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
28
- return (0, util_waiter_1.checkExceptions)(result);
29
- };
30
- exports.waitUntilClusterNotExists = waitUntilClusterNotExists;