31 31 | /// <p>Specifies object key name filtering rules. For information about key name filtering, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/notification-how-to-filtering.html">Configuring event notifications using object key name filtering</a> in the <i>Amazon S3 User Guide</i>.</p>
|
32 32 | pub fn filter(&self) -> ::std::option::Option<&crate::types::NotificationConfigurationFilter> {
|
33 33 | self.filter.as_ref()
|
34 34 | }
|
35 35 | }
|
36 36 | static TOPICCONFIGURATION_SCHEMA_ID: ::aws_smithy_schema::ShapeId =
|
37 37 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#TopicConfiguration", "com.amazonaws.s3", "TopicConfiguration");
|
38 38 | static TOPICCONFIGURATION_MEMBER_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
39 39 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#TopicConfiguration$Id", "com.amazonaws.s3", "TopicConfiguration"),
|
40 40 | ::aws_smithy_schema::ShapeType::String,
|
41 - | "id",
|
41 + | "Id",
|
42 42 | 0,
|
43 43 | );
|
44 44 | static TOPICCONFIGURATION_MEMBER_TOPIC_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
45 45 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#TopicConfiguration$TopicArn", "com.amazonaws.s3", "TopicConfiguration"),
|
46 46 | ::aws_smithy_schema::ShapeType::String,
|
47 - | "topic_arn",
|
47 + | "TopicArn",
|
48 48 | 1,
|
49 49 | )
|
50 50 | .with_xml_name("Topic");
|
51 51 | static TOPICCONFIGURATION_MEMBER_EVENTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
52 52 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#TopicConfiguration$Events", "com.amazonaws.s3", "TopicConfiguration"),
|
53 53 | ::aws_smithy_schema::ShapeType::List,
|
54 - | "events",
|
54 + | "Events",
|
55 55 | 2,
|
56 56 | )
|
57 57 | .with_xml_name("Event")
|
58 58 | .with_xml_flattened();
|
59 59 | static TOPICCONFIGURATION_MEMBER_FILTER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
60 60 | ::aws_smithy_schema::ShapeId::from_static("com.amazonaws.s3#TopicConfiguration$Filter", "com.amazonaws.s3", "TopicConfiguration"),
|
61 61 | ::aws_smithy_schema::ShapeType::Structure,
|
62 - | "filter",
|
62 + | "Filter",
|
63 63 | 3,
|
64 64 | );
|
65 65 | static TOPICCONFIGURATION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
66 66 | TOPICCONFIGURATION_SCHEMA_ID,
|
67 67 | ::aws_smithy_schema::ShapeType::Structure,
|
68 68 | &[
|
69 69 | &TOPICCONFIGURATION_MEMBER_ID,
|
70 70 | &TOPICCONFIGURATION_MEMBER_TOPIC_ARN,
|
71 71 | &TOPICCONFIGURATION_MEMBER_EVENTS,
|
72 72 | &TOPICCONFIGURATION_MEMBER_FILTER,
|
73 73 | ],
|
74 74 | );
|
75 75 | impl TopicConfiguration {
|
76 76 | /// The schema for this shape.
|
77 77 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &TOPICCONFIGURATION_SCHEMA;
|
78 78 | }
|
79 79 | impl ::aws_smithy_schema::serde::SerializableStruct for TopicConfiguration {
|
80 80 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
81 81 | fn serialize_members(
|
82 82 | &self,
|
83 83 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
84 84 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
85 85 | if let Some(ref val) = self.id {
|
86 86 | ser.write_string(&TOPICCONFIGURATION_MEMBER_ID, val)?;
|
87 87 | }
|
88 88 | {
|
89 89 | let val = &self.topic_arn;
|
90 90 | ser.write_string(&TOPICCONFIGURATION_MEMBER_TOPIC_ARN, val)?;
|
91 91 | }
|
92 92 | {
|
93 93 | let val = &self.events;
|
94 94 |
|
95 95 | ser.write_list(
|
96 96 | &TOPICCONFIGURATION_MEMBER_EVENTS,
|
97 97 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
98 98 | for item in val {
|
99 99 | ser.write_string(&aws_smithy_schema::prelude::STRING, item.as_str())?;
|
100 100 | }
|
101 101 | Ok(())
|
102 102 | },
|
103 103 | )?;
|
104 104 | }
|
105 105 | if let Some(ref val) = self.filter {
|
106 106 | ser.write_struct(&TOPICCONFIGURATION_MEMBER_FILTER, val)?;
|
107 107 | }
|
108 108 | Ok(())
|
109 109 | }
|
110 110 | }
|
111 111 | impl TopicConfiguration {
|
112 112 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
113 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
114 - | deserializer: &mut D,
|
113 + | pub fn deserialize(
|
114 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
115 115 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
116 116 | #[allow(unused_variables, unused_mut)]
|
117 117 | let mut builder = Self::builder();
|
118 118 | #[allow(
|
119 119 | unused_variables,
|
120 120 | unreachable_code,
|
121 121 | clippy::single_match,
|
122 122 | clippy::match_single_binding,
|
123 123 | clippy::diverging_sub_expression
|
124 124 | )]
|
125 - | deserializer.read_struct(&TOPICCONFIGURATION_SCHEMA, (), |_, member, deser| {
|
125 + | deserializer.read_struct(&TOPICCONFIGURATION_SCHEMA, &mut |member, deser| {
|
126 126 | match member.member_index() {
|
127 127 | Some(0) => {
|
128 128 | builder.id = Some(deser.read_string(member)?);
|
129 129 | }
|
130 130 | Some(1) => {
|
131 131 | builder.topic_arn = Some(deser.read_string(member)?);
|
132 132 | }
|
133 133 | Some(2) => {
|
134 134 | builder.events = Some({
|
135 - | let container = if let Some(cap) = deser.container_size() {
|
136 - | Vec::with_capacity(cap)
|
137 - | } else {
|
138 - | Vec::new()
|
139 - | };
|
140 - | deser.read_list(member, container, |mut list, deser| {
|
141 - | list.push(crate::types::Event::from(deser.read_string(member)?.as_str()));
|
142 - | Ok(list)
|
143 - | })?
|
135 + | let mut container = Vec::new();
|
136 + | deser.read_list(member, &mut |deser| {
|
137 + | container.push(crate::types::Event::from(deser.read_string(member)?.as_str()));
|
138 + | Ok(())
|
139 + | })?;
|
140 + | container
|
144 141 | });
|
145 142 | }
|
146 143 | Some(3) => {
|
147 144 | builder.filter = Some(crate::types::NotificationConfigurationFilter::deserialize(deser)?);
|
148 145 | }
|
149 146 | _ => {}
|
150 147 | }
|
151 148 | Ok(())
|
152 149 | })?;
|
150 + | builder.topic_arn = builder.topic_arn.or(Some(String::new()));
|
151 + | builder.events = builder.events.or(Some(Vec::new()));
|
153 152 | builder
|
154 153 | .build()
|
155 154 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
156 155 | }
|
157 156 | }
|
157 + | impl TopicConfiguration {
|
158 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
159 + | pub fn deserialize_with_response(
|
160 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
161 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
162 + | _status: u16,
|
163 + | _body: &[u8],
|
164 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
165 + | Self::deserialize(deserializer)
|
166 + | }
|
167 + | }
|
158 168 | impl TopicConfiguration {
|
159 169 | /// Creates a new builder-style object to manufacture [`TopicConfiguration`](crate::types::TopicConfiguration).
|
160 170 | pub fn builder() -> crate::types::builders::TopicConfigurationBuilder {
|
161 171 | crate::types::builders::TopicConfigurationBuilder::default()
|
162 172 | }
|
163 173 | }
|
164 174 |
|
165 175 | /// A builder for [`TopicConfiguration`](crate::types::TopicConfiguration).
|
166 176 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
167 177 | #[non_exhaustive]
|