@aws-sdk/client-sagemaker-runtime 3.928.0 → 3.929.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.
@@ -6,7 +6,7 @@ import { EndpointInputConfig, EndpointResolvedConfig } from "@smithy/middleware-
6
6
  import { RetryInputConfig, RetryResolvedConfig } from "@smithy/middleware-retry";
7
7
  import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http";
8
8
  import { Client as __Client, DefaultsMode as __DefaultsMode, SmithyConfiguration as __SmithyConfiguration, SmithyResolvedConfiguration as __SmithyResolvedConfiguration } from "@smithy/smithy-client";
9
- import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, Decoder as __Decoder, Encoder as __Encoder, EventStreamSerdeProvider as __EventStreamSerdeProvider, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
9
+ import { AwsCredentialIdentityProvider, BodyLengthCalculator as __BodyLengthCalculator, CheckOptionalClientConfig as __CheckOptionalClientConfig, ChecksumConstructor as __ChecksumConstructor, ClientProtocol, Decoder as __Decoder, Encoder as __Encoder, EventStreamSerdeProvider as __EventStreamSerdeProvider, HashConstructor as __HashConstructor, HttpHandlerOptions as __HttpHandlerOptions, HttpRequest, HttpResponse, Logger as __Logger, Provider as __Provider, Provider, StreamCollector as __StreamCollector, UrlParser as __UrlParser, UserAgent as __UserAgent } from "@smithy/types";
10
10
  import { HttpAuthSchemeInputConfig, HttpAuthSchemeResolvedConfig } from "./auth/httpAuthSchemeProvider";
11
11
  import { InvokeEndpointAsyncCommandInput, InvokeEndpointAsyncCommandOutput } from "./commands/InvokeEndpointAsyncCommand";
12
12
  import { InvokeEndpointCommandInput, InvokeEndpointCommandOutput } from "./commands/InvokeEndpointCommand";
@@ -145,6 +145,15 @@ export interface ClientDefaults extends Partial<__SmithyConfiguration<__HttpHand
145
145
  * Optional extensions
146
146
  */
147
147
  extensions?: RuntimeExtension[];
148
+ /**
149
+ * The protocol controlling the message type (e.g. HTTP) and format (e.g. JSON)
150
+ * may be overridden. A default will always be set by the client.
151
+ * Available options depend on the service's supported protocols and will not be validated by
152
+ * the client.
153
+ * @alpha
154
+ *
155
+ */
156
+ protocol?: ClientProtocol<HttpRequest, HttpResponse>;
148
157
  /**
149
158
  * The function that provides necessary utilities for generating and parsing event stream
150
159
  */
@@ -616,31 +616,3 @@ export interface InvokeEndpointWithResponseStreamOutput {
616
616
  */
617
617
  CustomAttributes?: string | undefined;
618
618
  }
619
- /**
620
- * @internal
621
- */
622
- export declare const InvokeEndpointInputFilterSensitiveLog: (obj: InvokeEndpointInput) => any;
623
- /**
624
- * @internal
625
- */
626
- export declare const InvokeEndpointOutputFilterSensitiveLog: (obj: InvokeEndpointOutput) => any;
627
- /**
628
- * @internal
629
- */
630
- export declare const InvokeEndpointAsyncInputFilterSensitiveLog: (obj: InvokeEndpointAsyncInput) => any;
631
- /**
632
- * @internal
633
- */
634
- export declare const InvokeEndpointWithResponseStreamInputFilterSensitiveLog: (obj: InvokeEndpointWithResponseStreamInput) => any;
635
- /**
636
- * @internal
637
- */
638
- export declare const PayloadPartFilterSensitiveLog: (obj: PayloadPart) => any;
639
- /**
640
- * @internal
641
- */
642
- export declare const ResponseStreamFilterSensitiveLog: (obj: ResponseStream) => any;
643
- /**
644
- * @internal
645
- */
646
- export declare const InvokeEndpointWithResponseStreamOutputFilterSensitiveLog: (obj: InvokeEndpointWithResponseStreamOutput) => any;
@@ -30,6 +30,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
30
30
  profile?: string;
31
31
  logger: import("@smithy/types").Logger;
32
32
  extensions: import("./runtimeExtensions").RuntimeExtension[];
