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}
62impl CreateAgentInput {
63    /// Creates a new builder-style object to manufacture [`CreateAgentInput`](crate::operation::create_agent::CreateAgentInput).
64    pub fn builder() -> crate::operation::create_agent::builders::CreateAgentInputBuilder {
65        crate::operation::create_agent::builders::CreateAgentInputBuilder::default()
66    }
67}
68
69/// A builder for [`CreateAgentInput`](crate::operation::create_agent::CreateAgentInput).
70#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
71#[non_exhaustive]
72pub struct CreateAgentInputBuilder {
73    pub(crate) activation_key: ::std::option::Option<::std::string::String>,
74    pub(crate) agent_name: ::std::option::Option<::std::string::String>,
75    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>,
76    pub(crate) vpc_endpoint_id: ::std::option::Option<::std::string::String>,
77    pub(crate) subnet_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
78    pub(crate) security_group_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
79}
80impl CreateAgentInputBuilder {
81    /// <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>
82    /// This field is required.
83    pub fn activation_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.activation_key = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <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>
88    pub fn set_activation_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.activation_key = input;
90        self
91    }
92    /// <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>
93    pub fn get_activation_key(&self) -> &::std::option::Option<::std::string::String> {
94        &self.activation_key
95    }
96    /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
97    pub fn agent_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98        self.agent_name = ::std::option::Option::Some(input.into());
99        self
100    }
101    /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
102    pub fn set_agent_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103        self.agent_name = input;
104        self
105    }
106    /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
107    pub fn get_agent_name(&self) -> &::std::option::Option<::std::string::String> {
108        &self.agent_name
109    }
110    /// Appends an item to `tags`.
111    ///
112    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
113    ///
114    /// <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>
115    pub fn tags(mut self, input: crate::types::TagListEntry) -> Self {
116        let mut v = self.tags.unwrap_or_default();
117        v.push(input);
118        self.tags = ::std::option::Option::Some(v);
119        self
120    }
121    /// <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>
122    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
123        self.tags = input;
124        self
125    }
126    /// <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>
127    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
128        &self.tags
129    }
130    /// <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>
131    /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
132    /// </important>
133    /// <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>
134    pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.vpc_endpoint_id = ::std::option::Option::Some(input.into());
136        self
137    }
138    /// <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>
139    /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
140    /// </important>
141    /// <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>
142    pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.vpc_endpoint_id = input;
144        self
145    }
146    /// <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>
147    /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
148    /// </important>
149    /// <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>
150    pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
151        &self.vpc_endpoint_id
152    }
153    /// Appends an item to `subnet_arns`.
154    ///
155    /// To override the contents of this collection use [`set_subnet_arns`](Self::set_subnet_arns).
156    ///
157    /// <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>
158    /// <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>
159    pub fn subnet_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        let mut v = self.subnet_arns.unwrap_or_default();
161        v.push(input.into());
162        self.subnet_arns = ::std::option::Option::Some(v);
163        self
164    }
165    /// <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>
166    /// <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>
167    pub fn set_subnet_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
168        self.subnet_arns = input;
169        self
170    }
171    /// <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>
172    /// <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>
173    pub fn get_subnet_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
174        &self.subnet_arns
175    }
176    /// Appends an item to `security_group_arns`.
177    ///
178    /// To override the contents of this collection use [`set_security_group_arns`](Self::set_security_group_arns).
179    ///
180    /// <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>
181    /// <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>
182    pub fn security_group_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        let mut v = self.security_group_arns.unwrap_or_default();
184        v.push(input.into());
185        self.security_group_arns = ::std::option::Option::Some(v);
186        self
187    }
188    /// <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>
189    /// <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>
190    pub fn set_security_group_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
191        self.security_group_arns = input;
192        self
193    }
194    /// <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>
195    /// <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>
196    pub fn get_security_group_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
197        &self.security_group_arns
198    }
199    /// Consumes the builder and constructs a [`CreateAgentInput`](crate::operation::create_agent::CreateAgentInput).
200    pub fn build(self) -> ::std::result::Result<crate::operation::create_agent::CreateAgentInput, ::aws_smithy_types::error::operation::BuildError> {
201        ::std::result::Result::Ok(crate::operation::create_agent::CreateAgentInput {
202            activation_key: self.activation_key,
203            agent_name: self.agent_name,
204            tags: self.tags,
205            vpc_endpoint_id: self.vpc_endpoint_id,
206            subnet_arns: self.subnet_arns,
207            security_group_arns: self.security_group_arns,
208        })
209    }
210}