| 1 |
from typing_extensions import TYPE_CHECKING |
| 2 |
from stripe.v2._list_object import ListObject as ListObject |
| 3 |
from stripe.v2._amount import Amount as Amount, AmountParam as AmountParam |
| 4 |
|
| 5 |
|
| 6 |
# The beginning of the section generated from our OpenAPI spec |
| 7 |
from importlib import import_module |
| 8 |
|
| 9 |
if TYPE_CHECKING: |
| 10 |
from stripe.v2 import billing as billing, core as core |
| 11 |
from stripe.v2._billing_service import BillingService as BillingService |
| 12 |
from stripe.v2._core_service import CoreService as CoreService |
| 13 |
from stripe.v2._deleted_object import DeletedObject as DeletedObject |
| 14 |
|
| 15 |
# name -> (import_target, is_submodule) |
| 16 |
_import_map = { |
| 17 |
"billing": ("stripe.v2.billing", True), |
| 18 |
"core": ("stripe.v2.core", True), |
| 19 |
"BillingService": ("stripe.v2._billing_service", False), |
| 20 |
"CoreService": ("stripe.v2._core_service", False), |
| 21 |
"DeletedObject": ("stripe.v2._deleted_object", False), |
| 22 |
} |
| 23 |
if not TYPE_CHECKING: |
| 24 |
|
| 25 |
def __getattr__(name): |
| 26 |
try: |
| 27 |
target, is_submodule = _import_map[name] |
| 28 |
module = import_module(target) |
| 29 |
if is_submodule: |
| 30 |
return module |
| 31 |
|
| 32 |
return getattr( |
| 33 |
module, |
| 34 |
name, |
| 35 |
) |
| 36 |
except KeyError: |
| 37 |
raise AttributeError() |
| 38 |
|
| 39 |
# The end of the section generated from our OpenAPI spec |