aws-sdk-bedrockagent 1.18.0

AWS SDK for Agents for Amazon Bedrock
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 ListAgentsOutput {
    /// <p>A list of objects, each of which contains information about an agent.</p>
    pub agent_summaries: ::std::vec::Vec<crate::types::AgentSummary>,
    /// <p>If the total number of results is greater than the <code>maxResults</code> value provided in the request, use this token when making another request in the <code>nextToken</code> field to return the next batch of results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListAgentsOutput {
    /// <p>A list of objects, each of which contains information about an agent.</p>
    pub fn agent_summaries(&self) -> &[crate::types::AgentSummary] {
        use std::ops::Deref;
        self.agent_summaries.deref()
    }
    /// <p>If the total number of results is greater than the <code>maxResults</code> value provided in the request, use this token when making another request in the <code>nextToken</code> field to return the next batch of results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for ListAgentsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ListAgentsOutput {
    /// Creates a new builder-style object to manufacture [`ListAgentsOutput`](crate::operation::list_agents::ListAgentsOutput).
    pub fn builder() -> crate::operation::list_agents::builders::ListAgentsOutputBuilder {
        crate::operation::list_agents::builders::ListAgentsOutputBuilder::default()
    }
}

/// A builder for [`ListAgentsOutput`](crate::operation::list_agents::ListAgentsOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct ListAgentsOutputBuilder {
    pub(crate) agent_summaries: ::std::option::Option<::std::vec::Vec<crate::types::AgentSummary>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListAgentsOutputBuilder {
    /// Appends an item to `agent_summaries`.
    ///
    /// To override the contents of this collection use [`set_agent_summaries`](Self::set_agent_summaries).
    ///
    /// <p>A list of objects, each of which contains information about an agent.</p>
    pub fn agent_summaries(mut self, input: crate::types::AgentSummary) -> Self {
        let mut v = self.agent_summaries.unwrap_or_default();
        v.push(input);
        self.agent_summaries = ::std::option::Option::Some(v);
        self
    }
    /// <p>A list of objects, each of which contains information about an agent.</p>
    pub fn set_agent_summaries(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AgentSummary>>) -> Self {
        self.agent_summaries = input;
        self
    }
    /// <p>A list of objects, each of which contains information about an agent.</p>
    pub fn get_agent_summaries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AgentSummary>> {
        &self.agent_summaries
    }
    /// <p>If the total number of results is greater than the <code>maxResults</code> value provided in the request, use this token when making another request in the <code>nextToken</code> field to return the next batch of 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>If the total number of results is greater than the <code>maxResults</code> value provided in the request, use this token when making another request in the <code>nextToken</code> field to return the next batch of results.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>If the total number of results is greater than the <code>maxResults</code> value provided in the request, use this token when making another request in the <code>nextToken</code> field to return the next batch of results.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    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 [`ListAgentsOutput`](crate::operation::list_agents::ListAgentsOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`agent_summaries`](crate::operation::list_agents::builders::ListAgentsOutputBuilder::agent_summaries)
    pub fn build(self) -> ::std::result::Result<crate::operation::list_agents::ListAgentsOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_agents::ListAgentsOutput {
            agent_summaries: self.agent_summaries.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "agent_summaries",
                    "agent_summaries was not specified but it is required when building ListAgentsOutput",
                )
            })?,
            next_token: self.next_token,
            _request_id: self._request_id,
        })
    }
}