Enum aws_sdk_quicksight::model::DataSourceType
source · #[non_exhaustive]
pub enum DataSourceType {
Show 26 variants
AdobeAnalytics,
AmazonElasticsearch,
AmazonOpensearch,
Athena,
Aurora,
AuroraPostgresql,
AwsIotAnalytics,
Exasol,
Github,
Jira,
Mariadb,
Mysql,
Oracle,
Postgresql,
Presto,
Redshift,
S3,
Salesforce,
Servicenow,
Snowflake,
Spark,
Sqlserver,
Teradata,
Timestream,
Twitter,
Unknown(UnknownVariantValue),
}Expand description
When writing a match expression against DataSourceType, 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 datasourcetype = unimplemented!();
match datasourcetype {
DataSourceType::AdobeAnalytics => { /* ... */ },
DataSourceType::AmazonElasticsearch => { /* ... */ },
DataSourceType::AmazonOpensearch => { /* ... */ },
DataSourceType::Athena => { /* ... */ },
DataSourceType::Aurora => { /* ... */ },
DataSourceType::AuroraPostgresql => { /* ... */ },
DataSourceType::AwsIotAnalytics => { /* ... */ },
DataSourceType::Exasol => { /* ... */ },
DataSourceType::Github => { /* ... */ },
DataSourceType::Jira => { /* ... */ },
DataSourceType::Mariadb => { /* ... */ },
DataSourceType::Mysql => { /* ... */ },
DataSourceType::Oracle => { /* ... */ },
DataSourceType::Postgresql => { /* ... */ },
DataSourceType::Presto => { /* ... */ },
DataSourceType::Redshift => { /* ... */ },
DataSourceType::S3 => { /* ... */ },
DataSourceType::Salesforce => { /* ... */ },
DataSourceType::Servicenow => { /* ... */ },
DataSourceType::Snowflake => { /* ... */ },
DataSourceType::Spark => { /* ... */ },
DataSourceType::Sqlserver => { /* ... */ },
DataSourceType::Teradata => { /* ... */ },
DataSourceType::Timestream => { /* ... */ },
DataSourceType::Twitter => { /* ... */ },
other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
_ => { /* ... */ },
}
The above code demonstrates that when datasourcetype represents
NewFeature, the execution path will lead to the second last match arm,
even though the enum does not contain a variant DataSourceType::NewFeature
in the current version of SDK. The reason is that the variable other,
created by the @ operator, is bound to
DataSourceType::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 DataSourceType::NewFeature is defined.
Specifically, when datasourcetype represents NewFeature,
the execution path will hit the second last match arm as before by virtue of
calling as_str on DataSourceType::NewFeature also yielding "NewFeature".
Explicitly matching on the Unknown variant should
be avoided for two reasons:
- The inner data
UnknownVariantValueis 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
AdobeAnalytics
AmazonElasticsearch
AmazonOpensearch
Athena
Aurora
AuroraPostgresql
AwsIotAnalytics
Exasol
Github
Jira
Mariadb
Mysql
Oracle
Postgresql
Presto
Redshift
S3
Salesforce
Servicenow
Snowflake
Spark
Sqlserver
Teradata
Timestream
Unknown(UnknownVariantValue)
Unknown contains new variants that have been added since this code was generated.
Implementations§
source§impl DataSourceType
impl DataSourceType
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
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
pub fn serialize_structure_crate_input_create_data_source_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::CreateDataSourceInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_98) = &input.credentials {
#[allow(unused_mut)]
let mut object_99 = object.key("Credentials").start_object();
crate::json_ser::serialize_structure_crate_model_data_source_credentials(
&mut object_99,
var_98,
)?;
object_99.finish();
}
if let Some(var_100) = &input.data_source_id {
object.key("DataSourceId").string(var_100.as_str());
}
if let Some(var_101) = &input.data_source_parameters {
#[allow(unused_mut)]
let mut object_102 = object.key("DataSourceParameters").start_object();
crate::json_ser::serialize_union_crate_model_data_source_parameters(
&mut object_102,
var_101,
)?;
object_102.finish();
}
if let Some(var_103) = &input.name {
object.key("Name").string(var_103.as_str());
}
if let Some(var_104) = &input.permissions {
let mut array_105 = object.key("Permissions").start_array();
for item_106 in var_104 {
{
#[allow(unused_mut)]
let mut object_107 = array_105.value().start_object();
crate::json_ser::serialize_structure_crate_model_resource_permission(
&mut object_107,
item_106,
)?;
object_107.finish();
}
}
array_105.finish();
}
if let Some(var_108) = &input.ssl_properties {
#[allow(unused_mut)]
let mut object_109 = object.key("SslProperties").start_object();
crate::json_ser::serialize_structure_crate_model_ssl_properties(&mut object_109, var_108)?;
object_109.finish();
}
if let Some(var_110) = &input.tags {
let mut array_111 = object.key("Tags").start_array();
for item_112 in var_110 {
{
#[allow(unused_mut)]
let mut object_113 = array_111.value().start_object();
crate::json_ser::serialize_structure_crate_model_tag(&mut object_113, item_112)?;
object_113.finish();
}
}
array_111.finish();
}
if let Some(var_114) = &input.r#type {
object.key("Type").string(var_114.as_str());
}
if let Some(var_115) = &input.vpc_connection_properties {
#[allow(unused_mut)]
let mut object_116 = object.key("VpcConnectionProperties").start_object();
crate::json_ser::serialize_structure_crate_model_vpc_connection_properties(
&mut object_116,
var_115,
)?;
object_116.finish();
}
Ok(())
}Trait Implementations§
source§impl AsRef<str> for DataSourceType
impl AsRef<str> for DataSourceType
source§impl Clone for DataSourceType
impl Clone for DataSourceType
source§fn clone(&self) -> DataSourceType
fn clone(&self) -> DataSourceType
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for DataSourceType
impl Debug for DataSourceType
source§impl From<&str> for DataSourceType
impl From<&str> for DataSourceType
source§impl FromStr for DataSourceType
impl FromStr for DataSourceType
source§impl Hash for DataSourceType
impl Hash for DataSourceType
source§impl Ord for DataSourceType
impl Ord for DataSourceType
source§fn cmp(&self, other: &DataSourceType) -> Ordering
fn cmp(&self, other: &DataSourceType) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<DataSourceType> for DataSourceType
impl PartialEq<DataSourceType> for DataSourceType
source§fn eq(&self, other: &DataSourceType) -> bool
fn eq(&self, other: &DataSourceType) -> bool
source§impl PartialOrd<DataSourceType> for DataSourceType
impl PartialOrd<DataSourceType> for DataSourceType
source§fn partial_cmp(&self, other: &DataSourceType) -> Option<Ordering>
fn partial_cmp(&self, other: &DataSourceType) -> 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 DataSourceType
impl StructuralEq for DataSourceType
impl StructuralPartialEq for DataSourceType
Auto Trait Implementations§
impl RefUnwindSafe for DataSourceType
impl Send for DataSourceType
impl Sync for DataSourceType
impl Unpin for DataSourceType
impl UnwindSafe for DataSourceType
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.