@aws-sdk/client-internetmonitor 3.451.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 (44) hide show
  1. package/README.md +42 -10
  2. package/dist-cjs/InternetMonitor.js +8 -0
  3. package/dist-cjs/commands/GetQueryResultsCommand.js +51 -0
  4. package/dist-cjs/commands/GetQueryStatusCommand.js +51 -0
  5. package/dist-cjs/commands/StartQueryCommand.js +51 -0
  6. package/dist-cjs/commands/StopQueryCommand.js +51 -0
  7. package/dist-cjs/commands/index.js +4 -0
  8. package/dist-cjs/models/models_0.js +17 -1
  9. package/dist-cjs/pagination/GetQueryResultsPaginator.js +29 -0
  10. package/dist-cjs/pagination/index.js +1 -0
  11. package/dist-cjs/protocols/Aws_restJson1.js +270 -1
  12. package/dist-es/InternetMonitor.js +8 -0
  13. package/dist-es/commands/GetQueryResultsCommand.js +47 -0
  14. package/dist-es/commands/GetQueryStatusCommand.js +47 -0
  15. package/dist-es/commands/StartQueryCommand.js +47 -0
  16. package/dist-es/commands/StopQueryCommand.js +47 -0
  17. package/dist-es/commands/index.js +4 -0
  18. package/dist-es/models/models_0.js +16 -0
  19. package/dist-es/pagination/GetQueryResultsPaginator.js +25 -0
  20. package/dist-es/pagination/index.js +1 -0
  21. package/dist-es/protocols/Aws_restJson1.js +261 -0
  22. package/dist-types/InternetMonitor.d.ts +28 -0
  23. package/dist-types/InternetMonitorClient.d.ts +6 -2
  24. package/dist-types/commands/GetQueryResultsCommand.d.ts +106 -0
  25. package/dist-types/commands/GetQueryStatusCommand.d.ts +112 -0
  26. package/dist-types/commands/StartQueryCommand.d.ts +105 -0
  27. package/dist-types/commands/StopQueryCommand.d.ts +87 -0
  28. package/dist-types/commands/index.d.ts +4 -0
  29. package/dist-types/models/models_0.d.ts +255 -3
  30. package/dist-types/pagination/GetQueryResultsPaginator.d.ts +7 -0
  31. package/dist-types/pagination/index.d.ts +1 -0
  32. package/dist-types/protocols/Aws_restJson1.d.ts +36 -0
  33. package/dist-types/ts3.4/InternetMonitor.d.ts +68 -0
  34. package/dist-types/ts3.4/InternetMonitorClient.d.ts +24 -0
  35. package/dist-types/ts3.4/commands/GetQueryResultsCommand.d.ts +38 -0
  36. package/dist-types/ts3.4/commands/GetQueryStatusCommand.d.ts +35 -0
  37. package/dist-types/ts3.4/commands/StartQueryCommand.d.ts +35 -0
  38. package/dist-types/ts3.4/commands/StopQueryCommand.d.ts +35 -0
  39. package/dist-types/ts3.4/commands/index.d.ts +4 -0
  40. package/dist-types/ts3.4/models/models_0.d.ts +61 -0
  41. package/dist-types/ts3.4/pagination/GetQueryResultsPaginator.d.ts +11 -0
  42. package/dist-types/ts3.4/pagination/index.d.ts +1 -0
  43. package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +48 -0
  44. package/package.json +3 -3
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.de_UpdateMonitorCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_ListTagsForResourceCommand = exports.de_ListMonitorsCommand = exports.de_ListHealthEventsCommand = exports.de_GetMonitorCommand = exports.de_GetHealthEventCommand = exports.de_DeleteMonitorCommand = exports.de_CreateMonitorCommand = exports.se_UpdateMonitorCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_ListTagsForResourceCommand = exports.se_ListMonitorsCommand = exports.se_ListHealthEventsCommand = exports.se_GetMonitorCommand = exports.se_GetHealthEventCommand = exports.se_DeleteMonitorCommand = exports.se_CreateMonitorCommand = void 0;
3
+ exports.de_UpdateMonitorCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StopQueryCommand = exports.de_StartQueryCommand = exports.de_ListTagsForResourceCommand = exports.de_ListMonitorsCommand = exports.de_ListHealthEventsCommand = exports.de_GetQueryStatusCommand = exports.de_GetQueryResultsCommand = exports.de_GetMonitorCommand = exports.de_GetHealthEventCommand = exports.de_DeleteMonitorCommand = exports.de_CreateMonitorCommand = exports.se_UpdateMonitorCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StopQueryCommand = exports.se_StartQueryCommand = exports.se_ListTagsForResourceCommand = exports.se_ListMonitorsCommand = exports.se_ListHealthEventsCommand = exports.se_GetQueryStatusCommand = exports.se_GetQueryResultsCommand = exports.se_GetMonitorCommand = exports.se_GetHealthEventCommand = exports.se_DeleteMonitorCommand = exports.se_CreateMonitorCommand = void 0;
4
4
  const protocol_http_1 = require("@smithy/protocol-http");
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const uuid_1 = require("uuid");
@@ -87,6 +87,49 @@ const se_GetMonitorCommand = async (input, context) => {
87
87
  });
