aws_sdk_ec2/operation/modify_vpc_attribute/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::modify_vpc_attribute::_modify_vpc_attribute_output::ModifyVpcAttributeOutputBuilder;
3
4pub use crate::operation::modify_vpc_attribute::_modify_vpc_attribute_input::ModifyVpcAttributeInputBuilder;
5
6impl crate::operation::modify_vpc_attribute::builders::ModifyVpcAttributeInputBuilder {
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::modify_vpc_attribute::ModifyVpcAttributeOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::modify_vpc_attribute::ModifyVpcAttributeError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.modify_vpc_attribute();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ModifyVpcAttribute`.
24///
25/// <p>Modifies the specified attribute of the specified VPC.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ModifyVpcAttributeFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::modify_vpc_attribute::builders::ModifyVpcAttributeInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::modify_vpc_attribute::ModifyVpcAttributeOutput,
35        crate::operation::modify_vpc_attribute::ModifyVpcAttributeError,
36    > for ModifyVpcAttributeFluentBuilder
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::modify_vpc_attribute::ModifyVpcAttributeOutput,
44            crate::operation::modify_vpc_attribute::ModifyVpcAttributeError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ModifyVpcAttributeFluentBuilder {
51    /// Creates a new `ModifyVpcAttributeFluentBuilder`.
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 ModifyVpcAttribute as a reference.
60    pub fn as_input(&self) -> &crate::operation::modify_vpc_attribute::builders::ModifyVpcAttributeInputBuilder {
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::modify_vpc_attribute::ModifyVpcAttributeOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::modify_vpc_attribute::ModifyVpcAttributeError,
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::modify_vpc_attribute::ModifyVpcAttribute::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::modify_vpc_attribute::ModifyVpcAttribute::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::modify_vpc_attribute::ModifyVpcAttributeOutput,
97        crate::operation::modify_vpc_attribute::ModifyVpcAttributeError,
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>Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not.</p>
112    /// <p>You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute. You can only enable DNS hostnames if you've enabled DNS support.</p>
113    pub fn enable_dns_hostnames(mut self, input: crate::types::AttributeBooleanValue) -> Self {
114        self.inner = self.inner.enable_dns_hostnames(input);
115        self
116    }
117    /// <p>Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not.</p>
118    /// <p>You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute. You can only enable DNS hostnames if you've enabled DNS support.</p>
119    pub fn set_enable_dns_hostnames(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
120        self.inner = self.inner.set_enable_dns_hostnames(input);
121        self
122    }
123    /// <p>Indicates whether the instances launched in the VPC get DNS hostnames. If enabled, instances in the VPC get DNS hostnames; otherwise, they do not.</p>
124    /// <p>You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute. You can only enable DNS hostnames if you've enabled DNS support.</p>
125    pub fn get_enable_dns_hostnames(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
126        self.inner.get_enable_dns_hostnames()
127    }
128    /// <p>Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled.</p>
129    /// <p>You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute.</p>
130    pub fn enable_dns_support(mut self, input: crate::types::AttributeBooleanValue) -> Self {
131        self.inner = self.inner.enable_dns_support(input);
132        self
133    }
134    /// <p>Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled.</p>
135    /// <p>You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute.</p>
136    pub fn set_enable_dns_support(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
137        self.inner = self.inner.set_enable_dns_support(input);
138        self
139    }
140    /// <p>Indicates whether the DNS resolution is supported for the VPC. If enabled, queries to the Amazon provided DNS server at the 169.254.169.253 IP address, or the reserved IP address at the base of the VPC network range "plus two" succeed. If disabled, the Amazon provided DNS service in the VPC that resolves public DNS hostnames to IP addresses is not enabled.</p>
141    /// <p>You cannot modify the DNS resolution and DNS hostnames attributes in the same request. Use separate requests for each attribute.</p>
142    pub fn get_enable_dns_support(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
143        self.inner.get_enable_dns_support()
144    }
145    /// <p>The ID of the VPC.</p>
146    pub fn vpc_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.vpc_id(input.into());
148        self
149    }
150    /// <p>The ID of the VPC.</p>
151    pub fn set_vpc_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_vpc_id(input);
153        self
154    }
155    /// <p>The ID of the VPC.</p>
156    pub fn get_vpc_id(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_vpc_id()
158    }
159    /// <p>Indicates whether Network Address Usage metrics are enabled for your VPC.</p>
160    pub fn enable_network_address_usage_metrics(mut self, input: crate::types::AttributeBooleanValue) -> Self {
161        self.inner = self.inner.enable_network_address_usage_metrics(input);
162        self
163    }
164    /// <p>Indicates whether Network Address Usage metrics are enabled for your VPC.</p>
165    pub fn set_enable_network_address_usage_metrics(mut self, input: ::std::option::Option<crate::types::AttributeBooleanValue>) -> Self {
166        self.inner = self.inner.set_enable_network_address_usage_metrics(input);
167        self
168    }
169    /// <p>Indicates whether Network Address Usage metrics are enabled for your VPC.</p>
170    pub fn get_enable_network_address_usage_metrics(&self) -> &::std::option::Option<crate::types::AttributeBooleanValue> {
171        self.inner.get_enable_network_address_usage_metrics()
172    }
173}