1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
// 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,
}
}
}