aws_sdk_ec2/operation/describe_ipams/
_describe_ipams_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 DescribeIpamsInput {
6    /// <p>A check for 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>One or more filters for the request. For more information about filtering, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html">Filtering CLI output</a>.</p>
9    pub filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
10    /// <p>The maximum number of results to return in the request.</p>
11    pub max_results: ::std::option::Option<i32>,
12    /// <p>The token for the next page of results.</p>
13    pub next_token: ::std::option::Option<::std::string::String>,
14    /// <p>The IDs of the IPAMs you want information on.</p>
15    pub ipam_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16}
17impl DescribeIpamsInput {
18    /// <p>A check for 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>
19    pub fn dry_run(&self) -> ::std::option::Option<bool> {
20        self.dry_run
21    }
22    /// <p>One or more filters for the request. For more information about filtering, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html">Filtering CLI output</a>.</p>
23    ///
24    /// 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()`.
25    pub fn filters(&self) -> &[crate::types::Filter] {
26        self.filters.as_deref().unwrap_or_default()
27    }
28    /// <p>The maximum number of results to return in the request.</p>
29    pub fn max_results(&self) -> ::std::option::Option<i32> {
30        self.max_results
31    }
32    /// <p>The token for the next page of results.</p>
33    pub fn next_token(&self) -> ::std::option::Option<&str> {
34        self.next_token.as_deref()
35    }
36    /// <p>The IDs of the IPAMs you want information on.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.ipam_ids.is_none()`.
39    pub fn ipam_ids(&self) -> &[::std::string::String] {
40        self.ipam_ids.as_deref().unwrap_or_default()
41    }
42}
43impl DescribeIpamsInput {
44    /// Creates a new builder-style object to manufacture [`DescribeIpamsInput`](crate::operation::describe_ipams::DescribeIpamsInput).
45    pub fn builder() -> crate::operation::describe_ipams::builders::DescribeIpamsInputBuilder {
46        crate::operation::describe_ipams::builders::DescribeIpamsInputBuilder::default()
47    }
48}
49
50/// A builder for [`DescribeIpamsInput`](crate::operation::describe_ipams::DescribeIpamsInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct DescribeIpamsInputBuilder {
54    pub(crate) dry_run: ::std::option::Option<bool>,
55    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>,
56    pub(crate) max_results: ::std::option::Option<i32>,
57    pub(crate) next_token: ::std::option::Option<::std::string::String>,
58    pub(crate) ipam_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
59}
60impl DescribeIpamsInputBuilder {
61    /// <p>A check for 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>
62    pub fn dry_run(mut self, input: bool) -> Self {
63        self.dry_run = ::std::option::Option::Some(input);
64        self
65    }
66    /// <p>A check for 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>
67    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
68        self.dry_run = input;
69        self
70    }
71    /// <p>A check for 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>
72    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
73        &self.dry_run
74    }
75    /// Appends an item to `filters`.
76    ///
77    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
78    ///
79    /// <p>One or more filters for the request. For more information about filtering, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html">Filtering CLI output</a>.</p>
80    pub fn filters(mut self, input: crate::types::Filter) -> Self {
81        let mut v = self.filters.unwrap_or_default();
82        v.push(input);
83        self.filters = ::std::option::Option::Some(v);
84        self
85    }
86    /// <p>One or more filters for the request. For more information about filtering, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html">Filtering CLI output</a>.</p>
87    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Filter>>) -> Self {
88        self.filters = input;
89        self
90    }
91    /// <p>One or more filters for the request. For more information about filtering, see <a href="https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-filter.html">Filtering CLI output</a>.</p>
92    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Filter>> {
93        &self.filters
94    }
95    /// <p>The maximum number of results to return in the request.</p>
96    pub fn max_results(mut self, input: i32) -> Self {
97        self.max_results = ::std::option::Option::Some(input);
98        self
99    }
100    /// <p>The maximum number of results to return in the request.</p>
101    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
102        self.max_results = input;
103        self
104    }
105    /// <p>The maximum number of results to return in the request.</p>
106    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
107        &self.max_results
108    }
109    /// <p>The token for the next page of results.</p>
110    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.next_token = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The token for the next page of results.</p>
115    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.next_token = input;
117        self
118    }
119    /// <p>The token for the next page of results.</p>
120    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
121        &self.next_token
122    }
123    /// Appends an item to `ipam_ids`.
124    ///
125    /// To override the contents of this collection use [`set_ipam_ids`](Self::set_ipam_ids).
126    ///
127    /// <p>The IDs of the IPAMs you want information on.</p>
128    pub fn ipam_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        let mut v = self.ipam_ids.unwrap_or_default();
130        v.push(input.into());
131        self.ipam_ids = ::std::option::Option::Some(v);
132        self
133    }
134    /// <p>The IDs of the IPAMs you want information on.</p>
135    pub fn set_ipam_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
136        self.ipam_ids = input;
137        self
138    }
139    /// <p>The IDs of the IPAMs you want information on.</p>
140    pub fn get_ipam_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
141        &self.ipam_ids
142    }
143    /// Consumes the builder and constructs a [`DescribeIpamsInput`](crate::operation::describe_ipams::DescribeIpamsInput).
144    pub fn build(
145        self,
146    ) -> ::std::result::Result<crate::operation::describe_ipams::DescribeIpamsInput, ::aws_smithy_types::error::operation::BuildError> {
147        ::std::result::Result::Ok(crate::operation::describe_ipams::DescribeIpamsInput {
148            dry_run: self.dry_run,
149            filters: self.filters,
150            max_results: self.max_results,
151            next_token: self.next_token,
152            ipam_ids: self.ipam_ids,
153        })
154    }
155}