aws-sdk-context 1.0.0

AWS SDK for AWS Context
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The request for SearchAgentContext.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
pub struct SearchAgentContextInput {
    /// <p>Maximum number of results to return per page.</p>
    pub max_results: ::std::option::Option<i32>,
    /// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
    pub agent_context_id: ::std::option::Option<::std::string::String>,
    /// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
    pub query: ::std::option::Option<::std::string::String>,
    /// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
    pub filter: ::std::option::Option<crate::types::SearchFilter>,
    /// <p>The search strategy to use. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
    /// <li>
    /// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
    /// <li>
    /// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
    /// </ul>
    pub search_type: ::std::option::Option<crate::types::SearchAgentContextType>,
}
impl SearchAgentContextInput {
    /// <p>Maximum number of results to return per page.</p>
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
    /// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
    pub fn agent_context_id(&self) -> ::std::option::Option<&str> {
        self.agent_context_id.as_deref()
    }
    /// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
    pub fn query(&self) -> ::std::option::Option<&str> {
        self.query.as_deref()
    }
    /// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
    pub fn filter(&self) -> ::std::option::Option<&crate::types::SearchFilter> {
        self.filter.as_ref()
    }
    /// <p>The search strategy to use. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
    /// <li>
    /// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
    /// <li>
    /// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
    /// </ul>
    pub fn search_type(&self) -> ::std::option::Option<&crate::types::SearchAgentContextType> {
        self.search_type.as_ref()
    }
}
impl ::std::fmt::Debug for SearchAgentContextInput {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("SearchAgentContextInput");
        formatter.field("max_results", &self.max_results);
        formatter.field("next_token", &self.next_token);
        formatter.field("agent_context_id", &self.agent_context_id);
        formatter.field("query", &"*** Sensitive Data Redacted ***");
        formatter.field("filter", &"*** Sensitive Data Redacted ***");
        formatter.field("search_type", &self.search_type);
        formatter.finish()
    }
}
impl SearchAgentContextInput {
    /// Creates a new builder-style object to manufacture [`SearchAgentContextInput`](crate::operation::search_agent_context::SearchAgentContextInput).
    pub fn builder() -> crate::operation::search_agent_context::builders::SearchAgentContextInputBuilder {
        crate::operation::search_agent_context::builders::SearchAgentContextInputBuilder::default()
    }
}

/// A builder for [`SearchAgentContextInput`](crate::operation::search_agent_context::SearchAgentContextInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
#[non_exhaustive]
pub struct SearchAgentContextInputBuilder {
    pub(crate) max_results: ::std::option::Option<i32>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) agent_context_id: ::std::option::Option<::std::string::String>,
    pub(crate) query: ::std::option::Option<::std::string::String>,
    pub(crate) filter: ::std::option::Option<crate::types::SearchFilter>,
    pub(crate) search_type: ::std::option::Option<crate::types::SearchAgentContextType>,
}
impl SearchAgentContextInputBuilder {
    /// <p>Maximum number of results to return per page.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// <p>Maximum number of results to return per page.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// <p>Maximum number of results to return per page.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.next_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>Opaque continuation token from a prior response. Omit on the first page.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
    /// This field is required.
    pub fn agent_context_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.agent_context_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
    pub fn set_agent_context_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.agent_context_id = input;
        self
    }
    /// <p>The agent context to search, by ID or full Amazon Resource Name (ARN).</p>
    pub fn get_agent_context_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.agent_context_id
    }
    /// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
    /// This field is required.
    pub fn query(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.query = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
    pub fn set_query(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.query = input;
        self
    }
    /// <p>The natural-language query or keywords to search for in the agent context. AWS Context interprets it based on <code>searchType</code>: as literal text for <code>KEYWORD</code>, as a semantic concept for <code>SEMANTIC</code>, or as both for <code>AUTO</code>.</p>
    pub fn get_query(&self) -> &::std::option::Option<::std::string::String> {
        &self.query
    }
    /// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
    pub fn filter(mut self, input: crate::types::SearchFilter) -> Self {
        self.filter = ::std::option::Option::Some(input);
        self
    }
    /// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
    pub fn set_filter(mut self, input: ::std::option::Option<crate::types::SearchFilter>) -> Self {
        self.filter = input;
        self
    }
    /// <p>Optional filter on node attributes: a single comparison, or <code>andAll</code> of comparisons that must all match.</p>
    pub fn get_filter(&self) -> &::std::option::Option<crate::types::SearchFilter> {
        &self.filter
    }
    /// <p>The search strategy to use. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
    /// <li>
    /// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
    /// <li>
    /// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
    /// </ul>
    /// This field is required.
    pub fn search_type(mut self, input: crate::types::SearchAgentContextType) -> Self {
        self.search_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The search strategy to use. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
    /// <li>
    /// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
    /// <li>
    /// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
    /// </ul>
    pub fn set_search_type(mut self, input: ::std::option::Option<crate::types::SearchAgentContextType>) -> Self {
        self.search_type = input;
        self
    }
    /// <p>The search strategy to use. Valid values:</p>
    /// <ul>
    /// <li>
    /// <p><code>KEYWORD</code> - Full-text keyword matching (BM25).</p></li>
    /// <li>
    /// <p><code>SEMANTIC</code> - Vector similarity of embeddings.</p></li>
    /// <li>
    /// <p><code>AUTO</code> - Keyword matches first, then semantic matches for the remaining results.</p></li>
    /// </ul>
    pub fn get_search_type(&self) -> &::std::option::Option<crate::types::SearchAgentContextType> {
        &self.search_type
    }
    /// Consumes the builder and constructs a [`SearchAgentContextInput`](crate::operation::search_agent_context::SearchAgentContextInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::search_agent_context::SearchAgentContextInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::search_agent_context::SearchAgentContextInput {
            max_results: self.max_results,
            next_token: self.next_token,
            agent_context_id: self.agent_context_id,
            query: self.query,
            filter: self.filter,
            search_type: self.search_type,
        })
    }
}
impl ::std::fmt::Debug for SearchAgentContextInputBuilder {
    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        let mut formatter = f.debug_struct("SearchAgentContextInputBuilder");
        formatter.field("max_results", &self.max_results);
        formatter.field("next_token", &self.next_token);
        formatter.field("agent_context_id", &self.agent_context_id);
        formatter.field("query", &"*** Sensitive Data Redacted ***");
        formatter.field("filter", &"*** Sensitive Data Redacted ***");
        formatter.field("search_type", &self.search_type);
        formatter.finish()
    }
}