@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.
Files changed (60) hide show
  1. package/README.md +68 -28
  2. package/dist-cjs/Amp.js +10 -0
  3. package/dist-cjs/commands/CreateScraperCommand.js +51 -0
  4. package/dist-cjs/commands/DeleteScraperCommand.js +51 -0
  5. package/dist-cjs/commands/DescribeScraperCommand.js +51 -0
  6. package/dist-cjs/commands/GetDefaultScraperConfigurationCommand.js +51 -0
  7. package/dist-cjs/commands/ListScrapersCommand.js +51 -0
  8. package/dist-cjs/commands/index.js +5 -0
  9. package/dist-cjs/models/models_0.js +32 -1
  10. package/dist-cjs/pagination/ListScrapersPaginator.js +29 -0
  11. package/dist-cjs/pagination/index.js +1 -0
  12. package/dist-cjs/protocols/Aws_restJson1.js +396 -1
  13. package/dist-cjs/waiters/index.js +2 -0
  14. package/dist-cjs/waiters/waitForScraperActive.js +45 -0
  15. package/dist-cjs/waiters/waitForScraperDeleted.js +39 -0
  16. package/dist-es/Amp.js +10 -0
  17. package/dist-es/commands/CreateScraperCommand.js +47 -0
  18. package/dist-es/commands/DeleteScraperCommand.js +47 -0
  19. package/dist-es/commands/DescribeScraperCommand.js +47 -0
  20. package/dist-es/commands/GetDefaultScraperConfigurationCommand.js +47 -0
  21. package/dist-es/commands/ListScrapersCommand.js +47 -0
  22. package/dist-es/commands/index.js +5 -0
  23. package/dist-es/models/models_0.js +31 -0
  24. package/dist-es/pagination/ListScrapersPaginator.js +25 -0
  25. package/dist-es/pagination/index.js +1 -0
  26. package/dist-es/protocols/Aws_restJson1.js +386 -2
  27. package/dist-es/waiters/index.js +2 -0
  28. package/dist-es/waiters/waitForScraperActive.js +40 -0
  29. package/dist-es/waiters/waitForScraperDeleted.js +34 -0
  30. package/dist-types/Amp.d.ts +35 -0
  31. package/dist-types/AmpClient.d.ts +7 -2
  32. package/dist-types/commands/CreateScraperCommand.d.ts +124 -0
  33. package/dist-types/commands/DeleteScraperCommand.d.ts +95 -0
  34. package/dist-types/commands/DescribeScraperCommand.d.ts +121 -0
  35. package/dist-types/commands/GetDefaultScraperConfigurationCommand.d.ts +80 -0
  36. package/dist-types/commands/ListScrapersCommand.d.ts +124 -0
  37. package/dist-types/commands/index.d.ts +5 -0
  38. package/dist-types/models/models_0.d.ts +460 -0
  39. package/dist-types/pagination/ListScrapersPaginator.d.ts +7 -0
  40. package/dist-types/pagination/index.d.ts +1 -0
  41. package/dist-types/protocols/Aws_restJson1.d.ts +45 -0
  42. package/dist-types/ts3.4/Amp.d.ts +85 -0
  43. package/dist-types/ts3.4/AmpClient.d.ts +30 -0
  44. package/dist-types/ts3.4/commands/CreateScraperCommand.d.ts +38 -0
  45. package/dist-types/ts3.4/commands/DeleteScraperCommand.d.ts +38 -0
  46. package/dist-types/ts3.4/commands/DescribeScraperCommand.d.ts +38 -0
  47. package/dist-types/ts3.4/commands/GetDefaultScraperConfigurationCommand.d.ts +42 -0
  48. package/dist-types/ts3.4/commands/ListScrapersCommand.d.ts +35 -0
  49. package/dist-types/ts3.4/commands/index.d.ts +5 -0
  50. package/dist-types/ts3.4/models/models_0.d.ts +140 -0
  51. package/dist-types/ts3.4/pagination/ListScrapersPaginator.d.ts +11 -0
  52. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  53. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +60 -0
  54. package/dist-types/ts3.4/waiters/index.d.ts +2 -0
  55. package/dist-types/ts3.4/waiters/waitForScraperActive.d.ts +11 -0
  56. package/dist-types/ts3.4/waiters/waitForScraperDeleted.d.ts +11 -0
  57. package/dist-types/waiters/index.d.ts +2 -0
  58. package/dist-types/waiters/waitForScraperActive.d.ts +14 -0
  59. package/dist-types/waiters/waitForScraperDeleted.d.ts +14 -0
  60. package/package.json +3 -3
