aws_sdk_dynamodb/types/error/
_conditional_check_failed_exception.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct ConditionalCheckFailedException {
7 pub message: ::std::option::Option<::std::string::String>,
9 pub item: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
11 pub(crate) meta: ::aws_smithy_types::error::ErrorMetadata,
12}
13impl ConditionalCheckFailedException {
14 pub fn item(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
16 self.item.as_ref()
17 }
18}
19impl ConditionalCheckFailedException {
20 pub fn message(&self) -> ::std::option::Option<&str> {
22 self.message.as_deref()
23 }
24}
25impl ::std::fmt::Display for ConditionalCheckFailedException {
26 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
27 ::std::write!(f, "ConditionalCheckFailedException")?;
28 if let ::std::option::Option::Some(inner_1) = &self.message {
29 {
30 ::std::write!(f, ": {inner_1}")?;
31 }
32 }
33 Ok(())
34 }
35}
36impl ::std::error::Error for ConditionalCheckFailedException {}
37impl ::aws_types::request_id::RequestId for crate::types::error::ConditionalCheckFailedException {
38 fn request_id(&self) -> Option<&str> {
39 use ::aws_smithy_types::error::metadata::ProvideErrorMetadata;
40 self.meta().request_id()
41 }
42}
43impl ::aws_smithy_types::error::metadata::ProvideErrorMetadata for ConditionalCheckFailedException {
44 fn meta(&self) -> &::aws_smithy_types::error::ErrorMetadata {
45 &self.meta
46 }
47}
48impl ConditionalCheckFailedException {
49 pub fn builder() -> crate::types::error::builders::ConditionalCheckFailedExceptionBuilder {
51 crate::types::error::builders::ConditionalCheckFailedExceptionBuilder::default()
52 }
53}
54
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
57#[non_exhaustive]
58pub struct ConditionalCheckFailedExceptionBuilder {
59 pub(crate) message: ::std::option::Option<::std::string::String>,
60 pub(crate) item: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
61 meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>,
62}
63impl ConditionalCheckFailedExceptionBuilder {
64 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 pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.message = input;
72 self
73 }
74 pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
76 &self.message
77 }
78 pub fn item(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::AttributeValue) -> Self {
84 let mut hash_map = self.item.unwrap_or_default();
85 hash_map.insert(k.into(), v);
86 self.item = ::std::option::Option::Some(hash_map);
87 self
88 }
89 pub fn set_item(
91 mut self,
92 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>>,
93 ) -> Self {
94 self.item = input;
95 self
96 }
97 pub fn get_item(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::AttributeValue>> {
99 &self.item
100 }
101 pub fn meta(mut self, meta: ::aws_smithy_types::error::ErrorMetadata) -> Self {
103 self.meta = Some(meta);
104 self
105 }
106
107 pub fn set_meta(&mut self, meta: std::option::Option<::aws_smithy_types::error::ErrorMetadata>) -> &mut Self {
109 self.meta = meta;
110 self
111 }
112 pub fn build(self) -> crate::types::error::ConditionalCheckFailedException {
114 crate::types::error::ConditionalCheckFailedException {
115 message: self.message,
116 item: self.item,
117 meta: self.meta.unwrap_or_default(),
118 }
119 }
120}