Debian Codegraph @

stripe/test_helpers/treasury/__init__.py

raw
1 # -*- coding: utf-8 -*-
2 # File generated from our OpenAPI spec
3 from importlib import import_module
4 from typing_extensions import TYPE_CHECKING
5
6 if TYPE_CHECKING:
7 from stripe.test_helpers.treasury._inbound_transfer_service import (
8 InboundTransferService as InboundTransferService,
9 )
10 from stripe.test_helpers.treasury._outbound_payment_service import (
11 OutboundPaymentService as OutboundPaymentService,
12 )
13 from stripe.test_helpers.treasury._outbound_transfer_service import (
14 OutboundTransferService as OutboundTransferService,
15 )
16 from stripe.test_helpers.treasury._received_credit_service import (
17 ReceivedCreditService as ReceivedCreditService,
18 )
19 from stripe.test_helpers.treasury._received_debit_service import (
20 ReceivedDebitService as ReceivedDebitService,
21 )
22
23 # name -> (import_target, is_submodule)
24 _import_map = {
25 "InboundTransferService": (
26 "stripe.test_helpers.treasury._inbound_transfer_service",
27 False,
28 ),
29 "OutboundPaymentService": (
30 "stripe.test_helpers.treasury._outbound_payment_service",
31 False,
32 ),
33 "OutboundTransferService": (
34 "stripe.test_helpers.treasury._outbound_transfer_service",
35 False,
36 ),
37 "ReceivedCreditService": (
38 "stripe.test_helpers.treasury._received_credit_service",
39 False,
40 ),
41 "ReceivedDebitService": (
42 "stripe.test_helpers.treasury._received_debit_service",
43 False,
44 ),
45 }
46 if not TYPE_CHECKING:
47
48 def __getattr__(name):
49 try:
50 target, is_submodule = _import_map[name]
51 module = import_module(target)
52 if is_submodule:
53 return module
54
55 return getattr(
56 module,
57 name,
58 )
59 except KeyError:
60 raise AttributeError()