aws-sdk-supplychain 1.97.0

AWS SDK for AWS Supply Chain
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>The request parameters for ListInstances.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct ListInstancesInput {
    /// <p>The pagination token to fetch the next page of instances.</p>
    pub next_token: ::std::option::Option<::std::string::String>,
    /// <p>Specify the maximum number of instances to fetch in this paginated request.</p>
    pub max_results: ::std::option::Option<i32>,
    /// <p>The filter to ListInstances based on their names.</p>
    pub instance_name_filter: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The filter to ListInstances based on their state.</p>
    pub instance_state_filter: ::std::option::Option<::std::vec::Vec<crate::types::InstanceState>>,
}
impl ListInstancesInput {
    /// <p>The pagination token to fetch the next page of instances.</p>
    pub fn next_token(&self) -> ::std::option::Option<&str> {
        self.next_token.as_deref()
    }
    /// <p>Specify the maximum number of instances to fetch in this paginated request.</p>
    pub fn max_results(&self) -> ::std::option::Option<i32> {
        self.max_results
    }
    /// <p>The filter to ListInstances based on their names.</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 `.instance_name_filter.is_none()`.
    pub fn instance_name_filter(&self) -> &[::std::string::String] {
        self.instance_name_filter.as_deref().unwrap_or_default()
    }
    /// <p>The filter to ListInstances based on their state.</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 `.instance_state_filter.is_none()`.
    pub fn instance_state_filter(&self) -> &[crate::types::InstanceState] {
        self.instance_state_filter.as_deref().unwrap_or_default()
    }
}
impl ListInstancesInput {
    /// Creates a new builder-style object to manufacture [`ListInstancesInput`](crate::operation::list_instances::ListInstancesInput).
    pub fn builder() -> crate::operation::list_instances::builders::ListInstancesInputBuilder {
        crate::operation::list_instances::builders::ListInstancesInputBuilder::default()
    }
}

/// A builder for [`ListInstancesInput`](crate::operation::list_instances::ListInstancesInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ListInstancesInputBuilder {
    pub(crate) next_token: ::std::option::Option<::std::string::String>,
    pub(crate) max_results: ::std::option::Option<i32>,
    pub(crate) instance_name_filter: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) instance_state_filter: ::std::option::Option<::std::vec::Vec<crate::types::InstanceState>>,
}
impl ListInstancesInputBuilder {
    /// <p>The pagination token to fetch the next page of instances.</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 pagination token to fetch the next page of instances.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.next_token = input;
        self
    }
    /// <p>The pagination token to fetch the next page of instances.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.next_token
    }
    /// <p>Specify the maximum number of instances to fetch in this paginated request.</p>
    pub fn max_results(mut self, input: i32) -> Self {
        self.max_results = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specify the maximum number of instances to fetch in this paginated request.</p>
    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_results = input;
        self
    }
    /// <p>Specify the maximum number of instances to fetch in this paginated request.</p>
    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
        &self.max_results
    }
    /// Appends an item to `instance_name_filter`.
    ///
    /// To override the contents of this collection use [`set_instance_name_filter`](Self::set_instance_name_filter).
    ///
    /// <p>The filter to ListInstances based on their names.</p>
    pub fn instance_name_filter(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.instance_name_filter.unwrap_or_default();
        v.push(input.into());
        self.instance_name_filter = ::std::option::Option::Some(v);
        self
    }
    /// <p>The filter to ListInstances based on their names.</p>
    pub fn set_instance_name_filter(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.instance_name_filter = input;
        self
    }
    /// <p>The filter to ListInstances based on their names.</p>
    pub fn get_instance_name_filter(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.instance_name_filter
    }
    /// Appends an item to `instance_state_filter`.
    ///
    /// To override the contents of this collection use [`set_instance_state_filter`](Self::set_instance_state_filter).
    ///
    /// <p>The filter to ListInstances based on their state.</p>
    pub fn instance_state_filter(mut self, input: crate::types::InstanceState) -> Self {
        let mut v = self.instance_state_filter.unwrap_or_default();
        v.push(input);
        self.instance_state_filter = ::std::option::Option::Some(v);
        self
    }
    /// <p>The filter to ListInstances based on their state.</p>
    pub fn set_instance_state_filter(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::InstanceState>>) -> Self {
        self.instance_state_filter = input;
        self
    }
    /// <p>The filter to ListInstances based on their state.</p>
    pub fn get_instance_state_filter(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::InstanceState>> {
        &self.instance_state_filter
    }
    /// Consumes the builder and constructs a [`ListInstancesInput`](crate::operation::list_instances::ListInstancesInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::list_instances::ListInstancesInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::list_instances::ListInstancesInput {
            next_token: self.next_token,
            max_results: self.max_results,
            instance_name_filter: self.instance_name_filter,
            instance_state_filter: self.instance_state_filter,
        })
    }
}