@aws-sdk/client-internetmonitor 3.474.0 → 3.477.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
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
- const protocol_http_1 = require("@smithy/protocol-http");
4
+ const core_1 = require("@smithy/core");
5
5
  const smithy_client_1 = require("@smithy/smithy-client");
6
6
  const uuid_1 = require("uuid");
7
7
  const InternetMonitorServiceException_1 = require("../models/InternetMonitorServiceException");
8
8
  const models_0_1 = require("../models/models_0");
9
9
  const se_CreateMonitorCommand = async (input, context) => {
10
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
10
+ const b = (0, core_1.requestBuilder)(input, context);
11
11
  const headers = {
12
12
  "content-type": "application/json",
13
13
  };
14
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors";
14
+ b.bp("/v20210603/Monitors");
15
15
  let body;
16
16
  body = JSON.stringify((0, smithy_client_1.take)(input, {
17
17
  ClientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
@@ -23,188 +23,115 @@ const se_CreateMonitorCommand = async (input, context) => {
23
23
  Tags: (_) => (0, smithy_client_1._json)(_),
24
24
  TrafficPercentageToMonitor: [],
25
25
  }));
26
- return new protocol_http_1.HttpRequest({
27
- protocol,
28
- hostname,
29
- port,
30
- method: "POST",
31
- headers,
32
- path: resolvedPath,
33
- body,
34
- });
26
+ b.m("POST").h(headers).b(body);
27
+ return b.build();
35
28
  };
36
29
  exports.se_CreateMonitorCommand = se_CreateMonitorCommand;
37
30
  const se_DeleteMonitorCommand = async (input, context) => {
38
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
31
+ const b = (0, core_1.requestBuilder)(input, context);
39
32
  const headers = {};
40
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}";
41
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
33
+ b.bp("/v20210603/Monitors/{MonitorName}");
34
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
42
35
  let body;
43
- return new protocol_http_1.HttpRequest({
44
- protocol,
45
- hostname,
46
- port,
47
- method: "DELETE",
48
- headers,
49
- path: resolvedPath,
50
- body,
51
- });
36
+ b.m("DELETE").h(headers).b(body);
37
+ return b.build();
52
38
  };
53
39
  exports.se_DeleteMonitorCommand = se_DeleteMonitorCommand;
54
40
  const se_GetHealthEventCommand = async (input, context) => {
55
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
41
+ const b = (0, core_1.requestBuilder)(input, context);
56
42
  const headers = {};
57
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
58
- "/v20210603/Monitors/{MonitorName}/HealthEvents/{EventId}";
59
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
60
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EventId", () => input.EventId, "{EventId}", false);
43
+ b.bp("/v20210603/Monitors/{MonitorName}/HealthEvents/{EventId}");
44
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
45
+ b.p("EventId", () => input.EventId, "{EventId}", false);
61
46
  let body;
62
- return new protocol_http_1.HttpRequest({
63
- protocol,
64
- hostname,
65
- port,
66
- method: "GET",
67
- headers,
68
- path: resolvedPath,
69
- body,
70
- });
47
+ b.m("GET").h(headers).b(body);
48
+ return b.build();
71
49
  };
72
50
  exports.se_GetHealthEventCommand = se_GetHealthEventCommand;
73
51
  const se_GetMonitorCommand = async (input, context) => {
74
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
52
+ const b = (0, core_1.requestBuilder)(input, context);
75
53
  const headers = {};
76
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}";
77
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
54
+ b.bp("/v20210603/Monitors/{MonitorName}");
55
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
78
56
  let body;
79
- return new protocol_http_1.HttpRequest({
80
- protocol,
81
- hostname,
82
- port,
83
- method: "GET",
84
- headers,
85
- path: resolvedPath,
86
- body,
87
- });
57
+ b.m("GET").h(headers).b(body);
58
+ return b.build();
88
59
  };
89
60
  exports.se_GetMonitorCommand = se_GetMonitorCommand;
90
61
  const se_GetQueryResultsCommand = async (input, context) => {
91
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
62
+ const b = (0, core_1.requestBuilder)(input, context);
92
63
  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);
