stripe_shared/
legal_entity_company.rs

1#[derive(Clone, Debug)]
2#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
3#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
4pub struct LegalEntityCompany {
5    pub address: Option<stripe_shared::Address>,
6    /// The Kana variation of the company's primary address (Japan only).
7    pub address_kana: Option<stripe_shared::LegalEntityJapanAddress>,
8    /// The Kanji variation of the company's primary address (Japan only).
9    pub address_kanji: Option<stripe_shared::LegalEntityJapanAddress>,
10    /// Whether the company's directors have been provided.
11    /// This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided).
12    pub directors_provided: Option<bool>,
13    /// This hash is used to attest that the director information provided to Stripe is both current and correct.
14    pub directorship_declaration: Option<stripe_shared::LegalEntityDirectorshipDeclaration>,
15    /// Whether the company's executives have been provided.
16    /// This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided.
17    pub executives_provided: Option<bool>,
18    /// The export license ID number of the company, also referred as Import Export Code (India only).
19    pub export_license_id: Option<String>,
20    /// The purpose code to use for export transactions (India only).
21    pub export_purpose_code: Option<String>,
22    /// The company's legal name.
23    /// Also available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `stripe`.
24    pub name: Option<String>,
25    /// The Kana variation of the company's legal name (Japan only).
26    /// Also available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `stripe`.
27    pub name_kana: Option<String>,
28    /// The Kanji variation of the company's legal name (Japan only).
29    /// Also available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `stripe`.
30    pub name_kanji: Option<String>,
31    /// Whether the company's owners have been provided.
32    /// This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided.
33    /// Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together).
34    pub owners_provided: Option<bool>,
35    /// This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct.
36    pub ownership_declaration: Option<stripe_shared::LegalEntityUboDeclaration>,
37    /// This value is used to determine if a business is exempt from providing ultimate beneficial owners.
38    /// See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details.
39    pub ownership_exemption_reason: Option<LegalEntityCompanyOwnershipExemptionReason>,
40    /// The company's phone number (used for verification).
41    pub phone: Option<String>,
42    pub registration_date: Option<stripe_shared::LegalEntityRegistrationDate>,
43    /// This hash is used to attest that the representative is authorized to act as the representative of their legal entity.
44    pub representative_declaration: Option<stripe_shared::LegalEntityRepresentativeDeclaration>,
45    /// The category identifying the legal structure of the company or legal entity.
46    /// Also available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `stripe`.
47    /// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
48    pub structure: Option<LegalEntityCompanyStructure>,
49    /// Whether the company's business ID number was provided.
50    pub tax_id_provided: Option<bool>,
51    /// The jurisdiction in which the `tax_id` is registered (Germany-based companies only).
52    pub tax_id_registrar: Option<String>,
53    /// Whether the company's business VAT number was provided.
54    pub vat_id_provided: Option<bool>,
55    /// Information on the verification state of the company.
56    pub verification: Option<stripe_shared::LegalEntityCompanyVerification>,
57}
58#[doc(hidden)]
59pub struct LegalEntityCompanyBuilder {
60    address: Option<Option<stripe_shared::Address>>,
61    address_kana: Option<Option<stripe_shared::LegalEntityJapanAddress>>,
62    address_kanji: Option<Option<stripe_shared::LegalEntityJapanAddress>>,
63    directors_provided: Option<Option<bool>>,
64    directorship_declaration: Option<Option<stripe_shared::LegalEntityDirectorshipDeclaration>>,
65    executives_provided: Option<Option<bool>>,
66    export_license_id: Option<Option<String>>,
67    export_purpose_code: Option<Option<String>>,
68    name: Option<Option<String>>,
69    name_kana: Option<Option<String>>,
70    name_kanji: Option<Option<String>>,
71    owners_provided: Option<Option<bool>>,
72    ownership_declaration: Option<Option<stripe_shared::LegalEntityUboDeclaration>>,
73    ownership_exemption_reason: Option<Option<LegalEntityCompanyOwnershipExemptionReason>>,
74    phone: Option<Option<String>>,
75    registration_date: Option<Option<stripe_shared::LegalEntityRegistrationDate>>,
76    representative_declaration: Option<Option<stripe_shared::LegalEntityRepresentativeDeclaration>>,
77    structure: Option<Option<LegalEntityCompanyStructure>>,
78    tax_id_provided: Option<Option<bool>>,
79    tax_id_registrar: Option<Option<String>>,
80    vat_id_provided: Option<Option<bool>>,
81    verification: Option<Option<stripe_shared::LegalEntityCompanyVerification>>,
82}
83
84#[allow(
85    unused_variables,
86    irrefutable_let_patterns,
87    clippy::let_unit_value,
88    clippy::match_single_binding,
89    clippy::single_match
90)]
91const _: () = {
92    use miniserde::de::{Map, Visitor};
93    use miniserde::json::Value;
94    use miniserde::{Deserialize, Result, make_place};
95    use stripe_types::miniserde_helpers::FromValueOpt;
96    use stripe_types::{MapBuilder, ObjectDeser};
97
98    make_place!(Place);
99
100    impl Deserialize for LegalEntityCompany {
101        fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
102            Place::new(out)
103        }
104    }
105
106    struct Builder<'a> {
107        out: &'a mut Option<LegalEntityCompany>,
108        builder: LegalEntityCompanyBuilder,
109    }
110
111    impl Visitor for Place<LegalEntityCompany> {
112        fn map(&mut self) -> Result<Box<dyn Map + '_>> {
113            Ok(Box::new(Builder {
114                out: &mut self.out,
115                builder: LegalEntityCompanyBuilder::deser_default(),
116            }))
117        }
118    }
119
120    impl MapBuilder for LegalEntityCompanyBuilder {
121        type Out = LegalEntityCompany;
122        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
123            Ok(match k {
124                "address" => Deserialize::begin(&mut self.address),
125                "address_kana" => Deserialize::begin(&mut self.address_kana),
126                "address_kanji" => Deserialize::begin(&mut self.address_kanji),
127                "directors_provided" => Deserialize::begin(&mut self.directors_provided),
128                "directorship_declaration" => {
129                    Deserialize::begin(&mut self.directorship_declaration)
130                }
131                "executives_provided" => Deserialize::begin(&mut self.executives_provided),
132                "export_license_id" => Deserialize::begin(&mut self.export_license_id),
133                "export_purpose_code" => Deserialize::begin(&mut self.export_purpose_code),
134                "name" => Deserialize::begin(&mut self.name),
135                "name_kana" => Deserialize::begin(&mut self.name_kana),
136                "name_kanji" => Deserialize::begin(&mut self.name_kanji),
137                "owners_provided" => Deserialize::begin(&mut self.owners_provided),
138                "ownership_declaration" => Deserialize::begin(&mut self.ownership_declaration),
139                "ownership_exemption_reason" => {
140                    Deserialize::begin(&mut self.ownership_exemption_reason)
141                }
142                "phone" => Deserialize::begin(&mut self.phone),
143                "registration_date" => Deserialize::begin(&mut self.registration_date),
144                "representative_declaration" => {
145                    Deserialize::begin(&mut self.representative_declaration)
146                }
147                "structure" => Deserialize::begin(&mut self.structure),
148                "tax_id_provided" => Deserialize::begin(&mut self.tax_id_provided),
149                "tax_id_registrar" => Deserialize::begin(&mut self.tax_id_registrar),
150                "vat_id_provided" => Deserialize::begin(&mut self.vat_id_provided),
151                "verification" => Deserialize::begin(&mut self.verification),
152                _ => <dyn Visitor>::ignore(),
153            })
154        }
155
156        fn deser_default() -> Self {
157            Self {
158                address: Deserialize::default(),
159                address_kana: Deserialize::default(),
160                address_kanji: Deserialize::default(),
161                directors_provided: Deserialize::default(),
162                directorship_declaration: Deserialize::default(),
163                executives_provided: Deserialize::default(),
164                export_license_id: Deserialize::default(),
165                export_purpose_code: Deserialize::default(),
166                name: Deserialize::default(),
167                name_kana: Deserialize::default(),
168                name_kanji: Deserialize::default(),
169                owners_provided: Deserialize::default(),
170                ownership_declaration: Deserialize::default(),
171                ownership_exemption_reason: Deserialize::default(),
172                phone: Deserialize::default(),
173                registration_date: Deserialize::default(),
174                representative_declaration: Deserialize::default(),
175                structure: Deserialize::default(),
176                tax_id_provided: Deserialize::default(),
177                tax_id_registrar: Deserialize::default(),
178                vat_id_provided: Deserialize::default(),
179                verification: Deserialize::default(),
180            }
181        }
182
183        fn take_out(&mut self) -> Option<Self::Out> {
184            let (
185                Some(address),
186                Some(address_kana),
187                Some(address_kanji),
188                Some(directors_provided),
189                Some(directorship_declaration),
190                Some(executives_provided),
191                Some(export_license_id),
192                Some(export_purpose_code),
193                Some(name),
194                Some(name_kana),
195                Some(name_kanji),
196                Some(owners_provided),
197                Some(ownership_declaration),
198                Some(ownership_exemption_reason),
199                Some(phone),
200                Some(registration_date),
201                Some(representative_declaration),
202                Some(structure),
203                Some(tax_id_provided),
204                Some(tax_id_registrar),
205                Some(vat_id_provided),
206                Some(verification),
207            ) = (
208                self.address.take(),
209                self.address_kana.take(),
210                self.address_kanji.take(),
211                self.directors_provided,
212                self.directorship_declaration.take(),
213                self.executives_provided,
214                self.export_license_id.take(),
215                self.export_purpose_code.take(),
216                self.name.take(),
217                self.name_kana.take(),
218                self.name_kanji.take(),
219                self.owners_provided,
220                self.ownership_declaration.take(),
221                self.ownership_exemption_reason,
222                self.phone.take(),
223                self.registration_date,
224                self.representative_declaration.take(),
225                self.structure.take(),
226                self.tax_id_provided,
227                self.tax_id_registrar.take(),
228                self.vat_id_provided,
229                self.verification.take(),
230            )
231            else {
232                return None;
233            };
234            Some(Self::Out {
235                address,
236                address_kana,
237                address_kanji,
238                directors_provided,
239                directorship_declaration,
240                executives_provided,
241                export_license_id,
242                export_purpose_code,
243                name,
244                name_kana,
245                name_kanji,
246                owners_provided,
247                ownership_declaration,
248                ownership_exemption_reason,
249                phone,
250                registration_date,
251                representative_declaration,
252                structure,
253                tax_id_provided,
254                tax_id_registrar,
255                vat_id_provided,
256                verification,
257            })
258        }
259    }
260
261    impl Map for Builder<'_> {
262        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
263            self.builder.key(k)
264        }
265
266        fn finish(&mut self) -> Result<()> {
267            *self.out = self.builder.take_out();
268            Ok(())
269        }
270    }
271
272    impl ObjectDeser for LegalEntityCompany {
273        type Builder = LegalEntityCompanyBuilder;
274    }
275
276    impl FromValueOpt for LegalEntityCompany {
277        fn from_value(v: Value) -> Option<Self> {
278            let Value::Object(obj) = v else {
279                return None;
280            };
281            let mut b = LegalEntityCompanyBuilder::deser_default();
282            for (k, v) in obj {
283                match k.as_str() {
284                    "address" => b.address = FromValueOpt::from_value(v),
285                    "address_kana" => b.address_kana = FromValueOpt::from_value(v),
286                    "address_kanji" => b.address_kanji = FromValueOpt::from_value(v),
287                    "directors_provided" => b.directors_provided = FromValueOpt::from_value(v),
288                    "directorship_declaration" => {
289                        b.directorship_declaration = FromValueOpt::from_value(v)
290                    }
291                    "executives_provided" => b.executives_provided = FromValueOpt::from_value(v),
292                    "export_license_id" => b.export_license_id = FromValueOpt::from_value(v),
293                    "export_purpose_code" => b.export_purpose_code = FromValueOpt::from_value(v),
294                    "name" => b.name = FromValueOpt::from_value(v),
295                    "name_kana" => b.name_kana = FromValueOpt::from_value(v),
296                    "name_kanji" => b.name_kanji = FromValueOpt::from_value(v),
297                    "owners_provided" => b.owners_provided = FromValueOpt::from_value(v),
298                    "ownership_declaration" => {
299                        b.ownership_declaration = FromValueOpt::from_value(v)
300                    }
301                    "ownership_exemption_reason" => {
302                        b.ownership_exemption_reason = FromValueOpt::from_value(v)
303                    }
304                    "phone" => b.phone = FromValueOpt::from_value(v),
305                    "registration_date" => b.registration_date = FromValueOpt::from_value(v),
306                    "representative_declaration" => {
307                        b.representative_declaration = FromValueOpt::from_value(v)
308                    }
309                    "structure" => b.structure = FromValueOpt::from_value(v),
310                    "tax_id_provided" => b.tax_id_provided = FromValueOpt::from_value(v),
311                    "tax_id_registrar" => b.tax_id_registrar = FromValueOpt::from_value(v),
312                    "vat_id_provided" => b.vat_id_provided = FromValueOpt::from_value(v),
313                    "verification" => b.verification = FromValueOpt::from_value(v),
314                    _ => {}
315                }
316            }
317            b.take_out()
318        }
319    }
320};
321/// This value is used to determine if a business is exempt from providing ultimate beneficial owners.
322/// See [this support article](https://support.stripe.com/questions/exemption-from-providing-ownership-details) and [changelog](https://docs.stripe.com/changelog/acacia/2025-01-27/ownership-exemption-reason-accounts-api) for more details.
323#[derive(Copy, Clone, Eq, PartialEq)]
324pub enum LegalEntityCompanyOwnershipExemptionReason {
325    QualifiedEntityExceedsOwnershipThreshold,
326    QualifiesAsFinancialInstitution,
327}
328impl LegalEntityCompanyOwnershipExemptionReason {
329    pub fn as_str(self) -> &'static str {
330        use LegalEntityCompanyOwnershipExemptionReason::*;
331        match self {
332            QualifiedEntityExceedsOwnershipThreshold => {
333                "qualified_entity_exceeds_ownership_threshold"
334            }
335            QualifiesAsFinancialInstitution => "qualifies_as_financial_institution",
336        }
337    }
338}
339
340impl std::str::FromStr for LegalEntityCompanyOwnershipExemptionReason {
341    type Err = stripe_types::StripeParseError;
342    fn from_str(s: &str) -> Result<Self, Self::Err> {
343        use LegalEntityCompanyOwnershipExemptionReason::*;
344        match s {
345            "qualified_entity_exceeds_ownership_threshold" => {
346                Ok(QualifiedEntityExceedsOwnershipThreshold)
347            }
348            "qualifies_as_financial_institution" => Ok(QualifiesAsFinancialInstitution),
349            _ => Err(stripe_types::StripeParseError),
350        }
351    }
352}
353impl std::fmt::Display for LegalEntityCompanyOwnershipExemptionReason {
354    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
355        f.write_str(self.as_str())
356    }
357}
358
359impl std::fmt::Debug for LegalEntityCompanyOwnershipExemptionReason {
360    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
361        f.write_str(self.as_str())
362    }
363}
364#[cfg(feature = "serialize")]
365impl serde::Serialize for LegalEntityCompanyOwnershipExemptionReason {
366    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
367    where
368        S: serde::Serializer,
369    {
370        serializer.serialize_str(self.as_str())
371    }
372}
373impl miniserde::Deserialize for LegalEntityCompanyOwnershipExemptionReason {
374    fn begin(out: &mut Option<Self>) -> &mut dyn miniserde::de::Visitor {
375        crate::Place::new(out)
376    }
377}
378
379impl miniserde::de::Visitor for crate::Place<LegalEntityCompanyOwnershipExemptionReason> {
380    fn string(&mut self, s: &str) -> miniserde::Result<()> {
381        use std::str::FromStr;
382        self.out = Some(
383            LegalEntityCompanyOwnershipExemptionReason::from_str(s)
384                .map_err(|_| miniserde::Error)?,
385        );
386        Ok(())
387    }
388}
389
390stripe_types::impl_from_val_with_from_str!(LegalEntityCompanyOwnershipExemptionReason);
391#[cfg(feature = "deserialize")]
392impl<'de> serde::Deserialize<'de> for LegalEntityCompanyOwnershipExemptionReason {
393    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
394        use std::str::FromStr;
395        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
396        Self::from_str(&s).map_err(|_| {
397            serde::de::Error::custom("Unknown value for LegalEntityCompanyOwnershipExemptionReason")
398        })
399    }
400}
401/// The category identifying the legal structure of the company or legal entity.
402/// Also available for accounts where [controller.requirement_collection](/api/accounts/object#account_object-controller-requirement_collection) is `stripe`.
403/// See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details.
404#[derive(Clone, Eq, PartialEq)]
405#[non_exhaustive]
406pub enum LegalEntityCompanyStructure {
407    FreeZoneEstablishment,
408    FreeZoneLlc,
409    GovernmentInstrumentality,
410    GovernmentalUnit,
411    IncorporatedNonProfit,
412    IncorporatedPartnership,
413    LimitedLiabilityPartnership,
414    Llc,
415    MultiMemberLlc,
416    PrivateCompany,
417    PrivateCorporation,
418    PrivatePartnership,
419    PublicCompany,
420    PublicCorporation,
421    PublicPartnership,
422    RegisteredCharity,
423    SingleMemberLlc,
424    SoleEstablishment,
425    SoleProprietorship,
426    TaxExemptGovernmentInstrumentality,
427    UnincorporatedAssociation,
428    UnincorporatedNonProfit,
429    UnincorporatedPartnership,
430    /// An unrecognized value from Stripe. Should not be used as a request parameter.
431    Unknown(String),
432}
433impl LegalEntityCompanyStructure {
434    pub fn as_str(&self) -> &str {
435        use LegalEntityCompanyStructure::*;
436        match self {
437            FreeZoneEstablishment => "free_zone_establishment",
438            FreeZoneLlc => "free_zone_llc",
439            GovernmentInstrumentality => "government_instrumentality",
440            GovernmentalUnit => "governmental_unit",
441            IncorporatedNonProfit => "incorporated_non_profit",
442            IncorporatedPartnership => "incorporated_partnership",
443            LimitedLiabilityPartnership => "limited_liability_partnership",
444            Llc => "llc",
445            MultiMemberLlc => "multi_member_llc",
446            PrivateCompany => "private_company",
447            PrivateCorporation => "private_corporation",
448            PrivatePartnership => "private_partnership",
449            PublicCompany => "public_company",
450            PublicCorporation => "public_corporation",
451            PublicPartnership => "public_partnership",
452            RegisteredCharity => "registered_charity",
453            SingleMemberLlc => "single_member_llc",
454            SoleEstablishment => "sole_establishment",
455            SoleProprietorship => "sole_proprietorship",
456            TaxExemptGovernmentInstrumentality => "tax_exempt_government_instrumentality",
457            UnincorporatedAssociation => "unincorporated_association",
458            UnincorporatedNonProfit => "unincorporated_non_profit",
459            UnincorporatedPartnership => "unincorporated_partnership",
460            Unknown(v) => v,
461        }
462    }
463}
464
465impl std::str::FromStr for LegalEntityCompanyStructure {
466    type Err = std::convert::Infallible;
467    fn from_str(s: &str) -> Result<Self, Self::Err> {
468        use LegalEntityCompanyStructure::*;
469        match s {
470            "free_zone_establishment" => Ok(FreeZoneEstablishment),
471            "free_zone_llc" => Ok(FreeZoneLlc),
472            "government_instrumentality" => Ok(GovernmentInstrumentality),
473            "governmental_unit" => Ok(GovernmentalUnit),
474            "incorporated_non_profit" => Ok(IncorporatedNonProfit),
475            "incorporated_partnership" => Ok(IncorporatedPartnership),
476            "limited_liability_partnership" => Ok(LimitedLiabilityPartnership),
477            "llc" => Ok(Llc),
478            "multi_member_llc" => Ok(MultiMemberLlc),
479            "private_company" => Ok(PrivateCompany),
480            "private_corporation" => Ok(PrivateCorporation),
481            "private_partnership" => Ok(PrivatePartnership),
482            "public_company" => Ok(PublicCompany),
483            "public_corporation" => Ok(PublicCorporation),
484            "public_partnership" => Ok(PublicPartnership),
485            "registered_charity" => Ok(RegisteredCharity),
486            "single_member_llc" => Ok(SingleMemberLlc),
487            "sole_establishment" => Ok(SoleEstablishment),
488            "sole_proprietorship" => Ok(SoleProprietorship),
489            "tax_exempt_government_instrumentality" => Ok(TaxExemptGovernmentInstrumentality),
490            "unincorporated_association" => Ok(UnincorporatedAssociation),
491            "unincorporated_non_profit" => Ok(UnincorporatedNonProfit),
492            "unincorporated_partnership" => Ok(UnincorporatedPartnership),
493            v => Ok(Unknown(v.to_owned())),
494        }
495    }
496}
497impl std::fmt::Display for LegalEntityCompanyStructure {
498    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
499        f.write_str(self.as_str())
500    }
501}
502
503impl std::fmt::Debug for LegalEntityCompanyStructure {
504    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
505        f.write_str(self.as_str())
506    }
507}
508#[cfg(feature = "serialize")]
509impl serde::Serialize for LegalEntityCompanyStructure {
510    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
511    where
512        S: serde::Serializer,
513    {
514        serializer.serialize_str(self.as_str())
515    }
516}
517impl miniserde::Deserialize for LegalEntityCompanyStructure {
518    fn begin(out: &mut Option<Self>) -> &mut dyn miniserde::de::Visitor {
519        crate::Place::new(out)
520    }
521}
522
523impl miniserde::de::Visitor for crate::Place<LegalEntityCompanyStructure> {
524    fn string(&mut self, s: &str) -> miniserde::Result<()> {
525        use std::str::FromStr;
526        self.out = Some(LegalEntityCompanyStructure::from_str(s).unwrap());
527        Ok(())
528    }
529}
530
531stripe_types::impl_from_val_with_from_str!(LegalEntityCompanyStructure);
532#[cfg(feature = "deserialize")]
533impl<'de> serde::Deserialize<'de> for LegalEntityCompanyStructure {
534    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
535        use std::str::FromStr;
536        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
537        Ok(Self::from_str(&s).unwrap())
538    }
539}