| 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.terminal._configuration import Configuration as Configuration |
| 8 |
from stripe.terminal._configuration_service import ( |
| 9 |
ConfigurationService as ConfigurationService, |
| 10 |
) |
| 11 |
from stripe.terminal._connection_token import ( |
| 12 |
ConnectionToken as ConnectionToken, |
| 13 |
) |
| 14 |
from stripe.terminal._connection_token_service import ( |
| 15 |
ConnectionTokenService as ConnectionTokenService, |
| 16 |
) |
| 17 |
from stripe.terminal._location import Location as Location |
| 18 |
from stripe.terminal._location_service import ( |
| 19 |
LocationService as LocationService, |
| 20 |
) |
| 21 |
from stripe.terminal._onboarding_link import ( |
| 22 |
OnboardingLink as OnboardingLink, |
| 23 |
) |
| 24 |
from stripe.terminal._onboarding_link_service import ( |
| 25 |
OnboardingLinkService as OnboardingLinkService, |
| 26 |
) |
| 27 |
from stripe.terminal._reader import Reader as Reader |
| 28 |
from stripe.terminal._reader_service import ReaderService as ReaderService |
| 29 |
|
| 30 |
# name -> (import_target, is_submodule) |
| 31 |
_import_map = { |
| 32 |
"Configuration": ("stripe.terminal._configuration", False), |
| 33 |
"ConfigurationService": ("stripe.terminal._configuration_service", False), |
| 34 |
"ConnectionToken": ("stripe.terminal._connection_token", False), |
| 35 |
"ConnectionTokenService": ( |
| 36 |
"stripe.terminal._connection_token_service", |
| 37 |
False, |
| 38 |
), |
| 39 |
"Location": ("stripe.terminal._location", False), |
| 40 |
"LocationService": ("stripe.terminal._location_service", False), |
| 41 |
"OnboardingLink": ("stripe.terminal._onboarding_link", False), |
| 42 |
"OnboardingLinkService": ( |
| 43 |
"stripe.terminal._onboarding_link_service", |
| 44 |
False, |
| 45 |
), |
| 46 |
"Reader": ("stripe.terminal._reader", False), |
| 47 |
"ReaderService": ("stripe.terminal._reader_service", False), |
| 48 |
} |
| 49 |
if not TYPE_CHECKING: |
| 50 |
|
| 51 |
def __getattr__(name): |
| 52 |
try: |
| 53 |
target, is_submodule = _import_map[name] |
| 54 |
module = import_module(target) |
| 55 |
if is_submodule: |
| 56 |
return module |
| 57 |
|
| 58 |
return getattr( |
| 59 |
module, |
| 60 |
name, |
| 61 |
) |
| 62 |
except KeyError: |
| 63 |
raise AttributeError() |