@aws-sdk/client-sagemaker-runtime 3.901.0 → 3.907.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/dist-cjs/index.js +691 -859
- package/package.json +6 -6
package/dist-cjs/index.js
CHANGED
|
@@ -1,893 +1,725 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var middlewareHostHeader = require('@aws-sdk/middleware-host-header');
|
|
4
|
+
var middlewareLogger = require('@aws-sdk/middleware-logger');
|
|
5
|
+
var middlewareRecursionDetection = require('@aws-sdk/middleware-recursion-detection');
|
|
6
|
+
var middlewareUserAgent = require('@aws-sdk/middleware-user-agent');
|
|
7
|
+
var configResolver = require('@smithy/config-resolver');
|
|
8
|
+
var core = require('@smithy/core');
|
|
9
|
+
var eventstreamSerdeConfigResolver = require('@smithy/eventstream-serde-config-resolver');
|
|
10
|
+
var middlewareContentLength = require('@smithy/middleware-content-length');
|
|
11
|
+
var middlewareEndpoint = require('@smithy/middleware-endpoint');
|
|
12
|
+
var middlewareRetry = require('@smithy/middleware-retry');
|
|
13
|
+
var smithyClient = require('@smithy/smithy-client');
|
|
14
|
+
var httpAuthSchemeProvider = require('./auth/httpAuthSchemeProvider');
|
|
15
|
+
var runtimeConfig = require('./runtimeConfig');
|
|
16
|
+
var regionConfigResolver = require('@aws-sdk/region-config-resolver');
|
|
17
|
+
var protocolHttp = require('@smithy/protocol-http');
|
|
18
|
+
var middlewareSerde = require('@smithy/middleware-serde');
|
|
19
|
+
var core$1 = require('@aws-sdk/core');
|
|
20
|
+
|
|
21
|
+
const resolveClientEndpointParameters = (options) => {
|
|
22
|
+
return Object.assign(options, {
|
|
23
|
+
useDualstackEndpoint: options.useDualstackEndpoint ?? false,
|
|
24
|
+
useFipsEndpoint: options.useFipsEndpoint ?? false,
|
|
25
|
+
defaultSigningName: "sagemaker",
|
|
26
|
+
});
|
|
10
27
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
28
|
+
const commonParams = {
|
|
29
|
+
UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
|
|
30
|
+
Endpoint: { type: "builtInParams", name: "endpoint" },
|
|
31
|
+
Region: { type: "builtInParams", name: "region" },
|
|
32
|
+
UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" },
|
|
18
33
|
};
|
|
19
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
20
|
-
|
|
21
|
-
// src/index.ts
|
|
22
|
-
var index_exports = {};
|
|
23
|
-
__export(index_exports, {
|
|
24
|
-
InternalDependencyException: () => InternalDependencyException,
|
|
25
|
-
InternalFailure: () => InternalFailure,
|
|
26
|
-
InternalStreamFailure: () => InternalStreamFailure,
|
|
27
|
-
InvokeEndpointAsyncCommand: () => InvokeEndpointAsyncCommand,
|
|
28
|
-
InvokeEndpointAsyncInputFilterSensitiveLog: () => InvokeEndpointAsyncInputFilterSensitiveLog,
|
|
29
|
-
InvokeEndpointCommand: () => InvokeEndpointCommand,
|
|
30
|
-
InvokeEndpointInputFilterSensitiveLog: () => InvokeEndpointInputFilterSensitiveLog,
|
|
31
|
-
InvokeEndpointOutputFilterSensitiveLog: () => InvokeEndpointOutputFilterSensitiveLog,
|
|
32
|
-
InvokeEndpointWithResponseStreamCommand: () => InvokeEndpointWithResponseStreamCommand,
|
|
33
|
-
InvokeEndpointWithResponseStreamInputFilterSensitiveLog: () => InvokeEndpointWithResponseStreamInputFilterSensitiveLog,
|
|
34
|
-
InvokeEndpointWithResponseStreamOutputFilterSensitiveLog: () => InvokeEndpointWithResponseStreamOutputFilterSensitiveLog,
|
|
35
|
-
ModelError: () => ModelError,
|
|
36
|
-
ModelNotReadyException: () => ModelNotReadyException,
|
|
37
|
-
ModelStreamError: () => ModelStreamError,
|
|
38
|
-
PayloadPartFilterSensitiveLog: () => PayloadPartFilterSensitiveLog,
|
|
39
|
-
ResponseStream: () => ResponseStream,
|
|
40
|
-
ResponseStreamFilterSensitiveLog: () => ResponseStreamFilterSensitiveLog,
|
|
41
|
-
SageMakerRuntime: () => SageMakerRuntime,
|
|
42
|
-
SageMakerRuntimeClient: () => SageMakerRuntimeClient,
|
|
43
|
-
SageMakerRuntimeServiceException: () => SageMakerRuntimeServiceException,
|
|
44
|
-
ServiceUnavailable: () => ServiceUnavailable,
|
|
45
|
-
ValidationError: () => ValidationError,
|
|
46
|
-
__Client: () => import_smithy_client.Client
|
|
47
|
-
});
|
|
48
|
-
module.exports = __toCommonJS(index_exports);
|
|
49
34
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
35
|
+
const getHttpAuthExtensionConfiguration = (runtimeConfig) => {
|
|
36
|
+
const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
|
|
37
|
+
let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
|
|
38
|
+
let _credentials = runtimeConfig.credentials;
|
|
39
|
+
return {
|
|
40
|
+
setHttpAuthScheme(httpAuthScheme) {
|
|
41
|
+
const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
|
|
42
|
+
if (index === -1) {
|
|
43
|
+
_httpAuthSchemes.push(httpAuthScheme);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
_httpAuthSchemes.splice(index, 1, httpAuthScheme);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
httpAuthSchemes() {
|
|
50
|
+
return _httpAuthSchemes;
|
|
51
|
+
},
|
|
52
|
+
setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
|
|
53
|
+
_httpAuthSchemeProvider = httpAuthSchemeProvider;
|
|
54
|
+
},
|
|
55
|
+
httpAuthSchemeProvider() {
|
|
56
|
+
return _httpAuthSchemeProvider;
|
|
57
|
+
},
|
|
58
|
+
setCredentials(credentials) {
|
|
59
|
+
_credentials = credentials;
|
|
60
|
+
},
|
|
61
|
+
credentials() {
|
|
62
|
+
return _credentials;
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
const resolveHttpAuthRuntimeConfig = (config) => {
|
|
67
|
+
return {
|
|
68
|
+
httpAuthSchemes: config.httpAuthSchemes(),
|
|
69
|
+
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
70
|
+
credentials: config.credentials(),
|
|
71
|
+
};
|
|
77
72
|
};
|
|
78
73
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
var import_protocol_http = require("@smithy/protocol-http");
|
|
85
|
-
var import_smithy_client = require("@smithy/smithy-client");
|
|
74
|
+
const resolveRuntimeExtensions = (runtimeConfig, extensions) => {
|
|
75
|
+
const extensionConfiguration = Object.assign(regionConfigResolver.getAwsRegionExtensionConfiguration(runtimeConfig), smithyClient.getDefaultExtensionConfiguration(runtimeConfig), protocolHttp.getHttpHandlerExtensionConfiguration(runtimeConfig), getHttpAuthExtensionConfiguration(runtimeConfig));
|
|
76
|
+
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
77
|
+
return Object.assign(runtimeConfig, regionConfigResolver.resolveAwsRegionExtensionConfiguration(extensionConfiguration), smithyClient.resolveDefaultRuntimeConfig(extensionConfiguration), protocolHttp.resolveHttpHandlerRuntimeConfig(extensionConfiguration), resolveHttpAuthRuntimeConfig(extensionConfiguration));
|
|
78
|
+
};
|
|
86
79
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
80
|
+
class SageMakerRuntimeClient extends smithyClient.Client {
|
|
81
|
+
config;
|
|
82
|
+
constructor(...[configuration]) {
|
|
83
|
+
const _config_0 = runtimeConfig.getRuntimeConfig(configuration || {});
|
|
84
|
+
super(_config_0);
|
|
85
|
+
this.initConfig = _config_0;
|
|
86
|
+
const _config_1 = resolveClientEndpointParameters(_config_0);
|
|
87
|
+
const _config_2 = middlewareUserAgent.resolveUserAgentConfig(_config_1);
|
|
88
|
+
const _config_3 = middlewareRetry.resolveRetryConfig(_config_2);
|
|
89
|
+
const _config_4 = configResolver.resolveRegionConfig(_config_3);
|
|
90
|
+
const _config_5 = middlewareHostHeader.resolveHostHeaderConfig(_config_4);
|
|
91
|
+
const _config_6 = middlewareEndpoint.resolveEndpointConfig(_config_5);
|
|
92
|
+
const _config_7 = eventstreamSerdeConfigResolver.resolveEventStreamSerdeConfig(_config_6);
|
|
93
|
+
const _config_8 = httpAuthSchemeProvider.resolveHttpAuthSchemeConfig(_config_7);
|
|
94
|
+
const _config_9 = resolveRuntimeExtensions(_config_8, configuration?.extensions || []);
|
|
95
|
+
this.config = _config_9;
|
|
96
|
+
this.middlewareStack.use(middlewareUserAgent.getUserAgentPlugin(this.config));
|
|
97
|
+
this.middlewareStack.use(middlewareRetry.getRetryPlugin(this.config));
|
|
98
|
+
this.middlewareStack.use(middlewareContentLength.getContentLengthPlugin(this.config));
|
|
99
|
+
this.middlewareStack.use(middlewareHostHeader.getHostHeaderPlugin(this.config));
|
|
100
|
+
this.middlewareStack.use(middlewareLogger.getLoggerPlugin(this.config));
|
|
101
|
+
this.middlewareStack.use(middlewareRecursionDetection.getRecursionDetectionPlugin(this.config));
|
|
102
|
+
this.middlewareStack.use(core.getHttpAuthSchemeEndpointRuleSetPlugin(this.config, {
|
|
103
|
+
httpAuthSchemeParametersProvider: httpAuthSchemeProvider.defaultSageMakerRuntimeHttpAuthSchemeParametersProvider,
|
|
104
|
+
identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
|
|
105
|
+
"aws.auth#sigv4": config.credentials,
|
|
106
|
+
}),
|
|
107
|
+
}));
|
|
108
|
+
this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
|
|
115
109
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
httpAuthSchemes: config.httpAuthSchemes(),
|
|
121
|
-
httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
|
|
122
|
-
credentials: config.credentials()
|
|
123
|
-
};
|
|
124
|
-
}, "resolveHttpAuthRuntimeConfig");
|
|
125
|
-
|
|
126
|
-
// src/runtimeExtensions.ts
|
|
127
|
-
var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
|
|
128
|
-
const extensionConfiguration = Object.assign(
|
|
129
|
-
(0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
|
|
130
|
-
(0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
|
|
131
|
-
(0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
|
|
132
|
-
getHttpAuthExtensionConfiguration(runtimeConfig)
|
|
133
|
-
);
|
|
134
|
-
extensions.forEach((extension) => extension.configure(extensionConfiguration));
|
|
135
|
-
return Object.assign(
|
|
136
|
-
runtimeConfig,
|
|
137
|
-
(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
|
|
138
|
-
(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
|
|
139
|
-
(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
|
|
140
|
-
resolveHttpAuthRuntimeConfig(extensionConfiguration)
|
|
141
|
-
);
|
|
142
|
-
}, "resolveRuntimeExtensions");
|
|
110
|
+
destroy() {
|
|
111
|
+
super.destroy();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
143
114
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
115
|
+
class SageMakerRuntimeServiceException extends smithyClient.ServiceException {
|
|
116
|
+
constructor(options) {
|
|
117
|
+
super(options);
|
|
118
|
+
Object.setPrototypeOf(this, SageMakerRuntimeServiceException.prototype);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
class InternalDependencyException extends SageMakerRuntimeServiceException {
|
|
123
|
+
name = "InternalDependencyException";
|
|
124
|
+
$fault = "server";
|
|
125
|
+
Message;
|
|
126
|
+
constructor(opts) {
|
|
127
|
+
super({
|
|
128
|
+
name: "InternalDependencyException",
|
|
129
|
+
$fault: "server",
|
|
130
|
+
...opts,
|
|
131
|
+
});
|
|
132
|
+
Object.setPrototypeOf(this, InternalDependencyException.prototype);
|
|
133
|
+
this.Message = opts.Message;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
class InternalFailure extends SageMakerRuntimeServiceException {
|
|
137
|
+
name = "InternalFailure";
|
|
138
|
+
$fault = "server";
|
|
139
|
+
Message;
|
|
140
|
+
constructor(opts) {
|
|
141
|
+
super({
|
|
142
|
+
name: "InternalFailure",
|
|
143
|
+
$fault: "server",
|
|
144
|
+
...opts,
|
|
145
|
+
});
|
|
146
|
+
Object.setPrototypeOf(this, InternalFailure.prototype);
|
|
147
|
+
this.Message = opts.Message;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
class ModelError extends SageMakerRuntimeServiceException {
|
|
151
|
+
name = "ModelError";
|
|
152
|
+
$fault = "client";
|
|
153
|
+
Message;
|
|
154
|
+
OriginalStatusCode;
|
|
155
|
+
OriginalMessage;
|
|
156
|
+
LogStreamArn;
|
|
157
|
+
constructor(opts) {
|
|
158
|
+
super({
|
|
159
|
+
name: "ModelError",
|
|
160
|
+
$fault: "client",
|
|
161
|
+
...opts,
|
|
162
|
+
});
|
|
163
|
+
Object.setPrototypeOf(this, ModelError.prototype);
|
|
164
|
+
this.Message = opts.Message;
|
|
165
|
+
this.OriginalStatusCode = opts.OriginalStatusCode;
|
|
166
|
+
this.OriginalMessage = opts.OriginalMessage;
|
|
167
|
+
this.LogStreamArn = opts.LogStreamArn;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
class ModelNotReadyException extends SageMakerRuntimeServiceException {
|
|
171
|
+
name = "ModelNotReadyException";
|
|
172
|
+
$fault = "client";
|
|
173
|
+
Message;
|
|
174
|
+
constructor(opts) {
|
|
175
|
+
super({
|
|
176
|
+
name: "ModelNotReadyException",
|
|
177
|
+
$fault: "client",
|
|
178
|
+
...opts,
|
|
179
|
+
});
|
|
180
|
+
Object.setPrototypeOf(this, ModelNotReadyException.prototype);
|
|
181
|
+
this.Message = opts.Message;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
class ServiceUnavailable extends SageMakerRuntimeServiceException {
|
|
185
|
+
name = "ServiceUnavailable";
|
|
186
|
+
$fault = "server";
|
|
187
|
+
Message;
|
|
188
|
+
constructor(opts) {
|
|
189
|
+
super({
|
|
190
|
+
name: "ServiceUnavailable",
|
|
191
|
+
$fault: "server",
|
|
192
|
+
...opts,
|
|
193
|
+
});
|
|
194
|
+
Object.setPrototypeOf(this, ServiceUnavailable.prototype);
|
|
195
|
+
this.Message = opts.Message;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
class ValidationError extends SageMakerRuntimeServiceException {
|
|
199
|
+
name = "ValidationError";
|
|
200
|
+
$fault = "client";
|
|
201
|
+
Message;
|
|
202
|
+
constructor(opts) {
|
|
203
|
+
super({
|
|
204
|
+
name: "ValidationError",
|
|
205
|
+
$fault: "client",
|
|
206
|
+
...opts,
|
|
207
|
+
});
|
|
208
|
+
Object.setPrototypeOf(this, ValidationError.prototype);
|
|
209
|
+
this.Message = opts.Message;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
class InternalStreamFailure extends SageMakerRuntimeServiceException {
|
|
213
|
+
name = "InternalStreamFailure";
|
|
214
|
+
$fault = "server";
|
|
215
|
+
Message;
|
|
216
|
+
constructor(opts) {
|
|
217
|
+
super({
|
|
218
|
+
name: "InternalStreamFailure",
|
|
219
|
+
$fault: "server",
|
|
220
|
+
...opts,
|
|
221
|
+
});
|
|
222
|
+
Object.setPrototypeOf(this, InternalStreamFailure.prototype);
|
|
223
|
+
this.Message = opts.Message;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
class ModelStreamError extends SageMakerRuntimeServiceException {
|
|
227
|
+
name = "ModelStreamError";
|
|
228
|
+
$fault = "client";
|
|
229
|
+
Message;
|
|
230
|
+
ErrorCode;
|
|
231
|
+
constructor(opts) {
|
|
232
|
+
super({
|
|
233
|
+
name: "ModelStreamError",
|
|
234
|
+
$fault: "client",
|
|
235
|
+
...opts,
|
|
236
|
+
});
|
|
237
|
+
Object.setPrototypeOf(this, ModelStreamError.prototype);
|
|
238
|
+
this.Message = opts.Message;
|
|
239
|
+
this.ErrorCode = opts.ErrorCode;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
exports.ResponseStream = void 0;
|
|
243
|
+
(function (ResponseStream) {
|
|
244
|
+
ResponseStream.visit = (value, visitor) => {
|
|
245
|
+
if (value.PayloadPart !== undefined)
|
|
246
|
+
return visitor.PayloadPart(value.PayloadPart);
|
|
247
|
+
if (value.ModelStreamError !== undefined)
|
|
248
|
+
return visitor.ModelStreamError(value.ModelStreamError);
|
|
249
|
+
if (value.InternalStreamFailure !== undefined)
|
|
250
|
+
return visitor.InternalStreamFailure(value.InternalStreamFailure);
|
|
251
|
+
return visitor._(value.$unknown[0], value.$unknown[1]);
|
|
252
|
+
};
|
|
253
|
+
})(exports.ResponseStream || (exports.ResponseStream = {}));
|
|
254
|
+
const InvokeEndpointInputFilterSensitiveLog = (obj) => ({
|
|
255
|
+
...obj,
|
|
256
|
+
...(obj.Body && { Body: smithyClient.SENSITIVE_STRING }),
|
|
257
|
+
...(obj.CustomAttributes && { CustomAttributes: smithyClient.SENSITIVE_STRING }),
|
|
258
|
+
});
|
|
259
|
+
const InvokeEndpointOutputFilterSensitiveLog = (obj) => ({
|
|
260
|
+
...obj,
|
|
261
|
+
...(obj.Body && { Body: smithyClient.SENSITIVE_STRING }),
|
|
262
|
+
...(obj.CustomAttributes && { CustomAttributes: smithyClient.SENSITIVE_STRING }),
|
|
263
|
+
});
|
|
264
|
+
const InvokeEndpointAsyncInputFilterSensitiveLog = (obj) => ({
|
|
265
|
+
...obj,
|
|
266
|
+
...(obj.CustomAttributes && { CustomAttributes: smithyClient.SENSITIVE_STRING }),
|
|
267
|
+
});
|
|
268
|
+
const InvokeEndpointWithResponseStreamInputFilterSensitiveLog = (obj) => ({
|
|
269
|
+
...obj,
|
|
270
|
+
...(obj.Body && { Body: smithyClient.SENSITIVE_STRING }),
|
|
271
|
+
...(obj.CustomAttributes && { CustomAttributes: smithyClient.SENSITIVE_STRING }),
|
|
272
|
+
});
|
|
273
|
+
const PayloadPartFilterSensitiveLog = (obj) => ({
|
|
274
|
+
...obj,
|
|
275
|
+
...(obj.Bytes && { Bytes: smithyClient.SENSITIVE_STRING }),
|
|
276
|
+
});
|
|
277
|
+
const ResponseStreamFilterSensitiveLog = (obj) => {
|
|
278
|
+
if (obj.PayloadPart !== undefined)
|
|
279
|
+
return { PayloadPart: PayloadPartFilterSensitiveLog(obj.PayloadPart) };
|
|
280
|
+
if (obj.ModelStreamError !== undefined)
|
|
281
|
+
return { ModelStreamError: obj.ModelStreamError };
|
|
282
|
+
if (obj.InternalStreamFailure !== undefined)
|
|
283
|
+
return { InternalStreamFailure: obj.InternalStreamFailure };
|
|
284
|
+
if (obj.$unknown !== undefined)
|
|
285
|
+
return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
191
286
|
};
|
|
287
|
+
const InvokeEndpointWithResponseStreamOutputFilterSensitiveLog = (obj) => ({
|
|
288
|
+
...obj,
|
|
289
|
+
...(obj.Body && { Body: "STREAMING_CONTENT" }),
|
|
290
|
+
...(obj.CustomAttributes && { CustomAttributes: smithyClient.SENSITIVE_STRING }),
|
|
291
|
+
});
|
|
192
292
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
Object.setPrototypeOf(this, _SageMakerRuntimeServiceException.prototype);
|
|
216
|
-
}
|
|
293
|
+
const se_InvokeEndpointCommand = async (input, context) => {
|
|
294
|
+
const b = core.requestBuilder(input, context);
|
|
295
|
+
const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
|
|
296
|
+
[_ct]: input[_CT] || "application/octet-stream",
|
|
297
|
+
[_a]: input[_A],
|
|
298
|
+
[_xasca]: input[_CA],
|
|
299
|
+
[_xastm]: input[_TM],
|
|
300
|
+
[_xastv]: input[_TV],
|
|
301
|
+
[_xastch]: input[_TCH],
|
|
302
|
+
[_xasii]: input[_II],
|
|
303
|
+
[_xasee]: input[_EE],
|
|
304
|
+
[_xasic]: input[_ICN],
|
|
305
|
+
[_xassi]: input[_SI],
|
|
306
|
+
});
|
|
307
|
+
b.bp("/endpoints/{EndpointName}/invocations");
|
|
308
|
+
b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
|
|
309
|
+
let body;
|
|
310
|
+
if (input.Body !== undefined) {
|
|
311
|
+
body = input.Body;
|
|
312
|
+
}
|
|
313
|
+
b.m("POST").h(headers).b(body);
|
|
314
|
+
return b.build();
|
|
217
315
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
* @internal
|
|
229
|
-
*/
|
|
230
|
-
constructor(opts) {
|
|
231
|
-
super({
|
|
232
|
-
name: "InternalDependencyException",
|
|
233
|
-
$fault: "server",
|
|
234
|
-
...opts
|
|
316
|
+
const se_InvokeEndpointAsyncCommand = async (input, context) => {
|
|
317
|
+
const b = core.requestBuilder(input, context);
|
|
318
|
+
const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
|
|
319
|
+
[_xasct]: input[_CT],
|
|
320
|
+
[_xasa]: input[_A],
|
|
321
|
+
[_xasca]: input[_CA],
|
|
322
|
+
[_xasii]: input[_II],
|
|
323
|
+
[_xasi]: input[_IL],
|
|
324
|
+
[_xasr]: [() => smithyClient.isSerializableHeaderValue(input[_RTTLS]), () => input[_RTTLS].toString()],
|
|
325
|
+
[_xasi_]: [() => smithyClient.isSerializableHeaderValue(input[_ITS]), () => input[_ITS].toString()],
|
|
235
326
|
});
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
327
|
+
b.bp("/endpoints/{EndpointName}/async-invocations");
|
|
328
|
+
b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
|
|
329
|
+
let body;
|
|
330
|
+
b.m("POST").h(headers).b(body);
|
|
331
|
+
return b.build();
|
|
239
332
|
};
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
super({
|
|
252
|
-
name: "InternalFailure",
|
|
253
|
-
$fault: "server",
|
|
254
|
-
...opts
|
|
333
|
+
const se_InvokeEndpointWithResponseStreamCommand = async (input, context) => {
|
|
334
|
+
const b = core.requestBuilder(input, context);
|
|
335
|
+
const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
|
|
336
|
+
[_ct]: input[_CT] || "application/octet-stream",
|
|
337
|
+
[_xasa]: input[_A],
|
|
338
|
+
[_xasca]: input[_CA],
|
|
339
|
+
[_xastv]: input[_TV],
|
|
340
|
+
[_xastch]: input[_TCH],
|
|
341
|
+
[_xasii]: input[_II],
|
|
342
|
+
[_xasic]: input[_ICN],
|
|
343
|
+
[_xassi]: input[_SI],
|
|
255
344
|
});
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
345
|
+
b.bp("/endpoints/{EndpointName}/invocations-response-stream");
|
|
346
|
+
b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
|
|
347
|
+
let body;
|
|
348
|
+
if (input.Body !== undefined) {
|
|
349
|
+
body = input.Body;
|
|
350
|
+
}
|
|
351
|
+
b.m("POST").h(headers).b(body);
|
|
352
|
+
return b.build();
|
|
259
353
|
};
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
OriginalStatusCode;
|
|
272
|
-
/**
|
|
273
|
-
* <p> Original message. </p>
|
|
274
|
-
* @public
|
|
275
|
-
*/
|
|
276
|
-
OriginalMessage;
|
|
277
|
-
/**
|
|
278
|
-
* <p> The Amazon Resource Name (ARN) of the log stream. </p>
|
|
279
|
-
* @public
|
|
280
|
-
*/
|
|
281
|
-
LogStreamArn;
|
|
282
|
-
/**
|
|
283
|
-
* @internal
|
|
284
|
-
*/
|
|
285
|
-
constructor(opts) {
|
|
286
|
-
super({
|
|
287
|
-
name: "ModelError",
|
|
288
|
-
$fault: "client",
|
|
289
|
-
...opts
|
|
354
|
+
const de_InvokeEndpointCommand = async (output, context) => {
|
|
355
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
356
|
+
return de_CommandError(output, context);
|
|
357
|
+
}
|
|
358
|
+
const contents = smithyClient.map({
|
|
359
|
+
$metadata: deserializeMetadata(output),
|
|
360
|
+
[_CT]: [, output.headers[_ct]],
|
|
361
|
+
[_IPV]: [, output.headers[_xaipv]],
|
|
362
|
+
[_CA]: [, output.headers[_xasca]],
|
|
363
|
+
[_NSI]: [, output.headers[_xasnsi]],
|
|
364
|
+
[_CSI]: [, output.headers[_xascsi]],
|
|
290
365
|
});
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
this.OriginalMessage = opts.OriginalMessage;
|
|
295
|
-
this.LogStreamArn = opts.LogStreamArn;
|
|
296
|
-
}
|
|
366
|
+
const data = await smithyClient.collectBody(output.body, context);
|
|
367
|
+
contents.Body = data;
|
|
368
|
+
return contents;
|
|
297
369
|
};
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
* @internal
|
|
307
|
-
*/
|
|
308
|
-
constructor(opts) {
|
|
309
|
-
super({
|
|
310
|
-
name: "ModelNotReadyException",
|
|
311
|
-
$fault: "client",
|
|
312
|
-
...opts
|
|
370
|
+
const de_InvokeEndpointAsyncCommand = async (output, context) => {
|
|
371
|
+
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
372
|
+
return de_CommandError(output, context);
|
|
373
|
+
}
|
|
374
|
+
const contents = smithyClient.map({
|
|
375
|
+
$metadata: deserializeMetadata(output),
|
|
376
|
+
[_OL]: [, output.headers[_xaso]],
|
|
377
|
+
[_FL]: [, output.headers[_xasf]],
|
|
313
378
|
});
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
379
|
+
const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
|
|
380
|
+
const doc = smithyClient.take(data, {
|
|
381
|
+
InferenceId: smithyClient.expectString,
|
|
382
|
+
});
|
|
383
|
+
Object.assign(contents, doc);
|
|
384
|
+
return contents;
|
|
317
385
|
};
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
*/
|
|
328
|
-
constructor(opts) {
|
|
329
|
-
super({
|
|
330
|
-
name: "ServiceUnavailable",
|
|
331
|
-
$fault: "server",
|
|
332
|
-
...opts
|
|
386
|
+
const de_InvokeEndpointWithResponseStreamCommand = async (output, context) => {
|
|
387
|
+
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
388
|
+
return de_CommandError(output, context);
|
|
389
|
+
}
|
|
390
|
+
const contents = smithyClient.map({
|
|
391
|
+
$metadata: deserializeMetadata(output),
|
|
392
|
+
[_CT]: [, output.headers[_xasct]],
|
|
393
|
+
[_IPV]: [, output.headers[_xaipv]],
|
|
394
|
+
[_CA]: [, output.headers[_xasca]],
|
|
333
395
|
});
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
396
|
+
const data = output.body;
|
|
397
|
+
contents.Body = de_ResponseStream(data, context);
|
|
398
|
+
return contents;
|
|
399
|
+
};
|
|
400
|
+
const de_CommandError = async (output, context) => {
|
|
401
|
+
const parsedOutput = {
|
|
402
|
+
...output,
|
|
403
|
+
body: await core$1.parseJsonErrorBody(output.body, context),
|
|
404
|
+
};
|
|
405
|
+
const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
|
|
406
|
+
switch (errorCode) {
|
|
407
|
+
case "InternalDependencyException":
|
|
408
|
+
case "com.amazonaws.sagemakerruntime#InternalDependencyException":
|
|
409
|
+
throw await de_InternalDependencyExceptionRes(parsedOutput);
|
|
410
|
+
case "InternalFailure":
|
|
411
|
+
case "com.amazonaws.sagemakerruntime#InternalFailure":
|
|
412
|
+
throw await de_InternalFailureRes(parsedOutput);
|
|
413
|
+
case "ModelError":
|
|
414
|
+
case "com.amazonaws.sagemakerruntime#ModelError":
|
|
415
|
+
throw await de_ModelErrorRes(parsedOutput);
|
|
416
|
+
case "ModelNotReadyException":
|
|
417
|
+
case "com.amazonaws.sagemakerruntime#ModelNotReadyException":
|
|
418
|
+
throw await de_ModelNotReadyExceptionRes(parsedOutput);
|
|
419
|
+
case "ServiceUnavailable":
|
|
420
|
+
case "com.amazonaws.sagemakerruntime#ServiceUnavailable":
|
|
421
|
+
throw await de_ServiceUnavailableRes(parsedOutput);
|
|
422
|
+
case "ValidationError":
|
|
423
|
+
case "com.amazonaws.sagemakerruntime#ValidationError":
|
|
424
|
+
throw await de_ValidationErrorRes(parsedOutput);
|
|
425
|
+
case "InternalStreamFailure":
|
|
426
|
+
case "com.amazonaws.sagemakerruntime#InternalStreamFailure":
|
|
427
|
+
throw await de_InternalStreamFailureRes(parsedOutput);
|
|
428
|
+
case "ModelStreamError":
|
|
429
|
+
case "com.amazonaws.sagemakerruntime#ModelStreamError":
|
|
430
|
+
throw await de_ModelStreamErrorRes(parsedOutput);
|
|
431
|
+
default:
|
|
432
|
+
const parsedBody = parsedOutput.body;
|
|
433
|
+
return throwDefaultError({
|
|
434
|
+
output,
|
|
435
|
+
parsedBody,
|
|
436
|
+
errorCode,
|
|
437
|
+
});
|
|
438
|
+
}
|
|
337
439
|
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
super({
|
|
350
|
-
name: "ValidationError",
|
|
351
|
-
$fault: "client",
|
|
352
|
-
...opts
|
|
440
|
+
const throwDefaultError = smithyClient.withBaseException(SageMakerRuntimeServiceException);
|
|
441
|
+
const de_InternalDependencyExceptionRes = async (parsedOutput, context) => {
|
|
442
|
+
const contents = smithyClient.map({});
|
|
443
|
+
const data = parsedOutput.body;
|
|
444
|
+
const doc = smithyClient.take(data, {
|
|
445
|
+
Message: smithyClient.expectString,
|
|
446
|
+
});
|
|
447
|
+
Object.assign(contents, doc);
|
|
448
|
+
const exception = new InternalDependencyException({
|
|
449
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
450
|
+
...contents,
|
|
353
451
|
});
|
|
354
|
-
|
|
355
|
-
this.Message = opts.Message;
|
|
356
|
-
}
|
|
452
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
357
453
|
};
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
constructor(opts) {
|
|
369
|
-
super({
|
|
370
|
-
name: "InternalStreamFailure",
|
|
371
|
-
$fault: "server",
|
|
372
|
-
...opts
|
|
454
|
+
const de_InternalFailureRes = async (parsedOutput, context) => {
|
|
455
|
+
const contents = smithyClient.map({});
|
|
456
|
+
const data = parsedOutput.body;
|
|
457
|
+
const doc = smithyClient.take(data, {
|
|
458
|
+
Message: smithyClient.expectString,
|
|
459
|
+
});
|
|
460
|
+
Object.assign(contents, doc);
|
|
461
|
+
const exception = new InternalFailure({
|
|
462
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
463
|
+
...contents,
|
|
373
464
|
});
|
|
374
|
-
|
|
375
|
-
this.Message = opts.Message;
|
|
376
|
-
}
|
|
465
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
377
466
|
};
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
$fault = "client";
|
|
384
|
-
Message;
|
|
385
|
-
/**
|
|
386
|
-
* <p>This error can have the following error codes:</p>
|
|
387
|
-
* <dl>
|
|
388
|
-
* <dt>ModelInvocationTimeExceeded</dt>
|
|
389
|
-
* <dd>
|
|
390
|
-
* <p>The model failed to finish sending the response within the timeout period
|
|
391
|
-
* allowed by Amazon SageMaker AI.</p>
|
|
392
|
-
* </dd>
|
|
393
|
-
* <dt>StreamBroken</dt>
|
|
394
|
-
* <dd>
|
|
395
|
-
* <p>The Transmission Control Protocol (TCP) connection between the client and
|
|
396
|
-
* the model was reset or closed.</p>
|
|
397
|
-
* </dd>
|
|
398
|
-
* </dl>
|
|
399
|
-
* @public
|
|
400
|
-
*/
|
|
401
|
-
ErrorCode;
|
|
402
|
-
/**
|
|
403
|
-
* @internal
|
|
404
|
-
*/
|
|
405
|
-
constructor(opts) {
|
|
406
|
-
super({
|
|
407
|
-
name: "ModelStreamError",
|
|
408
|
-
$fault: "client",
|
|
409
|
-
...opts
|
|
467
|
+
const de_InternalStreamFailureRes = async (parsedOutput, context) => {
|
|
468
|
+
const contents = smithyClient.map({});
|
|
469
|
+
const data = parsedOutput.body;
|
|
470
|
+
const doc = smithyClient.take(data, {
|
|
471
|
+
Message: smithyClient.expectString,
|
|
410
472
|
});
|
|
411
|
-
Object.
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
473
|
+
Object.assign(contents, doc);
|
|
474
|
+
const exception = new InternalStreamFailure({
|
|
475
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
476
|
+
...contents,
|
|
477
|
+
});
|
|
478
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
415
479
|
};
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
})
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
})
|
|
430
|
-
|
|
431
|
-
...obj,
|
|
432
|
-
...obj.Body && { Body: import_smithy_client.SENSITIVE_STRING },
|
|
433
|
-
...obj.CustomAttributes && { CustomAttributes: import_smithy_client.SENSITIVE_STRING }
|
|
434
|
-
}), "InvokeEndpointOutputFilterSensitiveLog");
|
|
435
|
-
var InvokeEndpointAsyncInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
436
|
-
...obj,
|
|
437
|
-
...obj.CustomAttributes && { CustomAttributes: import_smithy_client.SENSITIVE_STRING }
|
|
438
|
-
}), "InvokeEndpointAsyncInputFilterSensitiveLog");
|
|
439
|
-
var InvokeEndpointWithResponseStreamInputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
440
|
-
...obj,
|
|
441
|
-
...obj.Body && { Body: import_smithy_client.SENSITIVE_STRING },
|
|
442
|
-
...obj.CustomAttributes && { CustomAttributes: import_smithy_client.SENSITIVE_STRING }
|
|
443
|
-
}), "InvokeEndpointWithResponseStreamInputFilterSensitiveLog");
|
|
444
|
-
var PayloadPartFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
445
|
-
...obj,
|
|
446
|
-
...obj.Bytes && { Bytes: import_smithy_client.SENSITIVE_STRING }
|
|
447
|
-
}), "PayloadPartFilterSensitiveLog");
|
|
448
|
-
var ResponseStreamFilterSensitiveLog = /* @__PURE__ */ __name((obj) => {
|
|
449
|
-
if (obj.PayloadPart !== void 0) return { PayloadPart: PayloadPartFilterSensitiveLog(obj.PayloadPart) };
|
|
450
|
-
if (obj.ModelStreamError !== void 0) return { ModelStreamError: obj.ModelStreamError };
|
|
451
|
-
if (obj.InternalStreamFailure !== void 0) return { InternalStreamFailure: obj.InternalStreamFailure };
|
|
452
|
-
if (obj.$unknown !== void 0) return { [obj.$unknown[0]]: "UNKNOWN" };
|
|
453
|
-
}, "ResponseStreamFilterSensitiveLog");
|
|
454
|
-
var InvokeEndpointWithResponseStreamOutputFilterSensitiveLog = /* @__PURE__ */ __name((obj) => ({
|
|
455
|
-
...obj,
|
|
456
|
-
...obj.Body && { Body: "STREAMING_CONTENT" },
|
|
457
|
-
...obj.CustomAttributes && { CustomAttributes: import_smithy_client.SENSITIVE_STRING }
|
|
458
|
-
}), "InvokeEndpointWithResponseStreamOutputFilterSensitiveLog");
|
|
459
|
-
|
|
460
|
-
// src/protocols/Aws_restJson1.ts
|
|
461
|
-
var import_core2 = require("@aws-sdk/core");
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
var se_InvokeEndpointCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
465
|
-
const b = (0, import_core.requestBuilder)(input, context);
|
|
466
|
-
const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
|
|
467
|
-
[_ct]: input[_CT] || "application/octet-stream",
|
|
468
|
-
[_a]: input[_A],
|
|
469
|
-
[_xasca]: input[_CA],
|
|
470
|
-
[_xastm]: input[_TM],
|
|
471
|
-
[_xastv]: input[_TV],
|
|
472
|
-
[_xastch]: input[_TCH],
|
|
473
|
-
[_xasii]: input[_II],
|
|
474
|
-
[_xasee]: input[_EE],
|
|
475
|
-
[_xasic]: input[_ICN],
|
|
476
|
-
[_xassi]: input[_SI]
|
|
477
|
-
});
|
|
478
|
-
b.bp("/endpoints/{EndpointName}/invocations");
|
|
479
|
-
b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
|
|
480
|
-
let body;
|
|
481
|
-
if (input.Body !== void 0) {
|
|
482
|
-
body = input.Body;
|
|
483
|
-
}
|
|
484
|
-
b.m("POST").h(headers).b(body);
|
|
485
|
-
return b.build();
|
|
486
|
-
}, "se_InvokeEndpointCommand");
|
|
487
|
-
var se_InvokeEndpointAsyncCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
488
|
-
const b = (0, import_core.requestBuilder)(input, context);
|
|
489
|
-
const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
|
|
490
|
-
[_xasct]: input[_CT],
|
|
491
|
-
[_xasa]: input[_A],
|
|
492
|
-
[_xasca]: input[_CA],
|
|
493
|
-
[_xasii]: input[_II],
|
|
494
|
-
[_xasi]: input[_IL],
|
|
495
|
-
[_xasr]: [() => (0, import_smithy_client.isSerializableHeaderValue)(input[_RTTLS]), () => input[_RTTLS].toString()],
|
|
496
|
-
[_xasi_]: [() => (0, import_smithy_client.isSerializableHeaderValue)(input[_ITS]), () => input[_ITS].toString()]
|
|
497
|
-
});
|
|
498
|
-
b.bp("/endpoints/{EndpointName}/async-invocations");
|
|
499
|
-
b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
|
|
500
|
-
let body;
|
|
501
|
-
b.m("POST").h(headers).b(body);
|
|
502
|
-
return b.build();
|
|
503
|
-
}, "se_InvokeEndpointAsyncCommand");
|
|
504
|
-
var se_InvokeEndpointWithResponseStreamCommand = /* @__PURE__ */ __name(async (input, context) => {
|
|
505
|
-
const b = (0, import_core.requestBuilder)(input, context);
|
|
506
|
-
const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
|
|
507
|
-
[_ct]: input[_CT] || "application/octet-stream",
|
|
508
|
-
[_xasa]: input[_A],
|
|
509
|
-
[_xasca]: input[_CA],
|
|
510
|
-
[_xastv]: input[_TV],
|
|
511
|
-
[_xastch]: input[_TCH],
|
|
512
|
-
[_xasii]: input[_II],
|
|
513
|
-
[_xasic]: input[_ICN],
|
|
514
|
-
[_xassi]: input[_SI]
|
|
515
|
-
});
|
|
516
|
-
b.bp("/endpoints/{EndpointName}/invocations-response-stream");
|
|
517
|
-
b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
|
|
518
|
-
let body;
|
|
519
|
-
if (input.Body !== void 0) {
|
|
520
|
-
body = input.Body;
|
|
521
|
-
}
|
|
522
|
-
b.m("POST").h(headers).b(body);
|
|
523
|
-
return b.build();
|
|
524
|
-
}, "se_InvokeEndpointWithResponseStreamCommand");
|
|
525
|
-
var de_InvokeEndpointCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
526
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
527
|
-
return de_CommandError(output, context);
|
|
528
|
-
}
|
|
529
|
-
const contents = (0, import_smithy_client.map)({
|
|
530
|
-
$metadata: deserializeMetadata(output),
|
|
531
|
-
[_CT]: [, output.headers[_ct]],
|
|
532
|
-
[_IPV]: [, output.headers[_xaipv]],
|
|
533
|
-
[_CA]: [, output.headers[_xasca]],
|
|
534
|
-
[_NSI]: [, output.headers[_xasnsi]],
|
|
535
|
-
[_CSI]: [, output.headers[_xascsi]]
|
|
536
|
-
});
|
|
537
|
-
const data = await (0, import_smithy_client.collectBody)(output.body, context);
|
|
538
|
-
contents.Body = data;
|
|
539
|
-
return contents;
|
|
540
|
-
}, "de_InvokeEndpointCommand");
|
|
541
|
-
var de_InvokeEndpointAsyncCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
542
|
-
if (output.statusCode !== 202 && output.statusCode >= 300) {
|
|
543
|
-
return de_CommandError(output, context);
|
|
544
|
-
}
|
|
545
|
-
const contents = (0, import_smithy_client.map)({
|
|
546
|
-
$metadata: deserializeMetadata(output),
|
|
547
|
-
[_OL]: [, output.headers[_xaso]],
|
|
548
|
-
[_FL]: [, output.headers[_xasf]]
|
|
549
|
-
});
|
|
550
|
-
const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
|
|
551
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
552
|
-
InferenceId: import_smithy_client.expectString
|
|
553
|
-
});
|
|
554
|
-
Object.assign(contents, doc);
|
|
555
|
-
return contents;
|
|
556
|
-
}, "de_InvokeEndpointAsyncCommand");
|
|
557
|
-
var de_InvokeEndpointWithResponseStreamCommand = /* @__PURE__ */ __name(async (output, context) => {
|
|
558
|
-
if (output.statusCode !== 200 && output.statusCode >= 300) {
|
|
559
|
-
return de_CommandError(output, context);
|
|
560
|
-
}
|
|
561
|
-
const contents = (0, import_smithy_client.map)({
|
|
562
|
-
$metadata: deserializeMetadata(output),
|
|
563
|
-
[_CT]: [, output.headers[_xasct]],
|
|
564
|
-
[_IPV]: [, output.headers[_xaipv]],
|
|
565
|
-
[_CA]: [, output.headers[_xasca]]
|
|
566
|
-
});
|
|
567
|
-
const data = output.body;
|
|
568
|
-
contents.Body = de_ResponseStream(data, context);
|
|
569
|
-
return contents;
|
|
570
|
-
}, "de_InvokeEndpointWithResponseStreamCommand");
|
|
571
|
-
var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
|
|
572
|
-
const parsedOutput = {
|
|
573
|
-
...output,
|
|
574
|
-
body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
|
|
575
|
-
};
|
|
576
|
-
const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
|
|
577
|
-
switch (errorCode) {
|
|
578
|
-
case "InternalDependencyException":
|
|
579
|
-
case "com.amazonaws.sagemakerruntime#InternalDependencyException":
|
|
580
|
-
throw await de_InternalDependencyExceptionRes(parsedOutput, context);
|
|
581
|
-
case "InternalFailure":
|
|
582
|
-
case "com.amazonaws.sagemakerruntime#InternalFailure":
|
|
583
|
-
throw await de_InternalFailureRes(parsedOutput, context);
|
|
584
|
-
case "ModelError":
|
|
585
|
-
case "com.amazonaws.sagemakerruntime#ModelError":
|
|
586
|
-
throw await de_ModelErrorRes(parsedOutput, context);
|
|
587
|
-
case "ModelNotReadyException":
|
|
588
|
-
case "com.amazonaws.sagemakerruntime#ModelNotReadyException":
|
|
589
|
-
throw await de_ModelNotReadyExceptionRes(parsedOutput, context);
|
|
590
|
-
case "ServiceUnavailable":
|
|
591
|
-
case "com.amazonaws.sagemakerruntime#ServiceUnavailable":
|
|
592
|
-
throw await de_ServiceUnavailableRes(parsedOutput, context);
|
|
593
|
-
case "ValidationError":
|
|
594
|
-
case "com.amazonaws.sagemakerruntime#ValidationError":
|
|
595
|
-
throw await de_ValidationErrorRes(parsedOutput, context);
|
|
596
|
-
case "InternalStreamFailure":
|
|
597
|
-
case "com.amazonaws.sagemakerruntime#InternalStreamFailure":
|
|
598
|
-
throw await de_InternalStreamFailureRes(parsedOutput, context);
|
|
599
|
-
case "ModelStreamError":
|
|
600
|
-
case "com.amazonaws.sagemakerruntime#ModelStreamError":
|
|
601
|
-
throw await de_ModelStreamErrorRes(parsedOutput, context);
|
|
602
|
-
default:
|
|
603
|
-
const parsedBody = parsedOutput.body;
|
|
604
|
-
return throwDefaultError({
|
|
605
|
-
output,
|
|
606
|
-
parsedBody,
|
|
607
|
-
errorCode
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
}, "de_CommandError");
|
|
611
|
-
var throwDefaultError = (0, import_smithy_client.withBaseException)(SageMakerRuntimeServiceException);
|
|
612
|
-
var de_InternalDependencyExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
613
|
-
const contents = (0, import_smithy_client.map)({});
|
|
614
|
-
const data = parsedOutput.body;
|
|
615
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
616
|
-
Message: import_smithy_client.expectString
|
|
617
|
-
});
|
|
618
|
-
Object.assign(contents, doc);
|
|
619
|
-
const exception = new InternalDependencyException({
|
|
620
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
621
|
-
...contents
|
|
622
|
-
});
|
|
623
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
624
|
-
}, "de_InternalDependencyExceptionRes");
|
|
625
|
-
var de_InternalFailureRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
626
|
-
const contents = (0, import_smithy_client.map)({});
|
|
627
|
-
const data = parsedOutput.body;
|
|
628
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
629
|
-
Message: import_smithy_client.expectString
|
|
630
|
-
});
|
|
631
|
-
Object.assign(contents, doc);
|
|
632
|
-
const exception = new InternalFailure({
|
|
633
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
634
|
-
...contents
|
|
635
|
-
});
|
|
636
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
637
|
-
}, "de_InternalFailureRes");
|
|
638
|
-
var de_InternalStreamFailureRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
639
|
-
const contents = (0, import_smithy_client.map)({});
|
|
640
|
-
const data = parsedOutput.body;
|
|
641
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
642
|
-
Message: import_smithy_client.expectString
|
|
643
|
-
});
|
|
644
|
-
Object.assign(contents, doc);
|
|
645
|
-
const exception = new InternalStreamFailure({
|
|
646
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
647
|
-
...contents
|
|
648
|
-
});
|
|
649
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
650
|
-
}, "de_InternalStreamFailureRes");
|
|
651
|
-
var de_ModelErrorRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
652
|
-
const contents = (0, import_smithy_client.map)({});
|
|
653
|
-
const data = parsedOutput.body;
|
|
654
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
655
|
-
LogStreamArn: import_smithy_client.expectString,
|
|
656
|
-
Message: import_smithy_client.expectString,
|
|
657
|
-
OriginalMessage: import_smithy_client.expectString,
|
|
658
|
-
OriginalStatusCode: import_smithy_client.expectInt32
|
|
659
|
-
});
|
|
660
|
-
Object.assign(contents, doc);
|
|
661
|
-
const exception = new ModelError({
|
|
662
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
663
|
-
...contents
|
|
664
|
-
});
|
|
665
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
666
|
-
}, "de_ModelErrorRes");
|
|
667
|
-
var de_ModelNotReadyExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
668
|
-
const contents = (0, import_smithy_client.map)({});
|
|
669
|
-
const data = parsedOutput.body;
|
|
670
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
671
|
-
Message: import_smithy_client.expectString
|
|
672
|
-
});
|
|
673
|
-
Object.assign(contents, doc);
|
|
674
|
-
const exception = new ModelNotReadyException({
|
|
675
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
676
|
-
...contents
|
|
677
|
-
});
|
|
678
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
679
|
-
}, "de_ModelNotReadyExceptionRes");
|
|
680
|
-
var de_ModelStreamErrorRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
681
|
-
const contents = (0, import_smithy_client.map)({});
|
|
682
|
-
const data = parsedOutput.body;
|
|
683
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
684
|
-
ErrorCode: import_smithy_client.expectString,
|
|
685
|
-
Message: import_smithy_client.expectString
|
|
686
|
-
});
|
|
687
|
-
Object.assign(contents, doc);
|
|
688
|
-
const exception = new ModelStreamError({
|
|
689
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
690
|
-
...contents
|
|
691
|
-
});
|
|
692
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
693
|
-
}, "de_ModelStreamErrorRes");
|
|
694
|
-
var de_ServiceUnavailableRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
695
|
-
const contents = (0, import_smithy_client.map)({});
|
|
696
|
-
const data = parsedOutput.body;
|
|
697
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
698
|
-
Message: import_smithy_client.expectString
|
|
699
|
-
});
|
|
700
|
-
Object.assign(contents, doc);
|
|
701
|
-
const exception = new ServiceUnavailable({
|
|
702
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
703
|
-
...contents
|
|
704
|
-
});
|
|
705
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
706
|
-
}, "de_ServiceUnavailableRes");
|
|
707
|
-
var de_ValidationErrorRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
|
|
708
|
-
const contents = (0, import_smithy_client.map)({});
|
|
709
|
-
const data = parsedOutput.body;
|
|
710
|
-
const doc = (0, import_smithy_client.take)(data, {
|
|
711
|
-
Message: import_smithy_client.expectString
|
|
712
|
-
});
|
|
713
|
-
Object.assign(contents, doc);
|
|
714
|
-
const exception = new ValidationError({
|
|
715
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
716
|
-
...contents
|
|
717
|
-
});
|
|
718
|
-
return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
|
|
719
|
-
}, "de_ValidationErrorRes");
|
|
720
|
-
var de_ResponseStream = /* @__PURE__ */ __name((output, context) => {
|
|
721
|
-
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
722
|
-
if (event["PayloadPart"] != null) {
|
|
723
|
-
return {
|
|
724
|
-
PayloadPart: await de_PayloadPart_event(event["PayloadPart"], context)
|
|
725
|
-
};
|
|
726
|
-
}
|
|
727
|
-
if (event["ModelStreamError"] != null) {
|
|
728
|
-
return {
|
|
729
|
-
ModelStreamError: await de_ModelStreamError_event(event["ModelStreamError"], context)
|
|
730
|
-
};
|
|
731
|
-
}
|
|
732
|
-
if (event["InternalStreamFailure"] != null) {
|
|
733
|
-
return {
|
|
734
|
-
InternalStreamFailure: await de_InternalStreamFailure_event(event["InternalStreamFailure"], context)
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
return { $unknown: event };
|
|
738
|
-
});
|
|
739
|
-
}, "de_ResponseStream");
|
|
740
|
-
var de_InternalStreamFailure_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
741
|
-
const parsedOutput = {
|
|
742
|
-
...output,
|
|
743
|
-
body: await (0, import_core2.parseJsonBody)(output.body, context)
|
|
744
|
-
};
|
|
745
|
-
return de_InternalStreamFailureRes(parsedOutput, context);
|
|
746
|
-
}, "de_InternalStreamFailure_event");
|
|
747
|
-
var de_ModelStreamError_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
748
|
-
const parsedOutput = {
|
|
749
|
-
...output,
|
|
750
|
-
body: await (0, import_core2.parseJsonBody)(output.body, context)
|
|
751
|
-
};
|
|
752
|
-
return de_ModelStreamErrorRes(parsedOutput, context);
|
|
753
|
-
}, "de_ModelStreamError_event");
|
|
754
|
-
var de_PayloadPart_event = /* @__PURE__ */ __name(async (output, context) => {
|
|
755
|
-
const contents = {};
|
|
756
|
-
contents.Bytes = output.body;
|
|
757
|
-
return contents;
|
|
758
|
-
}, "de_PayloadPart_event");
|
|
759
|
-
var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
|
|
760
|
-
httpStatusCode: output.statusCode,
|
|
761
|
-
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
762
|
-
extendedRequestId: output.headers["x-amz-id-2"],
|
|
763
|
-
cfId: output.headers["x-amz-cf-id"]
|
|
764
|
-
}), "deserializeMetadata");
|
|
765
|
-
var _A = "Accept";
|
|
766
|
-
var _CA = "CustomAttributes";
|
|
767
|
-
var _CSI = "ClosedSessionId";
|
|
768
|
-
var _CT = "ContentType";
|
|
769
|
-
var _EE = "EnableExplanations";
|
|
770
|
-
var _FL = "FailureLocation";
|
|
771
|
-
var _ICN = "InferenceComponentName";
|
|
772
|
-
var _II = "InferenceId";
|
|
773
|
-
var _IL = "InputLocation";
|
|
774
|
-
var _IPV = "InvokedProductionVariant";
|
|
775
|
-
var _ITS = "InvocationTimeoutSeconds";
|
|
776
|
-
var _NSI = "NewSessionId";
|
|
777
|
-
var _OL = "OutputLocation";
|
|
778
|
-
var _RTTLS = "RequestTTLSeconds";
|
|
779
|
-
var _SI = "SessionId";
|
|
780
|
-
var _TCH = "TargetContainerHostname";
|
|
781
|
-
var _TM = "TargetModel";
|
|
782
|
-
var _TV = "TargetVariant";
|
|
783
|
-
var _a = "accept";
|
|
784
|
-
var _ct = "content-type";
|
|
785
|
-
var _xaipv = "x-amzn-invoked-production-variant";
|
|
786
|
-
var _xasa = "x-amzn-sagemaker-accept";
|
|
787
|
-
var _xasca = "x-amzn-sagemaker-custom-attributes";
|
|
788
|
-
var _xascsi = "x-amzn-sagemaker-closed-session-id";
|
|
789
|
-
var _xasct = "x-amzn-sagemaker-content-type";
|
|
790
|
-
var _xasee = "x-amzn-sagemaker-enable-explanations";
|
|
791
|
-
var _xasf = "x-amzn-sagemaker-failurelocation";
|
|
792
|
-
var _xasi = "x-amzn-sagemaker-inputlocation";
|
|
793
|
-
var _xasi_ = "x-amzn-sagemaker-invocationtimeoutseconds";
|
|
794
|
-
var _xasic = "x-amzn-sagemaker-inference-component";
|
|
795
|
-
var _xasii = "x-amzn-sagemaker-inference-id";
|
|
796
|
-
var _xasnsi = "x-amzn-sagemaker-new-session-id";
|
|
797
|
-
var _xaso = "x-amzn-sagemaker-outputlocation";
|
|
798
|
-
var _xasr = "x-amzn-sagemaker-requestttlseconds";
|
|
799
|
-
var _xassi = "x-amzn-sagemaker-session-id";
|
|
800
|
-
var _xastch = "x-amzn-sagemaker-target-container-hostname";
|
|
801
|
-
var _xastm = "x-amzn-sagemaker-target-model";
|
|
802
|
-
var _xastv = "x-amzn-sagemaker-target-variant";
|
|
803
|
-
|
|
804
|
-
// src/commands/InvokeEndpointAsyncCommand.ts
|
|
805
|
-
var InvokeEndpointAsyncCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
|
|
806
|
-
return [
|
|
807
|
-
(0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
|
|
808
|
-
(0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
|
|
809
|
-
];
|
|
810
|
-
}).s("AmazonSageMakerRuntime", "InvokeEndpointAsync", {}).n("SageMakerRuntimeClient", "InvokeEndpointAsyncCommand").f(InvokeEndpointAsyncInputFilterSensitiveLog, void 0).ser(se_InvokeEndpointAsyncCommand).de(de_InvokeEndpointAsyncCommand).build() {
|
|
811
|
-
static {
|
|
812
|
-
__name(this, "InvokeEndpointAsyncCommand");
|
|
813
|
-
}
|
|
480
|
+
const de_ModelErrorRes = async (parsedOutput, context) => {
|
|
481
|
+
const contents = smithyClient.map({});
|
|
482
|
+
const data = parsedOutput.body;
|
|
483
|
+
const doc = smithyClient.take(data, {
|
|
484
|
+
LogStreamArn: smithyClient.expectString,
|
|
485
|
+
Message: smithyClient.expectString,
|
|
486
|
+
OriginalMessage: smithyClient.expectString,
|
|
487
|
+
OriginalStatusCode: smithyClient.expectInt32,
|
|
488
|
+
});
|
|
489
|
+
Object.assign(contents, doc);
|
|
490
|
+
const exception = new ModelError({
|
|
491
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
492
|
+
...contents,
|
|
493
|
+
});
|
|
494
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
814
495
|
};
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
})
|
|
826
|
-
|
|
827
|
-
__name(this, "InvokeEndpointCommand");
|
|
828
|
-
}
|
|
496
|
+
const de_ModelNotReadyExceptionRes = async (parsedOutput, context) => {
|
|
497
|
+
const contents = smithyClient.map({});
|
|
498
|
+
const data = parsedOutput.body;
|
|
499
|
+
const doc = smithyClient.take(data, {
|
|
500
|
+
Message: smithyClient.expectString,
|
|
501
|
+
});
|
|
502
|
+
Object.assign(contents, doc);
|
|
503
|
+
const exception = new ModelNotReadyException({
|
|
504
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
505
|
+
...contents,
|
|
506
|
+
});
|
|
507
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
829
508
|
};
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
*/
|
|
844
|
-
eventStream: {
|
|
845
|
-
output: true
|
|
846
|
-
}
|
|
847
|
-
}).n("SageMakerRuntimeClient", "InvokeEndpointWithResponseStreamCommand").f(InvokeEndpointWithResponseStreamInputFilterSensitiveLog, InvokeEndpointWithResponseStreamOutputFilterSensitiveLog).ser(se_InvokeEndpointWithResponseStreamCommand).de(de_InvokeEndpointWithResponseStreamCommand).build() {
|
|
848
|
-
static {
|
|
849
|
-
__name(this, "InvokeEndpointWithResponseStreamCommand");
|
|
850
|
-
}
|
|
509
|
+
const de_ModelStreamErrorRes = async (parsedOutput, context) => {
|
|
510
|
+
const contents = smithyClient.map({});
|
|
511
|
+
const data = parsedOutput.body;
|
|
512
|
+
const doc = smithyClient.take(data, {
|
|
513
|
+
ErrorCode: smithyClient.expectString,
|
|
514
|
+
Message: smithyClient.expectString,
|
|
515
|
+
});
|
|
516
|
+
Object.assign(contents, doc);
|
|
517
|
+
const exception = new ModelStreamError({
|
|
518
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
519
|
+
...contents,
|
|
520
|
+
});
|
|
521
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
851
522
|
};
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
523
|
+
const de_ServiceUnavailableRes = async (parsedOutput, context) => {
|
|
524
|
+
const contents = smithyClient.map({});
|
|
525
|
+
const data = parsedOutput.body;
|
|
526
|
+
const doc = smithyClient.take(data, {
|
|
527
|
+
Message: smithyClient.expectString,
|
|
528
|
+
});
|
|
529
|
+
Object.assign(contents, doc);
|
|
530
|
+
const exception = new ServiceUnavailable({
|
|
531
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
532
|
+
...contents,
|
|
533
|
+
});
|
|
534
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
858
535
|
};
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
536
|
+
const de_ValidationErrorRes = async (parsedOutput, context) => {
|
|
537
|
+
const contents = smithyClient.map({});
|
|
538
|
+
const data = parsedOutput.body;
|
|
539
|
+
const doc = smithyClient.take(data, {
|
|
540
|
+
Message: smithyClient.expectString,
|
|
541
|
+
});
|
|
542
|
+
Object.assign(contents, doc);
|
|
543
|
+
const exception = new ValidationError({
|
|
544
|
+
$metadata: deserializeMetadata(parsedOutput),
|
|
545
|
+
...contents,
|
|
546
|
+
});
|
|
547
|
+
return smithyClient.decorateServiceException(exception, parsedOutput.body);
|
|
863
548
|
};
|
|
864
|
-
(
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
549
|
+
const de_ResponseStream = (output, context) => {
|
|
550
|
+
return context.eventStreamMarshaller.deserialize(output, async (event) => {
|
|
551
|
+
if (event["PayloadPart"] != null) {
|
|
552
|
+
return {
|
|
553
|
+
PayloadPart: await de_PayloadPart_event(event["PayloadPart"]),
|
|
554
|
+
};
|
|
555
|
+
}
|
|
556
|
+
if (event["ModelStreamError"] != null) {
|
|
557
|
+
return {
|
|
558
|
+
ModelStreamError: await de_ModelStreamError_event(event["ModelStreamError"], context),
|
|
559
|
+
};
|
|
560
|
+
}
|
|
561
|
+
if (event["InternalStreamFailure"] != null) {
|
|
562
|
+
return {
|
|
563
|
+
InternalStreamFailure: await de_InternalStreamFailure_event(event["InternalStreamFailure"], context),
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
return { $unknown: event };
|
|
567
|
+
});
|
|
568
|
+
};
|
|
569
|
+
const de_InternalStreamFailure_event = async (output, context) => {
|
|
570
|
+
const parsedOutput = {
|
|
571
|
+
...output,
|
|
572
|
+
body: await core$1.parseJsonBody(output.body, context),
|
|
573
|
+
};
|
|
574
|
+
return de_InternalStreamFailureRes(parsedOutput);
|
|
575
|
+
};
|
|
576
|
+
const de_ModelStreamError_event = async (output, context) => {
|
|
577
|
+
const parsedOutput = {
|
|
578
|
+
...output,
|
|
579
|
+
body: await core$1.parseJsonBody(output.body, context),
|
|
580
|
+
};
|
|
581
|
+
return de_ModelStreamErrorRes(parsedOutput);
|
|
582
|
+
};
|
|
583
|
+
const de_PayloadPart_event = async (output, context) => {
|
|
584
|
+
const contents = {};
|
|
585
|
+
contents.Bytes = output.body;
|
|
586
|
+
return contents;
|
|
587
|
+
};
|
|
588
|
+
const deserializeMetadata = (output) => ({
|
|
589
|
+
httpStatusCode: output.statusCode,
|
|
590
|
+
requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
|
|
591
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
592
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
892
593
|
});
|
|
594
|
+
const _A = "Accept";
|
|
595
|
+
const _CA = "CustomAttributes";
|
|
596
|
+
const _CSI = "ClosedSessionId";
|
|
597
|
+
const _CT = "ContentType";
|
|
598
|
+
const _EE = "EnableExplanations";
|
|
599
|
+
const _FL = "FailureLocation";
|
|
600
|
+
const _ICN = "InferenceComponentName";
|
|
601
|
+
const _II = "InferenceId";
|
|
602
|
+
const _IL = "InputLocation";
|
|
603
|
+
const _IPV = "InvokedProductionVariant";
|
|
604
|
+
const _ITS = "InvocationTimeoutSeconds";
|
|
605
|
+
const _NSI = "NewSessionId";
|
|
606
|
+
const _OL = "OutputLocation";
|
|
607
|
+
const _RTTLS = "RequestTTLSeconds";
|
|
608
|
+
const _SI = "SessionId";
|
|
609
|
+
const _TCH = "TargetContainerHostname";
|
|
610
|
+
const _TM = "TargetModel";
|
|
611
|
+
const _TV = "TargetVariant";
|
|
612
|
+
const _a = "accept";
|
|
613
|
+
const _ct = "content-type";
|
|
614
|
+
const _xaipv = "x-amzn-invoked-production-variant";
|
|
615
|
+
const _xasa = "x-amzn-sagemaker-accept";
|
|
616
|
+
const _xasca = "x-amzn-sagemaker-custom-attributes";
|
|
617
|
+
const _xascsi = "x-amzn-sagemaker-closed-session-id";
|
|
618
|
+
const _xasct = "x-amzn-sagemaker-content-type";
|
|
619
|
+
const _xasee = "x-amzn-sagemaker-enable-explanations";
|
|
620
|
+
const _xasf = "x-amzn-sagemaker-failurelocation";
|
|
621
|
+
const _xasi = "x-amzn-sagemaker-inputlocation";
|
|
622
|
+
const _xasi_ = "x-amzn-sagemaker-invocationtimeoutseconds";
|
|
623
|
+
const _xasic = "x-amzn-sagemaker-inference-component";
|
|
624
|
+
const _xasii = "x-amzn-sagemaker-inference-id";
|
|
625
|
+
const _xasnsi = "x-amzn-sagemaker-new-session-id";
|
|
626
|
+
const _xaso = "x-amzn-sagemaker-outputlocation";
|
|
627
|
+
const _xasr = "x-amzn-sagemaker-requestttlseconds";
|
|
628
|
+
const _xassi = "x-amzn-sagemaker-session-id";
|
|
629
|
+
const _xastch = "x-amzn-sagemaker-target-container-hostname";
|
|
630
|
+
const _xastm = "x-amzn-sagemaker-target-model";
|
|
631
|
+
const _xastv = "x-amzn-sagemaker-target-variant";
|
|
632
|
+
|
|
633
|
+
class InvokeEndpointAsyncCommand extends smithyClient.Command
|
|
634
|
+
.classBuilder()
|
|
635
|
+
.ep(commonParams)
|
|
636
|
+
.m(function (Command, cs, config, o) {
|
|
637
|
+
return [
|
|
638
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
639
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
640
|
+
];
|
|
641
|
+
})
|
|
642
|
+
.s("AmazonSageMakerRuntime", "InvokeEndpointAsync", {})
|
|
643
|
+
.n("SageMakerRuntimeClient", "InvokeEndpointAsyncCommand")
|
|
644
|
+
.f(InvokeEndpointAsyncInputFilterSensitiveLog, void 0)
|
|
645
|
+
.ser(se_InvokeEndpointAsyncCommand)
|
|
646
|
+
.de(de_InvokeEndpointAsyncCommand)
|
|
647
|
+
.build() {
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
class InvokeEndpointCommand extends smithyClient.Command
|
|
651
|
+
.classBuilder()
|
|
652
|
+
.ep(commonParams)
|
|
653
|
+
.m(function (Command, cs, config, o) {
|
|
654
|
+
return [
|
|
655
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
656
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
657
|
+
];
|
|
658
|
+
})
|
|
659
|
+
.s("AmazonSageMakerRuntime", "InvokeEndpoint", {})
|
|
660
|
+
.n("SageMakerRuntimeClient", "InvokeEndpointCommand")
|
|
661
|
+
.f(InvokeEndpointInputFilterSensitiveLog, InvokeEndpointOutputFilterSensitiveLog)
|
|
662
|
+
.ser(se_InvokeEndpointCommand)
|
|
663
|
+
.de(de_InvokeEndpointCommand)
|
|
664
|
+
.build() {
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
class InvokeEndpointWithResponseStreamCommand extends smithyClient.Command
|
|
668
|
+
.classBuilder()
|
|
669
|
+
.ep(commonParams)
|
|
670
|
+
.m(function (Command, cs, config, o) {
|
|
671
|
+
return [
|
|
672
|
+
middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
|
|
673
|
+
middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
|
|
674
|
+
];
|
|
675
|
+
})
|
|
676
|
+
.s("AmazonSageMakerRuntime", "InvokeEndpointWithResponseStream", {
|
|
677
|
+
eventStream: {
|
|
678
|
+
output: true,
|
|
679
|
+
},
|
|
680
|
+
})
|
|
681
|
+
.n("SageMakerRuntimeClient", "InvokeEndpointWithResponseStreamCommand")
|
|
682
|
+
.f(InvokeEndpointWithResponseStreamInputFilterSensitiveLog, InvokeEndpointWithResponseStreamOutputFilterSensitiveLog)
|
|
683
|
+
.ser(se_InvokeEndpointWithResponseStreamCommand)
|
|
684
|
+
.de(de_InvokeEndpointWithResponseStreamCommand)
|
|
685
|
+
.build() {
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
const commands = {
|
|
689
|
+
InvokeEndpointCommand,
|
|
690
|
+
InvokeEndpointAsyncCommand,
|
|
691
|
+
InvokeEndpointWithResponseStreamCommand,
|
|
692
|
+
};
|
|
693
|
+
class SageMakerRuntime extends SageMakerRuntimeClient {
|
|
694
|
+
}
|
|
695
|
+
smithyClient.createAggregatedClient(commands, SageMakerRuntime);
|
|
893
696
|
|
|
697
|
+
Object.defineProperty(exports, "$Command", {
|
|
698
|
+
enumerable: true,
|
|
699
|
+
get: function () { return smithyClient.Command; }
|
|
700
|
+
});
|
|
701
|
+
Object.defineProperty(exports, "__Client", {
|
|
702
|
+
enumerable: true,
|
|
703
|
+
get: function () { return smithyClient.Client; }
|
|
704
|
+
});
|
|
705
|
+
exports.InternalDependencyException = InternalDependencyException;
|
|
706
|
+
exports.InternalFailure = InternalFailure;
|
|
707
|
+
exports.InternalStreamFailure = InternalStreamFailure;
|
|
708
|
+
exports.InvokeEndpointAsyncCommand = InvokeEndpointAsyncCommand;
|
|
709
|
+
exports.InvokeEndpointAsyncInputFilterSensitiveLog = InvokeEndpointAsyncInputFilterSensitiveLog;
|
|
710
|
+
exports.InvokeEndpointCommand = InvokeEndpointCommand;
|
|
711
|
+
exports.InvokeEndpointInputFilterSensitiveLog = InvokeEndpointInputFilterSensitiveLog;
|
|
712
|
+
exports.InvokeEndpointOutputFilterSensitiveLog = InvokeEndpointOutputFilterSensitiveLog;
|
|
713
|
+
exports.InvokeEndpointWithResponseStreamCommand = InvokeEndpointWithResponseStreamCommand;
|
|
714
|
+
exports.InvokeEndpointWithResponseStreamInputFilterSensitiveLog = InvokeEndpointWithResponseStreamInputFilterSensitiveLog;
|
|
715
|
+
exports.InvokeEndpointWithResponseStreamOutputFilterSensitiveLog = InvokeEndpointWithResponseStreamOutputFilterSensitiveLog;
|
|
716
|
+
exports.ModelError = ModelError;
|
|
717
|
+
exports.ModelNotReadyException = ModelNotReadyException;
|
|
718
|
+
exports.ModelStreamError = ModelStreamError;
|
|
719
|
+
exports.PayloadPartFilterSensitiveLog = PayloadPartFilterSensitiveLog;
|
|
720
|
+
exports.ResponseStreamFilterSensitiveLog = ResponseStreamFilterSensitiveLog;
|
|
721
|
+
exports.SageMakerRuntime = SageMakerRuntime;
|
|
722
|
+
exports.SageMakerRuntimeClient = SageMakerRuntimeClient;
|
|
723
|
+
exports.SageMakerRuntimeServiceException = SageMakerRuntimeServiceException;
|
|
724
|
+
exports.ServiceUnavailable = ServiceUnavailable;
|
|
725
|
+
exports.ValidationError = ValidationError;
|