aws_sdk_ec2/operation/create_vpc_endpoint/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_vpc_endpoint::_create_vpc_endpoint_output::CreateVpcEndpointOutputBuilder;
3
4pub use crate::operation::create_vpc_endpoint::_create_vpc_endpoint_input::CreateVpcEndpointInputBuilder;
5
6impl crate::operation::create_vpc_endpoint::builders::CreateVpcEndpointInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_vpc_endpoint::CreateVpcEndpointOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_vpc_endpoint::CreateVpcEndpointError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_vpc_endpoint();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateVpcEndpoint`.
24///
25/// <p>Creates a VPC endpoint. A VPC endpoint provides a private connection between the specified VPC and the specified endpoint service. You can use an endpoint service provided by Amazon Web Services, an Amazon Web Services Marketplace Partner, or another Amazon Web Services account. For more information, see the <a href="https://docs.aws.amazon.com/vpc/latest/privatelink/">Amazon Web Services PrivateLink User Guide</a>.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateVpcEndpointFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_vpc_endpoint::builders::CreateVpcEndpointInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_vpc_endpoint::CreateVpcEndpointOutput,
35        crate::operation::create_vpc_endpoint::CreateVpcEndpointError,
36    > for CreateVpcEndpointFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_vpc_endpoint::CreateVpcEndpointOutput,
44            crate::operation::create_vpc_endpoint::CreateVpcEndpointError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateVpcEndpointFluentBuilder {
51    /// Creates a new `CreateVpcEndpointFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateVpcEndpoint as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_vpc_endpoint::builders::CreateVpcEndpointInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_vpc_endpoint::CreateVpcEndpointOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_vpc_endpoint::CreateVpcEndpointError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_vpc_endpoint::CreateVpcEndpoint::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_vpc_endpoint::CreateVpcEndpoint::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_vpc_endpoint::CreateVpcEndpointOutput,
97        crate::operation::create_vpc_endpoint::CreateVpcEndpointError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
112    pub fn dry_run(mut self, input: bool) -> Self {
113        self.inner = self.inner.dry_run(input);
114        self
115    }
116    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
117    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
118        self.inner = self.inner.set_dry_run(input);
119        self
120    }
121    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
122    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
123        self.inner.get_dry_run()
124    }
125    /// <p>The type of endpoint.</p>
126    /// <p>Default: Gateway</p>
127    pub fn vpc_endpoint_type(mut self, input: crate::types::VpcEndpointType) -> Self {
128        self.inner = self.inner.vpc_endpoint_type(input);
129        self
130    }
131    /// <p>The type of endpoint.</p>
132    /// <p>Default: Gateway</p>
133    pub fn set_vpc_endpoint_type(mut self, input: ::std::option::Option<crate::types::VpcEndpointType>) -> Self {
134        self.inner = self.inner.set_vpc_endpoint_type(input);
135        self
136    }
137    /// <p>The type of endpoint.</p>
138    /// <p>Default: Gateway</p>
139    pub fn get_vpc_endpoint_type(&self) -> &::std::option::Option<crate::types::VpcEndpointType> {
140        self.inner.get_vpc_endpoint_type()
141    }
142    /// <p>The ID of the VPC.</p>
143    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.vpc_id(input.into());
145        self
146    }
147    /// <p>The ID of the VPC.</p>
148    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_vpc_id(input);
150        self
151    }
152    /// <p>The ID of the VPC.</p>
153    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_vpc_id()
155    }
156    /// <p>The name of the endpoint service.</p>
157    pub fn service_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158        self.inner = self.inner.service_name(input.into());
159        self
160    }
161    /// <p>The name of the endpoint service.</p>
162    pub fn set_service_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_service_name(input);
164        self
165    }
166    /// <p>The name of the endpoint service.</p>
167    pub fn get_service_name(&self) -> &::std::option::Option<::std::string::String> {
168        self.inner.get_service_name()
169    }
170    /// <p>(Interface and gateway endpoints) A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.</p>
171    pub fn policy_document(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
172        self.inner = self.inner.policy_document(input.into());
173        self
174    }
175    /// <p>(Interface and gateway endpoints) A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.</p>
176    pub fn set_policy_document(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
177        self.inner = self.inner.set_policy_document(input);
178        self
179    }
180    /// <p>(Interface and gateway endpoints) A policy to attach to the endpoint that controls access to the service. The policy must be in valid JSON format. If this parameter is not specified, we attach a default policy that allows full access to the service.</p>
181    pub fn get_policy_document(&self) -> &::std::option::Option<::std::string::String> {
182        self.inner.get_policy_document()
183    }
184    ///
185    /// Appends an item to `RouteTableIds`.
186    ///
187    /// To override the contents of this collection use [`set_route_table_ids`](Self::set_route_table_ids).
188    ///
189    /// <p>(Gateway endpoint) The route table IDs.</p>
190    pub fn route_table_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191        self.inner = self.inner.route_table_ids(input.into());
192        self
193    }
194    /// <p>(Gateway endpoint) The route table IDs.</p>
195    pub fn set_route_table_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
196        self.inner = self.inner.set_route_table_ids(input);
197        self
198    }
199    /// <p>(Gateway endpoint) The route table IDs.</p>
200    pub fn get_route_table_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
201        self.inner.get_route_table_ids()
202    }
203    ///
204    /// Appends an item to `SubnetIds`.
205    ///
206    /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
207    ///
208    /// <p>(Interface and Gateway Load Balancer endpoints) The IDs of the subnets in which to create endpoint network interfaces. For a Gateway Load Balancer endpoint, you can specify only one subnet.</p>
209    pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
210        self.inner = self.inner.subnet_ids(input.into());
211        self
212    }
213    /// <p>(Interface and Gateway Load Balancer endpoints) The IDs of the subnets in which to create endpoint network interfaces. For a Gateway Load Balancer endpoint, you can specify only one subnet.</p>
214    pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
215        self.inner = self.inner.set_subnet_ids(input);
216        self
217    }
218    /// <p>(Interface and Gateway Load Balancer endpoints) The IDs of the subnets in which to create endpoint network interfaces. For a Gateway Load Balancer endpoint, you can specify only one subnet.</p>
219    pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
220        self.inner.get_subnet_ids()
221    }
222    ///
223    /// Appends an item to `SecurityGroupIds`.
224    ///
225    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
226    ///
227    /// <p>(Interface endpoint) The IDs of the security groups to associate with the endpoint network interfaces. If this parameter is not specified, we use the default security group for the VPC.</p>
228    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
229        self.inner = self.inner.security_group_ids(input.into());
230        self
231    }
232    /// <p>(Interface endpoint) The IDs of the security groups to associate with the endpoint network interfaces. If this parameter is not specified, we use the default security group for the VPC.</p>
233    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
234        self.inner = self.inner.set_security_group_ids(input);
235        self
236    }
237    /// <p>(Interface endpoint) The IDs of the security groups to associate with the endpoint network interfaces. If this parameter is not specified, we use the default security group for the VPC.</p>
238    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
239        self.inner.get_security_group_ids()
240    }
241    /// <p>The IP address type for the endpoint.</p>
242    pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
243        self.inner = self.inner.ip_address_type(input);
244        self
245    }
246    /// <p>The IP address type for the endpoint.</p>
247    pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
248        self.inner = self.inner.set_ip_address_type(input);
249        self
250    }
251    /// <p>The IP address type for the endpoint.</p>
252    pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
253        self.inner.get_ip_address_type()
254    }
255    /// <p>The DNS options for the endpoint.</p>
256    pub fn dns_options(mut self, input: crate::types::DnsOptionsSpecification) -> Self {
257        self.inner = self.inner.dns_options(input);
258        self
259    }
260    /// <p>The DNS options for the endpoint.</p>
261    pub fn set_dns_options(mut self, input: ::std::option::Option<crate::types::DnsOptionsSpecification>) -> Self {
262        self.inner = self.inner.set_dns_options(input);
263        self
264    }
265    /// <p>The DNS options for the endpoint.</p>
266    pub fn get_dns_options(&self) -> &::std::option::Option<crate::types::DnsOptionsSpecification> {
267        self.inner.get_dns_options()
268    }
269    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">How to ensure idempotency</a>.</p>
270    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271        self.inner = self.inner.client_token(input.into());
272        self
273    }
274    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">How to ensure idempotency</a>.</p>
275    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276        self.inner = self.inner.set_client_token(input);
277        self
278    }
279    /// <p>Unique, case-sensitive identifier that you provide to ensure the idempotency of the request. For more information, see <a href="https://docs.aws.amazon.com/ec2/latest/devguide/ec2-api-idempotency.html">How to ensure idempotency</a>.</p>
280    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
281        self.inner.get_client_token()
282    }
283    /// <p>(Interface endpoint) Indicates whether to associate a private hosted zone with the specified VPC. The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, <code>kinesis.us-east-1.amazonaws.com</code>), which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service.</p>
284    /// <p>To use a private hosted zone, you must set the following VPC attributes to <code>true</code>: <code>enableDnsHostnames</code> and <code>enableDnsSupport</code>. Use <code>ModifyVpcAttribute</code> to set the VPC attributes.</p>
285    pub fn private_dns_enabled(mut self, input: bool) -> Self {
286        self.inner = self.inner.private_dns_enabled(input);
287        self
288    }
289    /// <p>(Interface endpoint) Indicates whether to associate a private hosted zone with the specified VPC. The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, <code>kinesis.us-east-1.amazonaws.com</code>), which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service.</p>
290    /// <p>To use a private hosted zone, you must set the following VPC attributes to <code>true</code>: <code>enableDnsHostnames</code> and <code>enableDnsSupport</code>. Use <code>ModifyVpcAttribute</code> to set the VPC attributes.</p>
291    pub fn set_private_dns_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
292        self.inner = self.inner.set_private_dns_enabled(input);
293        self
294    }
295    /// <p>(Interface endpoint) Indicates whether to associate a private hosted zone with the specified VPC. The private hosted zone contains a record set for the default public DNS name for the service for the Region (for example, <code>kinesis.us-east-1.amazonaws.com</code>), which resolves to the private IP addresses of the endpoint network interfaces in the VPC. This enables you to make requests to the default public DNS name for the service instead of the public DNS names that are automatically generated by the VPC endpoint service.</p>
296    /// <p>To use a private hosted zone, you must set the following VPC attributes to <code>true</code>: <code>enableDnsHostnames</code> and <code>enableDnsSupport</code>. Use <code>ModifyVpcAttribute</code> to set the VPC attributes.</p>
297    pub fn get_private_dns_enabled(&self) -> &::std::option::Option<bool> {
298        self.inner.get_private_dns_enabled()
299    }
300    ///
301    /// Appends an item to `TagSpecifications`.
302    ///
303    /// To override the contents of this collection use [`set_tag_specifications`](Self::set_tag_specifications).
304    ///
305    /// <p>The tags to associate with the endpoint.</p>
306    pub fn tag_specifications(mut self, input: crate::types::TagSpecification) -> Self {
307        self.inner = self.inner.tag_specifications(input);
308        self
309    }
310    /// <p>The tags to associate with the endpoint.</p>
311    pub fn set_tag_specifications(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>>) -> Self {
312        self.inner = self.inner.set_tag_specifications(input);
313        self
314    }
315    /// <p>The tags to associate with the endpoint.</p>
316    pub fn get_tag_specifications(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagSpecification>> {
317        self.inner.get_tag_specifications()
318    }
319    ///
320    /// Appends an item to `SubnetConfigurations`.
321    ///
322    /// To override the contents of this collection use [`set_subnet_configurations`](Self::set_subnet_configurations).
323    ///
324    /// <p>The subnet configurations for the endpoint.</p>
325    pub fn subnet_configurations(mut self, input: crate::types::SubnetConfiguration) -> Self {
326        self.inner = self.inner.subnet_configurations(input);
327        self
328    }
329    /// <p>The subnet configurations for the endpoint.</p>
330    pub fn set_subnet_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SubnetConfiguration>>) -> Self {
331        self.inner = self.inner.set_subnet_configurations(input);
332        self
333    }
334    /// <p>The subnet configurations for the endpoint.</p>
335    pub fn get_subnet_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SubnetConfiguration>> {
336        self.inner.get_subnet_configurations()
337    }
338    /// <p>The Amazon Resource Name (ARN) of a service network that will be associated with the VPC endpoint of type service-network.</p>
339    pub fn service_network_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
340        self.inner = self.inner.service_network_arn(input.into());
341        self
342    }
343    /// <p>The Amazon Resource Name (ARN) of a service network that will be associated with the VPC endpoint of type service-network.</p>
344    pub fn set_service_network_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
345        self.inner = self.inner.set_service_network_arn(input);
346        self
347    }
348    /// <p>The Amazon Resource Name (ARN) of a service network that will be associated with the VPC endpoint of type service-network.</p>
349    pub fn get_service_network_arn(&self) -> &::std::option::Option<::std::string::String> {
350        self.inner.get_service_network_arn()
351    }
352    /// <p>The Amazon Resource Name (ARN) of a resource configuration that will be associated with the VPC endpoint of type resource.</p>
353    pub fn resource_configuration_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
354        self.inner = self.inner.resource_configuration_arn(input.into());
355        self
356    }
357    /// <p>The Amazon Resource Name (ARN) of a resource configuration that will be associated with the VPC endpoint of type resource.</p>
358    pub fn set_resource_configuration_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
359        self.inner = self.inner.set_resource_configuration_arn(input);
360        self
361    }
362    /// <p>The Amazon Resource Name (ARN) of a resource configuration that will be associated with the VPC endpoint of type resource.</p>
363    pub fn get_resource_configuration_arn(&self) -> &::std::option::Option<::std::string::String> {
364        self.inner.get_resource_configuration_arn()
365    }
366    /// <p>The Region where the service is hosted. The default is the current Region.</p>
367    pub fn service_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
368        self.inner = self.inner.service_region(input.into());
369        self
370    }
371    /// <p>The Region where the service is hosted. The default is the current Region.</p>
372    pub fn set_service_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
373        self.inner = self.inner.set_service_region(input);
374        self
375    }
376    /// <p>The Region where the service is hosted. The default is the current Region.</p>
377    pub fn get_service_region(&self) -> &::std::option::Option<::std::string::String> {
378        self.inner.get_service_region()
379    }
380}