1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - |
|
3 - | /// A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
2 + | /* StructureGenerator.kt:197 */
|
3 + | /// /* StructureGenerator.kt:197 */A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.
|
4 + | /* RustType.kt:516 */
|
4 5 | #[non_exhaustive]
|
6 + | /* RustType.kt:516 */
|
5 7 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 - | pub struct ValidationError {
|
7 - | /// A summary of the validation failure.
|
8 + | pub /* StructureGenerator.kt:201 */ struct ValidationError {
|
9 + | /// /* StructureGenerator.kt:231 */A summary of the validation failure.
|
8 10 | pub message: ::std::string::String,
|
9 - | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
11 + | /// /* StructureGenerator.kt:231 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
10 12 | pub field_list: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>,
|
11 - | pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
|
13 + | /* ErrorGenerator.kt:53 */ pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
|
14 + | /* StructureGenerator.kt:201 */
|
12 15 | }
|
16 + | /* StructureGenerator.kt:135 */
|
13 17 | impl ValidationError {
|
14 - | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
15 - | ///
|
16 - | /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.field_list.is_none()`.
|
18 + | /// /* StructureGenerator.kt:231 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
19 + | /// /* StructureGenerator.kt:162 */
|
20 + | /// /* StructureGenerator.kt:163 */If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.field_list.is_none()`.
|
21 + | /* StructureGenerator.kt:166 */
|
17 22 | pub fn field_list(&self) -> &[crate::types::ValidationExceptionField] {
|
18 - | self.field_list.as_deref().unwrap_or_default()
|
23 + | /* StructureGenerator.kt:169 */
|
24 + | self.field_list
|
25 + | .as_deref()
|
26 + | /* StructureGenerator.kt:175 */
|
27 + | .unwrap_or_default()
|
28 + | /* StructureGenerator.kt:166 */
|
19 29 | }
|
30 + | /* StructureGenerator.kt:135 */
|
20 31 | }
|
32 + | /* ErrorImplGenerator.kt:99 */
|
21 33 | impl ValidationError {
|
34 + | /* ErrorImplGenerator.kt:128 */
|
22 35 | /// Returns the error message.
|
23 36 | pub fn message(&self) -> &str {
|
24 37 | &self.message
|
25 38 | }
|
39 + | /* ErrorImplGenerator.kt:99 */
|
26 40 | }
|
41 + | /* ErrorImplGenerator.kt:153 */
|
27 42 | impl ::std::fmt::Display for ValidationError {
|
43 + | /* ErrorImplGenerator.kt:154 */
|
28 44 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
45 + | /* ErrorImplGenerator.kt:161 */
|
29 46 | ::std::write!(f, "ValidationError [ValidationException]")?;
|
47 + | /* ErrorImplGenerator.kt:166 */
|
30 48 | {
|
49 + | /* ErrorImplGenerator.kt:167 */
|
31 50 | ::std::write!(f, ": {}", &self.message)?;
|
51 + | /* ErrorImplGenerator.kt:166 */
|
32 52 | }
|
53 + | /* ErrorImplGenerator.kt:171 */
|
33 54 | Ok(())
|
55 + | /* ErrorImplGenerator.kt:154 */
|
34 56 | }
|
57 + | /* ErrorImplGenerator.kt:153 */
|
35 58 | }
|
59 + | /* ErrorImplGenerator.kt:175 */
|
36 60 | impl ::std::error::Error for ValidationError {}
|
61 + | /* ErrorGenerator.kt:77 */
|
37 62 | impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ValidationError {
|
63 + | /* ErrorGenerator.kt:78 */
|
38 64 | fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
|
39 65 | &self.meta
|
40 66 | }
|
67 + | /* ErrorGenerator.kt:77 */
|
41 68 | }
|
69 + | /* ErrorGenerator.kt:81 */
|
42 70 | impl ValidationError {
|
43 - | /// Creates a new builder-style object to manufacture [`ValidationError`](crate::types::error::ValidationError).
|
71 + | /// /* BuilderGenerator.kt:173 */Creates a new builder-style object to manufacture [`ValidationError`](crate::types::error::ValidationError).
|
72 + | /* BuilderGenerator.kt:175 */
|
44 73 | pub fn builder() -> crate::types::error::builders::ValidationErrorBuilder {
|
74 + | /* BuilderGenerator.kt:176 */
|
45 75 | crate::types::error::builders::ValidationErrorBuilder::default()
|
76 + | /* BuilderGenerator.kt:175 */
|
46 77 | }
|
78 + | /* ErrorGenerator.kt:81 */
|
47 79 | }
|
48 80 |
|
49 - | /// A builder for [`ValidationError`](crate::types::error::ValidationError).
|
81 + | /// /* BuilderGenerator.kt:342 */A builder for [`ValidationError`](crate::types::error::ValidationError).
|
82 + | /* RustType.kt:516 */
|
50 83 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
84 + | /* RustType.kt:516 */
|
51 85 | #[non_exhaustive]
|
86 + | /* BuilderGenerator.kt:345 */
|
52 87 | pub struct ValidationErrorBuilder {
|
53 - | pub(crate) message: ::std::option::Option<::std::string::String>,
|
54 - | pub(crate) field_list: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>,
|
55 - | meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
88 + | /* BuilderGenerator.kt:275 */ pub(crate) message: ::std::option::Option<::std::string::String>,
|
89 + | /* BuilderGenerator.kt:275 */ pub(crate) field_list: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>,
|
90 + | /* ErrorGenerator.kt:97 */ meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
|
91 + | /* BuilderGenerator.kt:345 */
|
56 92 | }
|
93 + | /* BuilderGenerator.kt:355 */
|
57 94 | impl ValidationErrorBuilder {
|
58 - | /// A summary of the validation failure.
|
59 - | /// This field is required.
|
95 + | /// /* BuilderGenerator.kt:286 */A summary of the validation failure.
|
96 + | /// /* BuilderGenerator.kt:288 */This field is required.
|
97 + | /* BuilderGenerator.kt:291 */
|
60 98 | pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
99 + | /* BuilderGenerator.kt:292 */
|
61 100 | self.message = ::std::option::Option::Some(input.into());
|
101 + | /* BuilderGenerator.kt:293 */
|
62 102 | self
|
103 + | /* BuilderGenerator.kt:291 */
|
63 104 | }
|
64 - | /// A summary of the validation failure.
|
105 + | /// /* BuilderGenerator.kt:312 */A summary of the validation failure.
|
106 + | /* BuilderGenerator.kt:314 */
|
65 107 | pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
108 + | /* BuilderGenerator.kt:315 */
|
66 109 | self.message = input;
|
67 110 | self
|
111 + | /* BuilderGenerator.kt:314 */
|
68 112 | }
|
69 - | /// A summary of the validation failure.
|
113 + | /// /* BuilderGenerator.kt:334 */A summary of the validation failure.
|
114 + | /* BuilderGenerator.kt:336 */
|
70 115 | pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
|
116 + | /* BuilderGenerator.kt:337 */
|
71 117 | &self.message
|
118 + | /* BuilderGenerator.kt:336 */
|
72 119 | }
|
73 - | /// Appends an item to `field_list`.
|
120 + | /// /* BuilderGenerator.kt:410 */Appends an item to `field_list`.
|
121 + | /* BuilderGenerator.kt:411 */
|
74 122 | ///
|
75 - | /// To override the contents of this collection use [`set_field_list`](Self::set_field_list).
|
123 + | /// /* BuilderGenerator.kt:412 */To override the contents of this collection use [`set_field_list`](Self::set_field_list).
|
124 + | /* BuilderGenerator.kt:413 */
|
76 125 | ///
|
77 - | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
126 + | /// /* BuilderGenerator.kt:414 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
127 + | /* BuilderGenerator.kt:418 */
|
78 128 | pub fn field_list(mut self, input: crate::types::ValidationExceptionField) -> Self {
|
129 + | /* BuilderGenerator.kt:419 */
|
79 130 | let mut v = self.field_list.unwrap_or_default();
|
80 131 | v.push(input);
|
81 132 | self.field_list = ::std::option::Option::Some(v);
|
82 133 | self
|
134 + | /* BuilderGenerator.kt:418 */
|
83 135 | }
|
84 - | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
136 + | /// /* BuilderGenerator.kt:312 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
137 + | /* BuilderGenerator.kt:314 */
|
85 138 | pub fn set_field_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>>) -> Self {
|
139 + | /* BuilderGenerator.kt:315 */
|
86 140 | self.field_list = input;
|
87 141 | self
|
142 + | /* BuilderGenerator.kt:314 */
|
88 143 | }
|
89 - | /// A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
144 + | /// /* BuilderGenerator.kt:334 */A list of specific failures encountered while validating the input. A member can appear in this list more than once if it failed to satisfy multiple constraints.
|
145 + | /* BuilderGenerator.kt:336 */
|
90 146 | pub fn get_field_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ValidationExceptionField>> {
|
147 + | /* BuilderGenerator.kt:337 */
|
91 148 | &self.field_list
|
149 + | /* BuilderGenerator.kt:336 */
|
92 150 | }
|
151 + | /* ErrorGenerator.kt:101 */
|
93 152 | /// Sets error metadata
|
94 153 | pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
|
95 154 | self.meta = Some(meta);
|
96 155 | self
|
97 156 | }
|
98 157 |
|
99 158 | /// Sets error metadata
|
100 159 | pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
|
101 160 | self.meta = meta;
|
102 161 | self
|
103 162 | }
|
104 - | /// Consumes the builder and constructs a [`ValidationError`](crate::types::error::ValidationError).
|
105 - | /// This method will fail if any of the following fields are not set:
|
106 - | /// - [`message`](crate::types::error::builders::ValidationErrorBuilder::message)
|
163 + | /// /* BuilderGenerator.kt:240 */Consumes the builder and constructs a [`ValidationError`](crate::types::error::ValidationError).
|
164 + | /// /* BuilderGenerator.kt:243 */This method will fail if any of the following fields are not set:
|
165 + | /// /* BuilderGenerator.kt:246 */- [`message`](crate::types::error::builders::ValidationErrorBuilder::message)
|
166 + | /* BuilderGenerator.kt:253 */
|
107 167 | pub fn build(self) -> ::std::result::Result<crate::types::error::ValidationError, ::aws_smithy_types::error::operation::BuildError> {
|
108 - | ::std::result::Result::Ok(crate::types::error::ValidationError {
|
109 - | message: self.message.ok_or_else(|| {
|
110 - | ::aws_smithy_types::error::operation::BuildError::missing_field(
|
111 - | "message",
|
112 - | "message was not specified but it is required when building ValidationError",
|
113 - | )
|
114 - | })?,
|
115 - | field_list: self.field_list,
|
116 - | meta: self.meta.unwrap_or_default(),
|
117 - | })
|
168 + | /* BuilderGenerator.kt:254 */
|
169 + | ::std::result::Result::Ok(
|
170 + | /* BuilderGenerator.kt:477 */crate::types::error::ValidationError {
|
171 + | /* BuilderGenerator.kt:481 */message: self.message
|
172 + | /* BuilderGenerator.kt:494 */.ok_or_else(||
|
173 + | /* BuilderGenerator.kt:117 */::aws_smithy_types::error::operation::BuildError::missing_field("message", "message was not specified but it is required when building ValidationError")
|
174 + | /* BuilderGenerator.kt:494 */)?
|
175 + | ,
|
176 + | /* BuilderGenerator.kt:481 */field_list: self.field_list
|
177 + | ,
|
178 + | /* ErrorGenerator.kt:120 */meta: self.meta.unwrap_or_default(),
|
179 + | /* BuilderGenerator.kt:477 */}
|
180 + | /* BuilderGenerator.kt:254 */)
|
181 + | /* BuilderGenerator.kt:253 */
|
118 182 | }
|
183 + | /* BuilderGenerator.kt:355 */
|
119 184 | }
|