Debian Codegraph @

stripe/test_helpers/treasury/_received_debit_service.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from stripe._stripe_service import StripeService
4 from typing import Optional, cast
5 from typing_extensions import TYPE_CHECKING
6
7 if TYPE_CHECKING:
8 from stripe._request_options import RequestOptions
9 from stripe.params.test_helpers.treasury._received_debit_create_params import (
10 ReceivedDebitCreateParams,
11 )
12 from stripe.treasury._received_debit import ReceivedDebit
13
14
15 class ReceivedDebitService(StripeService):
16 def create(
17 self,
18 params: "ReceivedDebitCreateParams",
19 options: Optional["RequestOptions"] = None,
20 ) -> "ReceivedDebit":
21 """
22 Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties.
23 """
24 return cast(
25 "ReceivedDebit",
26 self._request(
27 "post",
28 "/v1/test_helpers/treasury/received_debits",
29 base_address="api",
30 params=params,
31 options=options,
32 ),
33 )
34
35 async def create_async(
36 self,
37 params: "ReceivedDebitCreateParams",
38 options: Optional["RequestOptions"] = None,
39 ) -> "ReceivedDebit":
40 """
41 Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties.
42 """
43 return cast(
44 "ReceivedDebit",
45 await self._request_async(
46 "post",
47 "/v1/test_helpers/treasury/received_debits",
48 base_address="api",
49 params=params,
50 options=options,
51 ),
52 )