aws_sdk_iot1clickdevices/types/error/
_range_not_satisfiable_exception.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RangeNotSatisfiableException {
6    /// <p>416</p>
7    pub code: ::std::option::Option<::std::string::String>,
8    /// <p>The requested number of results specified by nextToken cannot be satisfied.</p>
9    pub message: ::std::option::Option<::std::string::String>,
10    pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
11}
12impl RangeNotSatisfiableException {
13    /// <p>416</p>
14    pub fn code(&self) -> ::std::option::Option<&str> {
15        self.code.as_deref()
16    }
17}
18impl RangeNotSatisfiableException {
19    /// Returns the error message.
20    pub fn message(&self) -> ::std::option::Option<&str> {
21        self.message.as_deref()
22    }
23}
24impl ::std::fmt::Display for RangeNotSatisfiableException {
25    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
26        ::std::write!(f, "RangeNotSatisfiableException")?;
27        if let ::std::option::Option::Some(inner_1) = &self.message {
28            {
29                ::std::write!(f, ": {}", inner_1)?;
30            }
31        }
32        Ok(())
33    }
34}
35impl ::std::error::Error for RangeNotSatisfiableException {}
36impl ::aws_types::request_id::RequestId for crate::types::error::RangeNotSatisfiableException {
37    fn request_id(&self) -> Option<&str> {
38        use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
39        self.meta().request_id()
40    }
41}
42impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for RangeNotSatisfiableException {
43    fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
44        &self.meta
45    }
46}
47impl RangeNotSatisfiableException {
48    /// Creates a new builder-style object to manufacture [`RangeNotSatisfiableException`](crate::types::error::RangeNotSatisfiableException).
49    pub fn builder() -> crate::types::error::builders::RangeNotSatisfiableExceptionBuilder {
50        crate::types::error::builders::RangeNotSatisfiableExceptionBuilder::default()
51    }
52}
53
54/// A builder for [`RangeNotSatisfiableException`](crate::types::error::RangeNotSatisfiableException).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct RangeNotSatisfiableExceptionBuilder {
58    pub(crate) code: ::std::option::Option<::std::string::String>,
59    pub(crate) message: ::std::option::Option<::std::string::String>,
60    meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
61}
62impl RangeNotSatisfiableExceptionBuilder {
63    /// <p>416</p>
64    pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65        self.code = ::std::option::Option::Some(input.into());
66        self
67    }
68    /// <p>416</p>
69    pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70        self.code = input;
71        self
72    }
73    /// <p>416</p>
74    pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
75        &self.code
76    }
77    /// <p>The requested number of results specified by nextToken cannot be satisfied.</p>
78    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79        self.message = ::std::option::Option::Some(input.into());
80        self
81    }
82    /// <p>The requested number of results specified by nextToken cannot be satisfied.</p>
83    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84        self.message = input;
85        self
86    }
87    /// <p>The requested number of results specified by nextToken cannot be satisfied.</p>
88    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
89        &self.message
90    }
91    /// Sets error metadata
92    pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
93        self.meta = Some(meta);
94        self
95    }
96
97    /// Sets error metadata
98    pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
99        self.meta = meta;
100        self
101    }
102    /// Consumes the builder and constructs a [`RangeNotSatisfiableException`](crate::types::error::RangeNotSatisfiableException).
103    pub fn build(self) -> crate::types::error::RangeNotSatisfiableException {
104        crate::types::error::RangeNotSatisfiableException {
105            code: self.code,
106            message: self.message,
107            meta: self.meta.unwrap_or_default(),
108        }
109    }
110}