@aws-sdk/client-kafkaconnect 3.476.0 → 3.478.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,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateListConnectors = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const ListConnectorsCommand_1 = require("../commands/ListConnectorsCommand");
5
6
  const KafkaConnectClient_1 = require("../KafkaConnectClient");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new ListConnectorsCommand_1.ListConnectorsCommand(input), ...args);
8
- };
9
- async function* paginateListConnectors(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.nextToken = token;
15
- input["maxResults"] = config.pageSize;
16
- if (config.client instanceof KafkaConnectClient_1.KafkaConnectClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected KafkaConnect | KafkaConnectClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.nextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateListConnectors = paginateListConnectors;
7
+ exports.paginateListConnectors = (0, core_1.createPaginator)(KafkaConnectClient_1.KafkaConnectClient, ListConnectorsCommand_1.ListConnectorsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateListCustomPlugins = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const ListCustomPluginsCommand_1 = require("../commands/ListCustomPluginsCommand");
5
6
  const KafkaConnectClient_1 = require("../KafkaConnectClient");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new ListCustomPluginsCommand_1.ListCustomPluginsCommand(input), ...args);
8
- };
9
- async function* paginateListCustomPlugins(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.nextToken = token;
15
- input["maxResults"] = config.pageSize;
16
- if (config.client instanceof KafkaConnectClient_1.KafkaConnectClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected KafkaConnect | KafkaConnectClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.nextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateListCustomPlugins = paginateListCustomPlugins;
7
+ exports.paginateListCustomPlugins = (0, core_1.createPaginator)(KafkaConnectClient_1.KafkaConnectClient, ListCustomPluginsCommand_1.ListCustomPluginsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,29 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.paginateListWorkerConfigurations = void 0;
4
+ const core_1 = require("@smithy/core");
4
5
  const ListWorkerConfigurationsCommand_1 = require("../commands/ListWorkerConfigurationsCommand");
5
6
  const KafkaConnectClient_1 = require("../KafkaConnectClient");
6
- const makePagedClientRequest = async (client, input, ...args) => {
7
- return await client.send(new ListWorkerConfigurationsCommand_1.ListWorkerConfigurationsCommand(input), ...args);
8
- };
9
- async function* paginateListWorkerConfigurations(config, input, ...additionalArguments) {
10
- let token = config.startingToken || undefined;
11
- let hasNext = true;
12
- let page;
13
- while (hasNext) {
14
- input.nextToken = token;
15
- input["maxResults"] = config.pageSize;
16
- if (config.client instanceof KafkaConnectClient_1.KafkaConnectClient) {
17
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
18
- }
19
- else {
20
- throw new Error("Invalid client, expected KafkaConnect | KafkaConnectClient");
21
- }
22
- yield page;
23
- const prevToken = token;
24
- token = page.nextToken;
25
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
26
- }
27
- return undefined;
28
- }
29
- exports.paginateListWorkerConfigurations = paginateListWorkerConfigurations;
7
+ exports.paginateListWorkerConfigurations = (0, core_1.createPaginator)(KafkaConnectClient_1.KafkaConnectClient, ListWorkerConfigurationsCommand_1.ListWorkerConfigurationsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.de_UpdateConnectorCommand = exports.de_ListWorkerConfigurationsCommand = exports.de_ListCustomPluginsCommand = exports.de_ListConnectorsCommand = exports.de_DescribeWorkerConfigurationCommand = exports.de_DescribeCustomPluginCommand = exports.de_DescribeConnectorCommand = exports.de_DeleteCustomPluginCommand = exports.de_DeleteConnectorCommand = exports.de_CreateWorkerConfigurationCommand = exports.de_CreateCustomPluginCommand = exports.de_CreateConnectorCommand = exports.se_UpdateConnectorCommand = exports.se_ListWorkerConfigurationsCommand = exports.se_ListCustomPluginsCommand = exports.se_ListConnectorsCommand = exports.se_DescribeWorkerConfigurationCommand = exports.se_DescribeCustomPluginCommand = exports.se_DescribeConnectorCommand = exports.se_DeleteCustomPluginCommand = exports.se_DeleteConnectorCommand = exports.se_CreateWorkerConfigurationCommand = exports.se_CreateCustomPluginCommand = exports.se_CreateConnectorCommand = 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 KafkaConnectServiceException_1 = require("../models/KafkaConnectServiceException");
7
7
  const models_0_1 = require("../models/models_0");
8
8
  const se_CreateConnectorCommand = async (input, context) => {
9
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
9
+ const b = (0, core_1.requestBuilder)(input, context);
10
10
  const headers = {
11
11
  "content-type": "application/json",
12
12
  };
13
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors";
13
+ b.bp("/v1/connectors");
14
14
  let body;
15
15
  body = JSON.stringify((0, smithy_client_1.take)(input, {
16
16
  capacity: (_) => (0, smithy_client_1._json)(_),
@@ -26,23 +26,16 @@ const se_CreateConnectorCommand = async (input, context) => {
26
26
  serviceExecutionRoleArn: [],
27
27
  workerConfiguration: (_) => (0, smithy_client_1._json)(_),
28
28
  }));
29
- return new protocol_http_1.HttpRequest({
30
- protocol,
31
- hostname,
32
- port,
33
- method: "POST",
34
- headers,
35
- path: resolvedPath,
36
- body,
37
- });
29
+ b.m("POST").h(headers).b(body);
30
+ return b.build();
38
31
  };
39
32
  exports.se_CreateConnectorCommand = se_CreateConnectorCommand;
40
33
  const se_CreateCustomPluginCommand = async (input, context) => {
41
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
34
+ const b = (0, core_1.requestBuilder)(input, context);
42
35
  const headers = {
43
36
  "content-type": "application/json",
44
37
  };
45
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins";
38
+ b.bp("/v1/custom-plugins");
46
39
  let body;
47
40
  body = JSON.stringify((0, smithy_client_1.take)(input, {
48
41
  contentType: [],
@@ -50,218 +43,135 @@ const se_CreateCustomPluginCommand = async (input, context) => {
50
43
  location: (_) => (0, smithy_client_1._json)(_),
51
44
  name: [],
52
45
  }));
53
- return new protocol_http_1.HttpRequest({
54
- protocol,
55
- hostname,
56
- port,
57
- method: "POST",
58
- headers,
59
- path: resolvedPath,
60
- body,
61
- });
46
+ b.m("POST").h(headers).b(body);
47
+ return b.build();
62
48
  };
63
49
  exports.se_CreateCustomPluginCommand = se_CreateCustomPluginCommand;
64
50
  const se_CreateWorkerConfigurationCommand = async (input, context) => {
65
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
51
+ const b = (0, core_1.requestBuilder)(input, context);
66
52
  const headers = {
67
53
  "content-type": "application/json",
68
54
  };
69
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/worker-configurations";
55
+ b.bp("/v1/worker-configurations");
70
56
  let body;
71
57
  body = JSON.stringify((0, smithy_client_1.take)(input, {
72
58
  description: [],
73
59
  name: [],
74
60
  propertiesFileContent: [],
75
61
  }));
76
- return new protocol_http_1.HttpRequest({
77
- protocol,
78
- hostname,
79
- port,
80
- method: "POST",
81
- headers,
82
- path: resolvedPath,
83
- body,
84
- });
62
+ b.m("POST").h(headers).b(body);
63
+ return b.build();
85
64
  };
86
65
  exports.se_CreateWorkerConfigurationCommand = se_CreateWorkerConfigurationCommand;
87
66
  const se_DeleteConnectorCommand = async (input, context) => {
88
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
67
+ const b = (0, core_1.requestBuilder)(input, context);
89
68
  const headers = {};
90
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors/{connectorArn}";
91
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "connectorArn", () => input.connectorArn, "{connectorArn}", false);
69
+ b.bp("/v1/connectors/{connectorArn}");
70
+ b.p("connectorArn", () => input.connectorArn, "{connectorArn}", false);
92
71
  const query = (0, smithy_client_1.map)({
93
- currentVersion: [, input.currentVersion],
72
+ [_cV]: [, input[_cV]],
94
73
  });
95
74
  let body;
96
- return new protocol_http_1.HttpRequest({
97
- protocol,
98
- hostname,
99
- port,
100
- method: "DELETE",
101
- headers,
102
- path: resolvedPath,
103
- query,
104
- body,
105
- });
75
+ b.m("DELETE").h(headers).q(query).b(body);
76
+ return b.build();
106
77
  };
107
78
  exports.se_DeleteConnectorCommand = se_DeleteConnectorCommand;
108
79
  const se_DeleteCustomPluginCommand = async (input, context) => {
109
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
80
+ const b = (0, core_1.requestBuilder)(input, context);
110
81
  const headers = {};
111
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins/{customPluginArn}";
112
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
82
+ b.bp("/v1/custom-plugins/{customPluginArn}");
83
+ b.p("customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
113
84
  let body;
114
- return new protocol_http_1.HttpRequest({
115
- protocol,
116
- hostname,
117
- port,
118
- method: "DELETE",
119
- headers,
120
- path: resolvedPath,
121
- body,
122
- });
85
+ b.m("DELETE").h(headers).b(body);
86
+ return b.build();
123
87
  };
124
88
  exports.se_DeleteCustomPluginCommand = se_DeleteCustomPluginCommand;
125
89
  const se_DescribeConnectorCommand = async (input, context) => {
126
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
90
+ const b = (0, core_1.requestBuilder)(input, context);
127
91
  const headers = {};
128
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors/{connectorArn}";
129
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "connectorArn", () => input.connectorArn, "{connectorArn}", false);
92
+ b.bp("/v1/connectors/{connectorArn}");
93
+ b.p("connectorArn", () => input.connectorArn, "{connectorArn}", false);
130
94
  let body;
131
- return new protocol_http_1.HttpRequest({
132
- protocol,
133
- hostname,
134
- port,
135
- method: "GET",
136
- headers,
137
- path: resolvedPath,
138
- body,
139
- });
95
+ b.m("GET").h(headers).b(body);
96
+ return b.build();
140
97
  };
141
98
  exports.se_DescribeConnectorCommand = se_DescribeConnectorCommand;
142
99
  const se_DescribeCustomPluginCommand = async (input, context) => {
143
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
100
+ const b = (0, core_1.requestBuilder)(input, context);
144
101
  const headers = {};
145
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins/{customPluginArn}";
146
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
102
+ b.bp("/v1/custom-plugins/{customPluginArn}");
103
+ b.p("customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
147
104
  let body;
148
- return new protocol_http_1.HttpRequest({
149
- protocol,
150
- hostname,
151
- port,
152
- method: "GET",
153
- headers,
154
- path: resolvedPath,
155
- body,
156
- });
105
+ b.m("GET").h(headers).b(body);
106
+ return b.build();
157
107
  };
158
108
  exports.se_DescribeCustomPluginCommand = se_DescribeCustomPluginCommand;
159
109
  const se_DescribeWorkerConfigurationCommand = async (input, context) => {
160
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
110
+ const b = (0, core_1.requestBuilder)(input, context);
161
111
  const headers = {};
162
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
163
- "/v1/worker-configurations/{workerConfigurationArn}";
164
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workerConfigurationArn", () => input.workerConfigurationArn, "{workerConfigurationArn}", false);
112
+ b.bp("/v1/worker-configurations/{workerConfigurationArn}");
113
+ b.p("workerConfigurationArn", () => input.workerConfigurationArn, "{workerConfigurationArn}", false);
165
114
  let body;
166
- return new protocol_http_1.HttpRequest({
167
- protocol,
168
- hostname,
169
- port,
170
- method: "GET",
171
- headers,
172
- path: resolvedPath,
173
- body,
174
- });
115
+ b.m("GET").h(headers).b(body);
116
+ return b.build();
175
117
  };
176
118
  exports.se_DescribeWorkerConfigurationCommand = se_DescribeWorkerConfigurationCommand;
177
119
  const se_ListConnectorsCommand = async (input, context) => {
178
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
120
+ const b = (0, core_1.requestBuilder)(input, context);
179
121
  const headers = {};
180
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors";
122
+ b.bp("/v1/connectors");
181
123
  const query = (0, smithy_client_1.map)({
182
- connectorNamePrefix: [, input.connectorNamePrefix],
183
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
184
- nextToken: [, input.nextToken],
124
+ [_cNP]: [, input[_cNP]],
125
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
126
+ [_nT]: [, input[_nT]],
185
127
  });
186
128
  let body;
187
- return new protocol_http_1.HttpRequest({
188
- protocol,
189
- hostname,
190
- port,
191
- method: "GET",
192
- headers,
193
- path: resolvedPath,
194
- query,
195
- body,
196
- });
129
+ b.m("GET").h(headers).q(query).b(body);
130
+ return b.build();
197
131
  };
198
132
  exports.se_ListConnectorsCommand = se_ListConnectorsCommand;
199
133
  const se_ListCustomPluginsCommand = async (input, context) => {
200
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
134
+ const b = (0, core_1.requestBuilder)(input, context);
201
135
  const headers = {};
202
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins";
136
+ b.bp("/v1/custom-plugins");
203
137
  const query = (0, smithy_client_1.map)({
204
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
205
- nextToken: [, input.nextToken],
138
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
139
+ [_nT]: [, input[_nT]],
206
140
  });
207
141
  let body;
208
- return new protocol_http_1.HttpRequest({
209
- protocol,
210
- hostname,
211
- port,
212
- method: "GET",
213
- headers,
214
- path: resolvedPath,
215
- query,
216
- body,
217
- });
142
+ b.m("GET").h(headers).q(query).b(body);
143
+ return b.build();
218
144
  };
219
145
  exports.se_ListCustomPluginsCommand = se_ListCustomPluginsCommand;
220
146
  const se_ListWorkerConfigurationsCommand = async (input, context) => {
221
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
147
+ const b = (0, core_1.requestBuilder)(input, context);
222
148
  const headers = {};
223
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/worker-configurations";
149
+ b.bp("/v1/worker-configurations");
224
150
  const query = (0, smithy_client_1.map)({
225
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
226
- nextToken: [, input.nextToken],
151
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
152
+ [_nT]: [, input[_nT]],
227
153
  });
228
154
  let body;
229
- return new protocol_http_1.HttpRequest({
230
- protocol,
231
- hostname,
232
- port,
233
- method: "GET",
234
- headers,
235
- path: resolvedPath,
236
- query,
237
- body,
238
- });
155
+ b.m("GET").h(headers).q(query).b(body);
156
+ return b.build();
239
157
  };
240
158
  exports.se_ListWorkerConfigurationsCommand = se_ListWorkerConfigurationsCommand;
241
159
  const se_UpdateConnectorCommand = async (input, context) => {
242
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
160
+ const b = (0, core_1.requestBuilder)(input, context);
243
161
  const headers = {
244
162
  "content-type": "application/json",
245
163
  };
246
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors/{connectorArn}";
247
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "connectorArn", () => input.connectorArn, "{connectorArn}", false);
164
+ b.bp("/v1/connectors/{connectorArn}");
165
+ b.p("connectorArn", () => input.connectorArn, "{connectorArn}", false);
248
166
  const query = (0, smithy_client_1.map)({
249
- currentVersion: [, (0, smithy_client_1.expectNonNull)(input.currentVersion, `currentVersion`)],
167
+ [_cV]: [, (0, smithy_client_1.expectNonNull)(input[_cV], `currentVersion`)],
250
168
  });
251
169
  let body;
252
170
  body = JSON.stringify((0, smithy_client_1.take)(input, {
253
171
  capacity: (_) => (0, smithy_client_1._json)(_),
254
172
  }));
255
- return new protocol_http_1.HttpRequest({
256
- protocol,
257
- hostname,
258
- port,
259
- method: "PUT",
260
- headers,
261
- path: resolvedPath,
262
- query,
263
- body,
264
- });
173
+ b.m("PUT").h(headers).q(query).b(body);
174
+ return b.build();
265
175
  };
266
176
  exports.se_UpdateConnectorCommand = se_UpdateConnectorCommand;
267
177
  const de_CreateConnectorCommand = async (output, context) => {
@@ -1141,6 +1051,10 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
1141
1051
  value !== "" &&
1142
1052
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1143
1053
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1054
+ const _cNP = "connectorNamePrefix";
1055
+ const _cV = "currentVersion";
1056
+ const _mR = "maxResults";
1057
+ const _nT = "nextToken";
1144
1058
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1145
1059
  if (encoded.length) {
1146
1060
  return JSON.parse(encoded);
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListConnectorsCommand, } from "../commands/ListConnectorsCommand";
2
3
  import { KafkaConnectClient } from "../KafkaConnectClient";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListConnectorsCommand(input), ...args);
5
- };
6
- export async function* paginateListConnectors(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 KafkaConnectClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected KafkaConnect | KafkaConnectClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListConnectors = createPaginator(KafkaConnectClient, ListConnectorsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListCustomPluginsCommand, } from "../commands/ListCustomPluginsCommand";
2
3
  import { KafkaConnectClient } from "../KafkaConnectClient";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListCustomPluginsCommand(input), ...args);
5
- };
6
- export async function* paginateListCustomPlugins(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 KafkaConnectClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected KafkaConnect | KafkaConnectClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListCustomPlugins = createPaginator(KafkaConnectClient, ListCustomPluginsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { ListWorkerConfigurationsCommand, } from "../commands/ListWorkerConfigurationsCommand";
2
3
  import { KafkaConnectClient } from "../KafkaConnectClient";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListWorkerConfigurationsCommand(input), ...args);
5
- };
6
- export async function* paginateListWorkerConfigurations(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 KafkaConnectClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected KafkaConnect | KafkaConnectClient");
18
- }
19
- yield page;
20
- const prevToken = token;
21
- token = page.nextToken;
22
- hasNext = !!(token && (!config.stopOnSameToken || token !== prevToken));
23
- }
24
- return undefined;
25
- }
4
+ export const paginateListWorkerConfigurations = createPaginator(KafkaConnectClient, ListWorkerConfigurationsCommand, "nextToken", "nextToken", "maxResults");
@@ -1,13 +1,13 @@
1
- import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
2
- import { _json, collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client";
1
+ import { requestBuilder as rb } from "@smithy/core";
2
+ import { _json, collectBody, decorateServiceException as __decorateServiceException, expectLong as __expectLong, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, take, withBaseException, } from "@smithy/smithy-client";
3
3
  import { KafkaConnectServiceException as __BaseException } from "../models/KafkaConnectServiceException";
4
4
  import { BadRequestException, ConflictException, ForbiddenException, InternalServerErrorException, NotFoundException, ServiceUnavailableException, TooManyRequestsException, UnauthorizedException, } from "../models/models_0";
5
5
  export const se_CreateConnectorCommand = async (input, context) => {
6
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
6
+ const b = rb(input, context);
7
7
  const headers = {
8
8
  "content-type": "application/json",
9
9
  };
10
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors";
10
+ b.bp("/v1/connectors");
11
11
  let body;
12
12
  body = JSON.stringify(take(input, {
13
13
  capacity: (_) => _json(_),
@@ -23,22 +23,15 @@ export const se_CreateConnectorCommand = async (input, context) => {
23
23
  serviceExecutionRoleArn: [],
24
24
  workerConfiguration: (_) => _json(_),
25
25
  }));
26
- return new __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
  export const se_CreateCustomPluginCommand = async (input, context) => {
37
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
30
+ const b = rb(input, context);
38
31
  const headers = {
39
32
  "content-type": "application/json",
40
33
  };
41
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins";
34
+ b.bp("/v1/custom-plugins");
42
35
  let body;
43
36
  body = JSON.stringify(take(input, {
44
37
  contentType: [],
@@ -46,208 +39,125 @@ export const se_CreateCustomPluginCommand = async (input, context) => {
46
39
  location: (_) => _json(_),
47
40
  name: [],
48
41
  }));
49
- return new __HttpRequest({
50
- protocol,
51
- hostname,
52
- port,
53
- method: "POST",
54
- headers,
55
- path: resolvedPath,
56
- body,
57
- });
42
+ b.m("POST").h(headers).b(body);
43
+ return b.build();
58
44
  };
59
45
  export const se_CreateWorkerConfigurationCommand = async (input, context) => {
60
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
46
+ const b = rb(input, context);
61
47
  const headers = {
62
48
  "content-type": "application/json",
63
49
  };
64
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/worker-configurations";
50
+ b.bp("/v1/worker-configurations");
65
51
  let body;
66
52
  body = JSON.stringify(take(input, {
67
53
  description: [],
68
54
  name: [],
69
55
  propertiesFileContent: [],
70
56
  }));
71
- return new __HttpRequest({
72
- protocol,
73
- hostname,
74
- port,
75
- method: "POST",
76
- headers,
77
- path: resolvedPath,
78
- body,
79
- });
57
+ b.m("POST").h(headers).b(body);
58
+ return b.build();
80
59
  };
81
60
  export const se_DeleteConnectorCommand = async (input, context) => {
82
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
61
+ const b = rb(input, context);
83
62
  const headers = {};
84
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors/{connectorArn}";
85
- resolvedPath = __resolvedPath(resolvedPath, input, "connectorArn", () => input.connectorArn, "{connectorArn}", false);
63
+ b.bp("/v1/connectors/{connectorArn}");
64
+ b.p("connectorArn", () => input.connectorArn, "{connectorArn}", false);
86
65
  const query = map({
87
- currentVersion: [, input.currentVersion],
66
+ [_cV]: [, input[_cV]],
88
67
  });
89
68
  let body;
90
- return new __HttpRequest({
91
- protocol,
92
- hostname,
93
- port,
94
- method: "DELETE",
95
- headers,
96
- path: resolvedPath,
97
- query,
98
- body,
99
- });
69
+ b.m("DELETE").h(headers).q(query).b(body);
70
+ return b.build();
100
71
  };
101
72
  export const se_DeleteCustomPluginCommand = async (input, context) => {
102
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
73
+ const b = rb(input, context);
103
74
  const headers = {};
104
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins/{customPluginArn}";
105
- resolvedPath = __resolvedPath(resolvedPath, input, "customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
75
+ b.bp("/v1/custom-plugins/{customPluginArn}");
76
+ b.p("customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
106
77
  let body;
107
- return new __HttpRequest({
108
- protocol,
109
- hostname,
110
- port,
111
- method: "DELETE",
112
- headers,
113
- path: resolvedPath,
114
- body,
115
- });
78
+ b.m("DELETE").h(headers).b(body);
79
+ return b.build();
116
80
  };
117
81
  export const se_DescribeConnectorCommand = async (input, context) => {
118
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
82
+ const b = rb(input, context);
119
83
  const headers = {};
120
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors/{connectorArn}";
121
- resolvedPath = __resolvedPath(resolvedPath, input, "connectorArn", () => input.connectorArn, "{connectorArn}", false);
84
+ b.bp("/v1/connectors/{connectorArn}");
85
+ b.p("connectorArn", () => input.connectorArn, "{connectorArn}", false);
122
86
  let body;
123
- return new __HttpRequest({
124
- protocol,
125
- hostname,
126
- port,
127
- method: "GET",
128
- headers,
129
- path: resolvedPath,
130
- body,
131
- });
87
+ b.m("GET").h(headers).b(body);
88
+ return b.build();
132
89
  };
133
90
  export const se_DescribeCustomPluginCommand = async (input, context) => {
134
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
91
+ const b = rb(input, context);
135
92
  const headers = {};
136
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins/{customPluginArn}";
137
- resolvedPath = __resolvedPath(resolvedPath, input, "customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
93
+ b.bp("/v1/custom-plugins/{customPluginArn}");
94
+ b.p("customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
138
95
  let body;
139
- return new __HttpRequest({
140
- protocol,
141
- hostname,
142
- port,
143
- method: "GET",
144
- headers,
145
- path: resolvedPath,
146
- body,
147
- });
96
+ b.m("GET").h(headers).b(body);
97
+ return b.build();
148
98
  };
149
99
  export const se_DescribeWorkerConfigurationCommand = async (input, context) => {
150
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
100
+ const b = rb(input, context);
151
101
  const headers = {};
152
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
153
- "/v1/worker-configurations/{workerConfigurationArn}";
154
- resolvedPath = __resolvedPath(resolvedPath, input, "workerConfigurationArn", () => input.workerConfigurationArn, "{workerConfigurationArn}", false);
102
+ b.bp("/v1/worker-configurations/{workerConfigurationArn}");
103
+ b.p("workerConfigurationArn", () => input.workerConfigurationArn, "{workerConfigurationArn}", false);
155
104
  let body;
156
- return new __HttpRequest({
157
- protocol,
158
- hostname,
159
- port,
160
- method: "GET",
161
- headers,
162
- path: resolvedPath,
163
- body,
164
- });
105
+ b.m("GET").h(headers).b(body);
106
+ return b.build();
165
107
  };
166
108
  export const se_ListConnectorsCommand = async (input, context) => {
167
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
109
+ const b = rb(input, context);
168
110
  const headers = {};
169
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors";
111
+ b.bp("/v1/connectors");
170
112
  const query = map({
171
- connectorNamePrefix: [, input.connectorNamePrefix],
172
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
173
- nextToken: [, input.nextToken],
113
+ [_cNP]: [, input[_cNP]],
114
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
115
+ [_nT]: [, input[_nT]],
174
116
  });
175
117
  let body;
176
- return new __HttpRequest({
177
- protocol,
178
- hostname,
179
- port,
180
- method: "GET",
181
- headers,
182
- path: resolvedPath,
183
- query,
184
- body,
185
- });
118
+ b.m("GET").h(headers).q(query).b(body);
119
+ return b.build();
186
120
  };
187
121
  export const se_ListCustomPluginsCommand = async (input, context) => {
188
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
122
+ const b = rb(input, context);
189
123
  const headers = {};
190
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins";
124
+ b.bp("/v1/custom-plugins");
191
125
  const query = map({
192
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
193
- nextToken: [, input.nextToken],
126
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
127
+ [_nT]: [, input[_nT]],
194
128
  });
195
129
  let body;
196
- return new __HttpRequest({
197
- protocol,
198
- hostname,
199
- port,
200
- method: "GET",
201
- headers,
202
- path: resolvedPath,
203
- query,
204
- body,
205
- });
130
+ b.m("GET").h(headers).q(query).b(body);
131
+ return b.build();
206
132
  };
207
133
  export const se_ListWorkerConfigurationsCommand = async (input, context) => {
208
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
134
+ const b = rb(input, context);
209
135
  const headers = {};
210
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/worker-configurations";
136
+ b.bp("/v1/worker-configurations");
211
137
  const query = map({
212
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
213
- nextToken: [, input.nextToken],
138
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
139
+ [_nT]: [, input[_nT]],
214
140
  });
215
141
  let body;
216
- return new __HttpRequest({
217
- protocol,
218
- hostname,
219
- port,
220
- method: "GET",
221
- headers,
222
- path: resolvedPath,
223
- query,
224
- body,
225
- });
142
+ b.m("GET").h(headers).q(query).b(body);
143
+ return b.build();
226
144
  };
227
145
  export const se_UpdateConnectorCommand = async (input, context) => {
228
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
146
+ const b = rb(input, context);
229
147
  const headers = {
230
148
  "content-type": "application/json",
231
149
  };
232
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors/{connectorArn}";
233
- resolvedPath = __resolvedPath(resolvedPath, input, "connectorArn", () => input.connectorArn, "{connectorArn}", false);
150
+ b.bp("/v1/connectors/{connectorArn}");
151
+ b.p("connectorArn", () => input.connectorArn, "{connectorArn}", false);
234
152
  const query = map({
235
- currentVersion: [, __expectNonNull(input.currentVersion, `currentVersion`)],
153
+ [_cV]: [, __expectNonNull(input[_cV], `currentVersion`)],
236
154
  });
237
155
  let body;
238
156
  body = JSON.stringify(take(input, {
239
157
  capacity: (_) => _json(_),
240
158
  }));
241
- return new __HttpRequest({
242
- protocol,
243
- hostname,
244
- port,
245
- method: "PUT",
246
- headers,
247
- path: resolvedPath,
248
- query,
249
- body,
250
- });
159
+ b.m("PUT").h(headers).q(query).b(body);
160
+ return b.build();
251
161
  };
252
162
  export const de_CreateConnectorCommand = async (output, context) => {
253
163
  if (output.statusCode !== 200 && output.statusCode >= 300) {
@@ -1114,6 +1024,10 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
1114
1024
  value !== "" &&
1115
1025
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1116
1026
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1027
+ const _cNP = "connectorNamePrefix";
1028
+ const _cV = "currentVersion";
1029
+ const _mR = "maxResults";
1030
+ const _nT = "nextToken";
1117
1031
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1118
1032
  if (encoded.length) {
1119
1033
  return JSON.parse(encoded);
@@ -4,4 +4,4 @@ import { KafkaConnectPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateListConnectors(config: KafkaConnectPaginationConfiguration, input: ListConnectorsCommandInput, ...additionalArguments: any): Paginator<ListConnectorsCommandOutput>;
7
+ export declare const paginateListConnectors: (config: KafkaConnectPaginationConfiguration, input: ListConnectorsCommandInput, ...rest: any[]) => Paginator<ListConnectorsCommandOutput>;
@@ -4,4 +4,4 @@ import { KafkaConnectPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateListCustomPlugins(config: KafkaConnectPaginationConfiguration, input: ListCustomPluginsCommandInput, ...additionalArguments: any): Paginator<ListCustomPluginsCommandOutput>;
7
+ export declare const paginateListCustomPlugins: (config: KafkaConnectPaginationConfiguration, input: ListCustomPluginsCommandInput, ...rest: any[]) => Paginator<ListCustomPluginsCommandOutput>;
@@ -4,4 +4,4 @@ import { KafkaConnectPaginationConfiguration } from "./Interfaces";
4
4
  /**
5
5
  * @public
6
6
  */
7
- export declare function paginateListWorkerConfigurations(config: KafkaConnectPaginationConfiguration, input: ListWorkerConfigurationsCommandInput, ...additionalArguments: any): Paginator<ListWorkerConfigurationsCommandOutput>;
7
+ export declare const paginateListWorkerConfigurations: (config: KafkaConnectPaginationConfiguration, input: ListWorkerConfigurationsCommandInput, ...rest: any[]) => Paginator<ListWorkerConfigurationsCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  ListConnectorsCommandOutput,
5
5
  } from "../commands/ListConnectorsCommand";
6
6
  import { KafkaConnectPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateListConnectors(
7
+ export declare const paginateListConnectors: (
8
8
  config: KafkaConnectPaginationConfiguration,
9
9
  input: ListConnectorsCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<ListConnectorsCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<ListConnectorsCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  ListCustomPluginsCommandOutput,
5
5
  } from "../commands/ListCustomPluginsCommand";
6
6
  import { KafkaConnectPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateListCustomPlugins(
7
+ export declare const paginateListCustomPlugins: (
8
8
  config: KafkaConnectPaginationConfiguration,
9
9
  input: ListCustomPluginsCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<ListCustomPluginsCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<ListCustomPluginsCommandOutput>;
@@ -4,8 +4,8 @@ import {
4
4
  ListWorkerConfigurationsCommandOutput,
5
5
  } from "../commands/ListWorkerConfigurationsCommand";
6
6
  import { KafkaConnectPaginationConfiguration } from "./Interfaces";
7
- export declare function paginateListWorkerConfigurations(
7
+ export declare const paginateListWorkerConfigurations: (
8
8
  config: KafkaConnectPaginationConfiguration,
9
9
  input: ListWorkerConfigurationsCommandInput,
10
- ...additionalArguments: any
11
- ): Paginator<ListWorkerConfigurationsCommandOutput>;
10
+ ...rest: any[]
11
+ ) => Paginator<ListWorkerConfigurationsCommandOutput>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-kafkaconnect",
3
3
  "description": "AWS SDK for JavaScript Kafkaconnect Client for Node.js, Browser and React Native",
4
- "version": "3.476.0",
4
+ "version": "3.478.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,20 +20,21 @@
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.476.0",
24
- "@aws-sdk/core": "3.476.0",
25
- "@aws-sdk/credential-provider-node": "3.476.0",
23
+ "@aws-sdk/client-sts": "3.478.0",
24
+ "@aws-sdk/core": "3.477.0",
25
+ "@aws-sdk/credential-provider-node": "3.478.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",
29
29
  "@aws-sdk/middleware-signing": "3.468.0",
30
- "@aws-sdk/middleware-user-agent": "3.470.0",
30
+ "@aws-sdk/middleware-user-agent": "3.478.0",
31
31
  "@aws-sdk/region-config-resolver": "3.470.0",
32
32
  "@aws-sdk/types": "3.468.0",
33
- "@aws-sdk/util-endpoints": "3.470.0",
33
+ "@aws-sdk/util-endpoints": "3.478.0",
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",