41 41 | }
|
42 42 | static ATTRIBUTESUMMARY_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
43 43 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.ec2#AttributeSummary", "com.amazonaws.ec2", "AttributeSummary");
|
44 44 | static ATTRIBUTESUMMARY_MEMBER_ATTRIBUTE_NAME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
45 45 | ::aws_smithy_schema::ShapeId::from_static(
|
46 46 | "com.amazonaws.ec2#AttributeSummary$AttributeName",
|
47 47 | "com.amazonaws.ec2",
|
48 48 | "AttributeSummary",
|
49 49 | ),
|
50 50 | ::aws_smithy_schema::ShapeType::String,
|
51 - | "attribute_name",
|
51 + | "AttributeName",
|
52 52 | 0,
|
53 53 | )
|
54 54 | .with_xml_name("attributeName");
|
55 55 | static ATTRIBUTESUMMARY_MEMBER_MOST_FREQUENT_VALUE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
56 56 | ::aws_smithy_schema::ShapeId::from_static(
|
57 57 | "com.amazonaws.ec2#AttributeSummary$MostFrequentValue",
|
58 58 | "com.amazonaws.ec2",
|
59 59 | "AttributeSummary",
|
60 60 | ),
|
61 61 | ::aws_smithy_schema::ShapeType::String,
|
62 - | "most_frequent_value",
|
62 + | "MostFrequentValue",
|
63 63 | 1,
|
64 64 | )
|
65 65 | .with_xml_name("mostFrequentValue");
|
66 66 | static ATTRIBUTESUMMARY_MEMBER_NUMBER_OF_MATCHED_ACCOUNTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
67 67 | ::aws_smithy_schema::ShapeId::from_static(
|
68 68 | "com.amazonaws.ec2#AttributeSummary$NumberOfMatchedAccounts",
|
69 69 | "com.amazonaws.ec2",
|
70 70 | "AttributeSummary",
|
71 71 | ),
|
72 72 | ::aws_smithy_schema::ShapeType::Integer,
|
73 - | "number_of_matched_accounts",
|
73 + | "NumberOfMatchedAccounts",
|
74 74 | 2,
|
75 75 | )
|
76 76 | .with_xml_name("numberOfMatchedAccounts");
|
77 77 | static ATTRIBUTESUMMARY_MEMBER_NUMBER_OF_UNMATCHED_ACCOUNTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
78 78 | ::aws_smithy_schema::ShapeId::from_static(
|
79 79 | "com.amazonaws.ec2#AttributeSummary$NumberOfUnmatchedAccounts",
|
80 80 | "com.amazonaws.ec2",
|
81 81 | "AttributeSummary",
|
82 82 | ),
|
83 83 | ::aws_smithy_schema::ShapeType::Integer,
|
84 - | "number_of_unmatched_accounts",
|
84 + | "NumberOfUnmatchedAccounts",
|
85 85 | 3,
|
86 86 | )
|
87 87 | .with_xml_name("numberOfUnmatchedAccounts");
|
88 88 | static ATTRIBUTESUMMARY_MEMBER_REGIONAL_SUMMARIES: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
89 89 | ::aws_smithy_schema::ShapeId::from_static(
|
90 90 | "com.amazonaws.ec2#AttributeSummary$RegionalSummaries",
|
91 91 | "com.amazonaws.ec2",
|
92 92 | "AttributeSummary",
|
93 93 | ),
|
94 94 | ::aws_smithy_schema::ShapeType::List,
|
95 - | "regional_summaries",
|
95 + | "RegionalSummaries",
|
96 96 | 4,
|
97 97 | )
|
98 98 | .with_xml_name("regionalSummarySet");
|
99 99 | static ATTRIBUTESUMMARY_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
100 100 | ATTRIBUTESUMMARY_SCHEMA_ID,
|
101 101 | ::aws_smithy_schema::ShapeType::Structure,
|
102 102 | &[
|
103 103 | &ATTRIBUTESUMMARY_MEMBER_ATTRIBUTE_NAME,
|
104 104 | &ATTRIBUTESUMMARY_MEMBER_MOST_FREQUENT_VALUE,
|
105 105 | &ATTRIBUTESUMMARY_MEMBER_NUMBER_OF_MATCHED_ACCOUNTS,
|
106 106 | &ATTRIBUTESUMMARY_MEMBER_NUMBER_OF_UNMATCHED_ACCOUNTS,
|
107 107 | &ATTRIBUTESUMMARY_MEMBER_REGIONAL_SUMMARIES,
|
108 108 | ],
|
109 109 | );
|
110 110 | impl AttributeSummary {
|
111 111 | /// The schema for this shape.
|
112 112 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &ATTRIBUTESUMMARY_SCHEMA;
|
113 113 | }
|
114 114 | impl ::aws_smithy_schema::serde::SerializableStruct for AttributeSummary {
|
115 115 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
116 116 | fn serialize_members(
|
117 117 | &self,
|
118 118 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
119 119 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
120 120 | if let Some(ref val) = self.attribute_name {
|
121 121 | ser.write_string(&ATTRIBUTESUMMARY_MEMBER_ATTRIBUTE_NAME, val)?;
|
122 122 | }
|
123 123 | if let Some(ref val) = self.most_frequent_value {
|
124 124 | ser.write_string(&ATTRIBUTESUMMARY_MEMBER_MOST_FREQUENT_VALUE, val)?;
|
125 125 | }
|
126 126 | if let Some(ref val) = self.number_of_matched_accounts {
|
127 127 | ser.write_integer(&ATTRIBUTESUMMARY_MEMBER_NUMBER_OF_MATCHED_ACCOUNTS, *val)?;
|
128 128 | }
|
129 129 | if let Some(ref val) = self.number_of_unmatched_accounts {
|
130 130 | ser.write_integer(&ATTRIBUTESUMMARY_MEMBER_NUMBER_OF_UNMATCHED_ACCOUNTS, *val)?;
|
131 131 | }
|
132 132 | if let Some(ref val) = self.regional_summaries {
|
133 133 | ser.write_list(
|
134 134 | &ATTRIBUTESUMMARY_MEMBER_REGIONAL_SUMMARIES,
|
135 135 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
136 136 | for item in val {
|
137 137 | ser.write_struct(crate::types::RegionalSummary::SCHEMA, item)?;
|
138 138 | }
|
139 139 | Ok(())
|
140 140 | },
|
141 141 | )?;
|
142 142 | }
|
143 143 | Ok(())
|
144 144 | }
|
145 145 | }
|
146 146 | impl AttributeSummary {
|
147 147 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
148 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
149 - | deserializer: &mut D,
|
148 + | pub fn deserialize(
|
149 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
150 150 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
151 151 | #[allow(unused_variables, unused_mut)]
|
152 152 | let mut builder = Self::builder();
|
153 153 | #[allow(
|
154 154 | unused_variables,
|
155 155 | unreachable_code,
|
156 156 | clippy::single_match,
|
157 157 | clippy::match_single_binding,
|
158 158 | clippy::diverging_sub_expression
|
159 159 | )]
|
160 - | deserializer.read_struct(&ATTRIBUTESUMMARY_SCHEMA, (), |_, member, deser| {
|
160 + | deserializer.read_struct(&ATTRIBUTESUMMARY_SCHEMA, &mut |member, deser| {
|
161 161 | match member.member_index() {
|
162 162 | Some(0) => {
|
163 163 | builder.attribute_name = Some(deser.read_string(member)?);
|
164 164 | }
|
165 165 | Some(1) => {
|
166 166 | builder.most_frequent_value = Some(deser.read_string(member)?);
|
167 167 | }
|
168 168 | Some(2) => {
|
169 169 | builder.number_of_matched_accounts = Some(deser.read_integer(member)?);
|
170 170 | }
|
171 171 | Some(3) => {
|
172 172 | builder.number_of_unmatched_accounts = Some(deser.read_integer(member)?);
|
173 173 | }
|
174 174 | Some(4) => {
|
175 175 | builder.regional_summaries = Some({
|
176 - | let container = if let Some(cap) = deser.container_size() {
|
177 - | Vec::with_capacity(cap)
|
178 - | } else {
|
179 - | Vec::new()
|
180 - | };
|
181 - | deser.read_list(member, container, |mut list, deser| {
|
182 - | list.push(crate::types::RegionalSummary::deserialize(deser)?);
|
183 - | Ok(list)
|
184 - | })?
|
176 + | let mut container = Vec::new();
|
177 + | deser.read_list(member, &mut |deser| {
|
178 + | container.push(crate::types::RegionalSummary::deserialize(deser)?);
|
179 + | Ok(())
|
180 + | })?;
|
181 + | container
|
185 182 | });
|
186 183 | }
|
187 184 | _ => {}
|
188 185 | }
|
189 186 | Ok(())
|
190 187 | })?;
|
191 188 | Ok(builder.build())
|
192 189 | }
|
193 190 | }
|
191 + | impl AttributeSummary {
|
192 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
193 + | pub fn deserialize_with_response(
|
194 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
195 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
196 + | _status: u16,
|
197 + | _body: &[u8],
|
198 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
199 + | Self::deserialize(deserializer)
|
200 + | }
|
201 + | }
|
194 202 | impl AttributeSummary {
|
195 203 | /// Creates a new builder-style object to manufacture [`AttributeSummary`](crate::types::AttributeSummary).
|
196 204 | pub fn builder() -> crate::types::builders::AttributeSummaryBuilder {
|
197 205 | crate::types::builders::AttributeSummaryBuilder::default()
|
198 206 | }
|
199 207 | }
|
200 208 |
|
201 209 | /// A builder for [`AttributeSummary`](crate::types::AttributeSummary).
|
202 210 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
203 211 | #[non_exhaustive]
|