aws-sdk-kendra 1.95.0

AWS SDK for AWSKendraFrontendService
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SubmitFeedbackInput {
    /// <p>The identifier of the index that was queried.</p>
    pub index_id: ::std::option::Option<::std::string::String>,
    /// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
    pub query_id: ::std::option::Option<::std::string::String>,
    /// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</p>
    pub click_feedback_items: ::std::option::Option<::std::vec::Vec<crate::types::ClickFeedback>>,
    /// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>
    pub relevance_feedback_items: ::std::option::Option<::std::vec::Vec<crate::types::RelevanceFeedback>>,
}
impl SubmitFeedbackInput {
    /// <p>The identifier of the index that was queried.</p>
    pub fn index_id(&self) -> ::std::option::Option<&str> {
        self.index_id.as_deref()
    }
    /// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
    pub fn query_id(&self) -> ::std::option::Option<&str> {
        self.query_id.as_deref()
    }
    /// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.click_feedback_items.is_none()`.
    pub fn click_feedback_items(&self) -> &[crate::types::ClickFeedback] {
        self.click_feedback_items.as_deref().unwrap_or_default()
    }
    /// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.relevance_feedback_items.is_none()`.
    pub fn relevance_feedback_items(&self) -> &[crate::types::RelevanceFeedback] {
        self.relevance_feedback_items.as_deref().unwrap_or_default()
    }
}
impl SubmitFeedbackInput {
    /// Creates a new builder-style object to manufacture [`SubmitFeedbackInput`](crate::operation::submit_feedback::SubmitFeedbackInput).
    pub fn builder() -> crate::operation::submit_feedback::builders::SubmitFeedbackInputBuilder {
        crate::operation::submit_feedback::builders::SubmitFeedbackInputBuilder::default()
    }
}

/// A builder for [`SubmitFeedbackInput`](crate::operation::submit_feedback::SubmitFeedbackInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SubmitFeedbackInputBuilder {
    pub(crate) index_id: ::std::option::Option<::std::string::String>,
    pub(crate) query_id: ::std::option::Option<::std::string::String>,
    pub(crate) click_feedback_items: ::std::option::Option<::std::vec::Vec<crate::types::ClickFeedback>>,
    pub(crate) relevance_feedback_items: ::std::option::Option<::std::vec::Vec<crate::types::RelevanceFeedback>>,
}
impl SubmitFeedbackInputBuilder {
    /// <p>The identifier of the index that was queried.</p>
    /// This field is required.
    pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.index_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the index that was queried.</p>
    pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.index_id = input;
        self
    }
    /// <p>The identifier of the index that was queried.</p>
    pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.index_id
    }
    /// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
    /// This field is required.
    pub fn query_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
    pub fn set_query_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query_id = input;
        self
    }
    /// <p>The identifier of the specific query for which you are submitting feedback. The query ID is returned in the response to the <code>Query</code> API.</p>
    pub fn get_query_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.query_id
    }
    /// Appends an item to `click_feedback_items`.
    ///
    /// To override the contents of this collection use [`set_click_feedback_items`](Self::set_click_feedback_items).
    ///
    /// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</p>
    pub fn click_feedback_items(mut self, input: crate::types::ClickFeedback) -> Self {
        let mut v = self.click_feedback_items.unwrap_or_default();
        v.push(input);
        self.click_feedback_items = ::std::option::Option::Some(v);
        self
    }
    /// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</p>
    pub fn set_click_feedback_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ClickFeedback>>) -> Self {
        self.click_feedback_items = input;
        self
    }
    /// <p>Tells Amazon Kendra that a particular search result link was chosen by the user.</p>
    pub fn get_click_feedback_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ClickFeedback>> {
        &self.click_feedback_items
    }
    /// Appends an item to `relevance_feedback_items`.
    ///
    /// To override the contents of this collection use [`set_relevance_feedback_items`](Self::set_relevance_feedback_items).
    ///
    /// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>
    pub fn relevance_feedback_items(mut self, input: crate::types::RelevanceFeedback) -> Self {
        let mut v = self.relevance_feedback_items.unwrap_or_default();
        v.push(input);
        self.relevance_feedback_items = ::std::option::Option::Some(v);
        self
    }
    /// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>
    pub fn set_relevance_feedback_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RelevanceFeedback>>) -> Self {
        self.relevance_feedback_items = input;
        self
    }
    /// <p>Provides Amazon Kendra with relevant or not relevant feedback for whether a particular item was relevant to the search.</p>
    pub fn get_relevance_feedback_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RelevanceFeedback>> {
        &self.relevance_feedback_items
    }
    /// Consumes the builder and constructs a [`SubmitFeedbackInput`](crate::operation::submit_feedback::SubmitFeedbackInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::submit_feedback::SubmitFeedbackInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::submit_feedback::SubmitFeedbackInput {
            index_id: self.index_id,
            query_id: self.query_id,
            click_feedback_items: self.click_feedback_items,
            relevance_feedback_items: self.relevance_feedback_items,
        })
    }
}