64
+ b.bp("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Results");
65
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
66
+ b.p("QueryId", () => input.QueryId, "{QueryId}", false);
97
67
  const query = (0, smithy_client_1.map)({
98
- NextToken: [, input.NextToken],
99
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
68
+ [_NT]: [, input[_NT]],
69
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
100
70
  });
101
71
  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
- });
72
+ b.m("GET").h(headers).q(query).b(body);
73
+ return b.build();
112
74
  };
113
75
  exports.se_GetQueryResultsCommand = se_GetQueryResultsCommand;
114
76
  const se_GetQueryStatusCommand = async (input, context) => {
115
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
77
+ const b = (0, core_1.requestBuilder)(input, context);
116
78
  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);
79
+ b.bp("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Status");
80
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
81
+ b.p("QueryId", () => input.QueryId, "{QueryId}", false);
121
82
  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
- });
83
+ b.m("GET").h(headers).b(body);
84
+ return b.build();
131
85
  };
132
86
  exports.se_GetQueryStatusCommand = se_GetQueryStatusCommand;
133
87
  const se_ListHealthEventsCommand = async (input, context) => {
134
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
88
+ const b = (0, core_1.requestBuilder)(input, context);
135
89
  const headers = {};
136
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
137
- "/v20210603/Monitors/{MonitorName}/HealthEvents";
138
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
90
+ b.bp("/v20210603/Monitors/{MonitorName}/HealthEvents");
91
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
139
92
  const query = (0, smithy_client_1.map)({
140
- StartTime: [
141
- () => input.StartTime !== void 0,
142
- () => (input.StartTime.toISOString().split(".")[0] + "Z").toString(),
143
- ],
144
- EndTime: [() => input.EndTime !== void 0, () => (input.EndTime.toISOString().split(".")[0] + "Z").toString()],
145
- NextToken: [, input.NextToken],
146
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
147
- EventStatus: [, input.EventStatus],
93
+ [_ST]: [() => input.StartTime !== void 0, () => (input[_ST].toISOString().split(".")[0] + "Z").toString()],
94
+ [_ET]: [() => input.EndTime !== void 0, () => (input[_ET].toISOString().split(".")[0] + "Z").toString()],
95
+ [_NT]: [, input[_NT]],
96
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
97
+ [_ES]: [, input[_ES]],
148
98
  });
149
99
  let body;
150
- return new protocol_http_1.HttpRequest({
151
- protocol,
152
- hostname,
153
- port,
154
- method: "GET",
155
- headers,
156
- path: resolvedPath,
157
- query,
158
- body,
159
- });
100
+ b.m("GET").h(headers).q(query).b(body);
101
+ return b.build();
160
102
  };
161
103
  exports.se_ListHealthEventsCommand = se_ListHealthEventsCommand;
162
104
  const se_ListMonitorsCommand = async (input, context) => {
163
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
105
+ const b = (0, core_1.requestBuilder)(input, context);
164
106
  const headers = {};
165
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors";
107
+ b.bp("/v20210603/Monitors");
166
108
  const query = (0, smithy_client_1.map)({
167
- NextToken: [, input.NextToken],
168
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
169
- MonitorStatus: [, input.MonitorStatus],
109
+ [_NT]: [, input[_NT]],
110
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
111
+ [_MS]: [, input[_MS]],
170
112
  });
171
113
  let body;
172
- return new protocol_http_1.HttpRequest({
173
- protocol,
174
- hostname,
175
- port,
176
- method: "GET",
177
- headers,
178
- path: resolvedPath,
179
- query,
180
- body,
181
- });
114
+ b.m("GET").h(headers).q(query).b(body);
115
+ return b.build();
182
116
  };
183
117
  exports.se_ListMonitorsCommand = se_ListMonitorsCommand;
184
118
  const se_ListTagsForResourceCommand = async (input, context) => {
185
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
119
+ const b = (0, core_1.requestBuilder)(input, context);
186
120
  const headers = {};
187
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
188
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
121
+ b.bp("/tags/{ResourceArn}");
122
+ b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
189
123
  let body;
190
- return new protocol_http_1.HttpRequest({
191
- protocol,
192
- hostname,
193
- port,
194
- method: "GET",
195
- headers,
196
- path: resolvedPath,
197
- body,
198
- });
124
+ b.m("GET").h(headers).b(body);
125
+ return b.build();
199
126
  };
