async-payjp-core 0.0.1

Payjp SDK based on arlyon/async-stripe
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
use payjp_client_core::{PayjpClient, BlockingClient, PayjpRequest, RequestBuilder, PayjpMethod};

#[derive(Copy,Clone,Debug,)]#[derive(serde::Serialize)]
 struct ListTenantBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
 limit: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
 offset: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
 since: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
 until: Option<i64>,

}
impl ListTenantBuilder {
     fn new() -> Self {
    Self {
        limit: None,offset: None,since: None,until: None,
    }
}

}
        /// テナントのリストを取得します。
#[derive(Clone,Debug,)]#[derive(serde::Serialize)]
pub struct ListTenant {
 inner: ListTenantBuilder,

}
impl ListTenant {
    /// Construct a new `ListTenant`.
pub fn new() -> Self {
    Self {
        inner: ListTenantBuilder::new()
    }
}
    /// 取得するデータ数の最大値(1~100まで)。指定がない場合は 10 となる。
pub fn limit(mut self, limit: impl Into<i64>) -> Self {
    self.inner.limit = Some(limit.into());
    self
}
    /// 基準点からのデータ取得を行う開始位置。指定がない場合は 0 となる。
pub fn offset(mut self, offset: impl Into<i64>) -> Self {
    self.inner.offset = Some(offset.into());
    self
}
    /// ここに指定したタイムスタンプ以降に作成されたデータを取得
pub fn since(mut self, since: impl Into<i64>) -> Self {
    self.inner.since = Some(since.into());
    self
}
    /// ここに指定したタイムスタンプ以前に作成されたデータを取得
pub fn until(mut self, until: impl Into<i64>) -> Self {
    self.inner.until = Some(until.into());
    self
}

}
    impl Default for ListTenant {
    fn default() -> Self {
        Self::new()
    }
}impl ListTenant {
    /// Send the request and return the deserialized response.
    pub async fn send<C: PayjpClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send(client).await
    }

    /// Send the request and return the deserialized response, blocking until completion.
    pub fn send_blocking<C: BlockingClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send_blocking(client)
    }

    pub fn paginate(&self) -> payjp_client_core::ListPaginator<payjp_types::List<payjp_core::Tenant>> {
    
    payjp_client_core::ListPaginator::new_list("/tenants", &self.inner)
}

}

impl PayjpRequest for ListTenant {
    type Output = payjp_types::List<payjp_core::Tenant>;

    fn build(&self) -> RequestBuilder {
    RequestBuilder::new(PayjpMethod::Get, "/tenants").query(&self.inner)
}

}
#[derive(Clone,Debug,)]#[derive(serde::Serialize)]
 struct CreateTenantBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
 bank_account_holder_name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 bank_account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 bank_account_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 bank_branch_code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 bank_code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 id: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 metadata: Option<payjp_shared::Metadata>,
#[serde(skip_serializing_if = "Option::is_none")]
 minimum_transfer_amount: Option<i64>,
 name: String,
#[serde(skip_serializing_if = "Option::is_none")]
 payjp_fee_included: Option<bool>,
 platform_fee_rate: f64,

}
impl CreateTenantBuilder {
     fn new(name: impl Into<String>,platform_fee_rate: impl Into<f64>,) -> Self {
    Self {
        bank_account_holder_name: None,bank_account_number: None,bank_account_type: None,bank_branch_code: None,bank_code: None,id: None,metadata: None,minimum_transfer_amount: None,name: name.into(),payjp_fee_included: None,platform_fee_rate: platform_fee_rate.into(),
    }
}

}
        /// 名前やIDなどを指定してテナントを作成します。
    ///
    /// 作成したテナントはあとから更新・削除することができます。
