Skip to main content

aws_sdk_cloudfront/types/
_response_headers_policy_frame_options.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Determines whether CloudFront includes the <code>X-Frame-Options</code> HTTP response header and the header's value.</p>
4/// <p>For more information about the <code>X-Frame-Options</code> HTTP response header, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options">X-Frame-Options</a> in the MDN Web Docs.</p>
5#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct ResponseHeadersPolicyFrameOptions {
8    /// <p>A Boolean that determines whether CloudFront overrides the <code>X-Frame-Options</code> HTTP response header received from the origin with the one specified in this response headers policy.</p>
9    pub r#override: bool,
10    /// <p>The value of the <code>X-Frame-Options</code> HTTP response header. Valid values are <code>DENY</code> and <code>SAMEORIGIN</code>.</p>
11    /// <p>For more information about these values, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options">X-Frame-Options</a> in the MDN Web Docs.</p>
12    pub frame_option: crate::types::FrameOptionsList,
13}
14impl ResponseHeadersPolicyFrameOptions {
15    /// <p>A Boolean that determines whether CloudFront overrides the <code>X-Frame-Options</code> HTTP response header received from the origin with the one specified in this response headers policy.</p>
16    pub fn r#override(&self) -> bool {
17        self.r#override
18    }
19    /// <p>The value of the <code>X-Frame-Options</code> HTTP response header. Valid values are <code>DENY</code> and <code>SAMEORIGIN</code>.</p>
20    /// <p>For more information about these values, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options">X-Frame-Options</a> in the MDN Web Docs.</p>
21    pub fn frame_option(&self) -> &crate::types::FrameOptionsList {
22        &self.frame_option
23    }
24}
25impl ResponseHeadersPolicyFrameOptions {
26    /// Creates a new builder-style object to manufacture [`ResponseHeadersPolicyFrameOptions`](crate::types::ResponseHeadersPolicyFrameOptions).
27    pub fn builder() -> crate::types::builders::ResponseHeadersPolicyFrameOptionsBuilder {
28        crate::types::builders::ResponseHeadersPolicyFrameOptionsBuilder::default()
29    }
30}
31
32/// A builder for [`ResponseHeadersPolicyFrameOptions`](crate::types::ResponseHeadersPolicyFrameOptions).
33#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
34#[non_exhaustive]
35pub struct ResponseHeadersPolicyFrameOptionsBuilder {
36    pub(crate) r#override: ::std::option::Option<bool>,
37    pub(crate) frame_option: ::std::option::Option<crate::types::FrameOptionsList>,
38}
39impl ResponseHeadersPolicyFrameOptionsBuilder {
40    /// <p>A Boolean that determines whether CloudFront overrides the <code>X-Frame-Options</code> HTTP response header received from the origin with the one specified in this response headers policy.</p>
41    /// This field is required.
42    pub fn r#override(mut self, input: bool) -> Self {
43        self.r#override = ::std::option::Option::Some(input);
44        self
45    }
46    /// <p>A Boolean that determines whether CloudFront overrides the <code>X-Frame-Options</code> HTTP response header received from the origin with the one specified in this response headers policy.</p>
47    pub fn set_override(mut self, input: ::std::option::Option<bool>) -> Self {
48        self.r#override = input;
49        self
50    }
51    /// <p>A Boolean that determines whether CloudFront overrides the <code>X-Frame-Options</code> HTTP response header received from the origin with the one specified in this response headers policy.</p>
52    pub fn get_override(&self) -> &::std::option::Option<bool> {
53        &self.r#override
54    }
55    /// <p>The value of the <code>X-Frame-Options</code> HTTP response header. Valid values are <code>DENY</code> and <code>SAMEORIGIN</code>.</p>
56    /// <p>For more information about these values, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options">X-Frame-Options</a> in the MDN Web Docs.</p>
57    /// This field is required.
58    pub fn frame_option(mut self, input: crate::types::FrameOptionsList) -> Self {
59        self.frame_option = ::std::option::Option::Some(input);
60        self
61    }
62    /// <p>The value of the <code>X-Frame-Options</code> HTTP response header. Valid values are <code>DENY</code> and <code>SAMEORIGIN</code>.</p>
63    /// <p>For more information about these values, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options">X-Frame-Options</a> in the MDN Web Docs.</p>
64    pub fn set_frame_option(mut self, input: ::std::option::Option<crate::types::FrameOptionsList>) -> Self {
65        self.frame_option = input;
66        self
67    }
68    /// <p>The value of the <code>X-Frame-Options</code> HTTP response header. Valid values are <code>DENY</code> and <code>SAMEORIGIN</code>.</p>
69    /// <p>For more information about these values, see <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options">X-Frame-Options</a> in the MDN Web Docs.</p>
70    pub fn get_frame_option(&self) -> &::std::option::Option<crate::types::FrameOptionsList> {
71        &self.frame_option
72    }
73    /// Consumes the builder and constructs a [`ResponseHeadersPolicyFrameOptions`](crate::types::ResponseHeadersPolicyFrameOptions).
74    /// This method will fail if any of the following fields are not set:
75    /// - [`r#override`](crate::types::builders::ResponseHeadersPolicyFrameOptionsBuilder::override)
76    /// - [`frame_option`](crate::types::builders::ResponseHeadersPolicyFrameOptionsBuilder::frame_option)
77    pub fn build(self) -> ::std::result::Result<crate::types::ResponseHeadersPolicyFrameOptions, ::aws_smithy_types::error::operation::BuildError> {
78        ::std::result::Result::Ok(crate::types::ResponseHeadersPolicyFrameOptions {
79            r#override: self.r#override.ok_or_else(|| {
80                ::aws_smithy_types::error::operation::BuildError::missing_field(
81                    "r#override",
82                    "r#override was not specified but it is required when building ResponseHeadersPolicyFrameOptions",
83                )
84            })?,
85            frame_option: self.frame_option.ok_or_else(|| {
86                ::aws_smithy_types::error::operation::BuildError::missing_field(
87                    "frame_option",
88                    "frame_option was not specified but it is required when building ResponseHeadersPolicyFrameOptions",
89                )
90            })?,
91        })
92    }
93}