Skip to main content

aws_sdk_cognitoidentityprovider/types/
_string_attribute_constraints_type.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The minimum and maximum length values of an attribute that is of the string type, for example <code>custom:department</code>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct StringAttributeConstraintsType {
7    /// <p>The minimum length of a string attribute value.</p>
8    pub min_length: ::std::option::Option<::std::string::String>,
9    /// <p>The maximum length of a string attribute value. Must be a number less than or equal to <code>2^1023</code>, represented as a string with a length of 131072 characters or fewer.</p>
10    pub max_length: ::std::option::Option<::std::string::String>,
11}
12impl StringAttributeConstraintsType {
13    /// <p>The minimum length of a string attribute value.</p>
14    pub fn min_length(&self) -> ::std::option::Option<&str> {
15        self.min_length.as_deref()
16    }
17    /// <p>The maximum length of a string attribute value. Must be a number less than or equal to <code>2^1023</code>, represented as a string with a length of 131072 characters or fewer.</p>
18    pub fn max_length(&self) -> ::std::option::Option<&str> {
19        self.max_length.as_deref()
20    }
21}
22impl StringAttributeConstraintsType {
23    /// Creates a new builder-style object to manufacture [`StringAttributeConstraintsType`](crate::types::StringAttributeConstraintsType).
24    pub fn builder() -> crate::types::builders::StringAttributeConstraintsTypeBuilder {
25        crate::types::builders::StringAttributeConstraintsTypeBuilder::default()
26    }
27}
28
29/// A builder for [`StringAttributeConstraintsType`](crate::types::StringAttributeConstraintsType).
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct StringAttributeConstraintsTypeBuilder {
33    pub(crate) min_length: ::std::option::Option<::std::string::String>,
34    pub(crate) max_length: ::std::option::Option<::std::string::String>,
35}
36impl StringAttributeConstraintsTypeBuilder {
37    /// <p>The minimum length of a string attribute value.</p>
38    pub fn min_length(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39        self.min_length = ::std::option::Option::Some(input.into());
40        self
41    }
42    /// <p>The minimum length of a string attribute value.</p>
43    pub fn set_min_length(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44        self.min_length = input;
45        self
46    }
47    /// <p>The minimum length of a string attribute value.</p>
48    pub fn get_min_length(&self) -> &::std::option::Option<::std::string::String> {
49        &self.min_length
50    }
51    /// <p>The maximum length of a string attribute value. Must be a number less than or equal to <code>2^1023</code>, represented as a string with a length of 131072 characters or fewer.</p>
52    pub fn max_length(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.max_length = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The maximum length of a string attribute value. Must be a number less than or equal to <code>2^1023</code>, represented as a string with a length of 131072 characters or fewer.</p>
57    pub fn set_max_length(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.max_length = input;
59        self
60    }
61    /// <p>The maximum length of a string attribute value. Must be a number less than or equal to <code>2^1023</code>, represented as a string with a length of 131072 characters or fewer.</p>
62    pub fn get_max_length(&self) -> &::std::option::Option<::std::string::String> {
63        &self.max_length
64    }
65    /// Consumes the builder and constructs a [`StringAttributeConstraintsType`](crate::types::StringAttributeConstraintsType).
66    pub fn build(self) -> crate::types::StringAttributeConstraintsType {
67        crate::types::StringAttributeConstraintsType {
68            min_length: self.min_length,
69            max_length: self.max_length,
70        }
71    }
72}