tastytrade 0.5.0

Library for trading through tastytrade's 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
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
//! The customer resource: the most sensitive object this crate touches.
//!
//! Names, home and mailing addresses, tax identifiers, birth dates, visa
//! status, net worth, employer, political affiliation, family member names.
//! Every one of these is personal data about a real person, and several of
//! them are identity-theft material on their own.
//!
//! So the rule here is stricter than "keep it out of logs": **nothing in this
//! module renders itself**. `Debug` and `Display` print the type name and how
//! many fields arrived, never a value — the same treatment
//! [`crate::prelude::RawPayload`] gets, for the same reason. Reading a value
//! means naming the field, which is a decision a caller makes on purpose and a
//! reviewer can grep for.
//!
//! `Serialize` is derived because the generic verbs require it. Serialising a
//! customer writes the personal data, which is correct — it is an explicit act.

use std::fmt;

use chrono::{DateTime, FixedOffset, NaiveDate};
use rust_decimal::Decimal;
use serde::{Deserialize, Serialize};

/// Writes `Debug` and `Display` impls that render nothing but a field count.
///
/// A macro rather than seven hand-written impls: a per-field redaction is a
/// per-field opportunity to forget one, and the venue adds fields. This cannot
/// leak a value it has never been told about.
macro_rules! redacted_debug {
    ($name:ident) => {
        impl $name {
            /// How many fields the venue actually sent.
            ///
            /// Structural, not personal: a count is safe to print and is the
            /// only thing `Debug` is allowed to say about the contents.
            pub fn populated_fields(&self) -> usize {
                populated(self)
            }
        }

        impl fmt::Debug for $name {
            fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                write!(
                    f,
                    concat!(stringify!($name), "(<redacted, {} field(s) present>)"),
                    self.populated_fields()
                )
            }
        }

        impl fmt::Display for $name {
            fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
                write!(f, "<redacted {}>", stringify!($name))
            }
        }
    };
}

/// How many fields a value actually carries.
///
/// Counted by serialising and counting the keys serde emits, so it stays right
/// when a field is added and cannot itself print a value. Structural, not
/// personal.
fn populated(value: &impl Serialize) -> usize {
    serde_json::to_value(value)
        .ok()
        .and_then(|value| match value {
            serde_json::Value::Object(map) => Some(map.values().filter(|v| !v.is_null()).count()),
            _ => None,
        })
        .unwrap_or(0)
}

/// One account type this customer is permitted to open.
///
/// **Snake case, alone in this module.** Every other object the customer
/// resource carries is kebab-case; this one and its margin types are not, so
/// they carry no `rename_all` and decode through serde's default field-name
/// mapping — which is exactly the snake_case the venue sends. Observed in the
/// 2026-08-04 capture; the field was typed `String` before that, which made the
/// whole customer resource fail to decode against the real venue.
#[derive(Serialize, Deserialize, Clone, Default)]
pub struct PermittedAccountType {
    /// The venue's name for the account type.
    #[serde(default)]
    pub name: Option<String>,
    /// A longer description of it.
    #[serde(default)]
    pub description: Option<String>,
    /// Whether the type admits more than one owner.
    #[serde(default)]
    pub has_multiple_owners: Option<bool>,
    /// Whether it is offered publicly.
    #[serde(default)]
    pub is_publicly_available: Option<bool>,
    /// Whether it carries a tax advantage.
    #[serde(default)]
    pub is_tax_advantaged: Option<bool>,
    /// The margin arrangements it supports.
    #[serde(default)]
    pub margin_types: Vec<PermittedMarginType>,
}

redacted_debug!(PermittedAccountType);

/// One margin arrangement a [`PermittedAccountType`] supports.
#[derive(Serialize, Deserialize, Clone, Default)]
pub struct PermittedMarginType {
    /// The venue's name for it.
    #[serde(default)]
    pub name: Option<String>,
    /// Whether it is a margin arrangement rather than a cash one.
    #[serde(default)]
    pub is_margin: Option<bool>,
}

redacted_debug!(PermittedMarginType);

/// A postal address.
///
/// Every field is `Option<T>`: the venue sends what it holds, and a field it
/// omitted is unknown rather than empty. `Debug` and `Display` redact.
#[derive(Serialize, Deserialize, Clone, Default)]
#[serde(rename_all = "kebab-case")]
pub struct CustomerAddress {
    /// City.
    #[serde(default)]
    pub city: Option<String>,
    /// Country.
    #[serde(default)]
    pub country: Option<String>,
    /// Is domestic.
    #[serde(default)]
    pub is_domestic: Option<bool>,
    /// Is foreign.
    #[serde(default)]
    pub is_foreign: Option<bool>,
    /// Postal code.
    #[serde(default)]
    pub postal_code: Option<String>,
    /// State region.
    #[serde(default)]
    pub state_region: Option<String>,
    /// Street one.
    #[serde(default)]
    pub street_one: Option<String>,
    /// Street three.
    #[serde(default)]
    pub street_three: Option<String>,
    /// Street two.
    #[serde(default)]
    pub street_two: Option<String>,
}

