61 61 | "com.amazonaws.s3control.synthetic",
|
62 62 | "PutBucketPolicyInput",
|
63 63 | );
|
64 64 | static PUTBUCKETPOLICYINPUT_MEMBER_ACCOUNT_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
65 65 | ::aws_smithy_schema::ShapeId::from_static(
|
66 66 | "com.amazonaws.s3control.synthetic#PutBucketPolicyInput$AccountId",
|
67 67 | "com.amazonaws.s3control.synthetic",
|
68 68 | "PutBucketPolicyInput",
|
69 69 | ),
|
70 70 | ::aws_smithy_schema::ShapeType::String,
|
71 - | "account_id",
|
71 + | "AccountId",
|
72 72 | 0,
|
73 73 | )
|
74 74 | .with_host_label()
|
75 75 | .with_http_header("x-amz-account-id");
|
76 76 | static PUTBUCKETPOLICYINPUT_MEMBER_BUCKET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
77 77 | ::aws_smithy_schema::ShapeId::from_static(
|
78 78 | "com.amazonaws.s3control.synthetic#PutBucketPolicyInput$Bucket",
|
79 79 | "com.amazonaws.s3control.synthetic",
|
80 80 | "PutBucketPolicyInput",
|
81 81 | ),
|
82 82 | ::aws_smithy_schema::ShapeType::String,
|
83 - | "bucket",
|
83 + | "Bucket",
|
84 84 | 1,
|
85 85 | )
|
86 86 | .with_http_label();
|
87 87 | static PUTBUCKETPOLICYINPUT_MEMBER_CONFIRM_REMOVE_SELF_BUCKET_ACCESS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
88 88 | ::aws_smithy_schema::ShapeId::from_static(
|
89 89 | "com.amazonaws.s3control.synthetic#PutBucketPolicyInput$ConfirmRemoveSelfBucketAccess",
|
90 90 | "com.amazonaws.s3control.synthetic",
|
91 91 | "PutBucketPolicyInput",
|
92 92 | ),
|
93 93 | ::aws_smithy_schema::ShapeType::Boolean,
|
94 - | "confirm_remove_self_bucket_access",
|
94 + | "ConfirmRemoveSelfBucketAccess",
|
95 95 | 2,
|
96 96 | )
|
97 97 | .with_http_header("x-amz-confirm-remove-self-bucket-access");
|
98 98 | static PUTBUCKETPOLICYINPUT_MEMBER_POLICY: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
99 99 | ::aws_smithy_schema::ShapeId::from_static(
|
100 100 | "com.amazonaws.s3control.synthetic#PutBucketPolicyInput$Policy",
|
101 101 | "com.amazonaws.s3control.synthetic",
|
102 102 | "PutBucketPolicyInput",
|
103 103 | ),
|
104 104 | ::aws_smithy_schema::ShapeType::String,
|
105 - | "policy",
|
105 + | "Policy",
|
106 106 | 3,
|
107 107 | );
|
108 108 | static PUTBUCKETPOLICYINPUT_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
109 109 | PUTBUCKETPOLICYINPUT_SCHEMA_ID,
|
110 110 | ::aws_smithy_schema::ShapeType::Structure,
|
111 111 | &[
|
112 112 | &PUTBUCKETPOLICYINPUT_MEMBER_ACCOUNT_ID,
|
113 113 | &PUTBUCKETPOLICYINPUT_MEMBER_BUCKET,
|
114 114 | &PUTBUCKETPOLICYINPUT_MEMBER_CONFIRM_REMOVE_SELF_BUCKET_ACCESS,
|
115 115 | &PUTBUCKETPOLICYINPUT_MEMBER_POLICY,
|
116 116 | ],
|
117 - | );
|
117 + | )
|
118 + | .with_http(aws_smithy_schema::traits::HttpTrait::new(
|
119 + | "PUT",
|
120 + | "/v20180820/bucket/{Bucket}/policy",
|
121 + | None,
|
122 + | ));
|
118 123 | impl PutBucketPolicyInput {
|
119 124 | /// The schema for this shape.
|
120 125 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &PUTBUCKETPOLICYINPUT_SCHEMA;
|
121 126 | }
|
122 127 | impl ::aws_smithy_schema::serde::SerializableStruct for PutBucketPolicyInput {
|
123 128 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
124 129 | fn serialize_members(
|
125 130 | &self,
|
126 131 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
127 132 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
128 133 | if let Some(ref val) = self.account_id {
|
129 134 | ser.write_string(&PUTBUCKETPOLICYINPUT_MEMBER_ACCOUNT_ID, val)?;
|
130 135 | }
|
131 136 | if let Some(ref val) = self.bucket {
|
132 137 | ser.write_string(&PUTBUCKETPOLICYINPUT_MEMBER_BUCKET, val)?;
|
133 138 | }
|
134 139 | if let Some(ref val) = self.confirm_remove_self_bucket_access {
|
135 140 | ser.write_boolean(&PUTBUCKETPOLICYINPUT_MEMBER_CONFIRM_REMOVE_SELF_BUCKET_ACCESS, *val)?;
|
136 141 | }
|
137 142 | if let Some(ref val) = self.policy {
|
138 143 | ser.write_string(&PUTBUCKETPOLICYINPUT_MEMBER_POLICY, val)?;
|
139 144 | }
|
140 145 | Ok(())
|
141 146 | }
|
142 147 | }
|
143 148 | impl PutBucketPolicyInput {
|
144 149 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
145 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
146 - | deserializer: &mut D,
|
150 + | pub fn deserialize(
|
151 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
147 152 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
148 153 | #[allow(unused_variables, unused_mut)]
|
149 154 | let mut builder = Self::builder();
|
150 155 | #[allow(
|
151 156 | unused_variables,
|
152 157 | unreachable_code,
|
153 158 | clippy::single_match,
|
154 159 | clippy::match_single_binding,
|
155 160 | clippy::diverging_sub_expression
|
156 161 | )]
|
157 - | deserializer.read_struct(&PUTBUCKETPOLICYINPUT_SCHEMA, (), |_, member, deser| {
|
162 + | deserializer.read_struct(&PUTBUCKETPOLICYINPUT_SCHEMA, &mut |member, deser| {
|
158 163 | match member.member_index() {
|
159 164 | Some(0) => {
|
160 165 | builder.account_id = Some(deser.read_string(member)?);
|
161 166 | }
|
162 167 | Some(1) => {
|
163 168 | builder.bucket = Some(deser.read_string(member)?);
|
164 169 | }
|
165 170 | Some(2) => {
|
166 171 | builder.confirm_remove_self_bucket_access = Some(deser.read_boolean(member)?);
|
167 172 | }
|
168 173 | Some(3) => {
|
169 174 | builder.policy = Some(deser.read_string(member)?);
|
170 175 | }
|
171 176 | _ => {}
|
172 177 | }
|
173 178 | Ok(())
|
174 179 | })?;
|
180 + | builder.account_id = builder.account_id.or(Some(String::new()));
|
181 + | builder.bucket = builder.bucket.or(Some(String::new()));
|
182 + | builder.policy = builder.policy.or(Some(String::new()));
|
183 + | builder
|
184 + | .build()
|
185 + | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
186 + | }
|
187 + | }
|
188 + | impl PutBucketPolicyInput {
|
189 + | /// Deserializes this structure from a body deserializer and HTTP response headers.
|
190 + | /// Header-bound members are read directly from headers, avoiding runtime
|
191 + | /// member iteration overhead. Body members are read via the deserializer.
|
192 + | pub fn deserialize_with_response(
|
193 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
194 + | headers: &::aws_smithy_runtime_api::http::Headers,
|
195 + | _status: u16,
|
196 + | _body: &[u8],
|
197 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
198 + | #[allow(unused_variables, unused_mut)]
|
199 + | let mut builder = Self::builder();
|
200 + | if let Some(val) = headers.get("x-amz-account-id") {
|
201 + | builder.account_id = Some(val.to_string());
|
202 + | }
|
203 + | if let Some(val) = headers.get("x-amz-confirm-remove-self-bucket-access") {
|
204 + | builder.confirm_remove_self_bucket_access = val.parse::<bool>().ok();
|
205 + | }
|
206 + | #[allow(
|
207 + | unused_variables,
|
208 + | unreachable_code,
|
209 + | clippy::single_match,
|
210 + | clippy::match_single_binding,
|
211 + | clippy::diverging_sub_expression
|
212 + | )]
|
213 + | deserializer.read_struct(&PUTBUCKETPOLICYINPUT_SCHEMA, &mut |member, deser| {
|
214 + | match member.member_index() {
|
215 + | Some(0) => { /* read from headers above */ }
|
216 + | Some(1) => {
|
217 + | builder.bucket = Some(deser.read_string(member)?);
|
218 + | }
|
219 + | Some(2) => { /* read from headers above */ }
|
220 + | Some(3) => {
|
221 + | builder.policy = Some(deser.read_string(member)?);
|
222 + | }
|
223 + | _ => {}
|
224 + | }
|
225 + | Ok(())
|
226 + | })?;
|
175 227 | builder
|
176 228 | .build()
|
177 229 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
178 230 | }
|
179 231 | }
|
180 232 | impl PutBucketPolicyInput {
|
181 233 | /// Creates a new builder-style object to manufacture [`PutBucketPolicyInput`](crate::operation::put_bucket_policy::PutBucketPolicyInput).
|
182 234 | pub fn builder() -> crate::operation::put_bucket_policy::builders::PutBucketPolicyInputBuilder {
|
183 235 | crate::operation::put_bucket_policy::builders::PutBucketPolicyInputBuilder::default()
|
184 236 | }
|