66 66 | crate::error::InternalServerError {
|
67 67 | message: error.to_string(),
|
68 68 | }
|
69 69 | .into()
|
70 70 | })
|
71 71 | }
|
72 72 | }
|
73 73 |
|
74 74 | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
75 75 | /// :param message str:
|
76 + | /// :param field_list typing.Optional\[typing.List\[unique_items.model.ValidationExceptionField\]\]:
|
76 77 | /// :rtype None:
|
77 - | #[allow(missing_docs)] // documentation missing in model
|
78 + | /// 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.
|
78 79 | #[derive(
|
79 80 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
80 81 | )]
|
81 - | pub struct InternalServerError {
|
82 + | pub struct ValidationException {
|
82 83 | #[pyo3(get, set)]
|
83 84 | /// :type str:
|
84 - | #[allow(missing_docs)] // documentation missing in model
|
85 + | /// A summary of the validation failure.
|
85 86 | pub message: ::std::string::String,
|
87 + | #[pyo3(get, set)]
|
88 + | /// :type typing.Optional\[typing.List\[unique_items.model.ValidationExceptionField\]\]:
|
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.
|
90 + | pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
91 + | }
|
92 + | impl ValidationException {
|
93 + | /// 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.
|
94 + | pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
|
95 + | self.field_list.as_deref()
|
96 + | }
|
86 97 | }
|
87 98 | #[allow(clippy::new_without_default)]
|
88 99 | #[allow(clippy::too_many_arguments)]
|
89 100 | #[::pyo3::pymethods]
|
90 - | impl InternalServerError {
|
101 + | impl ValidationException {
|
91 102 | #[new]
|
92 - | pub fn new(message: ::std::string::String) -> Self {
|
93 - | Self { message }
|
103 + | pub fn new(
|
104 + | message: ::std::string::String,
|
105 + | field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
106 + | ) -> Self {
|
107 + | Self {
|
108 + | message,
|
109 + | field_list,
|
110 + | }
|
94 111 | }
|
95 112 | fn __repr__(&self) -> String {
|
96 113 | format!("{self:?}")
|
97 114 | }
|
98 115 | fn __str__(&self) -> String {
|
99 116 | format!("{self:?}")
|
100 117 | }
|
101 118 | }
|
102 - | impl InternalServerError {
|
119 + | impl ValidationException {
|
103 120 | /// Returns the error message.
|
104 121 | pub fn message(&self) -> &str {
|
105 122 | &self.message
|
106 123 | }
|
107 124 | #[doc(hidden)]
|
108 125 | /// Returns the error name.
|
109 126 | pub fn name(&self) -> &'static str {
|
110 - | "InternalServerError"
|
127 + | "ValidationException"
|
111 128 | }
|
112 129 | }
|
113 - | impl ::std::fmt::Display for InternalServerError {
|
130 + | impl ::std::fmt::Display for ValidationException {
|
114 131 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
115 - | ::std::write!(f, "InternalServerError")?;
|
132 + | ::std::write!(f, "ValidationException")?;
|
116 133 | {
|
117 134 | ::std::write!(f, ": {}", &self.message)?;
|
118 135 | }
|
119 136 | Ok(())
|
120 137 | }
|
121 138 | }
|
122 - | impl ::std::error::Error for InternalServerError {}
|
123 - | impl InternalServerError {
|
124 - | /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
125 - | pub fn builder() -> crate::error::internal_server_error::Builder {
|
126 - | crate::error::internal_server_error::Builder::default()
|
139 + | impl ::std::error::Error for ValidationException {}
|
140 + | impl ValidationException {
|
141 + | /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
|
142 + | pub fn builder() -> crate::error::validation_exception::Builder {
|
143 + | crate::error::validation_exception::Builder::default()
|
127 144 | }
|
128 145 | }
|
129 146 |
|
130 147 | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
131 148 | /// :param message str:
|
132 - | /// :param field_list typing.Optional\[typing.List\[unique_items.model.ValidationExceptionField\]\]:
|
133 149 | /// :rtype None:
|
134 - | /// 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.
|
150 + | #[allow(missing_docs)] // documentation missing in model
|
135 151 | #[derive(
|
136 152 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
137 153 | )]
|
138 - | pub struct ValidationException {
|
154 + | pub struct InternalServerError {
|
139 155 | #[pyo3(get, set)]
|
140 156 | /// :type str:
|
141 - | /// A summary of the validation failure.
|
157 + | #[allow(missing_docs)] // documentation missing in model
|
142 158 | pub message: ::std::string::String,
|
143 - | #[pyo3(get, set)]
|
144 - | /// :type typing.Optional\[typing.List\[unique_items.model.ValidationExceptionField\]\]:
|
145 - | /// 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.
|
146 - | pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
147 - | }
|
148 - | impl ValidationException {
|
149 - | /// 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.
|
150 - | pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
|
151 - | self.field_list.as_deref()
|
152 - | }
|
153 159 | }
|
154 160 | #[allow(clippy::new_without_default)]
|
155 161 | #[allow(clippy::too_many_arguments)]
|
156 162 | #[::pyo3::pymethods]
|
157 - | impl ValidationException {
|
163 + | impl InternalServerError {
|
158 164 | #[new]
|
159 - | pub fn new(
|
160 - | message: ::std::string::String,
|
161 - | field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
162 - | ) -> Self {
|
163 - | Self {
|
164 - | message,
|
165 - | field_list,
|
166 - | }
|
165 + | pub fn new(message: ::std::string::String) -> Self {
|
166 + | Self { message }
|
167 167 | }
|
168 168 | fn __repr__(&self) -> String {
|
169 169 | format!("{self:?}")
|
170 170 | }
|
171 171 | fn __str__(&self) -> String {
|
172 172 | format!("{self:?}")
|
173 173 | }
|
174 174 | }
|
175 - | impl ValidationException {
|
175 + | impl InternalServerError {
|
176 176 | /// Returns the error message.
|
177 177 | pub fn message(&self) -> &str {
|
178 178 | &self.message
|
179 179 | }
|
180 180 | #[doc(hidden)]
|
181 181 | /// Returns the error name.
|
182 182 | pub fn name(&self) -> &'static str {
|
183 - | "ValidationException"
|
183 + | "InternalServerError"
|
184 184 | }
|
185 185 | }
|
186 - | impl ::std::fmt::Display for ValidationException {
|
186 + | impl ::std::fmt::Display for InternalServerError {
|
187 187 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
188 - | ::std::write!(f, "ValidationException")?;
|
188 + | ::std::write!(f, "InternalServerError")?;
|
189 189 | {
|
190 190 | ::std::write!(f, ": {}", &self.message)?;
|
191 191 | }
|
192 192 | Ok(())
|
193 193 | }
|
194 194 | }
|
195 - | impl ::std::error::Error for ValidationException {}
|
196 - | impl ValidationException {
|
197 - | /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
|
198 - | pub fn builder() -> crate::error::validation_exception::Builder {
|
199 - | crate::error::validation_exception::Builder::default()
|
195 + | impl ::std::error::Error for InternalServerError {}
|
196 + | impl InternalServerError {
|
197 + | /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
198 + | pub fn builder() -> crate::error::internal_server_error::Builder {
|
199 + | crate::error::internal_server_error::Builder::default()
|
200 200 | }
|
201 201 | }
|
202 - | /// See [`InternalServerError`](crate::error::InternalServerError).
|
203 - | pub mod internal_server_error {
|
202 + | /// See [`ValidationException`](crate::error::ValidationException).
|
203 + | pub mod validation_exception {
|
204 204 |
|
205 205 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
206 206 | /// Holds one variant for each of the ways the builder can fail.
|
207 207 | #[allow(clippy::enum_variant_names)]
|
208 208 | pub enum ConstraintViolation {
|
209 - | /// `message` was not provided but it is required when building `InternalServerError`.
|
209 + | /// `message` was not provided but it is required when building `ValidationException`.
|
210 210 | MissingMessage,
|
211 211 | }
|
212 212 | impl ::std::fmt::Display for ConstraintViolation {
|
213 213 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
214 214 | match self {
|
215 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
215 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
216 216 | }
|
217 217 | }
|
218 218 | }
|
219 219 | impl ::std::error::Error for ConstraintViolation {}
|
220 - | impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
|
220 + | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
221 221 | type Error = ConstraintViolation;
|
222 222 |
|
223 223 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
224 224 | builder.build()
|
225 225 | }
|
226 226 | }
|
227 - | /// A builder for [`InternalServerError`](crate::error::InternalServerError).
|
227 + | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
228 228 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
229 229 | pub struct Builder {
|
230 230 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
231 + | pub(crate) field_list:
|
232 + | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
231 233 | }
|
232 234 | impl Builder {
|
233 - | #[allow(missing_docs)] // documentation missing in model
|
235 + | /// A summary of the validation failure.
|
234 236 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
235 237 | self.message = Some(input);
|
236 238 | self
|
237 239 | }
|
238 - | /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
240 + | /// 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.
|
241 + | pub fn field_list(
|
242 + | mut self,
|
243 + | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
244 + | ) -> Self {
|
245 + | self.field_list = input;
|
246 + | self
|
247 + | }
|
248 + | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
239 249 | ///
|
240 - | /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
|
250 + | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if you do not provide a value for all non-`Option`al members.
|
241 251 | ///
|
242 - | pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
252 + | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
243 253 | self.build_enforcing_required_and_enum_traits()
|
244 254 | }
|
245 255 | fn build_enforcing_required_and_enum_traits(
|
246 256 | self,
|
247 - | ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
248 - | Ok(crate::error::InternalServerError {
|
257 + | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
258 + | Ok(crate::error::ValidationException {
|
249 259 | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
260 + | field_list: self.field_list,
|
250 261 | })
|
251 262 | }
|
252 263 | }
|
253 264 | }
|
254 - | /// See [`ValidationException`](crate::error::ValidationException).
|
255 - | pub mod validation_exception {
|
265 + | /// See [`InternalServerError`](crate::error::InternalServerError).
|
266 + | pub mod internal_server_error {
|
256 267 |
|
257 268 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
258 269 | /// Holds one variant for each of the ways the builder can fail.
|
259 270 | #[allow(clippy::enum_variant_names)]
|
260 271 | pub enum ConstraintViolation {
|
261 - | /// `message` was not provided but it is required when building `ValidationException`.
|
272 + | /// `message` was not provided but it is required when building `InternalServerError`.
|
262 273 | MissingMessage,
|
263 274 | }
|
264 275 | impl ::std::fmt::Display for ConstraintViolation {
|
265 276 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
266 277 | match self {
|
267 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
278 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
268 279 | }
|
269 280 | }
|
270 281 | }
|
271 282 | impl ::std::error::Error for ConstraintViolation {}
|
272 - | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
283 + | impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
|
273 284 | type Error = ConstraintViolation;
|
274 285 |
|
275 286 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
276 287 | builder.build()
|
277 288 | }
|
278 289 | }
|
279 - | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
290 + | /// A builder for [`InternalServerError`](crate::error::InternalServerError).
|
280 291 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
281 292 | pub struct Builder {
|
282 293 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
283 - | pub(crate) field_list:
|
284 - | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
285 294 | }
|
286 295 | impl Builder {
|
287 - | /// A summary of the validation failure.
|
296 + | #[allow(missing_docs)] // documentation missing in model
|
288 297 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
289 298 | self.message = Some(input);
|
290 299 | self
|
291 300 | }
|
292 - | /// 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.
|
293 - | pub fn field_list(
|
294 - | mut self,
|
295 - | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
296 - | ) -> Self {
|
297 - | self.field_list = input;
|
298 - | self
|
299 - | }
|
300 - | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
301 + | /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
301 302 | ///
|
302 - | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if you do not provide a value for all non-`Option`al members.
|
303 + | /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
|
303 304 | ///
|
304 - | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
305 + | pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
305 306 | self.build_enforcing_required_and_enum_traits()
|
306 307 | }
|
307 308 | fn build_enforcing_required_and_enum_traits(
|
308 309 | self,
|
309 - | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
310 - | Ok(crate::error::ValidationException {
|
310 + | ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
311 + | Ok(crate::error::InternalServerError {
|
311 312 | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
312 - | field_list: self.field_list,
|
313 313 | })
|
314 314 | }
|
315 315 | }
|
316 316 | }
|