| 1 |
# -*- coding: utf-8 -*- |
| 2 |
|
| 3 |
from typing_extensions import TYPE_CHECKING |
| 4 |
from stripe.v2.core._event import ( |
| 5 |
EventNotification as EventNotification, |
| 6 |
RelatedObject as RelatedObject, |
| 7 |
Reason as Reason, |
| 8 |
ReasonRequest as ReasonRequest, |
| 9 |
) |
| 10 |
|
| 11 |
# The beginning of the section generated from our OpenAPI spec |
| 12 |
from importlib import import_module |
| 13 |
|
| 14 |
if TYPE_CHECKING: |
| 15 |
from stripe.v2.core import accounts as accounts |
| 16 |
from stripe.v2.core._account import Account as Account |
| 17 |
from stripe.v2.core._account_link import AccountLink as AccountLink |
| 18 |
from stripe.v2.core._account_link_service import ( |
| 19 |
AccountLinkService as AccountLinkService, |
| 20 |
) |
| 21 |
from stripe.v2.core._account_person import AccountPerson as AccountPerson |
| 22 |
from stripe.v2.core._account_person_token import ( |
| 23 |
AccountPersonToken as AccountPersonToken, |
| 24 |
) |
| 25 |
from stripe.v2.core._account_service import ( |
| 26 |
AccountService as AccountService, |
| 27 |
) |
| 28 |
from stripe.v2.core._account_token import AccountToken as AccountToken |
| 29 |
from stripe.v2.core._account_token_service import ( |
| 30 |
AccountTokenService as AccountTokenService, |
| 31 |
) |
| 32 |
from stripe.v2.core._event import Event as Event |
| 33 |
from stripe.v2.core._event_destination import ( |
| 34 |
EventDestination as EventDestination, |
| 35 |
) |
| 36 |
from stripe.v2.core._event_destination_service import ( |
| 37 |
EventDestinationService as EventDestinationService, |
| 38 |
) |
| 39 |
from stripe.v2.core._event_service import EventService as EventService |
| 40 |
|
| 41 |
# name -> (import_target, is_submodule) |
| 42 |
_import_map = { |
| 43 |
"accounts": ("stripe.v2.core.accounts", True), |
| 44 |
"Account": ("stripe.v2.core._account", False), |
| 45 |
"AccountLink": ("stripe.v2.core._account_link", False), |
| 46 |
"AccountLinkService": ("stripe.v2.core._account_link_service", False), |
| 47 |
"AccountPerson": ("stripe.v2.core._account_person", False), |
| 48 |
"AccountPersonToken": ("stripe.v2.core._account_person_token", False), |
| 49 |
"AccountService": ("stripe.v2.core._account_service", False), |
| 50 |
"AccountToken": ("stripe.v2.core._account_token", False), |
| 51 |
"AccountTokenService": ("stripe.v2.core._account_token_service", False), |
| 52 |
"Event": ("stripe.v2.core._event", False), |
| 53 |
"EventDestination": ("stripe.v2.core._event_destination", False), |
| 54 |
"EventDestinationService": ( |
| 55 |
"stripe.v2.core._event_destination_service", |
| 56 |
False, |
| 57 |
), |
| 58 |
"EventService": ("stripe.v2.core._event_service", False), |
| 59 |
} |
| 60 |
if not TYPE_CHECKING: |
| 61 |
|
| 62 |
def __getattr__(name): |
| 63 |
try: |
| 64 |
target, is_submodule = _import_map[name] |
| 65 |
module = import_module(target) |
| 66 |
if is_submodule: |
| 67 |
return module |
| 68 |
|
| 69 |
return getattr( |
| 70 |
module, |
| 71 |
name, |
| 72 |
) |
| 73 |
except KeyError: |
| 74 |
raise AttributeError() |
| 75 |
|
| 76 |
# The end of the section generated from our OpenAPI spec |