@@ -1,8 +1,9 @@
1
+ import { awsExpectUnion as __expectUnion } from "@aws-sdk/core";
1
2
  import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
3
+ import { _json, collectBody, convertMap, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectNumber as __expectNumber, expectObject as __expectObject, expectString as __expectString, map, parseEpochTimestamp as __parseEpochTimestamp, resolvedPath as __resolvedPath, strictParseInt32 as __strictParseInt32, take, withBaseException, } from "@smithy/smithy-client";
3
4
  import { v4 as generateIdempotencyToken } from "uuid";
4
5
  import { AmpServiceException as __BaseException } from "../models/AmpServiceException";
5
- import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
+ import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ScrapeConfiguration, ServiceQuotaExceededException, ThrottlingException, ValidationException, } from "../models/models_0";
6
7
  export const se_CreateAlertManagerDefinitionCommand = async (input, context) => {
7
8
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
8
9
  const headers = {
@@ -73,6 +74,31 @@ export const se_CreateRuleGroupsNamespaceCommand = async (input, context) => {
73
74
  body,
74
75
  });
75
76
  };
77
+ export const se_CreateScraperCommand = async (input, context) => {
78
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
79
+ const headers = {
80
+ "content-type": "application/json",
81
+ };
82
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scrapers";
83
+ let body;
84
+ body = JSON.stringify(take(input, {
85
+ alias: [],
86
+ clientToken: [true, (_) => _ ?? generateIdempotencyToken()],
87
+ destination: (_) => _json(_),
88
+ scrapeConfiguration: (_) => se_ScrapeConfiguration(_, context),
89
+ source: (_) => _json(_),
90
+ tags: (_) => _json(_),
91
+ }));
92
+ return new __HttpRequest({
93
+ protocol,
94
+ hostname,
95
+ port,
96
+ method: "POST",
97
+ headers,
98
+ path: resolvedPath,
99
+ body,
100
+ });
101
+ };
76
102
  export const se_CreateWorkspaceCommand = async (input, context) => {
77
103
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
78
104
  const headers = {
@@ -158,6 +184,26 @@ export const se_DeleteRuleGroupsNamespaceCommand = async (input, context) => {
158
184
  body,
159
185
  });
160
186
  };
187
+ export const se_DeleteScraperCommand = async (input, context) => {
188
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
189
+ const headers = {};
190
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scrapers/{scraperId}";
191
+ resolvedPath = __resolvedPath(resolvedPath, input, "scraperId", () => input.scraperId, "{scraperId}", false);
192
+ const query = map({
193
+ clientToken: [, input.clientToken ?? generateIdempotencyToken()],
194
+ });
195
+ let body;
196
+ return new __HttpRequest({
197
+ protocol,
198
+ hostname,
199
+ port,
200
+ method: "DELETE",
201
+ headers,
202
+ path: resolvedPath,
203
+ query,
204
+ body,
205
+ });
206
+ };
161
207
  export const se_DeleteWorkspaceCommand = async (input, context) => {
162
208
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
163
209
  const headers = {};
@@ -229,6 +275,22 @@ export const se_DescribeRuleGroupsNamespaceCommand = async (input, context) => {
229
275
  body,
230
276
  });
231
277
  };
278
+ export const se_DescribeScraperCommand = async (input, context) => {
279
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
280
+ const headers = {};
281
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scrapers/{scraperId}";
282
+ resolvedPath = __resolvedPath(resolvedPath, input, "scraperId", () => input.scraperId, "{scraperId}", false);
283
+ let body;
284
+ return new __HttpRequest({
285
+ protocol,
286
+ hostname,
287
+ port,
288
+ method: "GET",
289
+ headers,
290
+ path: resolvedPath,
291
+ body,
292
+ });
293
+ };
232
294
  export const se_DescribeWorkspaceCommand = async (input, context) => {
233
295
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
234
296
  const headers = {};
@@ -245,6 +307,24 @@ export const se_DescribeWorkspaceCommand = async (input, context) => {
245
307
  body,
246
308
  });
247
309
  };
