@aws-sdk/client-sagemaker-runtime 3.398.0 → 3.405.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 +8 -0
- package/dist-cjs/SageMakerRuntime.js +2 -0
- package/dist-cjs/SageMakerRuntimeClient.js +5 -3
- package/dist-cjs/commands/InvokeEndpointWithResponseStreamCommand.js +47 -0
- package/dist-cjs/commands/index.js +1 -0
- package/dist-cjs/endpoint/ruleset.js +1 -1
- package/dist-cjs/models/models_0.js +70 -1
- package/dist-cjs/protocols/Aws_restJson1.js +144 -1
- package/dist-cjs/runtimeConfig.browser.js +2 -0
- package/dist-cjs/runtimeConfig.js +2 -0
- package/dist-es/SageMakerRuntime.js +2 -0
- package/dist-es/SageMakerRuntimeClient.js +5 -3
- package/dist-es/commands/InvokeEndpointWithResponseStreamCommand.js +43 -0
- package/dist-es/commands/index.js +1 -0
- package/dist-es/endpoint/ruleset.js +1 -1
- package/dist-es/models/models_0.js +63 -0
- package/dist-es/protocols/Aws_restJson1.js +142 -1
- package/dist-es/runtimeConfig.browser.js +2 -0
- package/dist-es/runtimeConfig.js +2 -0
- package/dist-types/SageMakerRuntime.d.ts +7 -0
- package/dist-types/SageMakerRuntimeClient.d.ts +11 -5
- package/dist-types/commands/InvokeEndpointAsyncCommand.d.ts +8 -8
- package/dist-types/commands/InvokeEndpointCommand.d.ts +7 -8
- package/dist-types/commands/InvokeEndpointWithResponseStreamCommand.d.ts +151 -0
- package/dist-types/commands/index.d.ts +1 -0
- package/dist-types/models/models_0.d.ts +326 -61
- package/dist-types/protocols/Aws_restJson1.d.ts +10 -1
- package/dist-types/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/runtimeConfig.d.ts +1 -0
- package/dist-types/runtimeConfig.native.d.ts +1 -0
- package/dist-types/ts3.4/SageMakerRuntime.d.ts +17 -0
- package/dist-types/ts3.4/SageMakerRuntimeClient.d.ts +16 -2
- package/dist-types/ts3.4/commands/InvokeEndpointWithResponseStreamCommand.d.ts +49 -0
- package/dist-types/ts3.4/commands/index.d.ts +1 -0
- package/dist-types/ts3.4/models/models_0.d.ts +82 -0
- package/dist-types/ts3.4/protocols/Aws_restJson1.d.ts +16 -1
- package/dist-types/ts3.4/runtimeConfig.browser.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.d.ts +1 -0
- package/dist-types/ts3.4/runtimeConfig.native.d.ts +1 -0
- package/package.json +10 -7
package/README.md
CHANGED
|
@@ -219,3 +219,11 @@ InvokeEndpointAsync
|
|
|
219
219
|
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker-runtime/classes/invokeendpointasynccommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker-runtime/interfaces/invokeendpointasynccommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker-runtime/interfaces/invokeendpointasynccommandoutput.html)
|
|
220
220
|
|
|
221
221
|
</details>
|
|
222
|
+
<details>
|
|
223
|
+
<summary>
|
|
224
|
+
InvokeEndpointWithResponseStream
|
|
225
|
+
</summary>
|
|
226
|
+
|
|
227
|
+
[Command API Reference](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker-runtime/classes/invokeendpointwithresponsestreamcommand.html) / [Input](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker-runtime/interfaces/invokeendpointwithresponsestreamcommandinput.html) / [Output](https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/clients/client-sagemaker-runtime/interfaces/invokeendpointwithresponsestreamcommandoutput.html)
|
|
228
|
+
|
|
229
|
+
</details>
|
|
@@ -4,10 +4,12 @@ exports.SageMakerRuntime = void 0;
|
|
|
4
4
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
5
|
const InvokeEndpointAsyncCommand_1 = require("./commands/InvokeEndpointAsyncCommand");
|
|
6
6
|
const InvokeEndpointCommand_1 = require("./commands/InvokeEndpointCommand");
|
|
7
|
+
const InvokeEndpointWithResponseStreamCommand_1 = require("./commands/InvokeEndpointWithResponseStreamCommand");
|
|
7
8
|
const SageMakerRuntimeClient_1 = require("./SageMakerRuntimeClient");
|
|
8
9
|
const commands = {
|
|
9
10
|
InvokeEndpointCommand: InvokeEndpointCommand_1.InvokeEndpointCommand,
|
|
10
11
|
InvokeEndpointAsyncCommand: InvokeEndpointAsyncCommand_1.InvokeEndpointAsyncCommand,
|
|
12
|
+
InvokeEndpointWithResponseStreamCommand: InvokeEndpointWithResponseStreamCommand_1.InvokeEndpointWithResponseStreamCommand,
|
|
11
13
|
};
|
|
12
14
|
class SageMakerRuntime extends SageMakerRuntimeClient_1.SageMakerRuntimeClient {
|
|
13
15
|
}
|
|
@@ -7,6 +7,7 @@ const middleware_recursion_detection_1 = require("@aws-sdk/middleware-recursion-
|
|
|
7
7
|
const middleware_signing_1 = require("@aws-sdk/middleware-signing");
|
|
8
8
|
const middleware_user_agent_1 = require("@aws-sdk/middleware-user-agent");
|
|
9
9
|
const config_resolver_1 = require("@smithy/config-resolver");
|
|
10
|
+
const eventstream_serde_config_resolver_1 = require("@smithy/eventstream-serde-config-resolver");
|
|
10
11
|
const middleware_content_length_1 = require("@smithy/middleware-content-length");
|
|
11
12
|
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
12
13
|
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
@@ -25,9 +26,10 @@ class SageMakerRuntimeClient extends smithy_client_1.Client {
|
|
|
25
26
|
const _config_5 = (0, middleware_host_header_1.resolveHostHeaderConfig)(_config_4);
|
|
26
27
|
const _config_6 = (0, middleware_signing_1.resolveAwsAuthConfig)(_config_5);
|
|
27
28
|
const _config_7 = (0, middleware_user_agent_1.resolveUserAgentConfig)(_config_6);
|
|
28
|
-
const _config_8 = (0,
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
const _config_8 = (0, eventstream_serde_config_resolver_1.resolveEventStreamSerdeConfig)(_config_7);
|
|
30
|
+
const _config_9 = (0, runtimeExtensions_1.resolveRuntimeExtensions)(_config_8, configuration?.extensions || []);
|
|
31
|
+
super(_config_9);
|
|
32
|
+
this.config = _config_9;
|
|
31
33
|
this.middlewareStack.use((0, middleware_retry_1.getRetryPlugin)(this.config));
|
|
32
34
|
this.middlewareStack.use((0, middleware_content_length_1.getContentLengthPlugin)(this.config));
|
|
33
35
|
this.middlewareStack.use((0, middleware_host_header_1.getHostHeaderPlugin)(this.config));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InvokeEndpointWithResponseStreamCommand = exports.$Command = void 0;
|
|
4
|
+
const middleware_endpoint_1 = require("@smithy/middleware-endpoint");
|
|
5
|
+
const middleware_serde_1 = require("@smithy/middleware-serde");
|
|
6
|
+
const smithy_client_1 = require("@smithy/smithy-client");
|
|
7
|
+
Object.defineProperty(exports, "$Command", { enumerable: true, get: function () { return smithy_client_1.Command; } });
|
|
8
|
+
const models_0_1 = require("../models/models_0");
|
|
9
|
+
const Aws_restJson1_1 = require("../protocols/Aws_restJson1");
|
|
10
|
+
class InvokeEndpointWithResponseStreamCommand extends smithy_client_1.Command {
|
|
11
|
+
static getEndpointParameterInstructions() {
|
|
12
|
+
return {
|
|
13
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
14
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
15
|
+
Region: { type: "builtInParams", name: "region" },
|
|
16
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
constructor(input) {
|
|
20
|
+
super();
|
|
21
|
+
this.input = input;
|
|
22
|
+
}
|
|
23
|
+
resolveMiddleware(clientStack, configuration, options) {
|
|
24
|
+
this.middlewareStack.use((0, middleware_serde_1.getSerdePlugin)(configuration, this.serialize, this.deserialize));
|
|
25
|
+
this.middlewareStack.use((0, middleware_endpoint_1.getEndpointPlugin)(configuration, InvokeEndpointWithResponseStreamCommand.getEndpointParameterInstructions()));
|
|
26
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
27
|
+
const { logger } = configuration;
|
|
28
|
+
const clientName = "SageMakerRuntimeClient";
|
|
29
|
+
const commandName = "InvokeEndpointWithResponseStreamCommand";
|
|
30
|
+
const handlerExecutionContext = {
|
|
31
|
+
logger,
|
|
32
|
+
clientName,
|
|
33
|
+
commandName,
|
|
34
|
+
inputFilterSensitiveLog: models_0_1.InvokeEndpointWithResponseStreamInputFilterSensitiveLog,
|
|
35
|
+
outputFilterSensitiveLog: models_0_1.InvokeEndpointWithResponseStreamOutputFilterSensitiveLog,
|
|
36
|
+
};
|
|
37
|
+
const { requestHandler } = configuration;
|
|
38
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
39
|
+
}
|
|
40
|
+
serialize(input, context) {
|
|
41
|
+
return (0, Aws_restJson1_1.se_InvokeEndpointWithResponseStreamCommand)(input, context);
|
|
42
|
+
}
|
|
43
|
+
deserialize(output, context) {
|
|
44
|
+
return (0, Aws_restJson1_1.de_InvokeEndpointWithResponseStreamCommand)(output, context);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
exports.InvokeEndpointWithResponseStreamCommand = InvokeEndpointWithResponseStreamCommand;
|
|
@@ -3,3 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
tslib_1.__exportStar(require("./InvokeEndpointAsyncCommand"), exports);
|
|
5
5
|
tslib_1.__exportStar(require("./InvokeEndpointCommand"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./InvokeEndpointWithResponseStreamCommand"), exports);
|
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ruleSet = void 0;
|
|
4
4
|
const s = "required", t = "fn", u = "argv", v = "ref";
|
|
5
5
|
const a = "isSet", b = "tree", c = "error", d = "endpoint", e = "PartitionResult", f = "stringEquals", g = { [s]: false, "type": "String" }, h = { [s]: true, "default": false, "type": "Boolean" }, i = { [v]: "Endpoint" }, j = { [t]: "booleanEquals", [u]: [{ [v]: "UseFIPS" }, true] }, k = { [t]: "booleanEquals", [u]: [{ [v]: "UseDualStack" }, true] }, l = {}, m = { [t]: "booleanEquals", [u]: [true, { [t]: "getAttr", [u]: [{ [v]: e }, "supportsFIPS"] }] }, n = { [t]: "booleanEquals", [u]: [true, { [t]: "getAttr", [u]: [{ [v]: e }, "supportsDualStack"] }] }, o = { [t]: "getAttr", [u]: [{ [v]: e }, "name"] }, p = [j], q = [k], r = [{ [v]: "Region" }];
|
|
6
|
-
const _data = { version: "1.0", parameters: { Region: g, UseDualStack: h, UseFIPS: h, Endpoint: g }, rules: [{ conditions: [{ [t]: a, [u]: [i] }], type: b, rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, {
|
|
6
|
+
const _data = { version: "1.0", parameters: { Region: g, UseDualStack: h, UseFIPS: h, Endpoint: g }, rules: [{ conditions: [{ [t]: a, [u]: [i] }], type: b, rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: i, properties: l, headers: l }, type: d }] }, { conditions: [{ [t]: a, [u]: r }], type: b, rules: [{ conditions: [{ [t]: "aws.partition", [u]: r, assign: e }], type: b, rules: [{ conditions: [j, k], type: b, rules: [{ conditions: [m, n], type: b, rules: [{ endpoint: { url: "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: p, type: b, rules: [{ conditions: [m], type: b, rules: [{ conditions: [{ [t]: f, [u]: ["aws", o] }], endpoint: { url: "https://runtime-fips.sagemaker.{Region}.amazonaws.com", properties: l, headers: l }, type: d }, { conditions: [{ [t]: f, [u]: ["aws-us-gov", o] }], endpoint: { url: "https://runtime.sagemaker.{Region}.amazonaws.com", properties: l, headers: l }, type: d }, { endpoint: { url: "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: d }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: q, type: b, rules: [{ conditions: [n], type: b, rules: [{ endpoint: { url: "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: d }] }] }, { error: "Invalid Configuration: Missing Region", type: c }] };
|
|
7
7
|
exports.ruleSet = _data;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.InvokeEndpointAsyncInputFilterSensitiveLog = exports.InvokeEndpointOutputFilterSensitiveLog = exports.InvokeEndpointInputFilterSensitiveLog = exports.ValidationError = exports.ServiceUnavailable = exports.ModelNotReadyException = exports.ModelError = exports.InternalFailure = exports.InternalDependencyException = void 0;
|
|
3
|
+
exports.InvokeEndpointWithResponseStreamOutputFilterSensitiveLog = exports.ResponseStreamFilterSensitiveLog = exports.PayloadPartFilterSensitiveLog = exports.InvokeEndpointWithResponseStreamInputFilterSensitiveLog = exports.InvokeEndpointAsyncInputFilterSensitiveLog = exports.InvokeEndpointOutputFilterSensitiveLog = exports.InvokeEndpointInputFilterSensitiveLog = exports.ResponseStream = exports.ModelStreamError = exports.InternalStreamFailure = exports.ValidationError = exports.ServiceUnavailable = exports.ModelNotReadyException = exports.ModelError = exports.InternalFailure = exports.InternalDependencyException = void 0;
|
|
4
4
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
5
5
|
const SageMakerRuntimeServiceException_1 = require("./SageMakerRuntimeServiceException");
|
|
6
6
|
class InternalDependencyException extends SageMakerRuntimeServiceException_1.SageMakerRuntimeServiceException {
|
|
@@ -90,6 +90,47 @@ class ValidationError extends SageMakerRuntimeServiceException_1.SageMakerRuntim
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
exports.ValidationError = ValidationError;
|
|
93
|
+
class InternalStreamFailure extends SageMakerRuntimeServiceException_1.SageMakerRuntimeServiceException {
|
|
94
|
+
constructor(opts) {
|
|
95
|
+
super({
|
|
96
|
+
name: "InternalStreamFailure",
|
|
97
|
+
$fault: "server",
|
|
98
|
+
...opts,
|
|
99
|
+
});
|
|
100
|
+
this.name = "InternalStreamFailure";
|
|
101
|
+
this.$fault = "server";
|
|
102
|
+
Object.setPrototypeOf(this, InternalStreamFailure.prototype);
|
|
103
|
+
this.Message = opts.Message;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.InternalStreamFailure = InternalStreamFailure;
|
|
107
|
+
class ModelStreamError extends SageMakerRuntimeServiceException_1.SageMakerRuntimeServiceException {
|
|
108
|
+
constructor(opts) {
|
|
109
|
+
super({
|
|
110
|
+
name: "ModelStreamError",
|
|
111
|
+
$fault: "client",
|
|
112
|
+
...opts,
|
|
113
|
+
});
|
|
114
|
+
this.name = "ModelStreamError";
|
|
115
|
+
this.$fault = "client";
|
|
116
|
+
Object.setPrototypeOf(this, ModelStreamError.prototype);
|
|
117
|
+
this.Message = opts.Message;
|
|
118
|
+
this.ErrorCode = opts.ErrorCode;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
exports.ModelStreamError = ModelStreamError;
|
|
122
|
+
var ResponseStream;
|
|
123
|
+
(function (ResponseStream) {
|
|
124
|
+
ResponseStream.visit = (value, visitor) => {
|
|
125
|
+
if (value.PayloadPart !== undefined)
|
|
126
|
+
return visitor.PayloadPart(value.PayloadPart);
|
|
127
|
+
if (value.ModelStreamError !== undefined)
|
|
128
|
+
return visitor.ModelStreamError(value.ModelStreamError);
|
|
129
|
+
if (value.InternalStreamFailure !== undefined)
|
|
130
|
+
return visitor.InternalStreamFailure(value.InternalStreamFailure);
|
|
131
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
132
|
+
};
|
|
133
|
+
})(ResponseStream = exports.ResponseStream || (exports.ResponseStream = {}));
|
|
93
134
|
const InvokeEndpointInputFilterSensitiveLog = (obj) => ({
|
|
94
135
|
...obj,
|
|
95
136
|
...(obj.Body && { Body: smithy_client_1.SENSITIVE_STRING }),
|
|
@@ -107,3 +148,31 @@ const InvokeEndpointAsyncInputFilterSensitiveLog = (obj) => ({
|
|
|
107
148
|
...(obj.CustomAttributes && { CustomAttributes: smithy_client_1.SENSITIVE_STRING }),
|
|
108
149
|
});
|
|
109
150
|
exports.InvokeEndpointAsyncInputFilterSensitiveLog = InvokeEndpointAsyncInputFilterSensitiveLog;
|
|
151
|
+
const InvokeEndpointWithResponseStreamInputFilterSensitiveLog = (obj) => ({
|
|
152
|
+
...obj,
|
|
153
|
+
...(obj.Body && { Body: smithy_client_1.SENSITIVE_STRING }),
|
|
154
|
+
...(obj.CustomAttributes && { CustomAttributes: smithy_client_1.SENSITIVE_STRING }),
|
|
155
|
+
});
|
|
156
|
+
exports.InvokeEndpointWithResponseStreamInputFilterSensitiveLog = InvokeEndpointWithResponseStreamInputFilterSensitiveLog;
|
|
157
|
+
const PayloadPartFilterSensitiveLog = (obj) => ({
|
|
158
|
+
...obj,
|
|
159
|
+
...(obj.Bytes && { Bytes: smithy_client_1.SENSITIVE_STRING }),
|
|
160
|
+
});
|
|
161
|
+
exports.PayloadPartFilterSensitiveLog = PayloadPartFilterSensitiveLog;
|
|
162
|
+
const ResponseStreamFilterSensitiveLog = (obj) => {
|
|
163
|
+
if (obj.PayloadPart !== undefined)
|
|
164
|
+
return { PayloadPart: (0, exports.PayloadPartFilterSensitiveLog)(obj.PayloadPart) };
|
|
165
|
+
if (obj.ModelStreamError !== undefined)
|
|
166
|
+
return { ModelStreamError: obj.ModelStreamError };
|
|
167
|
+
if (obj.InternalStreamFailure !== undefined)
|
|
168
|
+
return { InternalStreamFailure: obj.InternalStreamFailure };
|
|
169
|
+
if (obj.$unknown !== undefined)
|
|
170
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
171
|
+
};
|
|
172
|
+
exports.ResponseStreamFilterSensitiveLog = ResponseStreamFilterSensitiveLog;
|
|
173
|
+
const InvokeEndpointWithResponseStreamOutputFilterSensitiveLog = (obj) => ({
|
|
174
|
+
...obj,
|
|
175
|
+
...(obj.Body && { Body: "STREAMING_CONTENT" }),
|
|
176
|
+
...(obj.CustomAttributes && { CustomAttributes: smithy_client_1.SENSITIVE_STRING }),
|
|
177
|
+
});
|
|
178
|
+
exports.InvokeEndpointWithResponseStreamOutputFilterSensitiveLog = InvokeEndpointWithResponseStreamOutputFilterSensitiveLog;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.de_InvokeEndpointAsyncCommand = exports.de_InvokeEndpointCommand = exports.se_InvokeEndpointAsyncCommand = exports.se_InvokeEndpointCommand = void 0;
|
|
3
|
+
exports.de_InvokeEndpointWithResponseStreamCommand = exports.de_InvokeEndpointAsyncCommand = exports.de_InvokeEndpointCommand = exports.se_InvokeEndpointWithResponseStreamCommand = exports.se_InvokeEndpointAsyncCommand = exports.se_InvokeEndpointCommand = void 0;
|
|
4
4
|
const protocol_http_1 = require("@smithy/protocol-http");
|
|
5
5
|
const smithy_client_1 = require("@smithy/smithy-client");
|
|
6
6
|
const models_0_1 = require("../models/models_0");
|
|
@@ -66,6 +66,34 @@ const se_InvokeEndpointAsyncCommand = async (input, context) => {
|
|
|
66
66
|
});
|
|
67
67
|
};
|
|
68
68
|
exports.se_InvokeEndpointAsyncCommand = se_InvokeEndpointAsyncCommand;
|
|
69
|
+
const se_InvokeEndpointWithResponseStreamCommand = async (input, context) => {
|
|
70
|
+
const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
|
|
71
|
+
const headers = (0, smithy_client_1.map)({}, isSerializableHeaderValue, {
|
|
72
|
+
"content-type": input.ContentType || "application/octet-stream",
|
|
73
|
+
"x-amzn-sagemaker-accept": input.Accept,
|
|
74
|
+
"x-amzn-sagemaker-custom-attributes": input.CustomAttributes,
|
|
75
|
+
"x-amzn-sagemaker-target-variant": input.TargetVariant,
|
|
76
|
+
"x-amzn-sagemaker-target-container-hostname": input.TargetContainerHostname,
|
|
77
|
+
"x-amzn-sagemaker-inference-id": input.InferenceId,
|
|
78
|
+
});
|
|
79
|
+
let resolvedPath = `${basePath?.endsWith("/") ? basePath.slice(0, -1) : basePath || ""}` +
|
|
80
|
+
"/endpoints/{EndpointName}/invocations-response-stream";
|
|
81
|
+
resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "EndpointName", () => input.EndpointName, "{EndpointName}", false);
|
|
82
|
+
let body;
|
|
83
|
+
if (input.Body !== undefined) {
|
|
84
|
+
body = input.Body;
|
|
85
|
+
}
|
|
86
|
+
return new protocol_http_1.HttpRequest({
|
|
87
|
+
protocol,
|
|
88
|
+
hostname,
|
|
89
|
+
port,
|
|
90
|
+
method: "POST",
|
|
91
|
+
headers,
|
|
92
|
+
path: resolvedPath,
|
|
93
|
+
body,
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
exports.se_InvokeEndpointWithResponseStreamCommand = se_InvokeEndpointWithResponseStreamCommand;
|
|
69
97
|
const de_InvokeEndpointCommand = async (output, context) => {
|
|
70
98
|
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
71
99
|
return de_InvokeEndpointCommandError(output, context);
|
|
@@ -157,6 +185,55 @@ const de_InvokeEndpointAsyncCommandError = async (output, context) => {
|
|
|
157
185
|
});
|
|
158
186
|
}
|
|
159
187
|
};
|
|
188
|
+
const de_InvokeEndpointWithResponseStreamCommand = async (output, context) => {
|
|
189
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
190
|
+
return de_InvokeEndpointWithResponseStreamCommandError(output, context);
|
|
191
|
+
}
|
|
192
|
+
const contents = (0, smithy_client_1.map)({
|
|
193
|
+
$metadata: deserializeMetadata(output),
|
|
194
|
+
ContentType: [, output.headers["x-amzn-sagemaker-content-type"]],
|
|
195
|
+
InvokedProductionVariant: [, output.headers["x-amzn-invoked-production-variant"]],
|
|
196
|
+
CustomAttributes: [, output.headers["x-amzn-sagemaker-custom-attributes"]],
|
|
197
|
+
});
|
|
198
|
+
const data = output.body;
|
|
199
|
+
contents.Body = de_ResponseStream(data, context);
|
|
200
|
+
return contents;
|
|
201
|
+
};
|
|
202
|
+
exports.de_InvokeEndpointWithResponseStreamCommand = de_InvokeEndpointWithResponseStreamCommand;
|
|
203
|
+
const de_InvokeEndpointWithResponseStreamCommandError = async (output, context) => {
|
|
204
|
+
const parsedOutput = {
|
|
205
|
+
...output,
|
|
206
|
+
body: await parseErrorBody(output.body, context),
|
|
207
|
+
};
|
|
208
|
+
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
209
|
+
switch (errorCode) {
|
|
210
|
+
case "InternalFailure":
|
|
211
|
+
case "com.amazonaws.sagemakerruntime#InternalFailure":
|
|
212
|
+
throw await de_InternalFailureRes(parsedOutput, context);
|
|
213
|
+
case "InternalStreamFailure":
|
|
214
|
+
case "com.amazonaws.sagemakerruntime#InternalStreamFailure":
|
|
215
|
+
throw await de_InternalStreamFailureRes(parsedOutput, context);
|
|
216
|
+
case "ModelError":
|
|
217
|
+
case "com.amazonaws.sagemakerruntime#ModelError":
|
|
218
|
+
throw await de_ModelErrorRes(parsedOutput, context);
|
|
219
|
+
case "ModelStreamError":
|
|
220
|
+
case "com.amazonaws.sagemakerruntime#ModelStreamError":
|
|
221
|
+
throw await de_ModelStreamErrorRes(parsedOutput, context);
|
|
222
|
+
case "ServiceUnavailable":
|
|
223
|
+
case "com.amazonaws.sagemakerruntime#ServiceUnavailable":
|
|
224
|
+
throw await de_ServiceUnavailableRes(parsedOutput, context);
|
|
225
|
+
case "ValidationError":
|
|
226
|
+
case "com.amazonaws.sagemakerruntime#ValidationError":
|
|
227
|
+
throw await de_ValidationErrorRes(parsedOutput, context);
|
|
228
|
+
default:
|
|
229
|
+
const parsedBody = parsedOutput.body;
|
|
230
|
+
return throwDefaultError({
|
|
231
|
+
output,
|
|
232
|
+
parsedBody,
|
|
233
|
+
errorCode,
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
};
|
|
160
237
|
const throwDefaultError = (0, smithy_client_1.withBaseException)(SageMakerRuntimeServiceException_1.SageMakerRuntimeServiceException);
|
|
161
238
|
const de_InternalDependencyExceptionRes = async (parsedOutput, context) => {
|
|
162
239
|
const contents = (0, smithy_client_1.map)({});
|
|
@@ -184,6 +261,19 @@ const de_InternalFailureRes = async (parsedOutput, context) => {
|
|
|
184
261
|
});
|
|
185
262
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
186
263
|
};
|
|
264
|
+
const de_InternalStreamFailureRes = async (parsedOutput, context) => {
|
|
265
|
+
const contents = (0, smithy_client_1.map)({});
|
|
266
|
+
const data = parsedOutput.body;
|
|
267
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
268
|
+
Message: smithy_client_1.expectString,
|
|
269
|
+
});
|
|
270
|
+
Object.assign(contents, doc);
|
|
271
|
+
const exception = new models_0_1.InternalStreamFailure({
|
|
272
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
273
|
+
...contents,
|
|
274
|
+
});
|
|
275
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
276
|
+
};
|
|
187
277
|
const de_ModelErrorRes = async (parsedOutput, context) => {
|
|
188
278
|
const contents = (0, smithy_client_1.map)({});
|
|
189
279
|
const data = parsedOutput.body;
|
|
@@ -213,6 +303,20 @@ const de_ModelNotReadyExceptionRes = async (parsedOutput, context) => {
|
|
|
213
303
|
});
|
|
214
304
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
215
305
|
};
|
|
306
|
+
const de_ModelStreamErrorRes = async (parsedOutput, context) => {
|
|
307
|
+
const contents = (0, smithy_client_1.map)({});
|
|
308
|
+
const data = parsedOutput.body;
|
|
309
|
+
const doc = (0, smithy_client_1.take)(data, {
|
|
310
|
+
ErrorCode: smithy_client_1.expectString,
|
|
311
|
+
Message: smithy_client_1.expectString,
|
|
312
|
+
});
|
|
313
|
+
Object.assign(contents, doc);
|
|
314
|
+
const exception = new models_0_1.ModelStreamError({
|
|
315
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
316
|
+
...contents,
|
|
317
|
+
});
|
|
318
|
+
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
319
|
+
};
|
|
216
320
|
const de_ServiceUnavailableRes = async (parsedOutput, context) => {
|
|
217
321
|
const contents = (0, smithy_client_1.map)({});
|
|
218
322
|
const data = parsedOutput.body;
|
|
@@ -239,6 +343,45 @@ const de_ValidationErrorRes = async (parsedOutput, context) => {
|
|
|
239
343
|
});
|
|
240
344
|
return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
|
|
241
345
|
};
|
|
346
|
+
const de_ResponseStream = (output, context) => {
|
|
347
|
+
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
348
|
+
if (event["PayloadPart"] != null) {
|
|
349
|
+
return {
|
|
350
|
+
PayloadPart: await de_PayloadPart_event(event["PayloadPart"], context),
|
|
351
|
+
};
|
|
352
|
+
}
|
|
353
|
+
if (event["ModelStreamError"] != null) {
|
|
354
|
+
return {
|
|
355
|
+
ModelStreamError: await de_ModelStreamError_event(event["ModelStreamError"], context),
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
if (event["InternalStreamFailure"] != null) {
|
|
359
|
+
return {
|
|
360
|
+
InternalStreamFailure: await de_InternalStreamFailure_event(event["InternalStreamFailure"], context),
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
return { $unknown: output };
|
|
364
|
+
});
|
|
365
|
+
};
|
|
366
|
+
const de_InternalStreamFailure_event = async (output, context) => {
|
|
367
|
+
const parsedOutput = {
|
|
368
|
+
...output,
|
|
369
|
+
body: await parseBody(output.body, context),
|
|
370
|
+
};
|
|
371
|
+
return de_InternalStreamFailureRes(parsedOutput, context);
|
|
372
|
+
};
|
|
373
|
+
const de_ModelStreamError_event = async (output, context) => {
|
|
374
|
+
const parsedOutput = {
|
|
375
|
+
...output,
|
|
376
|
+
body: await parseBody(output.body, context),
|
|
377
|
+
};
|
|
378
|
+
return de_ModelStreamErrorRes(parsedOutput, context);
|
|
379
|
+
};
|
|
380
|
+
const de_PayloadPart_event = async (output, context) => {
|
|
381
|
+
const contents = {};
|
|
382
|
+
contents.Bytes = output.body;
|
|
383
|
+
return contents;
|
|
384
|
+
};
|
|
242
385
|
const deserializeMetadata = (output) => ({
|
|
243
386
|
httpStatusCode: output.statusCode,
|
|
244
387
|
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
@@ -6,6 +6,7 @@ const package_json_1 = tslib_1.__importDefault(require("../package.json"));
|
|
|
6
6
|
const sha256_browser_1 = require("@aws-crypto/sha256-browser");
|
|
7
7
|
const util_user_agent_browser_1 = require("@aws-sdk/util-user-agent-browser");
|
|
8
8
|
const config_resolver_1 = require("@smithy/config-resolver");
|
|
9
|
+
const eventstream_serde_browser_1 = require("@smithy/eventstream-serde-browser");
|
|
9
10
|
const fetch_http_handler_1 = require("@smithy/fetch-http-handler");
|
|
10
11
|
const invalid_dependency_1 = require("@smithy/invalid-dependency");
|
|
11
12
|
const util_body_length_browser_1 = require("@smithy/util-body-length-browser");
|
|
@@ -26,6 +27,7 @@ const getRuntimeConfig = (config) => {
|
|
|
26
27
|
credentialDefaultProvider: config?.credentialDefaultProvider ?? ((_) => () => Promise.reject(new Error("Credential is missing"))),
|
|
27
28
|
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
28
29
|
(0, util_user_agent_browser_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
30
|
+
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventstream_serde_browser_1.eventStreamSerdeProvider,
|
|
29
31
|
maxAttempts: config?.maxAttempts ?? util_retry_1.DEFAULT_MAX_ATTEMPTS,
|
|
30
32
|
region: config?.region ?? (0, invalid_dependency_1.invalidProvider)("Region is missing"),
|
|
31
33
|
requestHandler: config?.requestHandler ?? new fetch_http_handler_1.FetchHttpHandler(defaultConfigProvider),
|
|
@@ -7,6 +7,7 @@ const client_sts_1 = require("@aws-sdk/client-sts");
|
|
|
7
7
|
const credential_provider_node_1 = require("@aws-sdk/credential-provider-node");
|
|
8
8
|
const util_user_agent_node_1 = require("@aws-sdk/util-user-agent-node");
|
|
9
9
|
const config_resolver_1 = require("@smithy/config-resolver");
|
|
10
|
+
const eventstream_serde_node_1 = require("@smithy/eventstream-serde-node");
|
|
10
11
|
const hash_node_1 = require("@smithy/hash-node");
|
|
11
12
|
const middleware_retry_1 = require("@smithy/middleware-retry");
|
|
12
13
|
const node_config_provider_1 = require("@smithy/node-config-provider");
|
|
@@ -31,6 +32,7 @@ const getRuntimeConfig = (config) => {
|
|
|
31
32
|
credentialDefaultProvider: config?.credentialDefaultProvider ?? (0, client_sts_1.decorateDefaultCredentialProvider)(credential_provider_node_1.defaultProvider),
|
|
32
33
|
defaultUserAgentProvider: config?.defaultUserAgentProvider ??
|
|
33
34
|
(0, util_user_agent_node_1.defaultUserAgent)({ serviceId: clientSharedValues.serviceId, clientVersion: package_json_1.default.version }),
|
|
35
|
+
eventStreamSerdeProvider: config?.eventStreamSerdeProvider ?? eventstream_serde_node_1.eventStreamSerdeProvider,
|
|
34
36
|
maxAttempts: config?.maxAttempts ?? (0, node_config_provider_1.loadConfig)(middleware_retry_1.NODE_MAX_ATTEMPT_CONFIG_OPTIONS),
|
|
35
37
|
region: config?.region ?? (0, node_config_provider_1.loadConfig)(config_resolver_1.NODE_REGION_CONFIG_OPTIONS, config_resolver_1.NODE_REGION_CONFIG_FILE_OPTIONS),
|
|
36
38
|
requestHandler: config?.requestHandler ?? new node_http_handler_1.NodeHttpHandler(defaultConfigProvider),
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { createAggregatedClient } from "@smithy/smithy-client";
|
|
2
2
|
import { InvokeEndpointAsyncCommand, } from "./commands/InvokeEndpointAsyncCommand";
|
|
3
3
|
import { InvokeEndpointCommand, } from "./commands/InvokeEndpointCommand";
|
|
4
|
+
import { InvokeEndpointWithResponseStreamCommand, } from "./commands/InvokeEndpointWithResponseStreamCommand";
|
|
4
5
|
import { SageMakerRuntimeClient } from "./SageMakerRuntimeClient";
|
|
5
6
|
const commands = {
|
|
6
7
|
InvokeEndpointCommand,
|
|
7
8
|
InvokeEndpointAsyncCommand,
|
|
9
|
+
InvokeEndpointWithResponseStreamCommand,
|
|
8
10
|
};
|
|
9
11
|
export class SageMakerRuntime extends SageMakerRuntimeClient {
|
|
10
12
|
}
|
|
@@ -4,6 +4,7 @@ import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detec
|
|
|
4
4
|
import { getAwsAuthPlugin, resolveAwsAuthConfig, } from "@aws-sdk/middleware-signing";
|
|
5
5
|
import { getUserAgentPlugin, resolveUserAgentConfig, } from "@aws-sdk/middleware-user-agent";
|
|
6
6
|
import { resolveRegionConfig } from "@smithy/config-resolver";
|
|
7
|
+
import { resolveEventStreamSerdeConfig, } from "@smithy/eventstream-serde-config-resolver";
|
|
7
8
|
import { getContentLengthPlugin } from "@smithy/middleware-content-length";
|
|
8
9
|
import { resolveEndpointConfig } from "@smithy/middleware-endpoint";
|
|
9
10
|
import { getRetryPlugin, resolveRetryConfig } from "@smithy/middleware-retry";
|
|
@@ -22,9 +23,10 @@ export class SageMakerRuntimeClient extends __Client {
|
|
|
22
23
|
const _config_5 = resolveHostHeaderConfig(_config_4);
|
|
23
24
|
const _config_6 = resolveAwsAuthConfig(_config_5);
|
|
24
25
|
const _config_7 = resolveUserAgentConfig(_config_6);
|
|
25
|
-
const _config_8 =
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
const _config_8 = resolveEventStreamSerdeConfig(_config_7);
|
|
27
|
+
const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []);
|
|
28
|
+
super(_config_9);
|
|
29
|
+
this.config = _config_9;
|
|
28
30
|
this.middlewareStack.use(getRetryPlugin(this.config));
|
|
29
31
|
this.middlewareStack.use(getContentLengthPlugin(this.config));
|
|
30
32
|
this.middlewareStack.use(getHostHeaderPlugin(this.config));
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { InvokeEndpointWithResponseStreamInputFilterSensitiveLog, InvokeEndpointWithResponseStreamOutputFilterSensitiveLog, } from "../models/models_0";
|
|
5
|
+
import { de_InvokeEndpointWithResponseStreamCommand, se_InvokeEndpointWithResponseStreamCommand, } from "../protocols/Aws_restJson1";
|
|
6
|
+
export { $Command };
|
|
7
|
+
export class InvokeEndpointWithResponseStreamCommand 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, InvokeEndpointWithResponseStreamCommand.getEndpointParameterInstructions()));
|
|
23
|
+
const stack = clientStack.concat(this.middlewareStack);
|
|
24
|
+
const { logger } = configuration;
|
|
25
|
+
const clientName = "SageMakerRuntimeClient";
|
|
26
|
+
const commandName = "InvokeEndpointWithResponseStreamCommand";
|
|
27
|
+
const handlerExecutionContext = {
|
|
28
|
+
logger,
|
|
29
|
+
clientName,
|
|
30
|
+
commandName,
|
|
31
|
+
inputFilterSensitiveLog: InvokeEndpointWithResponseStreamInputFilterSensitiveLog,
|
|
32
|
+
outputFilterSensitiveLog: InvokeEndpointWithResponseStreamOutputFilterSensitiveLog,
|
|
33
|
+
};
|
|
34
|
+
const { requestHandler } = configuration;
|
|
35
|
+
return stack.resolve((request) => requestHandler.handle(request.request, options || {}), handlerExecutionContext);
|
|
36
|
+
}
|
|
37
|
+
serialize(input, context) {
|
|
38
|
+
return se_InvokeEndpointWithResponseStreamCommand(input, context);
|
|
39
|
+
}
|
|
40
|
+
deserialize(output, context) {
|
|
41
|
+
return de_InvokeEndpointWithResponseStreamCommand(output, context);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
const s = "required", t = "fn", u = "argv", v = "ref";
|
|
2
2
|
const a = "isSet", b = "tree", c = "error", d = "endpoint", e = "PartitionResult", f = "stringEquals", g = { [s]: false, "type": "String" }, h = { [s]: true, "default": false, "type": "Boolean" }, i = { [v]: "Endpoint" }, j = { [t]: "booleanEquals", [u]: [{ [v]: "UseFIPS" }, true] }, k = { [t]: "booleanEquals", [u]: [{ [v]: "UseDualStack" }, true] }, l = {}, m = { [t]: "booleanEquals", [u]: [true, { [t]: "getAttr", [u]: [{ [v]: e }, "supportsFIPS"] }] }, n = { [t]: "booleanEquals", [u]: [true, { [t]: "getAttr", [u]: [{ [v]: e }, "supportsDualStack"] }] }, o = { [t]: "getAttr", [u]: [{ [v]: e }, "name"] }, p = [j], q = [k], r = [{ [v]: "Region" }];
|
|
3
|
-
const _data = { version: "1.0", parameters: { Region: g, UseDualStack: h, UseFIPS: h, Endpoint: g }, rules: [{ conditions: [{ [t]: a, [u]: [i] }], type: b, rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, {
|
|
3
|
+
const _data = { version: "1.0", parameters: { Region: g, UseDualStack: h, UseFIPS: h, Endpoint: g }, rules: [{ conditions: [{ [t]: a, [u]: [i] }], type: b, rules: [{ conditions: p, error: "Invalid Configuration: FIPS and custom endpoint are not supported", type: c }, { conditions: q, error: "Invalid Configuration: Dualstack and custom endpoint are not supported", type: c }, { endpoint: { url: i, properties: l, headers: l }, type: d }] }, { conditions: [{ [t]: a, [u]: r }], type: b, rules: [{ conditions: [{ [t]: "aws.partition", [u]: r, assign: e }], type: b, rules: [{ conditions: [j, k], type: b, rules: [{ conditions: [m, n], type: b, rules: [{ endpoint: { url: "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: d }] }, { error: "FIPS and DualStack are enabled, but this partition does not support one or both", type: c }] }, { conditions: p, type: b, rules: [{ conditions: [m], type: b, rules: [{ conditions: [{ [t]: f, [u]: ["aws", o] }], endpoint: { url: "https://runtime-fips.sagemaker.{Region}.amazonaws.com", properties: l, headers: l }, type: d }, { conditions: [{ [t]: f, [u]: ["aws-us-gov", o] }], endpoint: { url: "https://runtime.sagemaker.{Region}.amazonaws.com", properties: l, headers: l }, type: d }, { endpoint: { url: "https://runtime.sagemaker-fips.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: d }] }, { error: "FIPS is enabled but this partition does not support FIPS", type: c }] }, { conditions: q, type: b, rules: [{ conditions: [n], type: b, rules: [{ endpoint: { url: "https://runtime.sagemaker.{Region}.{PartitionResult#dualStackDnsSuffix}", properties: l, headers: l }, type: d }] }, { error: "DualStack is enabled but this partition does not support DualStack", type: c }] }, { endpoint: { url: "https://runtime.sagemaker.{Region}.{PartitionResult#dnsSuffix}", properties: l, headers: l }, type: d }] }] }, { error: "Invalid Configuration: Missing Region", type: c }] };
|
|
4
4
|
export const ruleSet = _data;
|
|
@@ -81,6 +81,45 @@ export class ValidationError extends __BaseException {
|
|
|
81
81
|
this.Message = opts.Message;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
+
export class InternalStreamFailure extends __BaseException {
|
|
85
|
+
constructor(opts) {
|
|
86
|
+
super({
|
|
87
|
+
name: "InternalStreamFailure",
|
|
88
|
+
$fault: "server",
|
|
89
|
+
...opts,
|
|
90
|
+
});
|
|
91
|
+
this.name = "InternalStreamFailure";
|
|
92
|
+
this.$fault = "server";
|
|
93
|
+
Object.setPrototypeOf(this, InternalStreamFailure.prototype);
|
|
94
|
+
this.Message = opts.Message;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
export class ModelStreamError extends __BaseException {
|
|
98
|
+
constructor(opts) {
|
|
99
|
+
super({
|
|
100
|
+
name: "ModelStreamError",
|
|
101
|
+
$fault: "client",
|
|
102
|
+
...opts,
|
|
103
|
+
});
|
|
104
|
+
this.name = "ModelStreamError";
|
|
105
|
+
this.$fault = "client";
|
|
106
|
+
Object.setPrototypeOf(this, ModelStreamError.prototype);
|
|
107
|
+
this.Message = opts.Message;
|
|
108
|
+
this.ErrorCode = opts.ErrorCode;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
export var ResponseStream;
|
|
112
|
+
(function (ResponseStream) {
|
|
113
|
+
ResponseStream.visit = (value, visitor) => {
|
|
114
|
+
if (value.PayloadPart !== undefined)
|
|
115
|
+
return visitor.PayloadPart(value.PayloadPart);
|
|
116
|
+
if (value.ModelStreamError !== undefined)
|
|
117
|
+
return visitor.ModelStreamError(value.ModelStreamError);
|
|
118
|
+
if (value.InternalStreamFailure !== undefined)
|
|
119
|
+
return visitor.InternalStreamFailure(value.InternalStreamFailure);
|
|
120
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
121
|
+
};
|
|
122
|
+
})(ResponseStream || (ResponseStream = {}));
|
|
84
123
|
export const InvokeEndpointInputFilterSensitiveLog = (obj) => ({
|
|
85
124
|
...obj,
|
|
86
125
|
...(obj.Body && { Body: SENSITIVE_STRING }),
|
|
@@ -95,3 +134,27 @@ export const InvokeEndpointAsyncInputFilterSensitiveLog = (obj) => ({
|
|
|
95
134
|
...obj,
|
|
96
135
|
...(obj.CustomAttributes && { CustomAttributes: SENSITIVE_STRING }),
|
|
97
136
|
});
|
|
137
|
+
export const InvokeEndpointWithResponseStreamInputFilterSensitiveLog = (obj) => ({
|
|
138
|
+
...obj,
|
|
139
|
+
...(obj.Body && { Body: SENSITIVE_STRING }),
|
|
140
|
+
...(obj.CustomAttributes && { CustomAttributes: SENSITIVE_STRING }),
|
|
141
|
+
});
|
|
142
|
+
export const PayloadPartFilterSensitiveLog = (obj) => ({
|
|
143
|
+
...obj,
|
|
144
|
+
...(obj.Bytes && { Bytes: SENSITIVE_STRING }),
|
|
145
|
+
});
|
|
146
|
+
export const ResponseStreamFilterSensitiveLog = (obj) => {
|
|
147
|
+
if (obj.PayloadPart !== undefined)
|
|
148
|
+
return { PayloadPart: PayloadPartFilterSensitiveLog(obj.PayloadPart) };
|
|
149
|
+
if (obj.ModelStreamError !== undefined)
|
|
150
|
+
return { ModelStreamError: obj.ModelStreamError };
|
|
151
|
+
if (obj.InternalStreamFailure !== undefined)
|
|
152
|
+
return { InternalStreamFailure: obj.InternalStreamFailure };
|
|
153
|
+
if (obj.$unknown !== undefined)
|
|
154
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
155
|
+
};
|
|
156
|
+
export const InvokeEndpointWithResponseStreamOutputFilterSensitiveLog = (obj) => ({
|
|
157
|
+
...obj,
|
|
158
|
+
...(obj.Body && { Body: "STREAMING_CONTENT" }),
|
|
159
|
+
...(obj.CustomAttributes && { CustomAttributes: SENSITIVE_STRING }),
|
|
160
|
+
});
|