#[non_exhaustive]pub struct ParameterConstraintsBuilder { /* private fields */ }
Expand description
A builder for ParameterConstraints
.
Implementations§
source§impl ParameterConstraintsBuilder
impl ParameterConstraintsBuilder
sourcepub fn allowed_values(self, input: impl Into<String>) -> Self
pub fn allowed_values(self, input: impl Into<String>) -> Self
Appends an item to allowed_values
.
To override the contents of this collection use set_allowed_values
.
The values that the administrator has allowed for the parameter.
sourcepub fn set_allowed_values(self, input: Option<Vec<String>>) -> Self
pub fn set_allowed_values(self, input: Option<Vec<String>>) -> Self
The values that the administrator has allowed for the parameter.
sourcepub fn get_allowed_values(&self) -> &Option<Vec<String>>
pub fn get_allowed_values(&self) -> &Option<Vec<String>>
The values that the administrator has allowed for the parameter.
sourcepub fn allowed_pattern(self, input: impl Into<String>) -> Self
pub fn allowed_pattern(self, input: impl Into<String>) -> Self
A regular expression that represents the patterns that allow for String
types. The pattern must match the entire parameter value provided.
sourcepub fn set_allowed_pattern(self, input: Option<String>) -> Self
pub fn set_allowed_pattern(self, input: Option<String>) -> Self
A regular expression that represents the patterns that allow for String
types. The pattern must match the entire parameter value provided.
sourcepub fn get_allowed_pattern(&self) -> &Option<String>
pub fn get_allowed_pattern(&self) -> &Option<String>
A regular expression that represents the patterns that allow for String
types. The pattern must match the entire parameter value provided.
sourcepub fn constraint_description(self, input: impl Into<String>) -> Self
pub fn constraint_description(self, input: impl Into<String>) -> Self
A string that explains a constraint when the constraint is violated. For example, without a constraint description, a parameter that has an allowed pattern of [A-Za-z0-9]+
displays the following error message when the user specifies an invalid value:
Malformed input-Parameter MyParameter must match pattern [A-Za-z0-9]+
By adding a constraint description, such as must only contain letters (uppercase and lowercase) and numbers, you can display the following customized error message:
Malformed input-Parameter MyParameter must only contain uppercase and lowercase letters and numbers.
sourcepub fn set_constraint_description(self, input: Option<String>) -> Self
pub fn set_constraint_description(self, input: Option<String>) -> Self
A string that explains a constraint when the constraint is violated. For example, without a constraint description, a parameter that has an allowed pattern of [A-Za-z0-9]+
displays the following error message when the user specifies an invalid value:
Malformed input-Parameter MyParameter must match pattern [A-Za-z0-9]+
By adding a constraint description, such as must only contain letters (uppercase and lowercase) and numbers, you can display the following customized error message:
Malformed input-Parameter MyParameter must only contain uppercase and lowercase letters and numbers.
sourcepub fn get_constraint_description(&self) -> &Option<String>
pub fn get_constraint_description(&self) -> &Option<String>
A string that explains a constraint when the constraint is violated. For example, without a constraint description, a parameter that has an allowed pattern of [A-Za-z0-9]+
displays the following error message when the user specifies an invalid value:
Malformed input-Parameter MyParameter must match pattern [A-Za-z0-9]+
By adding a constraint description, such as must only contain letters (uppercase and lowercase) and numbers, you can display the following customized error message:
Malformed input-Parameter MyParameter must only contain uppercase and lowercase letters and numbers.
sourcepub fn max_length(self, input: impl Into<String>) -> Self
pub fn max_length(self, input: impl Into<String>) -> Self
An integer value that determines the largest number of characters you want to allow for String
types.
sourcepub fn set_max_length(self, input: Option<String>) -> Self
pub fn set_max_length(self, input: Option<String>) -> Self
An integer value that determines the largest number of characters you want to allow for String
types.
sourcepub fn get_max_length(&self) -> &Option<String>
pub fn get_max_length(&self) -> &Option<String>
An integer value that determines the largest number of characters you want to allow for String
types.
sourcepub fn min_length(self, input: impl Into<String>) -> Self
pub fn min_length(self, input: impl Into<String>) -> Self
An integer value that determines the smallest number of characters you want to allow for String
types.
sourcepub fn set_min_length(self, input: Option<String>) -> Self
pub fn set_min_length(self, input: Option<String>) -> Self
An integer value that determines the smallest number of characters you want to allow for String
types.
sourcepub fn get_min_length(&self) -> &Option<String>
pub fn get_min_length(&self) -> &Option<String>
An integer value that determines the smallest number of characters you want to allow for String
types.
sourcepub fn max_value(self, input: impl Into<String>) -> Self
pub fn max_value(self, input: impl Into<String>) -> Self
A numeric value that determines the largest numeric value you want to allow for Number
types.
sourcepub fn set_max_value(self, input: Option<String>) -> Self
pub fn set_max_value(self, input: Option<String>) -> Self
A numeric value that determines the largest numeric value you want to allow for Number
types.
sourcepub fn get_max_value(&self) -> &Option<String>
pub fn get_max_value(&self) -> &Option<String>
A numeric value that determines the largest numeric value you want to allow for Number
types.
sourcepub fn min_value(self, input: impl Into<String>) -> Self
pub fn min_value(self, input: impl Into<String>) -> Self
A numeric value that determines the smallest numeric value you want to allow for Number
types.
sourcepub fn set_min_value(self, input: Option<String>) -> Self
pub fn set_min_value(self, input: Option<String>) -> Self
A numeric value that determines the smallest numeric value you want to allow for Number
types.
sourcepub fn get_min_value(&self) -> &Option<String>
pub fn get_min_value(&self) -> &Option<String>
A numeric value that determines the smallest numeric value you want to allow for Number
types.
sourcepub fn build(self) -> ParameterConstraints
pub fn build(self) -> ParameterConstraints
Consumes the builder and constructs a ParameterConstraints
.
Trait Implementations§
source§impl Clone for ParameterConstraintsBuilder
impl Clone for ParameterConstraintsBuilder
source§fn clone(&self) -> ParameterConstraintsBuilder
fn clone(&self) -> ParameterConstraintsBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ParameterConstraintsBuilder
impl Debug for ParameterConstraintsBuilder
source§impl Default for ParameterConstraintsBuilder
impl Default for ParameterConstraintsBuilder
source§fn default() -> ParameterConstraintsBuilder
fn default() -> ParameterConstraintsBuilder
source§impl PartialEq for ParameterConstraintsBuilder
impl PartialEq for ParameterConstraintsBuilder
source§fn eq(&self, other: &ParameterConstraintsBuilder) -> bool
fn eq(&self, other: &ParameterConstraintsBuilder) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for ParameterConstraintsBuilder
Auto Trait Implementations§
impl Freeze for ParameterConstraintsBuilder
impl RefUnwindSafe for ParameterConstraintsBuilder
impl Send for ParameterConstraintsBuilder
impl Sync for ParameterConstraintsBuilder
impl Unpin for ParameterConstraintsBuilder
impl UnwindSafe for ParameterConstraintsBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more