aws-sdk-opensearch 1.138.0

AWS SDK for Amazon OpenSearch Service
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::insight_feedback::_insight_feedback_input::InsightFeedbackInputBuilder;

pub use crate::operation::insight_feedback::_insight_feedback_output::InsightFeedbackOutputBuilder;

impl crate::operation::insight_feedback::builders::InsightFeedbackInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::insight_feedback::InsightFeedbackOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::insight_feedback::InsightFeedbackError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.insight_feedback();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `InsightFeedback`.
///
/// <p>Submits feedback for an existing insight in an Amazon OpenSearch Service domain. Allows users to provide a thumbs up or thumbs down rating and optional text feedback for a specific insight.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct InsightFeedbackFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::insight_feedback::builders::InsightFeedbackInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::insight_feedback::InsightFeedbackOutput,
        crate::operation::insight_feedback::InsightFeedbackError,
    > for InsightFeedbackFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::insight_feedback::InsightFeedbackOutput,
            crate::operation::insight_feedback::InsightFeedbackError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl InsightFeedbackFluentBuilder {
    /// Creates a new `InsightFeedbackFluentBuilder`.
    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 InsightFeedback as a reference.
    pub fn as_input(&self) -> &crate::operation::insight_feedback::builders::InsightFeedbackInputBuilder {
        &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::insight_feedback::InsightFeedbackOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::insight_feedback::InsightFeedbackError,
            ::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::insight_feedback::InsightFeedback::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::insight_feedback::InsightFeedback::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::insight_feedback::InsightFeedbackOutput,
        crate::operation::insight_feedback::InsightFeedbackError,
        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 entity for which to submit insight feedback. Specifies the type and value of the entity, such as a domain name.</p>
    pub fn entity(mut self, input: crate::types::InsightFeedbackEntity) -> Self {
        self.inner = self.inner.entity(input);
        self
    }
    /// <p>The entity for which to submit insight feedback. Specifies the type and value of the entity, such as a domain name.</p>
    pub fn set_entity(mut self, input: ::std::option::Option<crate::types::InsightFeedbackEntity>) -> Self {
        self.inner = self.inner.set_entity(input);
        self
    }
    /// <p>The entity for which to submit insight feedback. Specifies the type and value of the entity, such as a domain name.</p>
    pub fn get_entity(&self) -> &::std::option::Option<crate::types::InsightFeedbackEntity> {
        self.inner.get_entity()
    }
    /// <p>The unique identifier of the insight for which to submit feedback.</p>
    pub fn insight_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.insight_id(input.into());
        self
    }
    /// <p>The unique identifier of the insight for which to submit feedback.</p>
    pub fn set_insight_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_insight_id(input);
        self
    }
    /// <p>The unique identifier of the insight for which to submit feedback.</p>
    pub fn get_insight_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_insight_id()
    }
    /// <p>The thumbs up or thumbs down feedback for the insight. Possible values are <code>Up</code> and <code>Down</code>.</p>
    pub fn thumbs(mut self, input: crate::types::InsightFeedbackThumbs) -> Self {
        self.inner = self.inner.thumbs(input);
        self
    }
    /// <p>The thumbs up or thumbs down feedback for the insight. Possible values are <code>Up</code> and <code>Down</code>.</p>
    pub fn set_thumbs(mut self, input: ::std::option::Option<crate::types::InsightFeedbackThumbs>) -> Self {
        self.inner = self.inner.set_thumbs(input);
        self
    }
    /// <p>The thumbs up or thumbs down feedback for the insight. Possible values are <code>Up</code> and <code>Down</code>.</p>
    pub fn get_thumbs(&self) -> &::std::option::Option<crate::types::InsightFeedbackThumbs> {
        self.inner.get_thumbs()
    }
    /// <p>Optional text feedback providing additional details about the insight. Maximum length is 1000 characters.</p>
    pub fn feedback_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.feedback_text(input.into());
        self
    }
    /// <p>Optional text feedback providing additional details about the insight. Maximum length is 1000 characters.</p>
    pub fn set_feedback_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_feedback_text(input);
        self
    }
    /// <p>Optional text feedback providing additional details about the insight. Maximum length is 1000 characters.</p>
    pub fn get_feedback_text(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_feedback_text()
    }
}