Skip to main content

aws_sdk_datasync/operation/create_agent/
_create_agent_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>CreateAgentResponse</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateAgentOutput {
7    /// <p>The ARN of the agent that you just activated. Use the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/API_ListAgents.html">ListAgents</a> operation to return a list of agents in your Amazon Web Services account and Amazon Web Services Region.</p>
8    pub agent_arn: ::std::option::Option<::std::string::String>,
9    _request_id: Option<String>,
10}
11impl CreateAgentOutput {
12    /// <p>The ARN of the agent that you just activated. Use the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/API_ListAgents.html">ListAgents</a> operation to return a list of agents in your Amazon Web Services account and Amazon Web Services Region.</p>
13    pub fn agent_arn(&self) -> ::std::option::Option<&str> {
14        self.agent_arn.as_deref()
15    }
16}
17static CREATEAGENTOUTPUT_MEMBER_AGENT_ARN: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
18    ::aws_smithy_schema::ShapeId::from_parts(
19        "com.amazonaws.datasync.synthetic#CreateAgentOutput$AgentArn",
20        "com.amazonaws.datasync.synthetic",
21        "CreateAgentOutput",
22    ),
23    ::aws_smithy_schema::ShapeType::String,
24    "AgentArn",
25    0,
26);
27static CREATEAGENTOUTPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
28    ::aws_smithy_schema::ShapeId::from_parts(
29        "com.amazonaws.datasync.synthetic#CreateAgentOutput",
30        "com.amazonaws.datasync.synthetic",
31        "CreateAgentOutput",
32    ),
33    ::aws_smithy_schema::ShapeType::Structure,
34    &[&CREATEAGENTOUTPUT_MEMBER_AGENT_ARN],
35)
36.with_original_name("CreateAgentResponse");
37impl CreateAgentOutput {
38    /// The schema for this shape.
39    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &CREATEAGENTOUTPUT_SCHEMA;
40}
41impl ::aws_smithy_schema::serde::SerializableStruct for CreateAgentOutput {
42    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
43        Self::SCHEMA
44    }
45
46    #[allow(unused_variables, clippy::diverging_sub_expression)]
47    fn serialize_members(
48        &self,
49        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
50    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
51        if let Some(ref val) = self.agent_arn {
52            ser.write_string(&CREATEAGENTOUTPUT_MEMBER_AGENT_ARN, val)?;
53        }
54        Ok(())
55    }
56}
57impl crate::operation::create_agent::builders::CreateAgentOutputBuilder {
58    #[allow(
59        unused_variables,
60        unreachable_code,
61        clippy::single_match,
62        clippy::match_single_binding,
63        clippy::diverging_sub_expression
64    )]
65    pub(crate) fn deserialize_members(
66        &mut self,
67        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
68    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
69        deserializer.read_struct(&CREATEAGENTOUTPUT_SCHEMA, &mut |member, deser| {
70            match member.member_index() {
71                Some(0) => {
72                    if deser.is_null() {
73                        deser.read_null()?;
74                    } else {
75                        self.agent_arn = Some(deser.read_string(member)?);
76                    }
77                }
78                _ => {}
79            }
80            Ok(())
81        })
82    }
83}
84
85impl CreateAgentOutput {
86    /// Deserializes this structure from a [`ShapeDeserializer`].
87    pub fn deserialize(
88        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
89    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
90        let mut builder = Self::builder();
91        builder.deserialize_members(deserializer)?;
92        Ok(builder.build())
93    }
94}
95impl ::aws_types::request_id::RequestId for CreateAgentOutput {
96    fn request_id(&self) -> Option<&str> {
97        self._request_id.as_deref()
98    }
99}
100impl CreateAgentOutput {
101    /// Creates a new builder-style object to manufacture [`CreateAgentOutput`](crate::operation::create_agent::CreateAgentOutput).
102    pub fn builder() -> crate::operation::create_agent::builders::CreateAgentOutputBuilder {
103        crate::operation::create_agent::builders::CreateAgentOutputBuilder::default()
104    }
105}
106
107/// A builder for [`CreateAgentOutput`](crate::operation::create_agent::CreateAgentOutput).
108#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
109#[non_exhaustive]
110pub struct CreateAgentOutputBuilder {
111    pub(crate) agent_arn: ::std::option::Option<::std::string::String>,
112    _request_id: Option<String>,
113}
114impl CreateAgentOutputBuilder {
115    /// <p>The ARN of the agent that you just activated. Use the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/API_ListAgents.html">ListAgents</a> operation to return a list of agents in your Amazon Web Services account and Amazon Web Services Region.</p>
116    pub fn agent_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.agent_arn = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The ARN of the agent that you just activated. Use the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/API_ListAgents.html">ListAgents</a> operation to return a list of agents in your Amazon Web Services account and Amazon Web Services Region.</p>
121    pub fn set_agent_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.agent_arn = input;
123        self
124    }
125    /// <p>The ARN of the agent that you just activated. Use the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/API_ListAgents.html">ListAgents</a> operation to return a list of agents in your Amazon Web Services account and Amazon Web Services Region.</p>
126    pub fn get_agent_arn(&self) -> &::std::option::Option<::std::string::String> {
127        &self.agent_arn
128    }
129    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
130        self._request_id = Some(request_id.into());
131        self
132    }
133
134    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
135        self._request_id = request_id;
136        self
137    }
138    /// Consumes the builder and constructs a [`CreateAgentOutput`](crate::operation::create_agent::CreateAgentOutput).
139    pub fn build(self) -> crate::operation::create_agent::CreateAgentOutput {
140        crate::operation::create_agent::CreateAgentOutput {
141            agent_arn: self.agent_arn,
142            _request_id: self._request_id,
143        }
144    }
145}