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 pub vpc_endpoint_id: ::std::option::Option<::std::string::String>,
17 /// <p>Specifies the ARN of the subnet where your VPC service endpoint is located. You can only specify one ARN.</p>
18 pub subnet_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
19 /// <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>
20 pub security_group_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
21}
22impl CreateAgentInput {
23 /// <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>
24 pub fn activation_key(&self) -> ::std::option::Option<&str> {
25 self.activation_key.as_deref()
26 }
27 /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
28 pub fn agent_name(&self) -> ::std::option::Option<&str> {
29 self.agent_name.as_deref()
30 }
31 /// <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>
32 ///
33 /// 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()`.
34 pub fn tags(&self) -> &[crate::types::TagListEntry] {
35 self.tags.as_deref().unwrap_or_default()
36 }
37 /// <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>
38 /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
39 /// </important>
40 pub fn vpc_endpoint_id(&self) -> ::std::option::Option<&str> {
41 self.vpc_endpoint_id.as_deref()
42 }
43 /// <p>Specifies the ARN of the subnet where your VPC service endpoint is located. You can only specify one ARN.</p>
44 ///
45 /// 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()`.
46 pub fn subnet_arns(&self) -> &[::std::string::String] {
47 self.subnet_arns.as_deref().unwrap_or_default()
48 }
49 /// <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>
50 ///
51 /// 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()`.
52 pub fn security_group_arns(&self) -> &[::std::string::String] {
53 self.security_group_arns.as_deref().unwrap_or_default()
54 }
55}
56impl CreateAgentInput {
57 /// Creates a new builder-style object to manufacture [`CreateAgentInput`](crate::operation::create_agent::CreateAgentInput).
58 pub fn builder() -> crate::operation::create_agent::builders::CreateAgentInputBuilder {
59 crate::operation::create_agent::builders::CreateAgentInputBuilder::default()
60 }
61}
62
63/// A builder for [`CreateAgentInput`](crate::operation::create_agent::CreateAgentInput).
64#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
65#[non_exhaustive]
66pub struct CreateAgentInputBuilder {
67 pub(crate) activation_key: ::std::option::Option<::std::string::String>,
68 pub(crate) agent_name: ::std::option::Option<::std::string::String>,
69 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>,
70 pub(crate) vpc_endpoint_id: ::std::option::Option<::std::string::String>,
71 pub(crate) subnet_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
72 pub(crate) security_group_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
73}
74impl CreateAgentInputBuilder {
75 /// <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>
76 /// This field is required.
77 pub fn activation_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78 self.activation_key = ::std::option::Option::Some(input.into());
79 self
80 }
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 pub fn set_activation_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83 self.activation_key = input;
84 self
85 }
86 /// <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>
87 pub fn get_activation_key(&self) -> &::std::option::Option<::std::string::String> {
88 &self.activation_key
89 }
90 /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
91 pub fn agent_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92 self.agent_name = ::std::option::Option::Some(input.into());
93 self
94 }
95 /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
96 pub fn set_agent_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97 self.agent_name = input;
98 self
99 }
100 /// <p>Specifies a name for your agent. We recommend specifying a name that you can remember.</p>
101 pub fn get_agent_name(&self) -> &::std::option::Option<::std::string::String> {
102 &self.agent_name
103 }
104 /// Appends an item to `tags`.
105 ///
106 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
107 ///
108 /// <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>
109 pub fn tags(mut self, input: crate::types::TagListEntry) -> Self {
110 let mut v = self.tags.unwrap_or_default();
111 v.push(input);
112 self.tags = ::std::option::Option::Some(v);
113 self
114 }
115 /// <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>
116 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>>) -> Self {
117 self.tags = input;
118 self
119 }
120 /// <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>
121 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagListEntry>> {
122 &self.tags
123 }
124 /// <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>
125 /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
126 /// </important>
127 pub fn vpc_endpoint_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.vpc_endpoint_id = ::std::option::Option::Some(input.into());
129 self
130 }
131 /// <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>
132 /// <p>The VPC service endpoint you use must include the DataSync service name (for example, <code>com.amazonaws.us-east-2.datasync</code>).</p>
133 /// </important>
134 pub fn set_vpc_endpoint_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.vpc_endpoint_id = input;
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 pub fn get_vpc_endpoint_id(&self) -> &::std::option::Option<::std::string::String> {
142 &self.vpc_endpoint_id
143 }
144 /// Appends an item to `subnet_arns`.
145 ///
146 /// To override the contents of this collection use [`set_subnet_arns`](Self::set_subnet_arns).
147 ///
148 /// <p>Specifies the ARN of the subnet where your VPC service endpoint is located. You can only specify one ARN.</p>
149 pub fn subnet_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150 let mut v = self.subnet_arns.unwrap_or_default();
151 v.push(input.into());
152 self.subnet_arns = ::std::option::Option::Some(v);
153 self
154 }
155 /// <p>Specifies the ARN of the subnet where your VPC service endpoint is located. You can only specify one ARN.</p>
156 pub fn set_subnet_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
157 self.subnet_arns = input;
158 self
159 }
160 /// <p>Specifies the ARN of the subnet where your VPC service endpoint is located. You can only specify one ARN.</p>
161 pub fn get_subnet_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
162 &self.subnet_arns
163 }
164 /// Appends an item to `security_group_arns`.
165 ///
166 /// To override the contents of this collection use [`set_security_group_arns`](Self::set_security_group_arns).
167 ///
168 /// <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>
169 pub fn security_group_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170 let mut v = self.security_group_arns.unwrap_or_default();
171 v.push(input.into());
172 self.security_group_arns = ::std::option::Option::Some(v);
173 self
174 }
175 /// <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>
176 pub fn set_security_group_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
177 self.security_group_arns = input;
178 self
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 pub fn get_security_group_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
182 &self.security_group_arns
183 }
184 /// Consumes the builder and constructs a [`CreateAgentInput`](crate::operation::create_agent::CreateAgentInput).
185 pub fn build(self) -> ::std::result::Result<crate::operation::create_agent::CreateAgentInput, ::aws_smithy_types::error::operation::BuildError> {
186 ::std::result::Result::Ok(crate::operation::create_agent::CreateAgentInput {
187 activation_key: self.activation_key,
188 agent_name: self.agent_name,
189 tags: self.tags,
190 vpc_endpoint_id: self.vpc_endpoint_id,
191 subnet_arns: self.subnet_arns,
192 security_group_arns: self.security_group_arns,
193 })
194 }
195}