async-stripe-shared 1.0.0-rc.6

API bindings for the Stripe HTTP API
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
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
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
/// This object represents a customer of your business.
/// Use it to [create recurring charges](https://docs.stripe.com/invoicing/customer), [save payment](https://docs.stripe.com/payments/save-during-payment) and contact information,.
/// and track payments that belong to the same customer.
///
/// For more details see <<https://stripe.com/docs/api/customers/object>>.
#[derive(Clone)]
#[cfg_attr(not(feature = "redact-generated-debug"), derive(Debug))]
#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
pub struct Customer {
    /// The customer's address.
    pub address: Option<stripe_shared::Address>,
    /// The current balance, if any, that's stored on the customer in their default currency.
    /// If negative, the customer has credit to apply to their next invoice.
    /// If positive, the customer has an amount owed that's added to their next invoice.
    /// The balance only considers amounts that Stripe hasn't successfully applied to any invoice.
    /// It doesn't reflect unpaid invoices.
    /// This balance is only taken into account after invoices finalize.
    /// For multi-currency balances, see [invoice_credit_balance](https://docs.stripe.com/api/customers/object#customer_object-invoice_credit_balance).
    pub balance: Option<i64>,
    /// The customer's business name.
    pub business_name: Option<String>,
    /// The current funds being held by Stripe on behalf of the customer.
    /// You can apply these funds towards payment intents when the source is "cash_balance".
    /// The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically.
    pub cash_balance: Option<stripe_shared::CashBalance>,
    /// Time at which the object was created. Measured in seconds since the Unix epoch.
    pub created: stripe_types::Timestamp,
    /// Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes.
    pub currency: Option<stripe_types::Currency>,
    /// The ID of an Account representing a customer.
    /// You can use this ID with any v1 API that accepts a customer_account parameter.
    pub customer_account: Option<String>,
    /// ID of the default payment source for the customer.
    ///
    /// If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://docs.stripe.com/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead.
    pub default_source: Option<stripe_types::Expandable<stripe_shared::PaymentSource>>,
    /// Tracks the most recent state change on any invoice belonging to the customer.
    /// Paying an invoice or marking it uncollectible via the API will set this field to false.
    /// An automatic payment failure or passing the `invoice.due_date` will set this field to `true`.
    ///
    /// If an invoice becomes uncollectible by [dunning](https://docs.stripe.com/billing/automatic-collection), `delinquent` doesn't reset to `false`.
    ///
    /// If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead.
    /// Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`.
    pub delinquent: Option<bool>,
    /// An arbitrary string attached to the object. Often useful for displaying to users.
    pub description: Option<String>,
    /// Describes the current discount active on the customer, if there is one.
    pub discount: Option<stripe_shared::Discount>,
    /// The customer's email address.
    pub email: Option<String>,
    /// Unique identifier for the object.
    pub id: stripe_shared::CustomerId,
    /// The customer's individual name.
    pub individual_name: Option<String>,
    /// The current multi-currency balances, if any, that's stored on the customer.
    /// If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency.
    /// If negative, the customer has an amount owed that's added to their next invoice denominated in that currency.
    /// These balances don't apply to unpaid invoices.
    /// They solely track amounts that Stripe hasn't successfully applied to any invoice.
    /// Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes.
    pub invoice_credit_balance: Option<std::collections::HashMap<String, i64>>,
    /// The prefix for the customer used to generate unique invoice numbers.
    pub invoice_prefix: Option<String>,
    pub invoice_settings: Option<stripe_shared::InvoiceSettingCustomerSetting>,
    /// If the object exists in live mode, the value is `true`.
    /// If the object exists in test mode, the value is `false`.
    pub livemode: bool,
    /// Set of [key-value pairs](https://docs.stripe.com/api/metadata) that you can attach to an object.
    /// This can be useful for storing additional information about the object in a structured format.
    pub metadata: Option<std::collections::HashMap<String, String>>,
    /// The customer's full name or business name.
    pub name: Option<String>,
    /// The suffix of the customer's next invoice number (for example, 0001).
    /// When the account uses account level sequencing, this parameter is ignored in API requests and the field omitted in API responses.
    pub next_invoice_sequence: Option<i64>,
    /// The customer's phone number.
    pub phone: Option<String>,
    /// The customer's preferred locales (languages), ordered by preference.
    pub preferred_locales: Option<Vec<String>>,
    /// Mailing and shipping address for the customer. Appears on invoices emailed to this customer.
    pub shipping: Option<stripe_shared::Shipping>,
    /// The customer's payment sources, if any.
    pub sources: Option<stripe_types::List<stripe_shared::PaymentSource>>,
    /// The customer's current subscriptions, if any.
    pub subscriptions: Option<stripe_types::List<stripe_shared::Subscription>>,
    pub tax: Option<stripe_shared::CustomerTax>,
    /// Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`.
    /// When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**.
    pub tax_exempt: Option<stripe_shared::CustomerTaxExempt>,
    /// The customer's tax IDs.
    pub tax_ids: Option<stripe_types::List<stripe_shared::TaxId>>,
    /// ID of the test clock that this customer belongs to.
    pub test_clock: Option<stripe_types::Expandable<stripe_shared::TestHelpersTestClock>>,
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for Customer {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        f.debug_struct("Customer").finish_non_exhaustive()
    }
}
#[doc(hidden)]
pub struct CustomerBuilder {
    address: Option<Option<stripe_shared::Address>>,
    balance: Option<Option<i64>>,
    business_name: Option<Option<String>>,
    cash_balance: Option<Option<stripe_shared::CashBalance>>,
    created: Option<stripe_types::Timestamp>,
    currency: Option<Option<stripe_types::Currency>>,
    customer_account: Option<Option<String>>,
    default_source: Option<Option<stripe_types::Expandable<stripe_shared::PaymentSource>>>,
    delinquent: Option<Option<bool>>,
    description: Option<Option<String>>,
    discount: Option<Option<stripe_shared::Discount>>,
    email: Option<Option<String>>,
    id: Option<stripe_shared::CustomerId>,
    individual_name: Option<Option<String>>,
    invoice_credit_balance: Option<Option<std::collections::HashMap<String, i64>>>,
    invoice_prefix: Option<Option<String>>,
    invoice_settings: Option<Option<stripe_shared::InvoiceSettingCustomerSetting>>,
    livemode: Option<bool>,
    metadata: Option<Option<std::collections::HashMap<String, String>>>,
    name: Option<Option<String>>,
    next_invoice_sequence: Option<Option<i64>>,
    phone: Option<Option<String>>,
    preferred_locales: Option<Option<Vec<String>>>,
    shipping: Option<Option<stripe_shared::Shipping>>,
    sources: Option<Option<stripe_types::List<stripe_shared::PaymentSource>>>,
    subscriptions: Option<Option<stripe_types::List<stripe_shared::Subscription>>>,
    tax: Option<Option<stripe_shared::CustomerTax>>,
    tax_exempt: Option<Option<stripe_shared::CustomerTaxExempt>>,
    tax_ids: Option<Option<stripe_types::List<stripe_shared::TaxId>>>,
    test_clock: Option<Option<stripe_types::Expandable<stripe_shared::TestHelpersTestClock>>>,
}

