| 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 import ( |
| 8 |
issuing as issuing, |
| 9 |
terminal as terminal, |
| 10 |
treasury as treasury, |
| 11 |
) |
| 12 |
from stripe.test_helpers._confirmation_token_service import ( |
| 13 |
ConfirmationTokenService as ConfirmationTokenService, |
| 14 |
) |
| 15 |
from stripe.test_helpers._customer_service import ( |
| 16 |
CustomerService as CustomerService, |
| 17 |
) |
| 18 |
from stripe.test_helpers._issuing_service import ( |
| 19 |
IssuingService as IssuingService, |
| 20 |
) |
| 21 |
from stripe.test_helpers._refund_service import ( |
| 22 |
RefundService as RefundService, |
| 23 |
) |
| 24 |
from stripe.test_helpers._terminal_service import ( |
| 25 |
TerminalService as TerminalService, |
| 26 |
) |
| 27 |
from stripe.test_helpers._test_clock import TestClock as TestClock |
| 28 |
from stripe.test_helpers._test_clock_service import ( |
| 29 |
TestClockService as TestClockService, |
| 30 |
) |
| 31 |
from stripe.test_helpers._treasury_service import ( |
| 32 |
TreasuryService as TreasuryService, |
| 33 |
) |
| 34 |
|
| 35 |
# name -> (import_target, is_submodule) |
| 36 |
_import_map = { |
| 37 |
"issuing": ("stripe.test_helpers.issuing", True), |
| 38 |
"terminal": ("stripe.test_helpers.terminal", True), |
| 39 |
"treasury": ("stripe.test_helpers.treasury", True), |
| 40 |
"ConfirmationTokenService": ( |
| 41 |
"stripe.test_helpers._confirmation_token_service", |
| 42 |
False, |
| 43 |
), |
| 44 |
"CustomerService": ("stripe.test_helpers._customer_service", False), |
| 45 |
"IssuingService": ("stripe.test_helpers._issuing_service", False), |
| 46 |
"RefundService": ("stripe.test_helpers._refund_service", False), |
| 47 |
"TerminalService": ("stripe.test_helpers._terminal_service", False), |
| 48 |
"TestClock": ("stripe.test_helpers._test_clock", False), |
| 49 |
"TestClockService": ("stripe.test_helpers._test_clock_service", False), |
| 50 |
"TreasuryService": ("stripe.test_helpers._treasury_service", False), |
| 51 |
} |
| 52 |
if not TYPE_CHECKING: |
| 53 |
|
| 54 |
def __getattr__(name): |
| 55 |
try: |
| 56 |
target, is_submodule = _import_map[name] |
| 57 |
module = import_module(target) |
| 58 |
if is_submodule: |
| 59 |
return module |
| 60 |
|
| 61 |
return getattr( |
| 62 |
module, |
| 63 |
name, |
| 64 |
) |
| 65 |
except KeyError: |
| 66 |
raise AttributeError() |