aws_sdk_route53/operation/associate_vpc_with_hosted_zone/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::associate_vpc_with_hosted_zone::_associate_vpc_with_hosted_zone_output::AssociateVpcWithHostedZoneOutputBuilder;
3
4pub use crate::operation::associate_vpc_with_hosted_zone::_associate_vpc_with_hosted_zone_input::AssociateVpcWithHostedZoneInputBuilder;
5
6impl crate::operation::associate_vpc_with_hosted_zone::builders::AssociateVpcWithHostedZoneInputBuilder {
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::associate_vpc_with_hosted_zone::AssociateVpcWithHostedZoneOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::associate_vpc_with_hosted_zone::AssociateVPCWithHostedZoneError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.associate_vpc_with_hosted_zone();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AssociateVPCWithHostedZone`.
24///
25/// <p>Associates an Amazon VPC with a private hosted zone.</p><important>
26/// <p>To perform the association, the VPC and the private hosted zone must already exist. You can't convert a public hosted zone into a private hosted zone.</p>
27/// </important> <note>
28/// <p>If you want to associate a VPC that was created by using one Amazon Web Services account with a private hosted zone that was created by using a different account, the Amazon Web Services account that created the private hosted zone must first submit a <code>CreateVPCAssociationAuthorization</code> request. Then the account that created the VPC must submit an <code>AssociateVPCWithHostedZone</code> request.</p>
29/// </note> <note>
30/// <p>When granting access, the hosted zone and the Amazon VPC must belong to the same partition. A partition is a group of Amazon Web Services Regions. Each Amazon Web Services account is scoped to one partition.</p>
31/// <p>The following are the supported partitions:</p>
32/// <ul>
33/// <li>
34/// <p><code>aws</code> - Amazon Web Services Regions</p></li>
35/// <li>
36/// <p><code>aws-cn</code> - China Regions</p></li>
37/// <li>
38/// <p><code>aws-us-gov</code> - Amazon Web Services GovCloud (US) Region</p></li>
39/// </ul>
40/// <p>For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Access Management</a> in the <i>Amazon Web Services General Reference</i>.</p>
41/// </note>
42#[derive(::std::clone::Clone, ::std::fmt::Debug)]
43pub struct AssociateVPCWithHostedZoneFluentBuilder {
44    handle: ::std::sync::Arc<crate::client::Handle>,
45    inner: crate::operation::associate_vpc_with_hosted_zone::builders::AssociateVpcWithHostedZoneInputBuilder,
46    config_override: ::std::option::Option<crate::config::Builder>,
47}
48impl
49    crate::client::customize::internal::CustomizableSend<
50        crate::operation::associate_vpc_with_hosted_zone::AssociateVpcWithHostedZoneOutput,
51        crate::operation::associate_vpc_with_hosted_zone::AssociateVPCWithHostedZoneError,
52    > for AssociateVPCWithHostedZoneFluentBuilder
53{
54    fn send(
55        self,
56        config_override: crate::config::Builder,
57    ) -> crate::client::customize::internal::BoxFuture<
58        crate::client::customize::internal::SendResult<
59            crate::operation::associate_vpc_with_hosted_zone::AssociateVpcWithHostedZoneOutput,
60            crate::operation::associate_vpc_with_hosted_zone::AssociateVPCWithHostedZoneError,
61        >,
62    > {
63        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
64    }
65}
66impl AssociateVPCWithHostedZoneFluentBuilder {
67    /// Creates a new `AssociateVPCWithHostedZoneFluentBuilder`.
68    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
69        Self {
70            handle,
71            inner: ::std::default::Default::default(),
72            config_override: ::std::option::Option::None,
73        }
74    }
75    /// Access the AssociateVPCWithHostedZone as a reference.
76    pub fn as_input(&self) -> &crate::operation::associate_vpc_with_hosted_zone::builders::AssociateVpcWithHostedZoneInputBuilder {
77        &self.inner
78    }
79    /// Sends the request and returns the response.
80    ///
81    /// If an error occurs, an `SdkError` will be returned with additional details that
82    /// can be matched against.
83    ///
84    /// By default, any retryable failures will be retried twice. Retry behavior
85    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
86    /// set when configuring the client.
87    pub async fn send(
88        self,
89    ) -> ::std::result::Result<
90        crate::operation::associate_vpc_with_hosted_zone::AssociateVpcWithHostedZoneOutput,
91        ::aws_smithy_runtime_api::client::result::SdkError<
92            crate::operation::associate_vpc_with_hosted_zone::AssociateVPCWithHostedZoneError,
93            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
94        >,
95    > {
96        let input = self
97            .inner
98            .build()
99            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
100        let runtime_plugins = crate::operation::associate_vpc_with_hosted_zone::AssociateVPCWithHostedZone::operation_runtime_plugins(
101            self.handle.runtime_plugins.clone(),
102            &self.handle.conf,
103            self.config_override,
104        );
105        crate::operation::associate_vpc_with_hosted_zone::AssociateVPCWithHostedZone::orchestrate(&runtime_plugins, input).await
106    }
107
108    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
109    pub fn customize(
110        self,
111    ) -> crate::client::customize::CustomizableOperation<
112        crate::operation::associate_vpc_with_hosted_zone::AssociateVpcWithHostedZoneOutput,
113        crate::operation::associate_vpc_with_hosted_zone::AssociateVPCWithHostedZoneError,
114        Self,
115    > {
116        crate::client::customize::CustomizableOperation::new(self)
117    }
118    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
119        self.set_config_override(::std::option::Option::Some(config_override.into()));
120        self
121    }
122
123    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
124        self.config_override = config_override;
125        self
126    }
127    /// <p>The ID of the private hosted zone that you want to associate an Amazon VPC with.</p>
128    /// <p>Note that you can't associate a VPC with a hosted zone that doesn't have an existing VPC association.</p>
129    pub fn hosted_zone_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.hosted_zone_id(input.into());
131        self
132    }
133    /// <p>The ID of the private hosted zone that you want to associate an Amazon VPC with.</p>
134    /// <p>Note that you can't associate a VPC with a hosted zone that doesn't have an existing VPC association.</p>
135    pub fn set_hosted_zone_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_hosted_zone_id(input);
137        self
138    }
139    /// <p>The ID of the private hosted zone that you want to associate an Amazon VPC with.</p>
140    /// <p>Note that you can't associate a VPC with a hosted zone that doesn't have an existing VPC association.</p>
141    pub fn get_hosted_zone_id(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_hosted_zone_id()
143    }
144    /// <p>A complex type that contains information about the VPC that you want to associate with a private hosted zone.</p>
145    pub fn vpc(mut self, input: crate::types::Vpc) -> Self {
146        self.inner = self.inner.vpc(input);
147        self
148    }
149    /// <p>A complex type that contains information about the VPC that you want to associate with a private hosted zone.</p>
150    pub fn set_vpc(mut self, input: ::std::option::Option<crate::types::Vpc>) -> Self {
151        self.inner = self.inner.set_vpc(input);
152        self
153    }
154    /// <p>A complex type that contains information about the VPC that you want to associate with a private hosted zone.</p>
155    pub fn get_vpc(&self) -> &::std::option::Option<crate::types::Vpc> {
156        self.inner.get_vpc()
157    }
158    /// <p><i>Optional:</i> A comment about the association request.</p>
159    pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.comment(input.into());
161        self
162    }
163    /// <p><i>Optional:</i> A comment about the association request.</p>
164    pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.inner = self.inner.set_comment(input);
166        self
167    }
168    /// <p><i>Optional:</i> A comment about the association request.</p>
169    pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
170        self.inner.get_comment()
171    }
172}