aws_sdk_mailmanager/operation/get_relay/
_get_relay_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetRelayOutput {
6 pub relay_id: ::std::string::String,
8 pub relay_arn: ::std::option::Option<::std::string::String>,
10 pub relay_name: ::std::option::Option<::std::string::String>,
12 pub server_name: ::std::option::Option<::std::string::String>,
14 pub server_port: ::std::option::Option<i32>,
16 pub authentication: ::std::option::Option<crate::types::RelayAuthentication>,
18 pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
20 pub last_modified_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
22 _request_id: Option<String>,
23}
24impl GetRelayOutput {
25 pub fn relay_id(&self) -> &str {
27 use std::ops::Deref;
28 self.relay_id.deref()
29 }
30 pub fn relay_arn(&self) -> ::std::option::Option<&str> {
32 self.relay_arn.as_deref()
33 }
34 pub fn relay_name(&self) -> ::std::option::Option<&str> {
36 self.relay_name.as_deref()
37 }
38 pub fn server_name(&self) -> ::std::option::Option<&str> {
40 self.server_name.as_deref()
41 }
42 pub fn server_port(&self) -> ::std::option::Option<i32> {
44 self.server_port
45 }
46 pub fn authentication(&self) -> ::std::option::Option<&crate::types::RelayAuthentication> {
48 self.authentication.as_ref()
49 }
50 pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
52 self.created_timestamp.as_ref()
53 }
54 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 pub fn builder() -> crate::operation::get_relay::builders::GetRelayOutputBuilder {
67 crate::operation::get_relay::builders::GetRelayOutputBuilder::default()
68 }
69}
70
71#[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 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 pub fn set_relay_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.relay_id = input;
95 self
96 }
97 pub fn get_relay_id(&self) -> &::std::option::Option<::std::string::String> {
99 &self.relay_id
100 }
101 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 pub fn set_relay_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.relay_arn = input;
109 self
110 }
111 pub fn get_relay_arn(&self) -> &::std::option::Option<::std::string::String> {
113 &self.relay_arn
114 }
115 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 pub fn set_relay_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.relay_name = input;
123 self
124 }
125 pub fn get_relay_name(&self) -> &::std::option::Option<::std::string::String> {
127 &self.relay_name
128 }
129 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 pub fn set_server_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.server_name = input;
137 self
138 }
139 pub fn get_server_name(&self) -> &::std::option::Option<::std::string::String> {
141 &self.server_name
142 }
143 pub fn server_port(mut self, input: i32) -> Self {
145 self.server_port = ::std::option::Option::Some(input);
146 self
147 }
148 pub fn set_server_port(mut self, input: ::std::option::Option<i32>) -> Self {
150 self.server_port = input;
151 self
152 }
153 pub fn get_server_port(&self) -> &::std::option::Option<i32> {
155 &self.server_port
156 }
157 pub fn authentication(mut self, input: crate::types::RelayAuthentication) -> Self {
159 self.authentication = ::std::option::Option::Some(input);
160 self
161 }
162 pub fn set_authentication(mut self, input: ::std::option::Option<crate::types::RelayAuthentication>) -> Self {
164 self.authentication = input;
165 self
166 }
167 pub fn get_authentication(&self) -> &::std::option::Option<crate::types::RelayAuthentication> {
169 &self.authentication
170 }
171 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 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 pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
183 &self.created_timestamp
184 }
185 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 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 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 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}