310
+ export const se_GetDefaultScraperConfigurationCommand = async (input, context) => {
311
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
312
+ const headers = {
313
+ "content-type": "application/json",
314
+ };
315
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scraperconfiguration";
316
+ let body;
317
+ body = "";
318
+ return new __HttpRequest({
319
+ protocol,
320
+ hostname,
321
+ port,
322
+ method: "GET",
323
+ headers,
324
+ path: resolvedPath,
325
+ body,
326
+ });
327
+ };
248
328
  export const se_ListRuleGroupsNamespacesCommand = async (input, context) => {
249
329
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
250
330
  const headers = {};
@@ -268,6 +348,27 @@ export const se_ListRuleGroupsNamespacesCommand = async (input, context) => {
268
348
  body,
269
349
  });
270
350
  };
351
+ export const se_ListScrapersCommand = async (input, context) => {
352
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
353
+ const headers = {};
354
+ const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/scrapers";
355
+ const query = map({
356
+ ...convertMap(input.filters),
357
+ nextToken: [, input.nextToken],
358
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
359
+ });
360
+ let body;
361
+ return new __HttpRequest({
362
+ protocol,
363
+ hostname,
364
+ port,
365
+ method: "GET",
366
+ headers,
367
+ path: resolvedPath,
368
+ query,
369
+ body,
370
+ });
371
+ };
271
372
  export const se_ListTagsForResourceCommand = async (input, context) => {
272
373
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
273
374
  const headers = {};
@@ -587,6 +688,60 @@ const de_CreateRuleGroupsNamespaceCommandError = async (output, context) => {
587
688
  });
588
689
  }
589
690
  };
691
+ export const de_CreateScraperCommand = async (output, context) => {
692
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
693
+ return de_CreateScraperCommandError(output, context);
694
+ }
695
+ const contents = map({
696
+ $metadata: deserializeMetadata(output),
697
+ });
698
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
699
+ const doc = take(data, {
700
+ arn: __expectString,
701
+ scraperId: __expectString,
702
+ status: _json,
703
+ tags: _json,
704
+ });
705
+ Object.assign(contents, doc);
706
+ return contents;
707
+ };
708
+ const de_CreateScraperCommandError = async (output, context) => {
709
+ const parsedOutput = {
710
+ ...output,
711
+ body: await parseErrorBody(output.body, context),
712
+ };
713
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
714
+ switch (errorCode) {
715
+ case "AccessDeniedException":
716
+ case "com.amazonaws.amp#AccessDeniedException":
717
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
718
+ case "ConflictException":
719
+ case "com.amazonaws.amp#ConflictException":
720
+ throw await de_ConflictExceptionRes(parsedOutput, context);
721
+ case "InternalServerException":
722
+ case "com.amazonaws.amp#InternalServerException":
723
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
724
+ case "ResourceNotFoundException":
725
+ case "com.amazonaws.amp#ResourceNotFoundException":
726
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
727
+ case "ServiceQuotaExceededException":
728
+ case "com.amazonaws.amp#ServiceQuotaExceededException":
729
+ throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
730
+ case "ThrottlingException":
731
+ case "com.amazonaws.amp#ThrottlingException":
732
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
733
+ case "ValidationException":
734
+ case "com.amazonaws.amp#ValidationException":
735
+ throw await de_ValidationExceptionRes(parsedOutput, context);
736
+ default:
737
+ const parsedBody = parsedOutput.body;
738
+ return throwDefaultError({
739
+ output,
740
+ parsedBody,
741
+ errorCode,
742
+ });
743
+ }
744
+ };
590
745
  export const de_CreateWorkspaceCommand = async (output, context) => {
591
746
  if (output.statusCode !== 202 && output.statusCode >= 300) {
592
747
  return de_CreateWorkspaceCommandError(output, context);
@@ -767,6 +922,55 @@ const de_DeleteRuleGroupsNamespaceCommandError = async (output, context) => {
767
922
  });
768
923
  }
769
924
  };
