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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateCachePolicyOutput {
    /// <p>A cache policy.</p>
    pub cache_policy: ::std::option::Option<crate::types::CachePolicy>,
    /// <p>The fully qualified URI of the cache policy just created.</p>
    pub location: ::std::option::Option<::std::string::String>,
    /// <p>The current version of the cache policy.</p>
    pub e_tag: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateCachePolicyOutput {
    /// <p>A cache policy.</p>
    pub fn cache_policy(&self) -> ::std::option::Option<&crate::types::CachePolicy> {
        self.cache_policy.as_ref()
    }
    /// <p>The fully qualified URI of the cache policy just created.</p>
    pub fn location(&self) -> ::std::option::Option<&str> {
        self.location.as_deref()
    }
    /// <p>The current version of the cache policy.</p>
    pub fn e_tag(&self) -> ::std::option::Option<&str> {
        self.e_tag.as_deref()
    }
}
impl ::aws_types::request_id::RequestId for CreateCachePolicyOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateCachePolicyOutput {
    /// Creates a new builder-style object to manufacture [`CreateCachePolicyOutput`](crate::operation::create_cache_policy::CreateCachePolicyOutput).
    pub fn builder() -> crate::operation::create_cache_policy::builders::CreateCachePolicyOutputBuilder {
        crate::operation::create_cache_policy::builders::CreateCachePolicyOutputBuilder::default()
    }
}

/// A builder for [`CreateCachePolicyOutput`](crate::operation::create_cache_policy::CreateCachePolicyOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateCachePolicyOutputBuilder {
    pub(crate) cache_policy: ::std::option::Option<crate::types::CachePolicy>,
    pub(crate) location: ::std::option::Option<::std::string::String>,
    pub(crate) e_tag: ::std::option::Option<::std::string::String>,
    _request_id: Option<String>,
}
impl CreateCachePolicyOutputBuilder {
    /// <p>A cache policy.</p>
    pub fn cache_policy(mut self, input: crate::types::CachePolicy) -> Self {
        self.cache_policy = ::std::option::Option::Some(input);
        self
    }
    /// <p>A cache policy.</p>
    pub fn set_cache_policy(mut self, input: ::std::option::Option<crate::types::CachePolicy>) -> Self {
        self.cache_policy = input;
        self
    }
    /// <p>A cache policy.</p>
    pub fn get_cache_policy(&self) -> &::std::option::Option<crate::types::CachePolicy> {
        &self.cache_policy
    }
    /// <p>The fully qualified URI of the cache policy just created.</p>
    pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.location = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The fully qualified URI of the cache policy just created.</p>
    pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.location = input;
        self
    }
    /// <p>The fully qualified URI of the cache policy just created.</p>
    pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
        &self.location
    }
    /// <p>The current version of the cache policy.</p>
    pub fn e_tag(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.e_tag = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The current version of the cache policy.</p>
    pub fn set_e_tag(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.e_tag = input;
        self
    }
    /// <p>The current version of the cache policy.</p>
    pub fn get_e_tag(&self) -> &::std::option::Option<::std::string::String> {
        &self.e_tag
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CreateCachePolicyOutput`](crate::operation::create_cache_policy::CreateCachePolicyOutput).
    pub fn build(self) -> crate::operation::create_cache_policy::CreateCachePolicyOutput {
        crate::operation::create_cache_policy::CreateCachePolicyOutput {
            cache_policy: self.cache_policy,
            location: self.location,
            e_tag: self.e_tag,
            _request_id: self._request_id,
        }
    }
}