redacted_debug!(CustomerAddress);

/// The customer's declared finances and trading experience.
///
/// Every field is `Option<T>`: the venue sends what it holds, and a field it
/// omitted is unknown rather than empty. `Debug` and `Display` redact.
#[derive(Serialize, Deserialize, Clone, Default)]
#[serde(rename_all = "kebab-case")]
pub struct CustomerSuitability {
    /// Id.
    #[serde(default)]
    pub id: Option<String>,
    /// Annual net income.
    #[serde(default, with = "crate::types::wire::decimal_option")]
    pub annual_net_income: Option<Decimal>,
    /// Covered options trading experience.
    #[serde(default)]
    pub covered_options_trading_experience: Option<String>,
    /// Customer id.
    #[serde(default)]
    pub customer_id: Option<i64>,
    /// Employer name.
    #[serde(default)]
    pub employer_name: Option<String>,
    /// Employment status.
    #[serde(default)]
    pub employment_status: Option<String>,
    /// Futures trading experience.
    #[serde(default)]
    pub futures_trading_experience: Option<String>,
    /// Job title.
    #[serde(default)]
    pub job_title: Option<String>,
    /// Liquid net worth.
    #[serde(default, with = "crate::types::wire::decimal_option")]
    pub liquid_net_worth: Option<Decimal>,
    /// Marital status.
    #[serde(default)]
    pub marital_status: Option<String>,
    /// Net worth.
    #[serde(default, with = "crate::types::wire::decimal_option")]
    pub net_worth: Option<Decimal>,
    /// Number of dependents.
    #[serde(default)]
    pub number_of_dependents: Option<i64>,
    /// Occupation.
    #[serde(default)]
    pub occupation: Option<String>,
    /// Stock trading experience.
    #[serde(default)]
    pub stock_trading_experience: Option<String>,
    /// Tax bracket.
    #[serde(default)]
    pub tax_bracket: Option<String>,
    /// Uncovered options trading experience.
    #[serde(default)]
    pub uncovered_options_trading_experience: Option<String>,
}

redacted_debug!(CustomerSuitability);

/// The natural person behind a customer.
///
/// Every field is `Option<T>`: the venue sends what it holds, and a field it
/// omitted is unknown rather than empty. `Debug` and `Display` redact.
#[derive(Serialize, Deserialize, Clone, Default)]
#[serde(rename_all = "kebab-case")]
pub struct CustomerPerson {
    /// External id.
    #[serde(default)]
    pub external_id: Option<String>,
    /// First name.
    #[serde(default)]
    pub first_name: Option<String>,
    /// Last name.
    #[serde(default)]
    pub last_name: Option<String>,
    /// Middle name.
    #[serde(default)]
    pub middle_name: Option<String>,
    /// Prefix name.
    #[serde(default)]
    pub prefix_name: Option<String>,
    /// Suffix name.
    #[serde(default)]
    pub suffix_name: Option<String>,
    /// Birth country.
    #[serde(default)]
    pub birth_country: Option<String>,
    /// Birth date.
    #[serde(default, with = "crate::types::wire::date_option")]
    pub birth_date: Option<NaiveDate>,
    /// Citizenship country.
    #[serde(default)]
    pub citizenship_country: Option<String>,
    /// Usa citizenship type.
    #[serde(default)]
    pub usa_citizenship_type: Option<String>,
    /// Visa expiration date.
    #[serde(default, with = "crate::types::wire::date_option")]
    pub visa_expiration_date: Option<NaiveDate>,
    /// Visa type.
    #[serde(default)]
    pub visa_type: Option<String>,
    /// Employer name.
    #[serde(default)]
    pub employer_name: Option<String>,
    /// Employment status.
    #[serde(default)]
    pub employment_status: Option<String>,
    /// Job title.
    #[serde(default)]
    pub job_title: Option<String>,
    /// Marital status.
    #[serde(default)]
    pub marital_status: Option<String>,
    /// Number of dependents.
    #[serde(default)]
    pub number_of_dependents: Option<i64>,
    /// Occupation.
    #[serde(default)]
    pub occupation: Option<String>,
}

redacted_debug!(CustomerPerson);

