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 response of SearchAgentContext.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct SearchAgentContextOutput {
    /// <p>Pagination cursor for the next page. Absent when there are no more results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>The matching entities, ranked by relevance.</p>
    pub items: ::std::vec::Vec<crate::types::SearchAgentContextResultEntity>,
    /// <p>Present when the end user must authorize access to a third-party resource before the search can run. In that case, <code>items</code> is empty. Show <code>authorizationUrl</code> to the end user, and retry after the user consents. Through the agent context's MCP server, you receive this as an MCP elicitation request that contains the URL.</p>
    pub authorization_required: ::std::option::Option<crate::types::AuthorizationRequired>,
    _request_id: Option<String>,
}
impl SearchAgentContextOutput {
    /// <p>Pagination cursor for the next page. Absent when there are no more results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>The matching entities, ranked by relevance.</p>
    pub fn items(&self) -> &[crate::types::SearchAgentContextResultEntity] {
        use std::ops::Deref;
        self.items.deref()
    }
    /// <p>Present when the end user must authorize access to a third-party resource before the search can run. In that case, <code>items</code> is empty. Show <code>authorizationUrl</code> to the end user, and retry after the user consents. Through the agent context's MCP server, you receive this as an MCP elicitation request that contains the URL.</p>
    pub fn authorization_required(&self) -> ::std::option::Option<&crate::types::AuthorizationRequired> {
        self.authorization_required.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for SearchAgentContextOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl SearchAgentContextOutput {
    /// Creates a new builder-style object to manufacture [`SearchAgentContextOutput`](crate::operation::search_agent_context::SearchAgentContextOutput).
    pub fn builder() -> crate::operation::search_agent_context::builders::SearchAgentContextOutputBuilder {
        crate::operation::search_agent_context::builders::SearchAgentContextOutputBuilder::default()
    }
}

/// A builder for [`SearchAgentContextOutput`](crate::operation::search_agent_context::SearchAgentContextOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct SearchAgentContextOutputBuilder {
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) items: ::std::option::Option<::std::vec::Vec<crate::types::SearchAgentContextResultEntity>>,
    pub(crate) authorization_required: ::std::option::Option<crate::types::AuthorizationRequired>,
    _request_id: Option<String>,
}
impl SearchAgentContextOutputBuilder {
    /// <p>Pagination cursor for the next page. Absent when there are no more results.</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>Pagination cursor for the next page. Absent when there are no more results.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>Pagination cursor for the next page. Absent when there are no more results.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// Appends an item to `items`.
    ///
    /// To override the contents of this collection use [`set_items`](Self::set_items).
    ///
    /// <p>The matching entities, ranked by relevance.</p>
    pub fn items(mut self, input: crate::types::SearchAgentContextResultEntity) -> Self {
        let mut v = self.items.unwrap_or_default();
        v.push(input);
        self.items = ::std::option::Option::Some(v);
        self
    }
    /// <p>The matching entities, ranked by relevance.</p>
    pub fn set_items(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SearchAgentContextResultEntity>>) -> Self {
        self.items = input;
        self
    }
    /// <p>The matching entities, ranked by relevance.</p>
    pub fn get_items(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SearchAgentContextResultEntity>> {
        &self.items
    }
    /// <p>Present when the end user must authorize access to a third-party resource before the search can run. In that case, <code>items</code> is empty. Show <code>authorizationUrl</code> to the end user, and retry after the user consents. Through the agent context's MCP server, you receive this as an MCP elicitation request that contains the URL.</p>
    pub fn authorization_required(mut self, input: crate::types::AuthorizationRequired) -> Self {
        self.authorization_required = ::std::option::Option::Some(input);
        self
    }
    /// <p>Present when the end user must authorize access to a third-party resource before the search can run. In that case, <code>items</code> is empty. Show <code>authorizationUrl</code> to the end user, and retry after the user consents. Through the agent context's MCP server, you receive this as an MCP elicitation request that contains the URL.</p>
    pub fn set_authorization_required(mut self, input: ::std::option::Option<crate::types::AuthorizationRequired>) -> Self {
        self.authorization_required = input;
        self
    }
    /// <p>Present when the end user must authorize access to a third-party resource before the search can run. In that case, <code>items</code> is empty. Show <code>authorizationUrl</code> to the end user, and retry after the user consents. Through the agent context's MCP server, you receive this as an MCP elicitation request that contains the URL.</p>
    pub fn get_authorization_required(&self) -> &::std::option::Option<crate::types::AuthorizationRequired> {
        &self.authorization_required
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`SearchAgentContextOutput`](crate::operation::search_agent_context::SearchAgentContextOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`items`](crate::operation::search_agent_context::builders::SearchAgentContextOutputBuilder::items)
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::search_agent_context::SearchAgentContextOutput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::search_agent_context::SearchAgentContextOutput {
            next_token: self.next_token,
            items: self.items.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "items",
                    "items was not specified but it is required when building SearchAgentContextOutput",
                )
            })?,
            authorization_required: self.authorization_required,
            _request_id: self._request_id,
        })
    }
}