aws_sdk_cloudhsmv2/operation/describe_clusters/_describe_clusters_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 DescribeClustersInput {
6 /// <p>One or more filters to limit the items returned in the response.</p>
7 /// <p>Use the <code>clusterIds</code> filter to return only the specified clusters. Specify clusters by their cluster identifier (ID).</p>
8 /// <p>Use the <code>vpcIds</code> filter to return only the clusters in the specified virtual private clouds (VPCs). Specify VPCs by their VPC identifier (ID).</p>
9 /// <p>Use the <code>states</code> filter to return only clusters that match the specified state.</p>
10 pub filters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
11 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more clusters.</p>
12 pub next_token: ::std::option::Option<::std::string::String>,
13 /// <p>The maximum number of clusters to return in the response. When there are more clusters than the number you specify, the response contains a <code>NextToken</code> value.</p>
14 pub max_results: ::std::option::Option<i32>,
15}
16impl DescribeClustersInput {
17 /// <p>One or more filters to limit the items returned in the response.</p>
18 /// <p>Use the <code>clusterIds</code> filter to return only the specified clusters. Specify clusters by their cluster identifier (ID).</p>
19 /// <p>Use the <code>vpcIds</code> filter to return only the clusters in the specified virtual private clouds (VPCs). Specify VPCs by their VPC identifier (ID).</p>
20 /// <p>Use the <code>states</code> filter to return only clusters that match the specified state.</p>
21 pub fn filters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
22 self.filters.as_ref()
23 }
24 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more clusters.</p>
25 pub fn next_token(&self) -> ::std::option::Option<&str> {
26 self.next_token.as_deref()
27 }
28 /// <p>The maximum number of clusters to return in the response. When there are more clusters than the number you specify, the response contains a <code>NextToken</code> value.</p>
29 pub fn max_results(&self) -> ::std::option::Option<i32> {
30 self.max_results
31 }
32}
33impl DescribeClustersInput {
34 /// Creates a new builder-style object to manufacture [`DescribeClustersInput`](crate::operation::describe_clusters::DescribeClustersInput).
35 pub fn builder() -> crate::operation::describe_clusters::builders::DescribeClustersInputBuilder {
36 crate::operation::describe_clusters::builders::DescribeClustersInputBuilder::default()
37 }
38}
39
40/// A builder for [`DescribeClustersInput`](crate::operation::describe_clusters::DescribeClustersInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct DescribeClustersInputBuilder {
44 pub(crate) filters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
45 pub(crate) next_token: ::std::option::Option<::std::string::String>,
46 pub(crate) max_results: ::std::option::Option<i32>,
47}
48impl DescribeClustersInputBuilder {
49 /// Adds a key-value pair to `filters`.
50 ///
51 /// To override the contents of this collection use [`set_filters`](Self::set_filters).
52 ///
53 /// <p>One or more filters to limit the items returned in the response.</p>
54 /// <p>Use the <code>clusterIds</code> filter to return only the specified clusters. Specify clusters by their cluster identifier (ID).</p>
55 /// <p>Use the <code>vpcIds</code> filter to return only the clusters in the specified virtual private clouds (VPCs). Specify VPCs by their VPC identifier (ID).</p>
56 /// <p>Use the <code>states</code> filter to return only clusters that match the specified state.</p>
57 pub fn filters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::vec::Vec<::std::string::String>) -> Self {
58 let mut hash_map = self.filters.unwrap_or_default();
59 hash_map.insert(k.into(), v);
60 self.filters = ::std::option::Option::Some(hash_map);
61 self
62 }
63 /// <p>One or more filters to limit the items returned in the response.</p>
64 /// <p>Use the <code>clusterIds</code> filter to return only the specified clusters. Specify clusters by their cluster identifier (ID).</p>
65 /// <p>Use the <code>vpcIds</code> filter to return only the clusters in the specified virtual private clouds (VPCs). Specify VPCs by their VPC identifier (ID).</p>
66 /// <p>Use the <code>states</code> filter to return only clusters that match the specified state.</p>
67 pub fn set_filters(
68 mut self,
69 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>>,
70 ) -> Self {
71 self.filters = input;
72 self
73 }
74 /// <p>One or more filters to limit the items returned in the response.</p>
75 /// <p>Use the <code>clusterIds</code> filter to return only the specified clusters. Specify clusters by their cluster identifier (ID).</p>
76 /// <p>Use the <code>vpcIds</code> filter to return only the clusters in the specified virtual private clouds (VPCs). Specify VPCs by their VPC identifier (ID).</p>
77 /// <p>Use the <code>states</code> filter to return only clusters that match the specified state.</p>
78 pub fn get_filters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::vec::Vec<::std::string::String>>> {
79 &self.filters
80 }
81 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more clusters.</p>
82 pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83 self.next_token = ::std::option::Option::Some(input.into());
84 self
85 }
86 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more clusters.</p>
87 pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88 self.next_token = input;
89 self
90 }
91 /// <p>The <code>NextToken</code> value that you received in the previous response. Use this value to get more clusters.</p>
92 pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
93 &self.next_token
94 }
95 /// <p>The maximum number of clusters to return in the response. When there are more clusters than the number you specify, the response contains a <code>NextToken</code> value.</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 clusters to return in the response. When there are more clusters than the number you specify, the response contains a <code>NextToken</code> value.</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 clusters to return in the response. When there are more clusters than the number you specify, the response contains a <code>NextToken</code> value.</p>
106 pub fn get_max_results(&self) -> &::std::option::Option<i32> {
107 &self.max_results
108 }
109 /// Consumes the builder and constructs a [`DescribeClustersInput`](crate::operation::describe_clusters::DescribeClustersInput).
110 pub fn build(
111 self,
112 ) -> ::std::result::Result<crate::operation::describe_clusters::DescribeClustersInput, ::aws_smithy_types::error::operation::BuildError> {
113 ::std::result::Result::Ok(crate::operation::describe_clusters::DescribeClustersInput {
114 filters: self.filters,
115 next_token: self.next_token,
116 max_results: self.max_results,
117 })
118 }
119}