#[derive(Clone,Debug,)]#[derive(serde::Serialize)]
pub struct CreateTenant {
 inner: CreateTenantBuilder,

}
impl CreateTenant {
    /// Construct a new `CreateTenant`.
pub fn new(name:impl Into<String>,platform_fee_rate:impl Into<f64>) -> Self {
    Self {
        inner: CreateTenantBuilder::new(name.into(),platform_fee_rate.into(),)
    }
}
    /// 口座名義(Payouts型アカウントの場合は必須)
pub fn bank_account_holder_name(mut self, bank_account_holder_name: impl Into<String>) -> Self {
    self.inner.bank_account_holder_name = Some(bank_account_holder_name.into());
    self
}
    /// 口座番号(Payouts型アカウントの場合は必須)
pub fn bank_account_number(mut self, bank_account_number: impl Into<String>) -> Self {
    self.inner.bank_account_number = Some(bank_account_number.into());
    self
}
    /// 預金種別(Payouts型アカウントの場合は必須)
pub fn bank_account_type(mut self, bank_account_type: impl Into<String>) -> Self {
    self.inner.bank_account_type = Some(bank_account_type.into());
    self
}
    /// 3桁の支店コード(Payouts型アカウントの場合は必須)
pub fn bank_branch_code(mut self, bank_branch_code: impl Into<String>) -> Self {
    self.inner.bank_branch_code = Some(bank_branch_code.into());
    self
}
    /// 4桁の銀行コード(Payouts型アカウントの場合は必須)
pub fn bank_code(mut self, bank_code: impl Into<String>) -> Self {
    self.inner.bank_code = Some(bank_code.into());
    self
}
        /// テナントIDとなる任意の文字列。一意にならないとエラーになります。また、未指定時は自動生成されます。.
pub fn id(mut self, id: impl Into<String>) -> Self {
    self.inner.id = Some(id.into());
    self
}
pub fn metadata(mut self, metadata: impl Into<payjp_shared::Metadata>) -> Self {
    self.inner.metadata = Some(metadata.into());
    self
}
    /// 最低入金額。デフォルトは1万円で下限は1000円。
pub fn minimum_transfer_amount(mut self, minimum_transfer_amount: impl Into<i64>) -> Self {
    self.inner.minimum_transfer_amount = Some(minimum_transfer_amount.into());
    self
}
        /// テナントのプラットフォーム利用料にPAY.JP決済手数料を含めるかどうか。デフォルトはfalse。作成時にのみ指定可能で、あとから変更はできません。.
pub fn payjp_fee_included(mut self, payjp_fee_included: impl Into<bool>) -> Self {
    self.inner.payjp_fee_included = Some(payjp_fee_included.into());
    self
}

}
    impl CreateTenant {
    /// Send the request and return the deserialized response.
    pub async fn send<C: PayjpClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send(client).await
    }

    /// Send the request and return the deserialized response, blocking until completion.
    pub fn send_blocking<C: BlockingClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send_blocking(client)
    }

    
}

impl PayjpRequest for CreateTenant {
    type Output = payjp_core::Tenant;

    fn build(&self) -> RequestBuilder {
    RequestBuilder::new(PayjpMethod::Post, "/tenants").form(&self.inner)
}

}
    /// テナント情報を取得します。
#[derive(Clone,Debug,)]#[derive(serde::Serialize)]
pub struct RetrieveTenant {
 tenant: String,

}
impl RetrieveTenant {
    /// Construct a new `RetrieveTenant`.
pub fn new(tenant:impl Into<String>) -> Self {
    Self {
        tenant: tenant.into(),
    }
}

}
    impl RetrieveTenant {
    /// Send the request and return the deserialized response.
    pub async fn send<C: PayjpClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send(client).await
    }

    /// Send the request and return the deserialized response, blocking until completion.
    pub fn send_blocking<C: BlockingClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send_blocking(client)
    }

    
}

impl PayjpRequest for RetrieveTenant {
    type Output = payjp_core::Tenant;

    fn build(&self) -> RequestBuilder {
    let tenant = &self.tenant;
RequestBuilder::new(PayjpMethod::Get, format!("/tenants/{tenant}"))
}

}
#[derive(Clone,Debug,)]#[derive(serde::Serialize)]
 struct UpdateTenantBuilder {
#[serde(skip_serializing_if = "Option::is_none")]
 bank_account_holder_name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 bank_account_number: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 bank_account_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 bank_branch_code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 bank_code: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 metadata: Option<payjp_shared::Metadata>,
#[serde(skip_serializing_if = "Option::is_none")]
 minimum_transfer_amount: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
 name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
 platform_fee_rate: Option<f64>,

}
impl UpdateTenantBuilder {
     fn new() -> Self {
    Self {
        bank_account_holder_name: None,bank_account_number: None,bank_account_type: None,bank_branch_code: None,bank_code: None,metadata: None,minimum_transfer_amount: None,name: None,platform_fee_rate: None,
    }
}

}
        /// 生成したテナント情報を更新することができます。
