aws-sdk-shield 1.98.0

AWS SDK for AWS Shield
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Specifies how many protections of a given type you can create.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Limit {
    /// <p>The type of protection.</p>
    pub r#type: ::std::option::Option<::std::string::String>,
    /// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
    pub max: i64,
}
impl Limit {
    /// <p>The type of protection.</p>
    pub fn r#type(&self) -> ::std::option::Option<&str> {
        self.r#type.as_deref()
    }
    /// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
    pub fn max(&self) -> i64 {
        self.max
    }
}
impl Limit {
    /// Creates a new builder-style object to manufacture [`Limit`](crate::types::Limit).
    pub fn builder() -> crate::types::builders::LimitBuilder {
        crate::types::builders::LimitBuilder::default()
    }
}

/// A builder for [`Limit`](crate::types::Limit).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct LimitBuilder {
    pub(crate) r#type: ::std::option::Option<::std::string::String>,
    pub(crate) max: ::std::option::Option<i64>,
}
impl LimitBuilder {
    /// <p>The type of protection.</p>
    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.r#type = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The type of protection.</p>
    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.r#type = input;
        self
    }
    /// <p>The type of protection.</p>
    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
        &self.r#type
    }
    /// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
    pub fn max(mut self, input: i64) -> Self {
        self.max = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
    pub fn set_max(mut self, input: ::std::option::Option<i64>) -> Self {
        self.max = input;
        self
    }
    /// <p>The maximum number of protections that can be created for the specified <code>Type</code>.</p>
    pub fn get_max(&self) -> &::std::option::Option<i64> {
        &self.max
    }
    /// Consumes the builder and constructs a [`Limit`](crate::types::Limit).
    pub fn build(self) -> crate::types::Limit {
        crate::types::Limit {
            r#type: self.r#type,
            max: self.max.unwrap_or_default(),
        }
    }
}