#[allow(
    unused_variables,
    irrefutable_let_patterns,
    clippy::let_unit_value,
    clippy::match_single_binding,
    clippy::single_match
)]
const _: () = {
    use miniserde::de::{Map, Visitor};
    use miniserde::json::Value;
    use miniserde::{Deserialize, Result, make_place};
    use stripe_types::miniserde_helpers::FromValueOpt;
    use stripe_types::{MapBuilder, ObjectDeser};

    make_place!(Place);

    impl Deserialize for Customer {
        fn begin(out: &mut Option<Self>) -> &mut dyn Visitor {
            Place::new(out)
        }
    }

    struct Builder<'a> {
        out: &'a mut Option<Customer>,
        builder: CustomerBuilder,
    }

    impl Visitor for Place<Customer> {
        fn map(&mut self) -> Result<Box<dyn Map + '_>> {
            Ok(Box::new(Builder { out: &mut self.out, builder: CustomerBuilder::deser_default() }))
        }
    }

    impl MapBuilder for CustomerBuilder {
        type Out = Customer;
        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
            Ok(match k {
                "address" => Deserialize::begin(&mut self.address),
                "balance" => Deserialize::begin(&mut self.balance),
                "business_name" => Deserialize::begin(&mut self.business_name),
                "cash_balance" => Deserialize::begin(&mut self.cash_balance),
                "created" => Deserialize::begin(&mut self.created),
                "currency" => Deserialize::begin(&mut self.currency),
                "customer_account" => Deserialize::begin(&mut self.customer_account),
                "default_source" => Deserialize::begin(&mut self.default_source),
                "delinquent" => Deserialize::begin(&mut self.delinquent),
                "description" => Deserialize::begin(&mut self.description),
                "discount" => Deserialize::begin(&mut self.discount),
                "email" => Deserialize::begin(&mut self.email),
                "id" => Deserialize::begin(&mut self.id),
                "individual_name" => Deserialize::begin(&mut self.individual_name),
                "invoice_credit_balance" => Deserialize::begin(&mut self.invoice_credit_balance),
                "invoice_prefix" => Deserialize::begin(&mut self.invoice_prefix),
                "invoice_settings" => Deserialize::begin(&mut self.invoice_settings),
                "livemode" => Deserialize::begin(&mut self.livemode),
                "metadata" => Deserialize::begin(&mut self.metadata),
                "name" => Deserialize::begin(&mut self.name),
                "next_invoice_sequence" => Deserialize::begin(&mut self.next_invoice_sequence),
                "phone" => Deserialize::begin(&mut self.phone),
                "preferred_locales" => Deserialize::begin(&mut self.preferred_locales),
                "shipping" => Deserialize::begin(&mut self.shipping),
                "sources" => Deserialize::begin(&mut self.sources),
                "subscriptions" => Deserialize::begin(&mut self.subscriptions),
                "tax" => Deserialize::begin(&mut self.tax),
                "tax_exempt" => Deserialize::begin(&mut self.tax_exempt),
                "tax_ids" => Deserialize::begin(&mut self.tax_ids),
                "test_clock" => Deserialize::begin(&mut self.test_clock),
                _ => <dyn Visitor>::ignore(),
            })
        }

        fn deser_default() -> Self {
            Self {
                address: Some(None),
                balance: Some(None),
                business_name: Some(None),
                cash_balance: Some(None),
                created: None,
                currency: Some(None),
                customer_account: Some(None),
                default_source: Some(None),
                delinquent: Some(None),
                description: Some(None),
                discount: Some(None),
                email: Some(None),
                id: None,
                individual_name: Some(None),
                invoice_credit_balance: Some(None),
                invoice_prefix: Some(None),
                invoice_settings: Some(None),
                livemode: None,
                metadata: Some(None),
                name: Some(None),
                next_invoice_sequence: Some(None),
                phone: Some(None),
                preferred_locales: Some(None),
                shipping: Some(None),
                sources: Some(None),
                subscriptions: Some(None),
                tax: Some(None),
                tax_exempt: Some(None),
                tax_ids: Some(None),
                test_clock: Some(None),
            }
        }

        fn take_out(&mut self) -> Option<Self::Out> {
            let (
                Some(address),
                Some(balance),
                Some(business_name),
                Some(cash_balance),
                Some(created),
                Some(currency),
                Some(customer_account),
                Some(default_source),
                Some(delinquent),
                Some(description),
                Some(discount),
                Some(email),
                Some(id),
                Some(individual_name),
                Some(invoice_credit_balance),
                Some(invoice_prefix),
                Some(invoice_settings),
                Some(livemode),
                Some(metadata),
                Some(name),
                Some(next_invoice_sequence),
                Some(phone),
                Some(preferred_locales),
                Some(shipping),
                Some(sources),
                Some(subscriptions),
                Some(tax),
                Some(tax_exempt),
                Some(tax_ids),
                Some(test_clock),
            ) = (
                self.address.take(),
                self.balance,
                self.business_name.take(),
                self.cash_balance.take(),
                self.created,
                self.currency.take(),
                self.customer_account.take(),
                self.default_source.take(),
                self.delinquent,
                self.description.take(),
                self.discount.take(),
                self.email.take(),
                self.id.take(),
                self.individual_name.take(),
                self.invoice_credit_balance.take(),
                self.invoice_prefix.take(),
                self.invoice_settings.take(),
                self.livemode,
                self.metadata.take(),
                self.name.take(),
                self.next_invoice_sequence,
                self.phone.take(),
                self.preferred_locales.take(),
                self.shipping.take(),
                self.sources.take(),
                self.subscriptions.take(),
                self.tax.take(),
                self.tax_exempt.take(),
                self.tax_ids.take(),
                self.test_clock.take(),
            )
            else {
                return None;
            };
            Some(Self::Out {
                address,
                balance,
                business_name,
                cash_balance,
                created,
                currency,
                customer_account,
                default_source,
                delinquent,
                description,
                discount,
                email,
                id,
                individual_name,
                invoice_credit_balance,
                invoice_prefix,
                invoice_settings,
                livemode,
                metadata,
                name,
                next_invoice_sequence,
                phone,
                preferred_locales,
                shipping,
                sources,
                subscriptions,
                tax,
                tax_exempt,
                tax_ids,
                test_clock,
            })
        }
    }

    impl Map for Builder<'_> {
        fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
            self.builder.key(k)
        }

        fn finish(&mut self) -> Result<()> {
            *self.out = self.builder.take_out();
            Ok(())
        }
    }

    impl ObjectDeser for Customer {
        type Builder = CustomerBuilder;
    }

    impl FromValueOpt for Customer {
        fn from_value(v: Value) -> Option<Self> {
            let Value::Object(obj) = v else {
                return None;
            };
            let mut b = CustomerBuilder::deser_default();
            for (k, v) in obj {
                match k.as_str() {
                    "address" => b.address = FromValueOpt::from_value(v),
                    "balance" => b.balance = FromValueOpt::from_value(v),
                    "business_name" => b.business_name = FromValueOpt::from_value(v),
                    "cash_balance" => b.cash_balance = FromValueOpt::from_value(v),
                    "created" => b.created = FromValueOpt::from_value(v),
                    "currency" => b.currency = FromValueOpt::from_value(v),
                    "customer_account" => b.customer_account = FromValueOpt::from_value(v),
                    "default_source" => b.default_source = FromValueOpt::from_value(v),
                    "delinquent" => b.delinquent = FromValueOpt::from_value(v),
                    "description" => b.description = FromValueOpt::from_value(v),
                    "discount" => b.discount = FromValueOpt::from_value(v),
                    "email" => b.email = FromValueOpt::from_value(v),
                    "id" => b.id = FromValueOpt::from_value(v),
                    "individual_name" => b.individual_name = FromValueOpt::from_value(v),
                    "invoice_credit_balance" => {
                        b.invoice_credit_balance = FromValueOpt::from_value(v)
                    }
                    "invoice_prefix" => b.invoice_prefix = FromValueOpt::from_value(v),
                    "invoice_settings" => b.invoice_settings = FromValueOpt::from_value(v),
                    "livemode" => b.livemode = FromValueOpt::from_value(v),
                    "metadata" => b.metadata = FromValueOpt::from_value(v),
                    "name" => b.name = FromValueOpt::from_value(v),
                    "next_invoice_sequence" => {
                        b.next_invoice_sequence = FromValueOpt::from_value(v)
                    }
                    "phone" => b.phone = FromValueOpt::from_value(v),
                    "preferred_locales" => b.preferred_locales = FromValueOpt::from_value(v),
                    "shipping" => b.shipping = FromValueOpt::from_value(v),
                    "sources" => b.sources = FromValueOpt::from_value(v),
                    "subscriptions" => b.subscriptions = FromValueOpt::from_value(v),
                    "tax" => b.tax = FromValueOpt::from_value(v),
                    "tax_exempt" => b.tax_exempt = FromValueOpt::from_value(v),
                    "tax_ids" => b.tax_ids = FromValueOpt::from_value(v),
                    "test_clock" => b.test_clock = FromValueOpt::from_value(v),
                    _ => {}
                }
            }
            b.take_out()
        }
    }
};
#[cfg(feature = "serialize")]
impl serde::Serialize for Customer {
    fn serialize<S: serde::Serializer>(&self, s: S) -> Result<S::Ok, S::Error> {
        use serde::ser::SerializeStruct;
        let mut s = s.serialize_struct("Customer", 31)?;
        s.serialize_field("address", &self.address)?;
        s.serialize_field("balance", &self.balance)?;
        s.serialize_field("business_name", &self.business_name)?;
        s.serialize_field("cash_balance", &self.cash_balance)?;
        s.serialize_field("created", &self.created)?;
        s.serialize_field("currency", &self.currency)?;
        s.serialize_field("customer_account", &self.customer_account)?;
        s.serialize_field("default_source", &self.default_source)?;
        s.serialize_field("delinquent", &self.delinquent)?;
        s.serialize_field("description", &self.description)?;
        s.serialize_field("discount", &self.discount)?;
        s.serialize_field("email", &self.email)?;
        s.serialize_field("id", &self.id)?;
        s.serialize_field("individual_name", &self.individual_name)?;
        s.serialize_field("invoice_credit_balance", &self.invoice_credit_balance)?;
        s.serialize_field("invoice_prefix", &self.invoice_prefix)?;
        s.serialize_field("invoice_settings", &self.invoice_settings)?;
        s.serialize_field("livemode", &self.livemode)?;
        s.serialize_field("metadata", &self.metadata)?;
        s.serialize_field("name", &self.name)?;
        s.serialize_field("next_invoice_sequence", &self.next_invoice_sequence)?;
        s.serialize_field("phone", &self.phone)?;
        s.serialize_field("preferred_locales", &self.preferred_locales)?;
        s.serialize_field("shipping", &self.shipping)?;
        s.serialize_field("sources", &self.sources)?;
        s.serialize_field("subscriptions", &self.subscriptions)?;
        s.serialize_field("tax", &self.tax)?;
        s.serialize_field("tax_exempt", &self.tax_exempt)?;
        s.serialize_field("tax_ids", &self.tax_ids)?;
        s.serialize_field("test_clock", &self.test_clock)?;

        s.serialize_field("object", "customer")?;
        s.end()
    }
}
impl stripe_types::Object for Customer {
    type Id = stripe_shared::CustomerId;
    fn id(&self) -> &Self::Id {
        &self.id
    }

