25 25 | );
|
26 26 | static HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_FOO: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
27 27 | ::aws_smithy_schema::ShapeId::from_static(
|
28 28 | "aws.protocoltests.restxml.synthetic#HttpPayloadTraitsWithMediaTypeInput$foo",
|
29 29 | "aws.protocoltests.restxml.synthetic",
|
30 30 | "HttpPayloadTraitsWithMediaTypeInput",
|
31 31 | ),
|
32 32 | ::aws_smithy_schema::ShapeType::String,
|
33 33 | "foo",
|
34 34 | 0,
|
35 35 | )
|
36 36 | .with_http_header("X-Foo");
|
37 37 | static HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_BLOB: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
38 38 | ::aws_smithy_schema::ShapeId::from_static(
|
39 39 | "aws.protocoltests.restxml.synthetic#HttpPayloadTraitsWithMediaTypeInput$blob",
|
40 40 | "aws.protocoltests.restxml.synthetic",
|
41 41 | "HttpPayloadTraitsWithMediaTypeInput",
|
42 42 | ),
|
43 43 | ::aws_smithy_schema::ShapeType::Blob,
|
44 44 | "blob",
|
45 45 | 1,
|
46 46 | )
|
47 47 | .with_http_payload();
|
48 48 | static HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
49 49 | HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA_ID,
|
50 50 | ::aws_smithy_schema::ShapeType::Structure,
|
51 51 | &[
|
52 52 | &HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_FOO,
|
53 53 | &HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_BLOB,
|
54 54 | ],
|
55 - | );
|
55 + | )
|
56 + | .with_http(aws_smithy_schema::traits::HttpTrait::new("POST", "/HttpPayloadTraitsWithMediaType", None));
|
56 57 | impl HttpPayloadTraitsWithMediaTypeInput {
|
57 58 | /// The schema for this shape.
|
58 59 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA;
|
59 60 | }
|
60 61 | impl ::aws_smithy_schema::serde::SerializableStruct for HttpPayloadTraitsWithMediaTypeInput {
|
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.foo {
|
67 68 | ser.write_string(&HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_FOO, val)?;
|
68 69 | }
|
69 70 | if let Some(ref val) = self.blob {
|
70 71 | ser.write_blob(&HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_MEMBER_BLOB, val)?;
|
71 72 | }
|
72 73 | Ok(())
|
73 74 | }
|
74 75 | }
|
75 76 | impl HttpPayloadTraitsWithMediaTypeInput {
|
76 77 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
77 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
78 - | deserializer: &mut D,
|
78 + | pub fn deserialize(
|
79 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
79 80 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
80 81 | #[allow(unused_variables, unused_mut)]
|
81 82 | let mut builder = Self::builder();
|
82 83 | #[allow(
|
83 84 | unused_variables,
|
84 85 | unreachable_code,
|
85 86 | clippy::single_match,
|
86 87 | clippy::match_single_binding,
|
87 88 | clippy::diverging_sub_expression
|
88 89 | )]
|
89 - | deserializer.read_struct(&HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA, (), |_, member, deser| {
|
90 + | deserializer.read_struct(&HTTPPAYLOADTRAITSWITHMEDIATYPEINPUT_SCHEMA, &mut |member, deser| {
|
90 91 | match member.member_index() {
|
91 92 | Some(0) => {
|
92 93 | builder.foo = Some(deser.read_string(member)?);
|
93 94 | }
|
94 95 | Some(1) => {
|
95 96 | builder.blob = Some(deser.read_blob(member)?);
|
96 97 | }
|
97 98 | _ => {}
|
98 99 | }
|
99 100 | Ok(())
|
100 101 | })?;
|
101 102 | builder
|
102 103 | .build()
|
103 104 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
104 105 | }
|
105 106 | }
|
107 + | impl HttpPayloadTraitsWithMediaTypeInput {
|
108 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
109 + | /// Header-bound members are read directly from headers, avoiding runtime
|
110 + | /// member iteration overhead. Body members are read via the deserializer.
|
111 + | pub fn deserialize_with_response(
|
112 + | _deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
113 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
114 + | _status: u16,
|
115 + | body: &[u8],
|
116 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
117 + | #[allow(unused_variables, unused_mut)]
|
118 + | let mut builder = Self::builder();
|
119 + | if let Some(val) = headers.get("X-Foo") {
|
120 + | builder.foo = Some(val.to_string());
|
121 + | }
|
122 + | if !body.is_empty() {
|
123 + | builder.blob = Some(::aws_smithy_types::Blob::new(body.to_vec()));
|
124 + | }
|
125 + | builder
|
126 + | .build()
|
127 + | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
128 + | }
|
129 + | }
|
106 130 | impl HttpPayloadTraitsWithMediaTypeInput {
|
107 131 | /// Creates a new builder-style object to manufacture [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
|
108 132 | pub fn builder() -> crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder {
|
109 133 | crate::operation::http_payload_traits_with_media_type::builders::HttpPayloadTraitsWithMediaTypeInputBuilder::default()
|
110 134 | }
|
111 135 | }
|
112 136 |
|
113 137 | /// A builder for [`HttpPayloadTraitsWithMediaTypeInput`](crate::operation::http_payload_traits_with_media_type::HttpPayloadTraitsWithMediaTypeInput).
|
114 138 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
115 139 | #[non_exhaustive]
|
116 140 | pub struct HttpPayloadTraitsWithMediaTypeInputBuilder {
|
117 141 | pub(crate) foo: ::std::option::Option<::std::string::String>,
|
118 142 | pub(crate) blob: ::std::option::Option<::aws_smithy_types::Blob>,
|
119 143 | }
|
120 144 | impl HttpPayloadTraitsWithMediaTypeInputBuilder {
|
121 145 | #[allow(missing_docs)] // documentation missing in model
|
122 146 | pub fn foo(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
|
123 147 | self.foo = ::std::option::Option::Some(input.into());
|
124 148 | self
|
125 149 | }
|
126 150 | #[allow(missing_docs)] // documentation missing in model
|
127 151 | pub fn set_foo(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
|
128 152 | self.foo = input;
|
129 153 | self
|
130 154 | }
|
131 155 | #[allow(missing_docs)] // documentation missing in model
|
132 156 | pub fn get_foo(&self) -> &::std::option::Option<::std::string::String> {
|
133 157 | &self.foo
|
134 158 | }
|
135 159 | #[allow(missing_docs)] // documentation missing in model
|