/// An officer of an entity customer.
///
/// Every field is `Option<T>`: the venue sends what it holds, and a field it
/// omitted is unknown rather than empty. `Debug` and `Display` redact.
#[derive(Serialize, Deserialize, Clone, Default)]
#[serde(rename_all = "kebab-case")]
pub struct EntityOfficer {
    /// Id.
    #[serde(default)]
    pub id: Option<String>,
    /// External id.
    #[serde(default)]
    pub external_id: Option<String>,
    /// First name.
    #[serde(default)]
    pub first_name: Option<String>,
    /// Last name.
    #[serde(default)]
    pub last_name: Option<String>,
    /// Middle name.
    #[serde(default)]
    pub middle_name: Option<String>,
    /// Prefix name.
    #[serde(default)]
    pub prefix_name: Option<String>,
    /// Suffix name.
    #[serde(default)]
    pub suffix_name: Option<String>,
    /// Address.
    #[serde(default)]
    pub address: Option<CustomerAddress>,
    /// Birth country.
    #[serde(default)]
    pub birth_country: Option<String>,
    /// Birth date.
    #[serde(default, with = "crate::types::wire::date_option")]
    pub birth_date: Option<NaiveDate>,
    /// Citizenship country.
    #[serde(default)]
    pub citizenship_country: Option<String>,
    /// Email.
    #[serde(default)]
    pub email: Option<String>,
    /// Employer name.
    #[serde(default)]
    pub employer_name: Option<String>,
    /// Employment status.
    #[serde(default)]
    pub employment_status: Option<String>,
    /// Home phone number.
    #[serde(default)]
    pub home_phone_number: Option<String>,
    /// Unobserved. The 2026-08-04 capture is an individual account and
    /// carries no entity section, so nothing here has been seen on the
    /// wire. The booleans found elsewhere in this module were found; this
    /// was not, and changing it on that basis would be the guess this
    /// exercise exists to remove.
    /// Is foreign.
    #[serde(default)]
    pub is_foreign: Option<String>,
    /// Job title.
    #[serde(default)]
    pub job_title: Option<String>,
    /// Marital status.
    #[serde(default)]
    pub marital_status: Option<String>,
    /// Mobile phone number.
    #[serde(default)]
    pub mobile_phone_number: Option<String>,
    /// Number of dependents.
    #[serde(default)]
    pub number_of_dependents: Option<i64>,
    /// Occupation.
    #[serde(default)]
    pub occupation: Option<String>,
    /// Owner of record.
    #[serde(default)]
    pub owner_of_record: Option<bool>,
    /// Relationship to entity.
    #[serde(default)]
    pub relationship_to_entity: Option<String>,
    /// Tax number.
    #[serde(default)]
    pub tax_number: Option<String>,
    /// Tax number type.
    #[serde(default)]
    pub tax_number_type: Option<String>,
    /// Usa citizenship type.
    #[serde(default)]
    pub usa_citizenship_type: Option<String>,
    /// Visa expiration date.
    #[serde(default, with = "crate::types::wire::date_option")]
    pub visa_expiration_date: Option<NaiveDate>,
    /// Visa type.
    #[serde(default)]
    pub visa_type: Option<String>,
    /// Work phone number.
    #[serde(default)]
    pub work_phone_number: Option<String>,
}

redacted_debug!(EntityOfficer);

/// An entity's declared finances and trading experience.
///
/// Every field is `Option<T>`: the venue sends what it holds, and a field it
/// omitted is unknown rather than empty. `Debug` and `Display` redact.
#[derive(Serialize, Deserialize, Clone, Default)]
#[serde(rename_all = "kebab-case")]
pub struct EntitySuitability {
    /// Id.
    #[serde(default)]
    pub id: Option<String>,
    /// Annual net income.
    #[serde(default, with = "crate::types::wire::decimal_option")]
    pub annual_net_income: Option<Decimal>,
    /// Covered options trading experience.
    #[serde(default)]
    pub covered_options_trading_experience: Option<String>,
    /// Entity id.
    #[serde(default)]
    pub entity_id: Option<i64>,
    /// Futures trading experience.
    #[serde(default)]
    pub futures_trading_experience: Option<String>,
    /// Liquid net worth.
    #[serde(default, with = "crate::types::wire::decimal_option")]
    pub liquid_net_worth: Option<Decimal>,
    /// Net worth.
    #[serde(default, with = "crate::types::wire::decimal_option")]
    pub net_worth: Option<Decimal>,
    /// Stock trading experience.
    #[serde(default)]
    pub stock_trading_experience: Option<String>,
    /// Tax bracket.
    #[serde(default)]
    pub tax_bracket: Option<String>,
    /// Uncovered options trading experience.
    #[serde(default)]
    pub uncovered_options_trading_experience: Option<String>,
}

