aws-sdk-redshiftserverless 1.104.0

AWS SDK for Redshift Serverless
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 CreateUsageLimitInput {
    /// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
    pub resource_arn: ::std::option::Option<::std::string::String>,
    /// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
    pub usage_type: ::std::option::Option<crate::types::UsageLimitUsageType>,
    /// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
    pub amount: ::std::option::Option<i64>,
    /// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
    pub period: ::std::option::Option<crate::types::UsageLimitPeriod>,
    /// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
    pub breach_action: ::std::option::Option<crate::types::UsageLimitBreachAction>,
}
impl CreateUsageLimitInput {
    /// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
    pub fn resource_arn(&self) -> ::std::option::Option<&str> {
        self.resource_arn.as_deref()
    }
    /// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
    pub fn usage_type(&self) -> ::std::option::Option<&crate::types::UsageLimitUsageType> {
        self.usage_type.as_ref()
    }
    /// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
    pub fn amount(&self) -> ::std::option::Option<i64> {
        self.amount
    }
    /// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
    pub fn period(&self) -> ::std::option::Option<&crate::types::UsageLimitPeriod> {
        self.period.as_ref()
    }
    /// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
    pub fn breach_action(&self) -> ::std::option::Option<&crate::types::UsageLimitBreachAction> {
        self.breach_action.as_ref()
    }
}
impl CreateUsageLimitInput {
    /// Creates a new builder-style object to manufacture [`CreateUsageLimitInput`](crate::operation::create_usage_limit::CreateUsageLimitInput).
    pub fn builder() -> crate::operation::create_usage_limit::builders::CreateUsageLimitInputBuilder {
        crate::operation::create_usage_limit::builders::CreateUsageLimitInputBuilder::default()
    }
}

/// A builder for [`CreateUsageLimitInput`](crate::operation::create_usage_limit::CreateUsageLimitInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateUsageLimitInputBuilder {
    pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
    pub(crate) usage_type: ::std::option::Option<crate::types::UsageLimitUsageType>,
    pub(crate) amount: ::std::option::Option<i64>,
    pub(crate) period: ::std::option::Option<crate::types::UsageLimitPeriod>,
    pub(crate) breach_action: ::std::option::Option<crate::types::UsageLimitBreachAction>,
}
impl CreateUsageLimitInputBuilder {
    /// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
    /// This field is required.
    pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.resource_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
    pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.resource_arn = input;
        self
    }
    /// <p>The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to create the usage limit for.</p>
    pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.resource_arn
    }
    /// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
    /// This field is required.
    pub fn usage_type(mut self, input: crate::types::UsageLimitUsageType) -> Self {
        self.usage_type = ::std::option::Option::Some(input);
        self
    }
    /// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
    pub fn set_usage_type(mut self, input: ::std::option::Option<crate::types::UsageLimitUsageType>) -> Self {
        self.usage_type = input;
        self
    }
    /// <p>The type of Amazon Redshift Serverless usage to create a usage limit for.</p>
    pub fn get_usage_type(&self) -> &::std::option::Option<crate::types::UsageLimitUsageType> {
        &self.usage_type
    }
    /// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
    /// This field is required.
    pub fn amount(mut self, input: i64) -> Self {
        self.amount = ::std::option::Option::Some(input);
        self
    }
    /// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
    pub fn set_amount(mut self, input: ::std::option::Option<i64>) -> Self {
        self.amount = input;
        self
    }
    /// <p>The limit amount. If time-based, this amount is in Redshift Processing Units (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data transferred between Regions in cross-account sharing. The value must be a positive number.</p>
    pub fn get_amount(&self) -> &::std::option::Option<i64> {
        &self.amount
    }
    /// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
    pub fn period(mut self, input: crate::types::UsageLimitPeriod) -> Self {
        self.period = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
    pub fn set_period(mut self, input: ::std::option::Option<crate::types::UsageLimitPeriod>) -> Self {
        self.period = input;
        self
    }
    /// <p>The time period that the amount applies to. A weekly period begins on Sunday. The default is monthly.</p>
    pub fn get_period(&self) -> &::std::option::Option<crate::types::UsageLimitPeriod> {
        &self.period
    }
    /// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
    pub fn breach_action(mut self, input: crate::types::UsageLimitBreachAction) -> Self {
        self.breach_action = ::std::option::Option::Some(input);
        self
    }
    /// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
    pub fn set_breach_action(mut self, input: ::std::option::Option<crate::types::UsageLimitBreachAction>) -> Self {
        self.breach_action = input;
        self
    }
    /// <p>The action that Amazon Redshift Serverless takes when the limit is reached. The default is log.</p>
    pub fn get_breach_action(&self) -> &::std::option::Option<crate::types::UsageLimitBreachAction> {
        &self.breach_action
    }
    /// Consumes the builder and constructs a [`CreateUsageLimitInput`](crate::operation::create_usage_limit::CreateUsageLimitInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_usage_limit::CreateUsageLimitInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_usage_limit::CreateUsageLimitInput {
            resource_arn: self.resource_arn,
            usage_type: self.usage_type,
            amount: self.amount,
            period: self.period,
            breach_action: self.breach_action,
        })
    }
}