aws_sdk_datasync/operation/describe_agent/_describe_agent_output.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>DescribeAgentResponse</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DescribeAgentOutput {
7 /// <p>The ARN of the agent.</p>
8 pub agent_arn: ::std::option::Option<::std::string::String>,
9 /// <p>The name of the agent.</p>
10 pub name: ::std::option::Option<::std::string::String>,
11 /// <p>The status of the agent.</p>
12 /// <ul>
13 /// <li>
14 /// <p>If the status is <code>ONLINE</code>, the agent is configured properly and ready to use.</p></li>
15 /// <li>
16 /// <p>If the status is <code>OFFLINE</code>, the agent has been out of contact with DataSync for five minutes or longer. This can happen for a few reasons. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/troubleshooting-datasync-agents.html#troubleshoot-agent-offline">What do I do if my agent is offline?</a></p></li>
17 /// </ul>
18 pub status: ::std::option::Option<crate::types::AgentStatus>,
19 /// <p>The last time that the agent was communicating with the DataSync service.</p>
20 pub last_connection_time: ::std::option::Option<::aws_smithy_types::DateTime>,
21 /// <p>The time that the agent was <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">activated</a>.</p>
22 pub creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
23 /// <p>The type of <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html">service endpoint</a> that your agent is connected to.</p>
24 pub endpoint_type: ::std::option::Option<crate::types::EndpointType>,
25 /// <p>The network configuration that the agent uses when connecting to a <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#choose-service-endpoint-vpc">VPC service endpoint</a>.</p>
26 pub private_link_config: ::std::option::Option<crate::types::PrivateLinkConfig>,
27 /// <p>The platform-related details about the agent, such as the version number.</p>
28 pub platform: ::std::option::Option<crate::types::Platform>,
29 _request_id: Option<String>,
30}
31impl DescribeAgentOutput {
32 /// <p>The ARN of the agent.</p>
33 pub fn agent_arn(&self) -> ::std::option::Option<&str> {
34 self.agent_arn.as_deref()
35 }
36 /// <p>The name of the agent.</p>
37 pub fn name(&self) -> ::std::option::Option<&str> {
38 self.name.as_deref()
39 }
40 /// <p>The status of the agent.</p>
41 /// <ul>
42 /// <li>
43 /// <p>If the status is <code>ONLINE</code>, the agent is configured properly and ready to use.</p></li>
44 /// <li>
45 /// <p>If the status is <code>OFFLINE</code>, the agent has been out of contact with DataSync for five minutes or longer. This can happen for a few reasons. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/troubleshooting-datasync-agents.html#troubleshoot-agent-offline">What do I do if my agent is offline?</a></p></li>
46 /// </ul>
47 pub fn status(&self) -> ::std::option::Option<&crate::types::AgentStatus> {
48 self.status.as_ref()
49 }
50 /// <p>The last time that the agent was communicating with the DataSync service.</p>
51 pub fn last_connection_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
52 self.last_connection_time.as_ref()
53 }
54 /// <p>The time that the agent was <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">activated</a>.</p>
55 pub fn creation_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
56 self.creation_time.as_ref()
57 }
58 /// <p>The type of <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html">service endpoint</a> that your agent is connected to.</p>
59 pub fn endpoint_type(&self) -> ::std::option::Option<&crate::types::EndpointType> {
60 self.endpoint_type.as_ref()
61 }
62 /// <p>The network configuration that the agent uses when connecting to a <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#choose-service-endpoint-vpc">VPC service endpoint</a>.</p>
63 pub fn private_link_config(&self) -> ::std::option::Option<&crate::types::PrivateLinkConfig> {
64 self.private_link_config.as_ref()
65 }
66 /// <p>The platform-related details about the agent, such as the version number.</p>
67 pub fn platform(&self) -> ::std::option::Option<&crate::types::Platform> {
68 self.platform.as_ref()
69 }
70}
71impl ::aws_types::request_id::RequestId for DescribeAgentOutput {
72 fn request_id(&self) -> Option<&str> {
73 self._request_id.as_deref()
74 }
75}
76impl DescribeAgentOutput {
77 /// Creates a new builder-style object to manufacture [`DescribeAgentOutput`](crate::operation::describe_agent::DescribeAgentOutput).
78 pub fn builder() -> crate::operation::describe_agent::builders::DescribeAgentOutputBuilder {
79 crate::operation::describe_agent::builders::DescribeAgentOutputBuilder::default()
80 }
81}
82
83/// A builder for [`DescribeAgentOutput`](crate::operation::describe_agent::DescribeAgentOutput).
84#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
85#[non_exhaustive]
86pub struct DescribeAgentOutputBuilder {
87 pub(crate) agent_arn: ::std::option::Option<::std::string::String>,
88 pub(crate) name: ::std::option::Option<::std::string::String>,
89 pub(crate) status: ::std::option::Option<crate::types::AgentStatus>,
90 pub(crate) last_connection_time: ::std::option::Option<::aws_smithy_types::DateTime>,
91 pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
92 pub(crate) endpoint_type: ::std::option::Option<crate::types::EndpointType>,
93 pub(crate) private_link_config: ::std::option::Option<crate::types::PrivateLinkConfig>,
94 pub(crate) platform: ::std::option::Option<crate::types::Platform>,
95 _request_id: Option<String>,
96}
97impl DescribeAgentOutputBuilder {
98 /// <p>The ARN of the agent.</p>
99 pub fn agent_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100 self.agent_arn = ::std::option::Option::Some(input.into());
101 self
102 }
103 /// <p>The ARN of the agent.</p>
104 pub fn set_agent_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105 self.agent_arn = input;
106 self
107 }
108 /// <p>The ARN of the agent.</p>
109 pub fn get_agent_arn(&self) -> &::std::option::Option<::std::string::String> {
110 &self.agent_arn
111 }
112 /// <p>The name of the agent.</p>
113 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.name = ::std::option::Option::Some(input.into());
115 self
116 }
117 /// <p>The name of the agent.</p>
118 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.name = input;
120 self
121 }
122 /// <p>The name of the agent.</p>
123 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
124 &self.name
125 }
126 /// <p>The status of the agent.</p>
127 /// <ul>
128 /// <li>
129 /// <p>If the status is <code>ONLINE</code>, the agent is configured properly and ready to use.</p></li>
130 /// <li>
131 /// <p>If the status is <code>OFFLINE</code>, the agent has been out of contact with DataSync for five minutes or longer. This can happen for a few reasons. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/troubleshooting-datasync-agents.html#troubleshoot-agent-offline">What do I do if my agent is offline?</a></p></li>
132 /// </ul>
133 pub fn status(mut self, input: crate::types::AgentStatus) -> Self {
134 self.status = ::std::option::Option::Some(input);
135 self
136 }
137 /// <p>The status of the agent.</p>
138 /// <ul>
139 /// <li>
140 /// <p>If the status is <code>ONLINE</code>, the agent is configured properly and ready to use.</p></li>
141 /// <li>
142 /// <p>If the status is <code>OFFLINE</code>, the agent has been out of contact with DataSync for five minutes or longer. This can happen for a few reasons. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/troubleshooting-datasync-agents.html#troubleshoot-agent-offline">What do I do if my agent is offline?</a></p></li>
143 /// </ul>
144 pub fn set_status(mut self, input: ::std::option::Option<crate::types::AgentStatus>) -> Self {
145 self.status = input;
146 self
147 }
148 /// <p>The status of the agent.</p>
149 /// <ul>
150 /// <li>
151 /// <p>If the status is <code>ONLINE</code>, the agent is configured properly and ready to use.</p></li>
152 /// <li>
153 /// <p>If the status is <code>OFFLINE</code>, the agent has been out of contact with DataSync for five minutes or longer. This can happen for a few reasons. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/troubleshooting-datasync-agents.html#troubleshoot-agent-offline">What do I do if my agent is offline?</a></p></li>
154 /// </ul>
155 pub fn get_status(&self) -> &::std::option::Option<crate::types::AgentStatus> {
156 &self.status
157 }
158 /// <p>The last time that the agent was communicating with the DataSync service.</p>
159 pub fn last_connection_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
160 self.last_connection_time = ::std::option::Option::Some(input);
161 self
162 }
163 /// <p>The last time that the agent was communicating with the DataSync service.</p>
164 pub fn set_last_connection_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
165 self.last_connection_time = input;
166 self
167 }
168 /// <p>The last time that the agent was communicating with the DataSync service.</p>
169 pub fn get_last_connection_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
170 &self.last_connection_time
171 }
172 /// <p>The time that the agent was <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">activated</a>.</p>
173 pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
174 self.creation_time = ::std::option::Option::Some(input);
175 self
176 }
177 /// <p>The time that the agent was <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">activated</a>.</p>
178 pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
179 self.creation_time = input;
180 self
181 }
182 /// <p>The time that the agent was <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">activated</a>.</p>
183 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
184 &self.creation_time
185 }
186 /// <p>The type of <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html">service endpoint</a> that your agent is connected to.</p>
187 pub fn endpoint_type(mut self, input: crate::types::EndpointType) -> Self {
188 self.endpoint_type = ::std::option::Option::Some(input);
189 self
190 }
191 /// <p>The type of <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html">service endpoint</a> that your agent is connected to.</p>
192 pub fn set_endpoint_type(mut self, input: ::std::option::Option<crate::types::EndpointType>) -> Self {
193 self.endpoint_type = input;
194 self
195 }
196 /// <p>The type of <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html">service endpoint</a> that your agent is connected to.</p>
197 pub fn get_endpoint_type(&self) -> &::std::option::Option<crate::types::EndpointType> {
198 &self.endpoint_type
199 }
200 /// <p>The network configuration that the agent uses when connecting to a <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#choose-service-endpoint-vpc">VPC service endpoint</a>.</p>
201 pub fn private_link_config(mut self, input: crate::types::PrivateLinkConfig) -> Self {
202 self.private_link_config = ::std::option::Option::Some(input);
203 self
204 }
205 /// <p>The network configuration that the agent uses when connecting to a <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#choose-service-endpoint-vpc">VPC service endpoint</a>.</p>
206 pub fn set_private_link_config(mut self, input: ::std::option::Option<crate::types::PrivateLinkConfig>) -> Self {
207 self.private_link_config = input;
208 self
209 }
210 /// <p>The network configuration that the agent uses when connecting to a <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#choose-service-endpoint-vpc">VPC service endpoint</a>.</p>
211 pub fn get_private_link_config(&self) -> &::std::option::Option<crate::types::PrivateLinkConfig> {
212 &self.private_link_config
213 }
214 /// <p>The platform-related details about the agent, such as the version number.</p>
215 pub fn platform(mut self, input: crate::types::Platform) -> Self {
216 self.platform = ::std::option::Option::Some(input);
217 self
218 }
219 /// <p>The platform-related details about the agent, such as the version number.</p>
220 pub fn set_platform(mut self, input: ::std::option::Option<crate::types::Platform>) -> Self {
221 self.platform = input;
222 self
223 }
224 /// <p>The platform-related details about the agent, such as the version number.</p>
225 pub fn get_platform(&self) -> &::std::option::Option<crate::types::Platform> {
226 &self.platform
227 }
228 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
229 self._request_id = Some(request_id.into());
230 self
231 }
232
233 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
234 self._request_id = request_id;
235 self
236 }
237 /// Consumes the builder and constructs a [`DescribeAgentOutput`](crate::operation::describe_agent::DescribeAgentOutput).
238 pub fn build(self) -> crate::operation::describe_agent::DescribeAgentOutput {
239 crate::operation::describe_agent::DescribeAgentOutput {
240 agent_arn: self.agent_arn,
241 name: self.name,
242 status: self.status,
243 last_connection_time: self.last_connection_time,
244 creation_time: self.creation_time,
245 endpoint_type: self.endpoint_type,
246 private_link_config: self.private_link_config,
247 platform: self.platform,
248 _request_id: self._request_id,
249 }
250 }
251}