200
127
  exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
201
128
  const se_StartQueryCommand = async (input, context) => {
202
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
129
+ const b = (0, core_1.requestBuilder)(input, context);
203
130
  const headers = {
204
131
  "content-type": "application/json",
205
132
  };
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);
133
+ b.bp("/v20210603/Monitors/{MonitorName}/Queries");
134
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
208
135
  let body;
209
136
  body = JSON.stringify((0, smithy_client_1.take)(input, {
210
137
  EndTime: (_) => _.toISOString().split(".")[0] + "Z",
@@ -212,89 +139,59 @@ const se_StartQueryCommand = async (input, context) => {
212
139
  QueryType: [],
213
140
  StartTime: (_) => _.toISOString().split(".")[0] + "Z",
214
141
  }));
215
- return new protocol_http_1.HttpRequest({
216
- protocol,
217
- hostname,
218
- port,
219
- method: "POST",
220
- headers,
221
- path: resolvedPath,
222
- body,
223
- });
142
+ b.m("POST").h(headers).b(body);
143
+ return b.build();
224
144
  };
225
145
  exports.se_StartQueryCommand = se_StartQueryCommand;
226
146
  const se_StopQueryCommand = async (input, context) => {
227
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
147
+ const b = (0, core_1.requestBuilder)(input, context);
228
148
  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);
149
+ b.bp("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}");
150
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
151
+ b.p("QueryId", () => input.QueryId, "{QueryId}", false);
233
152
  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
- });
153
+ b.m("DELETE").h(headers).b(body);
154
+ return b.build();
243
155
  };
244
156
  exports.se_StopQueryCommand = se_StopQueryCommand;
245
157
  const se_TagResourceCommand = async (input, context) => {
246
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
158
+ const b = (0, core_1.requestBuilder)(input, context);
247
159
  const headers = {
248
160
  "content-type": "application/json",
249
161
  };
250
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
251
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
162
+ b.bp("/tags/{ResourceArn}");
163
+ b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
252
164
  let body;
253
165
  body = JSON.stringify((0, smithy_client_1.take)(input, {
254
166
  Tags: (_) => (0, smithy_client_1._json)(_),
255
167
  }));
256
- return new protocol_http_1.HttpRequest({
257
- protocol,
258
- hostname,
259
- port,
260
- method: "POST",
261
- headers,
262
- path: resolvedPath,
263
- body,
264
- });
168
+ b.m("POST").h(headers).b(body);
169
+ return b.build();
265
170
  };
266
171
  exports.se_TagResourceCommand = se_TagResourceCommand;
