aws-sdk-ec2 1.218.0

AWS SDK for Amazon Elastic Compute Cloud
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 DescribeRegionsInput {
    /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</p>
    pub region_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
    pub all_regions: ::std::option::Option<bool>,
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub dry_run: ::std::option::Option<bool>,
    /// <p>The filters.</p>
    /// <ul>
    /// <li>
    /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
    /// <li>
    /// <p><code>opt-in-status</code> - The opt-in status of the Region (<code>opt-in-not-required</code> | <code>opted-in</code> | <code>not-opted-in</code>).</p></li>
    /// <li>
    /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
    /// </ul>
    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
}
impl DescribeRegionsInput {
    /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</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 `.region_names.is_none()`.
    pub fn region_names(&self) -> &[::std::string::String] {
        self.region_names.as_deref().unwrap_or_default()
    }
    /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
    pub fn all_regions(&self) -> ::std::option::Option<bool> {
        self.all_regions
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn dry_run(&self) -> ::std::option::Option<bool> {
        self.dry_run
    }
    /// <p>The filters.</p>
    /// <ul>
    /// <li>
    /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
    /// <li>
    /// <p><code>opt-in-status</code> - The opt-in status of the Region (<code>opt-in-not-required</code> | <code>opted-in</code> | <code>not-opted-in</code>).</p></li>
    /// <li>
    /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
    /// </ul>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.filters.is_none()`.
    pub fn filters(&self) -> &[crate::types::Filter] {
        self.filters.as_deref().unwrap_or_default()
    }
}
impl DescribeRegionsInput {
    /// Creates a new builder-style object to manufacture [`DescribeRegionsInput`](crate::operation::describe_regions::DescribeRegionsInput).
    pub fn builder() -> crate::operation::describe_regions::builders::DescribeRegionsInputBuilder {
        crate::operation::describe_regions::builders::DescribeRegionsInputBuilder::default()
    }
}

/// A builder for [`DescribeRegionsInput`](crate::operation::describe_regions::DescribeRegionsInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct DescribeRegionsInputBuilder {
    pub(crate) region_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) all_regions: ::std::option::Option<bool>,
    pub(crate) dry_run: ::std::option::Option<bool>,
    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
}
impl DescribeRegionsInputBuilder {
    /// Appends an item to `region_names`.
    ///
    /// To override the contents of this collection use [`set_region_names`](Self::set_region_names).
    ///
    /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</p>
    pub fn region_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.region_names.unwrap_or_default();
        v.push(input.into());
        self.region_names = ::std::option::Option::Some(v);
        self
    }
    /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</p>
    pub fn set_region_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.region_names = input;
        self
    }
    /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</p>
    pub fn get_region_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.region_names
    }
    /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
    pub fn all_regions(mut self, input: bool) -> Self {
        self.all_regions = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
    pub fn set_all_regions(mut self, input: ::std::option::Option<bool>) -> Self {
        self.all_regions = input;
        self
    }
    /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
    pub fn get_all_regions(&self) -> &::std::option::Option<bool> {
        &self.all_regions
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn dry_run(mut self, input: bool) -> Self {
        self.dry_run = ::std::option::Option::Some(input);
        self
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
        self.dry_run = input;
        self
    }
    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
        &self.dry_run
    }
    /// Appends an item to `filters`.
    ///
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
    ///
    /// <p>The filters.</p>
    /// <ul>
    /// <li>
    /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
    /// <li>
    /// <p><code>opt-in-status</code> - The opt-in status of the Region (<code>opt-in-not-required</code> | <code>opted-in</code> | <code>not-opted-in</code>).</p></li>
    /// <li>
    /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
    /// </ul>
    pub fn filters(mut self, input: crate::types::Filter) -> Self {
        let mut v = self.filters.unwrap_or_default();
        v.push(input);
        self.filters = ::std::option::Option::Some(v);
        self
    }
    /// <p>The filters.</p>
    /// <ul>
    /// <li>
    /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
    /// <li>
    /// <p><code>opt-in-status</code> - The opt-in status of the Region (<code>opt-in-not-required</code> | <code>opted-in</code> | <code>not-opted-in</code>).</p></li>
    /// <li>
    /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
    /// </ul>
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
        self.filters = input;
        self
    }
    /// <p>The filters.</p>
    /// <ul>
    /// <li>
    /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
    /// <li>
    /// <p><code>opt-in-status</code> - The opt-in status of the Region (<code>opt-in-not-required</code> | <code>opted-in</code> | <code>not-opted-in</code>).</p></li>
    /// <li>
    /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
    /// </ul>
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
        &self.filters
    }
    /// Consumes the builder and constructs a [`DescribeRegionsInput`](crate::operation::describe_regions::DescribeRegionsInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::describe_regions::DescribeRegionsInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::describe_regions::DescribeRegionsInput {
            region_names: self.region_names,
            all_regions: self.all_regions,
            dry_run: self.dry_run,
            filters: self.filters,
        })
    }
}