325 325 | }
|
326 326 | }
|
327 327 | impl ::std::error::Error for GetServerStatisticsError {
|
328 328 | fn source(&self) -> std::option::Option<&(dyn ::std::error::Error + 'static)> {
|
329 329 | match &self {
|
330 330 | GetServerStatisticsError::InternalServerError(_inner) => Some(_inner),
|
331 331 | }
|
332 332 | }
|
333 333 | }
|
334 334 | impl ::std::convert::From<crate::error::InternalServerError>
|
335 335 | for crate::error::GetServerStatisticsError
|
336 336 | {
|
337 337 | fn from(variant: crate::error::InternalServerError) -> crate::error::GetServerStatisticsError {
|
338 338 | Self::InternalServerError(variant)
|
339 339 | }
|
340 340 | }
|
341 341 |
|
342 342 | impl ::std::convert::From<::napi::Error> for crate::error::GetServerStatisticsError {
|
343 343 | fn from(variant: ::napi::Error) -> crate::error::GetServerStatisticsError {
|
344 344 | crate::error::InternalServerError {
|
345 345 | message: variant.to_string(),
|
346 346 | }
|
347 347 | .into()
|
348 348 | }
|
349 349 | }
|
350 350 | /// See [`InternalServerError`](crate::error::InternalServerError).
|
351 351 | pub mod internal_server_error {
|
352 352 |
|
353 353 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
354 354 | /// Holds one variant for each of the ways the builder can fail.
|
355 - |
|
356 355 | #[allow(clippy::enum_variant_names)]
|
357 356 | pub enum ConstraintViolation {
|
358 357 | /// `message` was not provided but it is required when building `InternalServerError`.
|
359 358 | MissingMessage,
|
360 359 | }
|
361 360 | impl ::std::fmt::Display for ConstraintViolation {
|
362 361 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
363 362 | match self {
|
364 363 | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `InternalServerError`"),
|
365 364 | }
|
366 365 | }
|
367 366 | }
|
368 367 | impl ::std::error::Error for ConstraintViolation {}
|
369 368 | impl ::std::convert::TryFrom<Builder> for crate::error::InternalServerError {
|
370 369 | type Error = ConstraintViolation;
|
371 370 |
|
372 371 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
373 372 | builder.build()
|
374 373 | }
|
375 374 | }
|
376 375 | /// A builder for [`InternalServerError`](crate::error::InternalServerError).
|
377 376 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
378 377 | pub struct Builder {
|
379 378 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
380 379 | }
|
381 380 | impl Builder {
|
382 381 | #[allow(missing_docs)] // documentation missing in model
|
383 382 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
384 383 | self.message = Some(input);
|
385 384 | self
|
386 385 | }
|
387 386 | /// Consumes the builder and constructs a [`InternalServerError`](crate::error::InternalServerError).
|
388 387 | ///
|
389 388 | /// The builder fails to construct a [`InternalServerError`](crate::error::InternalServerError) if you do not provide a value for all non-`Option`al members.
|
390 389 | ///
|
391 390 | pub fn build(self) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
392 391 | self.build_enforcing_required_and_enum_traits()
|
393 392 | }
|
394 393 | fn build_enforcing_required_and_enum_traits(
|
395 394 | self,
|
396 395 | ) -> Result<crate::error::InternalServerError, ConstraintViolation> {
|
397 396 | Ok(crate::error::InternalServerError {
|
398 397 | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
399 398 | })
|
400 399 | }
|
401 400 | }
|
402 401 | }
|
403 402 | /// See [`ValidationException`](crate::error::ValidationException).
|
404 403 | pub mod validation_exception {
|
405 404 |
|
406 405 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
407 406 | /// Holds one variant for each of the ways the builder can fail.
|
408 - |
|
409 407 | #[allow(clippy::enum_variant_names)]
|
410 408 | pub enum ConstraintViolation {
|
411 409 | /// `message` was not provided but it is required when building `ValidationException`.
|
412 410 | MissingMessage,
|
413 411 | }
|
414 412 | impl ::std::fmt::Display for ConstraintViolation {
|
415 413 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
416 414 | match self {
|
417 415 | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ValidationException`"),
|
418 416 | }
|
419 417 | }
|
420 418 | }
|
421 419 | impl ::std::error::Error for ConstraintViolation {}
|
422 420 | impl ::std::convert::TryFrom<Builder> for crate::error::ValidationException {
|
423 421 | type Error = ConstraintViolation;
|
424 422 |
|
425 423 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
426 424 | builder.build()
|
427 425 | }
|
428 426 | }
|
429 427 | /// A builder for [`ValidationException`](crate::error::ValidationException).
|
430 428 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
431 429 | pub struct Builder {
|
432 430 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
433 431 | pub(crate) field_list:
|
434 432 | ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
435 433 | }
|
436 434 | impl Builder {
|
437 435 | /// A summary of the validation failure.
|
438 436 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
442 440 | /// 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.
|
443 441 | pub fn field_list(
|
444 442 | mut self,
|
445 443 | input: ::std::option::Option<::std::vec::Vec<crate::model::ValidationExceptionField>>,
|
446 444 | ) -> Self {
|
447 445 | self.field_list = input;
|
448 446 | self
|
449 447 | }
|
450 448 | /// Consumes the builder and constructs a [`ValidationException`](crate::error::ValidationException).
|
451 449 | ///
|
452 450 | /// The builder fails to construct a [`ValidationException`](crate::error::ValidationException) if you do not provide a value for all non-`Option`al members.
|
453 451 | ///
|
454 452 | pub fn build(self) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
455 453 | self.build_enforcing_required_and_enum_traits()
|
456 454 | }
|
457 455 | fn build_enforcing_required_and_enum_traits(
|
458 456 | self,
|
459 457 | ) -> Result<crate::error::ValidationException, ConstraintViolation> {
|
460 458 | Ok(crate::error::ValidationException {
|
461 459 | message: self.message.ok_or(ConstraintViolation::MissingMessage)?,
|
462 460 | field_list: self.field_list,
|
463 461 | })
|
464 462 | }
|
465 463 | }
|
466 464 | }
|
467 465 | /// See [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
468 466 | pub mod resource_not_found_exception {
|
469 467 |
|
470 468 | #[derive(::std::cmp::PartialEq, ::std::fmt::Debug)]
|
471 469 | /// Holds one variant for each of the ways the builder can fail.
|
472 - |
|
473 470 | #[allow(clippy::enum_variant_names)]
|
474 471 | pub enum ConstraintViolation {
|
475 472 | /// `message` was not provided but it is required when building `ResourceNotFoundException`.
|
476 473 | MissingMessage,
|
477 474 | }
|
478 475 | impl ::std::fmt::Display for ConstraintViolation {
|
479 476 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
480 477 | match self {
|
481 478 | ConstraintViolation::MissingMessage => write!(f, "`message` was not provided but it is required when building `ResourceNotFoundException`"),
|
482 479 | }
|
483 480 | }
|
484 481 | }
|
485 482 | impl ::std::error::Error for ConstraintViolation {}
|
486 483 | impl ::std::convert::TryFrom<Builder> for crate::error::ResourceNotFoundException {
|
487 484 | type Error = ConstraintViolation;
|
488 485 |
|
489 486 | fn try_from(builder: Builder) -> ::std::result::Result<Self, Self::Error> {
|
490 487 | builder.build()
|
491 488 | }
|
492 489 | }
|
493 490 | /// A builder for [`ResourceNotFoundException`](crate::error::ResourceNotFoundException).
|
494 491 | #[derive(::std::clone::Clone, ::std::default::Default, ::std::fmt::Debug)]
|
495 492 | pub struct Builder {
|
496 493 | pub(crate) message: ::std::option::Option<::std::string::String>,
|
497 494 | }
|
498 495 | impl Builder {
|
499 496 | #[allow(missing_docs)] // documentation missing in model
|
500 497 | pub fn message(mut self, input: ::std::string::String) -> Self {
|
501 498 | self.message = Some(input);
|
502 499 | self
|