aws_sdk_mailmanager/operation/update_relay/
_update_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 UpdateRelayInput {
6    /// <p>The unique relay identifier.</p>
7    pub relay_id: ::std::option::Option<::std::string::String>,
8    /// <p>The 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}
17impl UpdateRelayInput {
18    /// <p>The unique relay identifier.</p>
19    pub fn relay_id(&self) -> ::std::option::Option<&str> {
20        self.relay_id.as_deref()
21    }
22    /// <p>The name of the relay resource.</p>
23    pub fn relay_name(&self) -> ::std::option::Option<&str> {
24        self.relay_name.as_deref()
25    }
26    /// <p>The destination relay server address.</p>
27    pub fn server_name(&self) -> ::std::option::Option<&str> {
28        self.server_name.as_deref()
29    }
30    /// <p>The destination relay server port.</p>
31    pub fn server_port(&self) -> ::std::option::Option<i32> {
32        self.server_port
33    }
34    /// <p>Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.</p>
35    pub fn authentication(&self) -> ::std::option::Option<&crate::types::RelayAuthentication> {
36        self.authentication.as_ref()
37    }
38}
39impl UpdateRelayInput {
40    /// Creates a new builder-style object to manufacture [`UpdateRelayInput`](crate::operation::update_relay::UpdateRelayInput).
41    pub fn builder() -> crate::operation::update_relay::builders::UpdateRelayInputBuilder {
42        crate::operation::update_relay::builders::UpdateRelayInputBuilder::default()
43    }
44}
45
46/// A builder for [`UpdateRelayInput`](crate::operation::update_relay::UpdateRelayInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct UpdateRelayInputBuilder {
50    pub(crate) relay_id: ::std::option::Option<::std::string::String>,
51    pub(crate) relay_name: ::std::option::Option<::std::string::String>,
52    pub(crate) server_name: ::std::option::Option<::std::string::String>,
53    pub(crate) server_port: ::std::option::Option<i32>,
54    pub(crate) authentication: ::std::option::Option<crate::types::RelayAuthentication>,
55}
56impl UpdateRelayInputBuilder {
57    /// <p>The unique relay identifier.</p>
58    /// This field is required.
59    pub fn relay_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.relay_id = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The unique relay identifier.</p>
64    pub fn set_relay_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.relay_id = input;
66        self
67    }
68    /// <p>The unique relay identifier.</p>
69    pub fn get_relay_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.relay_id
71    }
72    /// <p>The name of the relay resource.</p>
73    pub fn relay_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.relay_name = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The name of the relay resource.</p>
78    pub fn set_relay_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.relay_name = input;
80        self
81    }
82    /// <p>The name of the relay resource.</p>
83    pub fn get_relay_name(&self) -> &::std::option::Option<::std::string::String> {
84        &self.relay_name
85    }
86    /// <p>The destination relay server address.</p>
87    pub fn server_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88        self.server_name = ::std::option::Option::Some(input.into());
89        self
90    }
91    /// <p>The destination relay server address.</p>
92    pub fn set_server_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93        self.server_name = input;
94        self
95    }
96    /// <p>The destination relay server address.</p>
97    pub fn get_server_name(&self) -> &::std::option::Option<::std::string::String> {
98        &self.server_name
99    }
100    /// <p>The destination relay server port.</p>
101    pub fn server_port(mut self, input: i32) -> Self {
102        self.server_port = ::std::option::Option::Some(input);
103        self
104    }
105    /// <p>The destination relay server port.</p>
106    pub fn set_server_port(mut self, input: ::std::option::Option<i32>) -> Self {
107        self.server_port = input;
108        self
109    }
110    /// <p>The destination relay server port.</p>
111    pub fn get_server_port(&self) -> &::std::option::Option<i32> {
112        &self.server_port
113    }
114    /// <p>Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.</p>
115    pub fn authentication(mut self, input: crate::types::RelayAuthentication) -> Self {
116        self.authentication = ::std::option::Option::Some(input);
117        self
118    }
119    /// <p>Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.</p>
120    pub fn set_authentication(mut self, input: ::std::option::Option<crate::types::RelayAuthentication>) -> Self {
121        self.authentication = input;
122        self
123    }
124    /// <p>Authentication for the relay destination server—specify the secretARN where the SMTP credentials are stored.</p>
125    pub fn get_authentication(&self) -> &::std::option::Option<crate::types::RelayAuthentication> {
126        &self.authentication
127    }
128    /// Consumes the builder and constructs a [`UpdateRelayInput`](crate::operation::update_relay::UpdateRelayInput).
129    pub fn build(self) -> ::std::result::Result<crate::operation::update_relay::UpdateRelayInput, ::aws_smithy_types::error::operation::BuildError> {
130        ::std::result::Result::Ok(crate::operation::update_relay::UpdateRelayInput {
131            relay_id: self.relay_id,
132            relay_name: self.relay_name,
133            server_name: self.server_name,
134            server_port: self.server_port,
135            authentication: self.authentication,
136        })
137    }
138}