#[non_exhaustive]
pub enum ExportableAutoScalingGroupField {
Show 55 variants
AccountId,
AutoScalingGroupArn,
AutoScalingGroupName,
CurrentConfigurationDesiredCapacity,
CurrentConfigurationInstanceType,
CurrentConfigurationMaxSize,
CurrentConfigurationMinSize,
CurrentMemory,
CurrentNetwork,
CurrentOnDemandPrice,
CurrentPerformanceRisk,
CurrentStandardOneYearNoUpfrontReservedPrice,
CurrentStandardThreeYearNoUpfrontReservedPrice,
CurrentStorage,
CurrentVcpus,
EffectiveRecommendationPreferencesCpuVendorArchitectures,
EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics,
EffectiveRecommendationPreferencesInferredWorkloadTypes,
Finding,
InferredWorkloadTypes,
LastRefreshTimestamp,
LookbackPeriodInDays,
RecommendationOptionsConfigurationDesiredCapacity,
RecommendationOptionsConfigurationInstanceType,
RecommendationOptionsConfigurationMaxSize,
RecommendationOptionsConfigurationMinSize,
RecommendationOptionsEstimatedMonthlySavingsCurrency,
RecommendationOptionsEstimatedMonthlySavingsValue,
RecommendationOptionsMemory,
RecommendationOptionsMigrationEffort,
RecommendationOptionsNetwork,
RecommendationOptionsOnDemandPrice,
RecommendationOptionsPerformanceRisk,
RecommendationOptionsProjectedUtilizationMetricsCpuMaximum,
RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum,
RecommendationOptionsSavingsOpportunityPercentage,
RecommendationOptionsStandardOneYearNoUpfrontReservedPrice,
RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice,
RecommendationOptionsStorage,
RecommendationOptionsVcpus,
UtilizationMetricsCpuMaximum,
UtilizationMetricsDiskReadBytesPerSecondMaximum,
UtilizationMetricsDiskReadOpsPerSecondMaximum,
UtilizationMetricsDiskWriteBytesPerSecondMaximum,
UtilizationMetricsDiskWriteOpsPerSecondMaximum,
UtilizationMetricsEbsReadBytesPerSecondMaximum,
UtilizationMetricsEbsReadOpsPerSecondMaximum,
UtilizationMetricsEbsWriteBytesPerSecondMaximum,
UtilizationMetricsEbsWriteOpsPerSecondMaximum,
UtilizationMetricsMemoryMaximum,
UtilizationMetricsNetworkInBytesPerSecondMaximum,
UtilizationMetricsNetworkOutBytesPerSecondMaximum,
UtilizationMetricsNetworkPacketsInPerSecondMaximum,
UtilizationMetricsNetworkPacketsOutPerSecondMaximum,
Unknown(UnknownVariantValue),
}
Expand description
When writing a match expression against ExportableAutoScalingGroupField
, 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 exportableautoscalinggroupfield = unimplemented!();
match exportableautoscalinggroupfield {
ExportableAutoScalingGroupField::AccountId => { /* ... */ },
ExportableAutoScalingGroupField::AutoScalingGroupArn => { /* ... */ },
ExportableAutoScalingGroupField::AutoScalingGroupName => { /* ... */ },
ExportableAutoScalingGroupField::CurrentConfigurationDesiredCapacity => { /* ... */ },
ExportableAutoScalingGroupField::CurrentConfigurationInstanceType => { /* ... */ },
ExportableAutoScalingGroupField::CurrentConfigurationMaxSize => { /* ... */ },
ExportableAutoScalingGroupField::CurrentConfigurationMinSize => { /* ... */ },
ExportableAutoScalingGroupField::CurrentMemory => { /* ... */ },
ExportableAutoScalingGroupField::CurrentNetwork => { /* ... */ },
ExportableAutoScalingGroupField::CurrentOnDemandPrice => { /* ... */ },
ExportableAutoScalingGroupField::CurrentPerformanceRisk => { /* ... */ },
ExportableAutoScalingGroupField::CurrentStandardOneYearNoUpfrontReservedPrice => { /* ... */ },
ExportableAutoScalingGroupField::CurrentStandardThreeYearNoUpfrontReservedPrice => { /* ... */ },
ExportableAutoScalingGroupField::CurrentStorage => { /* ... */ },
ExportableAutoScalingGroupField::CurrentVcpus => { /* ... */ },
ExportableAutoScalingGroupField::EffectiveRecommendationPreferencesCpuVendorArchitectures => { /* ... */ },
ExportableAutoScalingGroupField::EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics => { /* ... */ },
ExportableAutoScalingGroupField::EffectiveRecommendationPreferencesInferredWorkloadTypes => { /* ... */ },
ExportableAutoScalingGroupField::Finding => { /* ... */ },
ExportableAutoScalingGroupField::InferredWorkloadTypes => { /* ... */ },
ExportableAutoScalingGroupField::LastRefreshTimestamp => { /* ... */ },
ExportableAutoScalingGroupField::LookbackPeriodInDays => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsConfigurationDesiredCapacity => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsConfigurationInstanceType => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsConfigurationMaxSize => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsConfigurationMinSize => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsEstimatedMonthlySavingsCurrency => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsEstimatedMonthlySavingsValue => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsMemory => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsMigrationEffort => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsNetwork => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsOnDemandPrice => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsPerformanceRisk => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsProjectedUtilizationMetricsCpuMaximum => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsSavingsOpportunityPercentage => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsStandardOneYearNoUpfrontReservedPrice => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsStorage => { /* ... */ },
ExportableAutoScalingGroupField::RecommendationOptionsVcpus => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsCpuMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsDiskReadBytesPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsDiskReadOpsPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsDiskWriteBytesPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsDiskWriteOpsPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsEbsReadBytesPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsEbsReadOpsPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsEbsWriteBytesPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsEbsWriteOpsPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsMemoryMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsNetworkInBytesPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsNetworkOutBytesPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsNetworkPacketsInPerSecondMaximum => { /* ... */ },
ExportableAutoScalingGroupField::UtilizationMetricsNetworkPacketsOutPerSecondMaximum => { /* ... */ },
other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
_ => { /* ... */ },
}
The above code demonstrates that when exportableautoscalinggroupfield
represents
NewFeature
, the execution path will lead to the second last match arm,
even though the enum does not contain a variant ExportableAutoScalingGroupField::NewFeature
in the current version of SDK. The reason is that the variable other
,
created by the @
operator, is bound to
ExportableAutoScalingGroupField::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 ExportableAutoScalingGroupField::NewFeature
is defined.
Specifically, when exportableautoscalinggroupfield
represents NewFeature
,
the execution path will hit the second last match arm as before by virtue of
calling as_str
on ExportableAutoScalingGroupField::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
AccountId
AutoScalingGroupArn
AutoScalingGroupName
CurrentConfigurationDesiredCapacity
CurrentConfigurationInstanceType
CurrentConfigurationMaxSize
CurrentConfigurationMinSize
CurrentMemory
CurrentNetwork
CurrentOnDemandPrice
CurrentPerformanceRisk
CurrentStandardOneYearNoUpfrontReservedPrice
CurrentStandardThreeYearNoUpfrontReservedPrice
CurrentStorage
CurrentVcpus
EffectiveRecommendationPreferencesCpuVendorArchitectures
EffectiveRecommendationPreferencesEnhancedInfrastructureMetrics
EffectiveRecommendationPreferencesInferredWorkloadTypes
Finding
InferredWorkloadTypes
LastRefreshTimestamp
LookbackPeriodInDays
RecommendationOptionsConfigurationDesiredCapacity
RecommendationOptionsConfigurationInstanceType
RecommendationOptionsConfigurationMaxSize
RecommendationOptionsConfigurationMinSize
RecommendationOptionsEstimatedMonthlySavingsCurrency
RecommendationOptionsEstimatedMonthlySavingsValue
RecommendationOptionsMemory
RecommendationOptionsMigrationEffort
RecommendationOptionsNetwork
RecommendationOptionsOnDemandPrice
RecommendationOptionsPerformanceRisk
RecommendationOptionsProjectedUtilizationMetricsCpuMaximum
RecommendationOptionsProjectedUtilizationMetricsMemoryMaximum
RecommendationOptionsSavingsOpportunityPercentage
RecommendationOptionsStandardOneYearNoUpfrontReservedPrice
RecommendationOptionsStandardThreeYearNoUpfrontReservedPrice
RecommendationOptionsStorage
RecommendationOptionsVcpus
UtilizationMetricsCpuMaximum
UtilizationMetricsDiskReadBytesPerSecondMaximum
UtilizationMetricsDiskReadOpsPerSecondMaximum
UtilizationMetricsDiskWriteBytesPerSecondMaximum
UtilizationMetricsDiskWriteOpsPerSecondMaximum
UtilizationMetricsEbsReadBytesPerSecondMaximum
UtilizationMetricsEbsReadOpsPerSecondMaximum
UtilizationMetricsEbsWriteBytesPerSecondMaximum
UtilizationMetricsEbsWriteOpsPerSecondMaximum
UtilizationMetricsMemoryMaximum
UtilizationMetricsNetworkInBytesPerSecondMaximum
UtilizationMetricsNetworkOutBytesPerSecondMaximum
UtilizationMetricsNetworkPacketsInPerSecondMaximum
UtilizationMetricsNetworkPacketsOutPerSecondMaximum
Unknown(UnknownVariantValue)
Unknown
contains new variants that have been added since this code was generated.
Implementations§
source§impl ExportableAutoScalingGroupField
impl ExportableAutoScalingGroupField
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
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
pub fn serialize_structure_crate_input_export_auto_scaling_group_recommendations_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::ExportAutoScalingGroupRecommendationsInput,
) -> Result<(), aws_smithy_http::operation::error::SerializationError> {
if let Some(var_16) = &input.account_ids {
let mut array_17 = object.key("accountIds").start_array();
for item_18 in var_16 {
{
array_17.value().string(item_18.as_str());
}
}
array_17.finish();
}
if let Some(var_19) = &input.filters {
let mut array_20 = object.key("filters").start_array();
for item_21 in var_19 {
{
#[allow(unused_mut)]
let mut object_22 = array_20.value().start_object();
crate::json_ser::serialize_structure_crate_model_filter(&mut object_22, item_21)?;
object_22.finish();
}
}
array_20.finish();
}
if let Some(var_23) = &input.fields_to_export {
let mut array_24 = object.key("fieldsToExport").start_array();
for item_25 in var_23 {
{
array_24.value().string(item_25.as_str());
}
}
array_24.finish();
}
if let Some(var_26) = &input.s3_destination_config {
#[allow(unused_mut)]
let mut object_27 = object.key("s3DestinationConfig").start_object();
crate::json_ser::serialize_structure_crate_model_s3_destination_config(
&mut object_27,
var_26,
)?;
object_27.finish();
}
if let Some(var_28) = &input.file_format {
object.key("fileFormat").string(var_28.as_str());
}
if input.include_member_accounts {
object
.key("includeMemberAccounts")
.boolean(input.include_member_accounts);
}
if let Some(var_29) = &input.recommendation_preferences {
#[allow(unused_mut)]
let mut object_30 = object.key("recommendationPreferences").start_object();
crate::json_ser::serialize_structure_crate_model_recommendation_preferences(
&mut object_30,
var_29,
)?;
object_30.finish();
}
Ok(())
}
Trait Implementations§
source§impl AsRef<str> for ExportableAutoScalingGroupField
impl AsRef<str> for ExportableAutoScalingGroupField
source§impl Clone for ExportableAutoScalingGroupField
impl Clone for ExportableAutoScalingGroupField
source§fn clone(&self) -> ExportableAutoScalingGroupField
fn clone(&self) -> ExportableAutoScalingGroupField
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl From<&str> for ExportableAutoScalingGroupField
impl From<&str> for ExportableAutoScalingGroupField
source§impl Ord for ExportableAutoScalingGroupField
impl Ord for ExportableAutoScalingGroupField
source§fn cmp(&self, other: &ExportableAutoScalingGroupField) -> Ordering
fn cmp(&self, other: &ExportableAutoScalingGroupField) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq<ExportableAutoScalingGroupField> for ExportableAutoScalingGroupField
impl PartialEq<ExportableAutoScalingGroupField> for ExportableAutoScalingGroupField
source§fn eq(&self, other: &ExportableAutoScalingGroupField) -> bool
fn eq(&self, other: &ExportableAutoScalingGroupField) -> bool
source§impl PartialOrd<ExportableAutoScalingGroupField> for ExportableAutoScalingGroupField
impl PartialOrd<ExportableAutoScalingGroupField> for ExportableAutoScalingGroupField
source§fn partial_cmp(
&self,
other: &ExportableAutoScalingGroupField
) -> Option<Ordering>
fn partial_cmp(
&self,
other: &ExportableAutoScalingGroupField
) -> 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 ExportableAutoScalingGroupField
impl StructuralEq for ExportableAutoScalingGroupField
impl StructuralPartialEq for ExportableAutoScalingGroupField
Auto Trait Implementations§
impl RefUnwindSafe for ExportableAutoScalingGroupField
impl Send for ExportableAutoScalingGroupField
impl Sync for ExportableAutoScalingGroupField
impl Unpin for ExportableAutoScalingGroupField
impl UnwindSafe for ExportableAutoScalingGroupField
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.