28 28 | "com.amazonaws.ec2.synthetic",
|
29 29 | "ReleaseHostsOutput",
|
30 30 | );
|
31 31 | static RELEASEHOSTSOUTPUT_MEMBER_SUCCESSFUL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
32 32 | ::aws_smithy_schema::ShapeId::from_static(
|
33 33 | "com.amazonaws.ec2.synthetic#ReleaseHostsOutput$Successful",
|
34 34 | "com.amazonaws.ec2.synthetic",
|
35 35 | "ReleaseHostsOutput",
|
36 36 | ),
|
37 37 | ::aws_smithy_schema::ShapeType::List,
|
38 - | "successful",
|
38 + | "Successful",
|
39 39 | 0,
|
40 40 | )
|
41 41 | .with_xml_name("successful");
|
42 42 | static RELEASEHOSTSOUTPUT_MEMBER_UNSUCCESSFUL: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
43 43 | ::aws_smithy_schema::ShapeId::from_static(
|
44 44 | "com.amazonaws.ec2.synthetic#ReleaseHostsOutput$Unsuccessful",
|
45 45 | "com.amazonaws.ec2.synthetic",
|
46 46 | "ReleaseHostsOutput",
|
47 47 | ),
|
48 48 | ::aws_smithy_schema::ShapeType::List,
|
49 - | "unsuccessful",
|
49 + | "Unsuccessful",
|
50 50 | 1,
|
51 51 | )
|
52 52 | .with_xml_name("unsuccessful");
|
53 + | static RELEASEHOSTSOUTPUT_MEMBER__REQUEST_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
54 + | ::aws_smithy_schema::ShapeId::from_static("synthetic#request_id", "synthetic", "request_id"),
|
55 + | ::aws_smithy_schema::ShapeType::String,
|
56 + | "request_id",
|
57 + | 2,
|
58 + | )
|
59 + | .with_http_header("x-amzn-requestid");
|
53 60 | static RELEASEHOSTSOUTPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
54 61 | RELEASEHOSTSOUTPUT_SCHEMA_ID,
|
55 62 | ::aws_smithy_schema::ShapeType::Structure,
|
56 - | &[&RELEASEHOSTSOUTPUT_MEMBER_SUCCESSFUL, &RELEASEHOSTSOUTPUT_MEMBER_UNSUCCESSFUL],
|
63 + | &[
|
64 + | &RELEASEHOSTSOUTPUT_MEMBER_SUCCESSFUL,
|
65 + | &RELEASEHOSTSOUTPUT_MEMBER_UNSUCCESSFUL,
|
66 + | &RELEASEHOSTSOUTPUT_MEMBER__REQUEST_ID,
|
67 + | ],
|
57 68 | );
|
58 69 | impl ReleaseHostsOutput {
|
59 70 | /// The schema for this shape.
|
60 71 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &RELEASEHOSTSOUTPUT_SCHEMA;
|
61 72 | }
|
62 73 | impl ::aws_smithy_schema::serde::SerializableStruct for ReleaseHostsOutput {
|
63 74 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
64 75 | fn serialize_members(
|
65 76 | &self,
|
66 77 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
67 78 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
68 79 | if let Some(ref val) = self.successful {
|
69 80 | ser.write_list(
|
70 81 | &RELEASEHOSTSOUTPUT_MEMBER_SUCCESSFUL,
|
71 82 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
72 83 | for item in val {
|
73 84 | ser.write_string(&aws_smithy_schema::prelude::STRING, item)?;
|
74 85 | }
|
75 86 | Ok(())
|
76 87 | },
|
77 88 | )?;
|
78 89 | }
|
79 90 | if let Some(ref val) = self.unsuccessful {
|
80 91 | ser.write_list(
|
81 92 | &RELEASEHOSTSOUTPUT_MEMBER_UNSUCCESSFUL,
|
82 93 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
83 94 | for item in val {
|
84 95 | ser.write_struct(crate::types::UnsuccessfulItem::SCHEMA, item)?;
|
85 96 | }
|
86 97 | Ok(())
|
87 98 | },
|
88 99 | )?;
|
89 100 | }
|
90 101 | Ok(())
|
91 102 | }
|
92 103 | }
|
93 104 | impl ReleaseHostsOutput {
|
94 105 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
95 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
96 - | deserializer: &mut D,
|
106 + | pub fn deserialize(
|
107 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
97 108 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
98 109 | #[allow(unused_variables, unused_mut)]
|
99 110 | let mut builder = Self::builder();
|
100 111 | #[allow(
|
101 112 | unused_variables,
|
102 113 | unreachable_code,
|
103 114 | clippy::single_match,
|
104 115 | clippy::match_single_binding,
|
105 116 | clippy::diverging_sub_expression
|
106 117 | )]
|
107 - | deserializer.read_struct(&RELEASEHOSTSOUTPUT_SCHEMA, (), |_, member, deser| {
|
118 + | deserializer.read_struct(&RELEASEHOSTSOUTPUT_SCHEMA, &mut |member, deser| {
|
108 119 | match member.member_index() {
|
109 120 | Some(0) => {
|
110 - | builder.successful = Some({
|
111 - | let container = if let Some(cap) = deser.container_size() {
|
112 - | Vec::with_capacity(cap)
|
113 - | } else {
|
114 - | Vec::new()
|
115 - | };
|
116 - | deser.read_list(member, container, |mut list, deser| {
|
117 - | list.push(deser.read_string(member)?);
|
118 - | Ok(list)
|
119 - | })?
|
121 + | builder.successful = Some(deser.read_string_list(member)?);
|
122 + | }
|
123 + | Some(1) => {
|
124 + | builder.unsuccessful = Some({
|
125 + | let mut container = Vec::new();
|
126 + | deser.read_list(member, &mut |deser| {
|
127 + | container.push(crate::types::UnsuccessfulItem::deserialize(deser)?);
|
128 + | Ok(())
|
129 + | })?;
|
130 + | container
|
120 131 | });
|
121 132 | }
|
133 + | Some(2) => {
|
134 + | builder._request_id = Some(deser.read_string(member)?);
|
135 + | }
|
136 + | _ => {}
|
137 + | }
|
138 + | Ok(())
|
139 + | })?;
|
140 + | Ok(builder.build())
|
141 + | }
|
142 + | }
|
143 + | impl ReleaseHostsOutput {
|
144 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
145 + | /// Header-bound members are read directly from headers, avoiding runtime
|
146 + | /// member iteration overhead. Body members are read via the deserializer.
|
147 + | pub fn deserialize_with_response(
|
148 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
149 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
150 + | _status: u16,
|
151 + | _body: &[u8],
|
152 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
153 + | #[allow(unused_variables, unused_mut)]
|
154 + | let mut builder = Self::builder();
|
155 + | if let Some(val) = headers.get("x-amzn-requestid") {
|
156 + | builder._request_id = Some(val.to_string());
|
157 + | }
|
158 + | #[allow(
|
159 + | unused_variables,
|
160 + | unreachable_code,
|
161 + | clippy::single_match,
|
162 + | clippy::match_single_binding,
|
163 + | clippy::diverging_sub_expression
|
164 + | )]
|
165 + | deserializer.read_struct(&RELEASEHOSTSOUTPUT_SCHEMA, &mut |member, deser| {
|
166 + | match member.member_index() {
|
167 + | Some(0) => {
|
168 + | builder.successful = Some(deser.read_string_list(member)?);
|
169 + | }
|
122 170 | Some(1) => {
|
123 171 | builder.unsuccessful = Some({
|
124 - | let container = if let Some(cap) = deser.container_size() {
|
125 - | Vec::with_capacity(cap)
|
126 - | } else {
|
127 - | Vec::new()
|
128 - | };
|
129 - | deser.read_list(member, container, |mut list, deser| {
|
130 - | list.push(crate::types::UnsuccessfulItem::deserialize(deser)?);
|
131 - | Ok(list)
|
132 - | })?
|
172 + | let mut container = Vec::new();
|
173 + | deser.read_list(member, &mut |deser| {
|
174 + | container.push(crate::types::UnsuccessfulItem::deserialize(deser)?);
|
175 + | Ok(())
|
176 + | })?;
|
177 + | container
|
133 178 | });
|
134 179 | }
|
135 180 | _ => {}
|
136 181 | }
|
137 182 | Ok(())
|
138 183 | })?;
|
139 184 | Ok(builder.build())
|
140 185 | }
|
141 186 | }
|
142 187 | impl ::aws_types::request_id::RequestId for ReleaseHostsOutput {
|