aws_sdk_cloudfront/operation/delete_streaming_distribution/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_streaming_distribution::_delete_streaming_distribution_output::DeleteStreamingDistributionOutputBuilder;
3
4pub use crate::operation::delete_streaming_distribution::_delete_streaming_distribution_input::DeleteStreamingDistributionInputBuilder;
5
6impl crate::operation::delete_streaming_distribution::builders::DeleteStreamingDistributionInputBuilder {
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_streaming_distribution::DeleteStreamingDistributionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_streaming_distribution::DeleteStreamingDistributionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_streaming_distribution();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteStreamingDistribution`.
24///
25/// <p>Delete a streaming distribution. To delete an RTMP distribution using the CloudFront API, perform the following steps.</p>
26/// <p><b>To delete an RTMP distribution using the CloudFront API</b>:</p>
27/// <ol>
28/// <li>
29/// <p>Disable the RTMP distribution.</p></li>
30/// <li>
31/// <p>Submit a <code>GET Streaming Distribution Config</code> request to get the current configuration and the <code>Etag</code> header for the distribution.</p></li>
32/// <li>
33/// <p>Update the XML document that was returned in the response to your <code>GET Streaming Distribution Config</code> request to change the value of <code>Enabled</code> to <code>false</code>.</p></li>
34/// <li>
35/// <p>Submit a <code>PUT Streaming Distribution Config</code> request to update the configuration for your distribution. In the request body, include the XML document that you updated in Step 3. Then set the value of the HTTP <code>If-Match</code> header to the value of the <code>ETag</code> header that CloudFront returned when you submitted the <code>GET Streaming Distribution Config</code> request in Step 2.</p></li>
36/// <li>
37/// <p>Review the response to the <code>PUT Streaming Distribution Config</code> request to confirm that the distribution was successfully disabled.</p></li>
38/// <li>
39/// <p>Submit a <code>GET Streaming Distribution Config</code> request to confirm that your changes have propagated. When propagation is complete, the value of <code>Status</code> is <code>Deployed</code>.</p></li>
40/// <li>
41/// <p>Submit a <code>DELETE Streaming Distribution</code> request. Set the value of the HTTP <code>If-Match</code> header to the value of the <code>ETag</code> header that CloudFront returned when you submitted the <code>GET Streaming Distribution Config</code> request in Step 2.</p></li>
42/// <li>
43/// <p>Review the response to your <code>DELETE Streaming Distribution</code> request to confirm that the distribution was successfully deleted.</p></li>
44/// </ol>
45/// <p>For information about deleting a distribution using the CloudFront console, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/HowToDeleteDistribution.html">Deleting a Distribution</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
46#[derive(::std::clone::Clone, ::std::fmt::Debug)]
47pub struct DeleteStreamingDistributionFluentBuilder {
48    handle: ::std::sync::Arc<crate::client::Handle>,
49    inner: crate::operation::delete_streaming_distribution::builders::DeleteStreamingDistributionInputBuilder,
50    config_override: ::std::option::Option<crate::config::Builder>,
51}
52impl
53    crate::client::customize::internal::CustomizableSend<
54        crate::operation::delete_streaming_distribution::DeleteStreamingDistributionOutput,
55        crate::operation::delete_streaming_distribution::DeleteStreamingDistributionError,
56    > for DeleteStreamingDistributionFluentBuilder
57{
58    fn send(
59        self,
60        config_override: crate::config::Builder,
61    ) -> crate::client::customize::internal::BoxFuture<
62        crate::client::customize::internal::SendResult<
63            crate::operation::delete_streaming_distribution::DeleteStreamingDistributionOutput,
64            crate::operation::delete_streaming_distribution::DeleteStreamingDistributionError,
65        >,
66    > {
67        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
68    }
69}
70impl DeleteStreamingDistributionFluentBuilder {
71    /// Creates a new `DeleteStreamingDistributionFluentBuilder`.
72    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
73        Self {
74            handle,
75            inner: ::std::default::Default::default(),
76            config_override: ::std::option::Option::None,
77        }
78    }
79    /// Access the DeleteStreamingDistribution as a reference.
80    pub fn as_input(&self) -> &crate::operation::delete_streaming_distribution::builders::DeleteStreamingDistributionInputBuilder {
81        &self.inner
82    }
83    /// Sends the request and returns the response.
84    ///
85    /// If an error occurs, an `SdkError` will be returned with additional details that
86    /// can be matched against.
87    ///
88    /// By default, any retryable failures will be retried twice. Retry behavior
89    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
90    /// set when configuring the client.
91    pub async fn send(
92        self,
93    ) -> ::std::result::Result<
94        crate::operation::delete_streaming_distribution::DeleteStreamingDistributionOutput,
95        ::aws_smithy_runtime_api::client::result::SdkError<
96            crate::operation::delete_streaming_distribution::DeleteStreamingDistributionError,
97            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
98        >,
99    > {
100        let input = self
101            .inner
102            .build()
103            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
104        let runtime_plugins = crate::operation::delete_streaming_distribution::DeleteStreamingDistribution::operation_runtime_plugins(
105            self.handle.runtime_plugins.clone(),
106            &self.handle.conf,
107            self.config_override,
108        );
109        crate::operation::delete_streaming_distribution::DeleteStreamingDistribution::orchestrate(&runtime_plugins, input).await
110    }
111
112    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
113    pub fn customize(
114        self,
115    ) -> crate::client::customize::CustomizableOperation<
116        crate::operation::delete_streaming_distribution::DeleteStreamingDistributionOutput,
117        crate::operation::delete_streaming_distribution::DeleteStreamingDistributionError,
118        Self,
119    > {
120        crate::client::customize::CustomizableOperation::new(self)
121    }
122    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
123        self.set_config_override(::std::option::Option::Some(config_override.into()));
124        self
125    }
126
127    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
128        self.config_override = config_override;
129        self
130    }
131    /// <p>The distribution ID.</p>
132    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.id(input.into());
134        self
135    }
136    /// <p>The distribution ID.</p>
137    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_id(input);
139        self
140    }
141    /// <p>The distribution ID.</p>
142    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
143        self.inner.get_id()
144    }
145    /// <p>The value of the <code>ETag</code> header that you received when you disabled the streaming distribution. For example: <code>E2QWRUHAPOMQZL</code>.</p>
146    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.if_match(input.into());
148        self
149    }
150    /// <p>The value of the <code>ETag</code> header that you received when you disabled the streaming distribution. For example: <code>E2QWRUHAPOMQZL</code>.</p>
151    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.inner = self.inner.set_if_match(input);
153        self
154    }
155    /// <p>The value of the <code>ETag</code> header that you received when you disabled the streaming distribution. For example: <code>E2QWRUHAPOMQZL</code>.</p>
156    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
157        self.inner.get_if_match()
158    }
159}