1 - | // Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
|
2 - |
|
3 - | /// When writing a match expression against `GuardrailPiiEntityType`, it is important to ensure
|
4 - | /// your code is forward-compatible. That is, if a match arm handles a case for a
|
5 - | /// feature that is supported by the service but has not been represented as an enum
|
6 - | /// variant in a current version of SDK, your code should continue to work when you
|
7 - | /// upgrade SDK to a future version in which the enum does include a variant for that
|
8 - | /// feature.
|
9 - | ///
|
10 - | /// Here is an example of how you can make a match expression forward-compatible:
|
11 - | ///
|
12 - | /// ```text
|
13 - | /// # let guardrailpiientitytype = unimplemented!();
|
14 - | /// match guardrailpiientitytype {
|
15 - | /// GuardrailPiiEntityType::Address => { /* ... */ },
|
16 - | /// GuardrailPiiEntityType::Age => { /* ... */ },
|
17 - | /// GuardrailPiiEntityType::AwsAccessKey => { /* ... */ },
|
18 - | /// GuardrailPiiEntityType::AwsSecretKey => { /* ... */ },
|
19 - | /// GuardrailPiiEntityType::CaHealthNumber => { /* ... */ },
|
20 - | /// GuardrailPiiEntityType::CaSocialInsuranceNumber => { /* ... */ },
|
21 - | /// GuardrailPiiEntityType::CreditDebitCardCvv => { /* ... */ },
|
22 - | /// GuardrailPiiEntityType::CreditDebitCardExpiry => { /* ... */ },
|
23 - | /// GuardrailPiiEntityType::CreditDebitCardNumber => { /* ... */ },
|
24 - | /// GuardrailPiiEntityType::DriverId => { /* ... */ },
|
25 - | /// GuardrailPiiEntityType::Email => { /* ... */ },
|
26 - | /// GuardrailPiiEntityType::InternationalBankAccountNumber => { /* ... */ },
|
27 - | /// GuardrailPiiEntityType::IpAddress => { /* ... */ },
|
28 - | /// GuardrailPiiEntityType::LicensePlate => { /* ... */ },
|
29 - | /// GuardrailPiiEntityType::MacAddress => { /* ... */ },
|
30 - | /// GuardrailPiiEntityType::Name => { /* ... */ },
|
31 - | /// GuardrailPiiEntityType::Password => { /* ... */ },
|
32 - | /// GuardrailPiiEntityType::Phone => { /* ... */ },
|
33 - | /// GuardrailPiiEntityType::Pin => { /* ... */ },
|
34 - | /// GuardrailPiiEntityType::SwiftCode => { /* ... */ },
|
35 - | /// GuardrailPiiEntityType::UkNationalHealthServiceNumber => { /* ... */ },
|
36 - | /// GuardrailPiiEntityType::UkNationalInsuranceNumber => { /* ... */ },
|
37 - | /// GuardrailPiiEntityType::UkUniqueTaxpayerReferenceNumber => { /* ... */ },
|
38 - | /// GuardrailPiiEntityType::Url => { /* ... */ },
|
39 - | /// GuardrailPiiEntityType::Username => { /* ... */ },
|
40 - | /// GuardrailPiiEntityType::UsBankAccountNumber => { /* ... */ },
|
41 - | /// GuardrailPiiEntityType::UsBankRoutingNumber => { /* ... */ },
|
42 - | /// GuardrailPiiEntityType::UsIndividualTaxIdentificationNumber => { /* ... */ },
|
43 - | /// GuardrailPiiEntityType::UsPassportNumber => { /* ... */ },
|
44 - | /// GuardrailPiiEntityType::UsSocialSecurityNumber => { /* ... */ },
|
45 - | /// GuardrailPiiEntityType::VehicleIdentificationNumber => { /* ... */ },
|
46 - | /// other @ _ if other.as_str() == "NewFeature" => { /* handles a case for `NewFeature` */ },
|
47 - | /// _ => { /* ... */ },
|
48 - | /// }
|
49 - | /// ```
|
50 - | /// The above code demonstrates that when `guardrailpiientitytype` represents
|
51 - | /// `NewFeature`, the execution path will lead to the second last match arm,
|
52 - | /// even though the enum does not contain a variant `GuardrailPiiEntityType::NewFeature`
|
53 - | /// in the current version of SDK. The reason is that the variable `other`,
|
54 - | /// created by the `@` operator, is bound to
|
55 - | /// `GuardrailPiiEntityType::Unknown(UnknownVariantValue("NewFeature".to_owned()))`
|
56 - | /// and calling `as_str` on it yields `"NewFeature"`.
|
57 - | /// This match expression is forward-compatible when executed with a newer
|
58 - | /// version of SDK where the variant `GuardrailPiiEntityType::NewFeature` is defined.
|
59 - | /// Specifically, when `guardrailpiientitytype` represents `NewFeature`,
|
60 - | /// the execution path will hit the second last match arm as before by virtue of
|
61 - | /// calling `as_str` on `GuardrailPiiEntityType::NewFeature` also yielding `"NewFeature"`.
|
62 - | ///
|
63 - | /// Explicitly matching on the `Unknown` variant should
|
64 - | /// be avoided for two reasons:
|
65 - | /// - The inner data `UnknownVariantValue` is opaque, and no further information can be extracted.
|
66 - | /// - It might inadvertently shadow other intended match arms.
|
67 - | ///
|
68 - | #[allow(missing_docs)] // documentation missing in model
|
69 - | #[non_exhaustive]
|
70 - | #[derive(
|
71 - | ::std::clone::Clone, ::std::cmp::Eq, ::std::cmp::Ord, ::std::cmp::PartialEq, ::std::cmp::PartialOrd, ::std::fmt::Debug, ::std::hash::Hash,
|
72 - | )]
|
73 - | pub enum GuardrailPiiEntityType {
|
74 - | #[allow(missing_docs)] // documentation missing in model
|
75 - | Address,
|
76 - | #[allow(missing_docs)] // documentation missing in model
|
77 - | Age,
|
78 - | #[allow(missing_docs)] // documentation missing in model
|
79 - | AwsAccessKey,
|
80 - | #[allow(missing_docs)] // documentation missing in model
|
81 - | AwsSecretKey,
|
82 - | #[allow(missing_docs)] // documentation missing in model
|
83 - | CaHealthNumber,
|
84 - | #[allow(missing_docs)] // documentation missing in model
|
85 - | CaSocialInsuranceNumber,
|
86 - | #[allow(missing_docs)] // documentation missing in model
|
87 - | CreditDebitCardCvv,
|
88 - | #[allow(missing_docs)] // documentation missing in model
|
89 - | CreditDebitCardExpiry,
|
90 - | #[allow(missing_docs)] // documentation missing in model
|
91 - | CreditDebitCardNumber,
|
92 - | #[allow(missing_docs)] // documentation missing in model
|
93 - | DriverId,
|
94 - | #[allow(missing_docs)] // documentation missing in model
|
95 - | Email,
|
96 - | #[allow(missing_docs)] // documentation missing in model
|
97 - | InternationalBankAccountNumber,
|
98 - | #[allow(missing_docs)] // documentation missing in model
|
99 - | IpAddress,
|
100 - | #[allow(missing_docs)] // documentation missing in model
|
101 - | LicensePlate,
|
102 - | #[allow(missing_docs)] // documentation missing in model
|
103 - | MacAddress,
|
104 - | #[allow(missing_docs)] // documentation missing in model
|
105 - | Name,
|
106 - | #[allow(missing_docs)] // documentation missing in model
|
107 - | Password,
|
108 - | #[allow(missing_docs)] // documentation missing in model
|
109 - | Phone,
|
110 - | #[allow(missing_docs)] // documentation missing in model
|
111 - | Pin,
|
112 - | #[allow(missing_docs)] // documentation missing in model
|
113 - | SwiftCode,
|
114 - | #[allow(missing_docs)] // documentation missing in model
|
115 - | UkNationalHealthServiceNumber,
|
116 - | #[allow(missing_docs)] // documentation missing in model
|
117 - | UkNationalInsuranceNumber,
|
118 - | #[allow(missing_docs)] // documentation missing in model
|
119 - | UkUniqueTaxpayerReferenceNumber,
|
120 - | #[allow(missing_docs)] // documentation missing in model
|
121 - | Url,
|
122 - | #[allow(missing_docs)] // documentation missing in model
|
123 - | Username,
|
124 - | #[allow(missing_docs)] // documentation missing in model
|
125 - | UsBankAccountNumber,
|
126 - | #[allow(missing_docs)] // documentation missing in model
|
127 - | UsBankRoutingNumber,
|
128 - | #[allow(missing_docs)] // documentation missing in model
|
129 - | UsIndividualTaxIdentificationNumber,
|
130 - | #[allow(missing_docs)] // documentation missing in model
|
131 - | UsPassportNumber,
|
132 - | #[allow(missing_docs)] // documentation missing in model
|
133 - | UsSocialSecurityNumber,
|
134 - | #[allow(missing_docs)] // documentation missing in model
|
135 - | VehicleIdentificationNumber,
|
136 - | /// `Unknown` contains new variants that have been added since this code was generated.
|
137 - | #[deprecated(note = "Don't directly match on `Unknown`. See the docs on this enum for the correct way to handle unknown variants.")]
|
138 - | Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue),
|
139 - | }
|
140 - | impl ::std::convert::From<&str> for GuardrailPiiEntityType {
|
141 - | fn from(s: &str) -> Self {
|
142 - | match s {
|
143 - | "ADDRESS" => GuardrailPiiEntityType::Address,
|
144 - | "AGE" => GuardrailPiiEntityType::Age,
|
145 - | "AWS_ACCESS_KEY" => GuardrailPiiEntityType::AwsAccessKey,
|
146 - | "AWS_SECRET_KEY" => GuardrailPiiEntityType::AwsSecretKey,
|
147 - | "CA_HEALTH_NUMBER" => GuardrailPiiEntityType::CaHealthNumber,
|
148 - | "CA_SOCIAL_INSURANCE_NUMBER" => GuardrailPiiEntityType::CaSocialInsuranceNumber,
|
149 - | "CREDIT_DEBIT_CARD_CVV" => GuardrailPiiEntityType::CreditDebitCardCvv,
|
150 - | "CREDIT_DEBIT_CARD_EXPIRY" => GuardrailPiiEntityType::CreditDebitCardExpiry,
|
151 - | "CREDIT_DEBIT_CARD_NUMBER" => GuardrailPiiEntityType::CreditDebitCardNumber,
|
152 - | "DRIVER_ID" => GuardrailPiiEntityType::DriverId,
|
153 - | "EMAIL" => GuardrailPiiEntityType::Email,
|
154 - | "INTERNATIONAL_BANK_ACCOUNT_NUMBER" => GuardrailPiiEntityType::InternationalBankAccountNumber,
|
155 - | "IP_ADDRESS" => GuardrailPiiEntityType::IpAddress,
|
156 - | "LICENSE_PLATE" => GuardrailPiiEntityType::LicensePlate,
|
157 - | "MAC_ADDRESS" => GuardrailPiiEntityType::MacAddress,
|
158 - | "NAME" => GuardrailPiiEntityType::Name,
|
159 - | "PASSWORD" => GuardrailPiiEntityType::Password,
|
160 - | "PHONE" => GuardrailPiiEntityType::Phone,
|
161 - | "PIN" => GuardrailPiiEntityType::Pin,
|
162 - | "SWIFT_CODE" => GuardrailPiiEntityType::SwiftCode,
|
163 - | "UK_NATIONAL_HEALTH_SERVICE_NUMBER" => GuardrailPiiEntityType::UkNationalHealthServiceNumber,
|
164 - | "UK_NATIONAL_INSURANCE_NUMBER" => GuardrailPiiEntityType::UkNationalInsuranceNumber,
|
165 - | "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER" => GuardrailPiiEntityType::UkUniqueTaxpayerReferenceNumber,
|
166 - | "URL" => GuardrailPiiEntityType::Url,
|
167 - | "USERNAME" => GuardrailPiiEntityType::Username,
|
168 - | "US_BANK_ACCOUNT_NUMBER" => GuardrailPiiEntityType::UsBankAccountNumber,
|
169 - | "US_BANK_ROUTING_NUMBER" => GuardrailPiiEntityType::UsBankRoutingNumber,
|
170 - | "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER" => GuardrailPiiEntityType::UsIndividualTaxIdentificationNumber,
|
171 - | "US_PASSPORT_NUMBER" => GuardrailPiiEntityType::UsPassportNumber,
|
172 - | "US_SOCIAL_SECURITY_NUMBER" => GuardrailPiiEntityType::UsSocialSecurityNumber,
|
173 - | "VEHICLE_IDENTIFICATION_NUMBER" => GuardrailPiiEntityType::VehicleIdentificationNumber,
|
174 - | other => GuardrailPiiEntityType::Unknown(crate::primitives::sealed_enum_unknown::UnknownVariantValue(other.to_owned())),
|
175 - | }
|
176 - | }
|
177 - | }
|
178 - | impl ::std::str::FromStr for GuardrailPiiEntityType {
|
179 - | type Err = ::std::convert::Infallible;
|
180 - |
|
181 - | fn from_str(s: &str) -> ::std::result::Result<Self, <Self as ::std::str::FromStr>::Err> {
|
182 - | ::std::result::Result::Ok(GuardrailPiiEntityType::from(s))
|
183 - | }
|
184 - | }
|
185 - | impl GuardrailPiiEntityType {
|
186 - | /// Returns the `&str` value of the enum member.
|
187 - | pub fn as_str(&self) -> &str {
|
188 - | match self {
|
189 - | GuardrailPiiEntityType::Address => "ADDRESS",
|
190 - | GuardrailPiiEntityType::Age => "AGE",
|
191 - | GuardrailPiiEntityType::AwsAccessKey => "AWS_ACCESS_KEY",
|
192 - | GuardrailPiiEntityType::AwsSecretKey => "AWS_SECRET_KEY",
|
193 - | GuardrailPiiEntityType::CaHealthNumber => "CA_HEALTH_NUMBER",
|
194 - | GuardrailPiiEntityType::CaSocialInsuranceNumber => "CA_SOCIAL_INSURANCE_NUMBER",
|
195 - | GuardrailPiiEntityType::CreditDebitCardCvv => "CREDIT_DEBIT_CARD_CVV",
|
196 - | GuardrailPiiEntityType::CreditDebitCardExpiry => "CREDIT_DEBIT_CARD_EXPIRY",
|
197 - | GuardrailPiiEntityType::CreditDebitCardNumber => "CREDIT_DEBIT_CARD_NUMBER",
|
198 - | GuardrailPiiEntityType::DriverId => "DRIVER_ID",
|
199 - | GuardrailPiiEntityType::Email => "EMAIL",
|
200 - | GuardrailPiiEntityType::InternationalBankAccountNumber => "INTERNATIONAL_BANK_ACCOUNT_NUMBER",
|
201 - | GuardrailPiiEntityType::IpAddress => "IP_ADDRESS",
|
202 - | GuardrailPiiEntityType::LicensePlate => "LICENSE_PLATE",
|
203 - | GuardrailPiiEntityType::MacAddress => "MAC_ADDRESS",
|
204 - | GuardrailPiiEntityType::Name => "NAME",
|
205 - | GuardrailPiiEntityType::Password => "PASSWORD",
|
206 - | GuardrailPiiEntityType::Phone => "PHONE",
|
207 - | GuardrailPiiEntityType::Pin => "PIN",
|
208 - | GuardrailPiiEntityType::SwiftCode => "SWIFT_CODE",
|
209 - | GuardrailPiiEntityType::UkNationalHealthServiceNumber => "UK_NATIONAL_HEALTH_SERVICE_NUMBER",
|
210 - | GuardrailPiiEntityType::UkNationalInsuranceNumber => "UK_NATIONAL_INSURANCE_NUMBER",
|
211 - | GuardrailPiiEntityType::UkUniqueTaxpayerReferenceNumber => "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",
|
212 - | GuardrailPiiEntityType::Url => "URL",
|
213 - | GuardrailPiiEntityType::Username => "USERNAME",
|
214 - | GuardrailPiiEntityType::UsBankAccountNumber => "US_BANK_ACCOUNT_NUMBER",
|
215 - | GuardrailPiiEntityType::UsBankRoutingNumber => "US_BANK_ROUTING_NUMBER",
|
216 - | GuardrailPiiEntityType::UsIndividualTaxIdentificationNumber => "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",
|
217 - | GuardrailPiiEntityType::UsPassportNumber => "US_PASSPORT_NUMBER",
|
218 - | GuardrailPiiEntityType::UsSocialSecurityNumber => "US_SOCIAL_SECURITY_NUMBER",
|
219 - | GuardrailPiiEntityType::VehicleIdentificationNumber => "VEHICLE_IDENTIFICATION_NUMBER",
|
220 - | GuardrailPiiEntityType::Unknown(value) => value.as_str(),
|
221 - | }
|
222 - | }
|
223 - | /// Returns all the `&str` representations of the enum members.
|
224 - | pub const fn values() -> &'static [&'static str] {
|
225 - | &[
|
226 - | "ADDRESS",
|
227 - | "AGE",
|
228 - | "AWS_ACCESS_KEY",
|
229 - | "AWS_SECRET_KEY",
|
230 - | "CA_HEALTH_NUMBER",
|
231 - | "CA_SOCIAL_INSURANCE_NUMBER",
|
232 - | "CREDIT_DEBIT_CARD_CVV",
|
233 - | "CREDIT_DEBIT_CARD_EXPIRY",
|
234 - | "CREDIT_DEBIT_CARD_NUMBER",
|
235 - | "DRIVER_ID",
|
236 - | "EMAIL",
|
237 - | "INTERNATIONAL_BANK_ACCOUNT_NUMBER",
|
238 - | "IP_ADDRESS",
|
239 - | "LICENSE_PLATE",
|
240 - | "MAC_ADDRESS",
|
241 - | "NAME",
|
242 - | "PASSWORD",
|
243 - | "PHONE",
|
244 - | "PIN",
|
245 - | "SWIFT_CODE",
|
246 - | "UK_NATIONAL_HEALTH_SERVICE_NUMBER",
|
247 - | "UK_NATIONAL_INSURANCE_NUMBER",
|
248 - | "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER",
|
249 - | "URL",
|
250 - | "USERNAME",
|
251 - | "US_BANK_ACCOUNT_NUMBER",
|
252 - | "US_BANK_ROUTING_NUMBER",
|
253 - | "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER",
|
254 - | "US_PASSPORT_NUMBER",
|
255 - | "US_SOCIAL_SECURITY_NUMBER",
|
256 - | "VEHICLE_IDENTIFICATION_NUMBER",
|
257 - | ]
|
258 - | }
|
259 - | }
|
260 - | impl ::std::convert::AsRef<str> for GuardrailPiiEntityType {
|
261 - | fn as_ref(&self) -> &str {
|
262 - | self.as_str()
|
263 - | }
|
264 - | }
|
265 - | impl GuardrailPiiEntityType {
|
266 - | /// Parses the enum value while disallowing unknown variants.
|
267 - | ///
|
268 - | /// Unknown variants will result in an error.
|
269 - | pub fn try_parse(value: &str) -> ::std::result::Result<Self, crate::error::UnknownVariantError> {
|
270 - | match Self::from(value) {
|
271 - | #[allow(deprecated)]
|
272 - | Self::Unknown(_) => ::std::result::Result::Err(crate::error::UnknownVariantError::new(value)),
|
273 - | known => Ok(known),
|
274 - | }
|
275 - | }
|
276 - | }
|
277 - | impl ::std::fmt::Display for GuardrailPiiEntityType {
|
278 - | fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
|
279 - | match self {
|
280 - | GuardrailPiiEntityType::Address => write!(f, "ADDRESS"),
|
281 - | GuardrailPiiEntityType::Age => write!(f, "AGE"),
|
282 - | GuardrailPiiEntityType::AwsAccessKey => write!(f, "AWS_ACCESS_KEY"),
|
283 - | GuardrailPiiEntityType::AwsSecretKey => write!(f, "AWS_SECRET_KEY"),
|
284 - | GuardrailPiiEntityType::CaHealthNumber => write!(f, "CA_HEALTH_NUMBER"),
|
285 - | GuardrailPiiEntityType::CaSocialInsuranceNumber => write!(f, "CA_SOCIAL_INSURANCE_NUMBER"),
|
286 - | GuardrailPiiEntityType::CreditDebitCardCvv => write!(f, "CREDIT_DEBIT_CARD_CVV"),
|
287 - | GuardrailPiiEntityType::CreditDebitCardExpiry => write!(f, "CREDIT_DEBIT_CARD_EXPIRY"),
|
288 - | GuardrailPiiEntityType::CreditDebitCardNumber => write!(f, "CREDIT_DEBIT_CARD_NUMBER"),
|
289 - | GuardrailPiiEntityType::DriverId => write!(f, "DRIVER_ID"),
|
290 - | GuardrailPiiEntityType::Email => write!(f, "EMAIL"),
|
291 - | GuardrailPiiEntityType::InternationalBankAccountNumber => write!(f, "INTERNATIONAL_BANK_ACCOUNT_NUMBER"),
|
292 - | GuardrailPiiEntityType::IpAddress => write!(f, "IP_ADDRESS"),
|
293 - | GuardrailPiiEntityType::LicensePlate => write!(f, "LICENSE_PLATE"),
|
294 - | GuardrailPiiEntityType::MacAddress => write!(f, "MAC_ADDRESS"),
|
295 - | GuardrailPiiEntityType::Name => write!(f, "NAME"),
|
296 - | GuardrailPiiEntityType::Password => write!(f, "PASSWORD"),
|
297 - | GuardrailPiiEntityType::Phone => write!(f, "PHONE"),
|
298 - | GuardrailPiiEntityType::Pin => write!(f, "PIN"),
|
299 - | GuardrailPiiEntityType::SwiftCode => write!(f, "SWIFT_CODE"),
|
300 - | GuardrailPiiEntityType::UkNationalHealthServiceNumber => write!(f, "UK_NATIONAL_HEALTH_SERVICE_NUMBER"),
|
301 - | GuardrailPiiEntityType::UkNationalInsuranceNumber => write!(f, "UK_NATIONAL_INSURANCE_NUMBER"),
|
302 - | GuardrailPiiEntityType::UkUniqueTaxpayerReferenceNumber => write!(f, "UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"),
|
303 - | GuardrailPiiEntityType::Url => write!(f, "URL"),
|
304 - | GuardrailPiiEntityType::Username => write!(f, "USERNAME"),
|
305 - | GuardrailPiiEntityType::UsBankAccountNumber => write!(f, "US_BANK_ACCOUNT_NUMBER"),
|
306 - | GuardrailPiiEntityType::UsBankRoutingNumber => write!(f, "US_BANK_ROUTING_NUMBER"),
|
307 - | GuardrailPiiEntityType::UsIndividualTaxIdentificationNumber => write!(f, "US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"),
|
308 - | GuardrailPiiEntityType::UsPassportNumber => write!(f, "US_PASSPORT_NUMBER"),
|
309 - | GuardrailPiiEntityType::UsSocialSecurityNumber => write!(f, "US_SOCIAL_SECURITY_NUMBER"),
|
310 - | GuardrailPiiEntityType::VehicleIdentificationNumber => write!(f, "VEHICLE_IDENTIFICATION_NUMBER"),
|
311 - | GuardrailPiiEntityType::Unknown(value) => write!(f, "{}", value),
|
312 - | }
|
313 - | }
|
314 - | }
|