    fn into_id(self) -> Self::Id {
        self.id
    }
}
stripe_types::def_id!(CustomerId);
#[derive(Clone, Eq, PartialEq)]
#[non_exhaustive]
pub enum CustomerTaxExempt {
    Exempt,
    None,
    Reverse,
    /// An unrecognized value from Stripe. Should not be used as a request parameter.
    Unknown(String),
}
impl CustomerTaxExempt {
    pub fn as_str(&self) -> &str {
        use CustomerTaxExempt::*;
        match self {
            Exempt => "exempt",
            None => "none",
            Reverse => "reverse",
            Unknown(v) => v,
        }
    }
}

impl std::str::FromStr for CustomerTaxExempt {
    type Err = std::convert::Infallible;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        use CustomerTaxExempt::*;
        match s {
            "exempt" => Ok(Exempt),
            "none" => Ok(None),
            "reverse" => Ok(Reverse),
            v => {
                tracing::warn!("Unknown value '{}' for enum '{}'", v, "CustomerTaxExempt");
                Ok(Unknown(v.to_owned()))
            }
        }
    }
}
impl std::fmt::Display for CustomerTaxExempt {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        f.write_str(self.as_str())
    }
}

#[cfg(not(feature = "redact-generated-debug"))]
impl std::fmt::Debug for CustomerTaxExempt {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        f.write_str(self.as_str())
    }
}
#[cfg(feature = "redact-generated-debug")]
impl std::fmt::Debug for CustomerTaxExempt {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        f.debug_struct(stringify!(CustomerTaxExempt)).finish_non_exhaustive()
    }
}
impl serde::Serialize for CustomerTaxExempt {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}
impl miniserde::Deserialize for CustomerTaxExempt {
    fn begin(out: &mut Option<Self>) -> &mut dyn miniserde::de::Visitor {
        crate::Place::new(out)
    }
}

impl miniserde::de::Visitor for crate::Place<CustomerTaxExempt> {
    fn string(&mut self, s: &str) -> miniserde::Result<()> {
        use std::str::FromStr;
        self.out = Some(CustomerTaxExempt::from_str(s).expect("infallible"));
        Ok(())
    }
}

stripe_types::impl_from_val_with_from_str!(CustomerTaxExempt);
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for CustomerTaxExempt {
    fn deserialize<D: serde::Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
        use std::str::FromStr;
        let s: std::borrow::Cow<'de, str> = serde::Deserialize::deserialize(deserializer)?;
        Ok(Self::from_str(&s).expect("infallible"))
    }
}