16 16 | Err(crate::operation::get_access_grants_instance::GetAccessGrantsInstanceError::generic(
|
17 17 | generic,
|
18 18 | ))
|
19 19 | }
|
20 20 |
|
21 21 | #[allow(clippy::unnecessary_wraps)]
|
22 22 | pub fn de_get_access_grants_instance_http_response(
|
23 23 | _response_status: u16,
|
24 24 | _response_headers: &::aws_smithy_runtime_api::http::Headers,
|
25 25 | _response_body: &[u8],
|
26 26 | ) -> std::result::Result<
|
27 27 | crate::operation::get_access_grants_instance::GetAccessGrantsInstanceOutput,
|
28 28 | crate::operation::get_access_grants_instance::GetAccessGrantsInstanceError,
|
29 29 | > {
|
30 30 | Ok({
|
31 31 | #[allow(unused_mut)]
|
32 32 | let mut output = crate::operation::get_access_grants_instance::builders::GetAccessGrantsInstanceOutputBuilder::default();
|
33 33 | output = crate::protocol_serde::shape_get_access_grants_instance::de_get_access_grants_instance(_response_body, output)
|
34 34 | .map_err(crate::operation::get_access_grants_instance::GetAccessGrantsInstanceError::unhandled)?;
|
35 35 | output._set_request_id(::aws_types::request_id::RequestId::request_id(_response_headers).map(str::to_string));
|
36 36 | output.build()
|
37 37 | })
|
38 38 | }
|
39 39 |
|
40 40 | pub fn ser_get_access_grants_instance_headers(
|
41 41 | input: &crate::operation::get_access_grants_instance::GetAccessGrantsInstanceInput,
|
42 42 | mut builder: ::http::request::Builder,
|
43 43 | ) -> std::result::Result<::http::request::Builder, ::aws_smithy_types::error::operation::BuildError> {
|
44 44 | if let ::std::option::Option::Some(inner_1) = &input.account_id {
|
45 45 | let formatted_2 = inner_1.as_str();
|
46 - | let header_value = formatted_2;
|
47 - | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
48 - | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
49 - | "account_id",
|
50 - | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
51 - | )
|
52 - | })?;
|
53 - | builder = builder.header("x-amz-account-id", header_value);
|
46 + | if !formatted_2.is_empty() {
|
47 + | let header_value = formatted_2;
|
48 + | let header_value: ::http::HeaderValue = header_value.parse().map_err(|err| {
|
49 + | ::aws_smithy_types::error::operation::BuildError::invalid_field(
|
50 + | "account_id",
|
51 + | format!("`{}` cannot be used as a header value: {}", &header_value, err),
|
52 + | )
|
53 + | })?;
|
54 + | builder = builder.header("x-amz-account-id", header_value);
|
55 + | }
|
54 56 | }
|
55 57 | Ok(builder)
|
56 58 | }
|
57 59 |
|
58 60 | #[allow(unused_mut)]
|
59 61 | pub fn de_get_access_grants_instance(
|
60 62 | inp: &[u8],
|
61 63 | mut builder: crate::operation::get_access_grants_instance::builders::GetAccessGrantsInstanceOutputBuilder,
|
62 64 | ) -> Result<crate::operation::get_access_grants_instance::builders::GetAccessGrantsInstanceOutputBuilder, ::aws_smithy_xml::decode::XmlDecodeError> {
|
63 65 | let mut doc = ::aws_smithy_xml::decode::Document::try_from(inp)?;
|
64 66 |
|
65 67 | #[allow(unused_mut)]
|
66 68 | let mut decoder = doc.root_element()?;
|
67 69 | #[allow(unused_variables)]
|
68 70 | let start_el = decoder.start_el();
|
69 71 | if !start_el.matches("GetAccessGrantsInstanceResult") {
|
70 72 | return Err(::aws_smithy_xml::decode::XmlDecodeError::custom(format!(
|
71 73 | "encountered invalid XML root: expected GetAccessGrantsInstanceResult but got {:?}. This is likely a bug in the SDK.",
|
72 74 | start_el
|
73 75 | )));
|
74 76 | }
|
75 77 | while let Some(mut tag) = decoder.next_tag() {
|
76 78 | match tag.start_el() {
|
77 79 | s if s.matches("AccessGrantsInstanceArn") /* AccessGrantsInstanceArn com.amazonaws.s3control.synthetic#GetAccessGrantsInstanceOutput$AccessGrantsInstanceArn */ => {
|
78 80 | let var_3 =
|
79 81 | Some(
|
80 82 | Result::<::std::string::String, ::aws_smithy_xml::decode::XmlDecodeError>::Ok(
|
81 83 | ::aws_smithy_xml::decode::try_data(&mut tag)?.as_ref()
|
82 84 | .into()
|
83 85 | )
|