File: __init__.py

package info (click to toggle)
python-stripe 14.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,576 kB
  • sloc: python: 201,956; makefile: 13; sh: 9
file content (76 lines) | stat: -rw-r--r-- 2,844 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# -*- coding: utf-8 -*-

from typing_extensions import TYPE_CHECKING
from stripe.v2.core._event import (
    EventNotification as EventNotification,
    RelatedObject as RelatedObject,
    Reason as Reason,
    ReasonRequest as ReasonRequest,
)

# The beginning of the section generated from our OpenAPI spec
from importlib import import_module

if TYPE_CHECKING:
    from stripe.v2.core import accounts as accounts
    from stripe.v2.core._account import Account as Account
    from stripe.v2.core._account_link import AccountLink as AccountLink
    from stripe.v2.core._account_link_service import (
        AccountLinkService as AccountLinkService,
    )
    from stripe.v2.core._account_person import AccountPerson as AccountPerson
    from stripe.v2.core._account_person_token import (
        AccountPersonToken as AccountPersonToken,
    )
    from stripe.v2.core._account_service import (
        AccountService as AccountService,
    )
    from stripe.v2.core._account_token import AccountToken as AccountToken
    from stripe.v2.core._account_token_service import (
        AccountTokenService as AccountTokenService,
    )
    from stripe.v2.core._event import Event as Event
    from stripe.v2.core._event_destination import (
        EventDestination as EventDestination,
    )
    from stripe.v2.core._event_destination_service import (
        EventDestinationService as EventDestinationService,
    )
    from stripe.v2.core._event_service import EventService as EventService

# name -> (import_target, is_submodule)
_import_map = {
    "accounts": ("stripe.v2.core.accounts", True),
    "Account": ("stripe.v2.core._account", False),
    "AccountLink": ("stripe.v2.core._account_link", False),
    "AccountLinkService": ("stripe.v2.core._account_link_service", False),
    "AccountPerson": ("stripe.v2.core._account_person", False),
    "AccountPersonToken": ("stripe.v2.core._account_person_token", False),
    "AccountService": ("stripe.v2.core._account_service", False),
    "AccountToken": ("stripe.v2.core._account_token", False),
    "AccountTokenService": ("stripe.v2.core._account_token_service", False),
    "Event": ("stripe.v2.core._event", False),
    "EventDestination": ("stripe.v2.core._event_destination", False),
    "EventDestinationService": (
        "stripe.v2.core._event_destination_service",
        False,
    ),
    "EventService": ("stripe.v2.core._event_service", False),
}
if not TYPE_CHECKING:

    def __getattr__(name):
        try:
            target, is_submodule = _import_map[name]
            module = import_module(target)
            if is_submodule:
                return module

            return getattr(
                module,
                name,
            )
        except KeyError:
            raise AttributeError()

# The end of the section generated from our OpenAPI spec