sumup 0.5.8

Rust SDK for the SumUp 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
// The contents of this file are generated; do not modify them.

use super::common::*;
/// Profile information.
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct AccountLegacy {
    /// Username of the user profile.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub username: Option<String>,
    /// The role of the user.
    #[serde(rename = "type")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub r#type: Option<String>,
}
/// Details of the registered address.
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct AddressWithDetails {
    /// Address line 1
    #[serde(skip_serializing_if = "Option::is_none")]
    pub address_line1: Option<String>,
    /// Address line 2
    #[serde(skip_serializing_if = "Option::is_none")]
    pub address_line2: Option<String>,
    /// City
    #[serde(skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    /// Country ISO 3166-1 code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    /// Country region id
    #[serde(skip_serializing_if = "Option::is_none")]
    pub region_id: Option<f64>,
    /// Region name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub region_name: Option<String>,
    /// Region code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub region_code: Option<String>,
    /// Postal code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub post_code: Option<String>,
    /// Landline number
    #[serde(skip_serializing_if = "Option::is_none")]
    pub landline: Option<String>,
    /// undefined
    #[serde(skip_serializing_if = "Option::is_none")]
    pub first_name: Option<String>,
    /// undefined
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_name: Option<String>,
    /// undefined
    #[serde(skip_serializing_if = "Option::is_none")]
    pub company: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub country_details: Option<CountryDetails>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub timeoffset_details: Option<TimeoffsetDetails>,
    /// undefined
    #[serde(skip_serializing_if = "Option::is_none")]
    pub state_id: Option<String>,
}
/// Mobile app settings
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct AppSettings {
    /// Checkout preference
    #[serde(skip_serializing_if = "Option::is_none")]
    pub checkout_preference: Option<String>,
    /// Include vat.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include_vat: Option<bool>,
    /// Manual entry tutorial.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub manual_entry_tutorial: Option<bool>,
    /// Mobile payment tutorial.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mobile_payment_tutorial: Option<bool>,
    /// Tax enabled.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tax_enabled: Option<bool>,
    /// Mobile payment.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mobile_payment: Option<String>,
    /// Reader payment.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub reader_payment: Option<String>,
    /// Cash payment.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cash_payment: Option<String>,
    /// Advanced mode.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub advanced_mode: Option<String>,
    /// Expected max transaction amount.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub expected_max_transaction_amount: Option<f64>,
    /// Manual entry.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub manual_entry: Option<String>,
    /// Terminal mode tutorial.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub terminal_mode_tutorial: Option<bool>,
    /// Tipping.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tipping: Option<String>,
    /// Tip rates.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tip_rates: Option<Vec<f32>>,
    /// Barcode scanner.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub barcode_scanner: Option<String>,
    /// Referral.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub referral: Option<String>,
}
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct BankAccount {
    /// Bank code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bank_code: Option<String>,
    /// Branch code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub branch_code: Option<String>,
    /// SWIFT code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub swift: Option<String>,
    /// Account number
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_number: Option<String>,
    /// IBAN
    #[serde(skip_serializing_if = "Option::is_none")]
    pub iban: Option<String>,
    /// Type of the account
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_type: Option<String>,
    /// Account category - business or personal
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_category: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account_holder_name: Option<String>,
    /// Status in the verification process
    #[serde(skip_serializing_if = "Option::is_none")]
    pub status: Option<String>,
    /// The primary bank account is the one used for payouts
    #[serde(skip_serializing_if = "Option::is_none")]
    pub primary: Option<bool>,
    /// Creation date of the bank account
    #[serde(skip_serializing_if = "Option::is_none")]
    pub created_at: Option<String>,
    /// Bank name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bank_name: Option<String>,
}
pub type BusinessOwners = Vec<serde_json::Value>;
/// Country Details
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct CountryDetails {
    /// Currency ISO 4217 code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub currency: Option<String>,
    /// Country ISO code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub iso_code: Option<String>,
    /// Country EN name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub en_name: Option<String>,
    /// Country native name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub native_name: Option<String>,
}
/// Doing Business As information
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct DoingBusinessAsLegacy {
    /// Doing business as name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub business_name: Option<String>,
    /// Doing business as company registration number
    #[serde(skip_serializing_if = "Option::is_none")]
    pub company_registration_number: Option<String>,
    /// Doing business as VAT ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub vat_id: Option<String>,
    /// Doing business as website
    #[serde(skip_serializing_if = "Option::is_none")]
    pub website: Option<String>,
    /// Doing business as email
    #[serde(skip_serializing_if = "Option::is_none")]
    pub email: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub address: Option<DoingBusinessAsLegacyAddress>,
}
/// Id of the legal type of the merchant profile
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct LegalTypeLegacy {
    /// Unique id
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<f64>,
    /// Legal type description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub full_description: Option<String>,
    /// Legal type short description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Sole trader legal type if true
    #[serde(skip_serializing_if = "Option::is_none")]
    pub sole_trader: Option<bool>,
}
/// Details of the merchant account.
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct MerchantAccount {
    #[serde(skip_serializing_if = "Option::is_none")]
    pub account: Option<AccountLegacy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub personal_profile: Option<PersonalProfileLegacy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub merchant_profile: Option<MerchantProfileLegacy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub app_settings: Option<AppSettings>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub permissions: Option<PermissionsLegacy>,
}
/// Account's merchant profile
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct MerchantProfileLegacy {
    /// Unique identifying code of the merchant profile
    #[serde(skip_serializing_if = "Option::is_none")]
    pub merchant_code: Option<String>,
    /// Company name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub company_name: Option<String>,
    /// Website
    #[serde(skip_serializing_if = "Option::is_none")]
    pub website: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub legal_type: Option<LegalTypeLegacy>,
    /// Merchant category code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub merchant_category_code: Option<String>,
    /// Mobile phone number
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mobile_phone: Option<String>,
    /// Company registration number
    #[serde(skip_serializing_if = "Option::is_none")]
    pub company_registration_number: Option<String>,
    /// Vat ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub vat_id: Option<String>,
    /// Permanent certificate access code &#40;Portugal&#41;
    #[serde(skip_serializing_if = "Option::is_none")]
    pub permanent_certificate_access_code: Option<String>,
    /// Nature and purpose of the business
    #[serde(skip_serializing_if = "Option::is_none")]
    pub nature_and_purpose: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub address: Option<AddressWithDetails>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub business_owners: Option<BusinessOwners>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub doing_business_as: Option<DoingBusinessAsLegacy>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub settings: Option<MerchantSettings>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub vat_rates: Option<VatRates>,
    /// Merchant locale &#40;for internal usage only&#41;
    #[serde(skip_serializing_if = "Option::is_none")]
    pub locale: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub bank_accounts: Option<Vec<BankAccount>>,
    /// True if the merchant is extdev
    #[serde(skip_serializing_if = "Option::is_none")]
    pub extdev: Option<bool>,
    /// True if the payout zone of this merchant is migrated
    #[serde(skip_serializing_if = "Option::is_none")]
    pub payout_zone_migrated: Option<bool>,
    /// Merchant country code formatted according to [ISO3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) &#40;for internal usage only&#41;
    #[serde(skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
}
/// Merchant settings &#40;like \"payout_type\", \"payout_period\"&#41;
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct MerchantSettings {
    /// Whether to show tax in receipts &#40;saved per transaction&#41;
    #[serde(skip_serializing_if = "Option::is_none")]
    pub tax_enabled: Option<bool>,
    /// Payout type
    #[serde(skip_serializing_if = "Option::is_none")]
    pub payout_type: Option<String>,
    /// Payout frequency
    #[serde(skip_serializing_if = "Option::is_none")]
    pub payout_period: Option<String>,
    /// Whether merchant can edit payouts on demand
    #[serde(skip_serializing_if = "Option::is_none")]
    pub payout_on_demand_available: Option<bool>,
    /// Whether merchant will receive payouts on demand
    #[serde(skip_serializing_if = "Option::is_none")]
    pub payout_on_demand: Option<bool>,
    /// Whether to show printers in mobile app
    #[serde(skip_serializing_if = "Option::is_none")]
    pub printers_enabled: Option<bool>,
    /// Payout Instrument
    #[serde(skip_serializing_if = "Option::is_none")]
    pub payout_instrument: Option<String>,
    /// Whether merchant can make MOTO payments
    #[serde(skip_serializing_if = "Option::is_none")]
    pub moto_payment: Option<String>,
    /// Stone merchant code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub stone_merchant_code: Option<String>,
    /// Whether merchant will receive daily payout emails
    #[serde(skip_serializing_if = "Option::is_none")]
    pub daily_payout_email: Option<bool>,
    /// Whether merchant will receive monthly payout emails
    #[serde(skip_serializing_if = "Option::is_none")]
    pub monthly_payout_email: Option<bool>,
    /// Whether merchant has gross settlement enabled
    #[serde(skip_serializing_if = "Option::is_none")]
    pub gross_settlement: Option<bool>,
}
/// User permissions
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct PermissionsLegacy {
    /// Create MOTO payments
    #[serde(skip_serializing_if = "Option::is_none")]
    pub create_moto_payments: Option<bool>,
    /// Can view full merchant transaction history
    #[serde(skip_serializing_if = "Option::is_none")]
    pub full_transaction_history_view: Option<bool>,
    /// Refund transactions
    #[serde(skip_serializing_if = "Option::is_none")]
    pub refund_transactions: Option<bool>,
    /// Create referral
    #[serde(skip_serializing_if = "Option::is_none")]
    pub create_referral: Option<bool>,
}
/// Account's personal profile.
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct PersonalProfileLegacy {
    /// First name of the user
    #[serde(skip_serializing_if = "Option::is_none")]
    pub first_name: Option<String>,
    /// Last name of the user
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_name: Option<String>,
    /// Date of birth
    #[serde(skip_serializing_if = "Option::is_none")]
    pub date_of_birth: Option<String>,
    /// Mobile phone number
    #[serde(skip_serializing_if = "Option::is_none")]
    pub mobile_phone: Option<String>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub address: Option<AddressWithDetails>,
    #[serde(skip_serializing_if = "Option::is_none")]
    pub complete: Option<bool>,
}
/// TimeOffset Details
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct TimeoffsetDetails {
    /// Postal code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub post_code: Option<String>,
    /// UTC offset
    #[serde(skip_serializing_if = "Option::is_none")]
    pub offset: Option<f64>,
    /// Daylight Saving Time
    #[serde(skip_serializing_if = "Option::is_none")]
    pub dst: Option<bool>,
}
/// Merchant VAT rates
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct VatRates {
    /// Internal ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub id: Option<f64>,
    /// Description
    #[serde(skip_serializing_if = "Option::is_none")]
    pub description: Option<String>,
    /// Rate
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rate: Option<f64>,
    /// Ordering
    #[serde(skip_serializing_if = "Option::is_none")]
    pub ordering: Option<f64>,
    /// Country ISO code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
}
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct DoingBusinessAsLegacyAddress {
    /// Address line 1
    #[serde(skip_serializing_if = "Option::is_none")]
    pub address_line1: Option<String>,
    /// Address line 2
    #[serde(skip_serializing_if = "Option::is_none")]
    pub address_line2: Option<String>,
    /// City
    #[serde(skip_serializing_if = "Option::is_none")]
    pub city: Option<String>,
    /// Country ISO 3166-1 code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    /// Country region ID
    #[serde(skip_serializing_if = "Option::is_none")]
    pub region_id: Option<f64>,
    /// Country region name
    #[serde(skip_serializing_if = "Option::is_none")]
    pub region_name: Option<String>,
    /// Postal code
    #[serde(skip_serializing_if = "Option::is_none")]
    pub post_code: Option<String>,
}
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct GetParams {
    /// A list of additional information you want to receive for the user. By default only personal and merchant profile information will be returned.
    #[serde(rename = "include[]")]
    #[serde(skip_serializing_if = "Option::is_none")]
    pub include: Option<Vec<String>>,
}
use crate::client::Client;
#[derive(Debug)]
pub enum GetErrorBody {
    Unauthorized(Error),
}
#[derive(Debug)]
pub enum GetMerchantProfileErrorBody {
    Unauthorized(Error),
    Forbidden(ErrorForbidden),
}
#[derive(Debug)]
pub enum GetDoingBusinessAsErrorBody {
    Unauthorized(Error),
}
#[derive(Debug)]
pub enum GetPersonalProfileErrorBody {
    Unauthorized(Error),
}
///Client for the Merchant API endpoints.
#[derive(Debug)]
pub struct MerchantClient<'a> {
    client: &'a Client,
}
impl<'a> MerchantClient<'a> {
    pub(crate) fn new(client: &'a Client) -> Self {
        Self { client }
    }
    /// Returns a reference to the underlying client.
    pub fn client(&self) -> &Client {
        self.client
    }
    /// Retrieve a profile
    ///
    /// Returns user profile information.
    pub async fn get(
        &self,
        params: GetParams,
    ) -> crate::error::SdkResult<MerchantAccount, GetErrorBody> {
        let path = "/v0.1/me";
        let url = format!("{}{}", self.client.base_url(), path);
        let mut request = self
            .client
            .http_client()
            .get(&url)
            .header("User-Agent", crate::version::user_agent())
            .timeout(self.client.timeout());
        if let Some(authorization) = self.client.authorization() {
            request = request.header("Authorization", format!("Bearer {}", authorization));
        }
        for (header_name, header_value) in self.client.runtime_headers() {
            request = request.header(*header_name, header_value);
        }
        if let Some(ref value) = params.include {
            request = request.query(&[("include[]", value)]);
        }
        let response = request.send().await?;
        let status = response.status();
        match status {
            reqwest::StatusCode::OK => {
                let data: MerchantAccount = response.json().await?;
                Ok(data)
            }
            reqwest::StatusCode::UNAUTHORIZED => {
                let body: Error = response.json().await?;
                Err(crate::error::SdkError::api(GetErrorBody::Unauthorized(
                    body,
                )))
            }
            _ => {
                let body_bytes = response.bytes().await?;
                let body = crate::error::UnknownApiBody::from_bytes(body_bytes.as_ref());
                Err(crate::error::SdkError::unexpected(status, body))
            }
        }
    }
    /// Retrieve a merchant profile
    ///
    /// Retrieves merchant profile data.
    pub async fn get_merchant_profile(
        &self,
    ) -> crate::error::SdkResult<MerchantProfileLegacy, GetMerchantProfileErrorBody> {
        let path = "/v0.1/me/merchant-profile";
        let url = format!("{}{}", self.client.base_url(), path);
        let mut request = self
            .client
            .http_client()
            .get(&url)
            .header("User-Agent", crate::version::user_agent())
            .timeout(self.client.timeout());
        if let Some(authorization) = self.client.authorization() {
            request = request.header("Authorization", format!("Bearer {}", authorization));
        }
        for (header_name, header_value) in self.client.runtime_headers() {
            request = request.header(*header_name, header_value);
        }
        let response = request.send().await?;
        let status = response.status();
        match status {
            reqwest::StatusCode::OK => {
                let data: MerchantProfileLegacy = response.json().await?;
                Ok(data)
            }
            reqwest::StatusCode::UNAUTHORIZED => {
                let body: Error = response.json().await?;
                Err(crate::error::SdkError::api(
                    GetMerchantProfileErrorBody::Unauthorized(body),
                ))
            }
            reqwest::StatusCode::FORBIDDEN => {
                let body: ErrorForbidden = response.json().await?;
                Err(crate::error::SdkError::api(
                    GetMerchantProfileErrorBody::Forbidden(body),
                ))
            }
            _ => {
                let body_bytes = response.bytes().await?;
                let body = crate::error::UnknownApiBody::from_bytes(body_bytes.as_ref());
                Err(crate::error::SdkError::unexpected(status, body))
            }
        }
    }
    /// Retrieve DBA
    ///
    /// Retrieves Doing Business As profile.
    pub async fn get_doing_business_as(
        &self,
    ) -> crate::error::SdkResult<DoingBusinessAsLegacy, GetDoingBusinessAsErrorBody> {
        let path = "/v0.1/me/merchant-profile/doing-business-as";
        let url = format!("{}{}", self.client.base_url(), path);
        let mut request = self
            .client
            .http_client()
            .get(&url)
            .header("User-Agent", crate::version::user_agent())
            .timeout(self.client.timeout());
        if let Some(authorization) = self.client.authorization() {
            request = request.header("Authorization", format!("Bearer {}", authorization));
        }
        for (header_name, header_value) in self.client.runtime_headers() {
            request = request.header(*header_name, header_value);
        }
        let response = request.send().await?;
        let status = response.status();
        match status {
            reqwest::StatusCode::OK => {
                let data: DoingBusinessAsLegacy = response.json().await?;
                Ok(data)
            }
            reqwest::StatusCode::UNAUTHORIZED => {
                let body: Error = response.json().await?;
                Err(crate::error::SdkError::api(
                    GetDoingBusinessAsErrorBody::Unauthorized(body),
                ))
            }
            _ => {
                let body_bytes = response.bytes().await?;
                let body = crate::error::UnknownApiBody::from_bytes(body_bytes.as_ref());
                Err(crate::error::SdkError::unexpected(status, body))
            }
        }
    }
    /// Retrieve a personal profile
    ///
    /// Retrieves personal profile data.
    pub async fn get_personal_profile(
        &self,
    ) -> crate::error::SdkResult<PersonalProfileLegacy, GetPersonalProfileErrorBody> {
        let path = "/v0.1/me/personal-profile";
        let url = format!("{}{}", self.client.base_url(), path);
        let mut request = self
            .client
            .http_client()
            .get(&url)
            .header("User-Agent", crate::version::user_agent())
            .timeout(self.client.timeout());
        if let Some(authorization) = self.client.authorization() {
            request = request.header("Authorization", format!("Bearer {}", authorization));
        }
        for (header_name, header_value) in self.client.runtime_headers() {
            request = request.header(*header_name, header_value);
        }
        let response = request.send().await?;
        let status = response.status();
        match status {
            reqwest::StatusCode::OK => {
                let data: PersonalProfileLegacy = response.json().await?;
                Ok(data)
            }
            reqwest::StatusCode::UNAUTHORIZED => {
                let body: Error = response.json().await?;
                Err(crate::error::SdkError::api(
                    GetPersonalProfileErrorBody::Unauthorized(body),
                ))
            }
            _ => {
                let body_bytes = response.bytes().await?;
                let body = crate::error::UnknownApiBody::from_bytes(body_bytes.as_ref());
                Err(crate::error::SdkError::unexpected(status, body))
            }
        }
    }
}