88
88
  };
89
89
  exports.se_GetMonitorCommand = se_GetMonitorCommand;
90
+ const se_GetQueryResultsCommand = async (input, context) => {
91
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
92
+ const headers = {};
93
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
94
+ "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Results";
95
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
96
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "QueryId", () => input.QueryId, "{QueryId}", false);
97
+ const query = (0, smithy_client_1.map)({
98
+ NextToken: [, input.NextToken],
99
+ MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
100
+ });
101
+ let body;
102
+ return new protocol_http_1.HttpRequest({
103
+ protocol,
104
+ hostname,
105
+ port,
106
+ method: "GET",
107
+ headers,
108
+ path: resolvedPath,
109
+ query,
110
+ body,
111
+ });
112
+ };
113
+ exports.se_GetQueryResultsCommand = se_GetQueryResultsCommand;
114
+ const se_GetQueryStatusCommand = async (input, context) => {
115
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
116
+ const headers = {};
117
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
118
+ "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Status";
119
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
120
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "QueryId", () => input.QueryId, "{QueryId}", false);
121
+ let body;
122
+ return new protocol_http_1.HttpRequest({
123
+ protocol,
124
+ hostname,
125
+ port,
126
+ method: "GET",
127
+ headers,
128
+ path: resolvedPath,
129
+ body,
130
+ });
131
+ };
132
+ exports.se_GetQueryStatusCommand = se_GetQueryStatusCommand;
90
133
  const se_ListHealthEventsCommand = async (input, context) => {
91
134
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
92
135
  const headers = {};
@@ -155,6 +198,50 @@ const se_ListTagsForResourceCommand = async (input, context) => {
155
198
  });
156
199
  };
157
200
  exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
201
+ const se_StartQueryCommand = async (input, context) => {
202
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
203
+ const headers = {
204
+ "content-type": "application/json",
205
+ };
206
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}/Queries";
207
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
208
+ let body;
209
+ body = JSON.stringify((0, smithy_client_1.take)(input, {
210
+ EndTime: (_) => _.toISOString().split(".")[0] + "Z",
211
+ FilterParameters: (_) => (0, smithy_client_1._json)(_),
212
+ QueryType: [],
213
+ StartTime: (_) => _.toISOString().split(".")[0] + "Z",
214
+ }));
215
+ return new protocol_http_1.HttpRequest({
216
+ protocol,
217
+ hostname,
218
+ port,
219
+ method: "POST",
220
+ headers,
221
+ path: resolvedPath,
222
+ body,
223
+ });
224
+ };
225
+ exports.se_StartQueryCommand = se_StartQueryCommand;
226
+ const se_StopQueryCommand = async (input, context) => {
227
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
228
+ const headers = {};
229
+ let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
230
+ "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}";
231
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
232
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "QueryId", () => input.QueryId, "{QueryId}", false);
233
+ let body;
234
+ return new protocol_http_1.HttpRequest({
235
+ protocol,
236
+ hostname,
237
+ port,
238
+ method: "DELETE",
239
+ headers,
240
+ path: resolvedPath,
241
+ body,
242
+ });
243
+ };
244
+ exports.se_StopQueryCommand = se_StopQueryCommand;
158
245
  const se_TagResourceCommand = async (input, context) => {
159
246
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
160
247
  const headers = {
@@ -427,6 +514,100 @@ const de_GetMonitorCommandError = async (output, context) => {
427
514
  });
428
515
  }
