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