Skip to main content

aws_sdk_datasync/operation/create_agent/
_create_agent_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>CreateAgentRequest</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateAgentInput {
7    /// <p>Specifies your DataSync agent's activation key. If you don't have an activation key, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">Activating your agent</a>.</p>
8    pub activation_key: ::std::option::Option<::std::string::String>,
9    /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
10    pub agent_name: ::std::option::Option<::std::string::String>,
11    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least one tag for your agent.</p>
12    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>,
13    /// <p>Specifies the ID of the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#datasync-in-vpc">VPC service endpoint</a> that you're using. For example, a VPC endpoint ID looks like <code>vpce-01234d5aff67890e1</code>.</p><important>
14    /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
15    /// </important>
16    /// <p>The endpoint ID is informational. DataSync doesn't verify it or use it to connect to your agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
17    pub vpc_endpoint_id: ::std::option::Option<::std::string::String>,
18    /// <p>Specifies the ARN of the subnet where DataSync creates the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/required-network-interfaces.html">network interfaces</a> that handle data transfer traffic for your tasks. You can only specify one ARN.</p>
19    /// <p>The subnet doesn't have to be the subnet that contains your VPC service endpoint. The subnet can be one that another Amazon Web Services account shared with you through <a href="https://docs.aws.amazon.com/ram/latest/userguide/what-is.html">RAM</a>, in which case the ARN must specify the account that owns the subnet. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
20    pub subnet_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
21    /// <p>Specifies the Amazon Resource Name (ARN) of the security group that allows traffic between your agent and VPC service endpoint. You can only specify one ARN.</p>
22    /// <p>The ARN must specify your own account, even when the security group was shared with you from the account that owns the VPC. The security group must belong to the same VPC as the subnet that you specify in <code>SubnetArns</code>.</p>
23    pub security_group_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
24}
25impl CreateAgentInput {
26    /// <p>Specifies your DataSync agent's activation key. If you don't have an activation key, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">Activating your agent</a>.</p>
27    pub fn activation_key(&self) -> ::std::option::Option<&str> {
28        self.activation_key.as_deref()
29    }
30    /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
31    pub fn agent_name(&self) -> ::std::option::Option<&str> {
32        self.agent_name.as_deref()
33    }
34    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least one tag for your agent.</p>
35    ///
36    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
37    pub fn tags(&self) -> &[crate::types::TagListEntry] {
38        self.tags.as_deref().unwrap_or_default()
39    }
40    /// <p>Specifies the ID of the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#datasync-in-vpc">VPC service endpoint</a> that you're using. For example, a VPC endpoint ID looks like <code>vpce-01234d5aff67890e1</code>.</p><important>
41    /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
42    /// </important>
43    /// <p>The endpoint ID is informational. DataSync doesn't verify it or use it to connect to your agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
44    pub fn vpc_endpoint_id(&self) -> ::std::option::Option<&str> {
45        self.vpc_endpoint_id.as_deref()
46    }
47    /// <p>Specifies the ARN of the subnet where DataSync creates the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/required-network-interfaces.html">network interfaces</a> that handle data transfer traffic for your tasks. You can only specify one ARN.</p>
48    /// <p>The subnet doesn't have to be the subnet that contains your VPC service endpoint. The subnet can be one that another Amazon Web Services account shared with you through <a href="https://docs.aws.amazon.com/ram/latest/userguide/what-is.html">RAM</a>, in which case the ARN must specify the account that owns the subnet. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
49    ///
50    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subnet_arns.is_none()`.
51    pub fn subnet_arns(&self) -> &[::std::string::String] {
52        self.subnet_arns.as_deref().unwrap_or_default()
53    }
54    /// <p>Specifies the Amazon Resource Name (ARN) of the security group that allows traffic between your agent and VPC service endpoint. You can only specify one ARN.</p>
55    /// <p>The ARN must specify your own account, even when the security group was shared with you from the account that owns the VPC. The security group must belong to the same VPC as the subnet that you specify in <code>SubnetArns</code>.</p>
56    ///
57    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_group_arns.is_none()`.
58    pub fn security_group_arns(&self) -> &[::std::string::String] {
59        self.security_group_arns.as_deref().unwrap_or_default()
60    }
61}
62static CREATEAGENTINPUT_MEMBER_ACTIVATION_KEY: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
63    ::aws_smithy_schema::ShapeId::from_parts(
64        "com.amazonaws.datasync.synthetic#CreateAgentInput$ActivationKey",
65        "com.amazonaws.datasync.synthetic",
66        "CreateAgentInput",
67    ),
68    ::aws_smithy_schema::ShapeType::String,
69    "ActivationKey",
70    0,
71);
72static CREATEAGENTINPUT_MEMBER_AGENT_NAME: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
73    ::aws_smithy_schema::ShapeId::from_parts(
74        "com.amazonaws.datasync.synthetic#CreateAgentInput$AgentName",
75        "com.amazonaws.datasync.synthetic",
76        "CreateAgentInput",
77    ),
78    ::aws_smithy_schema::ShapeType::String,
79    "AgentName",
80    1,
81);
82static CREATEAGENTINPUT_MEMBER_TAGS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
83    ::aws_smithy_schema::ShapeId::from_parts("com.amazonaws.datasync#InputTagList$member", "com.amazonaws.datasync", "InputTagList"),
84    ::aws_smithy_schema::ShapeType::Structure,
85    "member",
86    0,
87);
88static CREATEAGENTINPUT_MEMBER_TAGS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
89    ::aws_smithy_schema::ShapeId::from_parts(
90        "com.amazonaws.datasync.synthetic#CreateAgentInput$Tags",
91        "com.amazonaws.datasync.synthetic",
92        "CreateAgentInput",
93    ),
94    ::aws_smithy_schema::ShapeType::List,
95    "Tags",
96    2,
97)
98.with_list_member(&CREATEAGENTINPUT_MEMBER_TAGS_MEMBER);
99static CREATEAGENTINPUT_MEMBER_VPC_ENDPOINT_ID: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
100    ::aws_smithy_schema::ShapeId::from_parts(
101        "com.amazonaws.datasync.synthetic#CreateAgentInput$VpcEndpointId",
102        "com.amazonaws.datasync.synthetic",
103        "CreateAgentInput",
104    ),
105    ::aws_smithy_schema::ShapeType::String,
106    "VpcEndpointId",
107    3,
108);
109static CREATEAGENTINPUT_MEMBER_SUBNET_ARNS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
110    ::aws_smithy_schema::ShapeId::from_parts(
111        "com.amazonaws.datasync#PLSubnetArnList$member",
112        "com.amazonaws.datasync",
113        "PLSubnetArnList",
114    ),
115    ::aws_smithy_schema::ShapeType::String,
116    "member",
117    0,
118);
119static CREATEAGENTINPUT_MEMBER_SUBNET_ARNS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
120    ::aws_smithy_schema::ShapeId::from_parts(
121        "com.amazonaws.datasync.synthetic#CreateAgentInput$SubnetArns",
122        "com.amazonaws.datasync.synthetic",
123        "CreateAgentInput",
124    ),
125    ::aws_smithy_schema::ShapeType::List,
126    "SubnetArns",
127    4,
128)
129.with_list_member(&CREATEAGENTINPUT_MEMBER_SUBNET_ARNS_MEMBER);
130static CREATEAGENTINPUT_MEMBER_SECURITY_GROUP_ARNS_MEMBER: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
131    ::aws_smithy_schema::ShapeId::from_parts(
132        "com.amazonaws.datasync#PLSecurityGroupArnList$member",
133        "com.amazonaws.datasync",
134        "PLSecurityGroupArnList",
135    ),
136    ::aws_smithy_schema::ShapeType::String,
137    "member",
138    0,
139);
140static CREATEAGENTINPUT_MEMBER_SECURITY_GROUP_ARNS: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_member(
141    ::aws_smithy_schema::ShapeId::from_parts(
142        "com.amazonaws.datasync.synthetic#CreateAgentInput$SecurityGroupArns",
143        "com.amazonaws.datasync.synthetic",
144        "CreateAgentInput",
145    ),
146    ::aws_smithy_schema::ShapeType::List,
147    "SecurityGroupArns",
148    5,
149)
150.with_list_member(&CREATEAGENTINPUT_MEMBER_SECURITY_GROUP_ARNS_MEMBER);
151static CREATEAGENTINPUT_SCHEMA: ::aws_smithy_schema::Schema<'static> = ::aws_smithy_schema::Schema::new_struct(
152    ::aws_smithy_schema::ShapeId::from_parts(
153        "com.amazonaws.datasync.synthetic#CreateAgentInput",
154        "com.amazonaws.datasync.synthetic",
155        "CreateAgentInput",
156    ),
157    ::aws_smithy_schema::ShapeType::Structure,
158    &[
159        &CREATEAGENTINPUT_MEMBER_ACTIVATION_KEY,
160        &CREATEAGENTINPUT_MEMBER_AGENT_NAME,
161        &CREATEAGENTINPUT_MEMBER_TAGS,
162        &CREATEAGENTINPUT_MEMBER_VPC_ENDPOINT_ID,
163        &CREATEAGENTINPUT_MEMBER_SUBNET_ARNS,
164        &CREATEAGENTINPUT_MEMBER_SECURITY_GROUP_ARNS,
165    ],
166)
167.with_payload_hint(::aws_smithy_schema::PayloadHint::NoStructPayload)
168.with_original_name("CreateAgentRequest");
169impl CreateAgentInput {
170    /// The schema for this shape.
171    pub const SCHEMA: &'static ::aws_smithy_schema::Schema<'static> = &CREATEAGENTINPUT_SCHEMA;
172}
173impl ::aws_smithy_schema::serde::SerializableStruct for CreateAgentInput {
174    fn schema(&self) -> &::aws_smithy_schema::Schema<'_> {
175        Self::SCHEMA
176    }
177
178    #[allow(unused_variables, clippy::diverging_sub_expression)]
179    fn serialize_members(
180        &self,
181        ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
182    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
183        if let Some(ref val) = self.activation_key {
184            ser.write_string(&CREATEAGENTINPUT_MEMBER_ACTIVATION_KEY, val)?;
185        }
186        if let Some(ref val) = self.agent_name {
187            ser.write_string(&CREATEAGENTINPUT_MEMBER_AGENT_NAME, val)?;
188        }
189        if let Some(ref val) = self.tags {
190            ser.write_list(
191                &CREATEAGENTINPUT_MEMBER_TAGS,
192                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
193                    for item in val {
194                        ser.write_struct(crate::types::TagListEntry::SCHEMA, item)?;
195                    }
196                    Ok(())
197                },
198            )?;
199        }
200        if let Some(ref val) = self.vpc_endpoint_id {
201            ser.write_string(&CREATEAGENTINPUT_MEMBER_VPC_ENDPOINT_ID, val)?;
202        }
203        if let Some(ref val) = self.subnet_arns {
204            ser.write_list(
205                &CREATEAGENTINPUT_MEMBER_SUBNET_ARNS,
206                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
207                    for item in val {
208                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
209                    }
210                    Ok(())
211                },
212            )?;
213        }
214        if let Some(ref val) = self.security_group_arns {
215            ser.write_list(
216                &CREATEAGENTINPUT_MEMBER_SECURITY_GROUP_ARNS,
217                &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
218                    for item in val {
219                        ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
220                    }
221                    Ok(())
222                },
223            )?;
224        }
225        Ok(())
226    }
227}
228impl crate::operation::create_agent::builders::CreateAgentInputBuilder {
229    #[allow(
230        unused_variables,
231        unreachable_code,
232        clippy::single_match,
233        clippy::match_single_binding,
234        clippy::diverging_sub_expression
235    )]
236    pub(crate) fn deserialize_members(
237        &mut self,
238        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
239    ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
240        deserializer.read_struct(&CREATEAGENTINPUT_SCHEMA, &mut |member, deser| {
241            match member.member_index() {
242                Some(0) => {
243                    if deser.is_null() {
244                        deser.read_null()?;
245                    } else {
246                        self.activation_key = Some(deser.read_string(member)?);
247                    }
248                }
249                Some(1) => {
250                    if deser.is_null() {
251                        deser.read_null()?;
252                    } else {
253                        self.agent_name = Some(deser.read_string(member)?);
254                    }
255                }
256                Some(2) => {
257                    if deser.is_null() {
258                        deser.read_null()?;
259                    } else {
260                        self.tags = Some({
261                            let mut container = Vec::new();
262                            deser.read_list(member, &mut |deser| {
263                                container.push(crate::types::TagListEntry::deserialize(deser)?);
264                                Ok(())
265                            })?;
266                            container
267                        });
268                    }
269                }
270                Some(3) => {
271                    if deser.is_null() {
272                        deser.read_null()?;
273                    } else {
274                        self.vpc_endpoint_id = Some(deser.read_string(member)?);
275                    }
276                }
277                Some(4) => {
278                    if deser.is_null() {
279                        deser.read_null()?;
280                    } else {
281                        self.subnet_arns = Some(deser.read_string_list(member)?);
282                    }
283                }
284                Some(5) => {
285                    if deser.is_null() {
286                        deser.read_null()?;
287                    } else {
288                        self.security_group_arns = Some(deser.read_string_list(member)?);
289                    }
290                }
291                _ => {}
292            }
293            Ok(())
294        })
295    }
296}
297
298impl CreateAgentInput {
299    /// Deserializes this structure from a [`ShapeDeserializer`].
300    pub fn deserialize(
301        deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
302    ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
303        let mut builder = Self::builder();
304        builder.deserialize_members(deserializer)?;
305        builder.activation_key = builder.activation_key.or(Some(String::new()));
306        builder.build().map_err(|e| aws_smithy_schema::serde::SerdeError::custom(e.to_string()))
307    }
308}
309impl CreateAgentInput {
310    /// Creates a new builder-style object to manufacture [`CreateAgentInput`](crate::operation::create_agent::CreateAgentInput).
311    pub fn builder() -> crate::operation::create_agent::builders::CreateAgentInputBuilder {
312        crate::operation::create_agent::builders::CreateAgentInputBuilder::default()
313    }
314}
315
316/// A builder for [`CreateAgentInput`](crate::operation::create_agent::CreateAgentInput).
317#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
318#[non_exhaustive]
319pub struct CreateAgentInputBuilder {
320    pub(crate) activation_key: ::std::option::Option<::std::string::String>,
321    pub(crate) agent_name: ::std::option::Option<::std::string::String>,
322    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>,
323    pub(crate) vpc_endpoint_id: ::std::option::Option<::std::string::String>,
324    pub(crate) subnet_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
325    pub(crate) security_group_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
326}
327impl CreateAgentInputBuilder {
328    /// <p>Specifies your DataSync agent's activation key. If you don't have an activation key, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">Activating your agent</a>.</p>
329    /// This field is required.
330    pub fn activation_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
331        self.activation_key = ::std::option::Option::Some(input.into());
332        self
333    }
334    /// <p>Specifies your DataSync agent's activation key. If you don't have an activation key, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">Activating your agent</a>.</p>
335    pub fn set_activation_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
336        self.activation_key = input;
337        self
338    }
339    /// <p>Specifies your DataSync agent's activation key. If you don't have an activation key, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/activate-agent.html">Activating your agent</a>.</p>
340    pub fn get_activation_key(&self) -> &::std::option::Option<::std::string::String> {
341        &self.activation_key
342    }
343    /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
344    pub fn agent_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
345        self.agent_name = ::std::option::Option::Some(input.into());
346        self
347    }
348    /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
349    pub fn set_agent_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
350        self.agent_name = input;
351        self
352    }
353    /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
354    pub fn get_agent_name(&self) -> &::std::option::Option<::std::string::String> {
355        &self.agent_name
356    }
357    /// Appends an item to `tags`.
358    ///
359    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
360    ///
361    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least one tag for your agent.</p>
362    pub fn tags(mut self, input: crate::types::TagListEntry) -> Self {
363        let mut v = self.tags.unwrap_or_default();
364        v.push(input);
365        self.tags = ::std::option::Option::Some(v);
366        self
367    }
368    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least one tag for your agent.</p>
369    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
370        self.tags = input;
371        self
372    }
373    /// <p>Specifies labels that help you categorize, filter, and search for your Amazon Web Services resources. We recommend creating at least one tag for your agent.</p>
374    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
375        &self.tags
376    }
377    /// <p>Specifies the ID of the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#datasync-in-vpc">VPC service endpoint</a> that you're using. For example, a VPC endpoint ID looks like <code>vpce-01234d5aff67890e1</code>.</p><important>
378    /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
379    /// </important>
380    /// <p>The endpoint ID is informational. DataSync doesn't verify it or use it to connect to your agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
381    pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
382        self.vpc_endpoint_id = ::std::option::Option::Some(input.into());
383        self
384    }
385    /// <p>Specifies the ID of the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#datasync-in-vpc">VPC service endpoint</a> that you're using. For example, a VPC endpoint ID looks like <code>vpce-01234d5aff67890e1</code>.</p><important>
386    /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
387    /// </important>
388    /// <p>The endpoint ID is informational. DataSync doesn't verify it or use it to connect to your agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
389    pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
390        self.vpc_endpoint_id = input;
391        self
392    }
393    /// <p>Specifies the ID of the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#datasync-in-vpc">VPC service endpoint</a> that you're using. For example, a VPC endpoint ID looks like <code>vpce-01234d5aff67890e1</code>.</p><important>
394    /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
395    /// </important>
396    /// <p>The endpoint ID is informational. DataSync doesn't verify it or use it to connect to your agent. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
397    pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
398        &self.vpc_endpoint_id
399    }
400    /// Appends an item to `subnet_arns`.
401    ///
402    /// To override the contents of this collection use [`set_subnet_arns`](Self::set_subnet_arns).
403    ///
404    /// <p>Specifies the ARN of the subnet where DataSync creates the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/required-network-interfaces.html">network interfaces</a> that handle data transfer traffic for your tasks. You can only specify one ARN.</p>
405    /// <p>The subnet doesn't have to be the subnet that contains your VPC service endpoint. The subnet can be one that another Amazon Web Services account shared with you through <a href="https://docs.aws.amazon.com/ram/latest/userguide/what-is.html">RAM</a>, in which case the ARN must specify the account that owns the subnet. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
406    pub fn subnet_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
407        let mut v = self.subnet_arns.unwrap_or_default();
408        v.push(input.into());
409        self.subnet_arns = ::std::option::Option::Some(v);
410        self
411    }
412    /// <p>Specifies the ARN of the subnet where DataSync creates the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/required-network-interfaces.html">network interfaces</a> that handle data transfer traffic for your tasks. You can only specify one ARN.</p>
413    /// <p>The subnet doesn't have to be the subnet that contains your VPC service endpoint. The subnet can be one that another Amazon Web Services account shared with you through <a href="https://docs.aws.amazon.com/ram/latest/userguide/what-is.html">RAM</a>, in which case the ARN must specify the account that owns the subnet. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
414    pub fn set_subnet_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
415        self.subnet_arns = input;
416        self
417    }
418    /// <p>Specifies the ARN of the subnet where DataSync creates the <a href="https://docs.aws.amazon.com/datasync/latest/userguide/required-network-interfaces.html">network interfaces</a> that handle data transfer traffic for your tasks. You can only specify one ARN.</p>
419    /// <p>The subnet doesn't have to be the subnet that contains your VPC service endpoint. The subnet can be one that another Amazon Web Services account shared with you through <a href="https://docs.aws.amazon.com/ram/latest/userguide/what-is.html">RAM</a>, in which case the ARN must specify the account that owns the subnet. For more information, see <a href="https://docs.aws.amazon.com/datasync/latest/userguide/choose-service-endpoint.html#vpc-endpoint-multiple-subnets">Using a single VPC service endpoint across multiple subnets</a>.</p>
420    pub fn get_subnet_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
421        &self.subnet_arns
422    }
423    /// Appends an item to `security_group_arns`.
424    ///
425    /// To override the contents of this collection use [`set_security_group_arns`](Self::set_security_group_arns).
426    ///
427    /// <p>Specifies the Amazon Resource Name (ARN) of the security group that allows traffic between your agent and VPC service endpoint. You can only specify one ARN.</p>
428    /// <p>The ARN must specify your own account, even when the security group was shared with you from the account that owns the VPC. The security group must belong to the same VPC as the subnet that you specify in <code>SubnetArns</code>.</p>
429    pub fn security_group_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
430        let mut v = self.security_group_arns.unwrap_or_default();
431        v.push(input.into());
432        self.security_group_arns = ::std::option::Option::Some(v);
433        self
434    }
435    /// <p>Specifies the Amazon Resource Name (ARN) of the security group that allows traffic between your agent and VPC service endpoint. You can only specify one ARN.</p>
436    /// <p>The ARN must specify your own account, even when the security group was shared with you from the account that owns the VPC. The security group must belong to the same VPC as the subnet that you specify in <code>SubnetArns</code>.</p>
437    pub fn set_security_group_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
438        self.security_group_arns = input;
439        self
440    }
441    /// <p>Specifies the Amazon Resource Name (ARN) of the security group that allows traffic between your agent and VPC service endpoint. You can only specify one ARN.</p>
442    /// <p>The ARN must specify your own account, even when the security group was shared with you from the account that owns the VPC. The security group must belong to the same VPC as the subnet that you specify in <code>SubnetArns</code>.</p>
443    pub fn get_security_group_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
444        &self.security_group_arns
445    }
446    /// Consumes the builder and constructs a [`CreateAgentInput`](crate::operation::create_agent::CreateAgentInput).
447    pub fn build(self) -> ::std::result::Result<crate::operation::create_agent::CreateAgentInput, ::aws_smithy_types::error::operation::BuildError> {
448        ::std::result::Result::Ok(crate::operation::create_agent::CreateAgentInput {
449            activation_key: self.activation_key,
450            agent_name: self.agent_name,
451            tags: self.tags,
452            vpc_endpoint_id: self.vpc_endpoint_id,
453            subnet_arns: self.subnet_arns,
454            security_group_arns: self.security_group_arns,
455        })
456    }
457}