925
+ export const de_DeleteScraperCommand = async (output, context) => {
926
+ if (output.statusCode !== 202 && output.statusCode >= 300) {
927
+ return de_DeleteScraperCommandError(output, context);
928
+ }
929
+ const contents = map({
930
+ $metadata: deserializeMetadata(output),
931
+ });
932
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
933
+ const doc = take(data, {
934
+ scraperId: __expectString,
935
+ status: _json,
936
+ });
937
+ Object.assign(contents, doc);
938
+ return contents;
939
+ };
940
+ const de_DeleteScraperCommandError = async (output, context) => {
941
+ const parsedOutput = {
942
+ ...output,
943
+ body: await parseErrorBody(output.body, context),
944
+ };
945
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
946
+ switch (errorCode) {
947
+ case "AccessDeniedException":
948
+ case "com.amazonaws.amp#AccessDeniedException":
949
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
950
+ case "ConflictException":
951
+ case "com.amazonaws.amp#ConflictException":
952
+ throw await de_ConflictExceptionRes(parsedOutput, context);
953
+ case "InternalServerException":
954
+ case "com.amazonaws.amp#InternalServerException":
955
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
956
+ case "ResourceNotFoundException":
957
+ case "com.amazonaws.amp#ResourceNotFoundException":
958
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
959
+ case "ThrottlingException":
960
+ case "com.amazonaws.amp#ThrottlingException":
961
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
962
+ case "ValidationException":
963
+ case "com.amazonaws.amp#ValidationException":
964
+ throw await de_ValidationExceptionRes(parsedOutput, context);
965
+ default:
966
+ const parsedBody = parsedOutput.body;
967
+ return throwDefaultError({
968
+ output,
969
+ parsedBody,
970
+ errorCode,
971
+ });
972
+ }
973
+ };
770
974
  export const de_DeleteWorkspaceCommand = async (output, context) => {
771
975
  if (output.statusCode !== 202 && output.statusCode >= 300) {
772
976
  return de_DeleteWorkspaceCommandError(output, context);
@@ -943,6 +1147,51 @@ const de_DescribeRuleGroupsNamespaceCommandError = async (output, context) => {
943
1147
  });
944
1148
  }
945
1149
  };
1150
+ export const de_DescribeScraperCommand = async (output, context) => {
1151
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1152
+ return de_DescribeScraperCommandError(output, context);
1153
+ }
1154
+ const contents = map({
1155
+ $metadata: deserializeMetadata(output),
1156
+ });
1157
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1158
+ const doc = take(data, {
1159
+ scraper: (_) => de_ScraperDescription(_, context),
1160
+ });
1161
+ Object.assign(contents, doc);
1162
+ return contents;
1163
+ };
1164
+ const de_DescribeScraperCommandError = async (output, context) => {
1165
+ const parsedOutput = {
1166
+ ...output,
1167
+ body: await parseErrorBody(output.body, context),
1168
+ };
1169
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1170
+ switch (errorCode) {
1171
+ case "AccessDeniedException":
1172
+ case "com.amazonaws.amp#AccessDeniedException":
1173
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1174
+ case "InternalServerException":
1175
+ case "com.amazonaws.amp#InternalServerException":
1176
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1177
+ case "ResourceNotFoundException":
1178
+ case "com.amazonaws.amp#ResourceNotFoundException":
1179
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1180
+ case "ThrottlingException":
1181
+ case "com.amazonaws.amp#ThrottlingException":
1182
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1183
+ case "ValidationException":
1184
+ case "com.amazonaws.amp#ValidationException":
1185
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1186
+ default:
1187
+ const parsedBody = parsedOutput.body;
1188
+ return throwDefaultError({
1189
+ output,
1190
+ parsedBody,
1191
+ errorCode,
1192
+ });
1193
+ }
1194
+ };
946
1195
  export const de_DescribeWorkspaceCommand = async (output, context) => {
947
1196
  if (output.statusCode !== 200 && output.statusCode >= 300) {
948
1197
  return de_DescribeWorkspaceCommandError(output, context);
@@ -988,6 +1237,45 @@ const de_DescribeWorkspaceCommandError = async (output, context) => {
988
1237
  });
989
1238
  }
990
1239
  };
1240
+ export const de_GetDefaultScraperConfigurationCommand = async (output, context) => {
1241
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1242
+ return de_GetDefaultScraperConfigurationCommandError(output, context);
1243
+ }
1244
+ const contents = map({
1245
+ $metadata: deserializeMetadata(output),
1246
+ });
1247
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1248
+ const doc = take(data, {
1249
+ configuration: context.base64Decoder,
1250
+ });
1251
+ Object.assign(contents, doc);
1252
+ return contents;
1253
+ };
1254
+ const de_GetDefaultScraperConfigurationCommandError = async (output, context) => {
1255
+ const parsedOutput = {
1256
+ ...output,
1257
+ body: await parseErrorBody(output.body, context),
1258
+ };
1259
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1260
+ switch (errorCode) {
1261
+ case "AccessDeniedException":
1262
+ case "com.amazonaws.amp#AccessDeniedException":
1263
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1264
+ case "InternalServerException":
1265
+ case "com.amazonaws.amp#InternalServerException":
1266
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1267
+ case "ThrottlingException":
1268
+ case "com.amazonaws.amp#ThrottlingException":
1269
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1270
+ default:
1271
+ const parsedBody = parsedOutput.body;
1272
+ return throwDefaultError({
1273
+ output,
1274
+ parsedBody,
1275
+ errorCode,
1276
+ });
1277
+ }
1278
+ };
991
1279
  export const de_ListRuleGroupsNamespacesCommand = async (output, context) => {
992
1280
  if (output.statusCode !== 200 && output.statusCode >= 300) {
993
1281
  return de_ListRuleGroupsNamespacesCommandError(output, context);
@@ -1034,6 +1322,49 @@ const de_ListRuleGroupsNamespacesCommandError = async (output, context) => {
1034
1322
  });
1035
1323
  }
