@aws-sdk/client-bedrock 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,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.de_UpdateProvisionedModelThroughputCommand = exports.de_UntagResourceCommand = exports.de_TagResourceCommand = exports.de_StopModelCustomizationJobCommand = exports.de_PutModelInvocationLoggingConfigurationCommand = exports.de_ListTagsForResourceCommand = exports.de_ListProvisionedModelThroughputsCommand = exports.de_ListModelCustomizationJobsCommand = exports.de_ListFoundationModelsCommand = exports.de_ListCustomModelsCommand = exports.de_GetProvisionedModelThroughputCommand = exports.de_GetModelInvocationLoggingConfigurationCommand = exports.de_GetModelCustomizationJobCommand = exports.de_GetFoundationModelCommand = exports.de_GetCustomModelCommand = exports.de_DeleteProvisionedModelThroughputCommand = exports.de_DeleteModelInvocationLoggingConfigurationCommand = exports.de_DeleteCustomModelCommand = exports.de_CreateProvisionedModelThroughputCommand = exports.de_CreateModelCustomizationJobCommand = exports.se_UpdateProvisionedModelThroughputCommand = exports.se_UntagResourceCommand = exports.se_TagResourceCommand = exports.se_StopModelCustomizationJobCommand = exports.se_PutModelInvocationLoggingConfigurationCommand = exports.se_ListTagsForResourceCommand = exports.se_ListProvisionedModelThroughputsCommand = exports.se_ListModelCustomizationJobsCommand = exports.se_ListFoundationModelsCommand = exports.se_ListCustomModelsCommand = exports.se_GetProvisionedModelThroughputCommand = exports.se_GetModelInvocationLoggingConfigurationCommand = exports.se_GetModelCustomizationJobCommand = exports.se_GetFoundationModelCommand = exports.se_GetCustomModelCommand = exports.se_DeleteProvisionedModelThroughputCommand = exports.se_DeleteModelInvocationLoggingConfigurationCommand = exports.se_DeleteCustomModelCommand = exports.se_CreateProvisionedModelThroughputCommand = exports.se_CreateModelCustomizationJobCommand = 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 BedrockServiceException_1 = require("../models/BedrockServiceException");
8
8
  const models_0_1 = require("../models/models_0");
