aws-sdk-connect 1.169.0

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

/// <p>Defines validation rules for data table attribute values. Based on JSON Schema Draft 2020-12 with additional Connect-specific validations. Validation rules ensure data integrity and consistency across the data table.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Validation {
    /// <p>The minimum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be less than or equal to MaxLength.</p>
    pub min_length: i32,
    /// <p>The maximum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be greater than or equal to MinLength.</p>
    pub max_length: i32,
    /// <p>The minimum number of values in a list. Must be an integer greater than or equal to 0 and less than or equal to MaxValues. Applies to all list types.</p>
    pub min_values: i32,
    /// <p>The maximum number of values in a list. Must be an integer greater than or equal to 0 and greater than or equal to MinValues. Applies to all list types.</p>
    pub max_values: i32,
    /// <p>Boolean that defaults to false. Applies to text lists and text primary attributes. When true, enforces case-insensitive uniqueness for primary attributes and allows case-insensitive lookups.</p>
    pub ignore_case: bool,
    /// <p>The smallest inclusive numeric value for NUMBER value type. Cannot be provided when ExclusiveMinimum is also provided. Must be less than or equal to Maximum and less than ExclusiveMaximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub minimum: f64,
    /// <p>The largest inclusive numeric value for NUMBER value type. Can be provided alongside ExclusiveMaximum where both operate independently. Must be greater than or equal to Minimum and greater than ExclusiveMinimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub maximum: f64,
    /// <p>The smallest exclusive numeric value for NUMBER value type. Can be provided alongside Minimum where both operate independently. Must be less than ExclusiveMaximum and Maximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub exclusive_minimum: f64,
    /// <p>The largest exclusive numeric value for NUMBER value type. Can be provided alongside Maximum where both operate independently. Must be greater than ExclusiveMinimum and Minimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub exclusive_maximum: f64,
    /// <p>Specifies that numeric values must be multiples of this number. Must be greater than 0. The result of dividing a value by this multiple must result in an integer. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub multiple_of: f64,
    /// <p>Defines enumeration constraints for attribute values. Can specify a list of allowed values and whether custom values are permitted beyond the enumerated list.</p>
    pub r#enum: ::std::option::Option<crate::types::ValidationEnum>,
}
impl Validation {
    /// <p>The minimum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be less than or equal to MaxLength.</p>
    pub fn min_length(&self) -> i32 {
        self.min_length
    }
    /// <p>The maximum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be greater than or equal to MinLength.</p>
    pub fn max_length(&self) -> i32 {
        self.max_length
    }
    /// <p>The minimum number of values in a list. Must be an integer greater than or equal to 0 and less than or equal to MaxValues. Applies to all list types.</p>
    pub fn min_values(&self) -> i32 {
        self.min_values
    }
    /// <p>The maximum number of values in a list. Must be an integer greater than or equal to 0 and greater than or equal to MinValues. Applies to all list types.</p>
    pub fn max_values(&self) -> i32 {
        self.max_values
    }
    /// <p>Boolean that defaults to false. Applies to text lists and text primary attributes. When true, enforces case-insensitive uniqueness for primary attributes and allows case-insensitive lookups.</p>
    pub fn ignore_case(&self) -> bool {
        self.ignore_case
    }
    /// <p>The smallest inclusive numeric value for NUMBER value type. Cannot be provided when ExclusiveMinimum is also provided. Must be less than or equal to Maximum and less than ExclusiveMaximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn minimum(&self) -> f64 {
        self.minimum
    }
    /// <p>The largest inclusive numeric value for NUMBER value type. Can be provided alongside ExclusiveMaximum where both operate independently. Must be greater than or equal to Minimum and greater than ExclusiveMinimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn maximum(&self) -> f64 {
        self.maximum
    }
    /// <p>The smallest exclusive numeric value for NUMBER value type. Can be provided alongside Minimum where both operate independently. Must be less than ExclusiveMaximum and Maximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn exclusive_minimum(&self) -> f64 {
        self.exclusive_minimum
    }
    /// <p>The largest exclusive numeric value for NUMBER value type. Can be provided alongside Maximum where both operate independently. Must be greater than ExclusiveMinimum and Minimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn exclusive_maximum(&self) -> f64 {
        self.exclusive_maximum
    }
    /// <p>Specifies that numeric values must be multiples of this number. Must be greater than 0. The result of dividing a value by this multiple must result in an integer. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn multiple_of(&self) -> f64 {
        self.multiple_of
    }
    /// <p>Defines enumeration constraints for attribute values. Can specify a list of allowed values and whether custom values are permitted beyond the enumerated list.</p>
    pub fn r#enum(&self) -> ::std::option::Option<&crate::types::ValidationEnum> {
        self.r#enum.as_ref()
    }
}
impl Validation {
    /// Creates a new builder-style object to manufacture [`Validation`](crate::types::Validation).
    pub fn builder() -> crate::types::builders::ValidationBuilder {
        crate::types::builders::ValidationBuilder::default()
    }
}