429
516
  };
517
+ const de_GetQueryResultsCommand = async (output, context) => {
518
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
519
+ return de_GetQueryResultsCommandError(output, context);
520
+ }
521
+ const contents = (0, smithy_client_1.map)({
522
+ $metadata: deserializeMetadata(output),
523
+ });
524
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
525
+ const doc = (0, smithy_client_1.take)(data, {
526
+ Data: smithy_client_1._json,
527
+ Fields: smithy_client_1._json,
528
+ NextToken: smithy_client_1.expectString,
529
+ });
530
+ Object.assign(contents, doc);
531
+ return contents;
532
+ };
533
+ exports.de_GetQueryResultsCommand = de_GetQueryResultsCommand;
534
+ const de_GetQueryResultsCommandError = async (output, context) => {
535
+ const parsedOutput = {
536
+ ...output,
537
+ body: await parseErrorBody(output.body, context),
538
+ };
539
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
540
+ switch (errorCode) {
541
+ case "AccessDeniedException":
542
+ case "com.amazonaws.internetmonitor#AccessDeniedException":
543
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
544
+ case "InternalServerException":
545
+ case "com.amazonaws.internetmonitor#InternalServerException":
546
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
547
+ case "LimitExceededException":
548
+ case "com.amazonaws.internetmonitor#LimitExceededException":
549
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
550
+ case "ThrottlingException":
551
+ case "com.amazonaws.internetmonitor#ThrottlingException":
552
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
553
+ case "ValidationException":
554
+ case "com.amazonaws.internetmonitor#ValidationException":
555
+ throw await de_ValidationExceptionRes(parsedOutput, context);
556
+ default:
557
+ const parsedBody = parsedOutput.body;
558
+ return throwDefaultError({
559
+ output,
560
+ parsedBody,
561
+ errorCode,
562
+ });
563
+ }
564
+ };
565
+ const de_GetQueryStatusCommand = async (output, context) => {
566
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
567
+ return de_GetQueryStatusCommandError(output, context);
568
+ }
569
+ const contents = (0, smithy_client_1.map)({
570
+ $metadata: deserializeMetadata(output),
571
+ });
572
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
573
+ const doc = (0, smithy_client_1.take)(data, {
574
+ Status: smithy_client_1.expectString,
575
+ });
576
+ Object.assign(contents, doc);
577
+ return contents;
578
+ };
579
+ exports.de_GetQueryStatusCommand = de_GetQueryStatusCommand;
580
+ const de_GetQueryStatusCommandError = async (output, context) => {
581
+ const parsedOutput = {
582
+ ...output,
583
+ body: await parseErrorBody(output.body, context),
584
+ };
585
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
586
+ switch (errorCode) {
587
+ case "AccessDeniedException":
588
+ case "com.amazonaws.internetmonitor#AccessDeniedException":
589
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
590
+ case "InternalServerException":
591
+ case "com.amazonaws.internetmonitor#InternalServerException":
592
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
593
+ case "LimitExceededException":
594
+ case "com.amazonaws.internetmonitor#LimitExceededException":
595
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
596
+ case "ThrottlingException":
597
+ case "com.amazonaws.internetmonitor#ThrottlingException":
598
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
599
+ case "ValidationException":
600
+ case "com.amazonaws.internetmonitor#ValidationException":
601
+ throw await de_ValidationExceptionRes(parsedOutput, context);
602
+ default:
603
+ const parsedBody = parsedOutput.body;
604
+ return throwDefaultError({
605
+ output,
606
+ parsedBody,
607
+ errorCode,
608
+ });
609
+ }
610
+ };
430
611
  const de_ListHealthEventsCommand = async (output, context) => {
431
612
  if (output.statusCode !== 200 && output.statusCode >= 300) {
432
613
  return de_ListHealthEventsCommandError(output, context);
@@ -561,6 +742,94 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
561
742
  });
