aws-sdk-route53 0.25.1

AWS SDK for Amazon Route 53
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::delete_traffic_policy::_delete_traffic_policy_output::DeleteTrafficPolicyOutputBuilder;

pub use crate::operation::delete_traffic_policy::_delete_traffic_policy_input::DeleteTrafficPolicyInputBuilder;

/// Fluent builder constructing a request to `DeleteTrafficPolicy`.
///
/// <p>Deletes a traffic policy.</p>
/// <p>When you delete a traffic policy, Route 53 sets a flag on the policy to indicate that it has been deleted. However, Route 53 never fully deletes the traffic policy. Note the following:</p>
/// <ul>
/// <li> <p>Deleted traffic policies aren't listed if you run <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_ListTrafficPolicies.html">ListTrafficPolicies</a>.</p> </li>
/// <li> <p> There's no way to get a list of deleted policies.</p> </li>
/// <li> <p>If you retain the ID of the policy, you can get information about the policy, including the traffic policy document, by running <a href="https://docs.aws.amazon.com/Route53/latest/APIReference/API_GetTrafficPolicy.html">GetTrafficPolicy</a>.</p> </li>
/// </ul>
#[derive(std::clone::Clone, std::fmt::Debug)]
pub struct DeleteTrafficPolicyFluentBuilder {
    handle: std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::delete_traffic_policy::builders::DeleteTrafficPolicyInputBuilder,
}
impl DeleteTrafficPolicyFluentBuilder {
    /// Creates a new `DeleteTrafficPolicy`.
    pub(crate) fn new(handle: std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: Default::default(),
        }
    }

    /// Consume this builder, creating a customizable operation that can be modified before being
    /// sent. The operation's inner [http::Request] can be modified as well.
    pub async fn customize(
        self,
    ) -> std::result::Result<
        crate::client::customize::CustomizableOperation<
            crate::operation::delete_traffic_policy::DeleteTrafficPolicy,
            aws_http::retry::AwsResponseRetryClassifier,
        >,
        aws_smithy_http::result::SdkError<
            crate::operation::delete_traffic_policy::DeleteTrafficPolicyError,
        >,
    > {
        let handle = self.handle.clone();
        let operation = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        Ok(crate::client::customize::CustomizableOperation { handle, operation })
    }

    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> std::result::Result<
        crate::operation::delete_traffic_policy::DeleteTrafficPolicyOutput,
        aws_smithy_http::result::SdkError<
            crate::operation::delete_traffic_policy::DeleteTrafficPolicyError,
        >,
    > {
        let op = self
            .inner
            .build()
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?
            .make_operation(&self.handle.conf)
            .await
            .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
        self.handle.client.call(op).await
    }
    /// <p>The ID of the traffic policy that you want to delete.</p>
    pub fn id(mut self, input: impl Into<std::string::String>) -> Self {
        self.inner = self.inner.id(input.into());
        self
    }
    /// <p>The ID of the traffic policy that you want to delete.</p>
    pub fn set_id(mut self, input: std::option::Option<std::string::String>) -> Self {
        self.inner = self.inner.set_id(input);
        self
    }
    /// <p>The version number of the traffic policy that you want to delete.</p>
    pub fn version(mut self, input: i32) -> Self {
        self.inner = self.inner.version(input);
        self
    }
    /// <p>The version number of the traffic policy that you want to delete.</p>
    pub fn set_version(mut self, input: std::option::Option<i32>) -> Self {
        self.inner = self.inner.set_version(input);
        self
    }
}