aws_sdk_mailmanager/operation/get_relay/
_get_relay_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 GetRelayOutput {
6    /// <p>The unique relay identifier.</p>
7    pub relay_id: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) of the relay.</p>
9    pub relay_arn: ::std::option::Option<::std::string::String>,
10    /// <p>The unique name of the relay.</p>
11    pub relay_name: ::std::option::Option<::std::string::String>,
12    /// <p>The destination relay server address.</p>
13    pub server_name: ::std::option::Option<::std::string::String>,
14    /// <p>The destination relay server port.</p>
15    pub server_port: ::std::option::Option<i32>,
16    /// <p>The authentication attribute—contains the secret ARN where the customer relay server credentials are stored.</p>
17    pub authentication: ::std::option::Option<crate::types::RelayAuthentication>,
18    /// <p>The timestamp of when the relay was created.</p>
19    pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>The timestamp of when relay was last updated.</p>
21    pub last_modified_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
22    _request_id: Option<String>,
23}
24impl GetRelayOutput {
25    /// <p>The unique relay identifier.</p>
26    pub fn relay_id(&self) -> &str {
27        use std::ops::Deref;
28        self.relay_id.deref()
29    }
30    /// <p>The Amazon Resource Name (ARN) of the relay.</p>
31    pub fn relay_arn(&self) -> ::std::option::Option<&str> {
32        self.relay_arn.as_deref()
33    }
34    /// <p>The unique name of the relay.</p>
35    pub fn relay_name(&self) -> ::std::option::Option<&str> {
36        self.relay_name.as_deref()
37    }
38    /// <p>The destination relay server address.</p>
39    pub fn server_name(&self) -> ::std::option::Option<&str> {
40        self.server_name.as_deref()
41    }
42    /// <p>The destination relay server port.</p>
43    pub fn server_port(&self) -> ::std::option::Option<i32> {
44        self.server_port
45    }
46    /// <p>The authentication attribute—contains the secret ARN where the customer relay server credentials are stored.</p>
47    pub fn authentication(&self) -> ::std::option::Option<&crate::types::RelayAuthentication> {
48        self.authentication.as_ref()
49    }
50    /// <p>The timestamp of when the relay was created.</p>
51    pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
52        self.created_timestamp.as_ref()
53    }
54    /// <p>The timestamp of when relay was last updated.</p>
55    pub fn last_modified_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
56        self.last_modified_timestamp.as_ref()
57    }
58}
59impl ::aws_types::request_id::RequestId for GetRelayOutput {
60    fn request_id(&self) -> Option<&str> {
61        self._request_id.as_deref()
62    }
63}
64impl GetRelayOutput {
65    /// Creates a new builder-style object to manufacture [`GetRelayOutput`](crate::operation::get_relay::GetRelayOutput).
66    pub fn builder() -> crate::operation::get_relay::builders::GetRelayOutputBuilder {
67        crate::operation::get_relay::builders::GetRelayOutputBuilder::default()
68    }
69}
70
71/// A builder for [`GetRelayOutput`](crate::operation::get_relay::GetRelayOutput).
72#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
73#[non_exhaustive]
74pub struct GetRelayOutputBuilder {
75    pub(crate) relay_id: ::std::option::Option<::std::string::String>,
76    pub(crate) relay_arn: ::std::option::Option<::std::string::String>,
77    pub(crate) relay_name: ::std::option::Option<::std::string::String>,
78    pub(crate) server_name: ::std::option::Option<::std::string::String>,
79    pub(crate) server_port: ::std::option::Option<i32>,
80    pub(crate) authentication: ::std::option::Option<crate::types::RelayAuthentication>,
81    pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
82    pub(crate) last_modified_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
83    _request_id: Option<String>,
84}
85impl GetRelayOutputBuilder {
86    /// <p>The unique relay identifier.</p>
87    /// This field is required.
88    pub fn relay_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.relay_id = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The unique relay identifier.</p>
93    pub fn set_relay_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.relay_id = input;
95        self
96    }
97    /// <p>The unique relay identifier.</p>
98    pub fn get_relay_id(&self) -> &::std::option::Option<::std::string::String> {
99        &self.relay_id
100    }
101    /// <p>The Amazon Resource Name (ARN) of the relay.</p>
102    pub fn relay_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.relay_arn = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The Amazon Resource Name (ARN) of the relay.</p>
107    pub fn set_relay_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.relay_arn = input;
109        self
110    }
111    /// <p>The Amazon Resource Name (ARN) of the relay.</p>
112    pub fn get_relay_arn(&self) -> &::std::option::Option<::std::string::String> {
113        &self.relay_arn
114    }
115    /// <p>The unique name of the relay.</p>
116    pub fn relay_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.relay_name = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The unique name of the relay.</p>
121    pub fn set_relay_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.relay_name = input;
123        self
124    }
125    /// <p>The unique name of the relay.</p>
126    pub fn get_relay_name(&self) -> &::std::option::Option<::std::string::String> {
127        &self.relay_name
128    }
129    /// <p>The destination relay server address.</p>
130    pub fn server_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.server_name = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>The destination relay server address.</p>
135    pub fn set_server_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.server_name = input;
137        self
138    }
139    /// <p>The destination relay server address.</p>
140    pub fn get_server_name(&self) -> &::std::option::Option<::std::string::String> {
141        &self.server_name
142    }
143    /// <p>The destination relay server port.</p>
144    pub fn server_port(mut self, input: i32) -> Self {
145        self.server_port = ::std::option::Option::Some(input);
146        self
147    }
148    /// <p>The destination relay server port.</p>
149    pub fn set_server_port(mut self, input: ::std::option::Option<i32>) -> Self {
150        self.server_port = input;
151        self
152    }
153    /// <p>The destination relay server port.</p>
154    pub fn get_server_port(&self) -> &::std::option::Option<i32> {
155        &self.server_port
156    }
157    /// <p>The authentication attribute—contains the secret ARN where the customer relay server credentials are stored.</p>
158    pub fn authentication(mut self, input: crate::types::RelayAuthentication) -> Self {
159        self.authentication = ::std::option::Option::Some(input);
160        self
161    }
162    /// <p>The authentication attribute—contains the secret ARN where the customer relay server credentials are stored.</p>
163    pub fn set_authentication(mut self, input: ::std::option::Option<crate::types::RelayAuthentication>) -> Self {
164        self.authentication = input;
165        self
166    }
167    /// <p>The authentication attribute—contains the secret ARN where the customer relay server credentials are stored.</p>
168    pub fn get_authentication(&self) -> &::std::option::Option<crate::types::RelayAuthentication> {
169        &self.authentication
170    }
171    /// <p>The timestamp of when the relay was created.</p>
172    pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
173        self.created_timestamp = ::std::option::Option::Some(input);
174        self
175    }
176    /// <p>The timestamp of when the relay was created.</p>
177    pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
178        self.created_timestamp = input;
179        self
180    }
181    /// <p>The timestamp of when the relay was created.</p>
182    pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
183        &self.created_timestamp
184    }
185    /// <p>The timestamp of when relay was last updated.</p>
186    pub fn last_modified_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
187        self.last_modified_timestamp = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>The timestamp of when relay was last updated.</p>
191    pub fn set_last_modified_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
192        self.last_modified_timestamp = input;
193        self
194    }
195    /// <p>The timestamp of when relay was last updated.</p>
196    pub fn get_last_modified_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
197        &self.last_modified_timestamp
198    }
199    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
200        self._request_id = Some(request_id.into());
201        self
202    }
203
204    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
205        self._request_id = request_id;
206        self
207    }
208    /// Consumes the builder and constructs a [`GetRelayOutput`](crate::operation::get_relay::GetRelayOutput).
209    /// This method will fail if any of the following fields are not set:
210    /// - [`relay_id`](crate::operation::get_relay::builders::GetRelayOutputBuilder::relay_id)
211    pub fn build(self) -> ::std::result::Result<crate::operation::get_relay::GetRelayOutput, ::aws_smithy_types::error::operation::BuildError> {
212        ::std::result::Result::Ok(crate::operation::get_relay::GetRelayOutput {
213            relay_id: self.relay_id.ok_or_else(|| {
214                ::aws_smithy_types::error::operation::BuildError::missing_field(
215                    "relay_id",
216                    "relay_id was not specified but it is required when building GetRelayOutput",
217                )
218            })?,
219            relay_arn: self.relay_arn,
220            relay_name: self.relay_name,
221            server_name: self.server_name,
222            server_port: self.server_port,
223            authentication: self.authentication,
224            created_timestamp: self.created_timestamp,
225            last_modified_timestamp: self.last_modified_timestamp,
226            _request_id: self._request_id,
227        })
228    }
229}