aws-sdk-evs 1.29.0

AWS SDK for Amazon Elastic VMware Service
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 ListEnvironmentsInput {
    /// <p>A unique pagination token for each page. If <code>nextToken</code> is returned, there are more results available. Make the call again using the returned token with all other arguments unchanged to retrieve the next page. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>The maximum number of results to return. If you specify <code>MaxResults</code> in the request, the response includes information up to the limit specified.</p>
    pub max_results: ::std::option::Option<i32>,
    /// <p>The state of an environment. Used to filter response results to return only environments with the specified <code>environmentState</code>.</p>
    pub state: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentState>>,
}
impl ListEnvironmentsInput {
    /// <p>A unique pagination token for each page. If <code>nextToken</code> is returned, there are more results available. Make the call again using the returned token with all other arguments unchanged to retrieve the next page. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>The maximum number of results to return. If you specify <code>MaxResults</code> in the request, the response includes information up to the limit specified.</p>
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
    /// <p>The state of an environment. Used to filter response results to return only environments with the specified <code>environmentState</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.state.is_none()`.
    pub fn state(&self) -> &[crate::types::EnvironmentState] {
        self.state.as_deref().unwrap_or_default()
    }
}
impl ListEnvironmentsInput {
    /// Creates a new builder-style object to manufacture [`ListEnvironmentsInput`](crate::operation::list_environments::ListEnvironmentsInput).
    pub fn builder() -> crate::operation::list_environments::builders::ListEnvironmentsInputBuilder {
        crate::operation::list_environments::builders::ListEnvironmentsInputBuilder::default()
    }
}

/// A builder for [`ListEnvironmentsInput`](crate::operation::list_environments::ListEnvironmentsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListEnvironmentsInputBuilder {
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) max_results: ::std::option::Option<i32>,
    pub(crate) state: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentState>>,
}
impl ListEnvironmentsInputBuilder {
    /// <p>A unique pagination token for each page. If <code>nextToken</code> is returned, there are more results available. Make the call again using the returned token with all other arguments unchanged to retrieve the next page. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</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>A unique pagination token for each page. If <code>nextToken</code> is returned, there are more results available. Make the call again using the returned token with all other arguments unchanged to retrieve the next page. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>A unique pagination token for each page. If <code>nextToken</code> is returned, there are more results available. Make the call again using the returned token with all other arguments unchanged to retrieve the next page. Each pagination token expires after 24 hours. Using an expired pagination token will return an <i>HTTP 400 InvalidToken</i> error.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// <p>The maximum number of results to return. If you specify <code>MaxResults</code> in the request, the response includes information up to the limit specified.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of results to return. If you specify <code>MaxResults</code> in the request, the response includes information up to the limit specified.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// <p>The maximum number of results to return. If you specify <code>MaxResults</code> in the request, the response includes information up to the limit specified.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// Appends an item to `state`.
    ///
    /// To override the contents of this collection use [`set_state`](Self::set_state).
    ///
    /// <p>The state of an environment. Used to filter response results to return only environments with the specified <code>environmentState</code>.</p>
    pub fn state(mut self, input: crate::types::EnvironmentState) -> Self {
        let mut v = self.state.unwrap_or_default();
        v.push(input);
        self.state = ::std::option::Option::Some(v);
        self
    }
    /// <p>The state of an environment. Used to filter response results to return only environments with the specified <code>environmentState</code>.</p>
    pub fn set_state(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EnvironmentState>>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of an environment. Used to filter response results to return only environments with the specified <code>environmentState</code>.</p>
    pub fn get_state(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EnvironmentState>> {
        &self.state
    }
    /// Consumes the builder and constructs a [`ListEnvironmentsInput`](crate::operation::list_environments::ListEnvironmentsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::list_environments::ListEnvironmentsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_environments::ListEnvironmentsInput {
            next_token: self.next_token,
            max_results: self.max_results,
            state: self.state,
        })
    }
}