redacted_debug!(EntitySuitability);

/// The legal entity behind a customer, when there is one.
///
/// Every field is `Option<T>`: the venue sends what it holds, and a field it
/// omitted is unknown rather than empty. `Debug` and `Display` redact.
#[derive(Serialize, Deserialize, Clone, Default)]
#[serde(rename_all = "kebab-case")]
pub struct CustomerEntity {
    /// Id.
    #[serde(default)]
    pub id: Option<String>,
    /// Address.
    #[serde(default)]
    pub address: Option<CustomerAddress>,
    /// Business nature.
    #[serde(default)]
    pub business_nature: Option<String>,
    /// Date of trust creation.
    #[serde(default, with = "crate::types::wire::date_option")]
    pub date_of_trust_creation: Option<NaiveDate>,
    /// Email.
    #[serde(default)]
    pub email: Option<String>,
    /// Entity officers.
    pub entity_officers: Option<Vec<EntityOfficer>>,
    /// Entity suitability.
    #[serde(default)]
    pub entity_suitability: Option<EntitySuitability>,
    /// Entity type.
    #[serde(default)]
    pub entity_type: Option<String>,
    /// Foreign institution.
    #[serde(default)]
    pub foreign_institution: Option<String>,
    /// Grantor birth date.
    #[serde(default, with = "crate::types::wire::date_option")]
    pub grantor_birth_date: Option<NaiveDate>,
    /// Grantor email.
    #[serde(default)]
    pub grantor_email: Option<String>,
    /// Grantor first name.
    #[serde(default)]
    pub grantor_first_name: Option<String>,
    /// Grantor last name.
    #[serde(default)]
    pub grantor_last_name: Option<String>,
    /// Grantor middle name.
    #[serde(default)]
    pub grantor_middle_name: Option<String>,
    /// Grantor tax number.
    #[serde(default)]
    pub grantor_tax_number: Option<String>,
    /// Has foreign bank affiliation.
    #[serde(default)]
    pub has_foreign_bank_affiliation: Option<String>,
    /// Has foreign institution affiliation.
    #[serde(default)]
    pub has_foreign_institution_affiliation: Option<String>,
    /// Unobserved. The 2026-08-04 capture is an individual account and
    /// carries no entity section, so nothing here has been seen on the
    /// wire. The booleans found elsewhere in this module were found; this
    /// was not, and changing it on that basis would be the guess this
    /// exercise exists to remove.
    /// Is domestic.
    #[serde(default)]
    pub is_domestic: Option<String>,
    /// Is hedge fund.
    #[serde(default)]
    pub is_hedge_fund: Option<String>,
    /// Legal name.
    #[serde(default)]
    pub legal_name: Option<String>,
    /// Mailing address.
    #[serde(default)]
    pub mailing_address: Option<CustomerAddress>,
    /// Phone number.
    #[serde(default)]
    pub phone_number: Option<String>,
    /// Secretary name.
    #[serde(default)]
    pub secretary_name: Option<String>,
    /// Tax election.
    #[serde(default)]
    pub tax_election: Option<String>,
    /// Tax number.
    #[serde(default)]
    pub tax_number: Option<String>,
}

redacted_debug!(CustomerEntity);

