aws_sdk_ec2/operation/describe_regions/_describe_regions_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeRegionsInput {
6 /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</p>
7 pub region_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8 /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
9 pub all_regions: ::std::option::Option<bool>,
10 /// <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>
11 pub dry_run: ::std::option::Option<bool>,
12 /// <p>The filters.</p>
13 /// <ul>
14 /// <li>
15 /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
16 /// <li>
17 /// <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>
18 /// <li>
19 /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
20 /// </ul>
21 pub filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
22}
23impl DescribeRegionsInput {
24 /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</p>
25 ///
26 /// 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()`.
27 pub fn region_names(&self) -> &[::std::string::String] {
28 self.region_names.as_deref().unwrap_or_default()
29 }
30 /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
31 pub fn all_regions(&self) -> ::std::option::Option<bool> {
32 self.all_regions
33 }
34 /// <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>
35 pub fn dry_run(&self) -> ::std::option::Option<bool> {
36 self.dry_run
37 }
38 /// <p>The filters.</p>
39 /// <ul>
40 /// <li>
41 /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
42 /// <li>
43 /// <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>
44 /// <li>
45 /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
46 /// </ul>
47 ///
48 /// 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()`.
49 pub fn filters(&self) -> &[crate::types::Filter] {
50 self.filters.as_deref().unwrap_or_default()
51 }
52}
53impl DescribeRegionsInput {
54 /// Creates a new builder-style object to manufacture [`DescribeRegionsInput`](crate::operation::describe_regions::DescribeRegionsInput).
55 pub fn builder() -> crate::operation::describe_regions::builders::DescribeRegionsInputBuilder {
56 crate::operation::describe_regions::builders::DescribeRegionsInputBuilder::default()
57 }
58}
59
60/// A builder for [`DescribeRegionsInput`](crate::operation::describe_regions::DescribeRegionsInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct DescribeRegionsInputBuilder {
64 pub(crate) region_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
65 pub(crate) all_regions: ::std::option::Option<bool>,
66 pub(crate) dry_run: ::std::option::Option<bool>,
67 pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
68}
69impl DescribeRegionsInputBuilder {
70 /// Appends an item to `region_names`.
71 ///
72 /// To override the contents of this collection use [`set_region_names`](Self::set_region_names).
73 ///
74 /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</p>
75 pub fn region_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 let mut v = self.region_names.unwrap_or_default();
77 v.push(input.into());
78 self.region_names = ::std::option::Option::Some(v);
79 self
80 }
81 /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</p>
82 pub fn set_region_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
83 self.region_names = input;
84 self
85 }
86 /// <p>The names of the Regions. You can specify any Regions, whether they are enabled and disabled for your account.</p>
87 pub fn get_region_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
88 &self.region_names
89 }
90 /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
91 pub fn all_regions(mut self, input: bool) -> Self {
92 self.all_regions = ::std::option::Option::Some(input);
93 self
94 }
95 /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
96 pub fn set_all_regions(mut self, input: ::std::option::Option<bool>) -> Self {
97 self.all_regions = input;
98 self
99 }
100 /// <p>Indicates whether to display all Regions, including Regions that are disabled for your account.</p>
101 pub fn get_all_regions(&self) -> &::std::option::Option<bool> {
102 &self.all_regions
103 }
104 /// <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>
105 pub fn dry_run(mut self, input: bool) -> Self {
106 self.dry_run = ::std::option::Option::Some(input);
107 self
108 }
109 /// <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>
110 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
111 self.dry_run = input;
112 self
113 }
114 /// <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>
115 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
116 &self.dry_run
117 }
118 /// Appends an item to `filters`.
119 ///
120 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
121 ///
122 /// <p>The filters.</p>
123 /// <ul>
124 /// <li>
125 /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
126 /// <li>
127 /// <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>
128 /// <li>
129 /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
130 /// </ul>
131 pub fn filters(mut self, input: crate::types::Filter) -> Self {
132 let mut v = self.filters.unwrap_or_default();
133 v.push(input);
134 self.filters = ::std::option::Option::Some(v);
135 self
136 }
137 /// <p>The filters.</p>
138 /// <ul>
139 /// <li>
140 /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
141 /// <li>
142 /// <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>
143 /// <li>
144 /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
145 /// </ul>
146 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
147 self.filters = input;
148 self
149 }
150 /// <p>The filters.</p>
151 /// <ul>
152 /// <li>
153 /// <p><code>endpoint</code> - The endpoint of the Region (for example, <code>ec2.us-east-1.amazonaws.com</code>).</p></li>
154 /// <li>
155 /// <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>
156 /// <li>
157 /// <p><code>region-name</code> - The name of the Region (for example, <code>us-east-1</code>).</p></li>
158 /// </ul>
159 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
160 &self.filters
161 }
162 /// Consumes the builder and constructs a [`DescribeRegionsInput`](crate::operation::describe_regions::DescribeRegionsInput).
163 pub fn build(
164 self,
165 ) -> ::std::result::Result<crate::operation::describe_regions::DescribeRegionsInput, ::aws_smithy_types::error::operation::BuildError> {
166 ::std::result::Result::Ok(crate::operation::describe_regions::DescribeRegionsInput {
167 region_names: self.region_names,
168 all_regions: self.all_regions,
169 dry_run: self.dry_run,
170 filters: self.filters,
171 })
172 }
173}