1 1 | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 + | /* RustType.kt:516 */
|
2 3 | #[allow(clippy::unnecessary_wraps)]
|
4 + | /* ProtocolParserGenerator.kt:99 */
|
3 5 | pub fn de_get_storage_http_error(
|
4 6 | _response_status: u16,
|
5 7 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
6 8 | _response_body: &[u8],
|
7 9 | ) -> std::result::Result<crate::operation::get_storage::GetStorageOutput, crate::operation::get_storage::GetStorageError> {
|
10 + | /* RustType.kt:516 */
|
8 11 | #[allow(unused_mut)]
|
12 + | /* ProtocolParserGenerator.kt:106 */
|
9 13 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
10 14 | .map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
|
15 + | /* ProtocolParserGenerator.kt:120 */
|
11 16 | let generic = generic_builder.build();
|
17 + | /* ProtocolParserGenerator.kt:122 */
|
12 18 | let error_code = match generic.code() {
|
13 19 | Some(code) => code,
|
14 20 | None => return Err(crate::operation::get_storage::GetStorageError::unhandled(generic)),
|
15 21 | };
|
16 22 |
|
17 23 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
24 + | /* ProtocolParserGenerator.kt:133 */
|
18 25 | Err(match error_code {
|
26 + | /* ProtocolParserGenerator.kt:139 */
|
19 27 | "ValidationException" => crate::operation::get_storage::GetStorageError::ValidationError({
|
28 + | /* RustType.kt:516 */
|
20 29 | #[allow(unused_mut)]
|
21 - | let mut tmp = {
|
22 - | #[allow(unused_mut)]
|
23 - | let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
|
24 - | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
25 - | .map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
|
26 - | let output = output.meta(generic);
|
27 - | crate::serde_util::validation_exception_correct_errors(output)
|
28 - | .build()
|
29 - | .map_err(crate::operation::get_storage::GetStorageError::unhandled)?
|
30 - | };
|
30 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
31 + | /* ProtocolParserGenerator.kt:146 */ {
|
32 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
33 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ValidationErrorBuilder::default();
|
34 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output).map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
|
35 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
36 + | /* ClientBuilderInstantiator.kt:46 */crate::serde_util::validation_exception_correct_errors(output).build().map_err(crate::operation::get_storage::GetStorageError::unhandled)?
|
37 + | /* ProtocolParserGenerator.kt:146 */}
|
38 + | /* ProtocolParserGenerator.kt:145 */;
|
39 + | /* ProtocolParserGenerator.kt:179 */
|
31 40 | tmp
|
41 + | /* ProtocolParserGenerator.kt:139 */
|
32 42 | }),
|
43 + | /* ProtocolParserGenerator.kt:139 */
|
33 44 | "StorageAccessNotAuthorized" => crate::operation::get_storage::GetStorageError::StorageAccessNotAuthorized({
|
45 + | /* RustType.kt:516 */
|
34 46 | #[allow(unused_mut)]
|
35 - | let mut tmp = {
|
36 - | #[allow(unused_mut)]
|
37 - | let mut output = crate::types::error::builders::StorageAccessNotAuthorizedBuilder::default();
|
38 - | output =
|
39 - | crate::protocol_serde::shape_storage_access_not_authorized::de_storage_access_not_authorized_json_err(_response_body, output)
|
40 - | .map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
|
41 - | let output = output.meta(generic);
|
42 - | output.build()
|
43 - | };
|
47 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
48 + | /* ProtocolParserGenerator.kt:146 */ {
|
49 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
50 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::StorageAccessNotAuthorizedBuilder::default();
|
51 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_storage_access_not_authorized::de_storage_access_not_authorized_json_err(_response_body, output).map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
|
52 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
53 + | /* ClientBuilderInstantiator.kt:56 */output.build()
|
54 + | /* ProtocolParserGenerator.kt:146 */}
|
55 + | /* ProtocolParserGenerator.kt:145 */;
|
56 + | /* ProtocolParserGenerator.kt:170 */
|
44 57 | if tmp.message.is_none() {
|
45 58 | tmp.message = _error_message;
|
46 59 | }
|
60 + | /* ProtocolParserGenerator.kt:179 */
|
47 61 | tmp
|
62 + | /* ProtocolParserGenerator.kt:139 */
|
48 63 | }),
|
64 + | /* ProtocolParserGenerator.kt:139 */
|
49 65 | "ResourceNotFoundException" => crate::operation::get_storage::GetStorageError::ResourceNotFoundError({
|
66 + | /* RustType.kt:516 */
|
50 67 | #[allow(unused_mut)]
|
51 - | let mut tmp = {
|
52 - | #[allow(unused_mut)]
|
53 - | let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
|
54 - | output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output)
|
55 - | .map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
|
56 - | let output = output.meta(generic);
|
57 - | crate::serde_util::resource_not_found_exception_correct_errors(output)
|
58 - | .build()
|
59 - | .map_err(crate::operation::get_storage::GetStorageError::unhandled)?
|
60 - | };
|
68 + | /* ProtocolParserGenerator.kt:145 */let mut tmp =
|
69 + | /* ProtocolParserGenerator.kt:146 */ {
|
70 + | /* RustType.kt:516 */#[allow(unused_mut)]
|
71 + | /* ProtocolParserGenerator.kt:240 */let mut output = crate::types::error::builders::ResourceNotFoundErrorBuilder::default();
|
72 + | /* ProtocolParserGenerator.kt:257 */output = crate::protocol_serde::shape_resource_not_found_exception::de_resource_not_found_exception_json_err(_response_body, output).map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
|
73 + | /* ProtocolParserGenerator.kt:157 */let output = output.meta(generic);
|
74 + | /* ClientBuilderInstantiator.kt:46 */crate::serde_util::resource_not_found_exception_correct_errors(output).build().map_err(crate::operation::get_storage::GetStorageError::unhandled)?
|
75 + | /* ProtocolParserGenerator.kt:146 */}
|
76 + | /* ProtocolParserGenerator.kt:145 */;
|
77 + | /* ProtocolParserGenerator.kt:179 */
|
61 78 | tmp
|
79 + | /* ProtocolParserGenerator.kt:139 */
|
62 80 | }),
|
63 - | _ => crate::operation::get_storage::GetStorageError::generic(generic),
|
81 + | /* ProtocolParserGenerator.kt:182 */
|
82 + | _ => crate::operation::get_storage::GetStorageError::generic(generic), /* ProtocolParserGenerator.kt:133 */
|
64 83 | })
|
84 + | /* ProtocolParserGenerator.kt:99 */
|
65 85 | }
|
66 86 |
|
87 + | /* RustType.kt:516 */
|
67 88 | #[allow(clippy::unnecessary_wraps)]
|
89 + | /* ProtocolParserGenerator.kt:71 */
|
68 90 | pub fn de_get_storage_http_response(
|
69 91 | _response_status: u16,
|
70 92 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
71 93 | _response_body: &[u8],
|
72 94 | ) -> std::result::Result<crate::operation::get_storage::GetStorageOutput, crate::operation::get_storage::GetStorageError> {
|
95 + | /* ProtocolParserGenerator.kt:77 */
|
73 96 | Ok({
|
97 + | /* RustType.kt:516 */
|
74 98 | #[allow(unused_mut)]
|
99 + | /* ProtocolParserGenerator.kt:240 */
|
75 100 | let mut output = crate::operation::get_storage::builders::GetStorageOutputBuilder::default();
|
101 + | /* ProtocolParserGenerator.kt:247 */
|
76 102 | output = crate::protocol_serde::shape_get_storage::de_get_storage(_response_body, output)
|
77 103 | .map_err(crate::operation::get_storage::GetStorageError::unhandled)?;
|
104 + | /* ClientBuilderInstantiator.kt:46 */
|
78 105 | crate::serde_util::get_storage_output_output_correct_errors(output)
|
79 106 | .build()
|
80 107 | .map_err(crate::operation::get_storage::GetStorageError::unhandled)?
|
108 + | /* ProtocolParserGenerator.kt:77 */
|
81 109 | })
|
110 + | /* ProtocolParserGenerator.kt:71 */
|
82 111 | }
|
83 112 |
|
113 + | /* HttpBindingGenerator.kt:542 */
|
84 114 | pub fn ser_get_storage_headers(
|
85 115 | input: &crate::operation::get_storage::GetStorageInput,
|
86 116 | mut builder: ::http::request::Builder,
|
87 117 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
118 + | /* HttpBindingGenerator.kt:592 */
|
88 119 | if let ::std::option::Option::Some(inner_1) = &input.passcode {
|
120 + | /* HttpBindingGenerator.kt:704 */
|
89 121 | let formatted_2 = inner_1.as_str();
|
122 + | /* HttpBindingGenerator.kt:706 */
|
90 123 | let header_value = formatted_2;
|
91 124 | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
92 125 | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
93 126 | "passcode",
|
94 127 | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
95 128 | )
|
96 129 | })?;
|
97 130 | builder = builder.header("passcode", header_value);
|
131 + | /* HttpBindingGenerator.kt:592 */
|
98 132 | }
|
133 + | /* HttpBindingGenerator.kt:555 */
|
99 134 | Ok(builder)
|
135 + | /* HttpBindingGenerator.kt:542 */
|
100 136 | }
|
101 137 |
|
138 + | /* JsonParserGenerator.kt:148 */
|
102 139 | pub(crate) fn de_get_storage(
|
103 140 | value: &[u8],
|
104 141 | mut builder: crate::operation::get_storage::builders::GetStorageOutputBuilder,
|
105 142 | ) -> ::std::result::Result<crate::operation::get_storage::builders::GetStorageOutputBuilder, ::aws_smithy_json::deserialize::error::DeserializeError>
|
106 143 | {
|
144 + | /* JsonParserGenerator.kt:153 */
|
107 145 | let mut tokens_owned = ::aws_smithy_json::deserialize::json_token_iter(crate::protocol_serde::or_empty_doc(value)).peekable();
|
108 146 | let tokens = &mut tokens_owned;
|
109 147 | ::aws_smithy_json::deserialize::token::expect_start_object(tokens.next())?;
|
148 + | /* JsonParserGenerator.kt:684 */
|
110 149 | loop {
|
150 + | /* JsonParserGenerator.kt:685 */
|
111 151 | match tokens.next().transpose()? {
|
112 - | Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
113 - | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => match key.to_unescaped()?.as_ref() {
|
152 + | /* JsonParserGenerator.kt:686 */ Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
|
153 + | Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
|
154 + | /* JsonParserGenerator.kt:260 */
|
155 + | match key.to_unescaped()?.as_ref() {
|
156 + | /* JsonParserGenerator.kt:262 */
|
114 157 | "collection" => {
|
115 - | builder = builder.set_collection(crate::protocol_serde::shape_species_collection::de_species_collection(tokens)?);
|
158 + | /* JsonParserGenerator.kt:265 */
|
159 + | builder = builder.set_collection(
|
160 + | /* JsonParserGenerator.kt:451 */
|
161 + | crate::protocol_serde::shape_species_collection::de_species_collection(tokens)?, /* JsonParserGenerator.kt:265 */
|
162 + | );
|
163 + | /* JsonParserGenerator.kt:262 */
|
164 + | }
|
165 + | /* JsonParserGenerator.kt:290 */
|
166 + | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?, /* JsonParserGenerator.kt:260 */
|
116 167 | }
|
117 - | _ => ::aws_smithy_json::deserialize::token::skip_value(tokens)?,
|
118 - | },
|
168 + | /* JsonParserGenerator.kt:686 */
|
169 + | }
|
170 + | /* JsonParserGenerator.kt:695 */
|
119 171 | other => {
|
120 172 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
|
121 173 | "expected object key or end object, found: {:?}",
|
122 174 | other
|
123 175 | )))
|
176 + | } /* JsonParserGenerator.kt:685 */
|
124 177 | }
|
178 + | /* JsonParserGenerator.kt:684 */
|
125 179 | }
|
126 - | }
|
180 + | /* JsonParserGenerator.kt:250 */
|
127 181 | if tokens.next().is_some() {
|
182 + | /* JsonParserGenerator.kt:251 */
|
128 183 | return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
|
129 184 | "found more JSON tokens after completing parsing",
|
130 185 | ));
|
186 + | /* JsonParserGenerator.kt:250 */
|
131 187 | }
|
188 + | /* JsonParserGenerator.kt:163 */
|
132 189 | Ok(builder)
|
190 + | /* JsonParserGenerator.kt:148 */
|
133 191 | }
|