aws-sdk-nimble 1.46.0

AWS SDK for AmazonNimbleStudio
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 ListStudiosOutput {
    /// <p>The token for the next set of results, or null if there are no more results.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>A collection of studios.</p>
    pub studios: ::std::vec::Vec<crate::types::Studio>,
    _request_id: Option<String>,
}
impl ListStudiosOutput {
    /// <p>The token for the next set of results, or null if there are no more results.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>A collection of studios.</p>
    pub fn studios(&self) -> &[crate::types::Studio] {
        use std::ops::Deref;
        self.studios.deref()
    }
}
impl ::aws_types::request_id::RequestId for ListStudiosOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl ListStudiosOutput {
    /// Creates a new builder-style object to manufacture [`ListStudiosOutput`](crate::operation::list_studios::ListStudiosOutput).
    pub fn builder() -> crate::operation::list_studios::builders::ListStudiosOutputBuilder {
        crate::operation::list_studios::builders::ListStudiosOutputBuilder::default()
    }
}

/// A builder for [`ListStudiosOutput`](crate::operation::list_studios::ListStudiosOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListStudiosOutputBuilder {
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) studios: ::std::option::Option<::std::vec::Vec<crate::types::Studio>>,
    _request_id: Option<String>,
}
impl ListStudiosOutputBuilder {
    /// <p>The token for the next set of results, or null if 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>The token for the next set of results, or null if 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>The token for the next set of results, or null if 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 `studios`.
    ///
    /// To override the contents of this collection use [`set_studios`](Self::set_studios).
    ///
    /// <p>A collection of studios.</p>
    pub fn studios(mut self, input: crate::types::Studio) -> Self {
        let mut v = self.studios.unwrap_or_default();
        v.push(input);
        self.studios = ::std::option::Option::Some(v);
        self
    }
    /// <p>A collection of studios.</p>
    pub fn set_studios(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Studio>>) -> Self {
        self.studios = input;
        self
    }
    /// <p>A collection of studios.</p>
    pub fn get_studios(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Studio>> {
        &self.studios
    }
    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 [`ListStudiosOutput`](crate::operation::list_studios::ListStudiosOutput).
    /// This method will fail if any of the following fields are not set:
    /// - [`studios`](crate::operation::list_studios::builders::ListStudiosOutputBuilder::studios)
    pub fn build(self) -> ::std::result::Result<crate::operation::list_studios::ListStudiosOutput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_studios::ListStudiosOutput {
            next_token: self.next_token,
            studios: self.studios.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "studios",
                    "studios was not specified but it is required when building ListStudiosOutput",
                )
            })?,
            _request_id: self._request_id,
        })
    }
}