52 52 | /// <p>A container specifying replication metrics-related settings enabling replication metrics and events.</p>
|
53 53 | pub fn metrics(&self) -> ::std::option::Option<&crate::types::Metrics> {
|
54 54 | self.metrics.as_ref()
|
55 55 | }
|
56 56 | }
|
57 57 | static DESTINATION_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
58 58 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Destination", "com.amazonaws.s3", "Destination");
|
59 59 | static DESTINATION_MEMBER_BUCKET: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
60 60 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Destination$Bucket", "com.amazonaws.s3", "Destination"),
|
61 61 | ::aws_smithy_schema::ShapeType::String,
|
62 - | "bucket",
|
62 + | "Bucket",
|
63 63 | 0,
|
64 64 | );
|
65 65 | static DESTINATION_MEMBER_ACCOUNT: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
66 66 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Destination$Account", "com.amazonaws.s3", "Destination"),
|
67 67 | ::aws_smithy_schema::ShapeType::String,
|
68 - | "account",
|
68 + | "Account",
|
69 69 | 1,
|
70 70 | );
|
71 71 | static DESTINATION_MEMBER_STORAGE_CLASS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
72 72 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Destination$StorageClass", "com.amazonaws.s3", "Destination"),
|
73 73 | ::aws_smithy_schema::ShapeType::String,
|
74 - | "storage_class",
|
74 + | "StorageClass",
|
75 75 | 2,
|
76 76 | );
|
77 77 | static DESTINATION_MEMBER_ACCESS_CONTROL_TRANSLATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
78 78 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Destination$AccessControlTranslation", "com.amazonaws.s3", "Destination"),
|
79 79 | ::aws_smithy_schema::ShapeType::Structure,
|
80 - | "access_control_translation",
|
80 + | "AccessControlTranslation",
|
81 81 | 3,
|
82 82 | );
|
83 83 | static DESTINATION_MEMBER_ENCRYPTION_CONFIGURATION: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
84 84 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Destination$EncryptionConfiguration", "com.amazonaws.s3", "Destination"),
|
85 85 | ::aws_smithy_schema::ShapeType::Structure,
|
86 - | "encryption_configuration",
|
86 + | "EncryptionConfiguration",
|
87 87 | 4,
|
88 88 | );
|
89 89 | static DESTINATION_MEMBER_REPLICATION_TIME: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
90 90 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Destination$ReplicationTime", "com.amazonaws.s3", "Destination"),
|
91 91 | ::aws_smithy_schema::ShapeType::Structure,
|
92 - | "replication_time",
|
92 + | "ReplicationTime",
|
93 93 | 5,
|
94 94 | );
|
95 95 | static DESTINATION_MEMBER_METRICS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
96 96 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#Destination$Metrics", "com.amazonaws.s3", "Destination"),
|
97 97 | ::aws_smithy_schema::ShapeType::Structure,
|
98 - | "metrics",
|
98 + | "Metrics",
|
99 99 | 6,
|
100 100 | );
|
101 101 | static DESTINATION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
102 102 | DESTINATION_SCHEMA_ID,
|
103 103 | ::aws_smithy_schema::ShapeType::Structure,
|
104 104 | &[
|
105 105 | &DESTINATION_MEMBER_BUCKET,
|
106 106 | &DESTINATION_MEMBER_ACCOUNT,
|
107 107 | &DESTINATION_MEMBER_STORAGE_CLASS,
|
108 108 | &DESTINATION_MEMBER_ACCESS_CONTROL_TRANSLATION,
|
109 109 | &DESTINATION_MEMBER_ENCRYPTION_CONFIGURATION,
|
110 110 | &DESTINATION_MEMBER_REPLICATION_TIME,
|
111 111 | &DESTINATION_MEMBER_METRICS,
|
112 112 | ],
|
113 113 | );
|
114 114 | impl Destination {
|
115 115 | /// The schema for this shape.
|
116 116 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &DESTINATION_SCHEMA;
|
117 117 | }
|
118 118 | impl ::aws_smithy_schema::serde::SerializableStruct for Destination {
|
119 119 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
120 120 | fn serialize_members(
|
121 121 | &self,
|
122 122 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
123 123 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
124 124 | {
|
125 125 | let val = &self.bucket;
|
126 126 | ser.write_string(&DESTINATION_MEMBER_BUCKET, val)?;
|
127 127 | }
|
128 128 | if let Some(ref val) = self.account {
|
129 129 | ser.write_string(&DESTINATION_MEMBER_ACCOUNT, val)?;
|
130 130 | }
|
131 131 | if let Some(ref val) = self.storage_class {
|
132 132 | ser.write_string(&DESTINATION_MEMBER_STORAGE_CLASS, val.as_str())?;
|
133 133 | }
|
134 134 | if let Some(ref val) = self.access_control_translation {
|
135 135 | ser.write_struct(&DESTINATION_MEMBER_ACCESS_CONTROL_TRANSLATION, val)?;
|
136 136 | }
|
137 137 | if let Some(ref val) = self.encryption_configuration {
|
138 138 | ser.write_struct(&DESTINATION_MEMBER_ENCRYPTION_CONFIGURATION, val)?;
|
139 139 | }
|
140 140 | if let Some(ref val) = self.replication_time {
|
141 141 | ser.write_struct(&DESTINATION_MEMBER_REPLICATION_TIME, val)?;
|
142 142 | }
|
143 143 | if let Some(ref val) = self.metrics {
|
144 144 | ser.write_struct(&DESTINATION_MEMBER_METRICS, val)?;
|
145 145 | }
|
146 146 | Ok(())
|
147 147 | }
|
148 148 | }
|
149 149 | impl Destination {
|
150 150 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
151 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
152 - | deserializer: &mut D,
|
151 + | pub fn deserialize(
|
152 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
153 153 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
154 154 | #[allow(unused_variables, unused_mut)]
|
155 155 | let mut builder = Self::builder();
|
156 156 | #[allow(
|
157 157 | unused_variables,
|
158 158 | unreachable_code,
|
159 159 | clippy::single_match,
|
160 160 | clippy::match_single_binding,
|
161 161 | clippy::diverging_sub_expression
|
162 162 | )]
|
163 - | deserializer.read_struct(&DESTINATION_SCHEMA, (), |_, member, deser| {
|
163 + | deserializer.read_struct(&DESTINATION_SCHEMA, &mut |member, deser| {
|
164 164 | match member.member_index() {
|
165 165 | Some(0) => {
|
166 166 | builder.bucket = Some(deser.read_string(member)?);
|
167 167 | }
|
168 168 | Some(1) => {
|
169 169 | builder.account = Some(deser.read_string(member)?);
|
170 170 | }
|
171 171 | Some(2) => {
|
172 172 | builder.storage_class = Some(crate::types::StorageClass::from(deser.read_string(member)?.as_str()));
|
173 173 | }
|
174 174 | Some(3) => {
|
175 175 | builder.access_control_translation = Some(crate::types::AccessControlTranslation::deserialize(deser)?);
|
176 176 | }
|
177 177 | Some(4) => {
|
178 178 | builder.encryption_configuration = Some(crate::types::EncryptionConfiguration::deserialize(deser)?);
|
179 179 | }
|
180 180 | Some(5) => {
|
181 181 | builder.replication_time = Some(crate::types::ReplicationTime::deserialize(deser)?);
|
182 182 | }
|
183 183 | Some(6) => {
|
184 184 | builder.metrics = Some(crate::types::Metrics::deserialize(deser)?);
|
185 185 | }
|
186 186 | _ => {}
|
187 187 | }
|
188 188 | Ok(())
|
189 189 | })?;
|
190 + | builder.bucket = builder.bucket.or(Some(String::new()));
|
190 191 | builder
|
191 192 | .build()
|
192 193 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
193 194 | }
|
194 195 | }
|
196 + | impl Destination {
|
197 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
198 + | pub fn deserialize_with_response(
|
199 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
200 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
201 + | _status: u16,
|
202 + | _body: &[u8],
|
203 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
204 + | Self::deserialize(deserializer)
|
205 + | }
|
206 + | }
|
195 207 | impl Destination {
|
196 208 | /// Creates a new builder-style object to manufacture [`Destination`](crate::types::Destination).
|
197 209 | pub fn builder() -> crate::types::builders::DestinationBuilder {
|
198 210 | crate::types::builders::DestinationBuilder::default()
|
199 211 | }
|
200 212 | }
|
201 213 |
|
202 214 | /// A builder for [`Destination`](crate::types::Destination).
|
203 215 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
204 216 | #[non_exhaustive]
|