aws_sdk_mailmanager/operation/create_relay/
_create_relay_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 CreateRelayInput {
6    /// <p>A unique token that Amazon SES uses to recognize subsequent retries of the same request.</p>
7    pub client_token: ::std::option::Option<::std::string::String>,
8    /// <p>The unique name of the relay resource.</p>
9    pub relay_name: ::std::option::Option<::std::string::String>,
10    /// <p>The destination relay server address.</p>
11    pub server_name: ::std::option::Option<::std::string::String>,
12    /// <p>The destination relay server port.</p>
13    pub server_port: ::std::option::Option<i32>,
14    /// <p>Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.</p>
15    pub authentication: ::std::option::Option<crate::types::RelayAuthentication>,
16    /// <p>The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
17    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
18}
19impl CreateRelayInput {
20    /// <p>A unique token that Amazon SES uses to recognize subsequent retries of the same request.</p>
21    pub fn client_token(&self) -> ::std::option::Option<&str> {
22        self.client_token.as_deref()
23    }
24    /// <p>The unique name of the relay resource.</p>
25    pub fn relay_name(&self) -> ::std::option::Option<&str> {
26        self.relay_name.as_deref()
27    }
28    /// <p>The destination relay server address.</p>
29    pub fn server_name(&self) -> ::std::option::Option<&str> {
30        self.server_name.as_deref()
31    }
32    /// <p>The destination relay server port.</p>
33    pub fn server_port(&self) -> ::std::option::Option<i32> {
34        self.server_port
35    }
36    /// <p>Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.</p>
37    pub fn authentication(&self) -> ::std::option::Option<&crate::types::RelayAuthentication> {
38        self.authentication.as_ref()
39    }
40    /// <p>The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
41    ///
42    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
43    pub fn tags(&self) -> &[crate::types::Tag] {
44        self.tags.as_deref().unwrap_or_default()
45    }
46}
47impl CreateRelayInput {
48    /// Creates a new builder-style object to manufacture [`CreateRelayInput`](crate::operation::create_relay::CreateRelayInput).
49    pub fn builder() -> crate::operation::create_relay::builders::CreateRelayInputBuilder {
50        crate::operation::create_relay::builders::CreateRelayInputBuilder::default()
51    }
52}
53
54/// A builder for [`CreateRelayInput`](crate::operation::create_relay::CreateRelayInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct CreateRelayInputBuilder {
58    pub(crate) client_token: ::std::option::Option<::std::string::String>,
59    pub(crate) relay_name: ::std::option::Option<::std::string::String>,
60    pub(crate) server_name: ::std::option::Option<::std::string::String>,
61    pub(crate) server_port: ::std::option::Option<i32>,
62    pub(crate) authentication: ::std::option::Option<crate::types::RelayAuthentication>,
63    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
64}
65impl CreateRelayInputBuilder {
66    /// <p>A unique token that Amazon SES uses to recognize subsequent retries of the same request.</p>
67    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.client_token = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>A unique token that Amazon SES uses to recognize subsequent retries of the same request.</p>
72    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.client_token = input;
74        self
75    }
76    /// <p>A unique token that Amazon SES uses to recognize subsequent retries of the same request.</p>
77    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
78        &self.client_token
79    }
80    /// <p>The unique name of the relay resource.</p>
81    /// This field is required.
82    pub fn relay_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
83        self.relay_name = ::std::option::Option::Some(input.into());
84        self
85    }
86    /// <p>The unique name of the relay resource.</p>
87    pub fn set_relay_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.relay_name = input;
89        self
90    }
91    /// <p>The unique name of the relay resource.</p>
92    pub fn get_relay_name(&self) -> &::std::option::Option<::std::string::String> {
93        &self.relay_name
94    }
95    /// <p>The destination relay server address.</p>
96    /// This field is required.
97    pub fn server_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.server_name = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>The destination relay server address.</p>
102    pub fn set_server_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.server_name = input;
104        self
105    }
106    /// <p>The destination relay server address.</p>
107    pub fn get_server_name(&self) -> &::std::option::Option<::std::string::String> {
108        &self.server_name
109    }
110    /// <p>The destination relay server port.</p>
111    /// This field is required.
112    pub fn server_port(mut self, input: i32) -> Self {
113        self.server_port = ::std::option::Option::Some(input);
114        self
115    }
116    /// <p>The destination relay server port.</p>
117    pub fn set_server_port(mut self, input: ::std::option::Option<i32>) -> Self {
118        self.server_port = input;
119        self
120    }
121    /// <p>The destination relay server port.</p>
122    pub fn get_server_port(&self) -> &::std::option::Option<i32> {
123        &self.server_port
124    }
125    /// <p>Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.</p>
126    /// This field is required.
127    pub fn authentication(mut self, input: crate::types::RelayAuthentication) -> Self {
128        self.authentication = ::std::option::Option::Some(input);
129        self
130    }
131    /// <p>Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.</p>
132    pub fn set_authentication(mut self, input: ::std::option::Option<crate::types::RelayAuthentication>) -> Self {
133        self.authentication = input;
134        self
135    }
136    /// <p>Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.</p>
137    pub fn get_authentication(&self) -> &::std::option::Option<crate::types::RelayAuthentication> {
138        &self.authentication
139    }
140    /// Appends an item to `tags`.
141    ///
142    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
143    ///
144    /// <p>The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
145    pub fn tags(mut self, input: crate::types::Tag) -> Self {
146        let mut v = self.tags.unwrap_or_default();
147        v.push(input);
148        self.tags = ::std::option::Option::Some(v);
149        self
150    }
151    /// <p>The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
152    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
153        self.tags = input;
154        self
155    }
156    /// <p>The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
157    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
158        &self.tags
159    }
160    /// Consumes the builder and constructs a [`CreateRelayInput`](crate::operation::create_relay::CreateRelayInput).
161    pub fn build(self) -> ::std::result::Result<crate::operation::create_relay::CreateRelayInput, ::aws_smithy_types::error::operation::BuildError> {
162        ::std::result::Result::Ok(crate::operation::create_relay::CreateRelayInput {
163            client_token: self.client_token,
164            relay_name: self.relay_name,
165            server_name: self.server_name,
166            server_port: self.server_port,
167            authentication: self.authentication,
168            tags: self.tags,
169        })
170    }
171}