Enum aws_sdk_databrew::model::InputFormat
source · #[non_exhaustive]
pub enum InputFormat {
Csv,
Excel,
Json,
Orc,
Parquet,
Unknown(UnknownVariantValue),
}
Expand description
When writing a match expression against InputFormat
, it is important to ensure
your code is forward-compatible. That is, if a match arm handles a case for a
feature that is supported by the service but has not been represented as an enum
variant in a current version of SDK, your code should continue to work when you
upgrade SDK to a future version in which the enum does include a variant for that
feature.
Here is an example of how you can make a match expression forward-compatible:
# let inputformat = unimplemented!();
match inputformat {
InputFormat::Csv => { /* ... */ },
InputFormat::Excel => { /* ... */ },
InputFormat::Json => { /* ... */ },
InputFormat::Orc => { /* ... */ },
InputFormat::Parquet => { /* ... */ },
other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
_ => { /* ... */ },
}
The above code demonstrates that when inputformat
represents
NewFeature
, the execution path will lead to the second last match arm,
even though the enum does not contain a variant InputFormat::NewFeature
in the current version of SDK. The reason is that the variable other
,
created by the @
operator, is bound to
InputFormat::Unknown(UnknownVariantValue("NewFeature".to_owned()))
and calling as_str
on it yields "NewFeature"
.
This match expression is forward-compatible when executed with a newer
version of SDK where the variant InputFormat::NewFeature
is defined.
Specifically, when inputformat
represents NewFeature
,
the execution path will hit the second last match arm as before by virtue of
calling as_str
on InputFormat::NewFeature
also yielding "NewFeature"
.
Explicitly matching on the Unknown
variant should
be avoided for two reasons:
- The inner data
UnknownVariantValue
is opaque, and no further information can be extracted. - It might inadvertently shadow other intended match arms.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Csv
Excel
Json
Orc
Parquet
Unknown(UnknownVariantValue)
Unknown
contains new variants that have been added since this code was generated.
Implementations§
source§impl InputFormat
impl InputFormat
sourcepub fn as_str(&self) -> &str
pub fn as_str(&self) -> &str
Returns the &str
value of the enum member.
Examples found in repository?
More examples
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 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489
pub fn serialize_structure_crate_input_create_dataset_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateDatasetInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_4) = &input.format {
object.key("Format").string(var_4.as_str());
}
if let Some(var_5) = &input.format_options {
#[allow(unused_mut)]
let mut object_6 = object.key("FormatOptions").start_object();
crate::json_ser::serialize_structure_crate_model_format_options(&mut object_6, var_5)?;
object_6.finish();
}
if let Some(var_7) = &input.input {
#[allow(unused_mut)]
let mut object_8 = object.key("Input").start_object();
crate::json_ser::serialize_structure_crate_model_input(&mut object_8, var_7)?;
object_8.finish();
}
if let Some(var_9) = &input.name {
object.key("Name").string(var_9.as_str());
}
if let Some(var_10) = &input.path_options {
#[allow(unused_mut)]
let mut object_11 = object.key("PathOptions").start_object();
crate::json_ser::serialize_structure_crate_model_path_options(&mut object_11, var_10)?;
object_11.finish();
}
if let Some(var_12) = &input.tags {
#[allow(unused_mut)]
let mut object_13 = object.key("Tags").start_object();
for (key_14, value_15) in var_12 {
{
object_13.key(key_14.as_str()).string(value_15.as_str());
}
}
object_13.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_create_profile_job_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateProfileJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_16) = &input.configuration {
#[allow(unused_mut)]
let mut object_17 = object.key("Configuration").start_object();
crate::json_ser::serialize_structure_crate_model_profile_configuration(
&mut object_17,
var_16,
)?;
object_17.finish();
}
if let Some(var_18) = &input.dataset_name {
object.key("DatasetName").string(var_18.as_str());
}
if let Some(var_19) = &input.encryption_key_arn {
object.key("EncryptionKeyArn").string(var_19.as_str());
}
if let Some(var_20) = &input.encryption_mode {
object.key("EncryptionMode").string(var_20.as_str());
}
if let Some(var_21) = &input.job_sample {
#[allow(unused_mut)]
let mut object_22 = object.key("JobSample").start_object();
crate::json_ser::serialize_structure_crate_model_job_sample(&mut object_22, var_21)?;
object_22.finish();
}
if let Some(var_23) = &input.log_subscription {
object.key("LogSubscription").string(var_23.as_str());
}
if input.max_capacity != 0 {
object.key("MaxCapacity").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.max_capacity).into()),
);
}
if input.max_retries != 0 {
object.key("MaxRetries").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.max_retries).into()),
);
}
if let Some(var_24) = &input.name {
object.key("Name").string(var_24.as_str());
}
if let Some(var_25) = &input.output_location {
#[allow(unused_mut)]
let mut object_26 = object.key("OutputLocation").start_object();
crate::json_ser::serialize_structure_crate_model_s3_location(&mut object_26, var_25)?;
object_26.finish();
}
if let Some(var_27) = &input.role_arn {
object.key("RoleArn").string(var_27.as_str());
}
if let Some(var_28) = &input.tags {
#[allow(unused_mut)]
let mut object_29 = object.key("Tags").start_object();
for (key_30, value_31) in var_28 {
{
object_29.key(key_30.as_str()).string(value_31.as_str());
}
}
object_29.finish();
}
if input.timeout != 0 {
object.key("Timeout").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.timeout).into()),
);
}
if let Some(var_32) = &input.validation_configurations {
let mut array_33 = object.key("ValidationConfigurations").start_array();
for item_34 in var_32 {
{
#[allow(unused_mut)]
let mut object_35 = array_33.value().start_object();
crate::json_ser::serialize_structure_crate_model_validation_configuration(
&mut object_35,
item_34,
)?;
object_35.finish();
}
}
array_33.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_create_project_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateProjectInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_36) = &input.dataset_name {
object.key("DatasetName").string(var_36.as_str());
}
if let Some(var_37) = &input.name {
object.key("Name").string(var_37.as_str());
}
if let Some(var_38) = &input.recipe_name {
object.key("RecipeName").string(var_38.as_str());
}
if let Some(var_39) = &input.role_arn {
object.key("RoleArn").string(var_39.as_str());
}
if let Some(var_40) = &input.sample {
#[allow(unused_mut)]
let mut object_41 = object.key("Sample").start_object();
crate::json_ser::serialize_structure_crate_model_sample(&mut object_41, var_40)?;
object_41.finish();
}
if let Some(var_42) = &input.tags {
#[allow(unused_mut)]
let mut object_43 = object.key("Tags").start_object();
for (key_44, value_45) in var_42 {
{
object_43.key(key_44.as_str()).string(value_45.as_str());
}
}
object_43.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_create_recipe_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateRecipeInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_46) = &input.description {
object.key("Description").string(var_46.as_str());
}
if let Some(var_47) = &input.name {
object.key("Name").string(var_47.as_str());
}
if let Some(var_48) = &input.steps {
let mut array_49 = object.key("Steps").start_array();
for item_50 in var_48 {
{
#[allow(unused_mut)]
let mut object_51 = array_49.value().start_object();
crate::json_ser::serialize_structure_crate_model_recipe_step(
&mut object_51,
item_50,
)?;
object_51.finish();
}
}
array_49.finish();
}
if let Some(var_52) = &input.tags {
#[allow(unused_mut)]
let mut object_53 = object.key("Tags").start_object();
for (key_54, value_55) in var_52 {
{
object_53.key(key_54.as_str()).string(value_55.as_str());
}
}
object_53.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_create_recipe_job_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateRecipeJobInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_56) = &input.data_catalog_outputs {
let mut array_57 = object.key("DataCatalogOutputs").start_array();
for item_58 in var_56 {
{
#[allow(unused_mut)]
let mut object_59 = array_57.value().start_object();
crate::json_ser::serialize_structure_crate_model_data_catalog_output(
&mut object_59,
item_58,
)?;
object_59.finish();
}
}
array_57.finish();
}
if let Some(var_60) = &input.database_outputs {
let mut array_61 = object.key("DatabaseOutputs").start_array();
for item_62 in var_60 {
{
#[allow(unused_mut)]
let mut object_63 = array_61.value().start_object();
crate::json_ser::serialize_structure_crate_model_database_output(
&mut object_63,
item_62,
)?;
object_63.finish();
}
}
array_61.finish();
}
if let Some(var_64) = &input.dataset_name {
object.key("DatasetName").string(var_64.as_str());
}
if let Some(var_65) = &input.encryption_key_arn {
object.key("EncryptionKeyArn").string(var_65.as_str());
}
if let Some(var_66) = &input.encryption_mode {
object.key("EncryptionMode").string(var_66.as_str());
}
if let Some(var_67) = &input.log_subscription {
object.key("LogSubscription").string(var_67.as_str());
}
if input.max_capacity != 0 {
object.key("MaxCapacity").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.max_capacity).into()),
);
}
if input.max_retries != 0 {
object.key("MaxRetries").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.max_retries).into()),
);
}
if let Some(var_68) = &input.name {
object.key("Name").string(var_68.as_str());
}
if let Some(var_69) = &input.outputs {
let mut array_70 = object.key("Outputs").start_array();
for item_71 in var_69 {
{
#[allow(unused_mut)]
let mut object_72 = array_70.value().start_object();
crate::json_ser::serialize_structure_crate_model_output(&mut object_72, item_71)?;
object_72.finish();
}
}
array_70.finish();
}
if let Some(var_73) = &input.project_name {
object.key("ProjectName").string(var_73.as_str());
}
if let Some(var_74) = &input.recipe_reference {
#[allow(unused_mut)]
let mut object_75 = object.key("RecipeReference").start_object();
crate::json_ser::serialize_structure_crate_model_recipe_reference(&mut object_75, var_74)?;
object_75.finish();
}
if let Some(var_76) = &input.role_arn {
object.key("RoleArn").string(var_76.as_str());
}
if let Some(var_77) = &input.tags {
#[allow(unused_mut)]
let mut object_78 = object.key("Tags").start_object();
for (key_79, value_80) in var_77 {
{
object_78.key(key_79.as_str()).string(value_80.as_str());
}
}
object_78.finish();
}
if input.timeout != 0 {
object.key("Timeout").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((input.timeout).into()),
);
}
Ok(())
}
pub fn serialize_structure_crate_input_create_ruleset_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateRulesetInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_81) = &input.description {
object.key("Description").string(var_81.as_str());
}
if let Some(var_82) = &input.name {
object.key("Name").string(var_82.as_str());
}
if let Some(var_83) = &input.rules {
let mut array_84 = object.key("Rules").start_array();
for item_85 in var_83 {
{
#[allow(unused_mut)]
let mut object_86 = array_84.value().start_object();
crate::json_ser::serialize_structure_crate_model_rule(&mut object_86, item_85)?;
object_86.finish();
}
}
array_84.finish();
}
if let Some(var_87) = &input.tags {
#[allow(unused_mut)]
let mut object_88 = object.key("Tags").start_object();
for (key_89, value_90) in var_87 {
{
object_88.key(key_89.as_str()).string(value_90.as_str());
}
}
object_88.finish();
}
if let Some(var_91) = &input.target_arn {
object.key("TargetArn").string(var_91.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_create_schedule_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateScheduleInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_92) = &input.cron_expression {
object.key("CronExpression").string(var_92.as_str());
}
if let Some(var_93) = &input.job_names {
let mut array_94 = object.key("JobNames").start_array();
for item_95 in var_93 {
{
array_94.value().string(item_95.as_str());
}
}
array_94.finish();
}
if let Some(var_96) = &input.name {
object.key("Name").string(var_96.as_str());
}
if let Some(var_97) = &input.tags {
#[allow(unused_mut)]
let mut object_98 = object.key("Tags").start_object();
for (key_99, value_100) in var_97 {
{
object_98.key(key_99.as_str()).string(value_100.as_str());
}
}
object_98.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_publish_recipe_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::PublishRecipeInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_101) = &input.description {
object.key("Description").string(var_101.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_send_project_session_action_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::SendProjectSessionActionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_102) = &input.client_session_id {
object.key("ClientSessionId").string(var_102.as_str());
}
if input.preview {
object.key("Preview").boolean(input.preview);
}
if let Some(var_103) = &input.recipe_step {
#[allow(unused_mut)]
let mut object_104 = object.key("RecipeStep").start_object();
crate::json_ser::serialize_structure_crate_model_recipe_step(&mut object_104, var_103)?;
object_104.finish();
}
if let Some(var_105) = &input.step_index {
object.key("StepIndex").number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_105).into()),
);
}
if let Some(var_106) = &input.view_frame {
#[allow(unused_mut)]
let mut object_107 = object.key("ViewFrame").start_object();
crate::json_ser::serialize_structure_crate_model_view_frame(&mut object_107, var_106)?;
object_107.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_start_project_session_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::StartProjectSessionInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if input.assume_control {
object.key("AssumeControl").boolean(input.assume_control);
}
Ok(())
}
pub fn serialize_structure_crate_input_tag_resource_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::TagResourceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_108) = &input.tags {
#[allow(unused_mut)]
let mut object_109 = object.key("Tags").start_object();
for (key_110, value_111) in var_108 {
{
object_109.key(key_110.as_str()).string(value_111.as_str());
}
}
object_109.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_update_dataset_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::UpdateDatasetInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_112) = &input.format {
object.key("Format").string(var_112.as_str());
}
if let Some(var_113) = &input.format_options {
#[allow(unused_mut)]
let mut object_114 = object.key("FormatOptions").start_object();
crate::json_ser::serialize_structure_crate_model_format_options(&mut object_114, var_113)?;
object_114.finish();
}
if let Some(var_115) = &input.input {
#[allow(unused_mut)]
let mut object_116 = object.key("Input").start_object();
crate::json_ser::serialize_structure_crate_model_input(&mut object_116, var_115)?;
object_116.finish();
}
if let Some(var_117) = &input.path_options {
#[allow(unused_mut)]
let mut object_118 = object.key("PathOptions").start_object();
crate::json_ser::serialize_structure_crate_model_path_options(&mut object_118, var_117)?;
object_118.finish();
}
Ok(())
}
Trait Implementations§
source§impl AsRef<str> for InputFormat
impl AsRef<str> for InputFormat
source§impl Clone for InputFormat
impl Clone for InputFormat
source§fn clone(&self) -> InputFormat
fn clone(&self) -> InputFormat
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for InputFormat
impl Debug for InputFormat
source§impl From<&str> for InputFormat
impl From<&str> for InputFormat
source§impl FromStr for InputFormat
impl FromStr for InputFormat
source§impl Hash for InputFormat
impl Hash for InputFormat
source§impl Ord for InputFormat
impl Ord for InputFormat
source§fn cmp(&self, other: &InputFormat) -> Ordering
fn cmp(&self, other: &InputFormat) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<InputFormat> for InputFormat
impl PartialEq<InputFormat> for InputFormat
source§fn eq(&self, other: &InputFormat) -> bool
fn eq(&self, other: &InputFormat) -> bool
source§impl PartialOrd<InputFormat> for InputFormat
impl PartialOrd<InputFormat> for InputFormat
source§fn partial_cmp(&self, other: &InputFormat) -> Option<Ordering>
fn partial_cmp(&self, other: &InputFormat) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for InputFormat
impl StructuralEq for InputFormat
impl StructuralPartialEq for InputFormat
Auto Trait Implementations§
impl RefUnwindSafe for InputFormat
impl Send for InputFormat
impl Sync for InputFormat
impl Unpin for InputFormat
impl UnwindSafe for InputFormat
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.