33
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
33
34
  customUserAgent?: string | import("@smithy/types").UserAgent;
34
35
  userAgentAppId?: string | undefined | import("@smithy/types").Provider<string | undefined>;
35
36
  retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2;
@@ -32,6 +32,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
32
32
  profile?: string;
33
33
  logger: import("@smithy/types").Logger;
34
34
  extensions: import("./runtimeExtensions").RuntimeExtension[];
35
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
35
36
  customUserAgent?: string | import("@smithy/types").UserAgent;
36
37
  retryStrategy?: import("@smithy/types").RetryStrategy | import("@smithy/types").RetryStrategyV2;
37
38
  endpoint?: ((string | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint> | import("@smithy/types").EndpointV2 | import("@smithy/types").Provider<import("@smithy/types").EndpointV2>) & (string | import("@smithy/types").Provider<string> | import("@smithy/types").Endpoint | import("@smithy/types").Provider<import("@smithy/types").Endpoint> | import("@smithy/types").EndpointV2 | import("@smithy/types").Provider<import("@smithy/types").EndpointV2>)) | undefined;
@@ -27,6 +27,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
27
27
  retryMode: string | import("@smithy/types").Provider<string>;
28
28
  logger: import("@smithy/types").Logger;
29
29
  extensions: import("./runtimeExtensions").RuntimeExtension[];
30
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
30
31
  eventStreamSerdeProvider: import("@smithy/types").EventStreamSerdeProvider;
31
32
  defaultsMode: import("@smithy/smithy-client").DefaultsMode | import("@smithy/types").Provider<import("@smithy/smithy-client").DefaultsMode>;
32
33
  customUserAgent?: string | import("@smithy/types").UserAgent;
@@ -14,6 +14,7 @@ export declare const getRuntimeConfig: (config: SageMakerRuntimeClientConfig) =>
14
14
  httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").SageMakerRuntimeHttpAuthSchemeProvider;
15
15
  httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
16
16
  logger: import("@smithy/types").Logger;
17
+ protocol: import("@smithy/types").ClientProtocol<import("@smithy/types").HttpRequest, import("@smithy/types").HttpResponse>;
17
18
  serviceId: string;
18
19
  urlParser: import("@smithy/types").UrlParser;
19
20
  utf8Decoder: import("@smithy/types").Decoder;
@@ -0,0 +1,24 @@
1
+ import { StaticErrorSchema, StaticOperationSchema, StaticSimpleSchema, StaticStructureSchema } from "@smithy/types";
2
+ export declare var BodyBlob: StaticSimpleSchema;
3
+ export declare var CustomAttributesHeader: StaticSimpleSchema;
4
+ export declare var PartBlob: StaticSimpleSchema;
5
+ export declare var InternalDependencyException: StaticErrorSchema;
6
+ export declare var InternalFailure: StaticErrorSchema;
7
+ export declare var InternalStreamFailure: StaticErrorSchema;
8
+ export declare var InvokeEndpointAsyncInput: StaticStructureSchema;
9
+ export declare var InvokeEndpointAsyncOutput: StaticStructureSchema;
10
+ export declare var InvokeEndpointInput: StaticStructureSchema;
11
+ export declare var InvokeEndpointOutput: StaticStructureSchema;
12
+ export declare var InvokeEndpointWithResponseStreamInput: StaticStructureSchema;
13
+ export declare var InvokeEndpointWithResponseStreamOutput: StaticStructureSchema;
14
+ export declare var ModelError: StaticErrorSchema;
15
+ export declare var ModelNotReadyException: StaticErrorSchema;
16
+ export declare var ModelStreamError: StaticErrorSchema;
17
+ export declare var PayloadPart: StaticStructureSchema;
18
+ export declare var ServiceUnavailable: StaticErrorSchema;
19
+ export declare var ValidationError: StaticErrorSchema;
20
+ export declare var SageMakerRuntimeServiceException: StaticErrorSchema;
21
+ export declare var ResponseStream: StaticStructureSchema;
22
+ export declare var InvokeEndpoint: StaticOperationSchema;
23
+ export declare var InvokeEndpointAsync: StaticOperationSchema;
24
+ export declare var InvokeEndpointWithResponseStream: StaticOperationSchema;
@@ -34,11 +34,14 @@ import {
34
34
  BodyLengthCalculator as __BodyLengthCalculator,
35
35
  CheckOptionalClientConfig as __CheckOptionalClientConfig,
36
36
  ChecksumConstructor as __ChecksumConstructor,
37
+ ClientProtocol,
37
38
  Decoder as __Decoder,
38
39
  Encoder as __Encoder,
39
40
  EventStreamSerdeProvider as __EventStreamSerdeProvider,
40
41
  HashConstructor as __HashConstructor,
41
42
  HttpHandlerOptions as __HttpHandlerOptions,
43
+ HttpRequest,
44
+ HttpResponse,
42
45
  Logger as __Logger,
43
46
  Provider as __Provider,
44
47
  Provider,
@@ -101,6 +104,7 @@ export interface ClientDefaults
101
104
  retryMode?: string | __Provider<string>;
102
105
  logger?: __Logger;
103
106
  extensions?: RuntimeExtension[];
107
+ protocol?: ClientProtocol<HttpRequest, HttpResponse>;
104
108
  eventStreamSerdeProvider?: __EventStreamSerdeProvider;
105
109
  defaultsMode?: __DefaultsMode | __Provider<__DefaultsMode>;
106
110
  }
