aws_sdk_kafka/operation/create_configuration/
_create_configuration_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 CreateConfigurationInput {
6    /// <p>The description of the configuration.</p>
7    pub description: ::std::option::Option<::std::string::String>,
8    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
9    pub kafka_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10    /// <p>The name of the configuration.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>Contents of the <filename>
13    /// server.properties
14    /// </filename> file. When using the API, you must ensure that the contents of the file are base64 encoded. When using the AWS Management Console, the SDK, or the AWS CLI, the contents of <filename>
15    /// server.properties
16    /// </filename> can be in plaintext.</p>
17    pub server_properties: ::std::option::Option<::aws_smithy_types::Blob>,
18}
19impl CreateConfigurationInput {
20    /// <p>The description of the configuration.</p>
21    pub fn description(&self) -> ::std::option::Option<&str> {
22        self.description.as_deref()
23    }
24    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
25    ///
26    /// 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()`.
27    pub fn kafka_versions(&self) -> &[::std::string::String] {
28        self.kafka_versions.as_deref().unwrap_or_default()
29    }
30    /// <p>The name of the configuration.</p>
31    pub fn name(&self) -> ::std::option::Option<&str> {
32        self.name.as_deref()
33    }
34    /// <p>Contents of the <filename>
35    /// server.properties
36    /// </filename> file. When using the API, you must ensure that the contents of the file are base64 encoded. When using the AWS Management Console, the SDK, or the AWS CLI, the contents of <filename>
37    /// server.properties
38    /// </filename> can be in plaintext.</p>
39    pub fn server_properties(&self) -> ::std::option::Option<&::aws_smithy_types::Blob> {
40        self.server_properties.as_ref()
41    }
42}
43impl CreateConfigurationInput {
44    /// Creates a new builder-style object to manufacture [`CreateConfigurationInput`](crate::operation::create_configuration::CreateConfigurationInput).
45    pub fn builder() -> crate::operation::create_configuration::builders::CreateConfigurationInputBuilder {
46        crate::operation::create_configuration::builders::CreateConfigurationInputBuilder::default()
47    }
48}
49
50/// A builder for [`CreateConfigurationInput`](crate::operation::create_configuration::CreateConfigurationInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct CreateConfigurationInputBuilder {
54    pub(crate) description: ::std::option::Option<::std::string::String>,
55    pub(crate) kafka_versions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
56    pub(crate) name: ::std::option::Option<::std::string::String>,
57    pub(crate) server_properties: ::std::option::Option<::aws_smithy_types::Blob>,
58}
59impl CreateConfigurationInputBuilder {
60    /// <p>The description of the configuration.</p>
61    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.description = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The description of the configuration.</p>
66    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.description = input;
68        self
69    }
70    /// <p>The description of the configuration.</p>
71    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
72        &self.description
73    }
74    /// Appends an item to `kafka_versions`.
75    ///
76    /// To override the contents of this collection use [`set_kafka_versions`](Self::set_kafka_versions).
77    ///
78    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
79    pub fn kafka_versions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80        let mut v = self.kafka_versions.unwrap_or_default();
81        v.push(input.into());
82        self.kafka_versions = ::std::option::Option::Some(v);
83        self
84    }
85    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
86    pub fn set_kafka_versions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
87        self.kafka_versions = input;
88        self
89    }
90    /// <p>The versions of Apache Kafka with which you can use this MSK configuration.</p>
91    pub fn get_kafka_versions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
92        &self.kafka_versions
93    }
94    /// <p>The name of the configuration.</p>
95    /// This field is required.
96    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.name = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The name of the configuration.</p>
101    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.name = input;
103        self
104    }
105    /// <p>The name of the configuration.</p>
106    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
107        &self.name
108    }
109    /// <p>Contents of the <filename>
110    /// server.properties
111    /// </filename> file. When using the API, you must ensure that the contents of the file are base64 encoded. When using the AWS Management Console, the SDK, or the AWS CLI, the contents of <filename>
112    /// server.properties
113    /// </filename> can be in plaintext.</p>
114    /// This field is required.
115    pub fn server_properties(mut self, input: ::aws_smithy_types::Blob) -> Self {
116        self.server_properties = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>Contents of the <filename>
120    /// server.properties
121    /// </filename> file. When using the API, you must ensure that the contents of the file are base64 encoded. When using the AWS Management Console, the SDK, or the AWS CLI, the contents of <filename>
122    /// server.properties
123    /// </filename> can be in plaintext.</p>
124    pub fn set_server_properties(mut self, input: ::std::option::Option<::aws_smithy_types::Blob>) -> Self {
125        self.server_properties = input;
126        self
127    }
128    /// <p>Contents of the <filename>
129    /// server.properties
130    /// </filename> file. When using the API, you must ensure that the contents of the file are base64 encoded. When using the AWS Management Console, the SDK, or the AWS CLI, the contents of <filename>
131    /// server.properties
132    /// </filename> can be in plaintext.</p>
133    pub fn get_server_properties(&self) -> &::std::option::Option<::aws_smithy_types::Blob> {
134        &self.server_properties
135    }
136    /// Consumes the builder and constructs a [`CreateConfigurationInput`](crate::operation::create_configuration::CreateConfigurationInput).
137    pub fn build(
138        self,
139    ) -> ::std::result::Result<crate::operation::create_configuration::CreateConfigurationInput, ::aws_smithy_types::error::operation::BuildError>
140    {
141        ::std::result::Result::Ok(crate::operation::create_configuration::CreateConfigurationInput {
142            description: self.description,
143            kafka_versions: self.kafka_versions,
144            name: self.name,
145            server_properties: self.server_properties,
146        })
147    }
148}