| 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.billing._alert import Alert as Alert |
| 8 |
from stripe.billing._alert_service import AlertService as AlertService |
| 9 |
from stripe.billing._alert_triggered import ( |
| 10 |
AlertTriggered as AlertTriggered, |
| 11 |
) |
| 12 |
from stripe.billing._credit_balance_summary import ( |
| 13 |
CreditBalanceSummary as CreditBalanceSummary, |
| 14 |
) |
| 15 |
from stripe.billing._credit_balance_summary_service import ( |
| 16 |
CreditBalanceSummaryService as CreditBalanceSummaryService, |
| 17 |
) |
| 18 |
from stripe.billing._credit_balance_transaction import ( |
| 19 |
CreditBalanceTransaction as CreditBalanceTransaction, |
| 20 |
) |
| 21 |
from stripe.billing._credit_balance_transaction_service import ( |
| 22 |
CreditBalanceTransactionService as CreditBalanceTransactionService, |
| 23 |
) |
| 24 |
from stripe.billing._credit_grant import CreditGrant as CreditGrant |
| 25 |
from stripe.billing._credit_grant_service import ( |
| 26 |
CreditGrantService as CreditGrantService, |
| 27 |
) |
| 28 |
from stripe.billing._meter import Meter as Meter |
| 29 |
from stripe.billing._meter_event import MeterEvent as MeterEvent |
| 30 |
from stripe.billing._meter_event_adjustment import ( |
| 31 |
MeterEventAdjustment as MeterEventAdjustment, |
| 32 |
) |
| 33 |
from stripe.billing._meter_event_adjustment_service import ( |
| 34 |
MeterEventAdjustmentService as MeterEventAdjustmentService, |
| 35 |
) |
| 36 |
from stripe.billing._meter_event_service import ( |
| 37 |
MeterEventService as MeterEventService, |
| 38 |
) |
| 39 |
from stripe.billing._meter_event_summary import ( |
| 40 |
MeterEventSummary as MeterEventSummary, |
| 41 |
) |
| 42 |
from stripe.billing._meter_event_summary_service import ( |
| 43 |
MeterEventSummaryService as MeterEventSummaryService, |
| 44 |
) |
| 45 |
from stripe.billing._meter_service import MeterService as MeterService |
| 46 |
|
| 47 |
# name -> (import_target, is_submodule) |
| 48 |
_import_map = { |
| 49 |
"Alert": ("stripe.billing._alert", False), |
| 50 |
"AlertService": ("stripe.billing._alert_service", False), |
| 51 |
"AlertTriggered": ("stripe.billing._alert_triggered", False), |
| 52 |
"CreditBalanceSummary": ("stripe.billing._credit_balance_summary", False), |
| 53 |
"CreditBalanceSummaryService": ( |
| 54 |
"stripe.billing._credit_balance_summary_service", |
| 55 |
False, |
| 56 |
), |
| 57 |
"CreditBalanceTransaction": ( |
| 58 |
"stripe.billing._credit_balance_transaction", |
| 59 |
False, |
| 60 |
), |
| 61 |
"CreditBalanceTransactionService": ( |
| 62 |
"stripe.billing._credit_balance_transaction_service", |
| 63 |
False, |
| 64 |
), |
| 65 |
"CreditGrant": ("stripe.billing._credit_grant", False), |
| 66 |
"CreditGrantService": ("stripe.billing._credit_grant_service", False), |
| 67 |
"Meter": ("stripe.billing._meter", False), |
| 68 |
"MeterEvent": ("stripe.billing._meter_event", False), |
| 69 |
"MeterEventAdjustment": ("stripe.billing._meter_event_adjustment", False), |
| 70 |
"MeterEventAdjustmentService": ( |
| 71 |
"stripe.billing._meter_event_adjustment_service", |
| 72 |
False, |
| 73 |
), |
| 74 |
"MeterEventService": ("stripe.billing._meter_event_service", False), |
| 75 |
"MeterEventSummary": ("stripe.billing._meter_event_summary", False), |
| 76 |
"MeterEventSummaryService": ( |
| 77 |
"stripe.billing._meter_event_summary_service", |
| 78 |
False, |
| 79 |
), |
| 80 |
"MeterService": ("stripe.billing._meter_service", False), |
| 81 |
} |
| 82 |
if not TYPE_CHECKING: |
| 83 |
|
| 84 |
def __getattr__(name): |
| 85 |
try: |
| 86 |
target, is_submodule = _import_map[name] |
| 87 |
module = import_module(target) |
| 88 |
if is_submodule: |
| 89 |
return module |
| 90 |
|
| 91 |
return getattr( |
| 92 |
module, |
| 93 |
name, |
| 94 |
) |
| 95 |
except KeyError: |
| 96 |
raise AttributeError() |