267
172
  const se_UntagResourceCommand = async (input, context) => {
268
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
173
+ const b = (0, core_1.requestBuilder)(input, context);
269
174
  const headers = {};
270
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
271
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
175
+ b.bp("/tags/{ResourceArn}");
176
+ b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
272
177
  const query = (0, smithy_client_1.map)({
273
- tagKeys: [
178
+ [_tK]: [
274
179
  (0, smithy_client_1.expectNonNull)(input.TagKeys, `TagKeys`) != null,
275
- () => (input.TagKeys || []).map((_entry) => _entry),
180
+ () => (input[_TK] || []).map((_entry) => _entry),
276
181
  ],
277
182
  });
278
183
  let body;
279
- return new protocol_http_1.HttpRequest({
280
- protocol,
281
- hostname,
282
- port,
283
- method: "DELETE",
284
- headers,
285
- path: resolvedPath,
286
- query,
287
- body,
288
- });
184
+ b.m("DELETE").h(headers).q(query).b(body);
185
+ return b.build();
289
186
  };
290
187
  exports.se_UntagResourceCommand = se_UntagResourceCommand;
291
188
  const se_UpdateMonitorCommand = async (input, context) => {
292
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
189
+ const b = (0, core_1.requestBuilder)(input, context);
293
190
  const headers = {
294
191
  "content-type": "application/json",
295
192
  };
296
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}";
297
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
193
+ b.bp("/v20210603/Monitors/{MonitorName}");
194
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
298
195
  let body;
299
196
  body = JSON.stringify((0, smithy_client_1.take)(input, {
300
197
  ClientToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
@@ -306,15 +203,8 @@ const se_UpdateMonitorCommand = async (input, context) => {
306
203
  Status: [],
307
204
  TrafficPercentageToMonitor: [],
308
205
  }));
309
- return new protocol_http_1.HttpRequest({
310
- protocol,
311
- hostname,
312
- port,
313
- method: "PATCH",
314
- headers,
315
- path: resolvedPath,
316
- body,
317
- });
206
+ b.m("PATCH").h(headers).b(body);
207
+ return b.build();
318
208
  };
319
209
  exports.se_UpdateMonitorCommand = se_UpdateMonitorCommand;
320
210
  const de_CreateMonitorCommand = async (output, context) => {
@@ -1227,6 +1117,14 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
1227
1117
  value !== "" &&
1228
1118
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1229
1119
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1120
+ const _ES = "EventStatus";
1121
+ const _ET = "EndTime";
1122
+ const _MR = "MaxResults";
1123
+ const _MS = "MonitorStatus";
1124
+ const _NT = "NextToken";
1125
+ const _ST = "StartTime";
1126
+ const _TK = "TagKeys";
1127
+ const _tK = "tagKeys";
1230
1128
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1231
1129
  if (encoded.length) {
1232
1130
  return JSON.parse(encoded);
@@ -1,14 +1,14 @@
1
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
1
+ import { requestBuilder as rb } from "@smithy/core";
2
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseDouble as __limitedParseDouble, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, serializeFloat as __serializeFloat, take, withBaseException, } from "@smithy/smithy-client";
3
3
  import { v4 as generateIdempotencyToken } from "uuid";
4
4
  import { InternetMonitorServiceException as __BaseException } from "../models/InternetMonitorServiceException";
5
5
  import { AccessDeniedException, BadRequestException, ConflictException, InternalServerErrorException, InternalServerException, LimitExceededException, NotFoundException, ResourceNotFoundException, ThrottlingException, TooManyRequestsException, ValidationException, } from "../models/models_0";
6
6
  export const se_CreateMonitorCommand = async (input, context) => {
7
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
7
+ const b = rb(input, context);
8
8
  const headers = {
9
9
  "content-type": "application/json",
10
10
  };
11
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors";
11
+ b.bp("/v20210603/Monitors");
12
12
  let body;
13
13
  body = JSON.stringify(take(input, {
14
14
  ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
@@ -20,179 +20,106 @@ export const se_CreateMonitorCommand = async (input, context) => {
20
20
  Tags: (_) => _json(_),
21
21
  TrafficPercentageToMonitor: [],
22
22
  }));
23
- return new __HttpRequest({
24
- protocol,
25
- hostname,
26
- port,
27
- method: "POST",
28
- headers,
29
- path: resolvedPath,
30
- body,
31
- });
23
+ b.m("POST").h(headers).b(body);
24
+ return b.build();
32
25
  };
33
26
  export const se_DeleteMonitorCommand = async (input, context) => {
34
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
27
+ const b = rb(input, context);
35
28
  const headers = {};
36
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}";
37
- resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
29
+ b.bp("/v20210603/Monitors/{MonitorName}");
30
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
38
31
  let body;
39
- return new __HttpRequest({
40
- protocol,
41
- hostname,
42
- port,
43
- method: "DELETE",
44
- headers,
45
- path: resolvedPath,
46
- body,
47
- });
32
+ b.m("DELETE").h(headers).b(body);
33
+ return b.build();
48
34
  };
49
35
  export const se_GetHealthEventCommand = async (input, context) => {
50
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
36
+ const b = rb(input, context);
51
37
  const headers = {};
52
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
53
- "/v20210603/Monitors/{MonitorName}/HealthEvents/{EventId}";
54
- resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
55
- resolvedPath = __resolvedPath(resolvedPath, input, "EventId", () => input.EventId, "{EventId}", false);
38
+ b.bp("/v20210603/Monitors/{MonitorName}/HealthEvents/{EventId}");
39
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
40
+ b.p("EventId", () => input.EventId, "{EventId}", false);
56
41
  let body;
57
- return new __HttpRequest({
58
- protocol,
59
- hostname,
60
- port,
61
- method: "GET",
62
- headers,
63
- path: resolvedPath,
64
- body,
65
- });
42
+ b.m("GET").h(headers).b(body);
43
+ return b.build();
66
44
  };
67
45
  export const se_GetMonitorCommand = async (input, context) => {
68
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
46
+ const b = rb(input, context);
69
47
  const headers = {};
70
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}";
71
- resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
48
+ b.bp("/v20210603/Monitors/{MonitorName}");
49
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
72
50
  let body;
73
- return new __HttpRequest({
74
- protocol,
75
- hostname,
76
- port,
77
- method: "GET",
78
- headers,
79
- path: resolvedPath,
80
- body,
81
- });
51
+ b.m("GET").h(headers).b(body);
52
+ return b.build();
82
53
  };
83
54
  export const se_GetQueryResultsCommand = async (input, context) => {
84
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
55
+ const b = rb(input, context);
85
56
  const headers = {};
86
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
87
- "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Results";
88
- resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
89
- resolvedPath = __resolvedPath(resolvedPath, input, "QueryId", () => input.QueryId, "{QueryId}", false);
57
+ b.bp("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Results");
58
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
59
+ b.p("QueryId", () => input.QueryId, "{QueryId}", false);
90
60
  const query = map({
91
- NextToken: [, input.NextToken],
92
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
61
+ [_NT]: [, input[_NT]],
62
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
93
63
  });
94
64
  let body;
95
- return new __HttpRequest({
96
- protocol,
97
- hostname,
98
- port,
99
- method: "GET",
100
- headers,
101
- path: resolvedPath,
102
- query,
103
- body,
104
- });
65
+ b.m("GET").h(headers).q(query).b(body);
66
+ return b.build();
105
67
  };
106
68
  export const se_GetQueryStatusCommand = async (input, context) => {
107
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
69
+ const b = rb(input, context);
108
70
  const headers = {};
109
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
110
- "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Status";
111
- resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
112
- resolvedPath = __resolvedPath(resolvedPath, input, "QueryId", () => input.QueryId, "{QueryId}", false);
71
+ b.bp("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}/Status");
72
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
73
+ b.p("QueryId", () => input.QueryId, "{QueryId}", false);
113
74
  let body;
114
- return new __HttpRequest({
115
- protocol,
116
- hostname,
117
- port,
118
- method: "GET",
119
- headers,
120
- path: resolvedPath,
121
- body,
122
- });
75
+ b.m("GET").h(headers).b(body);
76
+ return b.build();
123
77
  };
124
78
  export const se_ListHealthEventsCommand = async (input, context) => {
125
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
79
+ const b = rb(input, context);
126
80
  const headers = {};
127
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
128
- "/v20210603/Monitors/{MonitorName}/HealthEvents";
129
- resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
81
+ b.bp("/v20210603/Monitors/{MonitorName}/HealthEvents");
82
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
130
83
  const query = map({
131
- StartTime: [
132
- () => input.StartTime !== void 0,
133
- () => (input.StartTime.toISOString().split(".")[0] + "Z").toString(),
134
- ],
135
- EndTime: [() => input.EndTime !== void 0, () => (input.EndTime.toISOString().split(".")[0] + "Z").toString()],
136
- NextToken: [, input.NextToken],
137
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
138
- EventStatus: [, input.EventStatus],
84
+ [_ST]: [() => input.StartTime !== void 0, () => (input[_ST].toISOString().split(".")[0] + "Z").toString()],
85
+ [_ET]: [() => input.EndTime !== void 0, () => (input[_ET].toISOString().split(".")[0] + "Z").toString()],
86
+ [_NT]: [, input[_NT]],
87
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
88
+ [_ES]: [, input[_ES]],
139
89
  });
140
90
  let body;
141
- return new __HttpRequest({
142
- protocol,
143
- hostname,
144
- port,
145
- method: "GET",
146
- headers,
147
- path: resolvedPath,
148
- query,
149
- body,
150
- });
91
+ b.m("GET").h(headers).q(query).b(body);
92
+ return b.build();
151
93
  };
152
94
  export const se_ListMonitorsCommand = async (input, context) => {
153
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
95
+ const b = rb(input, context);
154
96
  const headers = {};
155
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors";
97
+ b.bp("/v20210603/Monitors");
156
98
  const query = map({
157
- NextToken: [, input.NextToken],
158
- MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults.toString()],
159
- MonitorStatus: [, input.MonitorStatus],
99
+ [_NT]: [, input[_NT]],
100
+ [_MR]: [() => input.MaxResults !== void 0, () => input[_MR].toString()],
101
+ [_MS]: [, input[_MS]],
160
102
  });
161
103
  let body;
162
- return new __HttpRequest({
163
- protocol,
164
- hostname,
165
- port,
166
- method: "GET",
167
- headers,
168
- path: resolvedPath,
169
- query,
170
- body,
171
- });
104
+ b.m("GET").h(headers).q(query).b(body);
105
+ return b.build();
172
106
  };
