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