3 3 | pub fn de_delete_item_http_error(
|
4 4 | _response_status: u16,
|
5 5 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 6 | _response_body: &[u8],
|
7 7 | ) -> std::result::Result<crate::operation::delete_item::DeleteItemOutput, crate::operation::delete_item::DeleteItemError> {
|
8 8 | #[allow(unused_mut)]
|
9 9 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
10 10 | .map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
11 11 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
12 12 | let generic = generic_builder.build();
|
13 13 | let error_code = match generic.code() {
|
14 14 | Some(code) => code,
|
15 15 | None => return Err(crate::operation::delete_item::DeleteItemError::unhandled(generic)),
|
16 16 | };
|
17 17 |
|
18 18 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
19 19 | Err(match error_code {
|
20 20 | "ConditionalCheckFailedException" => crate::operation::delete_item::DeleteItemError::ConditionalCheckFailedException({
|
21 21 | #[allow(unused_mut)]
|
22 22 | let mut tmp = {
|
23 23 | #[allow(unused_mut)]
|
24 24 | let mut output = crate::types::error::builders::ConditionalCheckFailedExceptionBuilder::default();
|
25 25 | output = crate::protocol_serde::shape_conditional_check_failed_exception::de_conditional_check_failed_exception_json_err(
|
26 26 | _response_body,
|
27 27 | output,
|
28 28 | )
|
29 29 | .map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
30 30 | let output = output.meta(generic);
|
31 31 | output.build()
|
32 32 | };
|
33 - | if tmp.message.is_none() {
|
34 - | tmp.message = _error_message;
|
35 - | }
|
36 33 | tmp
|
37 34 | }),
|
38 35 | "InternalServerError" => crate::operation::delete_item::DeleteItemError::InternalServerError({
|
39 36 | #[allow(unused_mut)]
|
40 37 | let mut tmp = {
|
41 38 | #[allow(unused_mut)]
|
42 39 | let mut output = crate::types::error::builders::InternalServerErrorBuilder::default();
|
43 40 | output = crate::protocol_serde::shape_internal_server_error::de_internal_server_error_json_err(_response_body, output)
|
44 41 | .map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
45 42 | let output = output.meta(generic);
|
46 43 | output.build()
|
47 44 | };
|
48 - | if tmp.message.is_none() {
|
49 - | tmp.message = _error_message;
|
50 - | }
|
51 45 | tmp
|
52 46 | }),
|
53 47 | "InvalidEndpointException" => crate::operation::delete_item::DeleteItemError::InvalidEndpointException({
|
54 48 | #[allow(unused_mut)]
|
55 49 | let mut tmp = {
|
56 50 | #[allow(unused_mut)]
|
57 51 | let mut output = crate::types::error::builders::InvalidEndpointExceptionBuilder::default();
|
58 52 | output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
|
59 53 | .map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
60 54 | let output = output.meta(generic);
|
61 55 | output.build()
|
62 56 | };
|
63 - | if tmp.message.is_none() {
|
64 - | tmp.message = _error_message;
|
65 - | }
|
66 57 | tmp
|
67 58 | }),
|
68 59 | "ItemCollectionSizeLimitExceededException" => crate::operation::delete_item::DeleteItemError::ItemCollectionSizeLimitExceededException({
|
69 60 | #[allow(unused_mut)]
|
70 61 | let mut tmp = {
|
71 62 | #[allow(unused_mut)]
|
72 63 | let mut output = crate::types::error::builders::ItemCollectionSizeLimitExceededExceptionBuilder::default();
|
73 64 | output = crate::protocol_serde::shape_item_collection_size_limit_exceeded_exception::de_item_collection_size_limit_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
74 65 | let output = output.meta(generic);
|
75 66 | output.build()
|
76 67 | };
|
77 - | if tmp.message.is_none() {
|
78 - | tmp.message = _error_message;
|
79 - | }
|
80 68 | tmp
|
81 69 | }),
|
82 70 | "ProvisionedThroughputExceededException" => {
|
83 71 | crate::operation::delete_item::DeleteItemError::ProvisionedThroughputExceededException({
|
84 72 | #[allow(unused_mut)]
|
85 73 | let mut tmp = {
|
86 74 | #[allow(unused_mut)]
|
87 75 | let mut output = crate::types::error::builders::ProvisionedThroughputExceededExceptionBuilder::default();
|
88 76 | output = crate::protocol_serde::shape_provisioned_throughput_exceeded_exception::de_provisioned_throughput_exceeded_exception_json_err(_response_body, output).map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
89 77 | let output = output.meta(generic);
|
90 78 | output.build()
|
91 79 | };
|
92 - | if tmp.message.is_none() {
|
93 - | tmp.message = _error_message;
|
94 - | }
|
95 80 | tmp
|
96 81 | })
|
97 82 | }
|
98 83 | "RequestLimitExceeded" => crate::operation::delete_item::DeleteItemError::RequestLimitExceeded({
|
99 84 | #[allow(unused_mut)]
|
100 85 | let mut tmp = {
|
101 86 | #[allow(unused_mut)]
|
102 87 | let mut output = crate::types::error::builders::RequestLimitExceededBuilder::default();
|
103 88 | output = crate::protocol_serde::shape_request_limit_exceeded::de_request_limit_exceeded_json_err(_response_body, output)
|
104 89 | .map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
105 90 | let output = output.meta(generic);
|
106 91 | output.build()
|
107 92 | };
|
108 - | if tmp.message.is_none() {
|
109 - | tmp.message = _error_message;
|
110 - | }
|
111 93 | tmp
|
112 94 | }),
|
113 95 | "ResourceNotFoundException" => crate::operation::delete_item::DeleteItemError::ResourceNotFoundException({
|
114 96 | #[allow(unused_mut)]
|
115 97 | let mut tmp = {
|
116 98 | #[allow(unused_mut)]
|
117 99 | let mut output = crate::types::error::builders::ResourceNotFoundExceptionBuilder::default();
|
118 100 | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
119 101 | .map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
120 102 | let output = output.meta(generic);
|
121 103 | output.build()
|
122 104 | };
|
123 - | if tmp.message.is_none() {
|
124 - | tmp.message = _error_message;
|
125 - | }
|
126 105 | tmp
|
127 106 | }),
|
128 107 | "TransactionConflictException" => crate::operation::delete_item::DeleteItemError::TransactionConflictException({
|
129 108 | #[allow(unused_mut)]
|
130 109 | let mut tmp = {
|
131 110 | #[allow(unused_mut)]
|
132 111 | let mut output = crate::types::error::builders::TransactionConflictExceptionBuilder::default();
|
133 112 | output =
|
134 113 | crate::protocol_serde::shape_transaction_conflict_exception::de_transaction_conflict_exception_json_err(_response_body, output)
|
135 114 | .map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
136 115 | let output = output.meta(generic);
|
137 116 | output.build()
|
138 117 | };
|
139 - | if tmp.message.is_none() {
|
140 - | tmp.message = _error_message;
|
141 - | }
|
142 118 | tmp
|
143 119 | }),
|
144 120 | _ => crate::operation::delete_item::DeleteItemError::generic(generic),
|
145 121 | })
|
146 122 | }
|
147 123 |
|
148 124 | #[allow(clippy::unnecessary_wraps)]
|
149 125 | pub fn de_delete_item_http_response(
|
150 126 | _response_status: u16,
|
151 127 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
152 128 | _response_body: &[u8],
|
153 129 | ) -> std::result::Result<crate::operation::delete_item::DeleteItemOutput, crate::operation::delete_item::DeleteItemError> {
|
154 130 | Ok({
|
155 131 | #[allow(unused_mut)]
|
156 132 | let mut output = crate::operation::delete_item::builders::DeleteItemOutputBuilder::default();
|
157 133 | output = crate::protocol_serde::shape_delete_item::de_delete_item(_response_body, output)
|
158 134 | .map_err(crate::operation::delete_item::DeleteItemError::unhandled)?;
|
159 135 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
160 136 | output.build()
|
161 137 | })
|
162 138 | }
|
163 139 |
|
164 140 | pub fn ser_delete_item_input(
|
165 141 | input: &crate::operation::delete_item::DeleteItemInput,
|
166 142 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|
167 143 | let mut out = String::new();
|
168 144 | let mut object = ::aws_smithy_json::serialize::JsonObjectWriter::new(&mut out);
|
169 145 | crate::protocol_serde::shape_delete_item_input::ser_delete_item_input_input(&mut object, input)?;
|
170 146 | object.finish();
|
171 147 | Ok(::aws_smithy_types::body::SdkBody::from(out))
|