562
743
  }
563
744
  };
745
+ const de_StartQueryCommand = async (output, context) => {
746
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
747
+ return de_StartQueryCommandError(output, context);
748
+ }
749
+ const contents = (0, smithy_client_1.map)({
750
+ $metadata: deserializeMetadata(output),
751
+ });
752
+ const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
753
+ const doc = (0, smithy_client_1.take)(data, {
754
+ QueryId: smithy_client_1.expectString,
755
+ });
756
+ Object.assign(contents, doc);
757
+ return contents;
758
+ };
759
+ exports.de_StartQueryCommand = de_StartQueryCommand;
760
+ const de_StartQueryCommandError = async (output, context) => {
761
+ const parsedOutput = {
762
+ ...output,
763
+ body: await parseErrorBody(output.body, context),
764
+ };
765
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
766
+ switch (errorCode) {
767
+ case "AccessDeniedException":
768
+ case "com.amazonaws.internetmonitor#AccessDeniedException":
769
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
770
+ case "InternalServerException":
771
+ case "com.amazonaws.internetmonitor#InternalServerException":
772
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
773
+ case "LimitExceededException":
774
+ case "com.amazonaws.internetmonitor#LimitExceededException":
775
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
776
+ case "ThrottlingException":
777
+ case "com.amazonaws.internetmonitor#ThrottlingException":
778
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
779
+ case "ValidationException":
780
+ case "com.amazonaws.internetmonitor#ValidationException":
781
+ throw await de_ValidationExceptionRes(parsedOutput, context);
782
+ default:
783
+ const parsedBody = parsedOutput.body;
784
+ return throwDefaultError({
785
+ output,
786
+ parsedBody,
787
+ errorCode,
788
+ });
789
+ }
790
+ };
791
+ const de_StopQueryCommand = async (output, context) => {
792
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
793
+ return de_StopQueryCommandError(output, context);
794
+ }
795
+ const contents = (0, smithy_client_1.map)({
796
+ $metadata: deserializeMetadata(output),
797
+ });
798
+ await (0, smithy_client_1.collectBody)(output.body, context);
799
+ return contents;
800
+ };
801
+ exports.de_StopQueryCommand = de_StopQueryCommand;
802
+ const de_StopQueryCommandError = async (output, context) => {
803
+ const parsedOutput = {
804
+ ...output,
805
+ body: await parseErrorBody(output.body, context),
806
+ };
807
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
808
+ switch (errorCode) {
809
+ case "AccessDeniedException":
810
+ case "com.amazonaws.internetmonitor#AccessDeniedException":
811
+ throw await de_AccessDeniedExceptionRes(parsedOutput, context);
812
+ case "InternalServerException":
813
+ case "com.amazonaws.internetmonitor#InternalServerException":
814
+ throw await de_InternalServerExceptionRes(parsedOutput, context);
815
+ case "LimitExceededException":
816
+ case "com.amazonaws.internetmonitor#LimitExceededException":
817
+ throw await de_LimitExceededExceptionRes(parsedOutput, context);
818
+ case "ThrottlingException":
819
+ case "com.amazonaws.internetmonitor#ThrottlingException":
820
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
821
+ case "ValidationException":
822
+ case "com.amazonaws.internetmonitor#ValidationException":
823
+ throw await de_ValidationExceptionRes(parsedOutput, context);
824
+ default:
825
+ const parsedBody = parsedOutput.body;
826
+ return throwDefaultError({
827
+ output,
828
+ parsedBody,
829
+ errorCode,
830
+ });
831
+ }
832
+ };
564
833
  const de_TagResourceCommand = async (output, context) => {
565
834
  if (output.statusCode !== 204 && output.statusCode >= 300) {
566
835
  return de_TagResourceCommandError(output, context);
@@ -3,9 +3,13 @@ import { CreateMonitorCommand, } from "./commands/CreateMonitorCommand";
3
3
  import { DeleteMonitorCommand, } from "./commands/DeleteMonitorCommand";
4
4
  import { GetHealthEventCommand, } from "./commands/GetHealthEventCommand";
5
5
  import { GetMonitorCommand } from "./commands/GetMonitorCommand";
6
+ import { GetQueryResultsCommand, } from "./commands/GetQueryResultsCommand";
7
+ import { GetQueryStatusCommand, } from "./commands/GetQueryStatusCommand";
6
8
  import { ListHealthEventsCommand, } from "./commands/ListHealthEventsCommand";
7
9
  import { ListMonitorsCommand, } from "./commands/ListMonitorsCommand";
8
10
  import { ListTagsForResourceCommand, } from "./commands/ListTagsForResourceCommand";
11
+ import { StartQueryCommand } from "./commands/StartQueryCommand";
12
+ import { StopQueryCommand } from "./commands/StopQueryCommand";
9
13
  import { TagResourceCommand } from "./commands/TagResourceCommand";
10
14
  import { UntagResourceCommand, } from "./commands/UntagResourceCommand";
11
15
  import { UpdateMonitorCommand, } from "./commands/UpdateMonitorCommand";
@@ -15,9 +19,13 @@ const commands = {
15
19
  DeleteMonitorCommand,
16
20
  GetHealthEventCommand,
17
21
  GetMonitorCommand,
22
+ GetQueryResultsCommand,
23
+ GetQueryStatusCommand,
18
24
  ListHealthEventsCommand,
19
25
  ListMonitorsCommand,
20
26
  ListTagsForResourceCommand,
27
+ StartQueryCommand,
28
+ StopQueryCommand,
21
29
  TagResourceCommand,
22
30
  UntagResourceCommand,
23
31
  UpdateMonitorCommand,
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_GetQueryResultsCommand, se_GetQueryResultsCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class GetQueryResultsCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, GetQueryResultsCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "InternetMonitorClient";
26
+ const commandName = "GetQueryResultsCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "InternetMonitor20210603",
35
+ operation: "GetQueryResults",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_GetQueryResultsCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_GetQueryResultsCommand(output, context);
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_GetQueryStatusCommand, se_GetQueryStatusCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class GetQueryStatusCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, GetQueryStatusCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "InternetMonitorClient";
26
+ const commandName = "GetQueryStatusCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "InternetMonitor20210603",
35
+ operation: "GetQueryStatus",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_GetQueryStatusCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_GetQueryStatusCommand(output, context);
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_StartQueryCommand, se_StartQueryCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class StartQueryCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, StartQueryCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "InternetMonitorClient";
26
+ const commandName = "StartQueryCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "InternetMonitor20210603",
35
+ operation: "StartQuery",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_StartQueryCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_StartQueryCommand(output, context);
46
+ }
47
+ }
@@ -0,0 +1,47 @@
1
+ import { getEndpointPlugin } from "@smithy/middleware-endpoint";
2
+ import { getSerdePlugin } from "@smithy/middleware-serde";
3
+ import { Command as $Command } from "@smithy/smithy-client";
4
+ import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
5
+ import { de_StopQueryCommand, se_StopQueryCommand } from "../protocols/Aws_restJson1";
6
+ export { $Command };
7
+ export class StopQueryCommand extends $Command {
8
+ static getEndpointParameterInstructions() {
9
+ return {
10
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
11
+ Endpoint: { type: "builtInParams", name: "endpoint" },
12
+ Region: { type: "builtInParams", name: "region" },
13
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
14
+ };
15
+ }
16
+ constructor(input) {
17
+ super();
18
+ this.input = input;
19
+ }
20
+ resolveMiddleware(clientStack, configuration, options) {
21
+ this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
22
+ this.middlewareStack.use(getEndpointPlugin(configuration, StopQueryCommand.getEndpointParameterInstructions()));
23
+ const stack = clientStack.concat(this.middlewareStack);
24
+ const { logger } = configuration;
25
+ const clientName = "InternetMonitorClient";
26
+ const commandName = "StopQueryCommand";
27
+ const handlerExecutionContext = {
28
+ logger,
29
+ clientName,
30
+ commandName,
31
+ inputFilterSensitiveLog: (_) => _,
32
+ outputFilterSensitiveLog: (_) => _,
33
+ [SMITHY_CONTEXT_KEY]: {
34
+ service: "InternetMonitor20210603",
35
+ operation: "StopQuery",
36
+ },
37
+ };
38
+ const { requestHandler } = configuration;
39
+ return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
40
+ }
41
+ serialize(input, context) {
42
+ return se_StopQueryCommand(input, context);
43
+ }
44
+ deserialize(output, context) {
45
+ return de_StopQueryCommand(output, context);
46
+ }
47
+ }
@@ -2,9 +2,13 @@ export * from "./CreateMonitorCommand";
2
2
  export * from "./DeleteMonitorCommand";
3
3
  export * from "./GetHealthEventCommand";
4
4
  export * from "./GetMonitorCommand";
5
+ export * from "./GetQueryResultsCommand";
6
+ export * from "./GetQueryStatusCommand";
5
7
  export * from "./ListHealthEventsCommand";
6
8
  export * from "./ListMonitorsCommand";
7
9
  export * from "./ListTagsForResourceCommand";
10
+ export * from "./StartQueryCommand";
11
+ export * from "./StopQueryCommand";
8
12
  export * from "./TagResourceCommand";
9
13
  export * from "./UntagResourceCommand";
10
14
  export * from "./UpdateMonitorCommand";
@@ -101,6 +101,10 @@ export class ValidationException extends __BaseException {
101
101
  Object.setPrototypeOf(this, ValidationException.prototype);
102
102
  }
103
103
  }
