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
// 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,
}
}
}