aws-sdk-devopsagent 1.4.0

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

/// Response structure for listing chats
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ListChatsOutput {
    /// List of recent chat executions
    pub executions: ::std::vec::Vec<crate::types::ChatExecution>,
    /// Token for retrieving the next page of results
    pub next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListChatsOutput {
    /// List of recent chat executions
    pub fn executions(&self) -> &[crate::types::ChatExecution] {
        use std::ops::Deref;
        self.executions.deref()
    }
    /// Token for retrieving the next page of results
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for ListChatsOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ListChatsOutput {
    /// Creates a new builder-style object to manufacture [`ListChatsOutput`](crate::operation::list_chats::ListChatsOutput).
    pub fn builder() -> crate::operation::list_chats::builders::ListChatsOutputBuilder {
        crate::operation::list_chats::builders::ListChatsOutputBuilder::default()
    }
}

/// A builder for [`ListChatsOutput`](crate::operation::list_chats::ListChatsOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListChatsOutputBuilder {
    pub(crate) executions: ::std::option::Option<::std::vec::Vec<crate::types::ChatExecution>>,
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl ListChatsOutputBuilder {
    /// Appends an item to `executions`.
    ///
    /// To override the contents of this collection use [`set_executions`](Self::set_executions).
    ///
    /// List of recent chat executions
    pub fn executions(mut self, input: crate::types::ChatExecution) -> Self {
        let mut v = self.executions.unwrap_or_default();
        v.push(input);
        self.executions = ::std::option::Option::Some(v);
        self
    }
    /// List of recent chat executions
    pub fn set_executions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ChatExecution>>) -> Self {
        self.executions = input;
        self
    }
    /// List of recent chat executions
    pub fn get_executions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ChatExecution>> {
        &self.executions
    }
    /// Token for retrieving the next page of results
    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
    }
    /// Token for retrieving the next page of results
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// Token for retrieving the next page of results
    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 [`ListChatsOutput`](crate::operation::list_chats::ListChatsOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`executions`](crate::operation::list_chats::builders::ListChatsOutputBuilder::executions)
    pub fn build(self) -> ::std::result::Result<crate::operation::list_chats::ListChatsOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_chats::ListChatsOutput {
            executions: self.executions.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "executions",
                    "executions was not specified but it is required when building ListChatsOutput",
                )
            })?,
            next_token: self.next_token,
            _request_id: self._request_id,
        })
    }
}