aws_sdk_ec2/operation/describe_fleets/_describe_fleets_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 DescribeFleetsInput {
6 /// <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>
7 pub dry_run: ::std::option::Option<bool>,
8 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
9 pub max_results: ::std::option::Option<i32>,
10 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
11 pub next_token: ::std::option::Option<::std::string::String>,
12 /// <p>The IDs of the EC2 Fleets.</p><note>
13 /// <p>If a fleet is of type <code>instant</code>, you must specify the fleet ID, otherwise it does not appear in the response.</p>
14 /// </note>
15 pub fleet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16 /// <p>The filters.</p>
17 /// <ul>
18 /// <li>
19 /// <p><code>activity-status</code> - The progress of the EC2 Fleet ( <code>error</code> | <code>pending-fulfillment</code> | <code>pending-termination</code> | <code>fulfilled</code>).</p></li>
20 /// <li>
21 /// <p><code>excess-capacity-termination-policy</code> - Indicates whether to terminate running instances if the target capacity is decreased below the current EC2 Fleet size (<code>true</code> | <code>false</code>).</p></li>
22 /// <li>
23 /// <p><code>fleet-state</code> - The state of the EC2 Fleet (<code>submitted</code> | <code>active</code> | <code>deleted</code> | <code>failed</code> | <code>deleted-running</code> | <code>deleted-terminating</code> | <code>modifying</code>).</p></li>
24 /// <li>
25 /// <p><code>replace-unhealthy-instances</code> - Indicates whether EC2 Fleet should replace unhealthy instances (<code>true</code> | <code>false</code>).</p></li>
26 /// <li>
27 /// <p><code>type</code> - The type of request (<code>instant</code> | <code>request</code> | <code>maintain</code>).</p></li>
28 /// </ul>
29 pub filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
30}
31impl DescribeFleetsInput {
32 /// <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>
33 pub fn dry_run(&self) -> ::std::option::Option<bool> {
34 self.dry_run
35 }
36 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
37 pub fn max_results(&self) -> ::std::option::Option<i32> {
38 self.max_results
39 }
40 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
41 pub fn next_token(&self) -> ::std::option::Option<&str> {
42 self.next_token.as_deref()
43 }
44 /// <p>The IDs of the EC2 Fleets.</p><note>
45 /// <p>If a fleet is of type <code>instant</code>, you must specify the fleet ID, otherwise it does not appear in the response.</p>
46 /// </note>
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 `.fleet_ids.is_none()`.
49 pub fn fleet_ids(&self) -> &[::std::string::String] {
50 self.fleet_ids.as_deref().unwrap_or_default()
51 }
52 /// <p>The filters.</p>
53 /// <ul>
54 /// <li>
55 /// <p><code>activity-status</code> - The progress of the EC2 Fleet ( <code>error</code> | <code>pending-fulfillment</code> | <code>pending-termination</code> | <code>fulfilled</code>).</p></li>
56 /// <li>
57 /// <p><code>excess-capacity-termination-policy</code> - Indicates whether to terminate running instances if the target capacity is decreased below the current EC2 Fleet size (<code>true</code> | <code>false</code>).</p></li>
58 /// <li>
59 /// <p><code>fleet-state</code> - The state of the EC2 Fleet (<code>submitted</code> | <code>active</code> | <code>deleted</code> | <code>failed</code> | <code>deleted-running</code> | <code>deleted-terminating</code> | <code>modifying</code>).</p></li>
60 /// <li>
61 /// <p><code>replace-unhealthy-instances</code> - Indicates whether EC2 Fleet should replace unhealthy instances (<code>true</code> | <code>false</code>).</p></li>
62 /// <li>
63 /// <p><code>type</code> - The type of request (<code>instant</code> | <code>request</code> | <code>maintain</code>).</p></li>
64 /// </ul>
65 ///
66 /// 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()`.
67 pub fn filters(&self) -> &[crate::types::Filter] {
68 self.filters.as_deref().unwrap_or_default()
69 }
70}
71impl DescribeFleetsInput {
72 /// Creates a new builder-style object to manufacture [`DescribeFleetsInput`](crate::operation::describe_fleets::DescribeFleetsInput).
73 pub fn builder() -> crate::operation::describe_fleets::builders::DescribeFleetsInputBuilder {
74 crate::operation::describe_fleets::builders::DescribeFleetsInputBuilder::default()
75 }
76}
77
78/// A builder for [`DescribeFleetsInput`](crate::operation::describe_fleets::DescribeFleetsInput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
80#[non_exhaustive]
81pub struct DescribeFleetsInputBuilder {
82 pub(crate) dry_run: ::std::option::Option<bool>,
83 pub(crate) max_results: ::std::option::Option<i32>,
84 pub(crate) next_token: ::std::option::Option<::std::string::String>,
85 pub(crate) fleet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
86 pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
87}
88impl DescribeFleetsInputBuilder {
89 /// <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>
90 pub fn dry_run(mut self, input: bool) -> Self {
91 self.dry_run = ::std::option::Option::Some(input);
92 self
93 }
94 /// <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>
95 pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
96 self.dry_run = input;
97 self
98 }
99 /// <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>
100 pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
101 &self.dry_run
102 }
103 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
104 pub fn max_results(mut self, input: i32) -> Self {
105 self.max_results = ::std::option::Option::Some(input);
106 self
107 }
108 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
109 pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
110 self.max_results = input;
111 self
112 }
113 /// <p>The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination">Pagination</a>.</p>
114 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
115 &self.max_results
116 }
117 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
118 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119 self.next_token = ::std::option::Option::Some(input.into());
120 self
121 }
122 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
123 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124 self.next_token = input;
125 self
126 }
127 /// <p>The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.</p>
128 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
129 &self.next_token
130 }
131 /// Appends an item to `fleet_ids`.
132 ///
133 /// To override the contents of this collection use [`set_fleet_ids`](Self::set_fleet_ids).
134 ///
135 /// <p>The IDs of the EC2 Fleets.</p><note>
136 /// <p>If a fleet is of type <code>instant</code>, you must specify the fleet ID, otherwise it does not appear in the response.</p>
137 /// </note>
138 pub fn fleet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139 let mut v = self.fleet_ids.unwrap_or_default();
140 v.push(input.into());
141 self.fleet_ids = ::std::option::Option::Some(v);
142 self
143 }
144 /// <p>The IDs of the EC2 Fleets.</p><note>
145 /// <p>If a fleet is of type <code>instant</code>, you must specify the fleet ID, otherwise it does not appear in the response.</p>
146 /// </note>
147 pub fn set_fleet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
148 self.fleet_ids = input;
149 self
150 }
151 /// <p>The IDs of the EC2 Fleets.</p><note>
152 /// <p>If a fleet is of type <code>instant</code>, you must specify the fleet ID, otherwise it does not appear in the response.</p>
153 /// </note>
154 pub fn get_fleet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
155 &self.fleet_ids
156 }
157 /// Appends an item to `filters`.
158 ///
159 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
160 ///
161 /// <p>The filters.</p>
162 /// <ul>
163 /// <li>
164 /// <p><code>activity-status</code> - The progress of the EC2 Fleet ( <code>error</code> | <code>pending-fulfillment</code> | <code>pending-termination</code> | <code>fulfilled</code>).</p></li>
165 /// <li>
166 /// <p><code>excess-capacity-termination-policy</code> - Indicates whether to terminate running instances if the target capacity is decreased below the current EC2 Fleet size (<code>true</code> | <code>false</code>).</p></li>
167 /// <li>
168 /// <p><code>fleet-state</code> - The state of the EC2 Fleet (<code>submitted</code> | <code>active</code> | <code>deleted</code> | <code>failed</code> | <code>deleted-running</code> | <code>deleted-terminating</code> | <code>modifying</code>).</p></li>
169 /// <li>
170 /// <p><code>replace-unhealthy-instances</code> - Indicates whether EC2 Fleet should replace unhealthy instances (<code>true</code> | <code>false</code>).</p></li>
171 /// <li>
172 /// <p><code>type</code> - The type of request (<code>instant</code> | <code>request</code> | <code>maintain</code>).</p></li>
173 /// </ul>
174 pub fn filters(mut self, input: crate::types::Filter) -> Self {
175 let mut v = self.filters.unwrap_or_default();
176 v.push(input);
177 self.filters = ::std::option::Option::Some(v);
178 self
179 }
180 /// <p>The filters.</p>
181 /// <ul>
182 /// <li>
183 /// <p><code>activity-status</code> - The progress of the EC2 Fleet ( <code>error</code> | <code>pending-fulfillment</code> | <code>pending-termination</code> | <code>fulfilled</code>).</p></li>
184 /// <li>
185 /// <p><code>excess-capacity-termination-policy</code> - Indicates whether to terminate running instances if the target capacity is decreased below the current EC2 Fleet size (<code>true</code> | <code>false</code>).</p></li>
186 /// <li>
187 /// <p><code>fleet-state</code> - The state of the EC2 Fleet (<code>submitted</code> | <code>active</code> | <code>deleted</code> | <code>failed</code> | <code>deleted-running</code> | <code>deleted-terminating</code> | <code>modifying</code>).</p></li>
188 /// <li>
189 /// <p><code>replace-unhealthy-instances</code> - Indicates whether EC2 Fleet should replace unhealthy instances (<code>true</code> | <code>false</code>).</p></li>
190 /// <li>
191 /// <p><code>type</code> - The type of request (<code>instant</code> | <code>request</code> | <code>maintain</code>).</p></li>
192 /// </ul>
193 pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
194 self.filters = input;
195 self
196 }
197 /// <p>The filters.</p>
198 /// <ul>
199 /// <li>
200 /// <p><code>activity-status</code> - The progress of the EC2 Fleet ( <code>error</code> | <code>pending-fulfillment</code> | <code>pending-termination</code> | <code>fulfilled</code>).</p></li>
201 /// <li>
202 /// <p><code>excess-capacity-termination-policy</code> - Indicates whether to terminate running instances if the target capacity is decreased below the current EC2 Fleet size (<code>true</code> | <code>false</code>).</p></li>
203 /// <li>
204 /// <p><code>fleet-state</code> - The state of the EC2 Fleet (<code>submitted</code> | <code>active</code> | <code>deleted</code> | <code>failed</code> | <code>deleted-running</code> | <code>deleted-terminating</code> | <code>modifying</code>).</p></li>
205 /// <li>
206 /// <p><code>replace-unhealthy-instances</code> - Indicates whether EC2 Fleet should replace unhealthy instances (<code>true</code> | <code>false</code>).</p></li>
207 /// <li>
208 /// <p><code>type</code> - The type of request (<code>instant</code> | <code>request</code> | <code>maintain</code>).</p></li>
209 /// </ul>
210 pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
211 &self.filters
212 }
213 /// Consumes the builder and constructs a [`DescribeFleetsInput`](crate::operation::describe_fleets::DescribeFleetsInput).
214 pub fn build(
215 self,
216 ) -> ::std::result::Result<crate::operation::describe_fleets::DescribeFleetsInput, ::aws_smithy_types::error::operation::BuildError> {
217 ::std::result::Result::Ok(crate::operation::describe_fleets::DescribeFleetsInput {
218 dry_run: self.dry_run,
219 max_results: self.max_results,
220 next_token: self.next_token,
221 fleet_ids: self.fleet_ids,
222 filters: self.filters,
223 })
224 }
225}