23 23 | "aws.protocoltests.restxml.synthetic",
|
24 24 | "HttpEmptyPrefixHeadersInput",
|
25 25 | );
|
26 26 | static HTTPEMPTYPREFIXHEADERSINPUT_MEMBER_PREFIX_HEADERS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
27 27 | ::aws_smithy_schema::ShapeId::from_static(
|
28 28 | "aws.protocoltests.restxml.synthetic#HttpEmptyPrefixHeadersInput$prefixHeaders",
|
29 29 | "aws.protocoltests.restxml.synthetic",
|
30 30 | "HttpEmptyPrefixHeadersInput",
|
31 31 | ),
|
32 32 | ::aws_smithy_schema::ShapeType::Map,
|
33 - | "prefix_headers",
|
33 + | "prefixHeaders",
|
34 34 | 0,
|
35 35 | )
|
36 36 | .with_http_prefix_headers("");
|
37 37 | static HTTPEMPTYPREFIXHEADERSINPUT_MEMBER_SPECIFIC_HEADER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
38 38 | ::aws_smithy_schema::ShapeId::from_static(
|
39 39 | "aws.protocoltests.restxml.synthetic#HttpEmptyPrefixHeadersInput$specificHeader",
|
40 40 | "aws.protocoltests.restxml.synthetic",
|
41 41 | "HttpEmptyPrefixHeadersInput",
|
42 42 | ),
|
43 43 | ::aws_smithy_schema::ShapeType::String,
|
44 - | "specific_header",
|
44 + | "specificHeader",
|
45 45 | 1,
|
46 46 | )
|
47 47 | .with_http_header("hello");
|
48 48 | static HTTPEMPTYPREFIXHEADERSINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
49 49 | HTTPEMPTYPREFIXHEADERSINPUT_SCHEMA_ID,
|
50 50 | ::aws_smithy_schema::ShapeType::Structure,
|
51 51 | &[
|
52 52 | &HTTPEMPTYPREFIXHEADERSINPUT_MEMBER_PREFIX_HEADERS,
|
53 53 | &HTTPEMPTYPREFIXHEADERSINPUT_MEMBER_SPECIFIC_HEADER,
|
54 54 | ],
|
55 - | );
|
55 + | )
|
56 + | .with_http(aws_smithy_schema::traits::HttpTrait::new("GET", "/HttpEmptyPrefixHeaders", None));
|
56 57 | impl HttpEmptyPrefixHeadersInput {
|
57 58 | /// The schema for this shape.
|
58 59 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPEMPTYPREFIXHEADERSINPUT_SCHEMA;
|
59 60 | }
|
60 61 | impl ::aws_smithy_schema::serde::SerializableStruct for HttpEmptyPrefixHeadersInput {
|
61 62 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
62 63 | fn serialize_members(
|
63 64 | &self,
|
64 65 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
65 66 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
66 67 | if let Some(ref val) = self.prefix_headers {
|
67 68 | ser.write_map(
|
68 69 | &HTTPEMPTYPREFIXHEADERSINPUT_MEMBER_PREFIX_HEADERS,
|
69 70 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
70 71 | for (key, value) in val {
|
71 72 | ser.write_string(&::aws_smithy_schema::prelude::STRING, key)?;
|
72 73 | ser.write_string(&::aws_smithy_schema::prelude::STRING, value)?;
|
73 74 | }
|
74 75 | Ok(())
|
75 76 | },
|
76 77 | )?;
|
77 78 | }
|
78 79 | if let Some(ref val) = self.specific_header {
|
79 80 | ser.write_string(&HTTPEMPTYPREFIXHEADERSINPUT_MEMBER_SPECIFIC_HEADER, val)?;
|
80 81 | }
|
81 82 | Ok(())
|
82 83 | }
|
83 84 | }
|
84 85 | impl HttpEmptyPrefixHeadersInput {
|
85 86 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
86 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
87 - | deserializer: &mut D,
|
87 + | pub fn deserialize(
|
88 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
88 89 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
89 90 | #[allow(unused_variables, unused_mut)]
|
90 91 | let mut builder = Self::builder();
|
91 92 | #[allow(
|
92 93 | unused_variables,
|
93 94 | unreachable_code,
|
94 95 | clippy::single_match,
|
95 96 | clippy::match_single_binding,
|
96 97 | clippy::diverging_sub_expression
|
97 98 | )]
|
98 - | deserializer.read_struct(&HTTPEMPTYPREFIXHEADERSINPUT_SCHEMA, (), |_, member, deser| {
|
99 + | deserializer.read_struct(&HTTPEMPTYPREFIXHEADERSINPUT_SCHEMA, &mut |member, deser| {
|
99 100 | match member.member_index() {
|
100 101 | Some(0) => {
|
101 - | builder.prefix_headers = Some({
|
102 - | let container = if let Some(cap) = deser.container_size() {
|
103 - | std::collections::HashMap::with_capacity(cap)
|
104 - | } else {
|
105 - | std::collections::HashMap::new()
|
106 - | };
|
107 - | deser.read_map(member, container, |mut map, key, deser| {
|
108 - | map.insert(key, deser.read_string(member)?);
|
109 - | Ok(map)
|
110 - | })?
|
111 - | });
|
102 + | builder.prefix_headers = Some(deser.read_string_string_map(member)?);
|
112 103 | }
|
113 104 | Some(1) => {
|
114 105 | builder.specific_header = Some(deser.read_string(member)?);
|
115 106 | }
|
116 107 | _ => {}
|
117 108 | }
|
118 109 | Ok(())
|
119 110 | })?;
|
120 111 | builder
|
121 112 | .build()
|
122 113 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
123 114 | }
|
124 115 | }
|
116 + | impl HttpEmptyPrefixHeadersInput {
|
117 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
118 + | /// Header-bound members are read directly from headers, avoiding runtime
|
119 + | /// member iteration overhead. Body members are read via the deserializer.
|
120 + | pub fn deserialize_with_response(
|
121 + | _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
122 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
123 + | _status: u16,
|
124 + | _body: &[u8],
|
125 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
126 + | #[allow(unused_variables, unused_mut)]
|
127 + | let mut builder = Self::builder();
|
128 + | if let Some(val) = headers.get("hello") {
|
129 + | builder.specific_header = Some(val.to_string());
|
130 + | }
|
131 + | {
|
132 + | let mut map = ::std::collections::HashMap::new();
|
133 + | for (key, val) in headers.iter() {
|
134 + | if let Some(suffix) = key.strip_prefix("") {
|
135 + | map.insert(suffix.to_string(), val.to_string());
|
136 + | }
|
137 + | }
|
138 + | if !map.is_empty() {
|
139 + | builder.prefix_headers = Some(map);
|
140 + | }
|
141 + | }
|
142 + | builder
|
143 + | .build()
|
144 + | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
145 + | }
|
146 + | }
|
125 147 | impl HttpEmptyPrefixHeadersInput {
|
126 148 | /// Creates a new builder-style object to manufacture [`HttpEmptyPrefixHeadersInput`](crate::operation::http_empty_prefix_headers::HttpEmptyPrefixHeadersInput).
|
127 149 | pub fn builder() -> crate::operation::http_empty_prefix_headers::builders::HttpEmptyPrefixHeadersInputBuilder {
|
128 150 | crate::operation::http_empty_prefix_headers::builders::HttpEmptyPrefixHeadersInputBuilder::default()
|
129 151 | }
|
130 152 | }
|
131 153 |
|
132 154 | /// A builder for [`HttpEmptyPrefixHeadersInput`](crate::operation::http_empty_prefix_headers::HttpEmptyPrefixHeadersInput).
|
133 155 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
134 156 | #[non_exhaustive]
|