| 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.checkout._session import Session as Session |
| 8 |
from stripe.checkout._session_line_item_service import ( |
| 9 |
SessionLineItemService as SessionLineItemService, |
| 10 |
) |
| 11 |
from stripe.checkout._session_service import ( |
| 12 |
SessionService as SessionService, |
| 13 |
) |
| 14 |
|
| 15 |
# name -> (import_target, is_submodule) |
| 16 |
_import_map = { |
| 17 |
"Session": ("stripe.checkout._session", False), |
| 18 |
"SessionLineItemService": ( |
| 19 |
"stripe.checkout._session_line_item_service", |
| 20 |
False, |
| 21 |
), |
| 22 |
"SessionService": ("stripe.checkout._session_service", False), |
| 23 |
} |
| 24 |
if not TYPE_CHECKING: |
| 25 |
|
| 26 |
def __getattr__(name): |
| 27 |
try: |
| 28 |
target, is_submodule = _import_map[name] |
| 29 |
module = import_module(target) |
| 30 |
if is_submodule: |
| 31 |
return module |
| 32 |
|
| 33 |
return getattr( |
| 34 |
module, |
| 35 |
name, |
| 36 |
) |
| 37 |
except KeyError: |
| 38 |
raise AttributeError() |