@aws-sdk/client-amp 3.454.0 → 3.458.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/README.md +68 -28
- package/dist-cjs/Amp.js +10 -0
- package/dist-cjs/commands/CreateScraperCommand.js +51 -0
- package/dist-cjs/commands/DeleteScraperCommand.js +51 -0
- package/dist-cjs/commands/DescribeScraperCommand.js +51 -0
- package/dist-cjs/commands/GetDefaultScraperConfigurationCommand.js +51 -0
- package/dist-cjs/commands/ListScrapersCommand.js +51 -0
- package/dist-cjs/commands/index.js +5 -0
- package/dist-cjs/models/models_0.js +32 -1
- package/dist-cjs/pagination/ListScrapersPaginator.js +29 -0
- package/dist-cjs/pagination/index.js +1 -0
- package/dist-cjs/protocols/Aws_restJson1.js +396 -1
- package/dist-cjs/waiters/index.js +2 -0
- package/dist-cjs/waiters/waitForScraperActive.js +45 -0
- package/dist-cjs/waiters/waitForScraperDeleted.js +39 -0
- package/dist-es/Amp.js +10 -0
- package/dist-es/commands/CreateScraperCommand.js +47 -0
- package/dist-es/commands/DeleteScraperCommand.js +47 -0
- package/dist-es/commands/DescribeScraperCommand.js +47 -0
- package/dist-es/commands/GetDefaultScraperConfigurationCommand.js +47 -0
- package/dist-es/commands/ListScrapersCommand.js +47 -0
- package/dist-es/commands/index.js +5 -0
- package/dist-es/models/models_0.js +31 -0
- package/dist-es/pagination/ListScrapersPaginator.js +25 -0
- package/dist-es/pagination/index.js +1 -0
- package/dist-es/protocols/Aws_restJson1.js +386 -2
- package/dist-es/waiters/index.js +2 -0
- package/dist-es/waiters/waitForScraperActive.js +40 -0
- package/dist-es/waiters/waitForScraperDeleted.js +34 -0
- package/dist-types/Amp.d.ts +35 -0
- package/dist-types/AmpClient.d.ts +7 -2
- package/dist-types/commands/CreateScraperCommand.d.ts +124 -0
- package/dist-types/commands/DeleteScraperCommand.d.ts +95 -0
- package/dist-types/commands/DescribeScraperCommand.d.ts +121 -0
- package/dist-types/commands/GetDefaultScraperConfigurationCommand.d.ts +80 -0
- package/dist-types/commands/ListScrapersCommand.d.ts +124 -0
- package/dist-types/commands/index.d.ts +5 -0
- package/dist-types/models/models_0.d.ts +460 -0
- package/dist-types/pagination/ListScrapersPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +1 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +45 -0
- package/dist-types/ts3.4/Amp.d.ts +85 -0
- package/dist-types/ts3.4/AmpClient.d.ts +30 -0
- package/dist-types/ts3.4/commands/CreateScraperCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/DeleteScraperCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/DescribeScraperCommand.d.ts +38 -0
- package/dist-types/ts3.4/commands/GetDefaultScraperConfigurationCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/ListScrapersCommand.d.ts +35 -0
- package/dist-types/ts3.4/commands/index.d.ts +5 -0
- package/dist-types/ts3.4/models/models_0.d.ts +140 -0
- package/dist-types/ts3.4/pagination/ListScrapersPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +1 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +60 -0
- package/dist-types/ts3.4/waiters/index.d.ts +2 -0
- package/dist-types/ts3.4/waiters/waitForScraperActive.d.ts +11 -0
- package/dist-types/ts3.4/waiters/waitForScraperDeleted.d.ts +11 -0
- package/dist-types/waiters/index.d.ts +2 -0
- package/dist-types/waiters/waitForScraperActive.d.ts +14 -0
- package/dist-types/waiters/waitForScraperDeleted.d.ts +14 -0
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RuleGroupsNamespaceStatusCode = exports.LoggingConfigurationStatusCode = exports.WorkspaceStatusCode = exports.ValidationException = exports.ValidationExceptionReason = exports.ThrottlingException = exports.ServiceQuotaExceededException = exports.ResourceNotFoundException = exports.InternalServerException = exports.AlertManagerDefinitionStatusCode = exports.ConflictException = exports.AccessDeniedException = void 0;
|
|
3
|
+
exports.RuleGroupsNamespaceStatusCode = exports.LoggingConfigurationStatusCode = exports.WorkspaceStatusCode = exports.ScraperStatusCode = exports.Source = exports.ScrapeConfiguration = exports.Destination = exports.ValidationException = exports.ValidationExceptionReason = exports.ThrottlingException = exports.ServiceQuotaExceededException = exports.ResourceNotFoundException = exports.InternalServerException = exports.AlertManagerDefinitionStatusCode = exports.ConflictException = exports.AccessDeniedException = void 0;
|
|
4
4
|
const AmpServiceException_1 = require("./AmpServiceException");
|
|
5
5
|
class AccessDeniedException extends AmpServiceException_1.AmpServiceException {
|
|
6
6
|
constructor(opts) {
|
|
@@ -123,6 +123,37 @@ class ValidationException extends AmpServiceException_1.AmpServiceException {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
exports.ValidationException = ValidationException;
|
|
126
|
+
var Destination;
|
|
127
|
+
(function (Destination) {
|
|
128
|
+
Destination.visit = (value, visitor) => {
|
|
129
|
+
if (value.ampConfiguration !== undefined)
|
|
130
|
+
return visitor.ampConfiguration(value.ampConfiguration);
|
|
131
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
132
|
+
};
|
|
133
|
+
})(Destination = exports.Destination || (exports.Destination = {}));
|
|
134
|
+
var ScrapeConfiguration;
|
|
135
|
+
(function (ScrapeConfiguration) {
|
|
136
|
+
ScrapeConfiguration.visit = (value, visitor) => {
|
|
137
|
+
if (value.configurationBlob !== undefined)
|
|
138
|
+
return visitor.configurationBlob(value.configurationBlob);
|
|
139
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
140
|
+
};
|
|
141
|
+
})(ScrapeConfiguration = exports.ScrapeConfiguration || (exports.ScrapeConfiguration = {}));
|
|
142
|
+
var Source;
|
|
143
|
+
(function (Source) {
|
|
144
|
+
Source.visit = (value, visitor) => {
|
|
145
|
+
if (value.eksConfiguration !== undefined)
|
|
146
|
+
return visitor.eksConfiguration(value.eksConfiguration);
|
|
147
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
148
|
+
};
|
|
149
|
+
})(Source = exports.Source || (exports.Source = {}));
|
|
150
|
+
exports.ScraperStatusCode = {
|
|
151
|
+
ACTIVE: "ACTIVE",
|
|
152
|
+
CREATING: "CREATING",
|
|
153
|
+
CREATION_FAILED: "CREATION_FAILED",
|
|
154
|
+
DELETING: "DELETING",
|
|
155
|
+
DELETION_FAILED: "DELETION_FAILED",
|
|
156
|
+
};
|
|
126
157
|
exports.WorkspaceStatusCode = {
|
|
127
158
|
ACTIVE: "ACTIVE",
|
|
128
159
|
CREATING: "CREATING",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paginateListScrapers = void 0;
|
|
4
|
+
const AmpClient_1 = require("../AmpClient");
|
|
5
|
+
const ListScrapersCommand_1 = require("../commands/ListScrapersCommand");
|
|
6
|
+
const makePagedClientRequest = async (client, input, ...args) => {
|
|
7
|
+
return await client.send(new ListScrapersCommand_1.ListScrapersCommand(input), ...args);
|
|
8
|
+
};
|
|
9
|
+
async function* paginateListScrapers(config, input, ...additionalArguments) {
|
|
10
|
+
let token = config.startingToken || undefined;
|
|
11
|
+
let hasNext = true;
|
|
12
|
+
let page;
|
|
13
|
+
while (hasNext) {
|
|
14
|
+
input.nextToken = token;
|
|
15
|
+
input["maxResults"] = config.pageSize;
|
|
16
|
+
if (config.client instanceof AmpClient_1.AmpClient) {
|
|
17
|
+
page = await makePagedClientRequest(config.client, input, ...additionalArguments);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
throw new Error("Invalid client, expected Amp | AmpClient");
|
|
21
|
+
}
|
|
22
|
+
yield page;
|
|
23
|
+
const prevToken = token;
|
|
24
|
+
token = page.nextToken;
|
|
25
|
+
hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
|
|
26
|
+
}
|
|
27
|
+
return undefined;
|
|
28
|
+
}
|
|
29
|
+
exports.paginateListScrapers = paginateListScrapers;
|
|
@@ -3,4 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./Interfaces"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./ListRuleGroupsNamespacesPaginator"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./ListScrapersPaginator"), exports);
|
|
6
7
|
tslib_1.__exportStar(require("./ListWorkspacesPaginator"), exports);
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_PutRuleGroupsNamespaceCommand = exports.de_PutAlertManagerDefinitionCommand = exports.de_ListWorkspacesCommand = exports.de_ListTagsForResourceCommand = exports.de_ListScrapersCommand = exports.de_ListRuleGroupsNamespacesCommand = exports.de_GetDefaultScraperConfigurationCommand = exports.de_DescribeWorkspaceCommand = exports.de_DescribeScraperCommand = exports.de_DescribeRuleGroupsNamespaceCommand = exports.de_DescribeLoggingConfigurationCommand = exports.de_DescribeAlertManagerDefinitionCommand = exports.de_DeleteWorkspaceCommand = exports.de_DeleteScraperCommand = exports.de_DeleteRuleGroupsNamespaceCommand = exports.de_DeleteLoggingConfigurationCommand = exports.de_DeleteAlertManagerDefinitionCommand = exports.de_CreateWorkspaceCommand = exports.de_CreateScraperCommand = exports.de_CreateRuleGroupsNamespaceCommand = exports.de_CreateLoggingConfigurationCommand = exports.de_CreateAlertManagerDefinitionCommand = exports.se_UpdateWorkspaceAliasCommand = exports.se_UpdateLoggingConfigurationCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_PutRuleGroupsNamespaceCommand = exports.se_PutAlertManagerDefinitionCommand = exports.se_ListWorkspacesCommand = exports.se_ListTagsForResourceCommand = exports.se_ListScrapersCommand = exports.se_ListRuleGroupsNamespacesCommand = exports.se_GetDefaultScraperConfigurationCommand = exports.se_DescribeWorkspaceCommand = exports.se_DescribeScraperCommand = exports.se_DescribeRuleGroupsNamespaceCommand = exports.se_DescribeLoggingConfigurationCommand = exports.se_DescribeAlertManagerDefinitionCommand = exports.se_DeleteWorkspaceCommand = exports.se_DeleteScraperCommand = exports.se_DeleteRuleGroupsNamespaceCommand = exports.se_DeleteLoggingConfigurationCommand = exports.se_DeleteAlertManagerDefinitionCommand = exports.se_CreateWorkspaceCommand = exports.se_CreateScraperCommand = exports.se_CreateRuleGroupsNamespaceCommand = exports.se_CreateLoggingConfigurationCommand = exports.se_CreateAlertManagerDefinitionCommand = void 0;
|
|
4
|
+
exports.de_UpdateWorkspaceAliasCommand = exports.de_UpdateLoggingConfigurationCommand = void 0;
|
|
5
|
+
const core_1 = require("@aws-sdk/core");
|
|
4
6
|
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
7
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
8
|
const uuid_1 = require("uuid");
|
|
@@ -79,6 +81,32 @@ const se_CreateRuleGroupsNamespaceCommand = async (input, context) => {
|
|
|
79
81
|
});
|
|
80
82
|
};
|
|
81
83
|
exports.se_CreateRuleGroupsNamespaceCommand = se_CreateRuleGroupsNamespaceCommand;
|
|
84
|
+
const se_CreateScraperCommand = async (input, context) => {
|
|
85
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
86
|
+
const headers = {
|
|
87
|
+
"content-type": "application/json",
|
|
88
|
+
};
|
|
89
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scrapers";
|
|
90
|
+
let body;
|
|
91
|
+
body = JSON.stringify((0, smithy_client_1.take)(input, {
|
|
92
|
+
alias: [],
|
|
93
|
+
clientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
|
|
94
|
+
destination: (_) => (0, smithy_client_1._json)(_),
|
|
95
|
+
scrapeConfiguration: (_) => se_ScrapeConfiguration(_, context),
|
|
96
|
+
source: (_) => (0, smithy_client_1._json)(_),
|
|
97
|
+
tags: (_) => (0, smithy_client_1._json)(_),
|
|
98
|
+
}));
|
|
99
|
+
return new protocol_http_1.HttpRequest({
|
|
100
|
+
protocol,
|
|
101
|
+
hostname,
|
|
102
|
+
port,
|
|
103
|
+
method: "POST",
|
|
104
|
+
headers,
|
|
105
|
+
path: resolvedPath,
|
|
106
|
+
body,
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
exports.se_CreateScraperCommand = se_CreateScraperCommand;
|
|
82
110
|
const se_CreateWorkspaceCommand = async (input, context) => {
|
|
83
111
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
84
112
|
const headers = {
|
|
@@ -168,6 +196,27 @@ const se_DeleteRuleGroupsNamespaceCommand = async (input, context) => {
|
|
|
168
196
|
});
|
|
169
197
|
};
|
|
170
198
|
exports.se_DeleteRuleGroupsNamespaceCommand = se_DeleteRuleGroupsNamespaceCommand;
|
|
199
|
+
const se_DeleteScraperCommand = async (input, context) => {
|
|
200
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
201
|
+
const headers = {};
|
|
202
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scrapers/{scraperId}";
|
|
203
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "scraperId", () => input.scraperId, "{scraperId}", false);
|
|
204
|
+
const query = (0, smithy_client_1.map)({
|
|
205
|
+
clientToken: [, input.clientToken ?? (0, uuid_1.v4)()],
|
|
206
|
+
});
|
|
207
|
+
let body;
|
|
208
|
+
return new protocol_http_1.HttpRequest({
|
|
209
|
+
protocol,
|
|
210
|
+
hostname,
|
|
211
|
+
port,
|
|
212
|
+
method: "DELETE",
|
|
213
|
+
headers,
|
|
214
|
+
path: resolvedPath,
|
|
215
|
+
query,
|
|
216
|
+
body,
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
exports.se_DeleteScraperCommand = se_DeleteScraperCommand;
|
|
171
220
|
const se_DeleteWorkspaceCommand = async (input, context) => {
|
|
172
221
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
173
222
|
const headers = {};
|
|
@@ -243,6 +292,23 @@ const se_DescribeRuleGroupsNamespaceCommand = async (input, context) => {
|
|
|
243
292
|
});
|
|
244
293
|
};
|
|
245
294
|
exports.se_DescribeRuleGroupsNamespaceCommand = se_DescribeRuleGroupsNamespaceCommand;
|
|
295
|
+
const se_DescribeScraperCommand = async (input, context) => {
|
|
296
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
297
|
+
const headers = {};
|
|
298
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scrapers/{scraperId}";
|
|
299
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "scraperId", () => input.scraperId, "{scraperId}", false);
|
|
300
|
+
let body;
|
|
301
|
+
return new protocol_http_1.HttpRequest({
|
|
302
|
+
protocol,
|
|
303
|
+
hostname,
|
|
304
|
+
port,
|
|
305
|
+
method: "GET",
|
|
306
|
+
headers,
|
|
307
|
+
path: resolvedPath,
|
|
308
|
+
body,
|
|
309
|
+
});
|
|
310
|
+
};
|
|
311
|
+
exports.se_DescribeScraperCommand = se_DescribeScraperCommand;
|
|
246
312
|
const se_DescribeWorkspaceCommand = async (input, context) => {
|
|
247
313
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
248
314
|
const headers = {};
|
|
@@ -260,6 +326,25 @@ const se_DescribeWorkspaceCommand = async (input, context) => {
|
|
|
260
326
|
});
|
|
261
327
|
};
|
|
262
328
|
exports.se_DescribeWorkspaceCommand = se_DescribeWorkspaceCommand;
|
|
329
|
+
const se_GetDefaultScraperConfigurationCommand = async (input, context) => {
|
|
330
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
331
|
+
const headers = {
|
|
332
|
+
"content-type": "application/json",
|
|
333
|
+
};
|
|
334
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scraperconfiguration";
|
|
335
|
+
let body;
|
|
336
|
+
body = "";
|
|
337
|
+
return new protocol_http_1.HttpRequest({
|
|
338
|
+
protocol,
|
|
339
|
+
hostname,
|
|
340
|
+
port,
|
|
341
|
+
method: "GET",
|
|
342
|
+
headers,
|
|
343
|
+
path: resolvedPath,
|
|
344
|
+
body,
|
|
345
|
+
});
|
|
346
|
+
};
|
|
347
|
+
exports.se_GetDefaultScraperConfigurationCommand = se_GetDefaultScraperConfigurationCommand;
|
|
263
348
|
const se_ListRuleGroupsNamespacesCommand = async (input, context) => {
|
|
264
349
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
265
350
|
const headers = {};
|
|
@@ -284,6 +369,28 @@ const se_ListRuleGroupsNamespacesCommand = async (input, context) => {
|
|
|
284
369
|
});
|
|
285
370
|
};
|
|
286
371
|
exports.se_ListRuleGroupsNamespacesCommand = se_ListRuleGroupsNamespacesCommand;
|
|
372
|
+
const se_ListScrapersCommand = async (input, context) => {
|
|
373
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
374
|
+
const headers = {};
|
|
375
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scrapers";
|
|
376
|
+
const query = (0, smithy_client_1.map)({
|
|
377
|
+
...(0, smithy_client_1.convertMap)(input.filters),
|
|
378
|
+
nextToken: [, input.nextToken],
|
|
379
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
380
|
+
});
|
|
381
|
+
let body;
|
|
382
|
+
return new protocol_http_1.HttpRequest({
|
|
383
|
+
protocol,
|
|
384
|
+
hostname,
|
|
385
|
+
port,
|
|
386
|
+
method: "GET",
|
|
387
|
+
headers,
|
|
388
|
+
path: resolvedPath,
|
|
389
|
+
query,
|
|
390
|
+
body,
|
|
391
|
+
});
|
|
392
|
+
};
|
|
393
|
+
exports.se_ListScrapersCommand = se_ListScrapersCommand;
|
|
287
394
|
const se_ListTagsForResourceCommand = async (input, context) => {
|
|
288
395
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
289
396
|
const headers = {};
|
|
@@ -614,6 +721,61 @@ const de_CreateRuleGroupsNamespaceCommandError = async (output, context) => {
|
|
|
614
721
|
});
|
|
615
722
|
}
|
|
616
723
|
};
|
|
724
|
+
const de_CreateScraperCommand = async (output, context) => {
|
|
725
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
726
|
+
return de_CreateScraperCommandError(output, context);
|
|
727
|
+
}
|
|
728
|
+
const contents = (0, smithy_client_1.map)({
|
|
729
|
+
$metadata: deserializeMetadata(output),
|
|
730
|
+
});
|
|
731
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
732
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
733
|
+
arn: smithy_client_1.expectString,
|
|
734
|
+
scraperId: smithy_client_1.expectString,
|
|
735
|
+
status: smithy_client_1._json,
|
|
736
|
+
tags: smithy_client_1._json,
|
|
737
|
+
});
|
|
738
|
+
Object.assign(contents, doc);
|
|
739
|
+
return contents;
|
|
740
|
+
};
|
|
741
|
+
exports.de_CreateScraperCommand = de_CreateScraperCommand;
|
|
742
|
+
const de_CreateScraperCommandError = async (output, context) => {
|
|
743
|
+
const parsedOutput = {
|
|
744
|
+
...output,
|
|
745
|
+
body: await parseErrorBody(output.body, context),
|
|
746
|
+
};
|
|
747
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
748
|
+
switch (errorCode) {
|
|
749
|
+
case "AccessDeniedException":
|
|
750
|
+
case "com.amazonaws.amp#AccessDeniedException":
|
|
751
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
752
|
+
case "ConflictException":
|
|
753
|
+
case "com.amazonaws.amp#ConflictException":
|
|
754
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
755
|
+
case "InternalServerException":
|
|
756
|
+
case "com.amazonaws.amp#InternalServerException":
|
|
757
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
758
|
+
case "ResourceNotFoundException":
|
|
759
|
+
case "com.amazonaws.amp#ResourceNotFoundException":
|
|
760
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
761
|
+
case "ServiceQuotaExceededException":
|
|
762
|
+
case "com.amazonaws.amp#ServiceQuotaExceededException":
|
|
763
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
764
|
+
case "ThrottlingException":
|
|
765
|
+
case "com.amazonaws.amp#ThrottlingException":
|
|
766
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
767
|
+
case "ValidationException":
|
|
768
|
+
case "com.amazonaws.amp#ValidationException":
|
|
769
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
770
|
+
default:
|
|
771
|
+
const parsedBody = parsedOutput.body;
|
|
772
|
+
return throwDefaultError({
|
|
773
|
+
output,
|
|
774
|
+
parsedBody,
|
|
775
|
+
errorCode,
|
|
776
|
+
});
|
|
777
|
+
}
|
|
778
|
+
};
|
|
617
779
|
const de_CreateWorkspaceCommand = async (output, context) => {
|
|
618
780
|
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
619
781
|
return de_CreateWorkspaceCommandError(output, context);
|
|
@@ -798,6 +960,56 @@ const de_DeleteRuleGroupsNamespaceCommandError = async (output, context) => {
|
|
|
798
960
|
});
|
|
799
961
|
}
|
|
800
962
|
};
|
|
963
|
+
const de_DeleteScraperCommand = async (output, context) => {
|
|
964
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
965
|
+
return de_DeleteScraperCommandError(output, context);
|
|
966
|
+
}
|
|
967
|
+
const contents = (0, smithy_client_1.map)({
|
|
968
|
+
$metadata: deserializeMetadata(output),
|
|
969
|
+
});
|
|
970
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
971
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
972
|
+
scraperId: smithy_client_1.expectString,
|
|
973
|
+
status: smithy_client_1._json,
|
|
974
|
+
});
|
|
975
|
+
Object.assign(contents, doc);
|
|
976
|
+
return contents;
|
|
977
|
+
};
|
|
978
|
+
exports.de_DeleteScraperCommand = de_DeleteScraperCommand;
|
|
979
|
+
const de_DeleteScraperCommandError = async (output, context) => {
|
|
980
|
+
const parsedOutput = {
|
|
981
|
+
...output,
|
|
982
|
+
body: await parseErrorBody(output.body, context),
|
|
983
|
+
};
|
|
984
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
985
|
+
switch (errorCode) {
|
|
986
|
+
case "AccessDeniedException":
|
|
987
|
+
case "com.amazonaws.amp#AccessDeniedException":
|
|
988
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
989
|
+
case "ConflictException":
|
|
990
|
+
case "com.amazonaws.amp#ConflictException":
|
|
991
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
992
|
+
case "InternalServerException":
|
|
993
|
+
case "com.amazonaws.amp#InternalServerException":
|
|
994
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
995
|
+
case "ResourceNotFoundException":
|
|
996
|
+
case "com.amazonaws.amp#ResourceNotFoundException":
|
|
997
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
998
|
+
case "ThrottlingException":
|
|
999
|
+
case "com.amazonaws.amp#ThrottlingException":
|
|
1000
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
1001
|
+
case "ValidationException":
|
|
1002
|
+
case "com.amazonaws.amp#ValidationException":
|
|
1003
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1004
|
+
default:
|
|
1005
|
+
const parsedBody = parsedOutput.body;
|
|
1006
|
+
return throwDefaultError({
|
|
1007
|
+
output,
|
|
1008
|
+
parsedBody,
|
|
1009
|
+
errorCode,
|
|
1010
|
+
});
|
|
1011
|
+
}
|
|
1012
|
+
};
|
|
801
1013
|
const de_DeleteWorkspaceCommand = async (output, context) => {
|
|
802
1014
|
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
803
1015
|
return de_DeleteWorkspaceCommandError(output, context);
|
|
@@ -978,6 +1190,52 @@ const de_DescribeRuleGroupsNamespaceCommandError = async (output, context) => {
|
|
|
978
1190
|
});
|
|
979
1191
|
}
|
|
980
1192
|
};
|
|
1193
|
+
const de_DescribeScraperCommand = async (output, context) => {
|
|
1194
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1195
|
+
return de_DescribeScraperCommandError(output, context);
|
|
1196
|
+
}
|
|
1197
|
+
const contents = (0, smithy_client_1.map)({
|
|
1198
|
+
$metadata: deserializeMetadata(output),
|
|
1199
|
+
});
|
|
1200
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
1201
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
1202
|
+
scraper: (_) => de_ScraperDescription(_, context),
|
|
1203
|
+
});
|
|
1204
|
+
Object.assign(contents, doc);
|
|
1205
|
+
return contents;
|
|
1206
|
+
};
|
|
1207
|
+
exports.de_DescribeScraperCommand = de_DescribeScraperCommand;
|
|
1208
|
+
const de_DescribeScraperCommandError = async (output, context) => {
|
|
1209
|
+
const parsedOutput = {
|
|
1210
|
+
...output,
|
|
1211
|
+
body: await parseErrorBody(output.body, context),
|
|
1212
|
+
};
|
|
1213
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1214
|
+
switch (errorCode) {
|
|
1215
|
+
case "AccessDeniedException":
|
|
1216
|
+
case "com.amazonaws.amp#AccessDeniedException":
|
|
1217
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1218
|
+
case "InternalServerException":
|
|
1219
|
+
case "com.amazonaws.amp#InternalServerException":
|
|
1220
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
1221
|
+
case "ResourceNotFoundException":
|
|
1222
|
+
case "com.amazonaws.amp#ResourceNotFoundException":
|
|
1223
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1224
|
+
case "ThrottlingException":
|
|
1225
|
+
case "com.amazonaws.amp#ThrottlingException":
|
|
1226
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
1227
|
+
case "ValidationException":
|
|
1228
|
+
case "com.amazonaws.amp#ValidationException":
|
|
1229
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1230
|
+
default:
|
|
1231
|
+
const parsedBody = parsedOutput.body;
|
|
1232
|
+
return throwDefaultError({
|
|
1233
|
+
output,
|
|
1234
|
+
parsedBody,
|
|
1235
|
+
errorCode,
|
|
1236
|
+
});
|
|
1237
|
+
}
|
|
1238
|
+
};
|
|
981
1239
|
const de_DescribeWorkspaceCommand = async (output, context) => {
|
|
982
1240
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
983
1241
|
return de_DescribeWorkspaceCommandError(output, context);
|
|
@@ -1024,6 +1282,46 @@ const de_DescribeWorkspaceCommandError = async (output, context) => {
|
|
|
1024
1282
|
});
|
|
1025
1283
|
}
|
|
1026
1284
|
};
|
|
1285
|
+
const de_GetDefaultScraperConfigurationCommand = async (output, context) => {
|
|
1286
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1287
|
+
return de_GetDefaultScraperConfigurationCommandError(output, context);
|
|
1288
|
+
}
|
|
1289
|
+
const contents = (0, smithy_client_1.map)({
|
|
1290
|
+
$metadata: deserializeMetadata(output),
|
|
1291
|
+
});
|
|
1292
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
1293
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
1294
|
+
configuration: context.base64Decoder,
|
|
1295
|
+
});
|
|
1296
|
+
Object.assign(contents, doc);
|
|
1297
|
+
return contents;
|
|
1298
|
+
};
|
|
1299
|
+
exports.de_GetDefaultScraperConfigurationCommand = de_GetDefaultScraperConfigurationCommand;
|
|
1300
|
+
const de_GetDefaultScraperConfigurationCommandError = async (output, context) => {
|
|
1301
|
+
const parsedOutput = {
|
|
1302
|
+
...output,
|
|
1303
|
+
body: await parseErrorBody(output.body, context),
|
|
1304
|
+
};
|
|
1305
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1306
|
+
switch (errorCode) {
|
|
1307
|
+
case "AccessDeniedException":
|
|
1308
|
+
case "com.amazonaws.amp#AccessDeniedException":
|
|
1309
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1310
|
+
case "InternalServerException":
|
|
1311
|
+
case "com.amazonaws.amp#InternalServerException":
|
|
1312
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
1313
|
+
case "ThrottlingException":
|
|
1314
|
+
case "com.amazonaws.amp#ThrottlingException":
|
|
1315
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
1316
|
+
default:
|
|
1317
|
+
const parsedBody = parsedOutput.body;
|
|
1318
|
+
return throwDefaultError({
|
|
1319
|
+
output,
|
|
1320
|
+
parsedBody,
|
|
1321
|
+
errorCode,
|
|
1322
|
+
});
|
|
1323
|
+
}
|
|
1324
|
+
};
|
|
1027
1325
|
const de_ListRuleGroupsNamespacesCommand = async (output, context) => {
|
|
1028
1326
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1029
1327
|
return de_ListRuleGroupsNamespacesCommandError(output, context);
|
|
@@ -1071,6 +1369,50 @@ const de_ListRuleGroupsNamespacesCommandError = async (output, context) => {
|
|
|
1071
1369
|
});
|
|
1072
1370
|
}
|
|
1073
1371
|
};
|
|
1372
|
+
const de_ListScrapersCommand = async (output, context) => {
|
|
1373
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1374
|
+
return de_ListScrapersCommandError(output, context);
|
|
1375
|
+
}
|
|
1376
|
+
const contents = (0, smithy_client_1.map)({
|
|
1377
|
+
$metadata: deserializeMetadata(output),
|
|
1378
|
+
});
|
|
1379
|
+
const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
|
|
1380
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
1381
|
+
nextToken: smithy_client_1.expectString,
|
|
1382
|
+
scrapers: (_) => de_ScraperSummaryList(_, context),
|
|
1383
|
+
});
|
|
1384
|
+
Object.assign(contents, doc);
|
|
1385
|
+
return contents;
|
|
1386
|
+
};
|
|
1387
|
+
exports.de_ListScrapersCommand = de_ListScrapersCommand;
|
|
1388
|
+
const de_ListScrapersCommandError = async (output, context) => {
|
|
1389
|
+
const parsedOutput = {
|
|
1390
|
+
...output,
|
|
1391
|
+
body: await parseErrorBody(output.body, context),
|
|
1392
|
+
};
|
|
1393
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1394
|
+
switch (errorCode) {
|
|
1395
|
+
case "AccessDeniedException":
|
|
1396
|
+
case "com.amazonaws.amp#AccessDeniedException":
|
|
1397
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1398
|
+
case "InternalServerException":
|
|
1399
|
+
case "com.amazonaws.amp#InternalServerException":
|
|
1400
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
1401
|
+
case "ThrottlingException":
|
|
1402
|
+
case "com.amazonaws.amp#ThrottlingException":
|
|
1403
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
1404
|
+
case "ValidationException":
|
|
1405
|
+
case "com.amazonaws.amp#ValidationException":
|
|
1406
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1407
|
+
default:
|
|
1408
|
+
const parsedBody = parsedOutput.body;
|
|
1409
|
+
return throwDefaultError({
|
|
1410
|
+
output,
|
|
1411
|
+
parsedBody,
|
|
1412
|
+
errorCode,
|
|
1413
|
+
});
|
|
1414
|
+
}
|
|
1415
|
+
};
|
|
1074
1416
|
const de_ListTagsForResourceCommand = async (output, context) => {
|
|
1075
1417
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1076
1418
|
return de_ListTagsForResourceCommandError(output, context);
|
|
@@ -1560,6 +1902,12 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
|
|
|
1560
1902
|
});
|
|
1561
1903
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
1562
1904
|
};
|
|
1905
|
+
const se_ScrapeConfiguration = (input, context) => {
|
|
1906
|
+
return models_0_1.ScrapeConfiguration.visit(input, {
|
|
1907
|
+
configurationBlob: (value) => ({ configurationBlob: context.base64Encoder(value) }),
|
|
1908
|
+
_: (name, value) => ({ name: value }),
|
|
1909
|
+
});
|
|
1910
|
+
};
|
|
1563
1911
|
const de_AlertManagerDefinitionDescription = (output, context) => {
|
|
1564
1912
|
return (0, smithy_client_1.take)(output, {
|
|
1565
1913
|
createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
@@ -1606,6 +1954,53 @@ const de_RuleGroupsNamespaceSummaryList = (output, context) => {
|
|
|
1606
1954
|
});
|
|
1607
1955
|
return retVal;
|
|
1608
1956
|
};
|
|
1957
|
+
const de_ScrapeConfiguration = (output, context) => {
|
|
1958
|
+
if (output.configurationBlob != null) {
|
|
1959
|
+
return {
|
|
1960
|
+
configurationBlob: context.base64Decoder(output.configurationBlob),
|
|
1961
|
+
};
|
|
1962
|
+
}
|
|
1963
|
+
return { $unknown: Object.entries(output)[0] };
|
|
1964
|
+
};
|
|
1965
|
+
const de_ScraperDescription = (output, context) => {
|
|
1966
|
+
return (0, smithy_client_1.take)(output, {
|
|
1967
|
+
alias: smithy_client_1.expectString,
|
|
1968
|
+
arn: smithy_client_1.expectString,
|
|
1969
|
+
createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1970
|
+
destination: (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
|
|
1971
|
+
lastModifiedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1972
|
+
roleArn: smithy_client_1.expectString,
|
|
1973
|
+
scrapeConfiguration: (_) => de_ScrapeConfiguration((0, core_1.awsExpectUnion)(_), context),
|
|
1974
|
+
scraperId: smithy_client_1.expectString,
|
|
1975
|
+
source: (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
|
|
1976
|
+
status: smithy_client_1._json,
|
|
1977
|
+
statusReason: smithy_client_1.expectString,
|
|
1978
|
+
tags: smithy_client_1._json,
|
|
1979
|
+
});
|
|
1980
|
+
};
|
|
1981
|
+
const de_ScraperSummary = (output, context) => {
|
|
1982
|
+
return (0, smithy_client_1.take)(output, {
|
|
1983
|
+
alias: smithy_client_1.expectString,
|
|
1984
|
+
arn: smithy_client_1.expectString,
|
|
1985
|
+
createdAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1986
|
+
destination: (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
|
|
1987
|
+
lastModifiedAt: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(_))),
|
|
1988
|
+
roleArn: smithy_client_1.expectString,
|
|
1989
|
+
scraperId: smithy_client_1.expectString,
|
|
1990
|
+
source: (_) => (0, smithy_client_1._json)((0, core_1.awsExpectUnion)(_)),
|
|
1991
|
+
status: smithy_client_1._json,
|
|
1992
|
+
statusReason: smithy_client_1.expectString,
|
|
1993
|
+
tags: smithy_client_1._json,
|
|
1994
|
+
});
|
|
1995
|
+
};
|
|
1996
|
+
const de_ScraperSummaryList = (output, context) => {
|
|
1997
|
+
const retVal = (output || [])
|
|
1998
|
+
.filter((e) => e != null)
|
|
1999
|
+
.map((entry) => {
|
|
2000
|
+
return de_ScraperSummary(entry, context);
|
|
2001
|
+
});
|
|
2002
|
+
return retVal;
|
|
2003
|
+
};
|
|
1609
2004
|
const de_WorkspaceDescription = (output, context) => {
|
|
1610
2005
|
return (0, smithy_client_1.take)(output, {
|
|
1611
2006
|
alias: smithy_client_1.expectString,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./waitForScraperActive"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./waitForScraperDeleted"), exports);
|
|
4
6
|
tslib_1.__exportStar(require("./waitForWorkspaceActive"), exports);
|
|
5
7
|
tslib_1.__exportStar(require("./waitForWorkspaceDeleted"), exports);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.waitUntilScraperActive = exports.waitForScraperActive = void 0;
|
|
4
|
+
const util_waiter_1 = require("@smithy/util-waiter");
|
|
5
|
+
const DescribeScraperCommand_1 = require("../commands/DescribeScraperCommand");
|
|
6
|
+
const checkState = async (client, input) => {
|
|
7
|
+
let reason;
|
|
8
|
+
try {
|
|
9
|
+
const result = await client.send(new DescribeScraperCommand_1.DescribeScraperCommand(input));
|
|
10
|
+
reason = result;
|
|
11
|
+
try {
|
|
12
|
+
const returnComparator = () => {
|
|
13
|
+
return result.scraper.status.statusCode;
|
|
14
|
+
};
|
|
15
|
+
if (returnComparator() === "ACTIVE") {
|
|
16
|
+
return { state: util_waiter_1.WaiterState.SUCCESS, reason };
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch (e) { }
|
|
20
|
+
try {
|
|
21
|
+
const returnComparator = () => {
|
|
22
|
+
return result.scraper.status.statusCode;
|
|
23
|
+
};
|
|
24
|
+
if (returnComparator() === "CREATION_FAILED") {
|
|
25
|
+
return { state: util_waiter_1.WaiterState.FAILURE, reason };
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch (e) { }
|
|
29
|
+
}
|
|
30
|
+
catch (exception) {
|
|
31
|
+
reason = exception;
|
|
32
|
+
}
|
|
33
|
+
return { state: util_waiter_1.WaiterState.RETRY, reason };
|
|
34
|
+
};
|
|
35
|
+
const waitForScraperActive = async (params, input) => {
|
|
36
|
+
const serviceDefaults = { minDelay: 2, maxDelay: 120 };
|
|
37
|
+
return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
|
|
38
|
+
};
|
|
39
|
+
exports.waitForScraperActive = waitForScraperActive;
|
|
40
|
+
const waitUntilScraperActive = async (params, input) => {
|
|
41
|
+
const serviceDefaults = { minDelay: 2, maxDelay: 120 };
|
|
42
|
+
const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
|
|
43
|
+
return (0, util_waiter_1.checkExceptions)(result);
|
|
44
|
+
};
|
|
45
|
+
exports.waitUntilScraperActive = waitUntilScraperActive;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.waitUntilScraperDeleted = exports.waitForScraperDeleted = void 0;
|
|
4
|
+
const util_waiter_1 = require("@smithy/util-waiter");
|
|
5
|
+
const DescribeScraperCommand_1 = require("../commands/DescribeScraperCommand");
|
|
6
|
+
const checkState = async (client, input) => {
|
|
7
|
+
let reason;
|
|
8
|
+
try {
|
|
9
|
+
const result = await client.send(new DescribeScraperCommand_1.DescribeScraperCommand(input));
|
|
10
|
+
reason = result;
|
|
11
|
+
try {
|
|
12
|
+
const returnComparator = () => {
|
|
13
|
+
return result.scraper.status.statusCode;
|
|
14
|
+
};
|
|
15
|
+
if (returnComparator() === "DELETION_FAILED") {
|
|
16
|
+
return { state: util_waiter_1.WaiterState.FAILURE, reason };
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
catch (e) { }
|
|
20
|
+
}
|
|
21
|
+
catch (exception) {
|
|
22
|
+
reason = exception;
|
|
23
|
+
if (exception.name && exception.name == "ResourceNotFoundException") {
|
|
24
|
+
return { state: util_waiter_1.WaiterState.SUCCESS, reason };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return { state: util_waiter_1.WaiterState.RETRY, reason };
|
|
28
|
+
};
|
|
29
|
+
const waitForScraperDeleted = async (params, input) => {
|
|
30
|
+
const serviceDefaults = { minDelay: 2, maxDelay: 120 };
|
|
31
|
+
return (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
|
|
32
|
+
};
|
|
33
|
+
exports.waitForScraperDeleted = waitForScraperDeleted;
|
|
34
|
+
const waitUntilScraperDeleted = async (params, input) => {
|
|
35
|
+
const serviceDefaults = { minDelay: 2, maxDelay: 120 };
|
|
36
|
+
const result = await (0, util_waiter_1.createWaiter)({ ...serviceDefaults, ...params }, input, checkState);
|
|
37
|
+
return (0, util_waiter_1.checkExceptions)(result);
|
|
38
|
+
};
|
|
39
|
+
exports.waitUntilScraperDeleted = waitUntilScraperDeleted;
|