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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An object that determines whether any HTTP headers (and if so, which headers) are included in the cache key and in requests that CloudFront sends to the origin.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CachePolicyHeadersConfig {
    /// <p>Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin. Valid values are:</p>
    /// <ul>
    /// <li> <p> <code>none</code> – No HTTP headers are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to <code>none</code>, any headers that are listed in an <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> </li>
    /// <li> <p> <code>whitelist</code> – Only the HTTP headers that are listed in the <code>Headers</code> type are included in the cache key and in requests that CloudFront sends to the origin.</p> </li>
    /// </ul>
    pub header_behavior: ::std::option::Option<crate::types::CachePolicyHeaderBehavior>,
    /// <p>Contains a list of HTTP header names.</p>
    pub headers: ::std::option::Option<crate::types::Headers>,
}
impl CachePolicyHeadersConfig {
    /// <p>Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin. Valid values are:</p>
    /// <ul>
    /// <li> <p> <code>none</code> – No HTTP headers are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to <code>none</code>, any headers that are listed in an <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> </li>
    /// <li> <p> <code>whitelist</code> – Only the HTTP headers that are listed in the <code>Headers</code> type are included in the cache key and in requests that CloudFront sends to the origin.</p> </li>
    /// </ul>
    pub fn header_behavior(&self) -> ::std::option::Option<&crate::types::CachePolicyHeaderBehavior> {
        self.header_behavior.as_ref()
    }
    /// <p>Contains a list of HTTP header names.</p>
    pub fn headers(&self) -> ::std::option::Option<&crate::types::Headers> {
        self.headers.as_ref()
    }
}
impl CachePolicyHeadersConfig {
    /// Creates a new builder-style object to manufacture [`CachePolicyHeadersConfig`](crate::types::CachePolicyHeadersConfig).
    pub fn builder() -> crate::types::builders::CachePolicyHeadersConfigBuilder {
        crate::types::builders::CachePolicyHeadersConfigBuilder::default()
    }
}

/// A builder for [`CachePolicyHeadersConfig`](crate::types::CachePolicyHeadersConfig).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CachePolicyHeadersConfigBuilder {
    pub(crate) header_behavior: ::std::option::Option<crate::types::CachePolicyHeaderBehavior>,
    pub(crate) headers: ::std::option::Option<crate::types::Headers>,
}
impl CachePolicyHeadersConfigBuilder {
    /// <p>Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin. Valid values are:</p>
    /// <ul>
    /// <li> <p> <code>none</code> – No HTTP headers are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to <code>none</code>, any headers that are listed in an <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> </li>
    /// <li> <p> <code>whitelist</code> – Only the HTTP headers that are listed in the <code>Headers</code> type are included in the cache key and in requests that CloudFront sends to the origin.</p> </li>
    /// </ul>
    pub fn header_behavior(mut self, input: crate::types::CachePolicyHeaderBehavior) -> Self {
        self.header_behavior = ::std::option::Option::Some(input);
        self
    }
    /// <p>Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin. Valid values are:</p>
    /// <ul>
    /// <li> <p> <code>none</code> – No HTTP headers are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to <code>none</code>, any headers that are listed in an <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> </li>
    /// <li> <p> <code>whitelist</code> – Only the HTTP headers that are listed in the <code>Headers</code> type are included in the cache key and in requests that CloudFront sends to the origin.</p> </li>
    /// </ul>
    pub fn set_header_behavior(mut self, input: ::std::option::Option<crate::types::CachePolicyHeaderBehavior>) -> Self {
        self.header_behavior = input;
        self
    }
    /// <p>Determines whether any HTTP headers are included in the cache key and in requests that CloudFront sends to the origin. Valid values are:</p>
    /// <ul>
    /// <li> <p> <code>none</code> – No HTTP headers are included in the cache key or in requests that CloudFront sends to the origin. Even when this field is set to <code>none</code>, any headers that are listed in an <code>OriginRequestPolicy</code> <i>are</i> included in origin requests.</p> </li>
    /// <li> <p> <code>whitelist</code> – Only the HTTP headers that are listed in the <code>Headers</code> type are included in the cache key and in requests that CloudFront sends to the origin.</p> </li>
    /// </ul>
    pub fn get_header_behavior(&self) -> &::std::option::Option<crate::types::CachePolicyHeaderBehavior> {
        &self.header_behavior
    }
    /// <p>Contains a list of HTTP header names.</p>
    pub fn headers(mut self, input: crate::types::Headers) -> Self {
        self.headers = ::std::option::Option::Some(input);
        self
    }
    /// <p>Contains a list of HTTP header names.</p>
    pub fn set_headers(mut self, input: ::std::option::Option<crate::types::Headers>) -> Self {
        self.headers = input;
        self
    }
    /// <p>Contains a list of HTTP header names.</p>
    pub fn get_headers(&self) -> &::std::option::Option<crate::types::Headers> {
        &self.headers
    }
    /// Consumes the builder and constructs a [`CachePolicyHeadersConfig`](crate::types::CachePolicyHeadersConfig).
    pub fn build(self) -> crate::types::CachePolicyHeadersConfig {
        crate::types::CachePolicyHeadersConfig {
            header_behavior: self.header_behavior,
            headers: self.headers,
        }
    }
}