1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - | /// Error type for the `RPCEcho` operation.
|
3 - | /// Each variant represents an error that can occur for the `RPCEcho` operation.
|
2 + | /// Error type for the `ReservedWordsAsMembers` operation.
|
3 + | /// Each variant represents an error that can occur for the `ReservedWordsAsMembers` operation.
|
4 4 | #[derive(::std::fmt::Debug)]
|
5 - | pub enum RPCEchoError {
|
5 + | pub enum ReservedWordsAsMembersError {
|
6 6 | /// 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.
|
7 7 | ValidationException(crate::error::ValidationException),
|
8 8 | #[allow(missing_docs)] // documentation missing in model
|
9 9 | InternalServerError(crate::error::InternalServerError),
|
10 10 | }
|
11 - | impl ::std::fmt::Display for RPCEchoError {
|
11 + | impl ::std::fmt::Display for ReservedWordsAsMembersError {
|
12 12 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
13 13 | match &self {
|
14 - | RPCEchoError::ValidationException(_inner) => _inner.fmt(f),
|
15 - | RPCEchoError::InternalServerError(_inner) => _inner.fmt(f),
|
14 + | ReservedWordsAsMembersError::ValidationException(_inner) => _inner.fmt(f),
|
15 + | ReservedWordsAsMembersError::InternalServerError(_inner) => _inner.fmt(f),
|
16 16 | }
|
17 17 | }
|
18 18 | }
|
19 - | impl RPCEchoError {
|
20 - | /// Returns `true` if the error kind is `RPCEchoError::ValidationException`.
|
19 + | impl ReservedWordsAsMembersError {
|
20 + | /// Returns `true` if the error kind is `ReservedWordsAsMembersError::ValidationException`.
|
21 21 | pub fn is_validation_exception(&self) -> bool {
|
22 - | matches!(&self, RPCEchoError::ValidationException(_))
|
22 + | matches!(&self, ReservedWordsAsMembersError::ValidationException(_))
|
23 23 | }
|
24 - | /// Returns `true` if the error kind is `RPCEchoError::InternalServerError`.
|
24 + | /// Returns `true` if the error kind is `ReservedWordsAsMembersError::InternalServerError`.
|
25 25 | pub fn is_internal_server_error(&self) -> bool {
|
26 - | matches!(&self, RPCEchoError::InternalServerError(_))
|
26 + | matches!(&self, ReservedWordsAsMembersError::InternalServerError(_))
|
27 27 | }
|
28 28 | /// Returns the error name string by matching the correct variant.
|
29 29 | pub fn name(&self) -> &'static str {
|
30 30 | match &self {
|
31 - | RPCEchoError::ValidationException(_inner) => _inner.name(),
|
32 - | RPCEchoError::InternalServerError(_inner) => _inner.name(),
|
31 + | ReservedWordsAsMembersError::ValidationException(_inner) => _inner.name(),
|
32 + | ReservedWordsAsMembersError::InternalServerError(_inner) => _inner.name(),
|
33 33 | }
|
34 34 | }
|
35 35 | }
|
36 - | impl ::std::error::Error for RPCEchoError {
|
36 + | impl ::std::error::Error for ReservedWordsAsMembersError {
|
37 37 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
38 38 | match &self {
|
39 - | RPCEchoError::ValidationException(_inner) => Some(_inner),
|
40 - | RPCEchoError::InternalServerError(_inner) => Some(_inner),
|
39 + | ReservedWordsAsMembersError::ValidationException(_inner) => Some(_inner),
|
40 + | ReservedWordsAsMembersError::InternalServerError(_inner) => Some(_inner),
|
41 41 | }
|
42 42 | }
|
43 43 | }
|
44 - | impl ::std::convert::From<crate::error::ValidationException> for crate::error::RPCEchoError {
|
45 - | fn from(variant: crate::error::ValidationException) -> crate::error::RPCEchoError {
|
44 + | impl ::std::convert::From<crate::error::ValidationException>
|
45 + | for crate::error::ReservedWordsAsMembersError
|
46 + | {
|
47 + | fn from(
|
48 + | variant: crate::error::ValidationException,
|
49 + | ) -> crate::error::ReservedWordsAsMembersError {
|
46 50 | Self::ValidationException(variant)
|
47 51 | }
|
48 52 | }
|
49 - | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::RPCEchoError {
|
50 - | fn from(variant: crate::error::InternalServerError) -> crate::error::RPCEchoError {
|
53 + | impl ::std::convert::From<crate::error::InternalServerError>
|
54 + | for crate::error::ReservedWordsAsMembersError
|
55 + | {
|
56 + | fn from(
|
57 + | variant: crate::error::InternalServerError,
|
58 + | ) -> crate::error::ReservedWordsAsMembersError {
|
51 59 | Self::InternalServerError(variant)
|
52 60 | }
|
53 61 | }
|
54 62 |
|
55 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::RPCEchoError {
|
56 - | fn from(variant: ::pyo3::PyErr) -> crate::error::RPCEchoError {
|
63 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ReservedWordsAsMembersError {
|
64 + | fn from(variant: ::pyo3::PyErr) -> crate::error::ReservedWordsAsMembersError {
|
57 65 | ::pyo3::Python::with_gil(|py| {
|
58 66 | let error = variant.value(py);
|
59 67 | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
60 68 | return error.into();
|
61 69 | }
|
62 70 | crate::error::InternalServerError {
|
63 71 | message: error.to_string(),
|
64 72 | }
|
65 73 | .into()
|
66 74 | })
|
67 75 | }
|
68 76 | }
|
69 77 |
|
70 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
71 - | /// :param message str:
|
72 - | /// :rtype None:
|
73 - | #[allow(missing_docs)] // documentation missing in model
|
74 - | #[derive(
|
75 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
76 - | )]
|
77 - | pub struct InternalServerError {
|
78 - | #[pyo3(get, set)]
|
79 - | /// :type str:
|
78 + | /// Error type for the `StructureNamePunning` operation.
|
79 + | /// Each variant represents an error that can occur for the `StructureNamePunning` operation.
|
80 + | #[derive(::std::fmt::Debug)]
|
81 + | pub enum StructureNamePunningError {
|
80 82 | #[allow(missing_docs)] // documentation missing in model
|
81 - | pub message: ::std::string::String,
|
83 + | InternalServerError(crate::error::InternalServerError),
|
82 84 | }
|
83 - | #[allow(clippy::new_without_default)]
|
84 - | #[allow(clippy::too_many_arguments)]
|
85 - | #[::pyo3::pymethods]
|
86 - | impl InternalServerError {
|
87 - | #[new]
|
88 - | pub fn new(message: ::std::string::String) -> Self {
|
89 - | Self { message }
|
90 - | }
|
91 - | fn __repr__(&self) -> String {
|
92 - | format!("{self:?}")
|
93 - | }
|
94 - | fn __str__(&self) -> String {
|
95 - | format!("{self:?}")
|
85 + | impl ::std::fmt::Display for StructureNamePunningError {
|
86 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
87 + | match &self {
|
88 + | StructureNamePunningError::InternalServerError(_inner) => _inner.fmt(f),
|
89 + | }
|
96 90 | }
|
97 91 | }
|
98 - | impl InternalServerError {
|
99 - | /// Returns the error message.
|
100 - | pub fn message(&self) -> &str {
|
101 - | &self.message
|
92 + | impl StructureNamePunningError {
|
93 + | /// Returns `true` if the error kind is `StructureNamePunningError::InternalServerError`.
|
94 + | pub fn is_internal_server_error(&self) -> bool {
|
95 + | matches!(&self, StructureNamePunningError::InternalServerError(_))
|
102 96 | }
|
103 - | #[doc(hidden)]
|
104 - | /// Returns the error name.
|
97 + | /// Returns the error name string by matching the correct variant.
|
105 98 | pub fn name(&self) -> &'static str {
|
106 - | "InternalServerError"
|
99 + | match &self {
|
100 + | StructureNamePunningError::InternalServerError(_inner) => _inner.name(),
|
101 + | }
|
107 102 | }
|
108 103 | }
|
109 - | impl ::std::fmt::Display for InternalServerError {
|
110 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
111 - | ::std::write!(f, "InternalServerError")?;
|
112 - | {
|
113 - | ::std::write!(f, ": {}", &self.message)?;
|
104 + | impl ::std::error::Error for StructureNamePunningError {
|
105 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
106 + | match &self {
|
107 + | StructureNamePunningError::InternalServerError(_inner) => Some(_inner),
|
114 108 | }
|
115 - | Ok(())
|
116 109 | }
|
117 110 | }
|
118 - | impl ::std::error::Error for InternalServerError {}
|
119 - | impl InternalServerError {
|
120 - | /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
121 - | pub fn builder() -> crate::error::internal_server_error::Builder {
|
122 - | crate::error::internal_server_error::Builder::default()
|
111 + | impl ::std::convert::From<crate::error::InternalServerError>
|
112 + | for crate::error::StructureNamePunningError
|
113 + | {
|
114 + | fn from(variant: crate::error::InternalServerError) -> crate::error::StructureNamePunningError {
|
115 + | Self::InternalServerError(variant)
|
123 116 | }
|
124 117 | }
|
125 118 |
|
126 - | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
127 - | /// :param message str:
|
128 - | /// :param field_list typing.Optional\[typing.List\[naming_test_ops.model.ValidationExceptionField\]\]:
|
129 - | /// :rtype None:
|
130 - | /// 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.
|
131 - | #[derive(
|
132 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
133 - | )]
|
134 - | pub struct ValidationException {
|
135 - | #[pyo3(get, set)]
|
136 - | /// :type str:
|
137 - | /// A summary of the validation failure.
|
138 - | pub message: ::std::string::String,
|
139 - | #[pyo3(get, set)]
|
140 - | /// :type typing.Optional\[typing.List\[naming_test_ops.model.ValidationExceptionField\]\]:
|
141 - | /// 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.
|
142 - | pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
143 - | }
|
144 - | impl ValidationException {
|
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 fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
|
147 - | self.field_list.as_deref()
|
119 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::StructureNamePunningError {
|
120 + | fn from(variant: ::pyo3::PyErr) -> crate::error::StructureNamePunningError {
|
121 + | ::pyo3::Python::with_gil(|py| {
|
122 + | let error = variant.value(py);
|
123 + |
|
124 + | crate::error::InternalServerError {
|
125 + | message: error.to_string(),
|
126 + | }
|
127 + | .into()
|
128 + | })
|
148 129 | }
|
149 130 | }
|
150 - | #[allow(clippy::new_without_default)]
|
151 - | #[allow(clippy::too_many_arguments)]
|
152 - | #[::pyo3::pymethods]
|
153 - | impl ValidationException {
|
154 - | #[new]
|
155 - | pub fn new(
|
156 - | message: ::std::string::String,
|
157 - | field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
158 - | ) -> Self {
|
159 - | Self {
|
160 - | message,
|
161 - | field_list,
|
131 + |
|
132 + | /// Error type for the `ErrCollisions` operation.
|
133 + | /// Each variant represents an error that can occur for the `ErrCollisions` operation.
|
134 + | #[derive(::std::fmt::Debug)]
|
135 + | pub enum ErrCollisionsError {
|
136 + | #[allow(missing_docs)] // documentation missing in model
|
137 + | CollidingError(crate::error::CollidingError),
|
138 + | /// This will be renamed to CollidingError
|
139 + | CollidingException(crate::error::CollidingException),
|
140 + | #[allow(missing_docs)] // documentation missing in model
|
141 + | InternalServerError(crate::error::InternalServerError),
|
142 + | }
|
143 + | impl ::std::fmt::Display for ErrCollisionsError {
|
144 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
145 + | match &self {
|
146 + | ErrCollisionsError::CollidingError(_inner) => _inner.fmt(f),
|
147 + | ErrCollisionsError::CollidingException(_inner) => _inner.fmt(f),
|
148 + | ErrCollisionsError::InternalServerError(_inner) => _inner.fmt(f),
|
162 149 | }
|
163 150 | }
|
164 - | fn __repr__(&self) -> String {
|
165 - | format!("{self:?}")
|
151 + | }
|
152 + | impl ErrCollisionsError {
|
153 + | /// Returns `true` if the error kind is `ErrCollisionsError::CollidingError`.
|
154 + | pub fn is_colliding_error(&self) -> bool {
|
155 + | matches!(&self, ErrCollisionsError::CollidingError(_))
|
166 156 | }
|
167 - | fn __str__(&self) -> String {
|
168 - | format!("{self:?}")
|
157 + | /// Returns `true` if the error kind is `ErrCollisionsError::CollidingException`.
|
158 + | pub fn is_colliding_exception(&self) -> bool {
|
159 + | matches!(&self, ErrCollisionsError::CollidingException(_))
|
169 160 | }
|
170 - | }
|
171 - | impl ValidationException {
|
172 - | /// Returns the error message.
|
173 - | pub fn message(&self) -> &str {
|
174 - | &self.message
|
161 + | /// Returns `true` if the error kind is `ErrCollisionsError::InternalServerError`.
|
162 + | pub fn is_internal_server_error(&self) -> bool {
|
163 + | matches!(&self, ErrCollisionsError::InternalServerError(_))
|
175 164 | }
|
176 - | #[doc(hidden)]
|
177 - | /// Returns the error name.
|
165 + | /// Returns the error name string by matching the correct variant.
|
178 166 | pub fn name(&self) -> &'static str {
|
179 - | "ValidationException"
|
167 + | match &self {
|
168 + | ErrCollisionsError::CollidingError(_inner) => _inner.name(),
|
169 + | ErrCollisionsError::CollidingException(_inner) => _inner.name(),
|
170 + | ErrCollisionsError::InternalServerError(_inner) => _inner.name(),
|
171 + | }
|
180 172 | }
|
181 173 | }
|
182 - | impl ::std::fmt::Display for ValidationException {
|
183 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
184 - | ::std::write!(f, "ValidationException")?;
|
185 - | {
|
186 - | ::std::write!(f, ": {}", &self.message)?;
|
174 + | impl ::std::error::Error for ErrCollisionsError {
|
175 + | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
176 + | match &self {
|
177 + | ErrCollisionsError::CollidingError(_inner) => Some(_inner),
|
178 + | ErrCollisionsError::CollidingException(_inner) => Some(_inner),
|
179 + | ErrCollisionsError::InternalServerError(_inner) => Some(_inner),
|
187 180 | }
|
188 - | Ok(())
|
189 181 | }
|
190 182 | }
|
191 - | impl ::std::error::Error for ValidationException {}
|
192 - | impl ValidationException {
|
193 - | /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
|
194 - | pub fn builder() -> crate::error::validation_exception::Builder {
|
195 - | crate::error::validation_exception::Builder::default()
|
183 + | impl ::std::convert::From<crate::error::CollidingError> for crate::error::ErrCollisionsError {
|
184 + | fn from(variant: crate::error::CollidingError) -> crate::error::ErrCollisionsError {
|
185 + | Self::CollidingError(variant)
|
186 + | }
|
187 + | }
|
188 + | impl ::std::convert::From<crate::error::CollidingException> for crate::error::ErrCollisionsError {
|
189 + | fn from(variant: crate::error::CollidingException) -> crate::error::ErrCollisionsError {
|
190 + | Self::CollidingException(variant)
|
191 + | }
|
192 + | }
|
193 + | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::ErrCollisionsError {
|
194 + | fn from(variant: crate::error::InternalServerError) -> crate::error::ErrCollisionsError {
|
195 + | Self::InternalServerError(variant)
|
196 196 | }
|
197 197 | }
|
198 198 |
|
199 - | /// Error type for the `Match` operation.
|
200 - | /// Each variant represents an error that can occur for the `Match` operation.
|
199 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ErrCollisionsError {
|
200 + | fn from(variant: ::pyo3::PyErr) -> crate::error::ErrCollisionsError {
|
201 + | ::pyo3::Python::with_gil(|py| {
|
202 + | let error = variant.value(py);
|
203 + | if let Ok(error) = error.extract::<crate::error::CollidingError>() {
|
204 + | return error.into();
|
205 + | }
|
206 + | if let Ok(error) = error.extract::<crate::error::CollidingException>() {
|
207 + | return error.into();
|
208 + | }
|
209 + | crate::error::InternalServerError {
|
210 + | message: error.to_string(),
|
211 + | }
|
212 + | .into()
|
213 + | })
|
214 + | }
|
215 + | }
|
216 + |
|
217 + | /// Error type for the `Result` operation.
|
218 + | /// Each variant represents an error that can occur for the `Result` operation.
|
201 219 | #[derive(::std::fmt::Debug)]
|
202 - | pub enum MatchError {
|
203 - | /// 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.
|
204 - | ValidationException(crate::error::ValidationException),
|
220 + | pub enum ResultError {
|
205 221 | #[allow(missing_docs)] // documentation missing in model
|
206 222 | InternalServerError(crate::error::InternalServerError),
|
207 223 | }
|
208 - | impl ::std::fmt::Display for MatchError {
|
224 + | impl ::std::fmt::Display for ResultError {
|
209 225 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
210 226 | match &self {
|
211 - | MatchError::ValidationException(_inner) => _inner.fmt(f),
|
212 - | MatchError::InternalServerError(_inner) => _inner.fmt(f),
|
227 + | ResultError::InternalServerError(_inner) => _inner.fmt(f),
|
213 228 | }
|
214 229 | }
|
215 230 | }
|
216 - | impl MatchError {
|
217 - | /// Returns `true` if the error kind is `MatchError::ValidationException`.
|
218 - | pub fn is_validation_exception(&self) -> bool {
|
219 - | matches!(&self, MatchError::ValidationException(_))
|
220 - | }
|
221 - | /// Returns `true` if the error kind is `MatchError::InternalServerError`.
|
231 + | impl ResultError {
|
232 + | /// Returns `true` if the error kind is `ResultError::InternalServerError`.
|
222 233 | pub fn is_internal_server_error(&self) -> bool {
|
223 - | matches!(&self, MatchError::InternalServerError(_))
|
234 + | matches!(&self, ResultError::InternalServerError(_))
|
224 235 | }
|
225 236 | /// Returns the error name string by matching the correct variant.
|
226 237 | pub fn name(&self) -> &'static str {
|
227 238 | match &self {
|
228 - | MatchError::ValidationException(_inner) => _inner.name(),
|
229 - | MatchError::InternalServerError(_inner) => _inner.name(),
|
239 + | ResultError::InternalServerError(_inner) => _inner.name(),
|
230 240 | }
|
231 241 | }
|
232 242 | }
|
233 - | impl ::std::error::Error for MatchError {
|
243 + | impl ::std::error::Error for ResultError {
|
234 244 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
235 245 | match &self {
|
236 - | MatchError::ValidationException(_inner) => Some(_inner),
|
237 - | MatchError::InternalServerError(_inner) => Some(_inner),
|
246 + | ResultError::InternalServerError(_inner) => Some(_inner),
|
238 247 | }
|
239 248 | }
|
240 249 | }
|
241 - | impl ::std::convert::From<crate::error::ValidationException> for crate::error::MatchError {
|
242 - | fn from(variant: crate::error::ValidationException) -> crate::error::MatchError {
|
243 - | Self::ValidationException(variant)
|
244 - | }
|
245 - | }
|
246 - | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::MatchError {
|
247 - | fn from(variant: crate::error::InternalServerError) -> crate::error::MatchError {
|
250 + | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::ResultError {
|
251 + | fn from(variant: crate::error::InternalServerError) -> crate::error::ResultError {
|
248 252 | Self::InternalServerError(variant)
|
249 253 | }
|
250 254 | }
|
251 255 |
|
252 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::MatchError {
|
253 - | fn from(variant: ::pyo3::PyErr) -> crate::error::MatchError {
|
256 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ResultError {
|
257 + | fn from(variant: ::pyo3::PyErr) -> crate::error::ResultError {
|
254 258 | ::pyo3::Python::with_gil(|py| {
|
255 259 | let error = variant.value(py);
|
256 - | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
257 - | return error.into();
|
258 - | }
|
260 + |
|
259 261 | crate::error::InternalServerError {
|
260 262 | message: error.to_string(),
|
261 263 | }
|
262 264 | .into()
|
263 265 | })
|
264 266 | }
|
265 267 | }
|
266 268 |
|
267 269 | /// Error type for the `Option` operation.
|
268 270 | /// Each variant represents an error that can occur for the `Option` operation.
|
269 271 | #[derive(::std::fmt::Debug)]
|
270 272 | pub enum OptionError {
|
271 273 | #[allow(missing_docs)] // documentation missing in model
|
272 274 | InternalServerError(crate::error::InternalServerError),
|
273 275 | }
|
274 276 | impl ::std::fmt::Display for OptionError {
|
275 277 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
276 278 | match &self {
|
277 279 | OptionError::InternalServerError(_inner) => _inner.fmt(f),
|
278 280 | }
|
279 281 | }
|
280 282 | }
|
281 283 | impl OptionError {
|
282 284 | /// Returns `true` if the error kind is `OptionError::InternalServerError`.
|
283 285 | pub fn is_internal_server_error(&self) -> bool {
|
284 286 | matches!(&self, OptionError::InternalServerError(_))
|
285 287 | }
|
286 288 | /// Returns the error name string by matching the correct variant.
|
287 289 | pub fn name(&self) -> &'static str {
|
288 290 | match &self {
|
289 291 | OptionError::InternalServerError(_inner) => _inner.name(),
|
290 292 | }
|
291 293 | }
|
292 294 | }
|
293 295 | impl ::std::error::Error for OptionError {
|
294 296 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
295 297 | match &self {
|
296 298 | OptionError::InternalServerError(_inner) => Some(_inner),
|
297 299 | }
|
298 300 | }
|
299 301 | }
|
300 302 | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::OptionError {
|
301 303 | fn from(variant: crate::error::InternalServerError) -> crate::error::OptionError {
|
302 304 | Self::InternalServerError(variant)
|
303 305 | }
|
304 306 | }
|
305 307 |
|
306 308 | impl ::std::convert::From<::pyo3::PyErr> for crate::error::OptionError {
|
307 309 | fn from(variant: ::pyo3::PyErr) -> crate::error::OptionError {
|
308 310 | ::pyo3::Python::with_gil(|py| {
|
309 311 | let error = variant.value(py);
|
310 312 |
|
311 313 | crate::error::InternalServerError {
|
312 314 | message: error.to_string(),
|
313 315 | }
|
314 316 | .into()
|
315 317 | })
|
316 318 | }
|
317 319 | }
|
318 320 |
|
319 - | /// Error type for the `Result` operation.
|
320 - | /// Each variant represents an error that can occur for the `Result` operation.
|
321 + | /// Error type for the `Match` operation.
|
322 + | /// Each variant represents an error that can occur for the `Match` operation.
|
321 323 | #[derive(::std::fmt::Debug)]
|
322 - | pub enum ResultError {
|
324 + | pub enum MatchError {
|
325 + | /// 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.
|
326 + | ValidationException(crate::error::ValidationException),
|
323 327 | #[allow(missing_docs)] // documentation missing in model
|
324 328 | InternalServerError(crate::error::InternalServerError),
|
325 329 | }
|
326 - | impl ::std::fmt::Display for ResultError {
|
330 + | impl ::std::fmt::Display for MatchError {
|
327 331 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
328 332 | match &self {
|
329 - | ResultError::InternalServerError(_inner) => _inner.fmt(f),
|
333 + | MatchError::ValidationException(_inner) => _inner.fmt(f),
|
334 + | MatchError::InternalServerError(_inner) => _inner.fmt(f),
|
330 335 | }
|
331 336 | }
|
332 337 | }
|
333 - | impl ResultError {
|
334 - | /// Returns `true` if the error kind is `ResultError::InternalServerError`.
|
338 + | impl MatchError {
|
339 + | /// Returns `true` if the error kind is `MatchError::ValidationException`.
|
340 + | pub fn is_validation_exception(&self) -> bool {
|
341 + | matches!(&self, MatchError::ValidationException(_))
|
342 + | }
|
343 + | /// Returns `true` if the error kind is `MatchError::InternalServerError`.
|
335 344 | pub fn is_internal_server_error(&self) -> bool {
|
336 - | matches!(&self, ResultError::InternalServerError(_))
|
345 + | matches!(&self, MatchError::InternalServerError(_))
|
337 346 | }
|
338 347 | /// Returns the error name string by matching the correct variant.
|
339 348 | pub fn name(&self) -> &'static str {
|
340 349 | match &self {
|
341 - | ResultError::InternalServerError(_inner) => _inner.name(),
|
350 + | MatchError::ValidationException(_inner) => _inner.name(),
|
351 + | MatchError::InternalServerError(_inner) => _inner.name(),
|
342 352 | }
|
343 353 | }
|
344 354 | }
|
345 - | impl ::std::error::Error for ResultError {
|
355 + | impl ::std::error::Error for MatchError {
|
346 356 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
347 357 | match &self {
|
348 - | ResultError::InternalServerError(_inner) => Some(_inner),
|
358 + | MatchError::ValidationException(_inner) => Some(_inner),
|
359 + | MatchError::InternalServerError(_inner) => Some(_inner),
|
349 360 | }
|
350 361 | }
|
351 362 | }
|
352 - | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::ResultError {
|
353 - | fn from(variant: crate::error::InternalServerError) -> crate::error::ResultError {
|
363 + | impl ::std::convert::From<crate::error::ValidationException> for crate::error::MatchError {
|
364 + | fn from(variant: crate::error::ValidationException) -> crate::error::MatchError {
|
365 + | Self::ValidationException(variant)
|
366 + | }
|
367 + | }
|
368 + | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::MatchError {
|
369 + | fn from(variant: crate::error::InternalServerError) -> crate::error::MatchError {
|
354 370 | Self::InternalServerError(variant)
|
355 371 | }
|
356 372 | }
|
357 373 |
|
358 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ResultError {
|
359 - | fn from(variant: ::pyo3::PyErr) -> crate::error::ResultError {
|
374 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::MatchError {
|
375 + | fn from(variant: ::pyo3::PyErr) -> crate::error::MatchError {
|
360 376 | ::pyo3::Python::with_gil(|py| {
|
361 377 | let error = variant.value(py);
|
362 - |
|
378 + | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
379 + | return error.into();
|
380 + | }
|
363 381 | crate::error::InternalServerError {
|
364 382 | message: error.to_string(),
|
365 383 | }
|
366 384 | .into()
|
367 385 | })
|
368 386 | }
|
369 387 | }
|
370 388 |
|
371 - | /// Error type for the `ErrCollisions` operation.
|
372 - | /// Each variant represents an error that can occur for the `ErrCollisions` operation.
|
389 + | /// Error type for the `RPCEcho` operation.
|
390 + | /// Each variant represents an error that can occur for the `RPCEcho` operation.
|
373 391 | #[derive(::std::fmt::Debug)]
|
374 - | pub enum ErrCollisionsError {
|
375 - | #[allow(missing_docs)] // documentation missing in model
|
376 - | CollidingError(crate::error::CollidingError),
|
377 - | /// This will be renamed to CollidingError
|
378 - | CollidingException(crate::error::CollidingException),
|
392 + | pub enum RPCEchoError {
|
393 + | /// 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.
|
394 + | ValidationException(crate::error::ValidationException),
|
379 395 | #[allow(missing_docs)] // documentation missing in model
|
380 396 | InternalServerError(crate::error::InternalServerError),
|
381 397 | }
|
382 - | impl ::std::fmt::Display for ErrCollisionsError {
|
398 + | impl ::std::fmt::Display for RPCEchoError {
|
383 399 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
384 400 | match &self {
|
385 - | ErrCollisionsError::CollidingError(_inner) => _inner.fmt(f),
|
386 - | ErrCollisionsError::CollidingException(_inner) => _inner.fmt(f),
|
387 - | ErrCollisionsError::InternalServerError(_inner) => _inner.fmt(f),
|
401 + | RPCEchoError::ValidationException(_inner) => _inner.fmt(f),
|
402 + | RPCEchoError::InternalServerError(_inner) => _inner.fmt(f),
|
388 403 | }
|
389 404 | }
|
390 405 | }
|
391 - | impl ErrCollisionsError {
|
392 - | /// Returns `true` if the error kind is `ErrCollisionsError::CollidingError`.
|
393 - | pub fn is_colliding_error(&self) -> bool {
|
394 - | matches!(&self, ErrCollisionsError::CollidingError(_))
|
395 - | }
|
396 - | /// Returns `true` if the error kind is `ErrCollisionsError::CollidingException`.
|
397 - | pub fn is_colliding_exception(&self) -> bool {
|
398 - | matches!(&self, ErrCollisionsError::CollidingException(_))
|
406 + | impl RPCEchoError {
|
407 + | /// Returns `true` if the error kind is `RPCEchoError::ValidationException`.
|
408 + | pub fn is_validation_exception(&self) -> bool {
|
409 + | matches!(&self, RPCEchoError::ValidationException(_))
|
399 410 | }
|
400 - | /// Returns `true` if the error kind is `ErrCollisionsError::InternalServerError`.
|
411 + | /// Returns `true` if the error kind is `RPCEchoError::InternalServerError`.
|
401 412 | pub fn is_internal_server_error(&self) -> bool {
|
402 - | matches!(&self, ErrCollisionsError::InternalServerError(_))
|
413 + | matches!(&self, RPCEchoError::InternalServerError(_))
|
403 414 | }
|
404 415 | /// Returns the error name string by matching the correct variant.
|
405 416 | pub fn name(&self) -> &'static str {
|
406 417 | match &self {
|
407 - | ErrCollisionsError::CollidingError(_inner) => _inner.name(),
|
408 - | ErrCollisionsError::CollidingException(_inner) => _inner.name(),
|
409 - | ErrCollisionsError::InternalServerError(_inner) => _inner.name(),
|
418 + | RPCEchoError::ValidationException(_inner) => _inner.name(),
|
419 + | RPCEchoError::InternalServerError(_inner) => _inner.name(),
|
410 420 | }
|
411 421 | }
|
412 422 | }
|
413 - | impl ::std::error::Error for ErrCollisionsError {
|
423 + | impl ::std::error::Error for RPCEchoError {
|
414 424 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
415 425 | match &self {
|
416 - | ErrCollisionsError::CollidingError(_inner) => Some(_inner),
|
417 - | ErrCollisionsError::CollidingException(_inner) => Some(_inner),
|
418 - | ErrCollisionsError::InternalServerError(_inner) => Some(_inner),
|
426 + | RPCEchoError::ValidationException(_inner) => Some(_inner),
|
427 + | RPCEchoError::InternalServerError(_inner) => Some(_inner),
|
419 428 | }
|
420 429 | }
|
421 430 | }
|
422 - | impl ::std::convert::From<crate::error::CollidingError> for crate::error::ErrCollisionsError {
|
423 - | fn from(variant: crate::error::CollidingError) -> crate::error::ErrCollisionsError {
|
424 - | Self::CollidingError(variant)
|
425 - | }
|
426 - | }
|
427 - | impl ::std::convert::From<crate::error::CollidingException> for crate::error::ErrCollisionsError {
|
428 - | fn from(variant: crate::error::CollidingException) -> crate::error::ErrCollisionsError {
|
429 - | Self::CollidingException(variant)
|
431 + | impl ::std::convert::From<crate::error::ValidationException> for crate::error::RPCEchoError {
|
432 + | fn from(variant: crate::error::ValidationException) -> crate::error::RPCEchoError {
|
433 + | Self::ValidationException(variant)
|
430 434 | }
|
431 435 | }
|
432 - | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::ErrCollisionsError {
|
433 - | fn from(variant: crate::error::InternalServerError) -> crate::error::ErrCollisionsError {
|
436 + | impl ::std::convert::From<crate::error::InternalServerError> for crate::error::RPCEchoError {
|
437 + | fn from(variant: crate::error::InternalServerError) -> crate::error::RPCEchoError {
|
434 438 | Self::InternalServerError(variant)
|
435 439 | }
|
436 440 | }
|
437 441 |
|
438 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ErrCollisionsError {
|
439 - | fn from(variant: ::pyo3::PyErr) -> crate::error::ErrCollisionsError {
|
442 + | impl ::std::convert::From<::pyo3::PyErr> for crate::error::RPCEchoError {
|
443 + | fn from(variant: ::pyo3::PyErr) -> crate::error::RPCEchoError {
|
440 444 | ::pyo3::Python::with_gil(|py| {
|
441 445 | let error = variant.value(py);
|
442 - | if let Ok(error) = error.extract::<crate::error::CollidingError>() {
|
443 - | return error.into();
|
444 - | }
|
445 - | if let Ok(error) = error.extract::<crate::error::CollidingException>() {
|
446 + | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
446 447 | return error.into();
|
447 448 | }
|
448 449 | crate::error::InternalServerError {
|
449 450 | message: error.to_string(),
|
450 451 | }
|
451 452 | .into()
|
452 453 | })
|
453 454 | }
|
454 455 | }
|
455 456 |
|
456 457 | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
458 + | /// :param message str:
|
459 + | /// :param field_list typing.Optional\[typing.List\[naming_test_ops.model.ValidationExceptionField\]\]:
|
457 460 | /// :rtype None:
|
458 - | /// This will be renamed to CollidingError
|
461 + | /// 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.
|
459 462 | #[derive(
|
460 463 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
461 464 | )]
|
462 - | pub struct CollidingException {}
|
465 + | pub struct ValidationException {
|
466 + | #[pyo3(get, set)]
|
467 + | /// :type str:
|
468 + | /// A summary of the validation failure.
|
469 + | pub message: ::std::string::String,
|
470 + | #[pyo3(get, set)]
|
471 + | /// :type typing.Optional\[typing.List\[naming_test_ops.model.ValidationExceptionField\]\]:
|
472 + | /// 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.
|
473 + | pub field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
474 + | }
|
475 + | impl ValidationException {
|
476 + | /// 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.
|
477 + | pub fn field_list(&self) -> ::std::option::Option<&[crate::model::ValidationExceptionField]> {
|
478 + | self.field_list.as_deref()
|
479 + | }
|
480 + | }
|
463 481 | #[allow(clippy::new_without_default)]
|
464 482 | #[allow(clippy::too_many_arguments)]
|
465 483 | #[::pyo3::pymethods]
|
466 - | impl CollidingException {
|
484 + | impl ValidationException {
|
467 485 | #[new]
|
468 - | pub fn new() -> Self {
|
469 - | Self {}
|
486 + | pub fn new(
|
487 + | message: ::std::string::String,
|
488 + | field_list: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
489 + | ) -> Self {
|
490 + | Self {
|
491 + | message,
|
492 + | field_list,
|
493 + | }
|
470 494 | }
|
471 495 | fn __repr__(&self) -> String {
|
472 496 | format!("{self:?}")
|
473 497 | }
|
474 498 | fn __str__(&self) -> String {
|
475 499 | format!("{self:?}")
|
476 500 | }
|
477 501 | }
|
478 - | impl CollidingException {
|
502 + | impl ValidationException {
|
503 + | /// Returns the error message.
|
504 + | pub fn message(&self) -> &str {
|
505 + | &self.message
|
506 + | }
|
479 507 | #[doc(hidden)]
|
480 508 | /// Returns the error name.
|
481 509 | pub fn name(&self) -> &'static str {
|
482 - | "CollidingException"
|
510 + | "ValidationException"
|
483 511 | }
|
484 512 | }
|
485 - | impl ::std::fmt::Display for CollidingException {
|
513 + | impl ::std::fmt::Display for ValidationException {
|
486 514 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
487 - | ::std::write!(f, "CollidingException")?;
|
515 + | ::std::write!(f, "ValidationException")?;
|
516 + | {
|
517 + | ::std::write!(f, ": {}", &self.message)?;
|
518 + | }
|
488 519 | Ok(())
|
489 520 | }
|
490 521 | }
|
491 - | impl ::std::error::Error for CollidingException {}
|
492 - | impl CollidingException {
|
493 - | /// Creates a new builder-style object to manufacture [`CollidingException`](crate::error::CollidingException).
|
494 - | pub fn builder() -> crate::error::colliding_exception::Builder {
|
495 - | crate::error::colliding_exception::Builder::default()
|
522 + | impl ::std::error::Error for ValidationException {}
|
523 + | impl ValidationException {
|
524 + | /// Creates a new builder-style object to manufacture [`ValidationException`](crate::error::ValidationException).
|
525 + | pub fn builder() -> crate::error::validation_exception::Builder {
|
526 + | crate::error::validation_exception::Builder::default()
|
527 + | }
|
528 + | }
|
529 + |
|
530 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
531 + | /// :param message str:
|
532 + | /// :rtype None:
|
533 + | #[allow(missing_docs)] // documentation missing in model
|
534 + | #[derive(
|
535 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
536 + | )]
|
537 + | pub struct InternalServerError {
|
538 + | #[pyo3(get, set)]
|
539 + | /// :type str:
|
540 + | #[allow(missing_docs)] // documentation missing in model
|
541 + | pub message: ::std::string::String,
|
542 + | }
|
543 + | #[allow(clippy::new_without_default)]
|
544 + | #[allow(clippy::too_many_arguments)]
|
545 + | #[::pyo3::pymethods]
|
546 + | impl InternalServerError {
|
547 + | #[new]
|
548 + | pub fn new(message: ::std::string::String) -> Self {
|
549 + | Self { message }
|
550 + | }
|
551 + | fn __repr__(&self) -> String {
|
552 + | format!("{self:?}")
|
553 + | }
|
554 + | fn __str__(&self) -> String {
|
555 + | format!("{self:?}")
|
556 + | }
|
557 + | }
|
558 + | impl InternalServerError {
|
559 + | /// Returns the error message.
|
560 + | pub fn message(&self) -> &str {
|
561 + | &self.message
|
562 + | }
|
563 + | #[doc(hidden)]
|
564 + | /// Returns the error name.
|
565 + | pub fn name(&self) -> &'static str {
|
566 + | "InternalServerError"
|
567 + | }
|
568 + | }
|
569 + | impl ::std::fmt::Display for InternalServerError {
|
570 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
571 + | ::std::write!(f, "InternalServerError")?;
|
572 + | {
|
573 + | ::std::write!(f, ": {}", &self.message)?;
|
574 + | }
|
575 + | Ok(())
|
576 + | }
|
577 + | }
|
578 + | impl ::std::error::Error for InternalServerError {}
|
579 + | impl InternalServerError {
|
580 + | /// Creates a new builder-style object to manufacture [`InternalServerError`](crate::error::InternalServerError).
|
581 + | pub fn builder() -> crate::error::internal_server_error::Builder {
|
582 + | crate::error::internal_server_error::Builder::default()
|
496 583 | }
|
497 584 | }
|
498 585 |
|
499 586 | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
500 587 | /// :rtype None:
|
501 588 | #[allow(missing_docs)] // documentation missing in model
|
502 589 | #[derive(
|
503 590 | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
504 591 | )]
|
505 592 | pub struct CollidingError {}
|
506 593 | #[allow(clippy::new_without_default)]
|
507 594 | #[allow(clippy::too_many_arguments)]
|
508 595 | #[::pyo3::pymethods]
|
509 596 | impl CollidingError {
|
510 597 | #[new]
|
511 598 | pub fn new() -> Self {
|
512 599 | Self {}
|
513 600 | }
|
514 601 | fn __repr__(&self) -> String {
|
515 602 | format!("{self:?}")
|
516 603 | }
|
517 604 | fn __str__(&self) -> String {
|
518 605 | format!("{self:?}")
|
519 606 | }
|
520 607 | }
|
521 608 | impl CollidingError {
|
522 609 | #[doc(hidden)]
|
523 610 | /// Returns the error name.
|
524 611 | pub fn name(&self) -> &'static str {
|
525 612 | "CollidingError"
|
526 613 | }
|
527 614 | }
|
528 615 | impl ::std::fmt::Display for CollidingError {
|
529 616 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
530 617 | ::std::write!(f, "CollidingError")?;
|
531 618 | Ok(())
|
532 619 | }
|
533 620 | }
|
534 621 | impl ::std::error::Error for CollidingError {}
|
535 622 | impl CollidingError {
|
536 623 | /// Creates a new builder-style object to manufacture [`CollidingError`](crate::error::CollidingError).
|
537 624 | pub fn builder() -> crate::error::colliding_error::Builder {
|
538 625 | crate::error::colliding_error::Builder::default()
|
539 626 | }
|
540 627 | }
|
541 628 |
|
542 - | /// Error type for the `StructureNamePunning` operation.
|
543 - | /// Each variant represents an error that can occur for the `StructureNamePunning` operation.
|
544 - | #[derive(::std::fmt::Debug)]
|
545 - | pub enum StructureNamePunningError {
|
546 - | #[allow(missing_docs)] // documentation missing in model
|
547 - | InternalServerError(crate::error::InternalServerError),
|
548 - | }
|
549 - | impl ::std::fmt::Display for StructureNamePunningError {
|
550 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
551 - | match &self {
|
552 - | StructureNamePunningError::InternalServerError(_inner) => _inner.fmt(f),
|
553 - | }
|
554 - | }
|
555 - | }
|
556 - | impl StructureNamePunningError {
|
557 - | /// Returns `true` if the error kind is `StructureNamePunningError::InternalServerError`.
|
558 - | pub fn is_internal_server_error(&self) -> bool {
|
559 - | matches!(&self, StructureNamePunningError::InternalServerError(_))
|
560 - | }
|
561 - | /// Returns the error name string by matching the correct variant.
|
562 - | pub fn name(&self) -> &'static str {
|
563 - | match &self {
|
564 - | StructureNamePunningError::InternalServerError(_inner) => _inner.name(),
|
565 - | }
|
566 - | }
|
567 - | }
|
568 - | impl ::std::error::Error for StructureNamePunningError {
|
569 - | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
570 - | match &self {
|
571 - | StructureNamePunningError::InternalServerError(_inner) => Some(_inner),
|
572 - | }
|
573 - | }
|
574 - | }
|
575 - | impl ::std::convert::From<crate::error::InternalServerError>
|
576 - | for crate::error::StructureNamePunningError
|
577 - | {
|
578 - | fn from(variant: crate::error::InternalServerError) -> crate::error::StructureNamePunningError {
|
579 - | Self::InternalServerError(variant)
|
629 + | #[::pyo3::pyclass(extends = ::pyo3::exceptions::PyException)]
|
630 + | /// :rtype None:
|
631 + | /// This will be renamed to CollidingError
|
632 + | #[derive(
|
633 + | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::PartialEq, ::std::fmt::Debug, ::std::hash::Hash,
|
634 + | )]
|
635 + | pub struct CollidingException {}
|
636 + | #[allow(clippy::new_without_default)]
|
637 + | #[allow(clippy::too_many_arguments)]
|
638 + | #[::pyo3::pymethods]
|
639 + | impl CollidingException {
|
640 + | #[new]
|
641 + | pub fn new() -> Self {
|
642 + | Self {}
|
580 643 | }
|
581 - | }
|
582 - |
|
583 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::StructureNamePunningError {
|
584 - | fn from(variant: ::pyo3::PyErr) -> crate::error::StructureNamePunningError {
|
585 - | ::pyo3::Python::with_gil(|py| {
|
586 - | let error = variant.value(py);
|
587 - |
|
588 - | crate::error::InternalServerError {
|
589 - | message: error.to_string(),
|
590 - | }
|
591 - | .into()
|
592 - | })
|
644 + | fn __repr__(&self) -> String {
|
645 + | format!("{self:?}")
|
593 646 | }
|
594 - | }
|
595 - |
|
596 - | /// Error type for the `ReservedWordsAsMembers` operation.
|
597 - | /// Each variant represents an error that can occur for the `ReservedWordsAsMembers` operation.
|
598 - | #[derive(::std::fmt::Debug)]
|
599 - | pub enum ReservedWordsAsMembersError {
|
600 - | /// 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.
|
601 - | ValidationException(crate::error::ValidationException),
|
602 - | #[allow(missing_docs)] // documentation missing in model
|
603 - | InternalServerError(crate::error::InternalServerError),
|
604 - | }
|
605 - | impl ::std::fmt::Display for ReservedWordsAsMembersError {
|
606 - | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
607 - | match &self {
|
608 - | ReservedWordsAsMembersError::ValidationException(_inner) => _inner.fmt(f),
|
609 - | ReservedWordsAsMembersError::InternalServerError(_inner) => _inner.fmt(f),
|
610 - | }
|
647 + | fn __str__(&self) -> String {
|
648 + | format!("{self:?}")
|
611 649 | }
|
612 650 | }
|
613 - | impl ReservedWordsAsMembersError {
|
614 - | /// Returns `true` if the error kind is `ReservedWordsAsMembersError::ValidationException`.
|
615 - | pub fn is_validation_exception(&self) -> bool {
|
616 - | matches!(&self, ReservedWordsAsMembersError::ValidationException(_))
|
617 - | }
|
618 - | /// Returns `true` if the error kind is `ReservedWordsAsMembersError::InternalServerError`.
|
619 - | pub fn is_internal_server_error(&self) -> bool {
|
620 - | matches!(&self, ReservedWordsAsMembersError::InternalServerError(_))
|
621 - | }
|
622 - | /// Returns the error name string by matching the correct variant.
|
651 + | impl CollidingException {
|
652 + | #[doc(hidden)]
|
653 + | /// Returns the error name.
|
623 654 | pub fn name(&self) -> &'static str {
|
624 - | match &self {
|
625 - | ReservedWordsAsMembersError::ValidationException(_inner) => _inner.name(),
|
626 - | ReservedWordsAsMembersError::InternalServerError(_inner) => _inner.name(),
|
627 - | }
|
628 - | }
|
629 - | }
|
630 - | impl ::std::error::Error for ReservedWordsAsMembersError {
|
631 - | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
632 - | match &self {
|
633 - | ReservedWordsAsMembersError::ValidationException(_inner) => Some(_inner),
|
634 - | ReservedWordsAsMembersError::InternalServerError(_inner) => Some(_inner),
|
635 - | }
|
636 - | }
|
637 - | }
|
638 - | impl ::std::convert::From<crate::error::ValidationException>
|
639 - | for crate::error::ReservedWordsAsMembersError
|
640 - | {
|
641 - | fn from(
|
642 - | variant: crate::error::ValidationException,
|
643 - | ) -> crate::error::ReservedWordsAsMembersError {
|
644 - | Self::ValidationException(variant)
|
655 + | "CollidingException"
|
645 656 | }
|
646 657 | }
|
647 - | impl ::std::convert::From<crate::error::InternalServerError>
|
648 - | for crate::error::ReservedWordsAsMembersError
|
649 - | {
|
650 - | fn from(
|
651 - | variant: crate::error::InternalServerError,
|
652 - | ) -> crate::error::ReservedWordsAsMembersError {
|
653 - | Self::InternalServerError(variant)
|
658 + | impl ::std::fmt::Display for CollidingException {
|
659 + | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
660 + | ::std::write!(f, "CollidingException")?;
|
661 + | Ok(())
|
654 662 | }
|
655 663 | }
|
656 - |
|
657 - | impl ::std::convert::From<::pyo3::PyErr> for crate::error::ReservedWordsAsMembersError {
|
658 - | fn from(variant: ::pyo3::PyErr) -> crate::error::ReservedWordsAsMembersError {
|
659 - | ::pyo3::Python::with_gil(|py| {
|
660 - | let error = variant.value(py);
|
661 - | if let Ok(error) = error.extract::<crate::error::ValidationException>() {
|
662 - | return error.into();
|
663 - | }
|
664 - | crate::error::InternalServerError {
|
665 - | message: error.to_string(),
|
666 - | }
|
667 - | .into()
|
668 - | })
|
664 + | impl ::std::error::Error for CollidingException {}
|
665 + | impl CollidingException {
|
666 + | /// Creates a new builder-style object to manufacture [`CollidingException`](crate::error::CollidingException).
|
667 + | pub fn builder() -> crate::error::colliding_exception::Builder {
|
668 + | crate::error::colliding_exception::Builder::default()
|
669 669 | }
|
670 670 | }
|
671 - | /// See [`InternalServerError`](crate::error::InternalServerError).
|
672 - | pub mod internal_server_error {
|
671 + | /// See [`ValidationException`](crate::error::ValidationException).
|
672 + | pub mod validation_exception {
|
673 673 |
|
674 674 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
675 675 | /// Holds one variant for each of the ways the builder can fail.
|
676 676 | #[allow(clippy::enum_variant_names)]
|
677 677 | pub enum ConstraintViolation {
|
678 - | /// `message` was not provided but it is required when building `InternalServerError`.
|
678 + | /// `message` was not provided but it is required when building `ValidationException`.
|
679 679 | MissingMessage,
|
680 680 | }
|
681 681 | impl ::std::fmt::Display for ConstraintViolation {
|
682 682 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
683 683 | match self {
|
684 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
684 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
685 685 | }
|
686 686 | }
|
687 687 | }
|
688 688 | impl ::std::error::Error for ConstraintViolation {}
|
689 - | impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
|
689 + | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
690 690 | type Error = ConstraintViolation;
|
691 691 |
|
692 692 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
693 693 | builder.build()
|
694 694 | }
|
695 695 | }
|
696 - | /// A builder for [`InternalServerError`](crate::error::InternalServerError).
|
696 + | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
697 697 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
698 698 | pub struct Builder {
|
699 699 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
700 + | pub(crate) field_list:
|
701 + | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
700 702 | }
|
701 703 | impl Builder {
|
702 - | #[allow(missing_docs)] // documentation missing in model
|
704 + | /// A summary of the validation failure.
|
703 705 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
704 706 | self.message = Some(input);
|
705 707 | self
|
706 708 | }
|
707 - | /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
709 + | /// 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.
|
710 + | pub fn field_list(
|
711 + | mut self,
|
712 + | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
713 + | ) -> Self {
|
714 + | self.field_list = input;
|
715 + | self
|
716 + | }
|
717 + | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
708 718 | ///
|
709 - | /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
|
719 + | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if you do not provide a value for all non-`Option`al members.
|
710 720 | ///
|
711 - | pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
721 + | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
712 722 | self.build_enforcing_required_and_enum_traits()
|
713 723 | }
|
714 724 | fn build_enforcing_required_and_enum_traits(
|
715 725 | self,
|
716 - | ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
717 - | Ok(crate::error::InternalServerError {
|
726 + | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
727 + | Ok(crate::error::ValidationException {
|
718 728 | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
729 + | field_list: self.field_list,
|
719 730 | })
|
720 731 | }
|
721 732 | }
|
722 733 | }
|
723 - | /// See [`ValidationException`](crate::error::ValidationException).
|
724 - | pub mod validation_exception {
|
734 + | /// See [`InternalServerError`](crate::error::InternalServerError).
|
735 + | pub mod internal_server_error {
|
725 736 |
|
726 737 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
727 738 | /// Holds one variant for each of the ways the builder can fail.
|
728 739 | #[allow(clippy::enum_variant_names)]
|
729 740 | pub enum ConstraintViolation {
|
730 - | /// `message` was not provided but it is required when building `ValidationException`.
|
741 + | /// `message` was not provided but it is required when building `InternalServerError`.
|
731 742 | MissingMessage,
|
732 743 | }
|
733 744 | impl ::std::fmt::Display for ConstraintViolation {
|
734 745 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
735 746 | match self {
|
736 - | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
747 + | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
737 748 | }
|
738 749 | }
|
739 750 | }
|
740 751 | impl ::std::error::Error for ConstraintViolation {}
|
741 - | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
752 + | impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
|
742 753 | type Error = ConstraintViolation;
|
743 754 |
|
744 755 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
745 756 | builder.build()
|
746 757 | }
|
747 758 | }
|
748 - | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
759 + | /// A builder for [`InternalServerError`](crate::error::InternalServerError).
|
749 760 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
750 761 | pub struct Builder {
|
751 762 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
752 - | pub(crate) field_list:
|
753 - | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
754 763 | }
|
755 764 | impl Builder {
|
756 - | /// A summary of the validation failure.
|
765 + | #[allow(missing_docs)] // documentation missing in model
|
757 766 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
758 767 | self.message = Some(input);
|
759 768 | self
|
760 769 | }
|
761 - | /// 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.
|
762 - | pub fn field_list(
|
763 - | mut self,
|
764 - | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
765 - | ) -> Self {
|
766 - | self.field_list = input;
|
767 - | self
|
768 - | }
|
769 - | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
770 + | /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
770 771 | ///
|
771 - | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if you do not provide a value for all non-`Option`al members.
|
772 + | /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
|
772 773 | ///
|
773 - | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
774 + | pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
774 775 | self.build_enforcing_required_and_enum_traits()
|
775 776 | }
|
776 777 | fn build_enforcing_required_and_enum_traits(
|
777 778 | self,
|
778 - | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
779 - | Ok(crate::error::ValidationException {
|
779 + | ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
780 + | Ok(crate::error::InternalServerError {
|
780 781 | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
781 - | field_list: self.field_list,
|
782 782 | })
|
783 783 | }
|
784 784 | }
|
785 785 | }
|
786 - | /// See [`CollidingException`](crate::error::CollidingException).
|
787 - | pub mod colliding_exception {
|
786 + | /// See [`CollidingError`](crate::error::CollidingError).
|
787 + | pub mod colliding_error {
|
788 788 |
|
789 - | impl ::std::convert::From<Builder> for crate::error::CollidingException {
|
789 + | impl ::std::convert::From<Builder> for crate::error::CollidingError {
|
790 790 | fn from(builder: Builder) -> Self {
|
791 791 | builder.build()
|
792 792 | }
|
793 793 | }
|
794 - | /// A builder for [`CollidingException`](crate::error::CollidingException).
|
794 + | /// A builder for [`CollidingError`](crate::error::CollidingError).
|
795 795 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
796 796 | pub struct Builder {}
|
797 797 | impl Builder {
|
798 - | /// Consumes the builder and constructs a [`CollidingException`](crate::error::CollidingException).
|
799 - | pub fn build(self) -> crate::error::CollidingException {
|
798 + | /// Consumes the builder and constructs a [`CollidingError`](crate::error::CollidingError).
|
799 + | pub fn build(self) -> crate::error::CollidingError {
|
800 800 | self.build_enforcing_required_and_enum_traits()
|
801 801 | }
|
802 - | fn build_enforcing_required_and_enum_traits(self) -> crate::error::CollidingException {
|
803 - | crate::error::CollidingException {}
|
802 + | fn build_enforcing_required_and_enum_traits(self) -> crate::error::CollidingError {
|
803 + | crate::error::CollidingError {}
|
804 804 | }
|
805 805 | }
|
806 806 | }
|
807 - | /// See [`CollidingError`](crate::error::CollidingError).
|
808 - | pub mod colliding_error {
|
807 + | /// See [`CollidingException`](crate::error::CollidingException).
|
808 + | pub mod colliding_exception {
|
809 809 |
|
810 - | impl ::std::convert::From<Builder> for crate::error::CollidingError {
|
810 + | impl ::std::convert::From<Builder> for crate::error::CollidingException {
|
811 811 | fn from(builder: Builder) -> Self {
|
812 812 | builder.build()
|
813 813 | }
|
814 814 | }
|
815 - | /// A builder for [`CollidingError`](crate::error::CollidingError).
|
815 + | /// A builder for [`CollidingException`](crate::error::CollidingException).
|
816 816 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
817 817 | pub struct Builder {}
|
818 818 | impl Builder {
|
819 - | /// Consumes the builder and constructs a [`CollidingError`](crate::error::CollidingError).
|
820 - | pub fn build(self) -> crate::error::CollidingError {
|
819 + | /// Consumes the builder and constructs a [`CollidingException`](crate::error::CollidingException).
|
820 + | pub fn build(self) -> crate::error::CollidingException {
|
821 821 | self.build_enforcing_required_and_enum_traits()
|
822 822 | }
|
823 - | fn build_enforcing_required_and_enum_traits(self) -> crate::error::CollidingError {
|
824 - | crate::error::CollidingError {}
|
823 + | fn build_enforcing_required_and_enum_traits(self) -> crate::error::CollidingException {
|
824 + | crate::error::CollidingException {}
|
825 825 | }
|
826 826 | }
|
827 827 | }
|