aws_sdk_mq/operation/create_configuration/_create_configuration_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Creates a new configuration for the specified configuration name. Amazon MQ uses the default configuration (the engine type and version).</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateConfigurationInput {
7 /// <p>Optional. The authentication strategy associated with the configuration. The default is SIMPLE.</p>
8 pub authentication_strategy: ::std::option::Option<crate::types::AuthenticationStrategy>,
9 /// <p>Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.</p>
10 pub engine_type: ::std::option::Option<crate::types::EngineType>,
11 /// <p>The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/activemq-version-management.html">ActiveMQ version management</a> and the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/rabbitmq-version-management.html">RabbitMQ version management</a> sections in the Amazon MQ Developer Guide.</p>
12 pub engine_version: ::std::option::Option<::std::string::String>,
13 /// <p>Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long.</p>
14 pub name: ::std::option::Option<::std::string::String>,
15 /// <p>Create tags when creating the configuration.</p>
16 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
17}
18impl CreateConfigurationInput {
19 /// <p>Optional. The authentication strategy associated with the configuration. The default is SIMPLE.</p>
20 pub fn authentication_strategy(&self) -> ::std::option::Option<&crate::types::AuthenticationStrategy> {
21 self.authentication_strategy.as_ref()
22 }
23 /// <p>Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.</p>
24 pub fn engine_type(&self) -> ::std::option::Option<&crate::types::EngineType> {
25 self.engine_type.as_ref()
26 }
27 /// <p>The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/activemq-version-management.html">ActiveMQ version management</a> and the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/rabbitmq-version-management.html">RabbitMQ version management</a> sections in the Amazon MQ Developer Guide.</p>
28 pub fn engine_version(&self) -> ::std::option::Option<&str> {
29 self.engine_version.as_deref()
30 }
31 /// <p>Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long.</p>
32 pub fn name(&self) -> ::std::option::Option<&str> {
33 self.name.as_deref()
34 }
35 /// <p>Create tags when creating the configuration.</p>
36 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
37 self.tags.as_ref()
38 }
39}
40impl CreateConfigurationInput {
41 /// Creates a new builder-style object to manufacture [`CreateConfigurationInput`](crate::operation::create_configuration::CreateConfigurationInput).
42 pub fn builder() -> crate::operation::create_configuration::builders::CreateConfigurationInputBuilder {
43 crate::operation::create_configuration::builders::CreateConfigurationInputBuilder::default()
44 }
45}
46
47/// A builder for [`CreateConfigurationInput`](crate::operation::create_configuration::CreateConfigurationInput).
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
49#[non_exhaustive]
50pub struct CreateConfigurationInputBuilder {
51 pub(crate) authentication_strategy: ::std::option::Option<crate::types::AuthenticationStrategy>,
52 pub(crate) engine_type: ::std::option::Option<crate::types::EngineType>,
53 pub(crate) engine_version: ::std::option::Option<::std::string::String>,
54 pub(crate) name: ::std::option::Option<::std::string::String>,
55 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
56}
57impl CreateConfigurationInputBuilder {
58 /// <p>Optional. The authentication strategy associated with the configuration. The default is SIMPLE.</p>
59 pub fn authentication_strategy(mut self, input: crate::types::AuthenticationStrategy) -> Self {
60 self.authentication_strategy = ::std::option::Option::Some(input);
61 self
62 }
63 /// <p>Optional. The authentication strategy associated with the configuration. The default is SIMPLE.</p>
64 pub fn set_authentication_strategy(mut self, input: ::std::option::Option<crate::types::AuthenticationStrategy>) -> Self {
65 self.authentication_strategy = input;
66 self
67 }
68 /// <p>Optional. The authentication strategy associated with the configuration. The default is SIMPLE.</p>
69 pub fn get_authentication_strategy(&self) -> &::std::option::Option<crate::types::AuthenticationStrategy> {
70 &self.authentication_strategy
71 }
72 /// <p>Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.</p>
73 /// This field is required.
74 pub fn engine_type(mut self, input: crate::types::EngineType) -> Self {
75 self.engine_type = ::std::option::Option::Some(input);
76 self
77 }
78 /// <p>Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.</p>
79 pub fn set_engine_type(mut self, input: ::std::option::Option<crate::types::EngineType>) -> Self {
80 self.engine_type = input;
81 self
82 }
83 /// <p>Required. The type of broker engine. Currently, Amazon MQ supports ACTIVEMQ and RABBITMQ.</p>
84 pub fn get_engine_type(&self) -> &::std::option::Option<crate::types::EngineType> {
85 &self.engine_type
86 }
87 /// <p>The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/activemq-version-management.html">ActiveMQ version management</a> and the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/rabbitmq-version-management.html">RabbitMQ version management</a> sections in the Amazon MQ Developer Guide.</p>
88 pub fn engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.engine_version = ::std::option::Option::Some(input.into());
90 self
91 }
92 /// <p>The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/activemq-version-management.html">ActiveMQ version management</a> and the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/rabbitmq-version-management.html">RabbitMQ version management</a> sections in the Amazon MQ Developer Guide.</p>
93 pub fn set_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.engine_version = input;
95 self
96 }
97 /// <p>The broker engine version. Defaults to the latest available version for the specified broker engine type. For more information, see the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/activemq-version-management.html">ActiveMQ version management</a> and the <a href="https://docs.aws.amazon.com//amazon-mq/latest/developer-guide/rabbitmq-version-management.html">RabbitMQ version management</a> sections in the Amazon MQ Developer Guide.</p>
98 pub fn get_engine_version(&self) -> &::std::option::Option<::std::string::String> {
99 &self.engine_version
100 }
101 /// <p>Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long.</p>
102 /// This field is required.
103 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.name = ::std::option::Option::Some(input.into());
105 self
106 }
107 /// <p>Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long.</p>
108 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.name = input;
110 self
111 }
112 /// <p>Required. The name of the configuration. This value can contain only alphanumeric characters, dashes, periods, underscores, and tildes (- . _ ~). This value must be 1-150 characters long.</p>
113 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
114 &self.name
115 }
116 /// Adds a key-value pair to `tags`.
117 ///
118 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
119 ///
120 /// <p>Create tags when creating the configuration.</p>
121 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
122 let mut hash_map = self.tags.unwrap_or_default();
123 hash_map.insert(k.into(), v.into());
124 self.tags = ::std::option::Option::Some(hash_map);
125 self
126 }
127 /// <p>Create tags when creating the configuration.</p>
128 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
129 self.tags = input;
130 self
131 }
132 /// <p>Create tags when creating the configuration.</p>
133 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
134 &self.tags
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 authentication_strategy: self.authentication_strategy,
143 engine_type: self.engine_type,
144 engine_version: self.engine_version,
145 name: self.name,
146 tags: self.tags,
147 })
148 }
149}