#[derive(Clone,Debug,)]#[derive(serde::Serialize)]
pub struct UpdateTenant {
 inner: UpdateTenantBuilder,
 tenant: String,

}
impl UpdateTenant {
    /// Construct a new `UpdateTenant`.
pub fn new(tenant:impl Into<String>) -> Self {
    Self {
        tenant: tenant.into(),inner: UpdateTenantBuilder::new()
    }
}
    /// 口座名義
pub fn bank_account_holder_name(mut self, bank_account_holder_name: impl Into<String>) -> Self {
    self.inner.bank_account_holder_name = Some(bank_account_holder_name.into());
    self
}
    /// 口座番号
pub fn bank_account_number(mut self, bank_account_number: impl Into<String>) -> Self {
    self.inner.bank_account_number = Some(bank_account_number.into());
    self
}
    /// 預金種別
pub fn bank_account_type(mut self, bank_account_type: impl Into<String>) -> Self {
    self.inner.bank_account_type = Some(bank_account_type.into());
    self
}
    /// 3桁の支店コード
pub fn bank_branch_code(mut self, bank_branch_code: impl Into<String>) -> Self {
    self.inner.bank_branch_code = Some(bank_branch_code.into());
    self
}
    /// 4桁の銀行コード
pub fn bank_code(mut self, bank_code: impl Into<String>) -> Self {
    self.inner.bank_code = Some(bank_code.into());
    self
}
pub fn metadata(mut self, metadata: impl Into<payjp_shared::Metadata>) -> Self {
    self.inner.metadata = Some(metadata.into());
    self
}
    /// 最低入金額。デフォルトは1万円で下限は1000円。
pub fn minimum_transfer_amount(mut self, minimum_transfer_amount: impl Into<i64>) -> Self {
    self.inner.minimum_transfer_amount = Some(minimum_transfer_amount.into());
    self
}
    /// テナント名
pub fn name(mut self, name: impl Into<String>) -> Self {
    self.inner.name = Some(name.into());
    self
}
        /// テナントのプラットフォーム利用料率(%)。小数点以下2桁まで入力可能。最大95%.
pub fn platform_fee_rate(mut self, platform_fee_rate: impl Into<f64>) -> Self {
    self.inner.platform_fee_rate = Some(platform_fee_rate.into());
    self
}

}
    impl UpdateTenant {
    /// Send the request and return the deserialized response.
    pub async fn send<C: PayjpClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send(client).await
    }

    /// Send the request and return the deserialized response, blocking until completion.
    pub fn send_blocking<C: BlockingClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send_blocking(client)
    }

    
}

impl PayjpRequest for UpdateTenant {
    type Output = payjp_core::Tenant;

    fn build(&self) -> RequestBuilder {
    let tenant = &self.tenant;
RequestBuilder::new(PayjpMethod::Post, format!("/tenants/{tenant}")).form(&self.inner)
}

}
    /// 生成したテナント情報を削除します。
    ///
        /// 削除したテナントと同じIDのテナントをもう一度生成することができますが、削除したテナントとは別のテナントとして扱われます。.
#[derive(Clone,Debug,)]#[derive(serde::Serialize)]
pub struct DeleteTenant {
 tenant: String,

}
impl DeleteTenant {
    /// Construct a new `DeleteTenant`.
pub fn new(tenant:impl Into<String>) -> Self {
    Self {
        tenant: tenant.into(),
    }
}

}
    impl DeleteTenant {
    /// Send the request and return the deserialized response.
    pub async fn send<C: PayjpClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send(client).await
    }

    /// Send the request and return the deserialized response, blocking until completion.
    pub fn send_blocking<C: BlockingClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send_blocking(client)
    }

    
}

impl PayjpRequest for DeleteTenant {
    type Output = payjp_shared::DeleteResponse;

    fn build(&self) -> RequestBuilder {
    let tenant = &self.tenant;
RequestBuilder::new(PayjpMethod::Delete, format!("/tenants/{tenant}"))
}

}
        /// (Marketplace型アカウントのみ利用可能)テナントの審査申請ページのURLを作成します。.
    ///
        /// テストモードの場合、実際の審査は行われず情報が保存されない為、常に新規申請になります。.
#[derive(Clone,Debug,)]#[derive(serde::Serialize)]
pub struct ApplicationUrlsTenant {
 tenant: String,

}
impl ApplicationUrlsTenant {
    /// Construct a new `ApplicationUrlsTenant`.
pub fn new(tenant:impl Into<String>) -> Self {
    Self {
        tenant: tenant.into(),
    }
}

}
    impl ApplicationUrlsTenant {
    /// Send the request and return the deserialized response.
    pub async fn send<C: PayjpClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send(client).await
    }

    /// Send the request and return the deserialized response, blocking until completion.
    pub fn send_blocking<C: BlockingClient>(&self, client: &C) -> Result<<Self as PayjpRequest>::Output, C::Err> {
        self.customize().send_blocking(client)
    }

    
}

impl PayjpRequest for ApplicationUrlsTenant {
    type Output = ApplicationUrlsTenantReturned;

