aws-sdk-redshiftserverless 1.103.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 UpdateUsageLimitInput {
    /// <p>The identifier of the usage limit to update.</p>
    pub usage_limit_id: ::std::option::Option<::std::string::String>,
    /// <p>The new 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 new action that Amazon Redshift Serverless takes when the limit is reached.</p>
    pub breach_action: ::std::option::Option<crate::types::UsageLimitBreachAction>,
}
impl UpdateUsageLimitInput {
    /// <p>The identifier of the usage limit to update.</p>
    pub fn usage_limit_id(&self) -> ::std::option::Option<&str> {
        self.usage_limit_id.as_deref()
    }
    /// <p>The new 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 new action that Amazon Redshift Serverless takes when the limit is reached.</p>
    pub fn breach_action(&self) -> ::std::option::Option<&crate::types::UsageLimitBreachAction> {
        self.breach_action.as_ref()
    }
}
impl UpdateUsageLimitInput {
    /// Creates a new builder-style object to manufacture [`UpdateUsageLimitInput`](crate::operation::update_usage_limit::UpdateUsageLimitInput).
    pub fn builder() -> crate::operation::update_usage_limit::builders::UpdateUsageLimitInputBuilder {
        crate::operation::update_usage_limit::builders::UpdateUsageLimitInputBuilder::default()
    }
}

/// A builder for [`UpdateUsageLimitInput`](crate::operation::update_usage_limit::UpdateUsageLimitInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateUsageLimitInputBuilder {
    pub(crate) usage_limit_id: ::std::option::Option<::std::string::String>,
    pub(crate) amount: ::std::option::Option<i64>,
    pub(crate) breach_action: ::std::option::Option<crate::types::UsageLimitBreachAction>,
}
impl UpdateUsageLimitInputBuilder {
    /// <p>The identifier of the usage limit to update.</p>
    /// This field is required.
    pub fn usage_limit_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.usage_limit_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the usage limit to update.</p>
    pub fn set_usage_limit_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.usage_limit_id = input;
        self
    }
    /// <p>The identifier of the usage limit to update.</p>
    pub fn get_usage_limit_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.usage_limit_id
    }
    /// <p>The new 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(mut self, input: i64) -> Self {
        self.amount = ::std::option::Option::Some(input);
        self
    }
    /// <p>The new 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 new 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 new action that Amazon Redshift Serverless takes when the limit is reached.</p>
    pub fn breach_action(mut self, input: crate::types::UsageLimitBreachAction) -> Self {
        self.breach_action = ::std::option::Option::Some(input);
        self
    }
    /// <p>The new action that Amazon Redshift Serverless takes when the limit is reached.</p>
    pub fn set_breach_action(mut self, input: ::std::option::Option<crate::types::UsageLimitBreachAction>) -> Self {
        self.breach_action = input;
        self
    }
    /// <p>The new action that Amazon Redshift Serverless takes when the limit is reached.</p>
    pub fn get_breach_action(&self) -> &::std::option::Option<crate::types::UsageLimitBreachAction> {
        &self.breach_action
    }
    /// Consumes the builder and constructs a [`UpdateUsageLimitInput`](crate::operation::update_usage_limit::UpdateUsageLimitInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_usage_limit::UpdateUsageLimitInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::update_usage_limit::UpdateUsageLimitInput {
            usage_limit_id: self.usage_limit_id,
            amount: self.amount,
            breach_action: self.breach_action,
        })
    }
}