/// A builder for [`Validation`](crate::types::Validation).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ValidationBuilder {
    pub(crate) min_length: ::std::option::Option<i32>,
    pub(crate) max_length: ::std::option::Option<i32>,
    pub(crate) min_values: ::std::option::Option<i32>,
    pub(crate) max_values: ::std::option::Option<i32>,
    pub(crate) ignore_case: ::std::option::Option<bool>,
    pub(crate) minimum: ::std::option::Option<f64>,
    pub(crate) maximum: ::std::option::Option<f64>,
    pub(crate) exclusive_minimum: ::std::option::Option<f64>,
    pub(crate) exclusive_maximum: ::std::option::Option<f64>,
    pub(crate) multiple_of: ::std::option::Option<f64>,
    pub(crate) r#enum: ::std::option::Option<crate::types::ValidationEnum>,
}
impl ValidationBuilder {
    /// <p>The minimum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be less than or equal to MaxLength.</p>
    pub fn min_length(mut self, input: i32) -> Self {
        self.min_length = ::std::option::Option::Some(input);
        self
    }
    /// <p>The minimum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be less than or equal to MaxLength.</p>
    pub fn set_min_length(mut self, input: ::std::option::Option<i32>) -> Self {
        self.min_length = input;
        self
    }
    /// <p>The minimum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be less than or equal to MaxLength.</p>
    pub fn get_min_length(&self) -> &::std::option::Option<i32> {
        &self.min_length
    }
    /// <p>The maximum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be greater than or equal to MinLength.</p>
    pub fn max_length(mut self, input: i32) -> Self {
        self.max_length = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be greater than or equal to MinLength.</p>
    pub fn set_max_length(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_length = input;
        self
    }
    /// <p>The maximum number of characters a text value can contain. Applies to TEXT value type and values within a TEXT_LIST. Must be greater than or equal to MinLength.</p>
    pub fn get_max_length(&self) -> &::std::option::Option<i32> {
        &self.max_length
    }
    /// <p>The minimum number of values in a list. Must be an integer greater than or equal to 0 and less than or equal to MaxValues. Applies to all list types.</p>
    pub fn min_values(mut self, input: i32) -> Self {
        self.min_values = ::std::option::Option::Some(input);
        self
    }
    /// <p>The minimum number of values in a list. Must be an integer greater than or equal to 0 and less than or equal to MaxValues. Applies to all list types.</p>
    pub fn set_min_values(mut self, input: ::std::option::Option<i32>) -> Self {
        self.min_values = input;
        self
    }
    /// <p>The minimum number of values in a list. Must be an integer greater than or equal to 0 and less than or equal to MaxValues. Applies to all list types.</p>
    pub fn get_min_values(&self) -> &::std::option::Option<i32> {
        &self.min_values
    }
    /// <p>The maximum number of values in a list. Must be an integer greater than or equal to 0 and greater than or equal to MinValues. Applies to all list types.</p>
    pub fn max_values(mut self, input: i32) -> Self {
        self.max_values = ::std::option::Option::Some(input);
        self
    }
    /// <p>The maximum number of values in a list. Must be an integer greater than or equal to 0 and greater than or equal to MinValues. Applies to all list types.</p>
    pub fn set_max_values(mut self, input: ::std::option::Option<i32>) -> Self {
        self.max_values = input;
        self
    }
    /// <p>The maximum number of values in a list. Must be an integer greater than or equal to 0 and greater than or equal to MinValues. Applies to all list types.</p>
    pub fn get_max_values(&self) -> &::std::option::Option<i32> {
        &self.max_values
    }
    /// <p>Boolean that defaults to false. Applies to text lists and text primary attributes. When true, enforces case-insensitive uniqueness for primary attributes and allows case-insensitive lookups.</p>
    pub fn ignore_case(mut self, input: bool) -> Self {
        self.ignore_case = ::std::option::Option::Some(input);
        self
    }
    /// <p>Boolean that defaults to false. Applies to text lists and text primary attributes. When true, enforces case-insensitive uniqueness for primary attributes and allows case-insensitive lookups.</p>
    pub fn set_ignore_case(mut self, input: ::std::option::Option<bool>) -> Self {
        self.ignore_case = input;
        self
    }
    /// <p>Boolean that defaults to false. Applies to text lists and text primary attributes. When true, enforces case-insensitive uniqueness for primary attributes and allows case-insensitive lookups.</p>
    pub fn get_ignore_case(&self) -> &::std::option::Option<bool> {
        &self.ignore_case
    }
    /// <p>The smallest inclusive numeric value for NUMBER value type. Cannot be provided when ExclusiveMinimum is also provided. Must be less than or equal to Maximum and less than ExclusiveMaximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn minimum(mut self, input: f64) -> Self {
        self.minimum = ::std::option::Option::Some(input);
        self
    }
    /// <p>The smallest inclusive numeric value for NUMBER value type. Cannot be provided when ExclusiveMinimum is also provided. Must be less than or equal to Maximum and less than ExclusiveMaximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn set_minimum(mut self, input: ::std::option::Option<f64>) -> Self {
        self.minimum = input;
        self
    }
    /// <p>The smallest inclusive numeric value for NUMBER value type. Cannot be provided when ExclusiveMinimum is also provided. Must be less than or equal to Maximum and less than ExclusiveMaximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn get_minimum(&self) -> &::std::option::Option<f64> {
        &self.minimum
    }
    /// <p>The largest inclusive numeric value for NUMBER value type. Can be provided alongside ExclusiveMaximum where both operate independently. Must be greater than or equal to Minimum and greater than ExclusiveMinimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn maximum(mut self, input: f64) -> Self {
        self.maximum = ::std::option::Option::Some(input);
        self
    }
    /// <p>The largest inclusive numeric value for NUMBER value type. Can be provided alongside ExclusiveMaximum where both operate independently. Must be greater than or equal to Minimum and greater than ExclusiveMinimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn set_maximum(mut self, input: ::std::option::Option<f64>) -> Self {
        self.maximum = input;
        self
    }
    /// <p>The largest inclusive numeric value for NUMBER value type. Can be provided alongside ExclusiveMaximum where both operate independently. Must be greater than or equal to Minimum and greater than ExclusiveMinimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn get_maximum(&self) -> &::std::option::Option<f64> {
        &self.maximum
    }
    /// <p>The smallest exclusive numeric value for NUMBER value type. Can be provided alongside Minimum where both operate independently. Must be less than ExclusiveMaximum and Maximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn exclusive_minimum(mut self, input: f64) -> Self {
        self.exclusive_minimum = ::std::option::Option::Some(input);
        self
    }
    /// <p>The smallest exclusive numeric value for NUMBER value type. Can be provided alongside Minimum where both operate independently. Must be less than ExclusiveMaximum and Maximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn set_exclusive_minimum(mut self, input: ::std::option::Option<f64>) -> Self {
        self.exclusive_minimum = input;
        self
    }
    /// <p>The smallest exclusive numeric value for NUMBER value type. Can be provided alongside Minimum where both operate independently. Must be less than ExclusiveMaximum and Maximum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn get_exclusive_minimum(&self) -> &::std::option::Option<f64> {
        &self.exclusive_minimum
    }
    /// <p>The largest exclusive numeric value for NUMBER value type. Can be provided alongside Maximum where both operate independently. Must be greater than ExclusiveMinimum and Minimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn exclusive_maximum(mut self, input: f64) -> Self {
        self.exclusive_maximum = ::std::option::Option::Some(input);
        self
    }
    /// <p>The largest exclusive numeric value for NUMBER value type. Can be provided alongside Maximum where both operate independently. Must be greater than ExclusiveMinimum and Minimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn set_exclusive_maximum(mut self, input: ::std::option::Option<f64>) -> Self {
        self.exclusive_maximum = input;
        self
    }
    /// <p>The largest exclusive numeric value for NUMBER value type. Can be provided alongside Maximum where both operate independently. Must be greater than ExclusiveMinimum and Minimum. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn get_exclusive_maximum(&self) -> &::std::option::Option<f64> {
        &self.exclusive_maximum
    }
    /// <p>Specifies that numeric values must be multiples of this number. Must be greater than 0. The result of dividing a value by this multiple must result in an integer. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn multiple_of(mut self, input: f64) -> Self {
        self.multiple_of = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies that numeric values must be multiples of this number. Must be greater than 0. The result of dividing a value by this multiple must result in an integer. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn set_multiple_of(mut self, input: ::std::option::Option<f64>) -> Self {
        self.multiple_of = input;
        self
    }
    /// <p>Specifies that numeric values must be multiples of this number. Must be greater than 0. The result of dividing a value by this multiple must result in an integer. Applies to NUMBER and values within NUMBER_LIST.</p>
    pub fn get_multiple_of(&self) -> &::std::option::Option<f64> {
        &self.multiple_of
    }
    /// <p>Defines enumeration constraints for attribute values. Can specify a list of allowed values and whether custom values are permitted beyond the enumerated list.</p>
    pub fn r#enum(mut self, input: crate::types::ValidationEnum) -> Self {
        self.r#enum = ::std::option::Option::Some(input);
        self
    }
    /// <p>Defines enumeration constraints for attribute values. Can specify a list of allowed values and whether custom values are permitted beyond the enumerated list.</p>
    pub fn set_enum(mut self, input: ::std::option::Option<crate::types::ValidationEnum>) -> Self {
        self.r#enum = input;
        self
    }
    /// <p>Defines enumeration constraints for attribute values. Can specify a list of allowed values and whether custom values are permitted beyond the enumerated list.</p>
    pub fn get_enum(&self) -> &::std::option::Option<crate::types::ValidationEnum> {
        &self.r#enum
    }
    /// Consumes the builder and constructs a [`Validation`](crate::types::Validation).
    pub fn build(self) -> crate::types::Validation {
        crate::types::Validation {
            min_length: self.min_length.unwrap_or_default(),
            max_length: self.max_length.unwrap_or_default(),
            min_values: self.min_values.unwrap_or_default(),
            max_values: self.max_values.unwrap_or_default(),
            ignore_case: self.ignore_case.unwrap_or_default(),
            minimum: self.minimum.unwrap_or_default(),
            maximum: self.maximum.unwrap_or_default(),
            exclusive_minimum: self.exclusive_minimum.unwrap_or_default(),
            exclusive_maximum: self.exclusive_maximum.unwrap_or_default(),
            multiple_of: self.multiple_of.unwrap_or_default(),
            r#enum: self.r#enum,
        }
    }
}