@@ -154,22 +154,3 @@ export interface InvokeEndpointWithResponseStreamOutput {
154
154
  InvokedProductionVariant?: string | undefined;
155
155
  CustomAttributes?: string | undefined;
156
156
  }
157
- export declare const InvokeEndpointInputFilterSensitiveLog: (
158
- obj: InvokeEndpointInput
159
- ) => any;
160
- export declare const InvokeEndpointOutputFilterSensitiveLog: (
161
- obj: InvokeEndpointOutput
162
- ) => any;
163
- export declare const InvokeEndpointAsyncInputFilterSensitiveLog: (
164
- obj: InvokeEndpointAsyncInput
165
- ) => any;
166
- export declare const InvokeEndpointWithResponseStreamInputFilterSensitiveLog: (
167
- obj: InvokeEndpointWithResponseStreamInput
168
- ) => any;
169
- export declare const PayloadPartFilterSensitiveLog: (obj: PayloadPart) => any;
170
- export declare const ResponseStreamFilterSensitiveLog: (
171
- obj: ResponseStream
172
- ) => any;
173
- export declare const InvokeEndpointWithResponseStreamOutputFilterSensitiveLog: (
174
- obj: InvokeEndpointWithResponseStreamOutput
175
- ) => any;
@@ -41,6 +41,10 @@ export declare const getRuntimeConfig: (
41
41
  profile?: string;
42
42
  logger: import("@smithy/types").Logger;
43
43
  extensions: import("./runtimeExtensions").RuntimeExtension[];
44
+ protocol: import("@smithy/types").ClientProtocol<
45
+ import("@smithy/types").HttpRequest,
46
+ import("@smithy/types").HttpResponse
47
+ >;
44
48
  customUserAgent?: string | import("@smithy/types").UserAgent;
45
49
  userAgentAppId?:
46
50
  | string
@@ -41,6 +41,10 @@ export declare const getRuntimeConfig: (
41
41
  profile?: string;
42
42
  logger: import("@smithy/types").Logger;
43
43
  extensions: import("./runtimeExtensions").RuntimeExtension[];
44
+ protocol: import("@smithy/types").ClientProtocol<
45
+ import("@smithy/types").HttpRequest,
46
+ import("@smithy/types").HttpResponse
47
+ >;
44
48
  customUserAgent?: string | import("@smithy/types").UserAgent;
45
49
  retryStrategy?:
46
50
  | import("@smithy/types").RetryStrategy
@@ -39,6 +39,10 @@ export declare const getRuntimeConfig: (
39
39
  retryMode: string | import("@smithy/types").Provider<string>;
40
40
  logger: import("@smithy/types").Logger;
41
41
  extensions: import("./runtimeExtensions").RuntimeExtension[];
42
+ protocol: import("@smithy/types").ClientProtocol<
43
+ import("@smithy/types").HttpRequest,
44
+ import("@smithy/types").HttpResponse
45
+ >;
42
46
  eventStreamSerdeProvider: import("@smithy/types").EventStreamSerdeProvider;
43
47
  defaultsMode:
44
48
  | import("@smithy/smithy-client").DefaultsMode
@@ -16,6 +16,10 @@ export declare const getRuntimeConfig: (
16
16
  httpAuthSchemeProvider: import("./auth/httpAuthSchemeProvider").SageMakerRuntimeHttpAuthSchemeProvider;
17
17
  httpAuthSchemes: import("@smithy/types").HttpAuthScheme[];
18
18
  logger: import("@smithy/types").Logger;
19
+ protocol: import("@smithy/types").ClientProtocol<
20
+ import("@smithy/types").HttpRequest,
21
+ import("@smithy/types").HttpResponse
22
+ >;
19
23
  serviceId: string;
20
24
  urlParser: import("@smithy/types").UrlParser;
21
25
  utf8Decoder: import("@smithy/types").Decoder;
@@ -0,0 +1,29 @@
1
+ import {
2
+ StaticErrorSchema,
3
+ StaticOperationSchema,
4
+ StaticSimpleSchema,
5
+ StaticStructureSchema,
6
+ } from "@smithy/types";
7
+ export declare var BodyBlob: StaticSimpleSchema;
8
+ export declare var CustomAttributesHeader: StaticSimpleSchema;
9
+ export declare var PartBlob: StaticSimpleSchema;
10
+ export declare var InternalDependencyException: StaticErrorSchema;
11
+ export declare var InternalFailure: StaticErrorSchema;
12
+ export declare var InternalStreamFailure: StaticErrorSchema;
13
+ export declare var InvokeEndpointAsyncInput: StaticStructureSchema;
14
+ export declare var InvokeEndpointAsyncOutput: StaticStructureSchema;
15
+ export declare var InvokeEndpointInput: StaticStructureSchema;
16
+ export declare var InvokeEndpointOutput: StaticStructureSchema;
17
+ export declare var InvokeEndpointWithResponseStreamInput: StaticStructureSchema;
18
+ export declare var InvokeEndpointWithResponseStreamOutput: StaticStructureSchema;
19
+ export declare var ModelError: StaticErrorSchema;
20
+ export declare var ModelNotReadyException: StaticErrorSchema;
21
+ export declare var ModelStreamError: StaticErrorSchema;
22
+ export declare var PayloadPart: StaticStructureSchema;
23
+ export declare var ServiceUnavailable: StaticErrorSchema;
24
+ export declare var ValidationError: StaticErrorSchema;
25
+ export declare var SageMakerRuntimeServiceException: StaticErrorSchema;
26
+ export declare var ResponseStream: StaticStructureSchema;
27
+ export declare var InvokeEndpoint: StaticOperationSchema;
28
+ export declare var InvokeEndpointAsync: StaticOperationSchema;
29
+ export declare var InvokeEndpointWithResponseStream: StaticOperationSchema;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-sagemaker-runtime",
3
3
  "description": "AWS SDK for JavaScript Sagemaker Runtime Client for Node.js, Browser and React Native",
4
- "version": "3.928.0",
4
+ "version": "3.929.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "node ../../scripts/compilation/inline client-sagemaker-runtime",
@@ -21,7 +21,7 @@
21
21
  "@aws-crypto/sha256-browser": "5.2.0",
22
22
  "@aws-crypto/sha256-js": "5.2.0",
23
23
  "@aws-sdk/core": "3.928.0",
24
- "@aws-sdk/credential-provider-node": "3.928.0",
24
+ "@aws-sdk/credential-provider-node": "3.929.0",
25
25
  "@aws-sdk/middleware-host-header": "3.922.0",
26
26
  "@aws-sdk/middleware-logger": "3.922.0",
27
27
  "@aws-sdk/middleware-recursion-detection": "3.922.0",
@@ -1,345 +0,0 @@
1
- import { loadRestJsonErrorCode, parseJsonBody as parseBody, parseJsonErrorBody as parseErrorBody } from "@aws-sdk/core";
2
- import { requestBuilder as rb } from "@smithy/core";
3
- import { collectBody, decorateServiceException as __decorateServiceException, expectInt32 as __expectInt32, expectNonNull as __expectNonNull, expectObject as __expectObject, expectString as __expectString, isSerializableHeaderValue, map, take, withBaseException, } from "@smithy/smithy-client";
4
- import { InternalDependencyException, InternalFailure, InternalStreamFailure, ModelError, ModelNotReadyException, ModelStreamError, ServiceUnavailable, ValidationError, } from "../models/models_0";
5
- import { SageMakerRuntimeServiceException as __BaseException } from "../models/SageMakerRuntimeServiceException";
6
- export const se_InvokeEndpointCommand = async (input, context) => {
7
- const b = rb(input, context);
8
- const headers = map({}, isSerializableHeaderValue, {
9
- [_ct]: input[_CT] || "application/octet-stream",
10
- [_a]: input[_A],
11
- [_xasca]: input[_CA],
12
- [_xastm]: input[_TM],
13
- [_xastv]: input[_TV],
14
- [_xastch]: input[_TCH],
15
- [_xasii]: input[_II],
16
- [_xasee]: input[_EE],
17
- [_xasic]: input[_ICN],
18
- [_xassi]: input[_SI],
19
- });
20
- b.bp("/endpoints/{EndpointName}/invocations");
21
- b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
22
- let body;
23
- if (input.Body !== undefined) {
24
- body = input.Body;
25
- }
26
- b.m("POST").h(headers).b(body);
27
- return b.build();
28
- };
29
- export const se_InvokeEndpointAsyncCommand = async (input, context) => {
30
- const b = rb(input, context);
31
- const headers = map({}, isSerializableHeaderValue, {
32
- [_xasct]: input[_CT],
33
- [_xasa]: input[_A],
34
- [_xasca]: input[_CA],
35
- [_xasii]: input[_II],
36
- [_xasi]: input[_IL],
37
- [_xasr]: [() => isSerializableHeaderValue(input[_RTTLS]), () => input[_RTTLS].toString()],
38
- [_xasi_]: [() => isSerializableHeaderValue(input[_ITS]), () => input[_ITS].toString()],
39
- });
40
- b.bp("/endpoints/{EndpointName}/async-invocations");
41
- b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
42
- let body;
43
- b.m("POST").h(headers).b(body);
44
- return b.build();
45
- };
46
- export const se_InvokeEndpointWithResponseStreamCommand = async (input, context) => {
47
- const b = rb(input, context);
48
- const headers = map({}, isSerializableHeaderValue, {
49
- [_ct]: input[_CT] || "application/octet-stream",
50
- [_xasa]: input[_A],
51
- [_xasca]: input[_CA],
52
- [_xastv]: input[_TV],
53
- [_xastch]: input[_TCH],
54
- [_xasii]: input[_II],
55
- [_xasic]: input[_ICN],
56
- [_xassi]: input[_SI],
57
- });
58
- b.bp("/endpoints/{EndpointName}/invocations-response-stream");
59
- b.p("EndpointName", () => input.EndpointName, "{EndpointName}", false);
60
- let body;
61
- if (input.Body !== undefined) {
62
- body = input.Body;
63
- }
64
- b.m("POST").h(headers).b(body);
65
- return b.build();
66
- };
67
- export const de_InvokeEndpointCommand = async (output, context) => {
68
- if (output.statusCode !== 200 && output.statusCode >= 300) {
69
- return de_CommandError(output, context);
70
- }
71
- const contents = map({
72
- $metadata: deserializeMetadata(output),
73
- [_CT]: [, output.headers[_ct]],
74
- [_IPV]: [, output.headers[_xaipv]],
75
- [_CA]: [, output.headers[_xasca]],
76
- [_NSI]: [, output.headers[_xasnsi]],
77
- [_CSI]: [, output.headers[_xascsi]],
78
- });
79
- const data = await collectBody(output.body, context);
80
- contents.Body = data;
81
- return contents;
82
- };
83
- export const de_InvokeEndpointAsyncCommand = async (output, context) => {
84
- if (output.statusCode !== 202 && output.statusCode >= 300) {
85
- return de_CommandError(output, context);
86
- }
87
- const contents = map({
88
- $metadata: deserializeMetadata(output),
89
- [_OL]: [, output.headers[_xaso]],
90
- [_FL]: [, output.headers[_xasf]],
91
- });
92
- const data = __expectNonNull(__expectObject(await parseBody(output.body, context)), "body");
93
- const doc = take(data, {
94
- InferenceId: __expectString,
95
- });
96
- Object.assign(contents, doc);
97
- return contents;
98
- };
99
- export const de_InvokeEndpointWithResponseStreamCommand = async (output, context) => {
100
- if (output.statusCode !== 200 && output.statusCode >= 300) {
101
- return de_CommandError(output, context);
102
- }
103
- const contents = map({
104
- $metadata: deserializeMetadata(output),
105
- [_CT]: [, output.headers[_xasct]],
106
- [_IPV]: [, output.headers[_xaipv]],
107
- [_CA]: [, output.headers[_xasca]],
108
- });
109
- const data = output.body;
110
- contents.Body = de_ResponseStream(data, context);
111
- return contents;
112
- };
113
- const de_CommandError = async (output, context) => {
114
- const parsedOutput = {
115
- ...output,
116
- body: await parseErrorBody(output.body, context),
117
- };
118
- const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
119
- switch (errorCode) {
120
- case "InternalDependencyException":
121
- case "com.amazonaws.sagemakerruntime#InternalDependencyException":
122
- throw await de_InternalDependencyExceptionRes(parsedOutput, context);
123
- case "InternalFailure":
124
- case "com.amazonaws.sagemakerruntime#InternalFailure":
125
- throw await de_InternalFailureRes(parsedOutput, context);
126
- case "ModelError":
127
- case "com.amazonaws.sagemakerruntime#ModelError":
128
- throw await de_ModelErrorRes(parsedOutput, context);
129
- case "ModelNotReadyException":
130
- case "com.amazonaws.sagemakerruntime#ModelNotReadyException":
131
- throw await de_ModelNotReadyExceptionRes(parsedOutput, context);
132
- case "ServiceUnavailable":
133
- case "com.amazonaws.sagemakerruntime#ServiceUnavailable":
134
- throw await de_ServiceUnavailableRes(parsedOutput, context);
135
- case "ValidationError":
136
- case "com.amazonaws.sagemakerruntime#ValidationError":
137
- throw await de_ValidationErrorRes(parsedOutput, context);
138
- case "InternalStreamFailure":
139
- case "com.amazonaws.sagemakerruntime#InternalStreamFailure":
140
- throw await de_InternalStreamFailureRes(parsedOutput, context);
141
- case "ModelStreamError":
142
- case "com.amazonaws.sagemakerruntime#ModelStreamError":
143
- throw await de_ModelStreamErrorRes(parsedOutput, context);
144
- default:
145
- const parsedBody = parsedOutput.body;
146
- return throwDefaultError({
147
- output,
148
- parsedBody,
149
- errorCode,
150
- });
151
- }
152
- };
153
- const throwDefaultError = withBaseException(__BaseException);
154
- const de_InternalDependencyExceptionRes = async (parsedOutput, context) => {
155
- const contents = map({});
156
- const data = parsedOutput.body;
157
- const doc = take(data, {
158
- Message: __expectString,
159
- });
160
- Object.assign(contents, doc);
161
- const exception = new InternalDependencyException({
162
- $metadata: deserializeMetadata(parsedOutput),
163
- ...contents,
164
- });
165
- return __decorateServiceException(exception, parsedOutput.body);
166
- };
167
- const de_InternalFailureRes = async (parsedOutput, context) => {
168
- const contents = map({});
169
- const data = parsedOutput.body;
170
- const doc = take(data, {
171
- Message: __expectString,
172
- });
173
- Object.assign(contents, doc);
174
- const exception = new InternalFailure({
175
- $metadata: deserializeMetadata(parsedOutput),
176
- ...contents,
177
- });
178
- return __decorateServiceException(exception, parsedOutput.body);
179
- };
180
- const de_InternalStreamFailureRes = async (parsedOutput, context) => {
181
- const contents = map({});
182
- const data = parsedOutput.body;
183
- const doc = take(data, {
184
- Message: __expectString,
185
- });
186
- Object.assign(contents, doc);
187
- const exception = new InternalStreamFailure({
188
- $metadata: deserializeMetadata(parsedOutput),
189
- ...contents,
190
- });
191
- return __decorateServiceException(exception, parsedOutput.body);
192
- };
193
- const de_ModelErrorRes = async (parsedOutput, context) => {
194
- const contents = map({});
195
- const data = parsedOutput.body;
196
- const doc = take(data, {
197
- LogStreamArn: __expectString,
198
- Message: __expectString,
199
- OriginalMessage: __expectString,
200
- OriginalStatusCode: __expectInt32,
201
- });
202
- Object.assign(contents, doc);
203
- const exception = new ModelError({
204
- $metadata: deserializeMetadata(parsedOutput),
205
- ...contents,
206
- });
207
- return __decorateServiceException(exception, parsedOutput.body);
208
- };
209
- const de_ModelNotReadyExceptionRes = async (parsedOutput, context) => {
210
- const contents = map({});
211
- const data = parsedOutput.body;
212
- const doc = take(data, {
213
- Message: __expectString,
214
- });
215
- Object.assign(contents, doc);
216
- const exception = new ModelNotReadyException({
217
- $metadata: deserializeMetadata(parsedOutput),
218
- ...contents,
219
- });
220
- return __decorateServiceException(exception, parsedOutput.body);
221
- };
222
- const de_ModelStreamErrorRes = async (parsedOutput, context) => {
223
- const contents = map({});
224
- const data = parsedOutput.body;
225
- const doc = take(data, {
226
- ErrorCode: __expectString,
227
- Message: __expectString,
228
- });
229
- Object.assign(contents, doc);
230
- const exception = new ModelStreamError({
231
- $metadata: deserializeMetadata(parsedOutput),
232
- ...contents,
233
- });
234
- return __decorateServiceException(exception, parsedOutput.body);
235
- };
236
- const de_ServiceUnavailableRes = async (parsedOutput, context) => {
237
- const contents = map({});
238
- const data = parsedOutput.body;
239
- const doc = take(data, {
240
- Message: __expectString,
241
- });
242
- Object.assign(contents, doc);
243
- const exception = new ServiceUnavailable({
244
- $metadata: deserializeMetadata(parsedOutput),
245
- ...contents,
246
- });
247
- return __decorateServiceException(exception, parsedOutput.body);
248
- };
249
- const de_ValidationErrorRes = async (parsedOutput, context) => {
250
- const contents = map({});
251
- const data = parsedOutput.body;
252
- const doc = take(data, {
253
- Message: __expectString,
254
- });
255
- Object.assign(contents, doc);
256
- const exception = new ValidationError({
257
- $metadata: deserializeMetadata(parsedOutput),
258
- ...contents,
259
- });
260
- return __decorateServiceException(exception, parsedOutput.body);
261
- };
262
- const de_ResponseStream = (output, context) => {
263
- return context.eventStreamMarshaller.deserialize(output, async (event) => {
264
- if (event["PayloadPart"] != null) {
265
- return {
266
- PayloadPart: await de_PayloadPart_event(event["PayloadPart"], context),
267
- };
268
- }
269
- if (event["ModelStreamError"] != null) {
270
- return {
271
- ModelStreamError: await de_ModelStreamError_event(event["ModelStreamError"], context),
272
- };
273
- }
274
- if (event["InternalStreamFailure"] != null) {
275
- return {
276
- InternalStreamFailure: await de_InternalStreamFailure_event(event["InternalStreamFailure"], context),
277
- };
278
- }
279
- return { $unknown: event };
280
- });
281
- };
282
- const de_InternalStreamFailure_event = async (output, context) => {
283
- const parsedOutput = {
284
- ...output,
285
- body: await parseBody(output.body, context),
286
- };
287
- return de_InternalStreamFailureRes(parsedOutput, context);
288
- };
289
- const de_ModelStreamError_event = async (output, context) => {
290
- const parsedOutput = {
291
- ...output,
292
- body: await parseBody(output.body, context),
293
- };
294
- return de_ModelStreamErrorRes(parsedOutput, context);
295
- };
296
- const de_PayloadPart_event = async (output, context) => {
297
- const contents = {};
298
- contents.Bytes = output.body;
299
- return contents;
300
- };
301
- const deserializeMetadata = (output) => ({
302
- httpStatusCode: output.statusCode,
303
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
304
- extendedRequestId: output.headers["x-amz-id-2"],
305
- cfId: output.headers["x-amz-cf-id"],
306
- });
307
- const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
308
- const _A = "Accept";
309
- const _CA = "CustomAttributes";
310
- const _CSI = "ClosedSessionId";
311
- const _CT = "ContentType";
312
- const _EE = "EnableExplanations";
313
- const _FL = "FailureLocation";
314
- const _ICN = "InferenceComponentName";
315
- const _II = "InferenceId";
316
- const _IL = "InputLocation";
317
- const _IPV = "InvokedProductionVariant";
318
- const _ITS = "InvocationTimeoutSeconds";
319
- const _NSI = "NewSessionId";
320
- const _OL = "OutputLocation";
321
- const _RTTLS = "RequestTTLSeconds";
322
- const _SI = "SessionId";
323
- const _TCH = "TargetContainerHostname";
324
- const _TM = "TargetModel";
325
- const _TV = "TargetVariant";
326
- const _a = "accept";
327
- const _ct = "content-type";
328
- const _xaipv = "x-amzn-invoked-production-variant";
329
- const _xasa = "x-amzn-sagemaker-accept";
330
- const _xasca = "x-amzn-sagemaker-custom-attributes";
331
- const _xascsi = "x-amzn-sagemaker-closed-session-id";
332
- const _xasct = "x-amzn-sagemaker-content-type";
333
- const _xasee = "x-amzn-sagemaker-enable-explanations";
334
- const _xasf = "x-amzn-sagemaker-failurelocation";
335
- const _xasi = "x-amzn-sagemaker-inputlocation";
336
- const _xasi_ = "x-amzn-sagemaker-invocationtimeoutseconds";
337
- const _xasic = "x-amzn-sagemaker-inference-component";
338
- const _xasii = "x-amzn-sagemaker-inference-id";
339
- const _xasnsi = "x-amzn-sagemaker-new-session-id";
340
- const _xaso = "x-amzn-sagemaker-outputlocation";
341
- const _xasr = "x-amzn-sagemaker-requestttlseconds";
342
- const _xassi = "x-amzn-sagemaker-session-id";
343
- const _xastch = "x-amzn-sagemaker-target-container-hostname";
344
- const _xastm = "x-amzn-sagemaker-target-model";
345
- const _xastv = "x-amzn-sagemaker-target-variant";
@@ -1,29 +0,0 @@
1
- import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@smithy/protocol-http";
2
- import { EventStreamSerdeContext as __EventStreamSerdeContext, SerdeContext as __SerdeContext } from "@smithy/types";
3
- import { InvokeEndpointAsyncCommandInput, InvokeEndpointAsyncCommandOutput } from "../commands/InvokeEndpointAsyncCommand";
4
- import { InvokeEndpointCommandInput, InvokeEndpointCommandOutput } from "../commands/InvokeEndpointCommand";
5
- import { InvokeEndpointWithResponseStreamCommandInput, InvokeEndpointWithResponseStreamCommandOutput } from "../commands/InvokeEndpointWithResponseStreamCommand";
6
- /**
7
- * serializeAws_restJson1InvokeEndpointCommand
8
- */
9
- export declare const se_InvokeEndpointCommand: (input: InvokeEndpointCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
10
- /**
11
- * serializeAws_restJson1InvokeEndpointAsyncCommand
12
- */
13
- export declare const se_InvokeEndpointAsyncCommand: (input: InvokeEndpointAsyncCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
14
- /**
15
- * serializeAws_restJson1InvokeEndpointWithResponseStreamCommand
16
- */
17
- export declare const se_InvokeEndpointWithResponseStreamCommand: (input: InvokeEndpointWithResponseStreamCommandInput, context: __SerdeContext) => Promise<__HttpRequest>;
18
- /**
19
- * deserializeAws_restJson1InvokeEndpointCommand
20
- */
21
- export declare const de_InvokeEndpointCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<InvokeEndpointCommandOutput>;
22
- /**
23
- * deserializeAws_restJson1InvokeEndpointAsyncCommand
24
- */
25
- export declare const de_InvokeEndpointAsyncCommand: (output: __HttpResponse, context: __SerdeContext) => Promise<InvokeEndpointAsyncCommandOutput>;
26
- /**
27
- * deserializeAws_restJson1InvokeEndpointWithResponseStreamCommand
28
- */
29
- export declare const de_InvokeEndpointWithResponseStreamCommand: (output: __HttpResponse, context: __SerdeContext & __EventStreamSerdeContext) => Promise<InvokeEndpointWithResponseStreamCommandOutput>;