173
107
  export const se_ListTagsForResourceCommand = async (input, context) => {
174
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
108
+ const b = rb(input, context);
175
109
  const headers = {};
176
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
177
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
110
+ b.bp("/tags/{ResourceArn}");
111
+ b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
178
112
  let body;
179
- return new __HttpRequest({
180
- protocol,
181
- hostname,
182
- port,
183
- method: "GET",
184
- headers,
185
- path: resolvedPath,
186
- body,
187
- });
113
+ b.m("GET").h(headers).b(body);
114
+ return b.build();
188
115
  };
189
116
  export const se_StartQueryCommand = async (input, context) => {
190
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
117
+ const b = rb(input, context);
191
118
  const headers = {
192
119
  "content-type": "application/json",
193
120
  };
194
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}/Queries";
195
- resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
121
+ b.bp("/v20210603/Monitors/{MonitorName}/Queries");
122
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
196
123
  let body;
197
124
  body = JSON.stringify(take(input, {
198
125
  EndTime: (_) => _.toISOString().split(".")[0] + "Z",
@@ -200,85 +127,55 @@ export const se_StartQueryCommand = async (input, context) => {
200
127
  QueryType: [],
201
128
  StartTime: (_) => _.toISOString().split(".")[0] + "Z",
202
129
  }));
203
- return new __HttpRequest({
204
- protocol,
205
- hostname,
206
- port,
207
- method: "POST",
208
- headers,
209
- path: resolvedPath,
210
- body,
211
- });
130
+ b.m("POST").h(headers).b(body);
131
+ return b.build();
212
132
  };
