// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::predict_qa_results::_predict_qa_results_input::PredictQaResultsInputBuilder;
pub use crate::operation::predict_qa_results::_predict_qa_results_output::PredictQaResultsOutputBuilder;
impl crate::operation::predict_qa_results::builders::PredictQaResultsInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::predict_qa_results::PredictQaResultsOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::predict_qa_results::PredictQAResultsError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.predict_qa_results();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `PredictQAResults`.
///
/// <p>Predicts existing visuals or generates new visuals to answer a given query.</p>
/// <p>This API uses <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation.html">trusted identity propagation</a> to ensure that an end user is authenticated and receives the embed URL that is specific to that user. The IAM Identity Center application that the user has logged into needs to have <a href="https://docs.aws.amazon.com/singlesignon/latest/userguide/trustedidentitypropagation-using-customermanagedapps-specify-trusted-apps.html">trusted Identity Propagation enabled for Quick</a> with the scope value set to <code>quicksight:read</code>. Before you use this action, make sure that you have configured the relevant Quick resource and permissions.</p>
/// <p>We recommend enabling the <code>QSearchStatus</code> API to unlock the full potential of <code>PredictQnA</code>. When <code>QSearchStatus</code> is enabled, it first checks the specified dashboard for any existing visuals that match the question. If no matching visuals are found, <code>PredictQnA</code> uses generative Q&A to provide an answer. To update the <code>QSearchStatus</code>, see <a href="https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdateQuickSightQSearchConfiguration.html">UpdateQuickSightQSearchConfiguration</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PredictQAResultsFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::predict_qa_results::builders::PredictQaResultsInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::predict_qa_results::PredictQaResultsOutput,
crate::operation::predict_qa_results::PredictQAResultsError,
> for PredictQAResultsFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::predict_qa_results::PredictQaResultsOutput,
crate::operation::predict_qa_results::PredictQAResultsError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl PredictQAResultsFluentBuilder {
/// Creates a new `PredictQAResultsFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the PredictQAResults as a reference.
pub fn as_input(&self) -> &crate::operation::predict_qa_results::builders::PredictQaResultsInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::predict_qa_results::PredictQaResultsOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::predict_qa_results::PredictQAResultsError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::predict_qa_results::PredictQAResults::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::predict_qa_results::PredictQAResults::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::predict_qa_results::PredictQaResultsOutput,
crate::operation::predict_qa_results::PredictQAResultsError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The ID of the Amazon Web Services account that the user wants to execute Predict QA results in.</p>
pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.aws_account_id(input.into());
self
}
/// <p>The ID of the Amazon Web Services account that the user wants to execute Predict QA results in.</p>
pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_aws_account_id(input);
self
}
/// <p>The ID of the Amazon Web Services account that the user wants to execute Predict QA results in.</p>
pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_aws_account_id()
}
/// <p>The query text to be used to predict QA results.</p>
pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.query_text(input.into());
self
}
/// <p>The query text to be used to predict QA results.</p>
pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_query_text(input);
self
}
/// <p>The query text to be used to predict QA results.</p>
pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_query_text()
}
/// <p>Indicates whether Q indicies are included or excluded.</p>
pub fn include_quick_sight_q_index(mut self, input: crate::types::IncludeQuickSightQIndex) -> Self {
self.inner = self.inner.include_quick_sight_q_index(input);
self
}
/// <p>Indicates whether Q indicies are included or excluded.</p>
pub fn set_include_quick_sight_q_index(mut self, input: ::std::option::Option<crate::types::IncludeQuickSightQIndex>) -> Self {
self.inner = self.inner.set_include_quick_sight_q_index(input);
self
}
/// <p>Indicates whether Q indicies are included or excluded.</p>
pub fn get_include_quick_sight_q_index(&self) -> &::std::option::Option<crate::types::IncludeQuickSightQIndex> {
self.inner.get_include_quick_sight_q_index()
}
/// <p>Indicates whether generated answers are included or excluded.</p>
pub fn include_generated_answer(mut self, input: crate::types::IncludeGeneratedAnswer) -> Self {
self.inner = self.inner.include_generated_answer(input);
self
}
/// <p>Indicates whether generated answers are included or excluded.</p>
pub fn set_include_generated_answer(mut self, input: ::std::option::Option<crate::types::IncludeGeneratedAnswer>) -> Self {
self.inner = self.inner.set_include_generated_answer(input);
self
}
/// <p>Indicates whether generated answers are included or excluded.</p>
pub fn get_include_generated_answer(&self) -> &::std::option::Option<crate::types::IncludeGeneratedAnswer> {
self.inner.get_include_generated_answer()
}
/// <p>The number of maximum topics to be considered to predict QA results.</p>
pub fn max_topics_to_consider(mut self, input: i32) -> Self {
self.inner = self.inner.max_topics_to_consider(input);
self
}
/// <p>The number of maximum topics to be considered to predict QA results.</p>
pub fn set_max_topics_to_consider(mut self, input: ::std::option::Option<i32>) -> Self {
self.inner = self.inner.set_max_topics_to_consider(input);
self
}
/// <p>The number of maximum topics to be considered to predict QA results.</p>
pub fn get_max_topics_to_consider(&self) -> &::std::option::Option<i32> {
self.inner.get_max_topics_to_consider()
}
}