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.

/// <p>A complex type that identifies ways in which you want to restrict distribution of your content.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Restrictions {
    /// <p>A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using <code>MaxMind</code> GeoIP databases.</p>
    pub geo_restriction: ::std::option::Option<crate::types::GeoRestriction>,
}
impl Restrictions {
    /// <p>A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using <code>MaxMind</code> GeoIP databases.</p>
    pub fn geo_restriction(&self) -> ::std::option::Option<&crate::types::GeoRestriction> {
        self.geo_restriction.as_ref()
    }
}
impl Restrictions {
    /// Creates a new builder-style object to manufacture [`Restrictions`](crate::types::Restrictions).
    pub fn builder() -> crate::types::builders::RestrictionsBuilder {
        crate::types::builders::RestrictionsBuilder::default()
    }
}

/// A builder for [`Restrictions`](crate::types::Restrictions).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RestrictionsBuilder {
    pub(crate) geo_restriction: ::std::option::Option<crate::types::GeoRestriction>,
}
impl RestrictionsBuilder {
    /// <p>A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using <code>MaxMind</code> GeoIP databases.</p>
    /// This field is required.
    pub fn geo_restriction(mut self, input: crate::types::GeoRestriction) -> Self {
        self.geo_restriction = ::std::option::Option::Some(input);
        self
    }
    /// <p>A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using <code>MaxMind</code> GeoIP databases.</p>
    pub fn set_geo_restriction(mut self, input: ::std::option::Option<crate::types::GeoRestriction>) -> Self {
        self.geo_restriction = input;
        self
    }
    /// <p>A complex type that controls the countries in which your content is distributed. CloudFront determines the location of your users using <code>MaxMind</code> GeoIP databases.</p>
    pub fn get_geo_restriction(&self) -> &::std::option::Option<crate::types::GeoRestriction> {
        &self.geo_restriction
    }
    /// Consumes the builder and constructs a [`Restrictions`](crate::types::Restrictions).
    pub fn build(self) -> crate::types::Restrictions {
        crate::types::Restrictions {
            geo_restriction: self.geo_restriction,
        }
    }
}