4 4 | #[non_exhaustive]
|
5 5 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
|
6 6 | pub struct VersioningConfiguration {
|
7 7 | /// <p>Specifies whether MFA delete is enabled or disabled in the bucket versioning configuration for the S3 on Outposts bucket.</p>
|
8 8 | pub mfa_delete: ::std::option::Option<crate::types::MfaDelete>,
|
9 9 | /// <p>Sets the versioning state of the S3 on Outposts bucket.</p>
|
10 10 | pub status: ::std::option::Option<crate::types::BucketVersioningStatus>,
|
11 11 | }
|
12 12 | impl VersioningConfiguration {
|
13 13 | /// <p>Specifies whether MFA delete is enabled or disabled in the bucket versioning configuration for the S3 on Outposts bucket.</p>
|
14 14 | pub fn mfa_delete(&self) -> ::std::option::Option<&crate::types::MfaDelete> {
|
15 15 | self.mfa_delete.as_ref()
|
16 16 | }
|
17 17 | /// <p>Sets the versioning state of the S3 on Outposts bucket.</p>
|
18 18 | pub fn status(&self) -> ::std::option::Option<&crate::types::BucketVersioningStatus> {
|
19 19 | self.status.as_ref()
|
20 20 | }
|
21 21 | }
|
22 22 | static VERSIONINGCONFIGURATION_SCHEMA_ID: ::aws_smithy_schema::ShapeId = ::aws_smithy_schema::ShapeId::from_static(
|
23 23 | "com.amazonaws.s3control#VersioningConfiguration",
|
24 24 | "com.amazonaws.s3control",
|
25 25 | "VersioningConfiguration",
|
26 26 | );
|
27 27 | static VERSIONINGCONFIGURATION_MEMBER_MFA_DELETE: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
28 28 | ::aws_smithy_schema::ShapeId::from_static(
|
29 29 | "com.amazonaws.s3control#VersioningConfiguration$MFADelete",
|
30 30 | "com.amazonaws.s3control",
|
31 31 | "VersioningConfiguration",
|
32 32 | ),
|
33 33 | ::aws_smithy_schema::ShapeType::String,
|
34 - | "mfa_delete",
|
34 + | "MFADelete",
|
35 35 | 0,
|
36 36 | )
|
37 37 | .with_xml_name("MfaDelete");
|
38 38 | static VERSIONINGCONFIGURATION_MEMBER_STATUS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
39 39 | ::aws_smithy_schema::ShapeId::from_static(
|
40 40 | "com.amazonaws.s3control#VersioningConfiguration$Status",
|
41 41 | "com.amazonaws.s3control",
|
42 42 | "VersioningConfiguration",
|
43 43 | ),
|
44 44 | ::aws_smithy_schema::ShapeType::String,
|
45 - | "status",
|
45 + | "Status",
|
46 46 | 1,
|
47 47 | );
|
48 48 | static VERSIONINGCONFIGURATION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
49 49 | VERSIONINGCONFIGURATION_SCHEMA_ID,
|
50 50 | ::aws_smithy_schema::ShapeType::Structure,
|
51 51 | &[&VERSIONINGCONFIGURATION_MEMBER_MFA_DELETE, &VERSIONINGCONFIGURATION_MEMBER_STATUS],
|
52 52 | );
|
53 53 | impl VersioningConfiguration {
|
54 54 | /// The schema for this shape.
|
55 55 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &VERSIONINGCONFIGURATION_SCHEMA;
|
56 56 | }
|
57 57 | impl ::aws_smithy_schema::serde::SerializableStruct for VersioningConfiguration {
|
58 58 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
59 59 | fn serialize_members(
|
60 60 | &self,
|
61 61 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
62 62 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
63 63 | if let Some(ref val) = self.mfa_delete {
|
64 64 | ser.write_string(&VERSIONINGCONFIGURATION_MEMBER_MFA_DELETE, val.as_str())?;
|
65 65 | }
|
66 66 | if let Some(ref val) = self.status {
|
67 67 | ser.write_string(&VERSIONINGCONFIGURATION_MEMBER_STATUS, val.as_str())?;
|
68 68 | }
|
69 69 | Ok(())
|
70 70 | }
|
71 71 | }
|
72 72 | impl VersioningConfiguration {
|
73 73 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
74 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
75 - | deserializer: &mut D,
|
74 + | pub fn deserialize(
|
75 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
76 76 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
77 77 | #[allow(unused_variables, unused_mut)]
|
78 78 | let mut builder = Self::builder();
|
79 79 | #[allow(
|
80 80 | unused_variables,
|
81 81 | unreachable_code,
|
82 82 | clippy::single_match,
|
83 83 | clippy::match_single_binding,
|
84 84 | clippy::diverging_sub_expression
|
85 85 | )]
|
86 - | deserializer.read_struct(&VERSIONINGCONFIGURATION_SCHEMA, (), |_, member, deser| {
|
86 + | deserializer.read_struct(&VERSIONINGCONFIGURATION_SCHEMA, &mut |member, deser| {
|
87 87 | match member.member_index() {
|
88 88 | Some(0) => {
|
89 89 | builder.mfa_delete = Some(crate::types::MfaDelete::from(deser.read_string(member)?.as_str()));
|
90 90 | }
|
91 91 | Some(1) => {
|
92 92 | builder.status = Some(crate::types::BucketVersioningStatus::from(deser.read_string(member)?.as_str()));
|
93 93 | }
|
94 94 | _ => {}
|
95 95 | }
|
96 96 | Ok(())
|
97 97 | })?;
|
98 98 | Ok(builder.build())
|
99 99 | }
|
100 100 | }
|
101 + | impl VersioningConfiguration {
|
102 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
103 + | pub fn deserialize_with_response(
|
104 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
105 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
106 + | _status: u16,
|
107 + | _body: &[u8],
|
108 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
109 + | Self::deserialize(deserializer)
|
110 + | }
|
111 + | }
|
101 112 | impl VersioningConfiguration {
|
102 113 | /// Creates a new builder-style object to manufacture [`VersioningConfiguration`](crate::types::VersioningConfiguration).
|
103 114 | pub fn builder() -> crate::types::builders::VersioningConfigurationBuilder {
|
104 115 | crate::types::builders::VersioningConfigurationBuilder::default()
|
105 116 | }
|
106 117 | }
|
107 118 |
|
108 119 | /// A builder for [`VersioningConfiguration`](crate::types::VersioningConfiguration).
|
109 120 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
110 121 | #[non_exhaustive]
|
111 122 | pub struct VersioningConfigurationBuilder {
|
112 123 | pub(crate) mfa_delete: ::std::option::Option<crate::types::MfaDelete>,
|
113 124 | pub(crate) status: ::std::option::Option<crate::types::BucketVersioningStatus>,
|
114 125 | }
|
115 126 | impl VersioningConfigurationBuilder {
|
116 127 | /// <p>Specifies whether MFA delete is enabled or disabled in the bucket versioning configuration for the S3 on Outposts bucket.</p>
|
117 128 | pub fn mfa_delete(mut self, input: crate::types::MfaDelete) -> Self {
|
118 129 | self.mfa_delete = ::std::option::Option::Some(input);
|
119 130 | self
|
120 131 | }
|
121 132 | /// <p>Specifies whether MFA delete is enabled or disabled in the bucket versioning configuration for the S3 on Outposts bucket.</p>
|
122 133 | pub fn set_mfa_delete(mut self, input: ::std::option::Option<crate::types::MfaDelete>) -> Self {
|
123 134 | self.mfa_delete = input;
|
124 135 | self
|
125 136 | }
|
126 137 | /// <p>Specifies whether MFA delete is enabled or disabled in the bucket versioning configuration for the S3 on Outposts bucket.</p>
|
127 138 | pub fn get_mfa_delete(&self) -> &::std::option::Option<crate::types::MfaDelete> {
|
128 139 | &self.mfa_delete
|
129 140 | }
|
130 141 | /// <p>Sets the versioning state of the S3 on Outposts bucket.</p>
|