    fn build(&self) -> RequestBuilder {
    let tenant = &self.tenant;
RequestBuilder::new(PayjpMethod::Post, format!("/tenants/{tenant}/application_urls"))
}

}
#[derive(Clone,Debug,)]#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
#[cfg_attr(feature = "deserialize", derive(serde::Deserialize))]
pub struct ApplicationUrlsTenantReturned {
    /// application_urlの使用期限のタイムスタンプ。発行から5分
pub expires: i64,
    /// 固定文字列
pub object: ApplicationUrlsTenantReturnedObject,
    /// テナントの審査申請URL
pub url: String,

}
#[doc(hidden)]
pub struct ApplicationUrlsTenantReturnedBuilder {
    expires: Option<i64>,
object: Option<ApplicationUrlsTenantReturnedObject>,
url: Option<String>,

}

#[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::{make_place, Deserialize, Result};
    use payjp_types::{MapBuilder, ObjectDeser};
    use payjp_types::miniserde_helpers::FromValueOpt;

    make_place!(Place);

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

struct Builder<'a> {
    out: &'a mut Option<ApplicationUrlsTenantReturned>,
    builder: ApplicationUrlsTenantReturnedBuilder,
}

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

impl MapBuilder for ApplicationUrlsTenantReturnedBuilder {
    type Out = ApplicationUrlsTenantReturned;
    fn key(&mut self, k: &str) -> Result<&mut dyn Visitor> {
        Ok(match k {
            "expires" => Deserialize::begin(&mut self.expires),
"object" => Deserialize::begin(&mut self.object),
"url" => Deserialize::begin(&mut self.url),

            _ => <dyn Visitor>::ignore(),
        })
    }

    fn deser_default() -> Self {
        Self {
            expires: Deserialize::default(),
object: Deserialize::default(),
url: Deserialize::default(),

        }
    }

    fn take_out(&mut self) -> Option<Self::Out> {
        let (Some(expires),
Some(object),
Some(url),
) = (self.expires,
self.object,
self.url.take(),
) else {
            return None;
        };
        Some(Self::Out { expires,object,url })
    }
}

impl<'a> Map for Builder<'a> {
    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 ApplicationUrlsTenantReturned {
    type Builder = ApplicationUrlsTenantReturnedBuilder;
}

impl FromValueOpt for ApplicationUrlsTenantReturned {
    fn from_value(v: Value) -> Option<Self> {
        let Value::Object(obj) = v else {
            return None;
        };
        let mut b = ApplicationUrlsTenantReturnedBuilder::deser_default();
        for (k, v) in obj {
            match k.as_str() {
                "expires" => b.expires = FromValueOpt::from_value(v),
"object" => b.object = FromValueOpt::from_value(v),
"url" => b.url = FromValueOpt::from_value(v),

                _ => {}
            }
        }
        b.take_out()
    }
}

};
/// 固定文字列
#[derive(Copy,Clone,Eq, PartialEq,)]pub enum ApplicationUrlsTenantReturnedObject {
ApplicationUrl,

}
impl ApplicationUrlsTenantReturnedObject {
    pub fn as_str(self) -> &'static str {
        use ApplicationUrlsTenantReturnedObject::*;
        match self {
ApplicationUrl => "application_url",

        }
    }
}

impl std::str::FromStr for ApplicationUrlsTenantReturnedObject {
    type Err = payjp_types::ParseError;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        use ApplicationUrlsTenantReturnedObject::*;
        match s {
    "application_url" => Ok(ApplicationUrl),
_ => Err(payjp_types::ParseError)

        }
    }
}
impl std::fmt::Display for ApplicationUrlsTenantReturnedObject {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        f.write_str(self.as_str())
    }
}

impl std::fmt::Debug for ApplicationUrlsTenantReturnedObject {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
        f.write_str(self.as_str())
    }
}
#[cfg(feature = "serialize")]
impl serde::Serialize for ApplicationUrlsTenantReturnedObject {
    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 ApplicationUrlsTenantReturnedObject {
    fn begin(out: &mut Option<Self>) -> &mut dyn miniserde::de::Visitor {
        crate::Place::new(out)
    }
}

impl miniserde::de::Visitor for crate::Place<ApplicationUrlsTenantReturnedObject> {
    fn string(&mut self, s: &str) -> miniserde::Result<()> {
        use std::str::FromStr;
        self.out = Some(ApplicationUrlsTenantReturnedObject::from_str(s).map_err(|_| miniserde::Error)?);
        Ok(())
    }
}

payjp_types::impl_from_val_with_from_str!(ApplicationUrlsTenantReturnedObject);
#[cfg(feature = "deserialize")]
impl<'de> serde::Deserialize<'de> for ApplicationUrlsTenantReturnedObject {
    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)?;
        Self::from_str(&s).map_err(|_| serde::de::Error::custom("Unknown value for ApplicationUrlsTenantReturnedObject"))
    }
}