| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# File generated from our OpenAPI spec |
| 3 |
from stripe._stripe_service import StripeService |
| 4 |
from importlib import import_module |
| 5 |
from typing_extensions import TYPE_CHECKING |
| 6 |
|
| 7 |
if TYPE_CHECKING: |
| 8 |
from stripe.test_helpers.issuing._authorization_service import ( |
| 9 |
AuthorizationService, |
| 10 |
) |
| 11 |
from stripe.test_helpers.issuing._card_service import CardService |
| 12 |
from stripe.test_helpers.issuing._personalization_design_service import ( |
| 13 |
PersonalizationDesignService, |
| 14 |
) |
| 15 |
from stripe.test_helpers.issuing._transaction_service import ( |
| 16 |
TransactionService, |
| 17 |
) |
| 18 |
|
| 19 |
_subservices = { |
| 20 |
"authorizations": [ |
| 21 |
"stripe.test_helpers.issuing._authorization_service", |
| 22 |
"AuthorizationService", |
| 23 |
], |
| 24 |
"cards": ["stripe.test_helpers.issuing._card_service", "CardService"], |
| 25 |
"personalization_designs": [ |
| 26 |
"stripe.test_helpers.issuing._personalization_design_service", |
| 27 |
"PersonalizationDesignService", |
| 28 |
], |
| 29 |
"transactions": [ |
| 30 |
"stripe.test_helpers.issuing._transaction_service", |
| 31 |
"TransactionService", |
| 32 |
], |
| 33 |
} |
| 34 |
|
| 35 |
|
| 36 |
class IssuingService(StripeService): |
| 37 |
authorizations: "AuthorizationService" |
| 38 |
cards: "CardService" |
| 39 |
personalization_designs: "PersonalizationDesignService" |
| 40 |
transactions: "TransactionService" |
| 41 |
|
| 42 |
def __init__(self, requestor): |
| 43 |
super().__init__(requestor) |
| 44 |
|
| 45 |
def __getattr__(self, name): |
| 46 |
try: |
| 47 |
import_from, service = _subservices[name] |
| 48 |
service_class = getattr( |
| 49 |
import_module(import_from), |
| 50 |
service, |
| 51 |
) |
| 52 |
setattr( |
| 53 |
self, |
| 54 |
name, |
| 55 |
service_class(self._requestor), |
| 56 |
) |
| 57 |
return getattr(self, name) |
| 58 |
except KeyError: |
| 59 |
raise AttributeError() |