aws_sdk_cloudfront/operation/create_cache_policy/
_create_cache_policy_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateCachePolicyInput {
6    /// <p>A cache policy configuration.</p>
7    pub cache_policy_config: ::std::option::Option<crate::types::CachePolicyConfig>,
8}
9impl CreateCachePolicyInput {
10    /// <p>A cache policy configuration.</p>
11    pub fn cache_policy_config(&self) -> ::std::option::Option<&crate::types::CachePolicyConfig> {
12        self.cache_policy_config.as_ref()
13    }
14}
15impl CreateCachePolicyInput {
16    /// Creates a new builder-style object to manufacture [`CreateCachePolicyInput`](crate::operation::create_cache_policy::CreateCachePolicyInput).
17    pub fn builder() -> crate::operation::create_cache_policy::builders::CreateCachePolicyInputBuilder {
18        crate::operation::create_cache_policy::builders::CreateCachePolicyInputBuilder::default()
19    }
20}
21
22/// A builder for [`CreateCachePolicyInput`](crate::operation::create_cache_policy::CreateCachePolicyInput).
23#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
24#[non_exhaustive]
25pub struct CreateCachePolicyInputBuilder {
26    pub(crate) cache_policy_config: ::std::option::Option<crate::types::CachePolicyConfig>,
27}
28impl CreateCachePolicyInputBuilder {
29    /// <p>A cache policy configuration.</p>
30    /// This field is required.
31    pub fn cache_policy_config(mut self, input: crate::types::CachePolicyConfig) -> Self {
32        self.cache_policy_config = ::std::option::Option::Some(input);
33        self
34    }
35    /// <p>A cache policy configuration.</p>
36    pub fn set_cache_policy_config(mut self, input: ::std::option::Option<crate::types::CachePolicyConfig>) -> Self {
37        self.cache_policy_config = input;
38        self
39    }
40    /// <p>A cache policy configuration.</p>
41    pub fn get_cache_policy_config(&self) -> &::std::option::Option<crate::types::CachePolicyConfig> {
42        &self.cache_policy_config
43    }
44    /// Consumes the builder and constructs a [`CreateCachePolicyInput`](crate::operation::create_cache_policy::CreateCachePolicyInput).
45    pub fn build(
46        self,
47    ) -> ::std::result::Result<crate::operation::create_cache_policy::CreateCachePolicyInput, ::aws_smithy_types::error::operation::BuildError> {
48        ::std::result::Result::Ok(crate::operation::create_cache_policy::CreateCachePolicyInput {
49            cache_policy_config: self.cache_policy_config,
50        })
51    }
52}