aws_sdk_cloudfront/operation/delete_distribution/
_delete_distribution_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>This action deletes a web distribution. To delete a web distribution using the CloudFront API, perform the following steps.</p>
4/// <p><b>To delete a web distribution using the CloudFront API:</b></p>
5/// <ol>
6/// <li>
7/// <p>Disable the web distribution</p></li>
8/// <li>
9/// <p>Submit a <code>GET Distribution Config</code> request to get the current configuration and the <code>Etag</code> header for the distribution.</p></li>
10/// <li>
11/// <p>Update the XML document that was returned in the response to your <code>GET Distribution Config</code> request to change the value of <code>Enabled</code> to <code>false</code>.</p></li>
12/// <li>
13/// <p>Submit a <code>PUT 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. 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 Distribution Config</code> request in Step 2.</p></li>
14/// <li>
15/// <p>Review the response to the <code>PUT Distribution Config</code> request to confirm that the distribution was successfully disabled.</p></li>
16/// <li>
17/// <p>Submit a <code>GET Distribution</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>
18/// <li>
19/// <p>Submit a <code>DELETE 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 Distribution Config</code> request in Step 6.</p></li>
20/// <li>
21/// <p>Review the response to your <code>DELETE Distribution</code> request to confirm that the distribution was successfully deleted.</p></li>
22/// </ol>
23/// <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>
24#[non_exhaustive]
25#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
26pub struct DeleteDistributionInput {
27    /// <p>The distribution ID.</p>
28    pub id: ::std::option::Option<::std::string::String>,
29    /// <p>The value of the <code>ETag</code> header that you received when you disabled the distribution. For example: <code>E2QWRUHAPOMQZL</code>.</p>
30    pub if_match: ::std::option::Option<::std::string::String>,
31}
32impl DeleteDistributionInput {
33    /// <p>The distribution ID.</p>
34    pub fn id(&self) -> ::std::option::Option<&str> {
35        self.id.as_deref()
36    }
37    /// <p>The value of the <code>ETag</code> header that you received when you disabled the distribution. For example: <code>E2QWRUHAPOMQZL</code>.</p>
38    pub fn if_match(&self) -> ::std::option::Option<&str> {
39        self.if_match.as_deref()
40    }
41}
42impl DeleteDistributionInput {
43    /// Creates a new builder-style object to manufacture [`DeleteDistributionInput`](crate::operation::delete_distribution::DeleteDistributionInput).
44    pub fn builder() -> crate::operation::delete_distribution::builders::DeleteDistributionInputBuilder {
45        crate::operation::delete_distribution::builders::DeleteDistributionInputBuilder::default()
46    }
47}
48
49/// A builder for [`DeleteDistributionInput`](crate::operation::delete_distribution::DeleteDistributionInput).
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
51#[non_exhaustive]
52pub struct DeleteDistributionInputBuilder {
53    pub(crate) id: ::std::option::Option<::std::string::String>,
54    pub(crate) if_match: ::std::option::Option<::std::string::String>,
55}
56impl DeleteDistributionInputBuilder {
57    /// <p>The distribution ID.</p>
58    /// This field is required.
59    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.id = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The distribution ID.</p>
64    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.id = input;
66        self
67    }
68    /// <p>The distribution ID.</p>
69    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.id
71    }
72    /// <p>The value of the <code>ETag</code> header that you received when you disabled the distribution. For example: <code>E2QWRUHAPOMQZL</code>.</p>
73    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
74        self.if_match = ::std::option::Option::Some(input.into());
75        self
76    }
77    /// <p>The value of the <code>ETag</code> header that you received when you disabled the distribution. For example: <code>E2QWRUHAPOMQZL</code>.</p>
78    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
79        self.if_match = input;
80        self
81    }
82    /// <p>The value of the <code>ETag</code> header that you received when you disabled the distribution. For example: <code>E2QWRUHAPOMQZL</code>.</p>
83    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
84        &self.if_match
85    }
86    /// Consumes the builder and constructs a [`DeleteDistributionInput`](crate::operation::delete_distribution::DeleteDistributionInput).
87    pub fn build(
88        self,
89    ) -> ::std::result::Result<crate::operation::delete_distribution::DeleteDistributionInput, ::aws_smithy_types::error::operation::BuildError> {
90        ::std::result::Result::Ok(crate::operation::delete_distribution::DeleteDistributionInput {
91            id: self.id,
92            if_match: self.if_match,
93        })
94    }
95}