aws_sdk_cloudfront/operation/copy_distribution/
_copy_distribution_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CopyDistributionInput {
6    /// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
7    pub primary_distribution_id: ::std::option::Option<::std::string::String>,
8    /// <p>The type of distribution that your primary distribution will be copied to. The only valid value is <code>True</code>, indicating that you are copying to a staging distribution.</p>
9    pub staging: ::std::option::Option<bool>,
10    /// <p>The version identifier of the primary distribution whose configuration you are copying. This is the <code>ETag</code> value returned in the response to <code>GetDistribution</code> and <code>GetDistributionConfig</code>.</p>
11    pub if_match: ::std::option::Option<::std::string::String>,
12    /// <p>A value that uniquely identifies a request to create a resource. This helps to prevent CloudFront from creating a duplicate resource if you accidentally resubmit an identical request.</p>
13    pub caller_reference: ::std::option::Option<::std::string::String>,
14    /// <p>A Boolean flag to specify the state of the staging distribution when it's created. When you set this value to <code>True</code>, the staging distribution is enabled. When you set this value to <code>False</code>, the staging distribution is disabled.</p>
15    /// <p>If you omit this field, the default value is <code>True</code>.</p>
16    pub enabled: ::std::option::Option<bool>,
17}
18impl CopyDistributionInput {
19    /// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
20    pub fn primary_distribution_id(&self) -> ::std::option::Option<&str> {
21        self.primary_distribution_id.as_deref()
22    }
23    /// <p>The type of distribution that your primary distribution will be copied to. The only valid value is <code>True</code>, indicating that you are copying to a staging distribution.</p>
24    pub fn staging(&self) -> ::std::option::Option<bool> {
25        self.staging
26    }
27    /// <p>The version identifier of the primary distribution whose configuration you are copying. This is the <code>ETag</code> value returned in the response to <code>GetDistribution</code> and <code>GetDistributionConfig</code>.</p>
28    pub fn if_match(&self) -> ::std::option::Option<&str> {
29        self.if_match.as_deref()
30    }
31    /// <p>A value that uniquely identifies a request to create a resource. This helps to prevent CloudFront from creating a duplicate resource if you accidentally resubmit an identical request.</p>
32    pub fn caller_reference(&self) -> ::std::option::Option<&str> {
33        self.caller_reference.as_deref()
34    }
35    /// <p>A Boolean flag to specify the state of the staging distribution when it's created. When you set this value to <code>True</code>, the staging distribution is enabled. When you set this value to <code>False</code>, the staging distribution is disabled.</p>
36    /// <p>If you omit this field, the default value is <code>True</code>.</p>
37    pub fn enabled(&self) -> ::std::option::Option<bool> {
38        self.enabled
39    }
40}
41impl CopyDistributionInput {
42    /// Creates a new builder-style object to manufacture [`CopyDistributionInput`](crate::operation::copy_distribution::CopyDistributionInput).
43    pub fn builder() -> crate::operation::copy_distribution::builders::CopyDistributionInputBuilder {
44        crate::operation::copy_distribution::builders::CopyDistributionInputBuilder::default()
45    }
46}
47
48/// A builder for [`CopyDistributionInput`](crate::operation::copy_distribution::CopyDistributionInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CopyDistributionInputBuilder {
52    pub(crate) primary_distribution_id: ::std::option::Option<::std::string::String>,
53    pub(crate) staging: ::std::option::Option<bool>,
54    pub(crate) if_match: ::std::option::Option<::std::string::String>,
55    pub(crate) caller_reference: ::std::option::Option<::std::string::String>,
56    pub(crate) enabled: ::std::option::Option<bool>,
57}
58impl CopyDistributionInputBuilder {
59    /// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
60    /// This field is required.
61    pub fn primary_distribution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.primary_distribution_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
66    pub fn set_primary_distribution_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.primary_distribution_id = input;
68        self
69    }
70    /// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
71    pub fn get_primary_distribution_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.primary_distribution_id
73    }
74    /// <p>The type of distribution that your primary distribution will be copied to. The only valid value is <code>True</code>, indicating that you are copying to a staging distribution.</p>
75    pub fn staging(mut self, input: bool) -> Self {
76        self.staging = ::std::option::Option::Some(input);
77        self
78    }
79    /// <p>The type of distribution that your primary distribution will be copied to. The only valid value is <code>True</code>, indicating that you are copying to a staging distribution.</p>
80    pub fn set_staging(mut self, input: ::std::option::Option<bool>) -> Self {
81        self.staging = input;
82        self
83    }
84    /// <p>The type of distribution that your primary distribution will be copied to. The only valid value is <code>True</code>, indicating that you are copying to a staging distribution.</p>
85    pub fn get_staging(&self) -> &::std::option::Option<bool> {
86        &self.staging
87    }
88    /// <p>The version identifier of the primary distribution whose configuration you are copying. This is the <code>ETag</code> value returned in the response to <code>GetDistribution</code> and <code>GetDistributionConfig</code>.</p>
89    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.if_match = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The version identifier of the primary distribution whose configuration you are copying. This is the <code>ETag</code> value returned in the response to <code>GetDistribution</code> and <code>GetDistributionConfig</code>.</p>
94    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.if_match = input;
96        self
97    }
98    /// <p>The version identifier of the primary distribution whose configuration you are copying. This is the <code>ETag</code> value returned in the response to <code>GetDistribution</code> and <code>GetDistributionConfig</code>.</p>
99    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
100        &self.if_match
101    }
102    /// <p>A value that uniquely identifies a request to create a resource. This helps to prevent CloudFront from creating a duplicate resource if you accidentally resubmit an identical request.</p>
103    /// This field is required.
104    pub fn caller_reference(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
105        self.caller_reference = ::std::option::Option::Some(input.into());
106        self
107    }
108    /// <p>A value that uniquely identifies a request to create a resource. This helps to prevent CloudFront from creating a duplicate resource if you accidentally resubmit an identical request.</p>
109    pub fn set_caller_reference(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.caller_reference = input;
111        self
112    }
113    /// <p>A value that uniquely identifies a request to create a resource. This helps to prevent CloudFront from creating a duplicate resource if you accidentally resubmit an identical request.</p>
114    pub fn get_caller_reference(&self) -> &::std::option::Option<::std::string::String> {
115        &self.caller_reference
116    }
117    /// <p>A Boolean flag to specify the state of the staging distribution when it's created. When you set this value to <code>True</code>, the staging distribution is enabled. When you set this value to <code>False</code>, the staging distribution is disabled.</p>
118    /// <p>If you omit this field, the default value is <code>True</code>.</p>
119    pub fn enabled(mut self, input: bool) -> Self {
120        self.enabled = ::std::option::Option::Some(input);
121        self
122    }
123    /// <p>A Boolean flag to specify the state of the staging distribution when it's created. When you set this value to <code>True</code>, the staging distribution is enabled. When you set this value to <code>False</code>, the staging distribution is disabled.</p>
124    /// <p>If you omit this field, the default value is <code>True</code>.</p>
125    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
126        self.enabled = input;
127        self
128    }
129    /// <p>A Boolean flag to specify the state of the staging distribution when it's created. When you set this value to <code>True</code>, the staging distribution is enabled. When you set this value to <code>False</code>, the staging distribution is disabled.</p>
130    /// <p>If you omit this field, the default value is <code>True</code>.</p>
131    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
132        &self.enabled
133    }
134    /// Consumes the builder and constructs a [`CopyDistributionInput`](crate::operation::copy_distribution::CopyDistributionInput).
135    pub fn build(
136        self,
137    ) -> ::std::result::Result<crate::operation::copy_distribution::CopyDistributionInput, ::aws_smithy_types::error::operation::BuildError> {
138        ::std::result::Result::Ok(crate::operation::copy_distribution::CopyDistributionInput {
139            primary_distribution_id: self.primary_distribution_id,
140            staging: self.staging,
141            if_match: self.if_match,
142            caller_reference: self.caller_reference,
143            enabled: self.enabled,
144        })
145    }
146}