9
9
  const se_CreateModelCustomizationJobCommand = 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 || ""}` + "/model-customization-jobs";
14
+ b.bp("/model-customization-jobs");
15
15
  let body;
16
16
  body = JSON.stringify((0, smithy_client_1.take)(input, {
17
17
  baseModelIdentifier: [],
@@ -29,23 +29,16 @@ const se_CreateModelCustomizationJobCommand = async (input, context) => {
29
29
  validationDataConfig: (_) => (0, smithy_client_1._json)(_),
30
30
  vpcConfig: (_) => (0, smithy_client_1._json)(_),
31
31
  }));
32
- return new protocol_http_1.HttpRequest({
33
- protocol,
34
- hostname,
35
- port,
36
- method: "POST",
37
- headers,
38
- path: resolvedPath,
39
- body,
40
- });
32
+ b.m("POST").h(headers).b(body);
33
+ return b.build();
41
34
  };
42
35
  exports.se_CreateModelCustomizationJobCommand = se_CreateModelCustomizationJobCommand;
43
36
  const se_CreateProvisionedModelThroughputCommand = async (input, context) => {
44
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
37
+ const b = (0, core_1.requestBuilder)(input, context);
45
38
  const headers = {
46
39
  "content-type": "application/json",
47
40
  };
48
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/provisioned-model-throughput";
41
+ b.bp("/provisioned-model-throughput");
49
42
  let body;
50
43
  body = JSON.stringify((0, smithy_client_1.take)(input, {
51
44
  clientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
@@ -55,409 +48,268 @@ const se_CreateProvisionedModelThroughputCommand = async (input, context) => {
55
48
  provisionedModelName: [],
56
49
  tags: (_) => (0, smithy_client_1._json)(_),
57
50
  }));
58
- return new protocol_http_1.HttpRequest({
59
- protocol,
60
- hostname,
61
- port,
62
- method: "POST",
63
- headers,
64
- path: resolvedPath,
65
- body,
66
- });
51
+ b.m("POST").h(headers).b(body);
52
+ return b.build();
67
53
  };
68
54
  exports.se_CreateProvisionedModelThroughputCommand = se_CreateProvisionedModelThroughputCommand;
69
55
  const se_DeleteCustomModelCommand = async (input, context) => {
70
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
56
+ const b = (0, core_1.requestBuilder)(input, context);
71
57
  const headers = {};
72
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/custom-models/{modelIdentifier}";
73
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "modelIdentifier", () => input.modelIdentifier, "{modelIdentifier}", false);
58
+ b.bp("/custom-models/{modelIdentifier}");
59
+ b.p("modelIdentifier", () => input.modelIdentifier, "{modelIdentifier}", false);
74
60
  let body;
75
- return new protocol_http_1.HttpRequest({
76
- protocol,
77
- hostname,
78
- port,
79
- method: "DELETE",
80
- headers,
81
- path: resolvedPath,
82
- body,
83
- });
61
+ b.m("DELETE").h(headers).b(body);
62
+ return b.build();
84
63
  };
85
64
  exports.se_DeleteCustomModelCommand = se_DeleteCustomModelCommand;
86
65
  const se_DeleteModelInvocationLoggingConfigurationCommand = async (input, context) => {
87
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
66
+ const b = (0, core_1.requestBuilder)(input, context);
88
67
  const headers = {
89
68
  "content-type": "application/json",
90
69
  };
91
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/logging/modelinvocations";
70
+ b.bp("/logging/modelinvocations");
92
71
  let body;
93
72
  body = "";
94
- return new protocol_http_1.HttpRequest({
95
- protocol,
96
- hostname,
97
- port,
98
- method: "DELETE",
99
- headers,
100
- path: resolvedPath,
101
- body,
102
- });
73
+ b.m("DELETE").h(headers).b(body);
74
+ return b.build();
103
75
  };
104
76
  exports.se_DeleteModelInvocationLoggingConfigurationCommand = se_DeleteModelInvocationLoggingConfigurationCommand;
105
77
  const se_DeleteProvisionedModelThroughputCommand = async (input, context) => {
106
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
78
+ const b = (0, core_1.requestBuilder)(input, context);
107
79
  const headers = {};
108
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
109
- "/provisioned-model-throughput/{provisionedModelId}";
110
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
80
+ b.bp("/provisioned-model-throughput/{provisionedModelId}");
81
+ b.p("provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
111
82
  let body;
112
- return new protocol_http_1.HttpRequest({
113
- protocol,
114
- hostname,
115
- port,
116
- method: "DELETE",
117
- headers,
118
- path: resolvedPath,
119
- body,
120
- });
83
+ b.m("DELETE").h(headers).b(body);
84
+ return b.build();
121
85
  };
122
86
  exports.se_DeleteProvisionedModelThroughputCommand = se_DeleteProvisionedModelThroughputCommand;
123
87
  const se_GetCustomModelCommand = async (input, context) => {
124
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
88
+ const b = (0, core_1.requestBuilder)(input, context);
125
89
  const headers = {};
126
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/custom-models/{modelIdentifier}";
127
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "modelIdentifier", () => input.modelIdentifier, "{modelIdentifier}", false);
90
+ b.bp("/custom-models/{modelIdentifier}");
91
+ b.p("modelIdentifier", () => input.modelIdentifier, "{modelIdentifier}", false);
128
92
  let body;
129
- return new protocol_http_1.HttpRequest({
130
- protocol,
131
- hostname,
132
- port,
133
- method: "GET",
134
- headers,
135
- path: resolvedPath,
136
- body,
137
- });
93
+ b.m("GET").h(headers).b(body);
94
+ return b.build();
138
95
  };
139
96
  exports.se_GetCustomModelCommand = se_GetCustomModelCommand;
140
97
  const se_GetFoundationModelCommand = async (input, context) => {
141
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
98
+ const b = (0, core_1.requestBuilder)(input, context);
142
99
  const headers = {};
143
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/foundation-models/{modelIdentifier}";
144
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "modelIdentifier", () => input.modelIdentifier, "{modelIdentifier}", false);
100
+ b.bp("/foundation-models/{modelIdentifier}");
101
+ b.p("modelIdentifier", () => input.modelIdentifier, "{modelIdentifier}", false);
145
102
  let body;
146
- return new protocol_http_1.HttpRequest({
147
- protocol,
148
- hostname,
149
- port,
150
- method: "GET",
151
- headers,
152
- path: resolvedPath,
153
- body,
154
- });
103
+ b.m("GET").h(headers).b(body);
104
+ return b.build();
155
105
  };
156
106
  exports.se_GetFoundationModelCommand = se_GetFoundationModelCommand;
157
107
  const se_GetModelCustomizationJobCommand = async (input, context) => {
158
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
108
+ const b = (0, core_1.requestBuilder)(input, context);
159
109
  const headers = {};
160
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/model-customization-jobs/{jobIdentifier}";
161
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "jobIdentifier", () => input.jobIdentifier, "{jobIdentifier}", false);
110
+ b.bp("/model-customization-jobs/{jobIdentifier}");
111
+ b.p("jobIdentifier", () => input.jobIdentifier, "{jobIdentifier}", false);
162
112
  let body;
163
- return new protocol_http_1.HttpRequest({
164
- protocol,
165
- hostname,
166
- port,
167
- method: "GET",
168
- headers,
169
- path: resolvedPath,
170
- body,
171
- });
113
+ b.m("GET").h(headers).b(body);
114
+ return b.build();
172
115
  };
173
116
  exports.se_GetModelCustomizationJobCommand = se_GetModelCustomizationJobCommand;
174
117
  const se_GetModelInvocationLoggingConfigurationCommand = async (input, context) => {
175
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
118
+ const b = (0, core_1.requestBuilder)(input, context);
176
119
  const headers = {
177
120
  "content-type": "application/json",
178
121
  };
179
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/logging/modelinvocations";
122
+ b.bp("/logging/modelinvocations");
180
123
  let body;
181
124
  body = "";
182
- return new protocol_http_1.HttpRequest({
183
- protocol,
184
- hostname,
185
- port,
186
- method: "GET",
187
- headers,
188
- path: resolvedPath,
189
- body,
190
- });
125
+ b.m("GET").h(headers).b(body);
126
+ return b.build();
191
127
  };
192
128
  exports.se_GetModelInvocationLoggingConfigurationCommand = se_GetModelInvocationLoggingConfigurationCommand;
193
129
  const se_GetProvisionedModelThroughputCommand = async (input, context) => {
194
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
130
+ const b = (0, core_1.requestBuilder)(input, context);
195
131
  const headers = {};
196
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
197
- "/provisioned-model-throughput/{provisionedModelId}";
198
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
132
+ b.bp("/provisioned-model-throughput/{provisionedModelId}");
133
+ b.p("provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
199
134
  let body;
200
- return new protocol_http_1.HttpRequest({
201
- protocol,
202
- hostname,
203
- port,
204
- method: "GET",
205
- headers,
206
- path: resolvedPath,
207
- body,
208
- });
135
+ b.m("GET").h(headers).b(body);
136
+ return b.build();
209
137
  };
210
138
  exports.se_GetProvisionedModelThroughputCommand = se_GetProvisionedModelThroughputCommand;
211
139
  const se_ListCustomModelsCommand = async (input, context) => {
212
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
140
+ const b = (0, core_1.requestBuilder)(input, context);
213
141
  const headers = {};
214
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/custom-models";
142
+ b.bp("/custom-models");
215
143
  const query = (0, smithy_client_1.map)({
216
- creationTimeBefore: [
144
+ [_cTB]: [
217
145
  () => input.creationTimeBefore !== void 0,
218
- () => (input.creationTimeBefore.toISOString().split(".")[0] + "Z").toString(),
146
+ () => (input[_cTB].toISOString().split(".")[0] + "Z").toString(),
219
147
  ],
220
- creationTimeAfter: [
148
+ [_cTA]: [
221
149
  () => input.creationTimeAfter !== void 0,
222
- () => (input.creationTimeAfter.toISOString().split(".")[0] + "Z").toString(),
150
+ () => (input[_cTA].toISOString().split(".")[0] + "Z").toString(),
223
151
  ],
224
- nameContains: [, input.nameContains],
225
- baseModelArnEquals: [, input.baseModelArnEquals],
226
- foundationModelArnEquals: [, input.foundationModelArnEquals],
227
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
228
- nextToken: [, input.nextToken],
229
- sortBy: [, input.sortBy],
230
- sortOrder: [, input.sortOrder],
152
+ [_nC]: [, input[_nC]],
153
+ [_bMAE]: [, input[_bMAE]],
154
+ [_fMAE]: [, input[_fMAE]],
155
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
156
+ [_nT]: [, input[_nT]],
157
+ [_sB]: [, input[_sB]],
158
+ [_sO]: [, input[_sO]],
231
159
  });
232
160
  let body;
233
- return new protocol_http_1.HttpRequest({
234
- protocol,
235
- hostname,
236
- port,
237
- method: "GET",
238
- headers,
239
- path: resolvedPath,
240
- query,
241
- body,
242
- });
161
+ b.m("GET").h(headers).q(query).b(body);
162
+ return b.build();
243
163
  };
244
164
  exports.se_ListCustomModelsCommand = se_ListCustomModelsCommand;
245
165
  const se_ListFoundationModelsCommand = async (input, context) => {
246
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
166
+ const b = (0, core_1.requestBuilder)(input, context);
247
167
  const headers = {};
248
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/foundation-models";
168
+ b.bp("/foundation-models");
249
169
  const query = (0, smithy_client_1.map)({
250
- byProvider: [, input.byProvider],
251
- byCustomizationType: [, input.byCustomizationType],
252
- byOutputModality: [, input.byOutputModality],
253
- byInferenceType: [, input.byInferenceType],
170
+ [_bP]: [, input[_bP]],
171
+ [_bCT]: [, input[_bCT]],
172
+ [_bOM]: [, input[_bOM]],
173
+ [_bIT]: [, input[_bIT]],
254
174
  });
255
175
  let body;
256
- return new protocol_http_1.HttpRequest({
257
- protocol,
258
- hostname,
259
- port,
260
- method: "GET",
261
- headers,
262
- path: resolvedPath,
263
- query,
264
- body,
265
- });
176
+ b.m("GET").h(headers).q(query).b(body);
177
+ return b.build();
266
178
  };
267
179
  exports.se_ListFoundationModelsCommand = se_ListFoundationModelsCommand;
268
180
  const se_ListModelCustomizationJobsCommand = async (input, context) => {
269
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
181
+ const b = (0, core_1.requestBuilder)(input, context);
270
182
  const headers = {};
271
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/model-customization-jobs";
183
+ b.bp("/model-customization-jobs");
272
184
  const query = (0, smithy_client_1.map)({
273
- creationTimeAfter: [
185
+ [_cTA]: [
274
186
  () => input.creationTimeAfter !== void 0,
275
- () => (input.creationTimeAfter.toISOString().split(".")[0] + "Z").toString(),
187
+ () => (input[_cTA].toISOString().split(".")[0] + "Z").toString(),
276
188
  ],
277
- creationTimeBefore: [
189
+ [_cTB]: [
278
190
  () => input.creationTimeBefore !== void 0,
279
- () => (input.creationTimeBefore.toISOString().split(".")[0] + "Z").toString(),
191
+ () => (input[_cTB].toISOString().split(".")[0] + "Z").toString(),
280
192
  ],
281
- statusEquals: [, input.statusEquals],
282
- nameContains: [, input.nameContains],
283
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
284
- nextToken: [, input.nextToken],
285
- sortBy: [, input.sortBy],
286
- sortOrder: [, input.sortOrder],
193
+ [_sE]: [, input[_sE]],
194
+ [_nC]: [, input[_nC]],
195
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
196
+ [_nT]: [, input[_nT]],
197
+ [_sB]: [, input[_sB]],
198
+ [_sO]: [, input[_sO]],
287
199
  });
288
200
  let body;
289
- return new protocol_http_1.HttpRequest({
290
- protocol,
291
- hostname,
292
- port,
293
- method: "GET",
294
- headers,
295
- path: resolvedPath,
296
- query,
297
- body,
298
- });
201
+ b.m("GET").h(headers).q(query).b(body);
202
+ return b.build();
299
203
  };
300
204
  exports.se_ListModelCustomizationJobsCommand = se_ListModelCustomizationJobsCommand;
301
205
  const se_ListProvisionedModelThroughputsCommand = async (input, context) => {
302
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
206
+ const b = (0, core_1.requestBuilder)(input, context);
303
207
  const headers = {};
304
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/provisioned-model-throughputs";
208
+ b.bp("/provisioned-model-throughputs");
305
209
  const query = (0, smithy_client_1.map)({
306
- creationTimeAfter: [
210
+ [_cTA]: [
307
211
  () => input.creationTimeAfter !== void 0,
308
- () => (input.creationTimeAfter.toISOString().split(".")[0] + "Z").toString(),
212
+ () => (input[_cTA].toISOString().split(".")[0] + "Z").toString(),
309
213
  ],
310
- creationTimeBefore: [
214
+ [_cTB]: [
311
215
  () => input.creationTimeBefore !== void 0,
312
- () => (input.creationTimeBefore.toISOString().split(".")[0] + "Z").toString(),
216
+ () => (input[_cTB].toISOString().split(".")[0] + "Z").toString(),
313
217
  ],
314
- statusEquals: [, input.statusEquals],
315
- modelArnEquals: [, input.modelArnEquals],
316
- nameContains: [, input.nameContains],
317
- maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
318
- nextToken: [, input.nextToken],
319
- sortBy: [, input.sortBy],
320
- sortOrder: [, input.sortOrder],
218
+ [_sE]: [, input[_sE]],
219
+ [_mAE]: [, input[_mAE]],
220
+ [_nC]: [, input[_nC]],
221
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
222
+ [_nT]: [, input[_nT]],
223
+ [_sB]: [, input[_sB]],
224
+ [_sO]: [, input[_sO]],
321
225
  });
322
226
  let body;
323
- return new protocol_http_1.HttpRequest({
324
- protocol,
325
- hostname,
326
- port,
327
- method: "GET",
328
- headers,
329
- path: resolvedPath,
330
- query,
331
- body,
332
- });
227
+ b.m("GET").h(headers).q(query).b(body);
228
+ return b.build();
333
229
  };
334
230
  exports.se_ListProvisionedModelThroughputsCommand = se_ListProvisionedModelThroughputsCommand;
335
231
  const se_ListTagsForResourceCommand = async (input, context) => {
336
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
232
+ const b = (0, core_1.requestBuilder)(input, context);
337
233
  const headers = {
338
234
  "content-type": "application/json",
339
235
  };
340
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/listTagsForResource";
236
+ b.bp("/listTagsForResource");
341
237
  let body;
342
238
  body = JSON.stringify((0, smithy_client_1.take)(input, {
343
239
  resourceARN: [],
344
240
  }));
345
- return new protocol_http_1.HttpRequest({
346
- protocol,
347
- hostname,
348
- port,
349
- method: "POST",
350
- headers,
351
- path: resolvedPath,
352
- body,
353
- });
241
+ b.m("POST").h(headers).b(body);
242
+ return b.build();
354
243
  };
355
244
  exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
356
245
  const se_PutModelInvocationLoggingConfigurationCommand = async (input, context) => {
357
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
246
+ const b = (0, core_1.requestBuilder)(input, context);
358
247
  const headers = {
359
248
  "content-type": "application/json",
360
249
  };
361
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/logging/modelinvocations";
250
+ b.bp("/logging/modelinvocations");
362
251
  let body;
363
252
  body = JSON.stringify((0, smithy_client_1.take)(input, {
364
253
  loggingConfig: (_) => (0, smithy_client_1._json)(_),
365
254
  }));
366
- return new protocol_http_1.HttpRequest({
367
- protocol,
368
- hostname,
369
- port,
370
- method: "PUT",
371
- headers,
372
- path: resolvedPath,
373
- body,
374
- });
255
+ b.m("PUT").h(headers).b(body);
256
+ return b.build();
375
257
  };
376
258
  exports.se_PutModelInvocationLoggingConfigurationCommand = se_PutModelInvocationLoggingConfigurationCommand;
377
259
  const se_StopModelCustomizationJobCommand = async (input, context) => {
378
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
260
+ const b = (0, core_1.requestBuilder)(input, context);
379
261
  const headers = {};
380
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
381
- "/model-customization-jobs/{jobIdentifier}/stop";
382
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "jobIdentifier", () => input.jobIdentifier, "{jobIdentifier}", false);
262
+ b.bp("/model-customization-jobs/{jobIdentifier}/stop");
263
+ b.p("jobIdentifier", () => input.jobIdentifier, "{jobIdentifier}", false);
383
264
  let body;
384
- return new protocol_http_1.HttpRequest({
385
- protocol,
386
- hostname,
387
- port,
388
- method: "POST",
389
- headers,
390
- path: resolvedPath,
391
- body,
392
- });
265
+ b.m("POST").h(headers).b(body);
266
+ return b.build();
393
267
  };
394
268
  exports.se_StopModelCustomizationJobCommand = se_StopModelCustomizationJobCommand;
395
269
  const se_TagResourceCommand = async (input, context) => {
396
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
270
+ const b = (0, core_1.requestBuilder)(input, context);
397
271
  const headers = {
398
272
  "content-type": "application/json",
399
273
  };
400
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/tagResource";
274
+ b.bp("/tagResource");
401
275
  let body;
402
276
  body = JSON.stringify((0, smithy_client_1.take)(input, {
403
277
  resourceARN: [],
404
278
  tags: (_) => (0, smithy_client_1._json)(_),
405
279
  }));
406
- return new protocol_http_1.HttpRequest({
407
- protocol,
408
- hostname,
409
- port,
410
- method: "POST",
411
- headers,
412
- path: resolvedPath,
413
- body,
414
- });
280
+ b.m("POST").h(headers).b(body);
281
+ return b.build();
415
282
  };
416
283
  exports.se_TagResourceCommand = se_TagResourceCommand;
417
284
  const se_UntagResourceCommand = async (input, context) => {
418
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
285
+ const b = (0, core_1.requestBuilder)(input, context);
419
286
  const headers = {
420
287
  "content-type": "application/json",
421
288
  };
422
- const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/untagResource";
289
+ b.bp("/untagResource");
423
290
  let body;
424
291
  body = JSON.stringify((0, smithy_client_1.take)(input, {
425
292
  resourceARN: [],
426
293
  tagKeys: (_) => (0, smithy_client_1._json)(_),
427
294
  }));
428
- return new protocol_http_1.HttpRequest({
429
- protocol,
430
- hostname,
431
- port,
432
- method: "POST",
433
- headers,
434
- path: resolvedPath,
435
- body,
436
- });
295
+ b.m("POST").h(headers).b(body);
296
+ return b.build();
437
297
  };
438
298
  exports.se_UntagResourceCommand = se_UntagResourceCommand;
439
299
  const se_UpdateProvisionedModelThroughputCommand = async (input, context) => {
440
- const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
300
+ const b = (0, core_1.requestBuilder)(input, context);
441
301
  const headers = {
442
302
  "content-type": "application/json",
443
303
  };
444
- let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
445
- "/provisioned-model-throughput/{provisionedModelId}";
446
- resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
304
+ b.bp("/provisioned-model-throughput/{provisionedModelId}");
305
+ b.p("provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
447
306
  let body;
448
307
  body = JSON.stringify((0, smithy_client_1.take)(input, {
449
308
  desiredModelId: [],
450
309
  desiredProvisionedModelName: [],
451
310
  }));
452
- return new protocol_http_1.HttpRequest({
453
- protocol,
454
- hostname,
455
- port,
456
- method: "PATCH",
457
- headers,
458
- path: resolvedPath,
459
- body,
460
- });
311
+ b.m("PATCH").h(headers).b(body);
312
+ return b.build();
461
313
  };
462
314
  exports.se_UpdateProvisionedModelThroughputCommand = se_UpdateProvisionedModelThroughputCommand;
463
315
  const de_CreateModelCustomizationJobCommand = async (output, context) => {
@@ -1596,6 +1448,21 @@ const isSerializableHeaderValue = (value) => value !== undefined &&
1596
1448
  value !== "" &&
1597
1449
  (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
1598
1450
  (!Object.getOwnPropertyNames(value).includes("size") || value.size != 0);
1451
+ const _bCT = "byCustomizationType";
1452
+ const _bIT = "byInferenceType";
1453
+ const _bMAE = "baseModelArnEquals";
1454
+ const _bOM = "byOutputModality";
1455
+ const _bP = "byProvider";
1456
+ const _cTA = "creationTimeAfter";
1457
+ const _cTB = "creationTimeBefore";
1458
+ const _fMAE = "foundationModelArnEquals";
1459
+ const _mAE = "modelArnEquals";
1460
+ const _mR = "maxResults";
1461
+ const _nC = "nameContains";
1462
+ const _nT = "nextToken";
1463
+ const _sB = "sortBy";
1464
+ const _sE = "statusEquals";
1465
+ const _sO = "sortOrder";
1599
1466
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1600
1467
  if (encoded.length) {
1601
1468
  return JSON.parse(encoded);
@@ -1,25 +1,4 @@
1
+ import { createPaginator } from "@smithy/core";
1
2
  import { BedrockClient } from "../BedrockClient";
2
3
  import { ListCustomModelsCommand, } from "../commands/ListCustomModelsCommand";
3
- const makePagedClientRequest = async (client, input, ...args) => {
4
- return await client.send(new ListCustomModelsCommand(input), ...args);
5
- };
6
- export async function* paginateListCustomModels(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 BedrockClient) {
14
- page = await makePagedClientRequest(config.client, input, ...additionalArguments);
15
- }
16
- else {
17
- throw new Error("Invalid client, expected Bedrock | BedrockClient");
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 paginateListCustomModels = createPaginator(BedrockClient, ListCustomModelsCommand, "nextToken", "nextToken", "maxResults");