3 3 | pub fn de_create_scheduled_query_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<
|
8 8 | crate::operation::create_scheduled_query::CreateScheduledQueryOutput,
|
9 9 | crate::operation::create_scheduled_query::CreateScheduledQueryError,
|
10 10 | > {
|
11 11 | #[allow(unused_mut)]
|
12 12 | let mut generic_builder = crate::protocol_serde::parse_http_error_metadata(_response_status, _response_headers, _response_body)
|
13 13 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::unhandled)?;
|
14 14 | generic_builder = ::aws_types::request_id::apply_request_id(generic_builder, _response_headers);
|
15 15 | let generic = generic_builder.build();
|
16 16 | let error_code = match generic.code() {
|
17 17 | Some(code) => code,
|
18 18 | None => return Err(crate::operation::create_scheduled_query::CreateScheduledQueryError::unhandled(generic)),
|
19 19 | };
|
20 20 |
|
21 21 | let _error_message = generic.message().map(|msg| msg.to_owned());
|
22 22 | Err(match error_code {
|
23 23 | "AccessDeniedException" => crate::operation::create_scheduled_query::CreateScheduledQueryError::AccessDeniedException({
|
24 24 | #[allow(unused_mut)]
|
25 25 | let mut tmp = {
|
26 26 | #[allow(unused_mut)]
|
27 27 | let mut output = crate::types::error::builders::AccessDeniedExceptionBuilder::default();
|
28 28 | output = crate::protocol_serde::shape_access_denied_exception::de_access_denied_exception_json_err(_response_body, output)
|
29 29 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::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 | "ConflictException" => crate::operation::create_scheduled_query::CreateScheduledQueryError::ConflictException({
|
39 36 | #[allow(unused_mut)]
|
40 37 | let mut tmp = {
|
41 38 | #[allow(unused_mut)]
|
42 39 | let mut output = crate::types::error::builders::ConflictExceptionBuilder::default();
|
43 40 | output = crate::protocol_serde::shape_conflict_exception::de_conflict_exception_json_err(_response_body, output)
|
44 41 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::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 | "InternalServerException" => crate::operation::create_scheduled_query::CreateScheduledQueryError::InternalServerException({
|
54 48 | #[allow(unused_mut)]
|
55 49 | let mut tmp = {
|
56 50 | #[allow(unused_mut)]
|
57 51 | let mut output = crate::types::error::builders::InternalServerExceptionBuilder::default();
|
58 52 | output = crate::protocol_serde::shape_internal_server_exception::de_internal_server_exception_json_err(_response_body, output)
|
59 53 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::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 | "InvalidEndpointException" => crate::operation::create_scheduled_query::CreateScheduledQueryError::InvalidEndpointException({
|
69 60 | #[allow(unused_mut)]
|
70 61 | let mut tmp = {
|
71 62 | #[allow(unused_mut)]
|
72 63 | let mut output = crate::types::error::builders::InvalidEndpointExceptionBuilder::default();
|
73 64 | output = crate::protocol_serde::shape_invalid_endpoint_exception::de_invalid_endpoint_exception_json_err(_response_body, output)
|
74 65 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::unhandled)?;
|
75 66 | let output = output.meta(generic);
|
76 67 | output.build()
|
77 68 | };
|
78 - | if tmp.message.is_none() {
|
79 - | tmp.message = _error_message;
|
80 - | }
|
81 69 | tmp
|
82 70 | }),
|
83 71 | "ServiceQuotaExceededException" => crate::operation::create_scheduled_query::CreateScheduledQueryError::ServiceQuotaExceededException({
|
84 72 | #[allow(unused_mut)]
|
85 73 | let mut tmp = {
|
86 74 | #[allow(unused_mut)]
|
87 75 | let mut output = crate::types::error::builders::ServiceQuotaExceededExceptionBuilder::default();
|
88 76 | output = crate::protocol_serde::shape_service_quota_exceeded_exception::de_service_quota_exceeded_exception_json_err(
|
89 77 | _response_body,
|
90 78 | output,
|
91 79 | )
|
92 80 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::unhandled)?;
|
93 81 | let output = output.meta(generic);
|
94 82 | output.build()
|
95 83 | };
|
96 - | if tmp.message.is_none() {
|
97 - | tmp.message = _error_message;
|
98 - | }
|
99 84 | tmp
|
100 85 | }),
|
101 86 | "ThrottlingException" => crate::operation::create_scheduled_query::CreateScheduledQueryError::ThrottlingException({
|
102 87 | #[allow(unused_mut)]
|
103 88 | let mut tmp = {
|
104 89 | #[allow(unused_mut)]
|
105 90 | let mut output = crate::types::error::builders::ThrottlingExceptionBuilder::default();
|
106 91 | output = crate::protocol_serde::shape_throttling_exception::de_throttling_exception_json_err(_response_body, output)
|
107 92 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::unhandled)?;
|
108 93 | let output = output.meta(generic);
|
109 94 | output.build()
|
110 95 | };
|
111 - | if tmp.message.is_none() {
|
112 - | tmp.message = _error_message;
|
113 - | }
|
114 96 | tmp
|
115 97 | }),
|
116 98 | "ValidationException" => crate::operation::create_scheduled_query::CreateScheduledQueryError::ValidationException({
|
117 99 | #[allow(unused_mut)]
|
118 100 | let mut tmp = {
|
119 101 | #[allow(unused_mut)]
|
120 102 | let mut output = crate::types::error::builders::ValidationExceptionBuilder::default();
|
121 103 | output = crate::protocol_serde::shape_validation_exception::de_validation_exception_json_err(_response_body, output)
|
122 104 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::unhandled)?;
|
123 105 | let output = output.meta(generic);
|
124 106 | output.build()
|
125 107 | };
|
126 - | if tmp.message.is_none() {
|
127 - | tmp.message = _error_message;
|
128 - | }
|
129 108 | tmp
|
130 109 | }),
|
131 110 | _ => crate::operation::create_scheduled_query::CreateScheduledQueryError::generic(generic),
|
132 111 | })
|
133 112 | }
|
134 113 |
|
135 114 | #[allow(clippy::unnecessary_wraps)]
|
136 115 | pub fn de_create_scheduled_query_http_response(
|
137 116 | _response_status: u16,
|
138 117 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
139 118 | _response_body: &[u8],
|
140 119 | ) -> std::result::Result<
|
141 120 | crate::operation::create_scheduled_query::CreateScheduledQueryOutput,
|
142 121 | crate::operation::create_scheduled_query::CreateScheduledQueryError,
|
143 122 | > {
|
144 123 | Ok({
|
145 124 | #[allow(unused_mut)]
|
146 125 | let mut output = crate::operation::create_scheduled_query::builders::CreateScheduledQueryOutputBuilder::default();
|
147 126 | output = crate::protocol_serde::shape_create_scheduled_query::de_create_scheduled_query(_response_body, output)
|
148 127 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::unhandled)?;
|
149 128 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
150 129 | crate::serde_util::create_scheduled_query_output_output_correct_errors(output)
|
151 130 | .build()
|
152 131 | .map_err(crate::operation::create_scheduled_query::CreateScheduledQueryError::unhandled)?
|
153 132 | })
|
154 133 | }
|
155 134 |
|
156 135 | pub fn ser_create_scheduled_query_input(
|
157 136 | input: &crate::operation::create_scheduled_query::CreateScheduledQueryInput,
|
158 137 | ) -> ::std::result::Result<::aws_smithy_types::body::SdkBody, ::aws_smithy_types::error::operation::SerializationError> {
|