aws-sdk-kendra 1.95.0

AWS SDK for AWSKendraFrontendService
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_query_suggestions_config::_update_query_suggestions_config_output::UpdateQuerySuggestionsConfigOutputBuilder;

pub use crate::operation::update_query_suggestions_config::_update_query_suggestions_config_input::UpdateQuerySuggestionsConfigInputBuilder;

impl crate::operation::update_query_suggestions_config::builders::UpdateQuerySuggestionsConfigInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.update_query_suggestions_config();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `UpdateQuerySuggestionsConfig`.
///
/// <p>Updates the settings of query suggestions for an index.</p>
/// <p>Amazon Kendra supports partial updates, so you only need to provide the fields you want to update.</p>
/// <p>If an update is currently processing, you need to wait for the update to finish before making another update.</p>
/// <p>Updates to query suggestions settings might not take effect right away. The time for your updated settings to take effect depends on the updates made and the number of search queries in your index.</p>
/// <p>You can still enable/disable query suggestions at any time.</p>
/// <p><code>UpdateQuerySuggestionsConfig</code> is currently not supported in the Amazon Web Services GovCloud (US-West) region.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateQuerySuggestionsConfigFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::update_query_suggestions_config::builders::UpdateQuerySuggestionsConfigInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
        crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
    > for UpdateQuerySuggestionsConfigFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
            crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl UpdateQuerySuggestionsConfigFluentBuilder {
    /// Creates a new `UpdateQuerySuggestionsConfigFluentBuilder`.
    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 UpdateQuerySuggestionsConfig as a reference.
    pub fn as_input(&self) -> &crate::operation::update_query_suggestions_config::builders::UpdateQuerySuggestionsConfigInputBuilder {
        &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::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
            ::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::update_query_suggestions_config::UpdateQuerySuggestionsConfig::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfig::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::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
        crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
        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 identifier of the index with query suggestions you want to update.</p>
    pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.index_id(input.into());
        self
    }
    /// <p>The identifier of the index with query suggestions you want to update.</p>
    pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_index_id(input);
        self
    }
    /// <p>The identifier of the index with query suggestions you want to update.</p>
    pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_index_id()
    }
    /// <p>Set the mode to <code>ENABLED</code> or <code>LEARN_ONLY</code>.</p>
    /// <p>By default, Amazon Kendra enables query suggestions. <code>LEARN_ONLY</code> mode allows you to turn off query suggestions. You can to update this at any time.</p>
    /// <p>In <code>LEARN_ONLY</code> mode, Amazon Kendra continues to learn from new queries to keep suggestions up to date for when you are ready to switch to ENABLED mode again.</p>
    pub fn mode(mut self, input: crate::types::Mode) -> Self {
        self.inner = self.inner.mode(input);
        self
    }
    /// <p>Set the mode to <code>ENABLED</code> or <code>LEARN_ONLY</code>.</p>
    /// <p>By default, Amazon Kendra enables query suggestions. <code>LEARN_ONLY</code> mode allows you to turn off query suggestions. You can to update this at any time.</p>
    /// <p>In <code>LEARN_ONLY</code> mode, Amazon Kendra continues to learn from new queries to keep suggestions up to date for when you are ready to switch to ENABLED mode again.</p>
    pub fn set_mode(mut self, input: ::std::option::Option<crate::types::Mode>) -> Self {
        self.inner = self.inner.set_mode(input);
        self
    }
    /// <p>Set the mode to <code>ENABLED</code> or <code>LEARN_ONLY</code>.</p>
    /// <p>By default, Amazon Kendra enables query suggestions. <code>LEARN_ONLY</code> mode allows you to turn off query suggestions. You can to update this at any time.</p>
    /// <p>In <code>LEARN_ONLY</code> mode, Amazon Kendra continues to learn from new queries to keep suggestions up to date for when you are ready to switch to ENABLED mode again.</p>
    pub fn get_mode(&self) -> &::std::option::Option<crate::types::Mode> {
        self.inner.get_mode()
    }
    /// <p>How recent your queries are in your query log time window.</p>
    /// <p>The time window is the number of days from current day to past days.</p>
    /// <p>By default, Amazon Kendra sets this to 180.</p>
    pub fn query_log_look_back_window_in_days(mut self, input: i32) -> Self {
        self.inner = self.inner.query_log_look_back_window_in_days(input);
        self
    }
    /// <p>How recent your queries are in your query log time window.</p>
    /// <p>The time window is the number of days from current day to past days.</p>
    /// <p>By default, Amazon Kendra sets this to 180.</p>
    pub fn set_query_log_look_back_window_in_days(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_query_log_look_back_window_in_days(input);
        self
    }
    /// <p>How recent your queries are in your query log time window.</p>
    /// <p>The time window is the number of days from current day to past days.</p>
    /// <p>By default, Amazon Kendra sets this to 180.</p>
    pub fn get_query_log_look_back_window_in_days(&self) -> &::std::option::Option<i32> {
        self.inner.get_query_log_look_back_window_in_days()
    }
    /// <p><code>TRUE</code> to include queries without user information (i.e. all queries, irrespective of the user), otherwise <code>FALSE</code> to only include queries with user information.</p>
    /// <p>If you pass user information to Amazon Kendra along with the queries, you can set this flag to <code>FALSE</code> and instruct Amazon Kendra to only consider queries with user information.</p>
    /// <p>If you set to <code>FALSE</code>, Amazon Kendra only considers queries searched at least <code>MinimumQueryCount</code> times across <code>MinimumNumberOfQueryingUsers</code> unique users for suggestions.</p>
    /// <p>If you set to <code>TRUE</code>, Amazon Kendra ignores all user information and learns from all queries.</p>
    pub fn include_queries_without_user_information(mut self, input: bool) -> Self {
        self.inner = self.inner.include_queries_without_user_information(input);
        self
    }
    /// <p><code>TRUE</code> to include queries without user information (i.e. all queries, irrespective of the user), otherwise <code>FALSE</code> to only include queries with user information.</p>
    /// <p>If you pass user information to Amazon Kendra along with the queries, you can set this flag to <code>FALSE</code> and instruct Amazon Kendra to only consider queries with user information.</p>
    /// <p>If you set to <code>FALSE</code>, Amazon Kendra only considers queries searched at least <code>MinimumQueryCount</code> times across <code>MinimumNumberOfQueryingUsers</code> unique users for suggestions.</p>
    /// <p>If you set to <code>TRUE</code>, Amazon Kendra ignores all user information and learns from all queries.</p>
    pub fn set_include_queries_without_user_information(mut self, input: ::std::option::Option<bool>) -> Self {
        self.inner = self.inner.set_include_queries_without_user_information(input);
        self
    }
    /// <p><code>TRUE</code> to include queries without user information (i.e. all queries, irrespective of the user), otherwise <code>FALSE</code> to only include queries with user information.</p>
    /// <p>If you pass user information to Amazon Kendra along with the queries, you can set this flag to <code>FALSE</code> and instruct Amazon Kendra to only consider queries with user information.</p>
    /// <p>If you set to <code>FALSE</code>, Amazon Kendra only considers queries searched at least <code>MinimumQueryCount</code> times across <code>MinimumNumberOfQueryingUsers</code> unique users for suggestions.</p>
    /// <p>If you set to <code>TRUE</code>, Amazon Kendra ignores all user information and learns from all queries.</p>
    pub fn get_include_queries_without_user_information(&self) -> &::std::option::Option<bool> {
        self.inner.get_include_queries_without_user_information()
    }
    /// <p>The minimum number of unique users who must search a query in order for the query to be eligible to suggest to your users.</p>
    /// <p>Increasing this number might decrease the number of suggestions. However, this ensures a query is searched by many users and is truly popular to suggest to users.</p>
    /// <p>How you tune this setting depends on your specific needs.</p>
    pub fn minimum_number_of_querying_users(mut self, input: i32) -> Self {
        self.inner = self.inner.minimum_number_of_querying_users(input);
        self
    }
    /// <p>The minimum number of unique users who must search a query in order for the query to be eligible to suggest to your users.</p>
    /// <p>Increasing this number might decrease the number of suggestions. However, this ensures a query is searched by many users and is truly popular to suggest to users.</p>
    /// <p>How you tune this setting depends on your specific needs.</p>
    pub fn set_minimum_number_of_querying_users(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_minimum_number_of_querying_users(input);
        self
    }
    /// <p>The minimum number of unique users who must search a query in order for the query to be eligible to suggest to your users.</p>
    /// <p>Increasing this number might decrease the number of suggestions. However, this ensures a query is searched by many users and is truly popular to suggest to users.</p>
    /// <p>How you tune this setting depends on your specific needs.</p>
    pub fn get_minimum_number_of_querying_users(&self) -> &::std::option::Option<i32> {
        self.inner.get_minimum_number_of_querying_users()
    }
    /// <p>The the minimum number of times a query must be searched in order to be eligible to suggest to your users.</p>
    /// <p>Decreasing this number increases the number of suggestions. However, this affects the quality of suggestions as it sets a low bar for a query to be considered popular to suggest to users.</p>
    /// <p>How you tune this setting depends on your specific needs.</p>
    pub fn minimum_query_count(mut self, input: i32) -> Self {
        self.inner = self.inner.minimum_query_count(input);
        self
    }
    /// <p>The the minimum number of times a query must be searched in order to be eligible to suggest to your users.</p>
    /// <p>Decreasing this number increases the number of suggestions. However, this affects the quality of suggestions as it sets a low bar for a query to be considered popular to suggest to users.</p>
    /// <p>How you tune this setting depends on your specific needs.</p>
    pub fn set_minimum_query_count(mut self, input: ::std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_minimum_query_count(input);
        self
    }
    /// <p>The the minimum number of times a query must be searched in order to be eligible to suggest to your users.</p>
    /// <p>Decreasing this number increases the number of suggestions. However, this affects the quality of suggestions as it sets a low bar for a query to be considered popular to suggest to users.</p>
    /// <p>How you tune this setting depends on your specific needs.</p>
    pub fn get_minimum_query_count(&self) -> &::std::option::Option<i32> {
        self.inner.get_minimum_query_count()
    }
    /// <p>Configuration information for the document fields/attributes that you want to base query suggestions on.</p>
    pub fn attribute_suggestions_config(mut self, input: crate::types::AttributeSuggestionsUpdateConfig) -> Self {
        self.inner = self.inner.attribute_suggestions_config(input);
        self
    }
    /// <p>Configuration information for the document fields/attributes that you want to base query suggestions on.</p>
    pub fn set_attribute_suggestions_config(mut self, input: ::std::option::Option<crate::types::AttributeSuggestionsUpdateConfig>) -> Self {
        self.inner = self.inner.set_attribute_suggestions_config(input);
        self
    }
    /// <p>Configuration information for the document fields/attributes that you want to base query suggestions on.</p>
    pub fn get_attribute_suggestions_config(&self) -> &::std::option::Option<crate::types::AttributeSuggestionsUpdateConfig> {
        self.inner.get_attribute_suggestions_config()
    }
}