aws-sdk-cloudfront 1.115.0

AWS SDK for Amazon CloudFront
Documentation
// 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>
    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>
    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>
    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>
    pub caller_reference: ::std::option::Option<::std::string::String>,
    /// <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>
    /// <p>If you omit this field, the default value is <code>True</code>.</p>
    pub enabled: ::std::option::Option<bool>,
}
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()
    }
    /// <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>
    /// <p>If you omit this field, the default value is <code>True</code>.</p>
    pub fn enabled(&self) -> ::std::option::Option<bool> {
        self.enabled
    }
}
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).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
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>,
    pub(crate) enabled: ::std::option::Option<bool>,
}
impl CopyDistributionInputBuilder {
    /// <p>The identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
    /// This field is required.
    pub fn primary_distribution_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.primary_distribution_id = ::std::option::Option::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 identifier of the primary distribution whose configuration you are copying. To get a distribution ID, use <code>ListDistributions</code>.</p>
    pub fn get_primary_distribution_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.primary_distribution_id
    }
    /// <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 = ::std::option::Option::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 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 get_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(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.if_match = ::std::option::Option::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>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 get_if_match(&self) -> &::std::option::Option<::std::string::String> {
        &self.if_match
    }
    /// <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>
    /// This field is required.
    pub fn caller_reference(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.caller_reference = ::std::option::Option::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
    }
    /// <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 get_caller_reference(&self) -> &::std::option::Option<::std::string::String> {
        &self.caller_reference
    }
    /// <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>
    /// <p>If you omit this field, the default value is <code>True</code>.</p>
    pub fn enabled(mut self, input: bool) -> Self {
        self.enabled = ::std::option::Option::Some(input);
        self
    }
    /// <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>
    /// <p>If you omit this field, the default value is <code>True</code>.</p>
    pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
        self.enabled = input;
        self
    }
    /// <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>
    /// <p>If you omit this field, the default value is <code>True</code>.</p>
    pub fn get_enabled(&self) -> &::std::option::Option<bool> {
        &self.enabled
    }
    /// Consumes the builder and constructs a [`CopyDistributionInput`](crate::operation::copy_distribution::CopyDistributionInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::copy_distribution::CopyDistributionInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::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,
            enabled: self.enabled,
        })
    }
}