| 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.climate._order import Order as Order |
| 8 |
from stripe.climate._order_service import OrderService as OrderService |
| 9 |
from stripe.climate._product import Product as Product |
| 10 |
from stripe.climate._product_service import ( |
| 11 |
ProductService as ProductService, |
| 12 |
) |
| 13 |
from stripe.climate._supplier import Supplier as Supplier |
| 14 |
from stripe.climate._supplier_service import ( |
| 15 |
SupplierService as SupplierService, |
| 16 |
) |
| 17 |
|
| 18 |
# name -> (import_target, is_submodule) |
| 19 |
_import_map = { |
| 20 |
"Order": ("stripe.climate._order", False), |
| 21 |
"OrderService": ("stripe.climate._order_service", False), |
| 22 |
"Product": ("stripe.climate._product", False), |
| 23 |
"ProductService": ("stripe.climate._product_service", False), |
| 24 |
"Supplier": ("stripe.climate._supplier", False), |
| 25 |
"SupplierService": ("stripe.climate._supplier_service", False), |
| 26 |
} |
| 27 |
if not TYPE_CHECKING: |
| 28 |
|
| 29 |
def __getattr__(name): |
| 30 |
try: |
| 31 |
target, is_submodule = _import_map[name] |
| 32 |
module = import_module(target) |
| 33 |
if is_submodule: |
| 34 |
return module |
| 35 |
|
| 36 |
return getattr( |
| 37 |
module, |
| 38 |
name, |
| 39 |
) |
| 40 |
except KeyError: |
| 41 |
raise AttributeError() |