1036
1324
  };
1325
+ export const de_ListScrapersCommand = async (output, context) => {
1326
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
1327
+ return de_ListScrapersCommandError(output, context);
1328
+ }
1329
+ const contents = map({
1330
+ $metadata: deserializeMetadata(output),
1331
+ });
1332
+ const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
1333
+ const doc = take(data, {
1334
+ nextToken: __expectString,
1335
+ scrapers: (_) => de_ScraperSummaryList(_, context),
1336
+ });
1337
+ Object.assign(contents, doc);
1338
+ return contents;
1339
+ };
1340
+ const de_ListScrapersCommandError = async (output, context) => {
1341
+ const parsedOutput = {
1342
+ ...output,
1343
+ body: await parseErrorBody(output.body, context),
1344
+ };
1345
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1346
+ switch (errorCode) {
1347
+ case "AccessDeniedException":
1348
+ case "com.amazonaws.amp#AccessDeniedException":
1349
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1350
+ case "InternalServerException":
1351
+ case "com.amazonaws.amp#InternalServerException":
1352
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
1353
+ case "ThrottlingException":
1354
+ case "com.amazonaws.amp#ThrottlingException":
1355
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
1356
+ case "ValidationException":
1357
+ case "com.amazonaws.amp#ValidationException":
1358
+ throw await de_ValidationExceptionRes(parsedOutput, context);
1359
+ default:
1360
+ const parsedBody = parsedOutput.body;
1361
+ return throwDefaultError({
1362
+ output,
1363
+ parsedBody,
1364
+ errorCode,
1365
+ });
1366
+ }
1367
+ };
1037
1368
  export const de_ListTagsForResourceCommand = async (output, context) => {
1038
1369
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1039
1370
  return de_ListTagsForResourceCommandError(output, context);
@@ -1515,6 +1846,12 @@ const de_ValidationExceptionRes = async (parsedOutput, context) => {
1515
1846
  });
1516
1847
  return __decorateServiceException(exception, parsedOutput.body);
1517
1848
  };
