aws_sdk_devicefarm/types/
_device_filter_attribute.rs1#[allow(missing_docs)] #[non_exhaustive]
51#[derive(
52 ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
53)]
54pub enum DeviceFilterAttribute {
55 #[allow(missing_docs)] Arn,
57 #[allow(missing_docs)] Availability,
59 #[allow(missing_docs)] FleetType,
61 #[allow(missing_docs)] FormFactor,
63 #[allow(missing_docs)] InstanceArn,
65 #[allow(missing_docs)] InstanceLabels,
67 #[allow(missing_docs)] Manufacturer,
69 #[allow(missing_docs)] Model,
71 #[allow(missing_docs)] OsVersion,
73 #[allow(missing_docs)] Platform,
75 #[allow(missing_docs)] RemoteAccessEnabled,
77 #[allow(missing_docs)] RemoteDebugEnabled,
79 #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
81 Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
82}
83impl ::std::convert::From<&str> for DeviceFilterAttribute {
84 fn from(s: &str) -> Self {
85 match s {
86 "ARN" => DeviceFilterAttribute::Arn,
87 "AVAILABILITY" => DeviceFilterAttribute::Availability,
88 "FLEET_TYPE" => DeviceFilterAttribute::FleetType,
89 "FORM_FACTOR" => DeviceFilterAttribute::FormFactor,
90 "INSTANCE_ARN" => DeviceFilterAttribute::InstanceArn,
91 "INSTANCE_LABELS" => DeviceFilterAttribute::InstanceLabels,
92 "MANUFACTURER" => DeviceFilterAttribute::Manufacturer,
93 "MODEL" => DeviceFilterAttribute::Model,
94 "OS_VERSION" => DeviceFilterAttribute::OsVersion,
95 "PLATFORM" => DeviceFilterAttribute::Platform,
96 "REMOTE_ACCESS_ENABLED" => DeviceFilterAttribute::RemoteAccessEnabled,
97 "REMOTE_DEBUG_ENABLED" => DeviceFilterAttribute::RemoteDebugEnabled,
98 other => DeviceFilterAttribute::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
99 }
100 }
101}
102impl ::std::str::FromStr for DeviceFilterAttribute {
103 type Err = ::std::convert::Infallible;
104
105 fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
106 ::std::result::Result::Ok(DeviceFilterAttribute::from(s))
107 }
108}
109impl DeviceFilterAttribute {
110 pub fn as_str(&self) -> &str {
112 match self {
113 DeviceFilterAttribute::Arn => "ARN",
114 DeviceFilterAttribute::Availability => "AVAILABILITY",
115 DeviceFilterAttribute::FleetType => "FLEET_TYPE",
116 DeviceFilterAttribute::FormFactor => "FORM_FACTOR",
117 DeviceFilterAttribute::InstanceArn => "INSTANCE_ARN",
118 DeviceFilterAttribute::InstanceLabels => "INSTANCE_LABELS",
119 DeviceFilterAttribute::Manufacturer => "MANUFACTURER",
120 DeviceFilterAttribute::Model => "MODEL",
121 DeviceFilterAttribute::OsVersion => "OS_VERSION",
122 DeviceFilterAttribute::Platform => "PLATFORM",
123 DeviceFilterAttribute::RemoteAccessEnabled => "REMOTE_ACCESS_ENABLED",
124 DeviceFilterAttribute::RemoteDebugEnabled => "REMOTE_DEBUG_ENABLED",
125 DeviceFilterAttribute::Unknown(value) => value.as_str(),
126 }
127 }
128 pub const fn values() -> &'static [&'static str] {
130 &[
131 "ARN",
132 "AVAILABILITY",
133 "FLEET_TYPE",
134 "FORM_FACTOR",
135 "INSTANCE_ARN",
136 "INSTANCE_LABELS",
137 "MANUFACTURER",
138 "MODEL",
139 "OS_VERSION",
140 "PLATFORM",
141 "REMOTE_ACCESS_ENABLED",
142 "REMOTE_DEBUG_ENABLED",
143 ]
144 }
145}
146impl ::std::convert::AsRef<str> for DeviceFilterAttribute {
147 fn as_ref(&self) -> &str {
148 self.as_str()
149 }
150}
151impl DeviceFilterAttribute {
152 pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
156 match Self::from(value) {
157 #[allow(deprecated)]
158 Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
159 known => Ok(known),
160 }
161 }
162}
163impl ::std::fmt::Display for DeviceFilterAttribute {
164 fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
165 match self {
166 DeviceFilterAttribute::Arn => write!(f, "ARN"),
167 DeviceFilterAttribute::Availability => write!(f, "AVAILABILITY"),
168 DeviceFilterAttribute::FleetType => write!(f, "FLEET_TYPE"),
169 DeviceFilterAttribute::FormFactor => write!(f, "FORM_FACTOR"),
170 DeviceFilterAttribute::InstanceArn => write!(f, "INSTANCE_ARN"),
171 DeviceFilterAttribute::InstanceLabels => write!(f, "INSTANCE_LABELS"),
172 DeviceFilterAttribute::Manufacturer => write!(f, "MANUFACTURER"),
173 DeviceFilterAttribute::Model => write!(f, "MODEL"),
174 DeviceFilterAttribute::OsVersion => write!(f, "OS_VERSION"),
175 DeviceFilterAttribute::Platform => write!(f, "PLATFORM"),
176 DeviceFilterAttribute::RemoteAccessEnabled => write!(f, "REMOTE_ACCESS_ENABLED"),
177 DeviceFilterAttribute::RemoteDebugEnabled => write!(f, "REMOTE_DEBUG_ENABLED"),
178 DeviceFilterAttribute::Unknown(value) => write!(f, "{value}"),
179 }
180 }
181}