@aws-sdk/client-bedrock 3.490.0 → 3.496.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist-cjs/Bedrock.js +1 -51
  2. package/dist-cjs/BedrockClient.js +1 -43
  3. package/dist-cjs/commands/CreateModelCustomizationJobCommand.js +1 -28
  4. package/dist-cjs/commands/CreateProvisionedModelThroughputCommand.js +1 -28
  5. package/dist-cjs/commands/DeleteCustomModelCommand.js +1 -28
  6. package/dist-cjs/commands/DeleteModelInvocationLoggingConfigurationCommand.js +1 -28
  7. package/dist-cjs/commands/DeleteProvisionedModelThroughputCommand.js +1 -28
  8. package/dist-cjs/commands/GetCustomModelCommand.js +1 -28
  9. package/dist-cjs/commands/GetFoundationModelCommand.js +1 -28
  10. package/dist-cjs/commands/GetModelCustomizationJobCommand.js +1 -28
  11. package/dist-cjs/commands/GetModelInvocationLoggingConfigurationCommand.js +1 -28
  12. package/dist-cjs/commands/GetProvisionedModelThroughputCommand.js +1 -28
  13. package/dist-cjs/commands/ListCustomModelsCommand.js +1 -28
  14. package/dist-cjs/commands/ListFoundationModelsCommand.js +1 -28
  15. package/dist-cjs/commands/ListModelCustomizationJobsCommand.js +1 -28
  16. package/dist-cjs/commands/ListProvisionedModelThroughputsCommand.js +1 -28
  17. package/dist-cjs/commands/ListTagsForResourceCommand.js +1 -28
  18. package/dist-cjs/commands/PutModelInvocationLoggingConfigurationCommand.js +1 -28
  19. package/dist-cjs/commands/StopModelCustomizationJobCommand.js +1 -28
  20. package/dist-cjs/commands/TagResourceCommand.js +1 -28
  21. package/dist-cjs/commands/UntagResourceCommand.js +1 -28
  22. package/dist-cjs/commands/UpdateProvisionedModelThroughputCommand.js +1 -28
  23. package/dist-cjs/commands/index.js +1 -23
  24. package/dist-cjs/endpoint/EndpointParameters.js +1 -18
  25. package/dist-cjs/extensionConfiguration.js +1 -2
  26. package/dist-cjs/index.js +2275 -11
  27. package/dist-cjs/models/BedrockServiceException.js +1 -12
  28. package/dist-cjs/models/index.js +1 -4
  29. package/dist-cjs/models/models_0.js +1 -167
  30. package/dist-cjs/pagination/Interfaces.js +1 -2
  31. package/dist-cjs/pagination/ListCustomModelsPaginator.js +1 -7
  32. package/dist-cjs/pagination/ListModelCustomizationJobsPaginator.js +1 -7
  33. package/dist-cjs/pagination/ListProvisionedModelThroughputsPaginator.js +1 -7
  34. package/dist-cjs/pagination/index.js +1 -7
  35. package/dist-cjs/protocols/Aws_restJson1.js +1 -1505
  36. package/dist-cjs/runtimeExtensions.js +1 -22
  37. package/package.json +40 -40
