-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-lex-models-v2): This release introduces a new feature to …
…stop a running BotRecommendation Job for Automated Chatbot Designer.
- Loading branch information
awstools
committed
Aug 22, 2022
1 parent
356d5df
commit 48b347b
Showing
8 changed files
with
558 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
101 changes: 101 additions & 0 deletions
101
clients/client-lex-models-v2/src/commands/StopBotRecommendationCommand.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
// smithy-typescript generated code | ||
import { getSerdePlugin } from "@aws-sdk/middleware-serde"; | ||
import { HttpRequest as __HttpRequest, HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http"; | ||
import { Command as $Command } from "@aws-sdk/smithy-client"; | ||
import { | ||
FinalizeHandlerArguments, | ||
Handler, | ||
HandlerExecutionContext, | ||
HttpHandlerOptions as __HttpHandlerOptions, | ||
MetadataBearer as __MetadataBearer, | ||
MiddlewareStack, | ||
SerdeContext as __SerdeContext, | ||
} from "@aws-sdk/types"; | ||
|
||
import { LexModelsV2ClientResolvedConfig, ServiceInputTypes, ServiceOutputTypes } from "../LexModelsV2Client"; | ||
import { | ||
StopBotRecommendationRequest, | ||
StopBotRecommendationRequestFilterSensitiveLog, | ||
StopBotRecommendationResponse, | ||
StopBotRecommendationResponseFilterSensitiveLog, | ||
} from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1StopBotRecommendationCommand, | ||
serializeAws_restJson1StopBotRecommendationCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
|
||
export interface StopBotRecommendationCommandInput extends StopBotRecommendationRequest {} | ||
export interface StopBotRecommendationCommandOutput extends StopBotRecommendationResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Stop an already running Bot Recommendation request.</p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { LexModelsV2Client, StopBotRecommendationCommand } from "@aws-sdk/client-lex-models-v2"; // ES Modules import | ||
* // const { LexModelsV2Client, StopBotRecommendationCommand } = require("@aws-sdk/client-lex-models-v2"); // CommonJS import | ||
* const client = new LexModelsV2Client(config); | ||
* const command = new StopBotRecommendationCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link StopBotRecommendationCommandInput} for command's `input` shape. | ||
* @see {@link StopBotRecommendationCommandOutput} for command's `response` shape. | ||
* @see {@link LexModelsV2ClientResolvedConfig | config} for LexModelsV2Client's `config` shape. | ||
* | ||
*/ | ||
export class StopBotRecommendationCommand extends $Command< | ||
StopBotRecommendationCommandInput, | ||
StopBotRecommendationCommandOutput, | ||
LexModelsV2ClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: StopBotRecommendationCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: LexModelsV2ClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<StopBotRecommendationCommandInput, StopBotRecommendationCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "LexModelsV2Client"; | ||
const commandName = "StopBotRecommendationCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: StopBotRecommendationRequestFilterSensitiveLog, | ||
outputFilterSensitiveLog: StopBotRecommendationResponseFilterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: StopBotRecommendationCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1StopBotRecommendationCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<StopBotRecommendationCommandOutput> { | ||
return deserializeAws_restJson1StopBotRecommendationCommand(output, context); | ||
} | ||
|
||
// Start section: command_body_extra | ||
// End section: command_body_extra | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.