-
Notifications
You must be signed in to change notification settings - Fork 248
/
shape_data_source_parameters.rs
372 lines (371 loc) · 23.7 KB
/
shape_data_source_parameters.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub fn ser_data_source_parameters(
object_5: &mut ::aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::types::DataSourceParameters,
) -> Result<(), ::aws_smithy_types::error::operation::SerializationError> {
match input {
crate::types::DataSourceParameters::AmazonElasticsearchParameters(inner) => {
#[allow(unused_mut)]
let mut object_1 = object_5.key("AmazonElasticsearchParameters").start_object();
crate::protocol_serde::shape_amazon_elasticsearch_parameters::ser_amazon_elasticsearch_parameters(&mut object_1, inner)?;
object_1.finish();
}
crate::types::DataSourceParameters::AthenaParameters(inner) => {
#[allow(unused_mut)]
let mut object_2 = object_5.key("AthenaParameters").start_object();
crate::protocol_serde::shape_athena_parameters::ser_athena_parameters(&mut object_2, inner)?;
object_2.finish();
}
crate::types::DataSourceParameters::AuroraParameters(inner) => {
#[allow(unused_mut)]
let mut object_3 = object_5.key("AuroraParameters").start_object();
crate::protocol_serde::shape_aurora_parameters::ser_aurora_parameters(&mut object_3, inner)?;
object_3.finish();
}
crate::types::DataSourceParameters::AuroraPostgreSqlParameters(inner) => {
#[allow(unused_mut)]
let mut object_4 = object_5.key("AuroraPostgreSqlParameters").start_object();
crate::protocol_serde::shape_aurora_postgre_sql_parameters::ser_aurora_postgre_sql_parameters(&mut object_4, inner)?;
object_4.finish();
}
crate::types::DataSourceParameters::AwsIotAnalyticsParameters(inner) => {
#[allow(unused_mut)]
let mut object_5 = object_5.key("AwsIotAnalyticsParameters").start_object();
crate::protocol_serde::shape_aws_iot_analytics_parameters::ser_aws_iot_analytics_parameters(&mut object_5, inner)?;
object_5.finish();
}
crate::types::DataSourceParameters::JiraParameters(inner) => {
#[allow(unused_mut)]
let mut object_6 = object_5.key("JiraParameters").start_object();
crate::protocol_serde::shape_jira_parameters::ser_jira_parameters(&mut object_6, inner)?;
object_6.finish();
}
crate::types::DataSourceParameters::MariaDbParameters(inner) => {
#[allow(unused_mut)]
let mut object_7 = object_5.key("MariaDbParameters").start_object();
crate::protocol_serde::shape_maria_db_parameters::ser_maria_db_parameters(&mut object_7, inner)?;
object_7.finish();
}
crate::types::DataSourceParameters::MySqlParameters(inner) => {
#[allow(unused_mut)]
let mut object_8 = object_5.key("MySqlParameters").start_object();
crate::protocol_serde::shape_my_sql_parameters::ser_my_sql_parameters(&mut object_8, inner)?;
object_8.finish();
}
crate::types::DataSourceParameters::OracleParameters(inner) => {
#[allow(unused_mut)]
let mut object_9 = object_5.key("OracleParameters").start_object();
crate::protocol_serde::shape_oracle_parameters::ser_oracle_parameters(&mut object_9, inner)?;
object_9.finish();
}
crate::types::DataSourceParameters::PostgreSqlParameters(inner) => {
#[allow(unused_mut)]
let mut object_10 = object_5.key("PostgreSqlParameters").start_object();
crate::protocol_serde::shape_postgre_sql_parameters::ser_postgre_sql_parameters(&mut object_10, inner)?;
object_10.finish();
}
crate::types::DataSourceParameters::PrestoParameters(inner) => {
#[allow(unused_mut)]
let mut object_11 = object_5.key("PrestoParameters").start_object();
crate::protocol_serde::shape_presto_parameters::ser_presto_parameters(&mut object_11, inner)?;
object_11.finish();
}
crate::types::DataSourceParameters::RdsParameters(inner) => {
#[allow(unused_mut)]
let mut object_12 = object_5.key("RdsParameters").start_object();
crate::protocol_serde::shape_rds_parameters::ser_rds_parameters(&mut object_12, inner)?;
object_12.finish();
}
crate::types::DataSourceParameters::RedshiftParameters(inner) => {
#[allow(unused_mut)]
let mut object_13 = object_5.key("RedshiftParameters").start_object();
crate::protocol_serde::shape_redshift_parameters::ser_redshift_parameters(&mut object_13, inner)?;
object_13.finish();
}
crate::types::DataSourceParameters::S3Parameters(inner) => {
#[allow(unused_mut)]
let mut object_14 = object_5.key("S3Parameters").start_object();
crate::protocol_serde::shape_s3_parameters::ser_s3_parameters(&mut object_14, inner)?;
object_14.finish();
}
crate::types::DataSourceParameters::ServiceNowParameters(inner) => {
#[allow(unused_mut)]
let mut object_15 = object_5.key("ServiceNowParameters").start_object();
crate::protocol_serde::shape_service_now_parameters::ser_service_now_parameters(&mut object_15, inner)?;
object_15.finish();
}
crate::types::DataSourceParameters::SnowflakeParameters(inner) => {
#[allow(unused_mut)]
let mut object_16 = object_5.key("SnowflakeParameters").start_object();
crate::protocol_serde::shape_snowflake_parameters::ser_snowflake_parameters(&mut object_16, inner)?;
object_16.finish();
}
crate::types::DataSourceParameters::SparkParameters(inner) => {
#[allow(unused_mut)]
let mut object_17 = object_5.key("SparkParameters").start_object();
crate::protocol_serde::shape_spark_parameters::ser_spark_parameters(&mut object_17, inner)?;
object_17.finish();
}
crate::types::DataSourceParameters::SqlServerParameters(inner) => {
#[allow(unused_mut)]
let mut object_18 = object_5.key("SqlServerParameters").start_object();
crate::protocol_serde::shape_sql_server_parameters::ser_sql_server_parameters(&mut object_18, inner)?;
object_18.finish();
}
crate::types::DataSourceParameters::TeradataParameters(inner) => {
#[allow(unused_mut)]
let mut object_19 = object_5.key("TeradataParameters").start_object();
crate::protocol_serde::shape_teradata_parameters::ser_teradata_parameters(&mut object_19, inner)?;
object_19.finish();
}
crate::types::DataSourceParameters::TwitterParameters(inner) => {
#[allow(unused_mut)]
let mut object_20 = object_5.key("TwitterParameters").start_object();
crate::protocol_serde::shape_twitter_parameters::ser_twitter_parameters(&mut object_20, inner)?;
object_20.finish();
}
crate::types::DataSourceParameters::AmazonOpenSearchParameters(inner) => {
#[allow(unused_mut)]
let mut object_21 = object_5.key("AmazonOpenSearchParameters").start_object();
crate::protocol_serde::shape_amazon_open_search_parameters::ser_amazon_open_search_parameters(&mut object_21, inner)?;
object_21.finish();
}
crate::types::DataSourceParameters::ExasolParameters(inner) => {
#[allow(unused_mut)]
let mut object_22 = object_5.key("ExasolParameters").start_object();
crate::protocol_serde::shape_exasol_parameters::ser_exasol_parameters(&mut object_22, inner)?;
object_22.finish();
}
crate::types::DataSourceParameters::DatabricksParameters(inner) => {
#[allow(unused_mut)]
let mut object_23 = object_5.key("DatabricksParameters").start_object();
crate::protocol_serde::shape_databricks_parameters::ser_databricks_parameters(&mut object_23, inner)?;
object_23.finish();
}
crate::types::DataSourceParameters::StarburstParameters(inner) => {
#[allow(unused_mut)]
let mut object_24 = object_5.key("StarburstParameters").start_object();
crate::protocol_serde::shape_starburst_parameters::ser_starburst_parameters(&mut object_24, inner)?;
object_24.finish();
}
crate::types::DataSourceParameters::TrinoParameters(inner) => {
#[allow(unused_mut)]
let mut object_25 = object_5.key("TrinoParameters").start_object();
crate::protocol_serde::shape_trino_parameters::ser_trino_parameters(&mut object_25, inner)?;
object_25.finish();
}
crate::types::DataSourceParameters::BigQueryParameters(inner) => {
#[allow(unused_mut)]
let mut object_26 = object_5.key("BigQueryParameters").start_object();
crate::protocol_serde::shape_big_query_parameters::ser_big_query_parameters(&mut object_26, inner)?;
object_26.finish();
}
crate::types::DataSourceParameters::Unknown => {
return Err(::aws_smithy_types::error::operation::SerializationError::unknown_variant(
"DataSourceParameters",
))
}
}
Ok(())
}
pub(crate) fn de_data_source_parameters<'a, I>(
tokens: &mut ::std::iter::Peekable<I>,
) -> Result<Option<crate::types::DataSourceParameters>, ::aws_smithy_json::deserialize::error::DeserializeError>
where
I: Iterator<Item = Result<::aws_smithy_json::deserialize::Token<'a>, ::aws_smithy_json::deserialize::error::DeserializeError>>,
{
let mut variant = None;
match tokens.next().transpose()? {
Some(::aws_smithy_json::deserialize::Token::ValueNull { .. }) => return Ok(None),
Some(::aws_smithy_json::deserialize::Token::StartObject { .. }) => loop {
match tokens.next().transpose()? {
Some(::aws_smithy_json::deserialize::Token::EndObject { .. }) => break,
Some(::aws_smithy_json::deserialize::Token::ObjectKey { key, .. }) => {
if let ::std::option::Option::Some(::std::result::Result::Ok(::aws_smithy_json::deserialize::Token::ValueNull { .. })) =
tokens.peek()
{
let _ = tokens.next().expect("peek returned a token")?;
continue;
}
let key = key.to_unescaped()?;
if key == "__type" {
::aws_smithy_json::deserialize::token::skip_value(tokens)?;
continue;
}
if variant.is_some() {
return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"encountered mixed variants in union",
));
}
variant = match key.as_ref() {
"AmazonElasticsearchParameters" => Some(crate::types::DataSourceParameters::AmazonElasticsearchParameters(
crate::protocol_serde::shape_amazon_elasticsearch_parameters::de_amazon_elasticsearch_parameters(tokens)?.ok_or_else(
|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom(
"value for 'AmazonElasticsearchParameters' cannot be null",
)
},
)?,
)),
"AthenaParameters" => Some(crate::types::DataSourceParameters::AthenaParameters(
crate::protocol_serde::shape_athena_parameters::de_athena_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'AthenaParameters' cannot be null")
})?,
)),
"AuroraParameters" => Some(crate::types::DataSourceParameters::AuroraParameters(
crate::protocol_serde::shape_aurora_parameters::de_aurora_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'AuroraParameters' cannot be null")
})?,
)),
"AuroraPostgreSqlParameters" => Some(crate::types::DataSourceParameters::AuroraPostgreSqlParameters(
crate::protocol_serde::shape_aurora_postgre_sql_parameters::de_aurora_postgre_sql_parameters(tokens)?.ok_or_else(
|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom(
"value for 'AuroraPostgreSqlParameters' cannot be null",
)
},
)?,
)),
"AwsIotAnalyticsParameters" => Some(crate::types::DataSourceParameters::AwsIotAnalyticsParameters(
crate::protocol_serde::shape_aws_iot_analytics_parameters::de_aws_iot_analytics_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom(
"value for 'AwsIotAnalyticsParameters' cannot be null",
)
})?,
)),
"JiraParameters" => Some(crate::types::DataSourceParameters::JiraParameters(
crate::protocol_serde::shape_jira_parameters::de_jira_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'JiraParameters' cannot be null")
})?,
)),
"MariaDbParameters" => Some(crate::types::DataSourceParameters::MariaDbParameters(
crate::protocol_serde::shape_maria_db_parameters::de_maria_db_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'MariaDbParameters' cannot be null")
})?,
)),
"MySqlParameters" => Some(crate::types::DataSourceParameters::MySqlParameters(
crate::protocol_serde::shape_my_sql_parameters::de_my_sql_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'MySqlParameters' cannot be null")
})?,
)),
"OracleParameters" => Some(crate::types::DataSourceParameters::OracleParameters(
crate::protocol_serde::shape_oracle_parameters::de_oracle_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'OracleParameters' cannot be null")
})?,
)),
"PostgreSqlParameters" => Some(crate::types::DataSourceParameters::PostgreSqlParameters(
crate::protocol_serde::shape_postgre_sql_parameters::de_postgre_sql_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'PostgreSqlParameters' cannot be null")
})?,
)),
"PrestoParameters" => Some(crate::types::DataSourceParameters::PrestoParameters(
crate::protocol_serde::shape_presto_parameters::de_presto_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'PrestoParameters' cannot be null")
})?,
)),
"RdsParameters" => Some(crate::types::DataSourceParameters::RdsParameters(
crate::protocol_serde::shape_rds_parameters::de_rds_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'RdsParameters' cannot be null")
})?,
)),
"RedshiftParameters" => Some(crate::types::DataSourceParameters::RedshiftParameters(
crate::protocol_serde::shape_redshift_parameters::de_redshift_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'RedshiftParameters' cannot be null")
})?,
)),
"S3Parameters" => Some(crate::types::DataSourceParameters::S3Parameters(
crate::protocol_serde::shape_s3_parameters::de_s3_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'S3Parameters' cannot be null")
})?,
)),
"ServiceNowParameters" => Some(crate::types::DataSourceParameters::ServiceNowParameters(
crate::protocol_serde::shape_service_now_parameters::de_service_now_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'ServiceNowParameters' cannot be null")
})?,
)),
"SnowflakeParameters" => Some(crate::types::DataSourceParameters::SnowflakeParameters(
crate::protocol_serde::shape_snowflake_parameters::de_snowflake_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'SnowflakeParameters' cannot be null")
})?,
)),
"SparkParameters" => Some(crate::types::DataSourceParameters::SparkParameters(
crate::protocol_serde::shape_spark_parameters::de_spark_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'SparkParameters' cannot be null")
})?,
)),
"SqlServerParameters" => Some(crate::types::DataSourceParameters::SqlServerParameters(
crate::protocol_serde::shape_sql_server_parameters::de_sql_server_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'SqlServerParameters' cannot be null")
})?,
)),
"TeradataParameters" => Some(crate::types::DataSourceParameters::TeradataParameters(
crate::protocol_serde::shape_teradata_parameters::de_teradata_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'TeradataParameters' cannot be null")
})?,
)),
"TwitterParameters" => Some(crate::types::DataSourceParameters::TwitterParameters(
crate::protocol_serde::shape_twitter_parameters::de_twitter_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'TwitterParameters' cannot be null")
})?,
)),
"AmazonOpenSearchParameters" => Some(crate::types::DataSourceParameters::AmazonOpenSearchParameters(
crate::protocol_serde::shape_amazon_open_search_parameters::de_amazon_open_search_parameters(tokens)?.ok_or_else(
|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom(
"value for 'AmazonOpenSearchParameters' cannot be null",
)
},
)?,
)),
"ExasolParameters" => Some(crate::types::DataSourceParameters::ExasolParameters(
crate::protocol_serde::shape_exasol_parameters::de_exasol_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'ExasolParameters' cannot be null")
})?,
)),
"DatabricksParameters" => Some(crate::types::DataSourceParameters::DatabricksParameters(
crate::protocol_serde::shape_databricks_parameters::de_databricks_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'DatabricksParameters' cannot be null")
})?,
)),
"StarburstParameters" => Some(crate::types::DataSourceParameters::StarburstParameters(
crate::protocol_serde::shape_starburst_parameters::de_starburst_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'StarburstParameters' cannot be null")
})?,
)),
"TrinoParameters" => Some(crate::types::DataSourceParameters::TrinoParameters(
crate::protocol_serde::shape_trino_parameters::de_trino_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'TrinoParameters' cannot be null")
})?,
)),
"BigQueryParameters" => Some(crate::types::DataSourceParameters::BigQueryParameters(
crate::protocol_serde::shape_big_query_parameters::de_big_query_parameters(tokens)?.ok_or_else(|| {
::aws_smithy_json::deserialize::error::DeserializeError::custom("value for 'BigQueryParameters' cannot be null")
})?,
)),
_ => {
::aws_smithy_json::deserialize::token::skip_value(tokens)?;
Some(crate::types::DataSourceParameters::Unknown)
}
};
}
other => {
return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(format!(
"expected object key or end object, found: {:?}",
other
)))
}
}
},
_ => {
return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"expected start object or null",
))
}
}
if variant.is_none() {
return Err(::aws_smithy_json::deserialize::error::DeserializeError::custom(
"Union did not contain a valid variant.",
));
}
Ok(variant)
}