aws_sdk_kafka/operation/describe_configuration/
_describe_configuration_output.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 DescribeConfigurationOutput {
6    /// <p>The Amazon Resource Name (ARN) of the configuration.</p>
7    pub arn: ::std::option::Option<::std::string::String>,
8    /// <p>The time when the configuration was created.</p>
9    pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
10    /// <p>The description of the configuration.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
13    pub kafka_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14    /// <p>Latest revision of the configuration.</p>
15    pub latest_revision: ::std::option::Option<crate::types::ConfigurationRevision>,
16    /// <p>The name of the configuration.</p>
17    pub name: ::std::option::Option<::std::string::String>,
18    /// <p>The state of the configuration. The possible states are ACTIVE, DELETING, and DELETE_FAILED.</p>
19    pub state: ::std::option::Option<crate::types::ConfigurationState>,
20    _request_id: Option<String>,
21}
22impl DescribeConfigurationOutput {
23    /// <p>The Amazon Resource Name (ARN) of the configuration.</p>
24    pub fn arn(&self) -> ::std::option::Option<&str> {
25        self.arn.as_deref()
26    }
27    /// <p>The time when the configuration was created.</p>
28    pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
29        self.creation_time.as_ref()
30    }
31    /// <p>The description of the configuration.</p>
32    pub fn description(&self) -> ::std::option::Option<&str> {
33        self.description.as_deref()
34    }
35    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
36    ///
37    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.kafka_versions.is_none()`.
38    pub fn kafka_versions(&self) -> &[::std::string::String] {
39        self.kafka_versions.as_deref().unwrap_or_default()
40    }
41    /// <p>Latest revision of the configuration.</p>
42    pub fn latest_revision(&self) -> ::std::option::Option<&crate::types::ConfigurationRevision> {
43        self.latest_revision.as_ref()
44    }
45    /// <p>The name of the configuration.</p>
46    pub fn name(&self) -> ::std::option::Option<&str> {
47        self.name.as_deref()
48    }
49    /// <p>The state of the configuration. The possible states are ACTIVE, DELETING, and DELETE_FAILED.</p>
50    pub fn state(&self) -> ::std::option::Option<&crate::types::ConfigurationState> {
51        self.state.as_ref()
52    }
53}
54impl ::aws_types::request_id::RequestId for DescribeConfigurationOutput {
55    fn request_id(&self) -> Option<&str> {
56        self._request_id.as_deref()
57    }
58}
59impl DescribeConfigurationOutput {
60    /// Creates a new builder-style object to manufacture [`DescribeConfigurationOutput`](crate::operation::describe_configuration::DescribeConfigurationOutput).
61    pub fn builder() -> crate::operation::describe_configuration::builders::DescribeConfigurationOutputBuilder {
62        crate::operation::describe_configuration::builders::DescribeConfigurationOutputBuilder::default()
63    }
64}
65
66/// A builder for [`DescribeConfigurationOutput`](crate::operation::describe_configuration::DescribeConfigurationOutput).
67#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct DescribeConfigurationOutputBuilder {
70    pub(crate) arn: ::std::option::Option<::std::string::String>,
71    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
72    pub(crate) description: ::std::option::Option<::std::string::String>,
73    pub(crate) kafka_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
74    pub(crate) latest_revision: ::std::option::Option<crate::types::ConfigurationRevision>,
75    pub(crate) name: ::std::option::Option<::std::string::String>,
76    pub(crate) state: ::std::option::Option<crate::types::ConfigurationState>,
77    _request_id: Option<String>,
78}
79impl DescribeConfigurationOutputBuilder {
80    /// <p>The Amazon Resource Name (ARN) of the configuration.</p>
81    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.arn = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The Amazon Resource Name (ARN) of the configuration.</p>
86    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.arn = input;
88        self
89    }
90    /// <p>The Amazon Resource Name (ARN) of the configuration.</p>
91    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
92        &self.arn
93    }
94    /// <p>The time when the configuration was created.</p>
95    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
96        self.creation_time = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>The time when the configuration was created.</p>
100    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
101        self.creation_time = input;
102        self
103    }
104    /// <p>The time when the configuration was created.</p>
105    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
106        &self.creation_time
107    }
108    /// <p>The description of the configuration.</p>
109    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110        self.description = ::std::option::Option::Some(input.into());
111        self
112    }
113    /// <p>The description of the configuration.</p>
114    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115        self.description = input;
116        self
117    }
118    /// <p>The description of the configuration.</p>
119    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
120        &self.description
121    }
122    /// Appends an item to `kafka_versions`.
123    ///
124    /// To override the contents of this collection use [`set_kafka_versions`](Self::set_kafka_versions).
125    ///
126    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
127    pub fn kafka_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        let mut v = self.kafka_versions.unwrap_or_default();
129        v.push(input.into());
130        self.kafka_versions = ::std::option::Option::Some(v);
131        self
132    }
133    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
134    pub fn set_kafka_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
135        self.kafka_versions = input;
136        self
137    }
138    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
139    pub fn get_kafka_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
140        &self.kafka_versions
141    }
142    /// <p>Latest revision of the configuration.</p>
143    pub fn latest_revision(mut self, input: crate::types::ConfigurationRevision) -> Self {
144        self.latest_revision = ::std::option::Option::Some(input);
145        self
146    }
147    /// <p>Latest revision of the configuration.</p>
148    pub fn set_latest_revision(mut self, input: ::std::option::Option<crate::types::ConfigurationRevision>) -> Self {
149        self.latest_revision = input;
150        self
151    }
152    /// <p>Latest revision of the configuration.</p>
153    pub fn get_latest_revision(&self) -> &::std::option::Option<crate::types::ConfigurationRevision> {
154        &self.latest_revision
155    }
156    /// <p>The name of the configuration.</p>
157    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.name = ::std::option::Option::Some(input.into());
159        self
160    }
161    /// <p>The name of the configuration.</p>
162    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.name = input;
164        self
165    }
166    /// <p>The name of the configuration.</p>
167    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
168        &self.name
169    }
170    /// <p>The state of the configuration. The possible states are ACTIVE, DELETING, and DELETE_FAILED.</p>
171    pub fn state(mut self, input: crate::types::ConfigurationState) -> Self {
172        self.state = ::std::option::Option::Some(input);
173        self
174    }
175    /// <p>The state of the configuration. The possible states are ACTIVE, DELETING, and DELETE_FAILED.</p>
176    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ConfigurationState>) -> Self {
177        self.state = input;
178        self
179    }
180    /// <p>The state of the configuration. The possible states are ACTIVE, DELETING, and DELETE_FAILED.</p>
181    pub fn get_state(&self) -> &::std::option::Option<crate::types::ConfigurationState> {
182        &self.state
183    }
184    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
185        self._request_id = Some(request_id.into());
186        self
187    }
188
189    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
190        self._request_id = request_id;
191        self
192    }
193    /// Consumes the builder and constructs a [`DescribeConfigurationOutput`](crate::operation::describe_configuration::DescribeConfigurationOutput).
194    pub fn build(self) -> crate::operation::describe_configuration::DescribeConfigurationOutput {
195        crate::operation::describe_configuration::DescribeConfigurationOutput {
196            arn: self.arn,
197            creation_time: self.creation_time,
198            description: self.description,
199            kafka_versions: self.kafka_versions,
200            latest_revision: self.latest_revision,
201            name: self.name,
202            state: self.state,
203            _request_id: self._request_id,
204        }
205    }
206}