213
133
  export const se_StopQueryCommand = async (input, context) => {
214
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
134
+ const b = rb(input, context);
215
135
  const headers = {};
216
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
217
- "/v20210603/Monitors/{MonitorName}/Queries/{QueryId}";
218
- resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
219
- resolvedPath = __resolvedPath(resolvedPath, input, "QueryId", () => input.QueryId, "{QueryId}", false);
136
+ b.bp("/v20210603/Monitors/{MonitorName}/Queries/{QueryId}");
137
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
138
+ b.p("QueryId", () => input.QueryId, "{QueryId}", false);
220
139
  let body;
221
- return new __HttpRequest({
222
- protocol,
223
- hostname,
224
- port,
225
- method: "DELETE",
226
- headers,
227
- path: resolvedPath,
228
- body,
229
- });
140
+ b.m("DELETE").h(headers).b(body);
141
+ return b.build();
230
142
  };
231
143
  export const se_TagResourceCommand = async (input, context) => {
232
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
144
+ const b = rb(input, context);
233
145
  const headers = {
234
146
  "content-type": "application/json",
235
147
  };
236
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
237
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
148
+ b.bp("/tags/{ResourceArn}");
149
+ b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
238
150
  let body;
239
151
  body = JSON.stringify(take(input, {
240
152
  Tags: (_) => _json(_),
241
153
  }));
242
- return new __HttpRequest({
243
- protocol,
244
- hostname,
245
- port,
246
- method: "POST",
247
- headers,
248
- path: resolvedPath,
249
- body,
250
- });
154
+ b.m("POST").h(headers).b(body);
155
+ return b.build();
251
156
  };
