aws_sdk_route53/operation/delete_hosted_zone/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_hosted_zone::_delete_hosted_zone_output::DeleteHostedZoneOutputBuilder;
3
4pub use crate::operation::delete_hosted_zone::_delete_hosted_zone_input::DeleteHostedZoneInputBuilder;
5
6impl crate::operation::delete_hosted_zone::builders::DeleteHostedZoneInputBuilder {
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::delete_hosted_zone::DeleteHostedZoneOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_hosted_zone::DeleteHostedZoneError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_hosted_zone();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteHostedZone`.
24///
25/// <p>Deletes a hosted zone.</p>
26/// <p>If the hosted zone was created by another service, such as Cloud Map, see <a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/DeleteHostedZone.html#delete-public-hosted-zone-created-by-another-service">Deleting Public Hosted Zones That Were Created by Another Service</a> in the <i>Amazon Route&nbsp;53 Developer Guide</i> for information about how to delete it. (The process is the same for public and private hosted zones that were created by another service.)</p>
27/// <p>If you want to keep your domain registration but you want to stop routing internet traffic to your website or web application, we recommend that you delete resource record sets in the hosted zone instead of deleting the hosted zone.</p><important>
28/// <p>If you delete a hosted zone, you can't undelete it. You must create a new hosted zone and update the name servers for your domain registration, which can require up to 48 hours to take effect. (If you delegated responsibility for a subdomain to a hosted zone and you delete the child hosted zone, you must update the name servers in the parent hosted zone.) In addition, if you delete a hosted zone, someone could hijack the domain and route traffic to their own resources using your domain name.</p>
29/// </important>
30/// <p>If you want to avoid the monthly charge for the hosted zone, you can transfer DNS service for the domain to a free DNS service. When you transfer DNS service, you have to update the name servers for the domain registration. If the domain is registered with Route&nbsp;53, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_domains_UpdateDomainNameservers.html">UpdateDomainNameservers</a> for information about how to replace Route&nbsp;53 name servers with name servers for the new DNS service. If the domain is registered with another registrar, use the method provided by the registrar to update name servers for the domain registration. For more information, perform an internet search on "free DNS service."</p>
31/// <p>You can delete a hosted zone only if it contains only the default SOA and NS records and has DNSSEC signing disabled. If the hosted zone contains other records or has DNSSEC enabled, you must delete the records and disable DNSSEC before deletion. Attempting to delete a hosted zone with additional records or DNSSEC enabled returns a <code>HostedZoneNotEmpty</code> error. For information about deleting records, see <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_ChangeResourceRecordSets.html">ChangeResourceRecordSets</a>.</p>
32/// <p>To verify that the hosted zone has been deleted, do one of the following:</p>
33/// <ul>
34/// <li>
35/// <p>Use the <code>GetHostedZone</code> action to request information about the hosted zone.</p></li>
36/// <li>
37/// <p>Use the <code>ListHostedZones</code> action to get a list of the hosted zones associated with the current Amazon Web Services account.</p></li>
38/// </ul>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct DeleteHostedZoneFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::delete_hosted_zone::builders::DeleteHostedZoneInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::delete_hosted_zone::DeleteHostedZoneOutput,
48        crate::operation::delete_hosted_zone::DeleteHostedZoneError,
49    > for DeleteHostedZoneFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::delete_hosted_zone::DeleteHostedZoneOutput,
57            crate::operation::delete_hosted_zone::DeleteHostedZoneError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl DeleteHostedZoneFluentBuilder {
64    /// Creates a new `DeleteHostedZoneFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the DeleteHostedZone as a reference.
73    pub fn as_input(&self) -> &crate::operation::delete_hosted_zone::builders::DeleteHostedZoneInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::delete_hosted_zone::DeleteHostedZoneOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::delete_hosted_zone::DeleteHostedZoneError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::delete_hosted_zone::DeleteHostedZone::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::delete_hosted_zone::DeleteHostedZone::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::delete_hosted_zone::DeleteHostedZoneOutput,
110        crate::operation::delete_hosted_zone::DeleteHostedZoneError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <p>The ID of the hosted zone you want to delete.</p>
125    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.id(input.into());
127        self
128    }
129    /// <p>The ID of the hosted zone you want to delete.</p>
130    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_id(input);
132        self
133    }
134    /// <p>The ID of the hosted zone you want to delete.</p>
135    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_id()
137    }
138}