aws_sdk_neptunedata/types/error/
_bad_request_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct BadRequestException {
7 pub detailed_message: ::std::string::String,
9 pub request_id: ::std::string::String,
11 pub code: ::std::string::String,
13 #[allow(missing_docs)] pub message: ::std::option::Option<::std::string::String>,
15 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
16}
17impl BadRequestException {
18 pub fn detailed_message(&self) -> &str {
20 use std::ops::Deref;
21 self.detailed_message.deref()
22 }
23 pub fn request_id(&self) -> &str {
25 use std::ops::Deref;
26 self.request_id.deref()
27 }
28 pub fn code(&self) -> &str {
30 use std::ops::Deref;
31 self.code.deref()
32 }
33}
34impl BadRequestException {
35 pub fn message(&self) -> ::std::option::Option<&str> {
37 self.message.as_deref()
38 }
39}
40impl ::std::fmt::Display for BadRequestException {
41 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
42 ::std::write!(f, "BadRequestException")?;
43 if let ::std::option::Option::Some(inner_1) = &self.message {
44 {
45 ::std::write!(f, ": {}", inner_1)?;
46 }
47 }
48 Ok(())
49 }
50}
51impl ::std::error::Error for BadRequestException {}
52impl ::aws_types::request_id::RequestId for crate::types::error::BadRequestException {
53 fn request_id(&self) -> Option<&str> {
54 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
55 self.meta().request_id()
56 }
57}
58impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for BadRequestException {
59 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
60 &self.meta
61 }
62}
63impl BadRequestException {
64 pub fn builder() -> crate::types::error::builders::BadRequestExceptionBuilder {
66 crate::types::error::builders::BadRequestExceptionBuilder::default()
67 }
68}
69
70#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
72#[non_exhaustive]
73pub struct BadRequestExceptionBuilder {
74 pub(crate) detailed_message: ::std::option::Option<::std::string::String>,
75 pub(crate) request_id: ::std::option::Option<::std::string::String>,
76 pub(crate) code: ::std::option::Option<::std::string::String>,
77 pub(crate) message: ::std::option::Option<::std::string::String>,
78 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
79}
80impl BadRequestExceptionBuilder {
81 pub fn detailed_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.detailed_message = ::std::option::Option::Some(input.into());
85 self
86 }
87 pub fn set_detailed_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.detailed_message = input;
90 self
91 }
92 pub fn get_detailed_message(&self) -> &::std::option::Option<::std::string::String> {
94 &self.detailed_message
95 }
96 pub fn request_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99 self.request_id = ::std::option::Option::Some(input.into());
100 self
101 }
102 pub fn set_request_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104 self.request_id = input;
105 self
106 }
107 pub fn get_request_id(&self) -> &::std::option::Option<::std::string::String> {
109 &self.request_id
110 }
111 pub fn code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.code = ::std::option::Option::Some(input.into());
115 self
116 }
117 pub fn set_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.code = input;
120 self
121 }
122 pub fn get_code(&self) -> &::std::option::Option<::std::string::String> {
124 &self.code
125 }
126 #[allow(missing_docs)] pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.message = ::std::option::Option::Some(input.into());
129 self
130 }
131 #[allow(missing_docs)] pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.message = input;
134 self
135 }
136 #[allow(missing_docs)] pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
138 &self.message
139 }
140 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
142 self.meta = Some(meta);
143 self
144 }
145
146 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
148 self.meta = meta;
149 self
150 }
151 pub fn build(self) -> ::std::result::Result<crate::types::error::BadRequestException, ::aws_smithy_types::error::operation::BuildError> {
157 ::std::result::Result::Ok(crate::types::error::BadRequestException {
158 detailed_message: self.detailed_message.ok_or_else(|| {
159 ::aws_smithy_types::error::operation::BuildError::missing_field(
160 "detailed_message",
161 "detailed_message was not specified but it is required when building BadRequestException",
162 )
163 })?,
164 request_id: self.request_id.ok_or_else(|| {
165 ::aws_smithy_types::error::operation::BuildError::missing_field(
166 "request_id",
167 "request_id was not specified but it is required when building BadRequestException",
168 )
169 })?,
170 code: self.code.ok_or_else(|| {
171 ::aws_smithy_types::error::operation::BuildError::missing_field(
172 "code",
173 "code was not specified but it is required when building BadRequestException",
174 )
175 })?,
176 message: self.message,
177 meta: self.meta.unwrap_or_default(),
178 })
179 }
180}