252
157
  export const se_UntagResourceCommand = async (input, context) => {
253
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
158
+ const b = rb(input, context);
254
159
  const headers = {};
255
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tags/{ResourceArn}";
256
- resolvedPath = __resolvedPath(resolvedPath, input, "ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
160
+ b.bp("/tags/{ResourceArn}");
161
+ b.p("ResourceArn", () => input.ResourceArn, "{ResourceArn}", false);
257
162
  const query = map({
258
- tagKeys: [
163
+ [_tK]: [
259
164
  __expectNonNull(input.TagKeys, `TagKeys`) != null,
260
- () => (input.TagKeys || []).map((_entry) => _entry),
165
+ () => (input[_TK] || []).map((_entry) => _entry),
261
166
  ],
262
167
  });
263
168
  let body;
264
- return new __HttpRequest({
265
- protocol,
266
- hostname,
267
- port,
268
- method: "DELETE",
269
- headers,
270
- path: resolvedPath,
271
- query,
272
- body,
273
- });
169
+ b.m("DELETE").h(headers).q(query).b(body);
170
+ return b.build();
274
171
  };
275
172
  export const se_UpdateMonitorCommand = async (input, context) => {
276
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
173
+ const b = rb(input, context);
277
174
  const headers = {
278
175
  "content-type": "application/json",
279
176
  };
280
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v20210603/Monitors/{MonitorName}";
281
- resolvedPath = __resolvedPath(resolvedPath, input, "MonitorName", () => input.MonitorName, "{MonitorName}", false);
177
+ b.bp("/v20210603/Monitors/{MonitorName}");
178
+ b.p("MonitorName", () => input.MonitorName, "{MonitorName}", false);
282
179
  let body;
283
180
  body = JSON.stringify(take(input, {
284
181
  ClientToken: [true, (_) => _ ?? generateIdempotencyToken()],
@@ -290,15 +187,8 @@ export const se_UpdateMonitorCommand = async (input, context) => {
290
187
  Status: [],
291
188
  TrafficPercentageToMonitor: [],
292
189
  }));
293
- return new __HttpRequest({
294
- protocol,
295
- hostname,
296
- port,
297
- method: "PATCH",
298
- headers,
299
- path: resolvedPath,
300
- body,
301
- });
190
+ b.m("PATCH").h(headers).b(body);
191
+ return b.build();
302
192
  };
303
193
  export const de_CreateMonitorCommand = async (output, context) => {
304
194
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1196,6 +1086,14 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
1196
1086
  value !== "" &&
1197
1087
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1198
1088
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1089
+ const _ES = "EventStatus";
1090
+ const _ET = "EndTime";
1091
+ const _MR = "MaxResults";
1092
+ const _MS = "MonitorStatus";
1093
+ const _NT = "NextToken";
1094
+ const _ST = "StartTime";
1095
+ const _TK = "TagKeys";
1096
+ const _tK = "tagKeys";
1199
1097
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1200
1098
  if (encoded.length) {
1201
1099
  return JSON.parse(encoded);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-internetmonitor",
3
3
  "description": "AWS SDK for JavaScript Internetmonitor Client for Node.js, Browser and React Native",
4
- "version": "3.474.0",
4
+ "version": "3.477.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -20,9 +20,9 @@
20
20
  "dependencies": {
21
21
  "@aws-crypto/sha256-browser": "3.0.0",
22
22
  "@aws-crypto/sha256-js": "3.0.0",
23
- "@aws-sdk/client-sts": "3.474.0",
24
- "@aws-sdk/core": "3.474.0",
25
- "@aws-sdk/credential-provider-node": "3.474.0",
23
+ "@aws-sdk/client-sts": "3.477.0",
24
+ "@aws-sdk/core": "3.477.0",
25
+ "@aws-sdk/credential-provider-node": "3.477.0",
26
26
  "@aws-sdk/middleware-host-header": "3.468.0",
27
27
  "@aws-sdk/middleware-logger": "3.468.0",
28
28
  "@aws-sdk/middleware-recursion-detection": "3.468.0",
@@ -34,6 +34,7 @@
34
34
  "@aws-sdk/util-user-agent-browser": "3.468.0",
35
35
  "@aws-sdk/util-user-agent-node": "3.470.0",
36
36
  "@smithy/config-resolver": "^2.0.21",
37
+ "@smithy/core": "^1.2.0",
37
38
  "@smithy/fetch-http-handler": "^2.3.1",
38
39
  "@smithy/hash-node": "^2.0.17",
39
40
  "@smithy/invalid-dependency": "^2.0.15",