/// A full customer resource.
///
/// Every field is `Option<T>`: the venue sends what it holds, and a field it
/// omitted is unknown rather than empty. `Debug` and `Display` redact.
#[derive(Serialize, Deserialize, Clone, Default)]
#[serde(rename_all = "kebab-case")]
pub struct Customer {
    /// Id.
    #[serde(default)]
    pub id: Option<String>,
    /// First name.
    #[serde(default)]
    pub first_name: Option<String>,
    /// First surname.
    #[serde(default)]
    pub first_surname: Option<String>,
    /// Last name.
    #[serde(default)]
    pub last_name: Option<String>,
    /// Middle name.
    #[serde(default)]
    pub middle_name: Option<String>,
    /// Prefix name.
    #[serde(default)]
    pub prefix_name: Option<String>,
    /// Second surname.
    #[serde(default)]
    pub second_surname: Option<String>,
    /// Suffix name.
    #[serde(default)]
    pub suffix_name: Option<String>,
    /// Cherry club date.
    #[serde(default, with = "crate::types::wire::date_option")]
    pub cherry_club_date: Option<NaiveDate>,
    /// Address.
    #[serde(default)]
    pub address: Option<CustomerAddress>,
    /// Customer suitability.
    #[serde(default)]
    pub customer_suitability: Option<CustomerSuitability>,
    /// Mailing address.
    #[serde(default)]
    pub mailing_address: Option<CustomerAddress>,
    /// Is foreign.
    #[serde(default)]
    pub is_foreign: Option<bool>,
    /// Regulatory domain.
    #[serde(default)]
    pub regulatory_domain: Option<String>,
    /// Usa citizenship type.
    #[serde(default)]
    pub usa_citizenship_type: Option<String>,
    /// Home phone number.
    #[serde(default)]
    pub home_phone_number: Option<String>,
    /// Home phone number details.
    #[serde(default)]
    pub home_phone_number_details: Option<String>,
    /// Mobile phone number.
    #[serde(default)]
    pub mobile_phone_number: Option<String>,
    /// Mobile phone number details.
    #[serde(default)]
    pub mobile_phone_number_details: Option<String>,
    /// Work phone number.
    #[serde(default)]
    pub work_phone_number: Option<String>,
    /// Work phone number details.
    #[serde(default)]
    pub work_phone_number_details: Option<String>,
    /// Birth date.
    #[serde(default, with = "crate::types::wire::date_option")]
    pub birth_date: Option<NaiveDate>,
    /// Email.
    #[serde(default)]
    pub email: Option<String>,
    /// External id.
    #[serde(default)]
    pub external_id: Option<String>,
    /// Foreign tax number.
    #[serde(default)]
    pub foreign_tax_number: Option<String>,
    /// Tax number.
    #[serde(default)]
    pub tax_number: Option<String>,
    /// Tax number type.
    #[serde(default)]
    pub tax_number_type: Option<String>,
    /// Birth country.
    #[serde(default)]
    pub birth_country: Option<String>,
    /// Citizenship country.
    #[serde(default)]
    pub citizenship_country: Option<String>,
    /// Visa expiration date.
    #[serde(default, with = "crate::types::wire::date_option")]
    pub visa_expiration_date: Option<NaiveDate>,
    /// Visa type.
    #[serde(default)]
    pub visa_type: Option<String>,
    /// Agreed to margining.
    #[serde(default)]
    pub agreed_to_margining: Option<bool>,
    /// Subject to tax withholding.
    #[serde(default)]
    pub subject_to_tax_withholding: Option<bool>,
    /// Agreed to terms.
    #[serde(default)]
    pub agreed_to_terms: Option<bool>,
    /// Signature of agreement.
    #[serde(default)]
    pub signature_of_agreement: Option<bool>,
    /// Desk customer id.
    #[serde(default)]
    pub desk_customer_id: Option<String>,
    /// Ext crm id.
    #[serde(default)]
    pub ext_crm_id: Option<String>,
    /// Family member names.
    #[serde(default)]
    pub family_member_names: Option<String>,
    /// Gender.
    #[serde(default)]
    pub gender: Option<String>,
    /// Has industry affiliation.
    #[serde(default)]
    pub has_industry_affiliation: Option<bool>,
    /// Has institutional assets.
    #[serde(default)]
    pub has_institutional_assets: Option<String>,
    /// Has listed affiliation.
    #[serde(default)]
    pub has_listed_affiliation: Option<bool>,
    /// Has political affiliation.
    #[serde(default)]
    pub has_political_affiliation: Option<bool>,
    /// Industry affiliation firm.
    #[serde(default)]
    pub industry_affiliation_firm: Option<String>,
    /// Is investment adviser.
    #[serde(default)]
    pub is_investment_adviser: Option<String>,
    /// Listed affiliation symbol.
    #[serde(default)]
    pub listed_affiliation_symbol: Option<String>,
    /// Political organization.
    #[serde(default)]
    pub political_organization: Option<String>,
    /// User id.
    #[serde(default)]
    pub user_id: Option<String>,
    /// Has delayed quotes.
    #[serde(default)]
    pub has_delayed_quotes: Option<bool>,
    /// Has pending or approved application.
    #[serde(default)]
    pub has_pending_or_approved_application: Option<bool>,
    /// Is professional.
    #[serde(default)]
    pub is_professional: Option<bool>,
    /// Permitted account types.
    #[serde(default)]
    pub permitted_account_types: Option<Vec<PermittedAccountType>>,
    /// Created at.
    #[serde(default, with = "crate::types::wire::datetime_option")]
    pub created_at: Option<DateTime<FixedOffset>>,
    /// Entity.
    #[serde(default)]
    pub entity: Option<CustomerEntity>,
    /// Identifiable type.
    #[serde(default)]
    pub identifiable_type: Option<String>,
    /// Person.
    #[serde(default)]
    pub person: Option<CustomerPerson>,
}

redacted_debug!(Customer);