@@ -1,1505 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
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 core_1 = require("@smithy/core");
5
- const smithy_client_1 = require("@smithy/smithy-client");
6
- const uuid_1 = require("uuid");
7
- const BedrockServiceException_1 = require("../models/BedrockServiceException");
8
- const models_0_1 = require("../models/models_0");
9
- const se_CreateModelCustomizationJobCommand = async (input, context) => {
10
- const b = (0, core_1.requestBuilder)(input, context);
11
- const headers = {
12
- "content-type": "application/json",
13
- };
14
- b.bp("/model-customization-jobs");
15
- let body;
16
- body = JSON.stringify((0, smithy_client_1.take)(input, {
17
- baseModelIdentifier: [],
18
- clientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
19
- customModelKmsKeyId: [],
20
- customModelName: [],
21
- customModelTags: (_) => (0, smithy_client_1._json)(_),
22
- customizationType: [],
23
- hyperParameters: (_) => (0, smithy_client_1._json)(_),
24
- jobName: [],
25
- jobTags: (_) => (0, smithy_client_1._json)(_),
26
- outputDataConfig: (_) => (0, smithy_client_1._json)(_),
27
- roleArn: [],
28
- trainingDataConfig: (_) => (0, smithy_client_1._json)(_),
29
- validationDataConfig: (_) => (0, smithy_client_1._json)(_),
30
- vpcConfig: (_) => (0, smithy_client_1._json)(_),
31
- }));
32
- b.m("POST").h(headers).b(body);
33
- return b.build();
34
- };
35
- exports.se_CreateModelCustomizationJobCommand = se_CreateModelCustomizationJobCommand;
36
- const se_CreateProvisionedModelThroughputCommand = async (input, context) => {
37
- const b = (0, core_1.requestBuilder)(input, context);
38
- const headers = {
39
- "content-type": "application/json",
40
- };
41
- b.bp("/provisioned-model-throughput");
42
- let body;
43
- body = JSON.stringify((0, smithy_client_1.take)(input, {
44
- clientRequestToken: [true, (_) => _ ?? (0, uuid_1.v4)()],
45
- commitmentDuration: [],
46
- modelId: [],
47
- modelUnits: [],
48
- provisionedModelName: [],
49
- tags: (_) => (0, smithy_client_1._json)(_),
50
- }));
51
- b.m("POST").h(headers).b(body);
52
- return b.build();
53
- };
54
- exports.se_CreateProvisionedModelThroughputCommand = se_CreateProvisionedModelThroughputCommand;
55
- const se_DeleteCustomModelCommand = async (input, context) => {
56
- const b = (0, core_1.requestBuilder)(input, context);
57
- const headers = {};
58
- b.bp("/custom-models/{modelIdentifier}");
59
- b.p("modelIdentifier", () => input.modelIdentifier, "{modelIdentifier}", false);
60
- let body;
61
- b.m("DELETE").h(headers).b(body);
62
- return b.build();
63
- };
64
- exports.se_DeleteCustomModelCommand = se_DeleteCustomModelCommand;
65
- const se_DeleteModelInvocationLoggingConfigurationCommand = async (input, context) => {
66
- const b = (0, core_1.requestBuilder)(input, context);
67
- const headers = {
68
- "content-type": "application/json",
69
- };
70
- b.bp("/logging/modelinvocations");
71
- let body;
72
- body = "";
73
- b.m("DELETE").h(headers).b(body);
74
- return b.build();
75
- };
76
- exports.se_DeleteModelInvocationLoggingConfigurationCommand = se_DeleteModelInvocationLoggingConfigurationCommand;
77
- const se_DeleteProvisionedModelThroughputCommand = async (input, context) => {
78
- const b = (0, core_1.requestBuilder)(input, context);
79
- const headers = {};
80
- b.bp("/provisioned-model-throughput/{provisionedModelId}");
81
- b.p("provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
82
- let body;
83
- b.m("DELETE").h(headers).b(body);
84
- return b.build();
85
- };
86
- exports.se_DeleteProvisionedModelThroughputCommand = se_DeleteProvisionedModelThroughputCommand;
87
- const se_GetCustomModelCommand = async (input, context) => {
88
- const b = (0, core_1.requestBuilder)(input, context);
89
- const headers = {};
90
- b.bp("/custom-models/{modelIdentifier}");
91
- b.p("modelIdentifier", () => input.modelIdentifier, "{modelIdentifier}", false);
92
- let body;
93
- b.m("GET").h(headers).b(body);
94
- return b.build();
95
- };
96
- exports.se_GetCustomModelCommand = se_GetCustomModelCommand;
97
- const se_GetFoundationModelCommand = async (input, context) => {
98
- const b = (0, core_1.requestBuilder)(input, context);
99
- const headers = {};
100
- b.bp("/foundation-models/{modelIdentifier}");
101
- b.p("modelIdentifier", () => input.modelIdentifier, "{modelIdentifier}", false);
102
- let body;
103
- b.m("GET").h(headers).b(body);
104
- return b.build();
105
- };
106
- exports.se_GetFoundationModelCommand = se_GetFoundationModelCommand;
107
- const se_GetModelCustomizationJobCommand = async (input, context) => {
108
- const b = (0, core_1.requestBuilder)(input, context);
109
- const headers = {};
110
- b.bp("/model-customization-jobs/{jobIdentifier}");
111
- b.p("jobIdentifier", () => input.jobIdentifier, "{jobIdentifier}", false);
112
- let body;
113
- b.m("GET").h(headers).b(body);
114
- return b.build();
115
- };
116
- exports.se_GetModelCustomizationJobCommand = se_GetModelCustomizationJobCommand;
117
- const se_GetModelInvocationLoggingConfigurationCommand = async (input, context) => {
118
- const b = (0, core_1.requestBuilder)(input, context);
119
- const headers = {
120
- "content-type": "application/json",
121
- };
122
- b.bp("/logging/modelinvocations");
123
- let body;
124
- body = "";
125
- b.m("GET").h(headers).b(body);
126
- return b.build();
127
- };
128
- exports.se_GetModelInvocationLoggingConfigurationCommand = se_GetModelInvocationLoggingConfigurationCommand;
129
- const se_GetProvisionedModelThroughputCommand = async (input, context) => {
130
- const b = (0, core_1.requestBuilder)(input, context);
131
- const headers = {};
132
- b.bp("/provisioned-model-throughput/{provisionedModelId}");
133
- b.p("provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
134
- let body;
135
- b.m("GET").h(headers).b(body);
136
- return b.build();
137
- };
138
- exports.se_GetProvisionedModelThroughputCommand = se_GetProvisionedModelThroughputCommand;
139
- const se_ListCustomModelsCommand = async (input, context) => {
140
- const b = (0, core_1.requestBuilder)(input, context);
141
- const headers = {};
142
- b.bp("/custom-models");
143
- const query = (0, smithy_client_1.map)({
144
- [_cTB]: [
145
- () => input.creationTimeBefore !== void 0,
146
- () => (input[_cTB].toISOString().split(".")[0] + "Z").toString(),
147
- ],
148
- [_cTA]: [
149
- () => input.creationTimeAfter !== void 0,
150
- () => (input[_cTA].toISOString().split(".")[0] + "Z").toString(),
151
- ],
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]],
159
- });
160
- let body;
161
- b.m("GET").h(headers).q(query).b(body);
162
- return b.build();
163
- };
164
- exports.se_ListCustomModelsCommand = se_ListCustomModelsCommand;
165
- const se_ListFoundationModelsCommand = async (input, context) => {
166
- const b = (0, core_1.requestBuilder)(input, context);
167
- const headers = {};
168
- b.bp("/foundation-models");
169
- const query = (0, smithy_client_1.map)({
170
- [_bP]: [, input[_bP]],
171
- [_bCT]: [, input[_bCT]],
172
- [_bOM]: [, input[_bOM]],
173
- [_bIT]: [, input[_bIT]],
174
- });
175
- let body;
176
- b.m("GET").h(headers).q(query).b(body);
177
- return b.build();
178
- };
179
- exports.se_ListFoundationModelsCommand = se_ListFoundationModelsCommand;
180
- const se_ListModelCustomizationJobsCommand = async (input, context) => {
181
- const b = (0, core_1.requestBuilder)(input, context);
182
- const headers = {};
183
- b.bp("/model-customization-jobs");
184
- const query = (0, smithy_client_1.map)({
185
- [_cTA]: [
186
- () => input.creationTimeAfter !== void 0,
187
- () => (input[_cTA].toISOString().split(".")[0] + "Z").toString(),
188
- ],
189
- [_cTB]: [
190
- () => input.creationTimeBefore !== void 0,
191
- () => (input[_cTB].toISOString().split(".")[0] + "Z").toString(),
192
- ],
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]],
199
- });
200
- let body;
201
- b.m("GET").h(headers).q(query).b(body);
202
- return b.build();
203
- };
204
- exports.se_ListModelCustomizationJobsCommand = se_ListModelCustomizationJobsCommand;
205
- const se_ListProvisionedModelThroughputsCommand = async (input, context) => {
206
- const b = (0, core_1.requestBuilder)(input, context);
207
- const headers = {};
208
- b.bp("/provisioned-model-throughputs");
209
- const query = (0, smithy_client_1.map)({
210
- [_cTA]: [
211
- () => input.creationTimeAfter !== void 0,
212
- () => (input[_cTA].toISOString().split(".")[0] + "Z").toString(),
213
- ],
214
- [_cTB]: [
215
- () => input.creationTimeBefore !== void 0,
216
- () => (input[_cTB].toISOString().split(".")[0] + "Z").toString(),
217
- ],
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]],
225
- });
226
- let body;
227
- b.m("GET").h(headers).q(query).b(body);
228
- return b.build();
229
- };
230
- exports.se_ListProvisionedModelThroughputsCommand = se_ListProvisionedModelThroughputsCommand;
231
- const se_ListTagsForResourceCommand = async (input, context) => {
232
- const b = (0, core_1.requestBuilder)(input, context);
233
- const headers = {
234
- "content-type": "application/json",
235
- };
236
- b.bp("/listTagsForResource");
237
- let body;
238
- body = JSON.stringify((0, smithy_client_1.take)(input, {
239
- resourceARN: [],
240
- }));
241
- b.m("POST").h(headers).b(body);
242
- return b.build();
243
- };
244
- exports.se_ListTagsForResourceCommand = se_ListTagsForResourceCommand;
245
- const se_PutModelInvocationLoggingConfigurationCommand = async (input, context) => {
246
- const b = (0, core_1.requestBuilder)(input, context);
247
- const headers = {
248
- "content-type": "application/json",
249
- };
250
- b.bp("/logging/modelinvocations");
251
- let body;
252
- body = JSON.stringify((0, smithy_client_1.take)(input, {
253
- loggingConfig: (_) => (0, smithy_client_1._json)(_),
254
- }));
255
- b.m("PUT").h(headers).b(body);
256
- return b.build();
257
- };
258
- exports.se_PutModelInvocationLoggingConfigurationCommand = se_PutModelInvocationLoggingConfigurationCommand;
259
- const se_StopModelCustomizationJobCommand = async (input, context) => {
260
- const b = (0, core_1.requestBuilder)(input, context);
261
- const headers = {};
262
- b.bp("/model-customization-jobs/{jobIdentifier}/stop");
263
- b.p("jobIdentifier", () => input.jobIdentifier, "{jobIdentifier}", false);
264
- let body;
265
- b.m("POST").h(headers).b(body);
266
- return b.build();
267
- };
268
- exports.se_StopModelCustomizationJobCommand = se_StopModelCustomizationJobCommand;
269
- const se_TagResourceCommand = async (input, context) => {
270
- const b = (0, core_1.requestBuilder)(input, context);
271
- const headers = {
272
- "content-type": "application/json",
273
- };
274
- b.bp("/tagResource");
275
- let body;
276
- body = JSON.stringify((0, smithy_client_1.take)(input, {
277
- resourceARN: [],
278
- tags: (_) => (0, smithy_client_1._json)(_),
279
- }));
280
- b.m("POST").h(headers).b(body);
281
- return b.build();
282
- };
283
- exports.se_TagResourceCommand = se_TagResourceCommand;
284
- const se_UntagResourceCommand = async (input, context) => {
285
- const b = (0, core_1.requestBuilder)(input, context);
286
- const headers = {
287
- "content-type": "application/json",
288
- };
289
- b.bp("/untagResource");
290
- let body;
291
- body = JSON.stringify((0, smithy_client_1.take)(input, {
292
- resourceARN: [],
293
- tagKeys: (_) => (0, smithy_client_1._json)(_),
294
- }));
295
- b.m("POST").h(headers).b(body);
296
- return b.build();
297
- };
298
- exports.se_UntagResourceCommand = se_UntagResourceCommand;
299
- const se_UpdateProvisionedModelThroughputCommand = async (input, context) => {
300
- const b = (0, core_1.requestBuilder)(input, context);
301
- const headers = {
302
- "content-type": "application/json",
303
- };
304
- b.bp("/provisioned-model-throughput/{provisionedModelId}");
305
- b.p("provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
306
- let body;
307
- body = JSON.stringify((0, smithy_client_1.take)(input, {
308
- desiredModelId: [],
309
- desiredProvisionedModelName: [],
310
- }));
311
- b.m("PATCH").h(headers).b(body);
312
- return b.build();
313
- };
314
- exports.se_UpdateProvisionedModelThroughputCommand = se_UpdateProvisionedModelThroughputCommand;
315
- const de_CreateModelCustomizationJobCommand = async (output, context) => {
316
- if (output.statusCode !== 201 && output.statusCode >= 300) {
317
- return de_CreateModelCustomizationJobCommandError(output, context);
318
- }
319
- const contents = (0, smithy_client_1.map)({
320
- $metadata: deserializeMetadata(output),
321
- });
322
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
323
- const doc = (0, smithy_client_1.take)(data, {
324
- jobArn: smithy_client_1.expectString,
325
- });
326
- Object.assign(contents, doc);
327
- return contents;
328
- };
329
- exports.de_CreateModelCustomizationJobCommand = de_CreateModelCustomizationJobCommand;
330
- const de_CreateModelCustomizationJobCommandError = async (output, context) => {
331
- const parsedOutput = {
332
- ...output,
333
- body: await parseErrorBody(output.body, context),
334
- };
335
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
336
- switch (errorCode) {
337
- case "AccessDeniedException":
338
- case "com.amazonaws.bedrock#AccessDeniedException":
339
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
340
- case "ConflictException":
341
- case "com.amazonaws.bedrock#ConflictException":
342
- throw await de_ConflictExceptionRes(parsedOutput, context);
343
- case "InternalServerException":
344
- case "com.amazonaws.bedrock#InternalServerException":
345
- throw await de_InternalServerExceptionRes(parsedOutput, context);
346
- case "ResourceNotFoundException":
347
- case "com.amazonaws.bedrock#ResourceNotFoundException":
348
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
349
- case "ServiceQuotaExceededException":
350
- case "com.amazonaws.bedrock#ServiceQuotaExceededException":
351
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
352
- case "ThrottlingException":
353
- case "com.amazonaws.bedrock#ThrottlingException":
354
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
355
- case "TooManyTagsException":
356
- case "com.amazonaws.bedrock#TooManyTagsException":
357
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
358
- case "ValidationException":
359
- case "com.amazonaws.bedrock#ValidationException":
360
- throw await de_ValidationExceptionRes(parsedOutput, context);
361
- default:
362
- const parsedBody = parsedOutput.body;
363
- return throwDefaultError({
364
- output,
365
- parsedBody,
366
- errorCode,
367
- });
368
- }
369
- };
370
- const de_CreateProvisionedModelThroughputCommand = async (output, context) => {
371
- if (output.statusCode !== 201 && output.statusCode >= 300) {
372
- return de_CreateProvisionedModelThroughputCommandError(output, context);
373
- }
374
- const contents = (0, smithy_client_1.map)({
375
- $metadata: deserializeMetadata(output),
376
- });
377
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
378
- const doc = (0, smithy_client_1.take)(data, {
379
- provisionedModelArn: smithy_client_1.expectString,
380
- });
381
- Object.assign(contents, doc);
382
- return contents;
383
- };
384
- exports.de_CreateProvisionedModelThroughputCommand = de_CreateProvisionedModelThroughputCommand;
385
- const de_CreateProvisionedModelThroughputCommandError = async (output, context) => {
386
- const parsedOutput = {
387
- ...output,
388
- body: await parseErrorBody(output.body, context),
389
- };
390
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
391
- switch (errorCode) {
392
- case "AccessDeniedException":
393
- case "com.amazonaws.bedrock#AccessDeniedException":
394
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
395
- case "InternalServerException":
396
- case "com.amazonaws.bedrock#InternalServerException":
397
- throw await de_InternalServerExceptionRes(parsedOutput, context);
398
- case "ResourceNotFoundException":
399
- case "com.amazonaws.bedrock#ResourceNotFoundException":
400
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
401
- case "ServiceQuotaExceededException":
402
- case "com.amazonaws.bedrock#ServiceQuotaExceededException":
403
- throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
404
- case "ThrottlingException":
405
- case "com.amazonaws.bedrock#ThrottlingException":
406
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
407
- case "TooManyTagsException":
408
- case "com.amazonaws.bedrock#TooManyTagsException":
409
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
410
- case "ValidationException":
411
- case "com.amazonaws.bedrock#ValidationException":
412
- throw await de_ValidationExceptionRes(parsedOutput, context);
413
- default:
414
- const parsedBody = parsedOutput.body;
415
- return throwDefaultError({
416
- output,
417
- parsedBody,
418
- errorCode,
419
- });
420
- }
421
- };
422
- const de_DeleteCustomModelCommand = async (output, context) => {
423
- if (output.statusCode !== 200 && output.statusCode >= 300) {
424
- return de_DeleteCustomModelCommandError(output, context);
425
- }
426
- const contents = (0, smithy_client_1.map)({
427
- $metadata: deserializeMetadata(output),
428
- });
429
- await (0, smithy_client_1.collectBody)(output.body, context);
430
- return contents;
431
- };
432
- exports.de_DeleteCustomModelCommand = de_DeleteCustomModelCommand;
433
- const de_DeleteCustomModelCommandError = async (output, context) => {
434
- const parsedOutput = {
435
- ...output,
436
- body: await parseErrorBody(output.body, context),
437
- };
438
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
439
- switch (errorCode) {
440
- case "AccessDeniedException":
441
- case "com.amazonaws.bedrock#AccessDeniedException":
442
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
443
- case "ConflictException":
444
- case "com.amazonaws.bedrock#ConflictException":
445
- throw await de_ConflictExceptionRes(parsedOutput, context);
446
- case "InternalServerException":
447
- case "com.amazonaws.bedrock#InternalServerException":
448
- throw await de_InternalServerExceptionRes(parsedOutput, context);
449
- case "ResourceNotFoundException":
450
- case "com.amazonaws.bedrock#ResourceNotFoundException":
451
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
452
- case "ThrottlingException":
453
- case "com.amazonaws.bedrock#ThrottlingException":
454
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
455
- case "ValidationException":
456
- case "com.amazonaws.bedrock#ValidationException":
457
- throw await de_ValidationExceptionRes(parsedOutput, context);
458
- default:
459
- const parsedBody = parsedOutput.body;
460
- return throwDefaultError({
461
- output,
462
- parsedBody,
463
- errorCode,
464
- });
465
- }
466
- };
467
- const de_DeleteModelInvocationLoggingConfigurationCommand = async (output, context) => {
468
- if (output.statusCode !== 200 && output.statusCode >= 300) {
469
- return de_DeleteModelInvocationLoggingConfigurationCommandError(output, context);
470
- }
471
- const contents = (0, smithy_client_1.map)({
472
- $metadata: deserializeMetadata(output),
473
- });
474
- await (0, smithy_client_1.collectBody)(output.body, context);
475
- return contents;
476
- };
477
- exports.de_DeleteModelInvocationLoggingConfigurationCommand = de_DeleteModelInvocationLoggingConfigurationCommand;
478
- const de_DeleteModelInvocationLoggingConfigurationCommandError = async (output, context) => {
479
- const parsedOutput = {
480
- ...output,
481
- body: await parseErrorBody(output.body, context),
482
- };
483
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
484
- switch (errorCode) {
485
- case "AccessDeniedException":
486
- case "com.amazonaws.bedrock#AccessDeniedException":
487
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
488
- case "InternalServerException":
489
- case "com.amazonaws.bedrock#InternalServerException":
490
- throw await de_InternalServerExceptionRes(parsedOutput, context);
491
- case "ThrottlingException":
492
- case "com.amazonaws.bedrock#ThrottlingException":
493
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
494
- default:
495
- const parsedBody = parsedOutput.body;
496
- return throwDefaultError({
497
- output,
498
- parsedBody,
499
- errorCode,
500
- });
501
- }
502
- };
503
- const de_DeleteProvisionedModelThroughputCommand = async (output, context) => {
504
- if (output.statusCode !== 200 && output.statusCode >= 300) {
505
- return de_DeleteProvisionedModelThroughputCommandError(output, context);
506
- }
507
- const contents = (0, smithy_client_1.map)({
508
- $metadata: deserializeMetadata(output),
509
- });
510
- await (0, smithy_client_1.collectBody)(output.body, context);
511
- return contents;
512
- };
513
- exports.de_DeleteProvisionedModelThroughputCommand = de_DeleteProvisionedModelThroughputCommand;
514
- const de_DeleteProvisionedModelThroughputCommandError = async (output, context) => {
515
- const parsedOutput = {
516
- ...output,
517
- body: await parseErrorBody(output.body, context),
518
- };
519
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
520
- switch (errorCode) {
521
- case "AccessDeniedException":
522
- case "com.amazonaws.bedrock#AccessDeniedException":
523
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
524
- case "ConflictException":
525
- case "com.amazonaws.bedrock#ConflictException":
526
- throw await de_ConflictExceptionRes(parsedOutput, context);
527
- case "InternalServerException":
528
- case "com.amazonaws.bedrock#InternalServerException":
529
- throw await de_InternalServerExceptionRes(parsedOutput, context);
530
- case "ResourceNotFoundException":
531
- case "com.amazonaws.bedrock#ResourceNotFoundException":
532
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
533
- case "ThrottlingException":
534
- case "com.amazonaws.bedrock#ThrottlingException":
535
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
536
- case "ValidationException":
537
- case "com.amazonaws.bedrock#ValidationException":
538
- throw await de_ValidationExceptionRes(parsedOutput, context);
539
- default:
540
- const parsedBody = parsedOutput.body;
541
- return throwDefaultError({
542
- output,
543
- parsedBody,
544
- errorCode,
545
- });
546
- }
547
- };
548
- const de_GetCustomModelCommand = async (output, context) => {
549
- if (output.statusCode !== 200 && output.statusCode >= 300) {
550
- return de_GetCustomModelCommandError(output, context);
551
- }
552
- const contents = (0, smithy_client_1.map)({
553
- $metadata: deserializeMetadata(output),
554
- });
555
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
556
- const doc = (0, smithy_client_1.take)(data, {
557
- baseModelArn: smithy_client_1.expectString,
558
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
559
- customizationType: smithy_client_1.expectString,
560
- hyperParameters: smithy_client_1._json,
561
- jobArn: smithy_client_1.expectString,
562
- jobName: smithy_client_1.expectString,
563
- modelArn: smithy_client_1.expectString,
564
- modelKmsKeyArn: smithy_client_1.expectString,
565
- modelName: smithy_client_1.expectString,
566
- outputDataConfig: smithy_client_1._json,
567
- trainingDataConfig: smithy_client_1._json,
568
- trainingMetrics: (_) => de_TrainingMetrics(_, context),
569
- validationDataConfig: smithy_client_1._json,
570
- validationMetrics: (_) => de_ValidationMetrics(_, context),
571
- });
572
- Object.assign(contents, doc);
573
- return contents;
574
- };
575
- exports.de_GetCustomModelCommand = de_GetCustomModelCommand;
576
- const de_GetCustomModelCommandError = async (output, context) => {
577
- const parsedOutput = {
578
- ...output,
579
- body: await parseErrorBody(output.body, context),
580
- };
581
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
582
- switch (errorCode) {
583
- case "AccessDeniedException":
584
- case "com.amazonaws.bedrock#AccessDeniedException":
585
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
586
- case "InternalServerException":
587
- case "com.amazonaws.bedrock#InternalServerException":
588
- throw await de_InternalServerExceptionRes(parsedOutput, context);
589
- case "ResourceNotFoundException":
590
- case "com.amazonaws.bedrock#ResourceNotFoundException":
591
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
592
- case "ThrottlingException":
593
- case "com.amazonaws.bedrock#ThrottlingException":
594
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
595
- case "ValidationException":
596
- case "com.amazonaws.bedrock#ValidationException":
597
- throw await de_ValidationExceptionRes(parsedOutput, context);
598
- default:
599
- const parsedBody = parsedOutput.body;
600
- return throwDefaultError({
601
- output,
602
- parsedBody,
603
- errorCode,
604
- });
605
- }
606
- };
607
- const de_GetFoundationModelCommand = async (output, context) => {
608
- if (output.statusCode !== 200 && output.statusCode >= 300) {
609
- return de_GetFoundationModelCommandError(output, context);
610
- }
611
- const contents = (0, smithy_client_1.map)({
612
- $metadata: deserializeMetadata(output),
613
- });
614
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
615
- const doc = (0, smithy_client_1.take)(data, {
616
- modelDetails: smithy_client_1._json,
617
- });
618
- Object.assign(contents, doc);
619
- return contents;
620
- };
621
- exports.de_GetFoundationModelCommand = de_GetFoundationModelCommand;
622
- const de_GetFoundationModelCommandError = async (output, context) => {
623
- const parsedOutput = {
624
- ...output,
625
- body: await parseErrorBody(output.body, context),
626
- };
627
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
628
- switch (errorCode) {
629
- case "AccessDeniedException":
630
- case "com.amazonaws.bedrock#AccessDeniedException":
631
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
632
- case "InternalServerException":
633
- case "com.amazonaws.bedrock#InternalServerException":
634
- throw await de_InternalServerExceptionRes(parsedOutput, context);
635
- case "ResourceNotFoundException":
636
- case "com.amazonaws.bedrock#ResourceNotFoundException":
637
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
638
- case "ThrottlingException":
639
- case "com.amazonaws.bedrock#ThrottlingException":
640
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
641
- case "ValidationException":
642
- case "com.amazonaws.bedrock#ValidationException":
643
- throw await de_ValidationExceptionRes(parsedOutput, context);
644
- default:
645
- const parsedBody = parsedOutput.body;
646
- return throwDefaultError({
647
- output,
648
- parsedBody,
649
- errorCode,
650
- });
651
- }
652
- };
653
- const de_GetModelCustomizationJobCommand = async (output, context) => {
654
- if (output.statusCode !== 200 && output.statusCode >= 300) {
655
- return de_GetModelCustomizationJobCommandError(output, context);
656
- }
657
- const contents = (0, smithy_client_1.map)({
658
- $metadata: deserializeMetadata(output),
659
- });
660
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
661
- const doc = (0, smithy_client_1.take)(data, {
662
- baseModelArn: smithy_client_1.expectString,
663
- clientRequestToken: smithy_client_1.expectString,
664
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
665
- customizationType: smithy_client_1.expectString,
666
- endTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
667
- failureMessage: smithy_client_1.expectString,
668
- hyperParameters: smithy_client_1._json,
669
- jobArn: smithy_client_1.expectString,
670
- jobName: smithy_client_1.expectString,
671
- lastModifiedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
672
- outputDataConfig: smithy_client_1._json,
673
- outputModelArn: smithy_client_1.expectString,
674
- outputModelKmsKeyArn: smithy_client_1.expectString,
675
- outputModelName: smithy_client_1.expectString,
676
- roleArn: smithy_client_1.expectString,
677
- status: smithy_client_1.expectString,
678
- trainingDataConfig: smithy_client_1._json,
679
- trainingMetrics: (_) => de_TrainingMetrics(_, context),
680
- validationDataConfig: smithy_client_1._json,
681
- validationMetrics: (_) => de_ValidationMetrics(_, context),
682
- vpcConfig: smithy_client_1._json,
683
- });
684
- Object.assign(contents, doc);
685
- return contents;
686
- };
687
- exports.de_GetModelCustomizationJobCommand = de_GetModelCustomizationJobCommand;
688
- const de_GetModelCustomizationJobCommandError = async (output, context) => {
689
- const parsedOutput = {
690
- ...output,
691
- body: await parseErrorBody(output.body, context),
692
- };
693
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
694
- switch (errorCode) {
695
- case "AccessDeniedException":
696
- case "com.amazonaws.bedrock#AccessDeniedException":
697
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
698
- case "InternalServerException":
699
- case "com.amazonaws.bedrock#InternalServerException":
700
- throw await de_InternalServerExceptionRes(parsedOutput, context);
701
- case "ResourceNotFoundException":
702
- case "com.amazonaws.bedrock#ResourceNotFoundException":
703
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
704
- case "ThrottlingException":
705
- case "com.amazonaws.bedrock#ThrottlingException":
706
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
707
- case "ValidationException":
708
- case "com.amazonaws.bedrock#ValidationException":
709
- throw await de_ValidationExceptionRes(parsedOutput, context);
710
- default:
711
- const parsedBody = parsedOutput.body;
712
- return throwDefaultError({
713
- output,
714
- parsedBody,
715
- errorCode,
716
- });
717
- }
718
- };
719
- const de_GetModelInvocationLoggingConfigurationCommand = async (output, context) => {
720
- if (output.statusCode !== 200 && output.statusCode >= 300) {
721
- return de_GetModelInvocationLoggingConfigurationCommandError(output, context);
722
- }
723
- const contents = (0, smithy_client_1.map)({
724
- $metadata: deserializeMetadata(output),
725
- });
726
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
727
- const doc = (0, smithy_client_1.take)(data, {
728
- loggingConfig: smithy_client_1._json,
729
- });
730
- Object.assign(contents, doc);
731
- return contents;
732
- };
733
- exports.de_GetModelInvocationLoggingConfigurationCommand = de_GetModelInvocationLoggingConfigurationCommand;
734
- const de_GetModelInvocationLoggingConfigurationCommandError = async (output, context) => {
735
- const parsedOutput = {
736
- ...output,
737
- body: await parseErrorBody(output.body, context),
738
- };
739
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
740
- switch (errorCode) {
741
- case "AccessDeniedException":
742
- case "com.amazonaws.bedrock#AccessDeniedException":
743
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
744
- case "InternalServerException":
745
- case "com.amazonaws.bedrock#InternalServerException":
746
- throw await de_InternalServerExceptionRes(parsedOutput, context);
747
- case "ThrottlingException":
748
- case "com.amazonaws.bedrock#ThrottlingException":
749
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
750
- default:
751
- const parsedBody = parsedOutput.body;
752
- return throwDefaultError({
753
- output,
754
- parsedBody,
755
- errorCode,
756
- });
757
- }
758
- };
759
- const de_GetProvisionedModelThroughputCommand = async (output, context) => {
760
- if (output.statusCode !== 200 && output.statusCode >= 300) {
761
- return de_GetProvisionedModelThroughputCommandError(output, context);
762
- }
763
- const contents = (0, smithy_client_1.map)({
764
- $metadata: deserializeMetadata(output),
765
- });
766
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
767
- const doc = (0, smithy_client_1.take)(data, {
768
- commitmentDuration: smithy_client_1.expectString,
769
- commitmentExpirationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
770
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
771
- desiredModelArn: smithy_client_1.expectString,
772
- desiredModelUnits: smithy_client_1.expectInt32,
773
- failureMessage: smithy_client_1.expectString,
774
- foundationModelArn: smithy_client_1.expectString,
775
- lastModifiedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
776
- modelArn: smithy_client_1.expectString,
777
- modelUnits: smithy_client_1.expectInt32,
778
- provisionedModelArn: smithy_client_1.expectString,
779
- provisionedModelName: smithy_client_1.expectString,
780
- status: smithy_client_1.expectString,
781
- });
782
- Object.assign(contents, doc);
783
- return contents;
784
- };
785
- exports.de_GetProvisionedModelThroughputCommand = de_GetProvisionedModelThroughputCommand;
786
- const de_GetProvisionedModelThroughputCommandError = async (output, context) => {
787
- const parsedOutput = {
788
- ...output,
789
- body: await parseErrorBody(output.body, context),
790
- };
791
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
792
- switch (errorCode) {
793
- case "AccessDeniedException":
794
- case "com.amazonaws.bedrock#AccessDeniedException":
795
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
796
- case "InternalServerException":
797
- case "com.amazonaws.bedrock#InternalServerException":
798
- throw await de_InternalServerExceptionRes(parsedOutput, context);
799
- case "ResourceNotFoundException":
800
- case "com.amazonaws.bedrock#ResourceNotFoundException":
801
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
802
- case "ThrottlingException":
803
- case "com.amazonaws.bedrock#ThrottlingException":
804
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
805
- case "ValidationException":
806
- case "com.amazonaws.bedrock#ValidationException":
807
- throw await de_ValidationExceptionRes(parsedOutput, context);
808
- default:
809
- const parsedBody = parsedOutput.body;
810
- return throwDefaultError({
811
- output,
812
- parsedBody,
813
- errorCode,
814
- });
815
- }
816
- };
817
- const de_ListCustomModelsCommand = async (output, context) => {
818
- if (output.statusCode !== 200 && output.statusCode >= 300) {
819
- return de_ListCustomModelsCommandError(output, context);
820
- }
821
- const contents = (0, smithy_client_1.map)({
822
- $metadata: deserializeMetadata(output),
823
- });
824
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
825
- const doc = (0, smithy_client_1.take)(data, {
826
- modelSummaries: (_) => de_CustomModelSummaryList(_, context),
827
- nextToken: smithy_client_1.expectString,
828
- });
829
- Object.assign(contents, doc);
830
- return contents;
831
- };
832
- exports.de_ListCustomModelsCommand = de_ListCustomModelsCommand;
833
- const de_ListCustomModelsCommandError = async (output, context) => {
834
- const parsedOutput = {
835
- ...output,
836
- body: await parseErrorBody(output.body, context),
837
- };
838
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
839
- switch (errorCode) {
840
- case "AccessDeniedException":
841
- case "com.amazonaws.bedrock#AccessDeniedException":
842
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
843
- case "InternalServerException":
844
- case "com.amazonaws.bedrock#InternalServerException":
845
- throw await de_InternalServerExceptionRes(parsedOutput, context);
846
- case "ThrottlingException":
847
- case "com.amazonaws.bedrock#ThrottlingException":
848
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
849
- case "ValidationException":
850
- case "com.amazonaws.bedrock#ValidationException":
851
- throw await de_ValidationExceptionRes(parsedOutput, context);
852
- default:
853
- const parsedBody = parsedOutput.body;
854
- return throwDefaultError({
855
- output,
856
- parsedBody,
857
- errorCode,
858
- });
859
- }
860
- };
861
- const de_ListFoundationModelsCommand = async (output, context) => {
862
- if (output.statusCode !== 200 && output.statusCode >= 300) {
863
- return de_ListFoundationModelsCommandError(output, context);
864
- }
865
- const contents = (0, smithy_client_1.map)({
866
- $metadata: deserializeMetadata(output),
867
- });
868
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
869
- const doc = (0, smithy_client_1.take)(data, {
870
- modelSummaries: smithy_client_1._json,
871
- });
872
- Object.assign(contents, doc);
873
- return contents;
874
- };
875
- exports.de_ListFoundationModelsCommand = de_ListFoundationModelsCommand;
876
- const de_ListFoundationModelsCommandError = async (output, context) => {
877
- const parsedOutput = {
878
- ...output,
879
- body: await parseErrorBody(output.body, context),
880
- };
881
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
882
- switch (errorCode) {
883
- case "AccessDeniedException":
884
- case "com.amazonaws.bedrock#AccessDeniedException":
885
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
886
- case "InternalServerException":
887
- case "com.amazonaws.bedrock#InternalServerException":
888
- throw await de_InternalServerExceptionRes(parsedOutput, context);
889
- case "ThrottlingException":
890
- case "com.amazonaws.bedrock#ThrottlingException":
891
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
892
- case "ValidationException":
893
- case "com.amazonaws.bedrock#ValidationException":
894
- throw await de_ValidationExceptionRes(parsedOutput, context);
895
- default:
896
- const parsedBody = parsedOutput.body;
897
- return throwDefaultError({
898
- output,
899
- parsedBody,
900
- errorCode,
901
- });
902
- }
903
- };
904
- const de_ListModelCustomizationJobsCommand = async (output, context) => {
905
- if (output.statusCode !== 200 && output.statusCode >= 300) {
906
- return de_ListModelCustomizationJobsCommandError(output, context);
907
- }
908
- const contents = (0, smithy_client_1.map)({
909
- $metadata: deserializeMetadata(output),
910
- });
911
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
912
- const doc = (0, smithy_client_1.take)(data, {
913
- modelCustomizationJobSummaries: (_) => de_ModelCustomizationJobSummaries(_, context),
914
- nextToken: smithy_client_1.expectString,
915
- });
916
- Object.assign(contents, doc);
917
- return contents;
918
- };
919
- exports.de_ListModelCustomizationJobsCommand = de_ListModelCustomizationJobsCommand;
920
- const de_ListModelCustomizationJobsCommandError = async (output, context) => {
921
- const parsedOutput = {
922
- ...output,
923
- body: await parseErrorBody(output.body, context),
924
- };
925
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
926
- switch (errorCode) {
927
- case "AccessDeniedException":
928
- case "com.amazonaws.bedrock#AccessDeniedException":
929
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
930
- case "InternalServerException":
931
- case "com.amazonaws.bedrock#InternalServerException":
932
- throw await de_InternalServerExceptionRes(parsedOutput, context);
933
- case "ThrottlingException":
934
- case "com.amazonaws.bedrock#ThrottlingException":
935
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
936
- case "ValidationException":
937
- case "com.amazonaws.bedrock#ValidationException":
938
- throw await de_ValidationExceptionRes(parsedOutput, context);
939
- default:
940
- const parsedBody = parsedOutput.body;
941
- return throwDefaultError({
942
- output,
943
- parsedBody,
944
- errorCode,
945
- });
946
- }
947
- };
948
- const de_ListProvisionedModelThroughputsCommand = async (output, context) => {
949
- if (output.statusCode !== 200 && output.statusCode >= 300) {
950
- return de_ListProvisionedModelThroughputsCommandError(output, context);
951
- }
952
- const contents = (0, smithy_client_1.map)({
953
- $metadata: deserializeMetadata(output),
954
- });
955
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
956
- const doc = (0, smithy_client_1.take)(data, {
957
- nextToken: smithy_client_1.expectString,
958
- provisionedModelSummaries: (_) => de_ProvisionedModelSummaries(_, context),
959
- });
960
- Object.assign(contents, doc);
961
- return contents;
962
- };
963
- exports.de_ListProvisionedModelThroughputsCommand = de_ListProvisionedModelThroughputsCommand;
964
- const de_ListProvisionedModelThroughputsCommandError = async (output, context) => {
965
- const parsedOutput = {
966
- ...output,
967
- body: await parseErrorBody(output.body, context),
968
- };
969
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
970
- switch (errorCode) {
971
- case "AccessDeniedException":
972
- case "com.amazonaws.bedrock#AccessDeniedException":
973
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
974
- case "InternalServerException":
975
- case "com.amazonaws.bedrock#InternalServerException":
976
- throw await de_InternalServerExceptionRes(parsedOutput, context);
977
- case "ThrottlingException":
978
- case "com.amazonaws.bedrock#ThrottlingException":
979
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
980
- case "ValidationException":
981
- case "com.amazonaws.bedrock#ValidationException":
982
- throw await de_ValidationExceptionRes(parsedOutput, context);
983
- default:
984
- const parsedBody = parsedOutput.body;
985
- return throwDefaultError({
986
- output,
987
- parsedBody,
988
- errorCode,
989
- });
990
- }
991
- };
992
- const de_ListTagsForResourceCommand = async (output, context) => {
993
- if (output.statusCode !== 200 && output.statusCode >= 300) {
994
- return de_ListTagsForResourceCommandError(output, context);
995
- }
996
- const contents = (0, smithy_client_1.map)({
997
- $metadata: deserializeMetadata(output),
998
- });
999
- const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1000
- const doc = (0, smithy_client_1.take)(data, {
1001
- tags: smithy_client_1._json,
1002
- });
1003
- Object.assign(contents, doc);
1004
- return contents;
1005
- };
1006
- exports.de_ListTagsForResourceCommand = de_ListTagsForResourceCommand;
1007
- const de_ListTagsForResourceCommandError = async (output, context) => {
1008
- const parsedOutput = {
1009
- ...output,
1010
- body: await parseErrorBody(output.body, context),
1011
- };
1012
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1013
- switch (errorCode) {
1014
- case "AccessDeniedException":
1015
- case "com.amazonaws.bedrock#AccessDeniedException":
1016
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1017
- case "InternalServerException":
1018
- case "com.amazonaws.bedrock#InternalServerException":
1019
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1020
- case "ResourceNotFoundException":
1021
- case "com.amazonaws.bedrock#ResourceNotFoundException":
1022
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1023
- case "ThrottlingException":
1024
- case "com.amazonaws.bedrock#ThrottlingException":
1025
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1026
- case "ValidationException":
1027
- case "com.amazonaws.bedrock#ValidationException":
1028
- throw await de_ValidationExceptionRes(parsedOutput, context);
1029
- default:
1030
- const parsedBody = parsedOutput.body;
1031
- return throwDefaultError({
1032
- output,
1033
- parsedBody,
1034
- errorCode,
1035
- });
1036
- }
1037
- };
1038
- const de_PutModelInvocationLoggingConfigurationCommand = async (output, context) => {
1039
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1040
- return de_PutModelInvocationLoggingConfigurationCommandError(output, context);
1041
- }
1042
- const contents = (0, smithy_client_1.map)({
1043
- $metadata: deserializeMetadata(output),
1044
- });
1045
- await (0, smithy_client_1.collectBody)(output.body, context);
1046
- return contents;
1047
- };
1048
- exports.de_PutModelInvocationLoggingConfigurationCommand = de_PutModelInvocationLoggingConfigurationCommand;
1049
- const de_PutModelInvocationLoggingConfigurationCommandError = async (output, context) => {
1050
- const parsedOutput = {
1051
- ...output,
1052
- body: await parseErrorBody(output.body, context),
1053
- };
1054
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1055
- switch (errorCode) {
1056
- case "AccessDeniedException":
1057
- case "com.amazonaws.bedrock#AccessDeniedException":
1058
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1059
- case "InternalServerException":
1060
- case "com.amazonaws.bedrock#InternalServerException":
1061
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1062
- case "ThrottlingException":
1063
- case "com.amazonaws.bedrock#ThrottlingException":
1064
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1065
- case "ValidationException":
1066
- case "com.amazonaws.bedrock#ValidationException":
1067
- throw await de_ValidationExceptionRes(parsedOutput, context);
1068
- default:
1069
- const parsedBody = parsedOutput.body;
1070
- return throwDefaultError({
1071
- output,
1072
- parsedBody,
1073
- errorCode,
1074
- });
1075
- }
1076
- };
1077
- const de_StopModelCustomizationJobCommand = async (output, context) => {
1078
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1079
- return de_StopModelCustomizationJobCommandError(output, context);
1080
- }
1081
- const contents = (0, smithy_client_1.map)({
1082
- $metadata: deserializeMetadata(output),
1083
- });
1084
- await (0, smithy_client_1.collectBody)(output.body, context);
1085
- return contents;
1086
- };
1087
- exports.de_StopModelCustomizationJobCommand = de_StopModelCustomizationJobCommand;
1088
- const de_StopModelCustomizationJobCommandError = async (output, context) => {
1089
- const parsedOutput = {
1090
- ...output,
1091
- body: await parseErrorBody(output.body, context),
1092
- };
1093
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1094
- switch (errorCode) {
1095
- case "AccessDeniedException":
1096
- case "com.amazonaws.bedrock#AccessDeniedException":
1097
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1098
- case "ConflictException":
1099
- case "com.amazonaws.bedrock#ConflictException":
1100
- throw await de_ConflictExceptionRes(parsedOutput, context);
1101
- case "InternalServerException":
1102
- case "com.amazonaws.bedrock#InternalServerException":
1103
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1104
- case "ResourceNotFoundException":
1105
- case "com.amazonaws.bedrock#ResourceNotFoundException":
1106
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1107
- case "ThrottlingException":
1108
- case "com.amazonaws.bedrock#ThrottlingException":
1109
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1110
- case "ValidationException":
1111
- case "com.amazonaws.bedrock#ValidationException":
1112
- throw await de_ValidationExceptionRes(parsedOutput, context);
1113
- default:
1114
- const parsedBody = parsedOutput.body;
1115
- return throwDefaultError({
1116
- output,
1117
- parsedBody,
1118
- errorCode,
1119
- });
1120
- }
1121
- };
1122
- const de_TagResourceCommand = async (output, context) => {
1123
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1124
- return de_TagResourceCommandError(output, context);
1125
- }
1126
- const contents = (0, smithy_client_1.map)({
1127
- $metadata: deserializeMetadata(output),
1128
- });
1129
- await (0, smithy_client_1.collectBody)(output.body, context);
1130
- return contents;
1131
- };
1132
- exports.de_TagResourceCommand = de_TagResourceCommand;
1133
- const de_TagResourceCommandError = async (output, context) => {
1134
- const parsedOutput = {
1135
- ...output,
1136
- body: await parseErrorBody(output.body, context),
1137
- };
1138
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1139
- switch (errorCode) {
1140
- case "AccessDeniedException":
1141
- case "com.amazonaws.bedrock#AccessDeniedException":
1142
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1143
- case "InternalServerException":
1144
- case "com.amazonaws.bedrock#InternalServerException":
1145
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1146
- case "ResourceNotFoundException":
1147
- case "com.amazonaws.bedrock#ResourceNotFoundException":
1148
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1149
- case "ThrottlingException":
1150
- case "com.amazonaws.bedrock#ThrottlingException":
1151
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1152
- case "TooManyTagsException":
1153
- case "com.amazonaws.bedrock#TooManyTagsException":
1154
- throw await de_TooManyTagsExceptionRes(parsedOutput, context);
1155
- case "ValidationException":
1156
- case "com.amazonaws.bedrock#ValidationException":
1157
- throw await de_ValidationExceptionRes(parsedOutput, context);
1158
- default:
1159
- const parsedBody = parsedOutput.body;
1160
- return throwDefaultError({
1161
- output,
1162
- parsedBody,
1163
- errorCode,
1164
- });
1165
- }
1166
- };
1167
- const de_UntagResourceCommand = async (output, context) => {
1168
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1169
- return de_UntagResourceCommandError(output, context);
1170
- }
1171
- const contents = (0, smithy_client_1.map)({
1172
- $metadata: deserializeMetadata(output),
1173
- });
1174
- await (0, smithy_client_1.collectBody)(output.body, context);
1175
- return contents;
1176
- };
1177
- exports.de_UntagResourceCommand = de_UntagResourceCommand;
1178
- const de_UntagResourceCommandError = async (output, context) => {
1179
- const parsedOutput = {
1180
- ...output,
1181
- body: await parseErrorBody(output.body, context),
1182
- };
1183
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1184
- switch (errorCode) {
1185
- case "AccessDeniedException":
1186
- case "com.amazonaws.bedrock#AccessDeniedException":
1187
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1188
- case "InternalServerException":
1189
- case "com.amazonaws.bedrock#InternalServerException":
1190
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1191
- case "ResourceNotFoundException":
1192
- case "com.amazonaws.bedrock#ResourceNotFoundException":
1193
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1194
- case "ThrottlingException":
1195
- case "com.amazonaws.bedrock#ThrottlingException":
1196
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1197
- case "ValidationException":
1198
- case "com.amazonaws.bedrock#ValidationException":
1199
- throw await de_ValidationExceptionRes(parsedOutput, context);
1200
- default:
1201
- const parsedBody = parsedOutput.body;
1202
- return throwDefaultError({
1203
- output,
1204
- parsedBody,
1205
- errorCode,
1206
- });
1207
- }
1208
- };
1209
- const de_UpdateProvisionedModelThroughputCommand = async (output, context) => {
1210
- if (output.statusCode !== 200 && output.statusCode >= 300) {
1211
- return de_UpdateProvisionedModelThroughputCommandError(output, context);
1212
- }
1213
- const contents = (0, smithy_client_1.map)({
1214
- $metadata: deserializeMetadata(output),
1215
- });
1216
- await (0, smithy_client_1.collectBody)(output.body, context);
1217
- return contents;
1218
- };
1219
- exports.de_UpdateProvisionedModelThroughputCommand = de_UpdateProvisionedModelThroughputCommand;
1220
- const de_UpdateProvisionedModelThroughputCommandError = async (output, context) => {
1221
- const parsedOutput = {
1222
- ...output,
1223
- body: await parseErrorBody(output.body, context),
1224
- };
1225
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1226
- switch (errorCode) {
1227
- case "AccessDeniedException":
1228
- case "com.amazonaws.bedrock#AccessDeniedException":
1229
- throw await de_AccessDeniedExceptionRes(parsedOutput, context);
1230
- case "InternalServerException":
1231
- case "com.amazonaws.bedrock#InternalServerException":
1232
- throw await de_InternalServerExceptionRes(parsedOutput, context);
1233
- case "ResourceNotFoundException":
1234
- case "com.amazonaws.bedrock#ResourceNotFoundException":
1235
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
1236
- case "ThrottlingException":
1237
- case "com.amazonaws.bedrock#ThrottlingException":
1238
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
1239
- case "ValidationException":
1240
- case "com.amazonaws.bedrock#ValidationException":
1241
- throw await de_ValidationExceptionRes(parsedOutput, context);
1242
- default:
1243
- const parsedBody = parsedOutput.body;
1244
- return throwDefaultError({
1245
- output,
1246
- parsedBody,
1247
- errorCode,
1248
- });
1249
- }
1250
- };
1251
- const throwDefaultError = (0, smithy_client_1.withBaseException)(BedrockServiceException_1.BedrockServiceException);
1252
- const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
1253
- const contents = (0, smithy_client_1.map)({});
1254
- const data = parsedOutput.body;
1255
- const doc = (0, smithy_client_1.take)(data, {
1256
- message: smithy_client_1.expectString,
1257
- });
1258
- Object.assign(contents, doc);
1259
- const exception = new models_0_1.AccessDeniedException({
1260
- $metadata: deserializeMetadata(parsedOutput),
1261
- ...contents,
1262
- });
1263
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1264
- };
1265
- const de_ConflictExceptionRes = async (parsedOutput, context) => {
1266
- const contents = (0, smithy_client_1.map)({});
1267
- const data = parsedOutput.body;
1268
- const doc = (0, smithy_client_1.take)(data, {
1269
- message: smithy_client_1.expectString,
1270
- });
1271
- Object.assign(contents, doc);
1272
- const exception = new models_0_1.ConflictException({
1273
- $metadata: deserializeMetadata(parsedOutput),
1274
- ...contents,
1275
- });
1276
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1277
- };
1278
- const de_InternalServerExceptionRes = async (parsedOutput, context) => {
1279
- const contents = (0, smithy_client_1.map)({});
1280
- const data = parsedOutput.body;
1281
- const doc = (0, smithy_client_1.take)(data, {
1282
- message: smithy_client_1.expectString,
1283
- });
1284
- Object.assign(contents, doc);
1285
- const exception = new models_0_1.InternalServerException({
1286
- $metadata: deserializeMetadata(parsedOutput),
1287
- ...contents,
1288
- });
1289
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1290
- };
1291
- const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
1292
- const contents = (0, smithy_client_1.map)({});
1293
- const data = parsedOutput.body;
1294
- const doc = (0, smithy_client_1.take)(data, {
1295
- message: smithy_client_1.expectString,
1296
- });
1297
- Object.assign(contents, doc);
1298
- const exception = new models_0_1.ResourceNotFoundException({
1299
- $metadata: deserializeMetadata(parsedOutput),
1300
- ...contents,
1301
- });
1302
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1303
- };
1304
- const de_ServiceQuotaExceededExceptionRes = async (parsedOutput, context) => {
1305
- const contents = (0, smithy_client_1.map)({});
1306
- const data = parsedOutput.body;
1307
- const doc = (0, smithy_client_1.take)(data, {
1308
- message: smithy_client_1.expectString,
1309
- });
1310
- Object.assign(contents, doc);
1311
- const exception = new models_0_1.ServiceQuotaExceededException({
1312
- $metadata: deserializeMetadata(parsedOutput),
1313
- ...contents,
1314
- });
1315
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1316
- };
1317
- const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
1318
- const contents = (0, smithy_client_1.map)({});
1319
- const data = parsedOutput.body;
1320
- const doc = (0, smithy_client_1.take)(data, {
1321
- message: smithy_client_1.expectString,
1322
- });
1323
- Object.assign(contents, doc);
1324
- const exception = new models_0_1.ThrottlingException({
1325
- $metadata: deserializeMetadata(parsedOutput),
1326
- ...contents,
1327
- });
1328
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1329
- };
1330
- const de_TooManyTagsExceptionRes = async (parsedOutput, context) => {
1331
- const contents = (0, smithy_client_1.map)({});
1332
- const data = parsedOutput.body;
1333
- const doc = (0, smithy_client_1.take)(data, {
1334
- message: smithy_client_1.expectString,
1335
- resourceName: smithy_client_1.expectString,
1336
- });
1337
- Object.assign(contents, doc);
1338
- const exception = new models_0_1.TooManyTagsException({
1339
- $metadata: deserializeMetadata(parsedOutput),
1340
- ...contents,
1341
- });
1342
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1343
- };
1344
- const de_ValidationExceptionRes = async (parsedOutput, context) => {
1345
- const contents = (0, smithy_client_1.map)({});
1346
- const data = parsedOutput.body;
1347
- const doc = (0, smithy_client_1.take)(data, {
1348
- message: smithy_client_1.expectString,
1349
- });
1350
- Object.assign(contents, doc);
1351
- const exception = new models_0_1.ValidationException({
1352
- $metadata: deserializeMetadata(parsedOutput),
1353
- ...contents,
1354
- });
1355
- return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1356
- };
1357
- const de_CustomModelSummary = (output, context) => {
1358
- return (0, smithy_client_1.take)(output, {
1359
- baseModelArn: smithy_client_1.expectString,
1360
- baseModelName: smithy_client_1.expectString,
1361
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1362
- customizationType: smithy_client_1.expectString,
1363
- modelArn: smithy_client_1.expectString,
1364
- modelName: smithy_client_1.expectString,
1365
- });
1366
- };
1367
- const de_CustomModelSummaryList = (output, context) => {
1368
- const retVal = (output || [])
1369
- .filter((e) => e != null)
1370
- .map((entry) => {
1371
- return de_CustomModelSummary(entry, context);
1372
- });
1373
- return retVal;
1374
- };
1375
- const de_ModelCustomizationJobSummaries = (output, context) => {
1376
- const retVal = (output || [])
1377
- .filter((e) => e != null)
1378
- .map((entry) => {
1379
- return de_ModelCustomizationJobSummary(entry, context);
1380
- });
1381
- return retVal;
1382
- };
1383
- const de_ModelCustomizationJobSummary = (output, context) => {
1384
- return (0, smithy_client_1.take)(output, {
1385
- baseModelArn: smithy_client_1.expectString,
1386
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1387
- customModelArn: smithy_client_1.expectString,
1388
- customModelName: smithy_client_1.expectString,
1389
- customizationType: smithy_client_1.expectString,
1390
- endTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1391
- jobArn: smithy_client_1.expectString,
1392
- jobName: smithy_client_1.expectString,
1393
- lastModifiedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1394
- status: smithy_client_1.expectString,
1395
- });
1396
- };
1397
- const de_ProvisionedModelSummaries = (output, context) => {
1398
- const retVal = (output || [])
1399
- .filter((e) => e != null)
1400
- .map((entry) => {
1401
- return de_ProvisionedModelSummary(entry, context);
1402
- });
1403
- return retVal;
1404
- };
1405
- const de_ProvisionedModelSummary = (output, context) => {
1406
- return (0, smithy_client_1.take)(output, {
1407
- commitmentDuration: smithy_client_1.expectString,
1408
- commitmentExpirationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1409
- creationTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1410
- desiredModelArn: smithy_client_1.expectString,
1411
- desiredModelUnits: smithy_client_1.expectInt32,
1412
- foundationModelArn: smithy_client_1.expectString,
1413
- lastModifiedTime: (_) => (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTimeWithOffset)(_)),
1414
- modelArn: smithy_client_1.expectString,
1415
- modelUnits: smithy_client_1.expectInt32,
1416
- provisionedModelArn: smithy_client_1.expectString,
1417
- provisionedModelName: smithy_client_1.expectString,
1418
- status: smithy_client_1.expectString,
1419
- });
1420
- };
1421
- const de_TrainingMetrics = (output, context) => {
1422
- return (0, smithy_client_1.take)(output, {
1423
- trainingLoss: smithy_client_1.limitedParseFloat32,
1424
- });
1425
- };
1426
- const de_ValidationMetrics = (output, context) => {
1427
- const retVal = (output || [])
1428
- .filter((e) => e != null)
1429
- .map((entry) => {
1430
- return de_ValidatorMetric(entry, context);
1431
- });
1432
- return retVal;
1433
- };
1434
- const de_ValidatorMetric = (output, context) => {
1435
- return (0, smithy_client_1.take)(output, {
1436
- validationLoss: smithy_client_1.limitedParseFloat32,
1437
- });
1438
- };
1439
- const deserializeMetadata = (output) => ({
1440
- httpStatusCode: output.statusCode,
1441
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
1442
- extendedRequestId: output.headers["x-amz-id-2"],
1443
- cfId: output.headers["x-amz-cf-id"],
1444
- });
1445
- const collectBodyString = (streamBody, context) => (0, smithy_client_1.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body));
1446
- const isSerializableHeaderValue = (value) => value !== undefined &&
1447
- value !== null &&
1448
- value !== "" &&
1449
- (!Object.getOwnPropertyNames(value).includes("length") || value.length != 0) &&
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";
1466
- const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
1467
- if (encoded.length) {
1468
- return JSON.parse(encoded);
1469
- }
1470
- return {};
1471
- });
1472
- const parseErrorBody = async (errorBody, context) => {
1473
- const value = await parseBody(errorBody, context);
1474
- value.message = value.message ?? value.Message;
1475
- return value;
1476
- };
1477
- const loadRestJsonErrorCode = (output, data) => {
1478
- const findKey = (object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase());
1479
- const sanitizeErrorCode = (rawValue) => {
1480
- let cleanValue = rawValue;
1481
- if (typeof cleanValue === "number") {
1482
- cleanValue = cleanValue.toString();
1483
- }
1484
- if (cleanValue.indexOf(",") >= 0) {
1485
- cleanValue = cleanValue.split(",")[0];
1486
- }
1487
- if (cleanValue.indexOf(":") >= 0) {
1488
- cleanValue = cleanValue.split(":")[0];
1489
- }
1490
- if (cleanValue.indexOf("#") >= 0) {
1491
- cleanValue = cleanValue.split("#")[1];
1492
- }
1493
- return cleanValue;
1494
- };
1495
- const headerKey = findKey(output.headers, "x-amzn-errortype");
1496
- if (headerKey !== undefined) {
1497
- return sanitizeErrorCode(output.headers[headerKey]);
1498
- }
1499
- if (data.code !== undefined) {
1500
- return sanitizeErrorCode(data.code);
1501
- }
1502
- if (data["__type"] !== undefined) {
1503
- return sanitizeErrorCode(data["__type"]);
1504
- }
1505
- };
1
+ module.exports = require("../index.js");