38 38 | "com.amazonaws.s3",
|
39 39 | "LambdaFunctionConfiguration",
|
40 40 | );
|
41 41 | static LAMBDAFUNCTIONCONFIGURATION_MEMBER_ID: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
42 42 | ::aws_smithy_schema::ShapeId::from_static(
|
43 43 | "com.amazonaws.s3#LambdaFunctionConfiguration$Id",
|
44 44 | "com.amazonaws.s3",
|
45 45 | "LambdaFunctionConfiguration",
|
46 46 | ),
|
47 47 | ::aws_smithy_schema::ShapeType::String,
|
48 - | "id",
|
48 + | "Id",
|
49 49 | 0,
|
50 50 | );
|
51 51 | static LAMBDAFUNCTIONCONFIGURATION_MEMBER_LAMBDA_FUNCTION_ARN: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
52 52 | ::aws_smithy_schema::ShapeId::from_static(
|
53 53 | "com.amazonaws.s3#LambdaFunctionConfiguration$LambdaFunctionArn",
|
54 54 | "com.amazonaws.s3",
|
55 55 | "LambdaFunctionConfiguration",
|
56 56 | ),
|
57 57 | ::aws_smithy_schema::ShapeType::String,
|
58 - | "lambda_function_arn",
|
58 + | "LambdaFunctionArn",
|
59 59 | 1,
|
60 60 | )
|
61 61 | .with_xml_name("CloudFunction");
|
62 62 | static LAMBDAFUNCTIONCONFIGURATION_MEMBER_EVENTS: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
63 63 | ::aws_smithy_schema::ShapeId::from_static(
|
64 64 | "com.amazonaws.s3#LambdaFunctionConfiguration$Events",
|
65 65 | "com.amazonaws.s3",
|
66 66 | "LambdaFunctionConfiguration",
|
67 67 | ),
|
68 68 | ::aws_smithy_schema::ShapeType::List,
|
69 - | "events",
|
69 + | "Events",
|
70 70 | 2,
|
71 71 | )
|
72 72 | .with_xml_name("Event")
|
73 73 | .with_xml_flattened();
|
74 74 | static LAMBDAFUNCTIONCONFIGURATION_MEMBER_FILTER: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_member(
|
75 75 | ::aws_smithy_schema::ShapeId::from_static(
|
76 76 | "com.amazonaws.s3#LambdaFunctionConfiguration$Filter",
|
77 77 | "com.amazonaws.s3",
|
78 78 | "LambdaFunctionConfiguration",
|
79 79 | ),
|
80 80 | ::aws_smithy_schema::ShapeType::Structure,
|
81 - | "filter",
|
81 + | "Filter",
|
82 82 | 3,
|
83 83 | );
|
84 84 | static LAMBDAFUNCTIONCONFIGURATION_SCHEMA: ::aws_smithy_schema::Schema = ::aws_smithy_schema::Schema::new_struct(
|
85 85 | LAMBDAFUNCTIONCONFIGURATION_SCHEMA_ID,
|
86 86 | ::aws_smithy_schema::ShapeType::Structure,
|
87 87 | &[
|
88 88 | &LAMBDAFUNCTIONCONFIGURATION_MEMBER_ID,
|
89 89 | &LAMBDAFUNCTIONCONFIGURATION_MEMBER_LAMBDA_FUNCTION_ARN,
|
90 90 | &LAMBDAFUNCTIONCONFIGURATION_MEMBER_EVENTS,
|
91 91 | &LAMBDAFUNCTIONCONFIGURATION_MEMBER_FILTER,
|
92 92 | ],
|
93 93 | );
|
94 94 | impl LambdaFunctionConfiguration {
|
95 95 | /// The schema for this shape.
|
96 96 | pub const SCHEMA: &'static ::aws_smithy_schema::Schema = &LAMBDAFUNCTIONCONFIGURATION_SCHEMA;
|
97 97 | }
|
98 98 | impl ::aws_smithy_schema::serde::SerializableStruct for LambdaFunctionConfiguration {
|
99 99 | #[allow(unused_variables, clippy::diverging_sub_expression)]
|
100 100 | fn serialize_members(
|
101 101 | &self,
|
102 102 | ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer,
|
103 103 | ) -> ::std::result::Result<(), ::aws_smithy_schema::serde::SerdeError> {
|
104 104 | if let Some(ref val) = self.id {
|
105 105 | ser.write_string(&LAMBDAFUNCTIONCONFIGURATION_MEMBER_ID, val)?;
|
106 106 | }
|
107 107 | {
|
108 108 | let val = &self.lambda_function_arn;
|
109 109 | ser.write_string(&LAMBDAFUNCTIONCONFIGURATION_MEMBER_LAMBDA_FUNCTION_ARN, val)?;
|
110 110 | }
|
111 111 | {
|
112 112 | let val = &self.events;
|
113 113 |
|
114 114 | ser.write_list(
|
115 115 | &LAMBDAFUNCTIONCONFIGURATION_MEMBER_EVENTS,
|
116 116 | &|ser: &mut dyn ::aws_smithy_schema::serde::ShapeSerializer| {
|
117 117 | for item in val {
|
118 118 | ser.write_string(&aws_smithy_schema::prelude::STRING, item.as_str())?;
|
119 119 | }
|
120 120 | Ok(())
|
121 121 | },
|
122 122 | )?;
|
123 123 | }
|
124 124 | if let Some(ref val) = self.filter {
|
125 125 | ser.write_struct(&LAMBDAFUNCTIONCONFIGURATION_MEMBER_FILTER, val)?;
|
126 126 | }
|
127 127 | Ok(())
|
128 128 | }
|
129 129 | }
|
130 130 | impl LambdaFunctionConfiguration {
|
131 131 | /// Deserializes this structure from a [`ShapeDeserializer`].
|
132 - | pub fn deserialize<D: ::aws_smithy_schema::serde::ShapeDeserializer>(
|
133 - | deserializer: &mut D,
|
132 + | pub fn deserialize(
|
133 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
134 134 | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
135 135 | #[allow(unused_variables, unused_mut)]
|
136 136 | let mut builder = Self::builder();
|
137 137 | #[allow(
|
138 138 | unused_variables,
|
139 139 | unreachable_code,
|
140 140 | clippy::single_match,
|
141 141 | clippy::match_single_binding,
|
142 142 | clippy::diverging_sub_expression
|
143 143 | )]
|
144 - | deserializer.read_struct(&LAMBDAFUNCTIONCONFIGURATION_SCHEMA, (), |_, member, deser| {
|
144 + | deserializer.read_struct(&LAMBDAFUNCTIONCONFIGURATION_SCHEMA, &mut |member, deser| {
|
145 145 | match member.member_index() {
|
146 146 | Some(0) => {
|
147 147 | builder.id = Some(deser.read_string(member)?);
|
148 148 | }
|
149 149 | Some(1) => {
|
150 150 | builder.lambda_function_arn = Some(deser.read_string(member)?);
|
151 151 | }
|
152 152 | Some(2) => {
|
153 153 | builder.events = Some({
|
154 - | let container = if let Some(cap) = deser.container_size() {
|
155 - | Vec::with_capacity(cap)
|
156 - | } else {
|
157 - | Vec::new()
|
158 - | };
|
159 - | deser.read_list(member, container, |mut list, deser| {
|
160 - | list.push(crate::types::Event::from(deser.read_string(member)?.as_str()));
|
161 - | Ok(list)
|
162 - | })?
|
154 + | let mut container = Vec::new();
|
155 + | deser.read_list(member, &mut |deser| {
|
156 + | container.push(crate::types::Event::from(deser.read_string(member)?.as_str()));
|
157 + | Ok(())
|
158 + | })?;
|
159 + | container
|
163 160 | });
|
164 161 | }
|
165 162 | Some(3) => {
|
166 163 | builder.filter = Some(crate::types::NotificationConfigurationFilter::deserialize(deser)?);
|
167 164 | }
|
168 165 | _ => {}
|
169 166 | }
|
170 167 | Ok(())
|
171 168 | })?;
|
169 + | builder.lambda_function_arn = builder.lambda_function_arn.or(Some(String::new()));
|
170 + | builder.events = builder.events.or(Some(Vec::new()));
|
172 171 | builder
|
173 172 | .build()
|
174 173 | .map_err(|e| aws_smithy_schema::serde::SerdeError::Custom { message: e.to_string() })
|
175 174 | }
|
176 175 | }
|
176 + | impl LambdaFunctionConfiguration {
|
177 + | /// Deserializes this structure from a body deserializer and HTTP response.
|
178 + | pub fn deserialize_with_response(
|
179 + | deserializer: &mut dyn ::aws_smithy_schema::serde::ShapeDeserializer,
|
180 + | _headers: &::aws_smithy_runtime_api::http::Headers,
|
181 + | _status: u16,
|
182 + | _body: &[u8],
|
183 + | ) -> ::std::result::Result<Self, ::aws_smithy_schema::serde::SerdeError> {
|
184 + | Self::deserialize(deserializer)
|
185 + | }
|
186 + | }
|
177 187 | impl LambdaFunctionConfiguration {
|
178 188 | /// Creates a new builder-style object to manufacture [`LambdaFunctionConfiguration`](crate::types::LambdaFunctionConfiguration).
|
179 189 | pub fn builder() -> crate::types::builders::LambdaFunctionConfigurationBuilder {
|
180 190 | crate::types::builders::LambdaFunctionConfigurationBuilder::default()
|
181 191 | }
|
182 192 | }
|
183 193 |
|
184 194 | /// A builder for [`LambdaFunctionConfiguration`](crate::types::LambdaFunctionConfiguration).
|
185 195 | #[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
|
186 196 | #[non_exhaustive]
|