aws-sdk-cloudsearchdomain 1.93.0

AWS SDK for Amazon CloudSearch Domain
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::suggest::_suggest_output::SuggestOutputBuilder;

pub use crate::operation::suggest::_suggest_input::SuggestInputBuilder;

impl crate::operation::suggest::builders::SuggestInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::suggest::SuggestOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::suggest::SuggestError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.suggest();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `Suggest`.
///
/// <p>Retrieves autocomplete suggestions for a partial query string. You can use suggestions enable you to display likely matches before users finish typing. In Amazon CloudSearch, suggestions are based on the contents of a particular text field. When you request suggestions, Amazon CloudSearch finds all of the documents whose values in the suggester field start with the specified query string. The beginning of the field must match the query string to be considered a match.</p>
/// <p>For more information about configuring suggesters and retrieving suggestions, see <a href="http://docs.aws.amazon.com/cloudsearch/latest/developerguide/getting-suggestions.html">Getting Suggestions</a> in the <i>Amazon CloudSearch Developer Guide</i>.</p>
/// <p>The endpoint for submitting <code>Suggest</code> requests is domain-specific. You submit suggest requests to a domain's search endpoint. To get the search endpoint for your domain, use the Amazon CloudSearch configuration service <code>DescribeDomains</code> action. A domain's endpoints are also displayed on the domain dashboard in the Amazon CloudSearch console.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct SuggestFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::suggest::builders::SuggestInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl crate::client::customize::internal::CustomizableSend<crate::operation::suggest::SuggestOutput, crate::operation::suggest::SuggestError>
    for SuggestFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<crate::operation::suggest::SuggestOutput, crate::operation::suggest::SuggestError>,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl SuggestFluentBuilder {
    /// Creates a new `SuggestFluentBuilder`.
    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 Suggest as a reference.
    pub fn as_input(&self) -> &crate::operation::suggest::builders::SuggestInputBuilder {
        &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::suggest::SuggestOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::suggest::SuggestError,
            ::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::suggest::Suggest::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::suggest::Suggest::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::suggest::SuggestOutput, crate::operation::suggest::SuggestError, 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>Specifies the string for which you want to get suggestions.</p>
    pub fn query(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.query(input.into());
        self
    }
    /// <p>Specifies the string for which you want to get suggestions.</p>
    pub fn set_query(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_query(input);
        self
    }
    /// <p>Specifies the string for which you want to get suggestions.</p>
    pub fn get_query(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_query()
    }
    /// <p>Specifies the name of the suggester to use to find suggested matches.</p>
    pub fn suggester(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.suggester(input.into());
        self
    }
    /// <p>Specifies the name of the suggester to use to find suggested matches.</p>
    pub fn set_suggester(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_suggester(input);
        self
    }
    /// <p>Specifies the name of the suggester to use to find suggested matches.</p>
    pub fn get_suggester(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_suggester()
    }
    /// <p>Specifies the maximum number of suggestions to return.</p>
    pub fn size(mut self, input: i64) -> Self {
        self.inner = self.inner.size(input);
        self
    }
    /// <p>Specifies the maximum number of suggestions to return.</p>
    pub fn set_size(mut self, input: ::std::option::Option<i64>) -> Self {
        self.inner = self.inner.set_size(input);
        self
    }
    /// <p>Specifies the maximum number of suggestions to return.</p>
    pub fn get_size(&self) -> &::std::option::Option<i64> {
        self.inner.get_size()
    }
}