1849
+ const se_ScrapeConfiguration = (input, context) => {
1850
+ return ScrapeConfiguration.visit(input, {
1851
+ configurationBlob: (value) => ({ configurationBlob: context.base64Encoder(value) }),
1852
+ _: (name, value) => ({ name: value }),
1853
+ });
1854
+ };
1518
1855
  const de_AlertManagerDefinitionDescription = (output, context) => {
1519
1856
  return take(output, {
1520
1857
  createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
@@ -1561,6 +1898,53 @@ const de_RuleGroupsNamespaceSummaryList = (output, context) => {
1561
1898
  });
1562
1899
  return retVal;
1563
1900
  };
1901
+ const de_ScrapeConfiguration = (output, context) => {
1902
+ if (output.configurationBlob != null) {
1903
+ return {
1904
+ configurationBlob: context.base64Decoder(output.configurationBlob),
1905
+ };
1906
+ }
1907
+ return { $unknown: Object.entries(output)[0] };
1908
+ };
1909
+ const de_ScraperDescription = (output, context) => {
1910
+ return take(output, {
1911
+ alias: __expectString,
1912
+ arn: __expectString,
1913
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1914
+ destination: (_) => _json(__expectUnion(_)),
1915
+ lastModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1916
+ roleArn: __expectString,
1917
+ scrapeConfiguration: (_) => de_ScrapeConfiguration(__expectUnion(_), context),
1918
+ scraperId: __expectString,
1919
+ source: (_) => _json(__expectUnion(_)),
1920
+ status: _json,
1921
+ statusReason: __expectString,
1922
+ tags: _json,
1923
+ });
1924
+ };
1925
+ const de_ScraperSummary = (output, context) => {
1926
+ return take(output, {
1927
+ alias: __expectString,
1928
+ arn: __expectString,
1929
+ createdAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1930
+ destination: (_) => _json(__expectUnion(_)),
1931
+ lastModifiedAt: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
1932
+ roleArn: __expectString,
1933
+ scraperId: __expectString,
1934
+ source: (_) => _json(__expectUnion(_)),
1935
+ status: _json,
1936
+ statusReason: __expectString,
1937
+ tags: _json,
1938
+ });
1939
+ };
1940
+ const de_ScraperSummaryList = (output, context) => {
1941
+ const retVal = (output || [])
1942
+ .filter((e) => e != null)
1943
+ .map((entry) => {
1944
+ return de_ScraperSummary(entry, context);
1945
+ });
1946
+ return retVal;
1947
+ };
1564
1948
  const de_WorkspaceDescription = (output, context) => {
1565
1949
  return take(output, {
1566
1950
  alias: __expectString,
@@ -1,2 +1,4 @@
1
+ export * from "./waitForScraperActive";
2
+ export * from "./waitForScraperDeleted";
1
3
  export * from "./waitForWorkspaceActive";
2
4
  export * from "./waitForWorkspaceDeleted";
@@ -0,0 +1,40 @@
1
+ import { checkExceptions, createWaiter, WaiterState } from "@smithy/util-waiter";
2
+ import { DescribeScraperCommand } from "../commands/DescribeScraperCommand";
3
+ const checkState = async (client, input) => {
4
+ let reason;
5
+ try {
6
+ const result = await client.send(new DescribeScraperCommand(input));
7
+ reason = result;
8
+ try {
9
+ const returnComparator = () => {
10
+ return result.scraper.status.statusCode;
11
+ };
12
+ if (returnComparator() === "ACTIVE") {
13
+ return { state: WaiterState.SUCCESS, reason };
14
+ }
15
+ }
16
+ catch (e) { }
17
+ try {
18
+ const returnComparator = () => {
19
+ return result.scraper.status.statusCode;
20
+ };
21
+ if (returnComparator() === "CREATION_FAILED") {
22
+ return { state: WaiterState.FAILURE, reason };
23
+ }
24
+ }
25
+ catch (e) { }
26
+ }
27
+ catch (exception) {
28
+ reason = exception;
29
+ }
30
+ return { state: WaiterState.RETRY, reason };
31
+ };
32
+ export const waitForScraperActive = async (params, input) => {
33
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
34
+ return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
35
+ };
36
+ export const waitUntilScraperActive = async (params, input) => {
37
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
38
+ const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
39
+ return checkExceptions(result);
40
+ };
@@ -0,0 +1,34 @@
1
+ import { checkExceptions, createWaiter, WaiterState } from "@smithy/util-waiter";
2
+ import { DescribeScraperCommand } from "../commands/DescribeScraperCommand";
3
+ const checkState = async (client, input) => {
4
+ let reason;
5
+ try {
6
+ const result = await client.send(new DescribeScraperCommand(input));
7
+ reason = result;
8
+ try {
9
+ const returnComparator = () => {
10
+ return result.scraper.status.statusCode;
11
+ };
12
+ if (returnComparator() === "DELETION_FAILED") {
13
+ return { state: WaiterState.FAILURE, reason };
14
+ }
15
+ }
16
+ catch (e) { }
17
+ }
18
+ catch (exception) {
19
+ reason = exception;
20
+ if (exception.name && exception.name == "ResourceNotFoundException") {
21
+ return { state: WaiterState.SUCCESS, reason };
22
+ }
23
+ }
24
+ return { state: WaiterState.RETRY, reason };
25
+ };
26
+ export const waitForScraperDeleted = async (params, input) => {
27
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
28
+ return createWaiter({ ...serviceDefaults, ...params }, input, checkState);
29
+ };
30
+ export const waitUntilScraperDeleted = async (params, input) => {
31
+ const serviceDefaults = { minDelay: 2, maxDelay: 120 };
32
+ const result = await createWaiter({ ...serviceDefaults, ...params }, input, checkState);
33
+ return checkExceptions(result);
34
+ };
@@ -3,16 +3,21 @@ import { AmpClient } from "./AmpClient";
3
3
  import { CreateAlertManagerDefinitionCommandInput, CreateAlertManagerDefinitionCommandOutput } from "./commands/CreateAlertManagerDefinitionCommand";
4
4
  import { CreateLoggingConfigurationCommandInput, CreateLoggingConfigurationCommandOutput } from "./commands/CreateLoggingConfigurationCommand";
5
5
  import { CreateRuleGroupsNamespaceCommandInput, CreateRuleGroupsNamespaceCommandOutput } from "./commands/CreateRuleGroupsNamespaceCommand";
6
+ import { CreateScraperCommandInput, CreateScraperCommandOutput } from "./commands/CreateScraperCommand";
6
7
  import { CreateWorkspaceCommandInput, CreateWorkspaceCommandOutput } from "./commands/CreateWorkspaceCommand";
7
8
  import { DeleteAlertManagerDefinitionCommandInput, DeleteAlertManagerDefinitionCommandOutput } from "./commands/DeleteAlertManagerDefinitionCommand";
8
9
  import { DeleteLoggingConfigurationCommandInput, DeleteLoggingConfigurationCommandOutput } from "./commands/DeleteLoggingConfigurationCommand";
9
10
  import { DeleteRuleGroupsNamespaceCommandInput, DeleteRuleGroupsNamespaceCommandOutput } from "./commands/DeleteRuleGroupsNamespaceCommand";
11
+ import { DeleteScraperCommandInput, DeleteScraperCommandOutput } from "./commands/DeleteScraperCommand";
10
12
  import { DeleteWorkspaceCommandInput, DeleteWorkspaceCommandOutput } from "./commands/DeleteWorkspaceCommand";
11
13
  import { DescribeAlertManagerDefinitionCommandInput, DescribeAlertManagerDefinitionCommandOutput } from "./commands/DescribeAlertManagerDefinitionCommand";
12
14
  import { DescribeLoggingConfigurationCommandInput, DescribeLoggingConfigurationCommandOutput } from "./commands/DescribeLoggingConfigurationCommand";
13
15
  import { DescribeRuleGroupsNamespaceCommandInput, DescribeRuleGroupsNamespaceCommandOutput } from "./commands/DescribeRuleGroupsNamespaceCommand";
16
+ import { DescribeScraperCommandInput, DescribeScraperCommandOutput } from "./commands/DescribeScraperCommand";
14
17
  import { DescribeWorkspaceCommandInput, DescribeWorkspaceCommandOutput } from "./commands/DescribeWorkspaceCommand";
18
+ import { GetDefaultScraperConfigurationCommandInput, GetDefaultScraperConfigurationCommandOutput } from "./commands/GetDefaultScraperConfigurationCommand";
15
19
  import { ListRuleGroupsNamespacesCommandInput, ListRuleGroupsNamespacesCommandOutput } from "./commands/ListRuleGroupsNamespacesCommand";
20
+ import { ListScrapersCommandInput, ListScrapersCommandOutput } from "./commands/ListScrapersCommand";
16
21
  import { ListTagsForResourceCommandInput, ListTagsForResourceCommandOutput } from "./commands/ListTagsForResourceCommand";
17
22
  import { ListWorkspacesCommandInput, ListWorkspacesCommandOutput } from "./commands/ListWorkspacesCommand";
18
23
  import { PutAlertManagerDefinitionCommandInput, PutAlertManagerDefinitionCommandOutput } from "./commands/PutAlertManagerDefinitionCommand";
@@ -40,6 +45,12 @@ export interface Amp {
40
45
  createRuleGroupsNamespace(args: CreateRuleGroupsNamespaceCommandInput, options?: __HttpHandlerOptions): Promise<CreateRuleGroupsNamespaceCommandOutput>;
41
46
  createRuleGroupsNamespace(args: CreateRuleGroupsNamespaceCommandInput, cb: (err: any, data?: CreateRuleGroupsNamespaceCommandOutput) => void): void;
42
47
  createRuleGroupsNamespace(args: CreateRuleGroupsNamespaceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateRuleGroupsNamespaceCommandOutput) => void): void;
48
+ /**
49
+ * @see {@link CreateScraperCommand}
50
+ */
51
+ createScraper(args: CreateScraperCommandInput, options?: __HttpHandlerOptions): Promise<CreateScraperCommandOutput>;
52
+ createScraper(args: CreateScraperCommandInput, cb: (err: any, data?: CreateScraperCommandOutput) => void): void;
53
+ createScraper(args: CreateScraperCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: CreateScraperCommandOutput) => void): void;
43
54
  /**
44
55
  * @see {@link CreateWorkspaceCommand}
45
56
  */
@@ -64,6 +75,12 @@ export interface Amp {
64
75
  deleteRuleGroupsNamespace(args: DeleteRuleGroupsNamespaceCommandInput, options?: __HttpHandlerOptions): Promise<DeleteRuleGroupsNamespaceCommandOutput>;
65
76
  deleteRuleGroupsNamespace(args: DeleteRuleGroupsNamespaceCommandInput, cb: (err: any, data?: DeleteRuleGroupsNamespaceCommandOutput) => void): void;
66
77
  deleteRuleGroupsNamespace(args: DeleteRuleGroupsNamespaceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteRuleGroupsNamespaceCommandOutput) => void): void;
78
+ /**
79
+ * @see {@link DeleteScraperCommand}
80
+ */
81
+ deleteScraper(args: DeleteScraperCommandInput, options?: __HttpHandlerOptions): Promise<DeleteScraperCommandOutput>;
82
+ deleteScraper(args: DeleteScraperCommandInput, cb: (err: any, data?: DeleteScraperCommandOutput) => void): void;
83
+ deleteScraper(args: DeleteScraperCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DeleteScraperCommandOutput) => void): void;
67
84
  /**
68
85
  * @see {@link DeleteWorkspaceCommand}
69
86
  */
@@ -88,18 +105,36 @@ export interface Amp {
88
105
  describeRuleGroupsNamespace(args: DescribeRuleGroupsNamespaceCommandInput, options?: __HttpHandlerOptions): Promise<DescribeRuleGroupsNamespaceCommandOutput>;
89
106
  describeRuleGroupsNamespace(args: DescribeRuleGroupsNamespaceCommandInput, cb: (err: any, data?: DescribeRuleGroupsNamespaceCommandOutput) => void): void;
90
107
  describeRuleGroupsNamespace(args: DescribeRuleGroupsNamespaceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeRuleGroupsNamespaceCommandOutput) => void): void;
108
+ /**
109
+ * @see {@link DescribeScraperCommand}
110
+ */
111
+ describeScraper(args: DescribeScraperCommandInput, options?: __HttpHandlerOptions): Promise<DescribeScraperCommandOutput>;
112
+ describeScraper(args: DescribeScraperCommandInput, cb: (err: any, data?: DescribeScraperCommandOutput) => void): void;
113
+ describeScraper(args: DescribeScraperCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeScraperCommandOutput) => void): void;
91
114
  /**
92
115
  * @see {@link DescribeWorkspaceCommand}
93
116
  */
94
117
  describeWorkspace(args: DescribeWorkspaceCommandInput, options?: __HttpHandlerOptions): Promise<DescribeWorkspaceCommandOutput>;
95
118
  describeWorkspace(args: DescribeWorkspaceCommandInput, cb: (err: any, data?: DescribeWorkspaceCommandOutput) => void): void;
96
119
  describeWorkspace(args: DescribeWorkspaceCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: DescribeWorkspaceCommandOutput) => void): void;
