1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CopyDistributionInput {
/// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
#[doc(hidden)]
pub primary_distribution_id: std::option::Option<std::string::String>,
/// <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>
#[doc(hidden)]
pub staging: std::option::Option<bool>,
/// <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>
#[doc(hidden)]
pub if_match: std::option::Option<std::string::String>,
/// <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>
#[doc(hidden)]
pub caller_reference: std::option::Option<std::string::String>,
}
impl CopyDistributionInput {
/// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
pub fn primary_distribution_id(&self) -> std::option::Option<&str> {
self.primary_distribution_id.as_deref()
}
/// <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>
pub fn staging(&self) -> std::option::Option<bool> {
self.staging
}
/// <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>
pub fn if_match(&self) -> std::option::Option<&str> {
self.if_match.as_deref()
}
/// <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>
pub fn caller_reference(&self) -> std::option::Option<&str> {
self.caller_reference.as_deref()
}
}
impl CopyDistributionInput {
/// Creates a new builder-style object to manufacture [`CopyDistributionInput`](crate::operation::copy_distribution::CopyDistributionInput).
pub fn builder() -> crate::operation::copy_distribution::builders::CopyDistributionInputBuilder
{
crate::operation::copy_distribution::builders::CopyDistributionInputBuilder::default()
}
}
/// A builder for [`CopyDistributionInput`](crate::operation::copy_distribution::CopyDistributionInput).
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct CopyDistributionInputBuilder {
pub(crate) primary_distribution_id: std::option::Option<std::string::String>,
pub(crate) staging: std::option::Option<bool>,
pub(crate) if_match: std::option::Option<std::string::String>,
pub(crate) caller_reference: std::option::Option<std::string::String>,
}
impl CopyDistributionInputBuilder {
/// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
pub fn primary_distribution_id(mut self, input: impl Into<std::string::String>) -> Self {
self.primary_distribution_id = Some(input.into());
self
}
/// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
pub fn set_primary_distribution_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.primary_distribution_id = input;
self
}
/// <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>
pub fn staging(mut self, input: bool) -> Self {
self.staging = Some(input);
self
}
/// <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>
pub fn set_staging(mut self, input: std::option::Option<bool>) -> Self {
self.staging = input;
self
}
/// <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>
pub fn if_match(mut self, input: impl Into<std::string::String>) -> Self {
self.if_match = Some(input.into());
self
}
/// <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>
pub fn set_if_match(mut self, input: std::option::Option<std::string::String>) -> Self {
self.if_match = input;
self
}
/// <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>
pub fn caller_reference(mut self, input: impl Into<std::string::String>) -> Self {
self.caller_reference = Some(input.into());
self
}
/// <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>
pub fn set_caller_reference(mut self, input: std::option::Option<std::string::String>) -> Self {
self.caller_reference = input;
self
}
/// Consumes the builder and constructs a [`CopyDistributionInput`](crate::operation::copy_distribution::CopyDistributionInput).
pub fn build(
self,
) -> Result<
crate::operation::copy_distribution::CopyDistributionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::operation::copy_distribution::CopyDistributionInput {
primary_distribution_id: self.primary_distribution_id,
staging: self.staging,
if_match: self.if_match,
caller_reference: self.caller_reference,
})
}
}