aws_sdk_ec2/operation/describe_hosts/
_describe_hosts_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 DescribeHostsInput {
6    /// <p>The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.</p>
7    pub host_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
8    /// <p>The token to use to retrieve the next page of results.</p>
9    pub next_token: ::std::option::Option<::std::string::String>,
10    /// <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
11    /// <p>You cannot specify this parameter and the host IDs parameter in the same request.</p>
12    pub max_results: ::std::option::Option<i32>,
13    /// <p>The filters.</p>
14    /// <ul>
15    /// <li>
16    /// <p><code>auto-placement</code> - Whether auto-placement is enabled or disabled (<code>on</code> | <code>off</code>).</p></li>
17    /// <li>
18    /// <p><code>availability-zone</code> - The Availability Zone of the host.</p></li>
19    /// <li>
20    /// <p><code>client-token</code> - The idempotency token that you provided when you allocated the host.</p></li>
21    /// <li>
22    /// <p><code>host-reservation-id</code> - The ID of the reservation assigned to this host.</p></li>
23    /// <li>
24    /// <p><code>instance-type</code> - The instance type size that the Dedicated Host is configured to support.</p></li>
25    /// <li>
26    /// <p><code>state</code> - The allocation state of the Dedicated Host (<code>available</code> | <code>under-assessment</code> | <code>permanent-failure</code> | <code>released</code> | <code>released-permanent-failure</code>).</p></li>
27    /// <li>
28    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
29    /// </ul>
30    pub filter: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
31}
32impl DescribeHostsInput {
33    /// <p>The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.</p>
34    ///
35    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.host_ids.is_none()`.
36    pub fn host_ids(&self) -> &[::std::string::String] {
37        self.host_ids.as_deref().unwrap_or_default()
38    }
39    /// <p>The token to use to retrieve the next page of results.</p>
40    pub fn next_token(&self) -> ::std::option::Option<&str> {
41        self.next_token.as_deref()
42    }
43    /// <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
44    /// <p>You cannot specify this parameter and the host IDs parameter in the same request.</p>
45    pub fn max_results(&self) -> ::std::option::Option<i32> {
46        self.max_results
47    }
48    /// <p>The filters.</p>
49    /// <ul>
50    /// <li>
51    /// <p><code>auto-placement</code> - Whether auto-placement is enabled or disabled (<code>on</code> | <code>off</code>).</p></li>
52    /// <li>
53    /// <p><code>availability-zone</code> - The Availability Zone of the host.</p></li>
54    /// <li>
55    /// <p><code>client-token</code> - The idempotency token that you provided when you allocated the host.</p></li>
56    /// <li>
57    /// <p><code>host-reservation-id</code> - The ID of the reservation assigned to this host.</p></li>
58    /// <li>
59    /// <p><code>instance-type</code> - The instance type size that the Dedicated Host is configured to support.</p></li>
60    /// <li>
61    /// <p><code>state</code> - The allocation state of the Dedicated Host (<code>available</code> | <code>under-assessment</code> | <code>permanent-failure</code> | <code>released</code> | <code>released-permanent-failure</code>).</p></li>
62    /// <li>
63    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</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 `.filter.is_none()`.
67    pub fn filter(&self) -> &[crate::types::Filter] {
68        self.filter.as_deref().unwrap_or_default()
69    }
70}
71impl DescribeHostsInput {
72    /// Creates a new builder-style object to manufacture [`DescribeHostsInput`](crate::operation::describe_hosts::DescribeHostsInput).
73    pub fn builder() -> crate::operation::describe_hosts::builders::DescribeHostsInputBuilder {
74        crate::operation::describe_hosts::builders::DescribeHostsInputBuilder::default()
75    }
76}
77
78/// A builder for [`DescribeHostsInput`](crate::operation::describe_hosts::DescribeHostsInput).
79#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
80#[non_exhaustive]
81pub struct DescribeHostsInputBuilder {
82    pub(crate) host_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
83    pub(crate) next_token: ::std::option::Option<::std::string::String>,
84    pub(crate) max_results: ::std::option::Option<i32>,
85    pub(crate) filter: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
86}
87impl DescribeHostsInputBuilder {
88    /// Appends an item to `host_ids`.
89    ///
90    /// To override the contents of this collection use [`set_host_ids`](Self::set_host_ids).
91    ///
92    /// <p>The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.</p>
93    pub fn host_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        let mut v = self.host_ids.unwrap_or_default();
95        v.push(input.into());
96        self.host_ids = ::std::option::Option::Some(v);
97        self
98    }
99    /// <p>The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.</p>
100    pub fn set_host_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
101        self.host_ids = input;
102        self
103    }
104    /// <p>The IDs of the Dedicated Hosts. The IDs are used for targeted instance launches.</p>
105    pub fn get_host_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
106        &self.host_ids
107    }
108    /// <p>The token to use to retrieve the next page of results.</p>
109    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.next_token = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The token to use to retrieve the next page of results.</p>
114    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.next_token = input;
116        self
117    }
118    /// <p>The token to use to retrieve the next page of results.</p>
119    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
120        &self.next_token
121    }
122    /// <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
123    /// <p>You cannot specify this parameter and the host IDs parameter in the same request.</p>
124    pub fn max_results(mut self, input: i32) -> Self {
125        self.max_results = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
129    /// <p>You cannot specify this parameter and the host IDs parameter in the same request.</p>
130    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
131        self.max_results = input;
132        self
133    }
134    /// <p>The maximum number of results to return for the request in a single page. The remaining results can be seen by sending another request with the returned <code>nextToken</code> value. This value can be between 5 and 500. If <code>maxResults</code> is given a larger value than 500, you receive an error.</p>
135    /// <p>You cannot specify this parameter and the host IDs parameter in the same request.</p>
136    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
137        &self.max_results
138    }
139    /// Appends an item to `filter`.
140    ///
141    /// To override the contents of this collection use [`set_filter`](Self::set_filter).
142    ///
143    /// <p>The filters.</p>
144    /// <ul>
145    /// <li>
146    /// <p><code>auto-placement</code> - Whether auto-placement is enabled or disabled (<code>on</code> | <code>off</code>).</p></li>
147    /// <li>
148    /// <p><code>availability-zone</code> - The Availability Zone of the host.</p></li>
149    /// <li>
150    /// <p><code>client-token</code> - The idempotency token that you provided when you allocated the host.</p></li>
151    /// <li>
152    /// <p><code>host-reservation-id</code> - The ID of the reservation assigned to this host.</p></li>
153    /// <li>
154    /// <p><code>instance-type</code> - The instance type size that the Dedicated Host is configured to support.</p></li>
155    /// <li>
156    /// <p><code>state</code> - The allocation state of the Dedicated Host (<code>available</code> | <code>under-assessment</code> | <code>permanent-failure</code> | <code>released</code> | <code>released-permanent-failure</code>).</p></li>
157    /// <li>
158    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
159    /// </ul>
160    pub fn filter(mut self, input: crate::types::Filter) -> Self {
161        let mut v = self.filter.unwrap_or_default();
162        v.push(input);
163        self.filter = ::std::option::Option::Some(v);
164        self
165    }
166    /// <p>The filters.</p>
167    /// <ul>
168    /// <li>
169    /// <p><code>auto-placement</code> - Whether auto-placement is enabled or disabled (<code>on</code> | <code>off</code>).</p></li>
170    /// <li>
171    /// <p><code>availability-zone</code> - The Availability Zone of the host.</p></li>
172    /// <li>
173    /// <p><code>client-token</code> - The idempotency token that you provided when you allocated the host.</p></li>
174    /// <li>
175    /// <p><code>host-reservation-id</code> - The ID of the reservation assigned to this host.</p></li>
176    /// <li>
177    /// <p><code>instance-type</code> - The instance type size that the Dedicated Host is configured to support.</p></li>
178    /// <li>
179    /// <p><code>state</code> - The allocation state of the Dedicated Host (<code>available</code> | <code>under-assessment</code> | <code>permanent-failure</code> | <code>released</code> | <code>released-permanent-failure</code>).</p></li>
180    /// <li>
181    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
182    /// </ul>
183    pub fn set_filter(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
184        self.filter = input;
185        self
186    }
187    /// <p>The filters.</p>
188    /// <ul>
189    /// <li>
190    /// <p><code>auto-placement</code> - Whether auto-placement is enabled or disabled (<code>on</code> | <code>off</code>).</p></li>
191    /// <li>
192    /// <p><code>availability-zone</code> - The Availability Zone of the host.</p></li>
193    /// <li>
194    /// <p><code>client-token</code> - The idempotency token that you provided when you allocated the host.</p></li>
195    /// <li>
196    /// <p><code>host-reservation-id</code> - The ID of the reservation assigned to this host.</p></li>
197    /// <li>
198    /// <p><code>instance-type</code> - The instance type size that the Dedicated Host is configured to support.</p></li>
199    /// <li>
200    /// <p><code>state</code> - The allocation state of the Dedicated Host (<code>available</code> | <code>under-assessment</code> | <code>permanent-failure</code> | <code>released</code> | <code>released-permanent-failure</code>).</p></li>
201    /// <li>
202    /// <p><code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p></li>
203    /// </ul>
204    pub fn get_filter(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
205        &self.filter
206    }
207    /// Consumes the builder and constructs a [`DescribeHostsInput`](crate::operation::describe_hosts::DescribeHostsInput).
208    pub fn build(
209        self,
210    ) -> ::std::result::Result<crate::operation::describe_hosts::DescribeHostsInput, ::aws_smithy_types::error::operation::BuildError> {
211        ::std::result::Result::Ok(crate::operation::describe_hosts::DescribeHostsInput {
212            host_ids: self.host_ids,
213            next_token: self.next_token,
214            max_results: self.max_results,
215            filter: self.filter,
216        })
217    }
218}