120
+ /**
121
+ * @see {@link GetDefaultScraperConfigurationCommand}
122
+ */
123
+ getDefaultScraperConfiguration(args: GetDefaultScraperConfigurationCommandInput, options?: __HttpHandlerOptions): Promise<GetDefaultScraperConfigurationCommandOutput>;
124
+ getDefaultScraperConfiguration(args: GetDefaultScraperConfigurationCommandInput, cb: (err: any, data?: GetDefaultScraperConfigurationCommandOutput) => void): void;
125
+ getDefaultScraperConfiguration(args: GetDefaultScraperConfigurationCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: GetDefaultScraperConfigurationCommandOutput) => void): void;
97
126
  /**
98
127
  * @see {@link ListRuleGroupsNamespacesCommand}
99
128
  */
100
129
  listRuleGroupsNamespaces(args: ListRuleGroupsNamespacesCommandInput, options?: __HttpHandlerOptions): Promise<ListRuleGroupsNamespacesCommandOutput>;
101
130
  listRuleGroupsNamespaces(args: ListRuleGroupsNamespacesCommandInput, cb: (err: any, data?: ListRuleGroupsNamespacesCommandOutput) => void): void;
102
131
  listRuleGroupsNamespaces(args: ListRuleGroupsNamespacesCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListRuleGroupsNamespacesCommandOutput) => void): void;
132
+ /**
133
+ * @see {@link ListScrapersCommand}
134
+ */
135
+ listScrapers(args: ListScrapersCommandInput, options?: __HttpHandlerOptions): Promise<ListScrapersCommandOutput>;
136
+ listScrapers(args: ListScrapersCommandInput, cb: (err: any, data?: ListScrapersCommandOutput) => void): void;
137
+ listScrapers(args: ListScrapersCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: ListScrapersCommandOutput) => void): void;
103
138
  /**
104
139
  * @see {@link ListTagsForResourceCommand}
105
140
  */