11// smithy-typescript generated code
22import {
3- ConverseStreamCommandInput ,
4- ConverseStreamCommandOutput ,
5- } from "./commands/ConverseStreamCommand" ;
3+ HttpAuthSchemeInputConfig ,
4+ HttpAuthSchemeResolvedConfig ,
5+ defaultCodeWhispererStreamingHttpAuthSchemeParametersProvider ,
6+ resolveHttpAuthSchemeConfig ,
7+ } from "./auth/httpAuthSchemeProvider" ;
68import {
79 ExportResultArchiveCommandInput ,
810 ExportResultArchiveCommandOutput ,
@@ -15,6 +17,10 @@ import {
1517 GenerateTaskAssistPlanCommandInput ,
1618 GenerateTaskAssistPlanCommandOutput ,
1719} from "./commands/GenerateTaskAssistPlanCommand" ;
20+ import {
21+ SendMessageCommandInput ,
22+ SendMessageCommandOutput ,
23+ } from "./commands/SendMessageCommand" ;
1824import { getRuntimeConfig as __getRuntimeConfig } from "./runtimeConfig" ;
1925import {
2026 RuntimeExtension ,
@@ -29,12 +35,6 @@ import {
2935} from "@aws-sdk/middleware-host-header" ;
3036import { getLoggerPlugin } from "@aws-sdk/middleware-logger" ;
3137import { getRecursionDetectionPlugin } from "@aws-sdk/middleware-recursion-detection" ;
32- import {
33- TokenInputConfig ,
34- TokenResolvedConfig ,
35- getTokenPlugin ,
36- resolveTokenConfig ,
37- } from "@aws-sdk/middleware-token" ;
3838import {
3939 UserAgentInputConfig ,
4040 UserAgentResolvedConfig ,
@@ -49,6 +49,11 @@ import {
4949 resolveEndpointsConfig ,
5050 resolveRegionConfig ,
5151} from "@smithy/config-resolver" ;
52+ import {
53+ DefaultIdentityProviderConfig ,
54+ getHttpAuthSchemePlugin ,
55+ getHttpSigningPlugin ,
56+ } from "@smithy/core" ;
5257import {
5358 EventStreamSerdeInputConfig ,
5459 EventStreamSerdeResolvedConfig ,
@@ -61,7 +66,7 @@ import {
6166 getRetryPlugin ,
6267 resolveRetryConfig ,
6368} from "@smithy/middleware-retry" ;
64- import { HttpHandler as __HttpHandler } from "@smithy/protocol-http" ;
69+ import { HttpHandlerUserInput as __HttpHandlerUserInput } from "@smithy/protocol-http" ;
6570import {
6671 Client as __Client ,
6772 DefaultsMode as __DefaultsMode ,
@@ -73,12 +78,10 @@ import {
7378 RegionInfoProvider ,
7479 BodyLengthCalculator as __BodyLengthCalculator ,
7580 CheckOptionalClientConfig as __CheckOptionalClientConfig ,
76- Checksum as __Checksum ,
7781 ChecksumConstructor as __ChecksumConstructor ,
7882 Decoder as __Decoder ,
7983 Encoder as __Encoder ,
8084 EventStreamSerdeProvider as __EventStreamSerdeProvider ,
81- Hash as __Hash ,
8285 HashConstructor as __HashConstructor ,
8386 HttpHandlerOptions as __HttpHandlerOptions ,
8487 Logger as __Logger ,
@@ -94,29 +97,29 @@ export { __Client }
9497 * @public
9598 */
9699export type ServiceInputTypes =
97- | ConverseStreamCommandInput
98100 | ExportResultArchiveCommandInput
99101 | GenerateAssistantResponseCommandInput
100- | GenerateTaskAssistPlanCommandInput ;
102+ | GenerateTaskAssistPlanCommandInput
103+ | SendMessageCommandInput ;
101104
102105/**
103106 * @public
104107 */
105108export type ServiceOutputTypes =
106- | ConverseStreamCommandOutput
107109 | ExportResultArchiveCommandOutput
108110 | GenerateAssistantResponseCommandOutput
109- | GenerateTaskAssistPlanCommandOutput ;
111+ | GenerateTaskAssistPlanCommandOutput
112+ | SendMessageCommandOutput ;
110113
111114/**
112115 * @public
113116 */
114117export interface ClientDefaults
115- extends Partial < __SmithyResolvedConfiguration < __HttpHandlerOptions > > {
118+ extends Partial < __SmithyConfiguration < __HttpHandlerOptions > > {
116119 /**
117- * The HTTP handler to use. Fetch in browser and Https in Nodejs.
120+ * The HTTP handler to use or its constructor options . Fetch in browser and Https in Nodejs.
118121 */
119- requestHandler ?: __HttpHandler ;
122+ requestHandler ?: __HttpHandlerUserInput ;
120123
121124 /**
122125 * A constructor for a class implementing the {@link @smithy/types#ChecksumConstructor } interface
@@ -195,6 +198,11 @@ export interface ClientDefaults
195198 */
196199 useFipsEndpoint ?: boolean | __Provider < boolean > ;
197200
201+ /**
202+ * The AWS region to which this client will send requests
203+ */
204+ region ?: string | __Provider < string > ;
205+
198206 /**
199207 * Fetch related hostname, signing name or signing region with given region.
200208 * @internal
@@ -246,13 +254,13 @@ export interface ClientDefaults
246254 */
247255export type CodeWhispererStreamingClientConfigType = Partial < __SmithyConfiguration < __HttpHandlerOptions > >
248256 & ClientDefaults
249- & RegionInputConfig
250- & EndpointsInputConfig
257+ & UserAgentInputConfig
251258 & RetryInputConfig
259+ & RegionInputConfig
252260 & HostHeaderInputConfig
253- & TokenInputConfig
254- & UserAgentInputConfig
261+ & EndpointsInputConfig
255262 & EventStreamSerdeInputConfig
263+ & HttpAuthSchemeInputConfig
256264/**
257265 * @public
258266 *
@@ -266,13 +274,13 @@ export interface CodeWhispererStreamingClientConfig extends CodeWhispererStreami
266274export type CodeWhispererStreamingClientResolvedConfigType = __SmithyResolvedConfiguration < __HttpHandlerOptions >
267275 & Required < ClientDefaults >
268276 & RuntimeExtensionsConfig
269- & RegionResolvedConfig
270- & EndpointsResolvedConfig
277+ & UserAgentResolvedConfig
271278 & RetryResolvedConfig
279+ & RegionResolvedConfig
272280 & HostHeaderResolvedConfig
273- & TokenResolvedConfig
274- & UserAgentResolvedConfig
281+ & EndpointsResolvedConfig
275282 & EventStreamSerdeResolvedConfig
283+ & HttpAuthSchemeResolvedConfig
276284/**
277285 * @public
278286 *
@@ -296,23 +304,35 @@ export class CodeWhispererStreamingClient extends __Client<
296304
297305 constructor ( ...[ configuration ] : __CheckOptionalClientConfig < CodeWhispererStreamingClientConfig > ) {
298306 let _config_0 = __getRuntimeConfig ( configuration || { } ) ;
299- let _config_1 = resolveRegionConfig ( _config_0 ) ;
300- let _config_2 = resolveEndpointsConfig ( _config_1 ) ;
301- let _config_3 = resolveRetryConfig ( _config_2 ) ;
307+ let _config_1 = resolveUserAgentConfig ( _config_0 ) ;
308+ let _config_2 = resolveRetryConfig ( _config_1 ) ;
309+ let _config_3 = resolveRegionConfig ( _config_2 ) ;
302310 let _config_4 = resolveHostHeaderConfig ( _config_3 ) ;
303- let _config_5 = resolveTokenConfig ( _config_4 ) ;
304- let _config_6 = resolveUserAgentConfig ( _config_5 ) ;
305- let _config_7 = resolveEventStreamSerdeConfig ( _config_6 ) ;
311+ let _config_5 = resolveEndpointsConfig ( _config_4 ) ;
312+ let _config_6 = resolveEventStreamSerdeConfig ( _config_5 ) ;
313+ let _config_7 = resolveHttpAuthSchemeConfig ( _config_6 ) ;
306314 let _config_8 = resolveRuntimeExtensions ( _config_7 , configuration ?. extensions || [ ] ) ;
307315 super ( _config_8 ) ;
308316 this . config = _config_8 ;
309- this . middlewareStack . use ( getRetryPlugin ( this . config ) ) ;
310- this . middlewareStack . use ( getContentLengthPlugin ( this . config ) ) ;
311- this . middlewareStack . use ( getHostHeaderPlugin ( this . config ) ) ;
312- this . middlewareStack . use ( getLoggerPlugin ( this . config ) ) ;
313- this . middlewareStack . use ( getRecursionDetectionPlugin ( this . config ) ) ;
314- this . middlewareStack . use ( getTokenPlugin ( this . config ) ) ;
315- this . middlewareStack . use ( getUserAgentPlugin ( this . config ) ) ;
317+ this . middlewareStack . use ( getUserAgentPlugin ( this . config
318+ ) ) ;
319+ this . middlewareStack . use ( getRetryPlugin ( this . config
320+ ) ) ;
321+ this . middlewareStack . use ( getContentLengthPlugin ( this . config
322+ ) ) ;
323+ this . middlewareStack . use ( getHostHeaderPlugin ( this . config
324+ ) ) ;
325+ this . middlewareStack . use ( getLoggerPlugin ( this . config
326+ ) ) ;
327+ this . middlewareStack . use ( getRecursionDetectionPlugin ( this . config
328+ ) ) ;
329+ this . middlewareStack . use ( getHttpAuthSchemePlugin ( this . config
330+ , {
331+ httpAuthSchemeParametersProvider : defaultCodeWhispererStreamingHttpAuthSchemeParametersProvider , identityProviderConfigProvider : async ( config : CodeWhispererStreamingClientResolvedConfig ) => new DefaultIdentityProviderConfig ( {
332+ "smithy.api#httpBearerAuth" : config . token , } ) , }
333+ ) ) ;
334+ this . middlewareStack . use ( getHttpSigningPlugin ( this . config
335+ ) ) ;
316336 }
317337
318338 /**
0 commit comments