-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(client-wisdom): This release introduces a new API PutFeedback th…
…at allows submitting feedback to Wisdom on content relevance.
- Loading branch information
awstools
committed
Aug 15, 2022
1 parent
0f250fe
commit 53b4df1
Showing
7 changed files
with
482 additions
and
0 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
105 changes: 105 additions & 0 deletions
105
clients/client-wisdom/src/commands/PutFeedbackCommand.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,105 @@ | ||
// 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 { | ||
PutFeedbackRequest, | ||
PutFeedbackRequestFilterSensitiveLog, | ||
PutFeedbackResponse, | ||
PutFeedbackResponseFilterSensitiveLog, | ||
} from "../models/models_0"; | ||
import { | ||
deserializeAws_restJson1PutFeedbackCommand, | ||
serializeAws_restJson1PutFeedbackCommand, | ||
} from "../protocols/Aws_restJson1"; | ||
import { ServiceInputTypes, ServiceOutputTypes, WisdomClientResolvedConfig } from "../WisdomClient"; | ||
|
||
export interface PutFeedbackCommandInput extends PutFeedbackRequest {} | ||
export interface PutFeedbackCommandOutput extends PutFeedbackResponse, __MetadataBearer {} | ||
|
||
/** | ||
* <p>Submits feedback to Wisdom. The feedback is used to improve future recommendations from | ||
* <a href="https://docs.aws.amazon.com/wisdom/latest/APIReference/API_GetRecommendations.html">GetRecommendations</a> or | ||
* results from <a href="https://docs.aws.amazon.com/wisdom/latest/APIReference/API_QueryAssistant.html">QueryAssistant</a>. | ||
* Feedback can be resubmitted up to 6 hours after submission. | ||
* </p> | ||
* @example | ||
* Use a bare-bones client and the command you need to make an API call. | ||
* ```javascript | ||
* import { WisdomClient, PutFeedbackCommand } from "@aws-sdk/client-wisdom"; // ES Modules import | ||
* // const { WisdomClient, PutFeedbackCommand } = require("@aws-sdk/client-wisdom"); // CommonJS import | ||
* const client = new WisdomClient(config); | ||
* const command = new PutFeedbackCommand(input); | ||
* const response = await client.send(command); | ||
* ``` | ||
* | ||
* @see {@link PutFeedbackCommandInput} for command's `input` shape. | ||
* @see {@link PutFeedbackCommandOutput} for command's `response` shape. | ||
* @see {@link WisdomClientResolvedConfig | config} for WisdomClient's `config` shape. | ||
* | ||
*/ | ||
export class PutFeedbackCommand extends $Command< | ||
PutFeedbackCommandInput, | ||
PutFeedbackCommandOutput, | ||
WisdomClientResolvedConfig | ||
> { | ||
// Start section: command_properties | ||
// End section: command_properties | ||
|
||
constructor(readonly input: PutFeedbackCommandInput) { | ||
// Start section: command_constructor | ||
super(); | ||
// End section: command_constructor | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
resolveMiddleware( | ||
clientStack: MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>, | ||
configuration: WisdomClientResolvedConfig, | ||
options?: __HttpHandlerOptions | ||
): Handler<PutFeedbackCommandInput, PutFeedbackCommandOutput> { | ||
this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize)); | ||
|
||
const stack = clientStack.concat(this.middlewareStack); | ||
|
||
const { logger } = configuration; | ||
const clientName = "WisdomClient"; | ||
const commandName = "PutFeedbackCommand"; | ||
const handlerExecutionContext: HandlerExecutionContext = { | ||
logger, | ||
clientName, | ||
commandName, | ||
inputFilterSensitiveLog: PutFeedbackRequestFilterSensitiveLog, | ||
outputFilterSensitiveLog: PutFeedbackResponseFilterSensitiveLog, | ||
}; | ||
const { requestHandler } = configuration; | ||
return stack.resolve( | ||
(request: FinalizeHandlerArguments<any>) => | ||
requestHandler.handle(request.request as __HttpRequest, options || {}), | ||
handlerExecutionContext | ||
); | ||
} | ||
|
||
private serialize(input: PutFeedbackCommandInput, context: __SerdeContext): Promise<__HttpRequest> { | ||
return serializeAws_restJson1PutFeedbackCommand(input, context); | ||
} | ||
|
||
private deserialize(output: __HttpResponse, context: __SerdeContext): Promise<PutFeedbackCommandOutput> { | ||
return deserializeAws_restJson1PutFeedbackCommand(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.