@aws-sdk/client-bedrock 3.422.0 → 3.423.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.
- package/README.md +40 -0
- package/dist-cjs/Bedrock.js +10 -0
- package/dist-cjs/commands/CreateProvisionedModelThroughputCommand.js +51 -0
- package/dist-cjs/commands/DeleteProvisionedModelThroughputCommand.js +51 -0
- package/dist-cjs/commands/GetProvisionedModelThroughputCommand.js +51 -0
- package/dist-cjs/commands/ListProvisionedModelThroughputsCommand.js +51 -0
- package/dist-cjs/commands/UpdateProvisionedModelThroughputCommand.js +51 -0
- package/dist-cjs/commands/index.js +5 -0
- package/dist-cjs/models/models_0.js +25 -12
- package/dist-cjs/pagination/ListProvisionedModelThroughputsPaginator.js +29 -0
- package/dist-cjs/pagination/index.js +1 -0
- package/dist-cjs/protocols/Aws_restJson1.js +386 -1
- package/dist-es/Bedrock.js +10 -0
- package/dist-es/commands/CreateProvisionedModelThroughputCommand.js +47 -0
- package/dist-es/commands/DeleteProvisionedModelThroughputCommand.js +47 -0
- package/dist-es/commands/GetProvisionedModelThroughputCommand.js +47 -0
- package/dist-es/commands/ListProvisionedModelThroughputsCommand.js +47 -0
- package/dist-es/commands/UpdateProvisionedModelThroughputCommand.js +47 -0
- package/dist-es/commands/index.js +5 -0
- package/dist-es/models/models_0.js +22 -9
- package/dist-es/pagination/ListProvisionedModelThroughputsPaginator.js +25 -0
- package/dist-es/pagination/index.js +1 -0
- package/dist-es/protocols/Aws_restJson1.js +376 -1
- package/dist-types/Bedrock.d.ts +35 -0
- package/dist-types/BedrockClient.d.ts +7 -2
- package/dist-types/commands/CreateModelCustomizationJobCommand.d.ts +8 -8
- package/dist-types/commands/CreateProvisionedModelThroughputCommand.d.ts +106 -0
- package/dist-types/commands/DeleteProvisionedModelThroughputCommand.d.ts +89 -0
- package/dist-types/commands/GetModelCustomizationJobCommand.d.ts +1 -1
- package/dist-types/commands/GetProvisionedModelThroughputCommand.d.ts +100 -0
- package/dist-types/commands/ListModelCustomizationJobsCommand.d.ts +1 -1
- package/dist-types/commands/ListProvisionedModelThroughputsCommand.d.ts +109 -0
- package/dist-types/commands/TagResourceCommand.d.ts +1 -1
- package/dist-types/commands/UpdateProvisionedModelThroughputCommand.d.ts +88 -0
- package/dist-types/commands/index.d.ts +5 -0
- package/dist-types/models/models_0.d.ts +370 -36
- package/dist-types/pagination/ListProvisionedModelThroughputsPaginator.d.ts +7 -0
- package/dist-types/pagination/index.d.ts +1 -0
- package/dist-types/protocols/Aws_restJson1.d.ts +45 -0
- package/dist-types/ts3.4/Bedrock.d.ts +85 -0
- package/dist-types/ts3.4/BedrockClient.d.ts +32 -2
- package/dist-types/ts3.4/commands/CreateProvisionedModelThroughputCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/DeleteProvisionedModelThroughputCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/GetProvisionedModelThroughputCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/ListProvisionedModelThroughputsCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/UpdateProvisionedModelThroughputCommand.d.ts +42 -0
- package/dist-types/ts3.4/commands/index.d.ts +5 -0
- package/dist-types/ts3.4/models/models_0.d.ts +102 -15
- package/dist-types/ts3.4/pagination/ListProvisionedModelThroughputsPaginator.d.ts +11 -0
- package/dist-types/ts3.4/pagination/index.d.ts +1 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +60 -0
- package/package.json +3 -3
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
import { de_ListProvisionedModelThroughputsCommand, se_ListProvisionedModelThroughputsCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export { $Command };
|
|
7
|
+
export class ListProvisionedModelThroughputsCommand extends $Command {
|
|
8
|
+
static getEndpointParameterInstructions() {
|
|
9
|
+
return {
|
|
10
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
11
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
12
|
+
Region: { type: "builtInParams", name: "region" },
|
|
13
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
constructor(input) {
|
|
17
|
+
super();
|
|
18
|
+
this.input = input;
|
|
19
|
+
}
|
|
20
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
21
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
22
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, ListProvisionedModelThroughputsCommand.getEndpointParameterInstructions()));
|
|
23
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
24
|
+
const { logger } = configuration;
|
|
25
|
+
const clientName = "BedrockClient";
|
|
26
|
+
const commandName = "ListProvisionedModelThroughputsCommand";
|
|
27
|
+
const handlerExecutionContext = {
|
|
28
|
+
logger,
|
|
29
|
+
clientName,
|
|
30
|
+
commandName,
|
|
31
|
+
inputFilterSensitiveLog: (_) => _,
|
|
32
|
+
outputFilterSensitiveLog: (_) => _,
|
|
33
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
34
|
+
service: "AmazonBedrockControlPlaneService",
|
|
35
|
+
operation: "ListProvisionedModelThroughputs",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const { requestHandler } = configuration;
|
|
39
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
40
|
+
}
|
|
41
|
+
serialize(input, context) {
|
|
42
|
+
return se_ListProvisionedModelThroughputsCommand(input, context);
|
|
43
|
+
}
|
|
44
|
+
deserialize(output, context) {
|
|
45
|
+
return de_ListProvisionedModelThroughputsCommand(output, context);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getEndpointPlugin } from "@smithy/middleware-endpoint";
|
|
2
|
+
import { getSerdePlugin } from "@smithy/middleware-serde";
|
|
3
|
+
import { Command as $Command } from "@smithy/smithy-client";
|
|
4
|
+
import { SMITHY_CONTEXT_KEY, } from "@smithy/types";
|
|
5
|
+
import { de_UpdateProvisionedModelThroughputCommand, se_UpdateProvisionedModelThroughputCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export { $Command };
|
|
7
|
+
export class UpdateProvisionedModelThroughputCommand extends $Command {
|
|
8
|
+
static getEndpointParameterInstructions() {
|
|
9
|
+
return {
|
|
10
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
11
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
12
|
+
Region: { type: "builtInParams", name: "region" },
|
|
13
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
constructor(input) {
|
|
17
|
+
super();
|
|
18
|
+
this.input = input;
|
|
19
|
+
}
|
|
20
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
21
|
+
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));
|
|
22
|
+
this.middlewareStack.use(getEndpointPlugin(configuration, UpdateProvisionedModelThroughputCommand.getEndpointParameterInstructions()));
|
|
23
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
24
|
+
const { logger } = configuration;
|
|
25
|
+
const clientName = "BedrockClient";
|
|
26
|
+
const commandName = "UpdateProvisionedModelThroughputCommand";
|
|
27
|
+
const handlerExecutionContext = {
|
|
28
|
+
logger,
|
|
29
|
+
clientName,
|
|
30
|
+
commandName,
|
|
31
|
+
inputFilterSensitiveLog: (_) => _,
|
|
32
|
+
outputFilterSensitiveLog: (_) => _,
|
|
33
|
+
[SMITHY_CONTEXT_KEY]: {
|
|
34
|
+
service: "AmazonBedrockControlPlaneService",
|
|
35
|
+
operation: "UpdateProvisionedModelThroughput",
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
const { requestHandler } = configuration;
|
|
39
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
40
|
+
}
|
|
41
|
+
serialize(input, context) {
|
|
42
|
+
return se_UpdateProvisionedModelThroughputCommand(input, context);
|
|
43
|
+
}
|
|
44
|
+
deserialize(output, context) {
|
|
45
|
+
return de_UpdateProvisionedModelThroughputCommand(output, context);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
export * from "./CreateModelCustomizationJobCommand";
|
|
2
|
+
export * from "./CreateProvisionedModelThroughputCommand";
|
|
2
3
|
export * from "./DeleteCustomModelCommand";
|
|
3
4
|
export * from "./DeleteModelInvocationLoggingConfigurationCommand";
|
|
5
|
+
export * from "./DeleteProvisionedModelThroughputCommand";
|
|
4
6
|
export * from "./GetCustomModelCommand";
|
|
5
7
|
export * from "./GetFoundationModelCommand";
|
|
6
8
|
export * from "./GetModelCustomizationJobCommand";
|
|
7
9
|
export * from "./GetModelInvocationLoggingConfigurationCommand";
|
|
10
|
+
export * from "./GetProvisionedModelThroughputCommand";
|
|
8
11
|
export * from "./ListCustomModelsCommand";
|
|
9
12
|
export * from "./ListFoundationModelsCommand";
|
|
10
13
|
export * from "./ListModelCustomizationJobsCommand";
|
|
14
|
+
export * from "./ListProvisionedModelThroughputsCommand";
|
|
11
15
|
export * from "./ListTagsForResourceCommand";
|
|
12
16
|
export * from "./PutModelInvocationLoggingConfigurationCommand";
|
|
13
17
|
export * from "./StopModelCustomizationJobCommand";
|
|
14
18
|
export * from "./TagResourceCommand";
|
|
15
19
|
export * from "./UntagResourceCommand";
|
|
20
|
+
export * from "./UpdateProvisionedModelThroughputCommand";
|
|
@@ -90,31 +90,44 @@ export const SortOrder = {
|
|
|
90
90
|
ASCENDING: "Ascending",
|
|
91
91
|
DESCENDING: "Descending",
|
|
92
92
|
};
|
|
93
|
-
export
|
|
93
|
+
export const CommitmentDuration = {
|
|
94
|
+
ONE_MONTH: "OneMonth",
|
|
95
|
+
SIX_MONTHS: "SixMonths",
|
|
96
|
+
};
|
|
97
|
+
export class ServiceQuotaExceededException extends __BaseException {
|
|
94
98
|
constructor(opts) {
|
|
95
99
|
super({
|
|
96
|
-
name: "
|
|
100
|
+
name: "ServiceQuotaExceededException",
|
|
97
101
|
$fault: "client",
|
|
98
102
|
...opts,
|
|
99
103
|
});
|
|
100
|
-
this.name = "
|
|
104
|
+
this.name = "ServiceQuotaExceededException";
|
|
101
105
|
this.$fault = "client";
|
|
102
|
-
Object.setPrototypeOf(this,
|
|
103
|
-
this.resourceName = opts.resourceName;
|
|
106
|
+
Object.setPrototypeOf(this, ServiceQuotaExceededException.prototype);
|
|
104
107
|
}
|
|
105
108
|
}
|
|
106
|
-
export class
|
|
109
|
+
export class TooManyTagsException extends __BaseException {
|
|
107
110
|
constructor(opts) {
|
|
108
111
|
super({
|
|
109
|
-
name: "
|
|
112
|
+
name: "TooManyTagsException",
|
|
110
113
|
$fault: "client",
|
|
111
114
|
...opts,
|
|
112
115
|
});
|
|
113
|
-
this.name = "
|
|
116
|
+
this.name = "TooManyTagsException";
|
|
114
117
|
this.$fault = "client";
|
|
115
|
-
Object.setPrototypeOf(this,
|
|
118
|
+
Object.setPrototypeOf(this, TooManyTagsException.prototype);
|
|
119
|
+
this.resourceName = opts.resourceName;
|
|
116
120
|
}
|
|
117
121
|
}
|
|
122
|
+
export const ProvisionedModelStatus = {
|
|
123
|
+
CREATING: "Creating",
|
|
124
|
+
FAILED: "Failed",
|
|
125
|
+
IN_SERVICE: "InService",
|
|
126
|
+
UPDATING: "Updating",
|
|
127
|
+
};
|
|
128
|
+
export const SortByProvisionedModels = {
|
|
129
|
+
CREATION_TIME: "CreationTime",
|
|
130
|
+
};
|
|
118
131
|
export const ModelCustomizationJobStatus = {
|
|
119
132
|
COMPLETED: "Completed",
|
|
120
133
|
FAILED: "Failed",
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BedrockClient } from "../BedrockClient";
|
|
2
|
+
import { ListProvisionedModelThroughputsCommand, } from "../commands/ListProvisionedModelThroughputsCommand";
|
|
3
|
+
const makePagedClientRequest = async (client, input, ...args) => {
|
|
4
|
+
return await client.send(new ListProvisionedModelThroughputsCommand(input), ...args);
|
|
5
|
+
};
|
|
6
|
+
export async function* paginateListProvisionedModelThroughputs(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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpRequest as __HttpRequest } from "@smithy/protocol-http";
|
|
2
|
-
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client";
|
|
2
|
+
import { _json, collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, limitedParseFloat32 as __limitedParseFloat32, map, parseRfc3339DateTimeWithOffset as __parseRfc3339DateTimeWithOffset, resolvedPath as __resolvedPath, take, withBaseException, } from "@smithy/smithy-client";
|
|
3
3
|
import { v4 as generateIdempotencyToken } from "uuid";
|
|
4
4
|
import { BedrockServiceException as __BaseException } from "../models/BedrockServiceException";
|
|
5
5
|
import { AccessDeniedException, ConflictException, InternalServerException, ResourceNotFoundException, ServiceQuotaExceededException, ThrottlingException, TooManyTagsException, ValidationException, } from "../models/models_0";
|
|
@@ -35,6 +35,31 @@ export const se_CreateModelCustomizationJobCommand = async (input, context) => {
|
|
|
35
35
|
body,
|
|
36
36
|
});
|
|
37
37
|
};
|
|
38
|
+
export const se_CreateProvisionedModelThroughputCommand = async (input, context) => {
|
|
39
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
40
|
+
const headers = {
|
|
41
|
+
"content-type": "application/json",
|
|
42
|
+
};
|
|
43
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/provisioned-model-throughput";
|
|
44
|
+
let body;
|
|
45
|
+
body = JSON.stringify(take(input, {
|
|
46
|
+
clientRequestToken: [true, (_) => _ ?? generateIdempotencyToken()],
|
|
47
|
+
commitmentDuration: [],
|
|
48
|
+
modelId: [],
|
|
49
|
+
modelUnits: [],
|
|
50
|
+
provisionedModelName: [],
|
|
51
|
+
tags: (_) => _json(_),
|
|
52
|
+
}));
|
|
53
|
+
return new __HttpRequest({
|
|
54
|
+
protocol,
|
|
55
|
+
hostname,
|
|
56
|
+
port,
|
|
57
|
+
method: "POST",
|
|
58
|
+
headers,
|
|
59
|
+
path: resolvedPath,
|
|
60
|
+
body,
|
|
61
|
+
});
|
|
62
|
+
};
|
|
38
63
|
export const se_DeleteCustomModelCommand = async (input, context) => {
|
|
39
64
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
40
65
|
const headers = {};
|
|
@@ -69,6 +94,23 @@ export const se_DeleteModelInvocationLoggingConfigurationCommand = async (input,
|
|
|
69
94
|
body,
|
|
70
95
|
});
|
|
71
96
|
};
|
|
97
|
+
export const se_DeleteProvisionedModelThroughputCommand = async (input, context) => {
|
|
98
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
99
|
+
const headers = {};
|
|
100
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
101
|
+
"/provisioned-model-throughput/{provisionedModelId}";
|
|
102
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
|
|
103
|
+
let body;
|
|
104
|
+
return new __HttpRequest({
|
|
105
|
+
protocol,
|
|
106
|
+
hostname,
|
|
107
|
+
port,
|
|
108
|
+
method: "DELETE",
|
|
109
|
+
headers,
|
|
110
|
+
path: resolvedPath,
|
|
111
|
+
body,
|
|
112
|
+
});
|
|
113
|
+
};
|
|
72
114
|
export const se_GetCustomModelCommand = async (input, context) => {
|
|
73
115
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
74
116
|
const headers = {};
|
|
@@ -135,6 +177,23 @@ export const se_GetModelInvocationLoggingConfigurationCommand = async (input, co
|
|
|
135
177
|
body,
|
|
136
178
|
});
|
|
137
179
|
};
|
|
180
|
+
export const se_GetProvisionedModelThroughputCommand = async (input, context) => {
|
|
181
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
182
|
+
const headers = {};
|
|
183
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
184
|
+
"/provisioned-model-throughput/{provisionedModelId}";
|
|
185
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
|
|
186
|
+
let body;
|
|
187
|
+
return new __HttpRequest({
|
|
188
|
+
protocol,
|
|
189
|
+
hostname,
|
|
190
|
+
port,
|
|
191
|
+
method: "GET",
|
|
192
|
+
headers,
|
|
193
|
+
path: resolvedPath,
|
|
194
|
+
body,
|
|
195
|
+
});
|
|
196
|
+
};
|
|
138
197
|
export const se_ListCustomModelsCommand = async (input, context) => {
|
|
139
198
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
140
199
|
const headers = {};
|
|
@@ -222,6 +281,39 @@ export const se_ListModelCustomizationJobsCommand = async (input, context) => {
|
|
|
222
281
|
body,
|
|
223
282
|
});
|
|
224
283
|
};
|
|
284
|
+
export const se_ListProvisionedModelThroughputsCommand = async (input, context) => {
|
|
285
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
286
|
+
const headers = {};
|
|
287
|
+
const resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` + "/provisioned-model-throughputs";
|
|
288
|
+
const query = map({
|
|
289
|
+
creationTimeAfter: [
|
|
290
|
+
() => input.creationTimeAfter !== void 0,
|
|
291
|
+
() => (input.creationTimeAfter.toISOString().split(".")[0] + "Z").toString(),
|
|
292
|
+
],
|
|
293
|
+
creationTimeBefore: [
|
|
294
|
+
() => input.creationTimeBefore !== void 0,
|
|
295
|
+
() => (input.creationTimeBefore.toISOString().split(".")[0] + "Z").toString(),
|
|
296
|
+
],
|
|
297
|
+
statusEquals: [, input.statusEquals],
|
|
298
|
+
modelArnEquals: [, input.modelArnEquals],
|
|
299
|
+
nameContains: [, input.nameContains],
|
|
300
|
+
maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
|
|
301
|
+
nextToken: [, input.nextToken],
|
|
302
|
+
sortBy: [, input.sortBy],
|
|
303
|
+
sortOrder: [, input.sortOrder],
|
|
304
|
+
});
|
|
305
|
+
let body;
|
|
306
|
+
return new __HttpRequest({
|
|
307
|
+
protocol,
|
|
308
|
+
hostname,
|
|
309
|
+
port,
|
|
310
|
+
method: "GET",
|
|
311
|
+
headers,
|
|
312
|
+
path: resolvedPath,
|
|
313
|
+
query,
|
|
314
|
+
body,
|
|
315
|
+
});
|
|
316
|
+
};
|
|
225
317
|
export const se_ListTagsForResourceCommand = async (input, context) => {
|
|
226
318
|
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
227
319
|
const headers = {
|
|
@@ -321,6 +413,29 @@ export const se_UntagResourceCommand = async (input, context) => {
|
|
|
321
413
|
body,
|
|
322
414
|
});
|
|
323
415
|
};
|
|
416
|
+
export const se_UpdateProvisionedModelThroughputCommand = async (input, context) => {
|
|
417
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
418
|
+
const headers = {
|
|
419
|
+
"content-type": "application/json",
|
|
420
|
+
};
|
|
421
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
422
|
+
"/provisioned-model-throughput/{provisionedModelId}";
|
|
423
|
+
resolvedPath = __resolvedPath(resolvedPath, input, "provisionedModelId", () => input.provisionedModelId, "{provisionedModelId}", false);
|
|
424
|
+
let body;
|
|
425
|
+
body = JSON.stringify(take(input, {
|
|
426
|
+
desiredModelId: [],
|
|
427
|
+
desiredProvisionedModelName: [],
|
|
428
|
+
}));
|
|
429
|
+
return new __HttpRequest({
|
|
430
|
+
protocol,
|
|
431
|
+
hostname,
|
|
432
|
+
port,
|
|
433
|
+
method: "PATCH",
|
|
434
|
+
headers,
|
|
435
|
+
path: resolvedPath,
|
|
436
|
+
body,
|
|
437
|
+
});
|
|
438
|
+
};
|
|
324
439
|
export const de_CreateModelCustomizationJobCommand = async (output, context) => {
|
|
325
440
|
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
326
441
|
return de_CreateModelCustomizationJobCommandError(output, context);
|
|
@@ -375,6 +490,57 @@ const de_CreateModelCustomizationJobCommandError = async (output, context) => {
|
|
|
375
490
|
});
|
|
376
491
|
}
|
|
377
492
|
};
|
|
493
|
+
export const de_CreateProvisionedModelThroughputCommand = async (output, context) => {
|
|
494
|
+
if (output.statusCode !== 201 && output.statusCode >= 300) {
|
|
495
|
+
return de_CreateProvisionedModelThroughputCommandError(output, context);
|
|
496
|
+
}
|
|
497
|
+
const contents = map({
|
|
498
|
+
$metadata: deserializeMetadata(output),
|
|
499
|
+
});
|
|
500
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
501
|
+
const doc = take(data, {
|
|
502
|
+
provisionedModelArn: __expectString,
|
|
503
|
+
});
|
|
504
|
+
Object.assign(contents, doc);
|
|
505
|
+
return contents;
|
|
506
|
+
};
|
|
507
|
+
const de_CreateProvisionedModelThroughputCommandError = async (output, context) => {
|
|
508
|
+
const parsedOutput = {
|
|
509
|
+
...output,
|
|
510
|
+
body: await parseErrorBody(output.body, context),
|
|
511
|
+
};
|
|
512
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
513
|
+
switch (errorCode) {
|
|
514
|
+
case "AccessDeniedException":
|
|
515
|
+
case "com.amazonaws.bedrock#AccessDeniedException":
|
|
516
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
517
|
+
case "InternalServerException":
|
|
518
|
+
case "com.amazonaws.bedrock#InternalServerException":
|
|
519
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
520
|
+
case "ResourceNotFoundException":
|
|
521
|
+
case "com.amazonaws.bedrock#ResourceNotFoundException":
|
|
522
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
523
|
+
case "ServiceQuotaExceededException":
|
|
524
|
+
case "com.amazonaws.bedrock#ServiceQuotaExceededException":
|
|
525
|
+
throw await de_ServiceQuotaExceededExceptionRes(parsedOutput, context);
|
|
526
|
+
case "ThrottlingException":
|
|
527
|
+
case "com.amazonaws.bedrock#ThrottlingException":
|
|
528
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
529
|
+
case "TooManyTagsException":
|
|
530
|
+
case "com.amazonaws.bedrock#TooManyTagsException":
|
|
531
|
+
throw await de_TooManyTagsExceptionRes(parsedOutput, context);
|
|
532
|
+
case "ValidationException":
|
|
533
|
+
case "com.amazonaws.bedrock#ValidationException":
|
|
534
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
535
|
+
default:
|
|
536
|
+
const parsedBody = parsedOutput.body;
|
|
537
|
+
return throwDefaultError({
|
|
538
|
+
output,
|
|
539
|
+
parsedBody,
|
|
540
|
+
errorCode,
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
};
|
|
378
544
|
export const de_DeleteCustomModelCommand = async (output, context) => {
|
|
379
545
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
380
546
|
return de_DeleteCustomModelCommandError(output, context);
|
|
@@ -454,6 +620,50 @@ const de_DeleteModelInvocationLoggingConfigurationCommandError = async (output,
|
|
|
454
620
|
});
|
|
455
621
|
}
|
|
456
622
|
};
|
|
623
|
+
export const de_DeleteProvisionedModelThroughputCommand = async (output, context) => {
|
|
624
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
625
|
+
return de_DeleteProvisionedModelThroughputCommandError(output, context);
|
|
626
|
+
}
|
|
627
|
+
const contents = map({
|
|
628
|
+
$metadata: deserializeMetadata(output),
|
|
629
|
+
});
|
|
630
|
+
await collectBody(output.body, context);
|
|
631
|
+
return contents;
|
|
632
|
+
};
|
|
633
|
+
const de_DeleteProvisionedModelThroughputCommandError = async (output, context) => {
|
|
634
|
+
const parsedOutput = {
|
|
635
|
+
...output,
|
|
636
|
+
body: await parseErrorBody(output.body, context),
|
|
637
|
+
};
|
|
638
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
639
|
+
switch (errorCode) {
|
|
640
|
+
case "AccessDeniedException":
|
|
641
|
+
case "com.amazonaws.bedrock#AccessDeniedException":
|
|
642
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
643
|
+
case "ConflictException":
|
|
644
|
+
case "com.amazonaws.bedrock#ConflictException":
|
|
645
|
+
throw await de_ConflictExceptionRes(parsedOutput, context);
|
|
646
|
+
case "InternalServerException":
|
|
647
|
+
case "com.amazonaws.bedrock#InternalServerException":
|
|
648
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
649
|
+
case "ResourceNotFoundException":
|
|
650
|
+
case "com.amazonaws.bedrock#ResourceNotFoundException":
|
|
651
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
652
|
+
case "ThrottlingException":
|
|
653
|
+
case "com.amazonaws.bedrock#ThrottlingException":
|
|
654
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
655
|
+
case "ValidationException":
|
|
656
|
+
case "com.amazonaws.bedrock#ValidationException":
|
|
657
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
658
|
+
default:
|
|
659
|
+
const parsedBody = parsedOutput.body;
|
|
660
|
+
return throwDefaultError({
|
|
661
|
+
output,
|
|
662
|
+
parsedBody,
|
|
663
|
+
errorCode,
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
};
|
|
457
667
|
export const de_GetCustomModelCommand = async (output, context) => {
|
|
458
668
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
459
669
|
return de_GetCustomModelCommandError(output, context);
|
|
@@ -659,6 +869,63 @@ const de_GetModelInvocationLoggingConfigurationCommandError = async (output, con
|
|
|
659
869
|
});
|
|
660
870
|
}
|
|
661
871
|
};
|
|
872
|
+
export const de_GetProvisionedModelThroughputCommand = async (output, context) => {
|
|
873
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
874
|
+
return de_GetProvisionedModelThroughputCommandError(output, context);
|
|
875
|
+
}
|
|
876
|
+
const contents = map({
|
|
877
|
+
$metadata: deserializeMetadata(output),
|
|
878
|
+
});
|
|
879
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
880
|
+
const doc = take(data, {
|
|
881
|
+
commitmentDuration: __expectString,
|
|
882
|
+
commitmentExpirationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
883
|
+
creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
884
|
+
desiredModelArn: __expectString,
|
|
885
|
+
desiredModelUnits: __expectInt32,
|
|
886
|
+
failureMessage: __expectString,
|
|
887
|
+
foundationModelArn: __expectString,
|
|
888
|
+
lastModifiedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
889
|
+
modelArn: __expectString,
|
|
890
|
+
modelUnits: __expectInt32,
|
|
891
|
+
provisionedModelArn: __expectString,
|
|
892
|
+
provisionedModelName: __expectString,
|
|
893
|
+
status: __expectString,
|
|
894
|
+
});
|
|
895
|
+
Object.assign(contents, doc);
|
|
896
|
+
return contents;
|
|
897
|
+
};
|
|
898
|
+
const de_GetProvisionedModelThroughputCommandError = async (output, context) => {
|
|
899
|
+
const parsedOutput = {
|
|
900
|
+
...output,
|
|
901
|
+
body: await parseErrorBody(output.body, context),
|
|
902
|
+
};
|
|
903
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
904
|
+
switch (errorCode) {
|
|
905
|
+
case "AccessDeniedException":
|
|
906
|
+
case "com.amazonaws.bedrock#AccessDeniedException":
|
|
907
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
908
|
+
case "InternalServerException":
|
|
909
|
+
case "com.amazonaws.bedrock#InternalServerException":
|
|
910
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
911
|
+
case "ResourceNotFoundException":
|
|
912
|
+
case "com.amazonaws.bedrock#ResourceNotFoundException":
|
|
913
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
914
|
+
case "ThrottlingException":
|
|
915
|
+
case "com.amazonaws.bedrock#ThrottlingException":
|
|
916
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
917
|
+
case "ValidationException":
|
|
918
|
+
case "com.amazonaws.bedrock#ValidationException":
|
|
919
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
920
|
+
default:
|
|
921
|
+
const parsedBody = parsedOutput.body;
|
|
922
|
+
return throwDefaultError({
|
|
923
|
+
output,
|
|
924
|
+
parsedBody,
|
|
925
|
+
errorCode,
|
|
926
|
+
});
|
|
927
|
+
}
|
|
928
|
+
};
|
|
662
929
|
export const de_ListCustomModelsCommand = async (output, context) => {
|
|
663
930
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
664
931
|
return de_ListCustomModelsCommandError(output, context);
|
|
@@ -787,6 +1054,49 @@ const de_ListModelCustomizationJobsCommandError = async (output, context) => {
|
|
|
787
1054
|
});
|
|
788
1055
|
}
|
|
789
1056
|
};
|
|
1057
|
+
export const de_ListProvisionedModelThroughputsCommand = async (output, context) => {
|
|
1058
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1059
|
+
return de_ListProvisionedModelThroughputsCommandError(output, context);
|
|
1060
|
+
}
|
|
1061
|
+
const contents = map({
|
|
1062
|
+
$metadata: deserializeMetadata(output),
|
|
1063
|
+
});
|
|
1064
|
+
const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
|
|
1065
|
+
const doc = take(data, {
|
|
1066
|
+
nextToken: __expectString,
|
|
1067
|
+
provisionedModelSummaries: (_) => de_ProvisionedModelSummaries(_, context),
|
|
1068
|
+
});
|
|
1069
|
+
Object.assign(contents, doc);
|
|
1070
|
+
return contents;
|
|
1071
|
+
};
|
|
1072
|
+
const de_ListProvisionedModelThroughputsCommandError = async (output, context) => {
|
|
1073
|
+
const parsedOutput = {
|
|
1074
|
+
...output,
|
|
1075
|
+
body: await parseErrorBody(output.body, context),
|
|
1076
|
+
};
|
|
1077
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1078
|
+
switch (errorCode) {
|
|
1079
|
+
case "AccessDeniedException":
|
|
1080
|
+
case "com.amazonaws.bedrock#AccessDeniedException":
|
|
1081
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1082
|
+
case "InternalServerException":
|
|
1083
|
+
case "com.amazonaws.bedrock#InternalServerException":
|
|
1084
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
1085
|
+
case "ThrottlingException":
|
|
1086
|
+
case "com.amazonaws.bedrock#ThrottlingException":
|
|
1087
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
1088
|
+
case "ValidationException":
|
|
1089
|
+
case "com.amazonaws.bedrock#ValidationException":
|
|
1090
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1091
|
+
default:
|
|
1092
|
+
const parsedBody = parsedOutput.body;
|
|
1093
|
+
return throwDefaultError({
|
|
1094
|
+
output,
|
|
1095
|
+
parsedBody,
|
|
1096
|
+
errorCode,
|
|
1097
|
+
});
|
|
1098
|
+
}
|
|
1099
|
+
};
|
|
790
1100
|
export const de_ListTagsForResourceCommand = async (output, context) => {
|
|
791
1101
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
792
1102
|
return de_ListTagsForResourceCommandError(output, context);
|
|
@@ -999,6 +1309,47 @@ const de_UntagResourceCommandError = async (output, context) => {
|
|
|
999
1309
|
});
|
|
1000
1310
|
}
|
|
1001
1311
|
};
|
|
1312
|
+
export const de_UpdateProvisionedModelThroughputCommand = async (output, context) => {
|
|
1313
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
1314
|
+
return de_UpdateProvisionedModelThroughputCommandError(output, context);
|
|
1315
|
+
}
|
|
1316
|
+
const contents = map({
|
|
1317
|
+
$metadata: deserializeMetadata(output),
|
|
1318
|
+
});
|
|
1319
|
+
await collectBody(output.body, context);
|
|
1320
|
+
return contents;
|
|
1321
|
+
};
|
|
1322
|
+
const de_UpdateProvisionedModelThroughputCommandError = async (output, context) => {
|
|
1323
|
+
const parsedOutput = {
|
|
1324
|
+
...output,
|
|
1325
|
+
body: await parseErrorBody(output.body, context),
|
|
1326
|
+
};
|
|
1327
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
1328
|
+
switch (errorCode) {
|
|
1329
|
+
case "AccessDeniedException":
|
|
1330
|
+
case "com.amazonaws.bedrock#AccessDeniedException":
|
|
1331
|
+
throw await de_AccessDeniedExceptionRes(parsedOutput, context);
|
|
1332
|
+
case "InternalServerException":
|
|
1333
|
+
case "com.amazonaws.bedrock#InternalServerException":
|
|
1334
|
+
throw await de_InternalServerExceptionRes(parsedOutput, context);
|
|
1335
|
+
case "ResourceNotFoundException":
|
|
1336
|
+
case "com.amazonaws.bedrock#ResourceNotFoundException":
|
|
1337
|
+
throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
|
|
1338
|
+
case "ThrottlingException":
|
|
1339
|
+
case "com.amazonaws.bedrock#ThrottlingException":
|
|
1340
|
+
throw await de_ThrottlingExceptionRes(parsedOutput, context);
|
|
1341
|
+
case "ValidationException":
|
|
1342
|
+
case "com.amazonaws.bedrock#ValidationException":
|
|
1343
|
+
throw await de_ValidationExceptionRes(parsedOutput, context);
|
|
1344
|
+
default:
|
|
1345
|
+
const parsedBody = parsedOutput.body;
|
|
1346
|
+
return throwDefaultError({
|
|
1347
|
+
output,
|
|
1348
|
+
parsedBody,
|
|
1349
|
+
errorCode,
|
|
1350
|
+
});
|
|
1351
|
+
}
|
|
1352
|
+
};
|
|
1002
1353
|
const throwDefaultError = withBaseException(__BaseException);
|
|
1003
1354
|
const de_AccessDeniedExceptionRes = async (parsedOutput, context) => {
|
|
1004
1355
|
const contents = map({});
|
|
@@ -1143,6 +1494,30 @@ const de_ModelCustomizationJobSummary = (output, context) => {
|
|
|
1143
1494
|
status: __expectString,
|
|
1144
1495
|
});
|
|
1145
1496
|
};
|
|
1497
|
+
const de_ProvisionedModelSummaries = (output, context) => {
|
|
1498
|
+
const retVal = (output || [])
|
|
1499
|
+
.filter((e) => e != null)
|
|
1500
|
+
.map((entry) => {
|
|
1501
|
+
return de_ProvisionedModelSummary(entry, context);
|
|
1502
|
+
});
|
|
1503
|
+
return retVal;
|
|
1504
|
+
};
|
|
1505
|
+
const de_ProvisionedModelSummary = (output, context) => {
|
|
1506
|
+
return take(output, {
|
|
1507
|
+
commitmentDuration: __expectString,
|
|
1508
|
+
commitmentExpirationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
1509
|
+
creationTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
1510
|
+
desiredModelArn: __expectString,
|
|
1511
|
+
desiredModelUnits: __expectInt32,
|
|
1512
|
+
foundationModelArn: __expectString,
|
|
1513
|
+
lastModifiedTime: (_) => __expectNonNull(__parseRfc3339DateTimeWithOffset(_)),
|
|
1514
|
+
modelArn: __expectString,
|
|
1515
|
+
modelUnits: __expectInt32,
|
|
1516
|
+
provisionedModelArn: __expectString,
|
|
1517
|
+
provisionedModelName: __expectString,
|
|
1518
|
+
status: __expectString,
|
|
1519
|
+
});
|
|
1520
|
+
};
|
|
1146
1521
|
const de_TrainingMetrics = (output, context) => {
|
|
1147
1522
|
return take(output, {
|
|
1148
1523
|
trainingLoss: __limitedParseFloat32,
|