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