104
+ export const Operator = {
105
+ EQUALS: "EQUALS",
106
+ NOT_EQUALS: "NOT_EQUALS",
107
+ };
104
108
  export const TriangulationEventType = {
105
109
  AWS: "AWS",
106
110
  INTERNET: "Internet",
@@ -123,6 +127,13 @@ export const MonitorProcessingStatusCode = {
123
127
  INSUFFICIENT_DATA: "INSUFFICIENT_DATA",
124
128
  OK: "OK",
125
129
  };
130
+ export const QueryStatus = {
131
+ CANCELED: "CANCELED",
132
+ FAILED: "FAILED",
133
+ QUEUED: "QUEUED",
134
+ RUNNING: "RUNNING",
135
+ SUCCEEDED: "SUCCEEDED",
136
+ };
126
137
  export class InternalServerErrorException extends __BaseException {
127
138
  constructor(opts) {
128
139
  super({
@@ -163,6 +174,11 @@ export class TooManyRequestsException extends __BaseException {
163
174
  Object.setPrototypeOf(this, TooManyRequestsException.prototype);
164
175
  }
165
176
  }
177
+ export const QueryType = {
178
+ MEASUREMENTS: "MEASUREMENTS",
179
+ TOP_LOCATIONS: "TOP_LOCATIONS",
180
+ TOP_LOCATION_DETAILS: "TOP_LOCATION_DETAILS",
181
+ };
166
182
  export class ResourceNotFoundException extends __BaseException {
167
183
  constructor(opts) {
168
184
  super({
@@ -0,0 +1,25 @@
1
+ import { GetQueryResultsCommand, } from "../commands/GetQueryResultsCommand";
2
+ import { InternetMonitorClient } from "../InternetMonitorClient";
3
+ const makePagedClientRequest = async (client, input, ...args) => {
4
+ return await client.send(new GetQueryResultsCommand(input), ...args);
5
+ };
6
+ export async function* paginateGetQueryResults(config, input, ...additionalArguments) {
7
+ let token = config.startingToken || undefined;
8
+ let hasNext = true;
9
+ let page;
10
+ while (hasNext) {
11
+ input.NextToken = token;
12
+ input["MaxResults"] = config.pageSize;
13
+ if (config.client instanceof InternetMonitorClient) {
14
+ page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
+ }
16
+ else {
17
+ throw new Error("Invalid client, expected InternetMonitor | InternetMonitorClient");
18
+ }
19
+ yield page;
20
+ const prevToken = token;
21
+ token = page.NextToken;
22
+ hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
+ }
24
+ return undefined;
25
+ }
@@ -1,3 +1,4 @@
1
+ export * from "./GetQueryResultsPaginator";
1
2
  export * from "./Interfaces";
2
3
  export * from "./ListHealthEventsPaginator";
3
4
  export * from "./ListMonitorsPaginator";