aws-sdk-amplifygen3 1.0.0

AWS SDK for AWS Amplify Gen 3
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 StartCacheRevalidationInput {
    /// <p>The name of the app.</p>
    pub app_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the environment.</p>
    pub environment_name: ::std::option::Option<::std::string::String>,
    /// <p>The ID of the deployment.</p>
    pub deployment_id: ::std::option::Option<::std::string::String>,
    /// <p>The cache tags that identify the content to revalidate.</p>
    pub cache_tags: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The period, in seconds, after which the revalidated content expires.</p>
    pub expiration_period_seconds: ::std::option::Option<i32>,
}
impl StartCacheRevalidationInput {
    /// <p>The name of the app.</p>
    pub fn app_name(&self) -> ::std::option::Option<&str> {
        self.app_name.as_deref()
    }
    /// <p>The name of the environment.</p>
    pub fn environment_name(&self) -> ::std::option::Option<&str> {
        self.environment_name.as_deref()
    }
    /// <p>The ID of the deployment.</p>
    pub fn deployment_id(&self) -> ::std::option::Option<&str> {
        self.deployment_id.as_deref()
    }
    /// <p>The cache tags that identify the content to revalidate.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.cache_tags.is_none()`.
    pub fn cache_tags(&self) -> &[::std::string::String] {
        self.cache_tags.as_deref().unwrap_or_default()
    }
    /// <p>The period, in seconds, after which the revalidated content expires.</p>
    pub fn expiration_period_seconds(&self) -> ::std::option::Option<i32> {
        self.expiration_period_seconds
    }
}
impl StartCacheRevalidationInput {
    /// Creates a new builder-style object to manufacture [`StartCacheRevalidationInput`](crate::operation::start_cache_revalidation::StartCacheRevalidationInput).
    pub fn builder() -> crate::operation::start_cache_revalidation::builders::StartCacheRevalidationInputBuilder {
        crate::operation::start_cache_revalidation::builders::StartCacheRevalidationInputBuilder::default()
    }
}

/// A builder for [`StartCacheRevalidationInput`](crate::operation::start_cache_revalidation::StartCacheRevalidationInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct StartCacheRevalidationInputBuilder {
    pub(crate) app_name: ::std::option::Option<::std::string::String>,
    pub(crate) environment_name: ::std::option::Option<::std::string::String>,
    pub(crate) deployment_id: ::std::option::Option<::std::string::String>,
    pub(crate) cache_tags: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) expiration_period_seconds: ::std::option::Option<i32>,
}
impl StartCacheRevalidationInputBuilder {
    /// <p>The name of the app.</p>
    /// This field is required.
    pub fn app_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.app_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the app.</p>
    pub fn set_app_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.app_name = input;
        self
    }
    /// <p>The name of the app.</p>
    pub fn get_app_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.app_name
    }
    /// <p>The name of the environment.</p>
    /// This field is required.
    pub fn environment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the environment.</p>
    pub fn set_environment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_name = input;
        self
    }
    /// <p>The name of the environment.</p>
    pub fn get_environment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_name
    }
    /// <p>The ID of the deployment.</p>
    /// This field is required.
    pub fn deployment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.deployment_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ID of the deployment.</p>
    pub fn set_deployment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.deployment_id = input;
        self
    }
    /// <p>The ID of the deployment.</p>
    pub fn get_deployment_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.deployment_id
    }
    /// Appends an item to `cache_tags`.
    ///
    /// To override the contents of this collection use [`set_cache_tags`](Self::set_cache_tags).
    ///
    /// <p>The cache tags that identify the content to revalidate.</p>
    pub fn cache_tags(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.cache_tags.unwrap_or_default();
        v.push(input.into());
        self.cache_tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>The cache tags that identify the content to revalidate.</p>
    pub fn set_cache_tags(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.cache_tags = input;
        self
    }
    /// <p>The cache tags that identify the content to revalidate.</p>
    pub fn get_cache_tags(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.cache_tags
    }
    /// <p>The period, in seconds, after which the revalidated content expires.</p>
    pub fn expiration_period_seconds(mut self, input: i32) -> Self {
        self.expiration_period_seconds = ::std::option::Option::Some(input);
        self
    }
    /// <p>The period, in seconds, after which the revalidated content expires.</p>
    pub fn set_expiration_period_seconds(mut self, input: ::std::option::Option<i32>) -> Self {
        self.expiration_period_seconds = input;
        self
    }
    /// <p>The period, in seconds, after which the revalidated content expires.</p>
    pub fn get_expiration_period_seconds(&self) -> &::std::option::Option<i32> {
        &self.expiration_period_seconds
    }
    /// Consumes the builder and constructs a [`StartCacheRevalidationInput`](crate::operation::start_cache_revalidation::StartCacheRevalidationInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::start_cache_revalidation::StartCacheRevalidationInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::start_cache_revalidation::StartCacheRevalidationInput {
            app_name: self.app_name,
            environment_name: self.environment_name,
            deployment_id: self.deployment_id,
            cache_tags: self.cache_tags,
            expiration_period_seconds: self.expiration_period_seconds,
        })
    }
}