|
2 | 2 | from types import ModuleType |
3 | 3 | from typing import Optional |
4 | 4 |
|
5 | | -from .client import ShadeClient |
6 | | -from .config import config, Environment |
| 5 | +from .client import ShadeClient, default_client, reset_default_client |
| 6 | +from .config import config, Environment, get_config |
7 | 7 | from .gateway import Gateway |
8 | 8 | from .http import AsyncHTTPClient, SyncHTTPClient |
| 9 | +from .resources import BaseResource |
9 | 10 | from .errors import ( |
10 | 11 | AuthenticationError, |
11 | 12 | InvalidRequestError, |
|
14 | 15 | HTTPError, |
15 | 16 | RateLimitError, |
16 | 17 | ShadeError, |
| 18 | + SignatureVerificationError, |
| 19 | + StellarError, |
| 20 | + wrap_stellar_errors, |
| 21 | +) |
| 22 | +from .models import ( |
| 23 | + AssetBalance, |
| 24 | + Balance, |
| 25 | + Merchant, |
| 26 | + ShadeObject, |
| 27 | + Transfer, |
| 28 | + TransferStatus, |
| 29 | + WebhookEvent, |
| 30 | + WebhookEventType, |
17 | 31 | ) |
18 | 32 |
|
19 | 33 | __version__ = "0.1.0" |
20 | 34 |
|
21 | | -# ShadeClient is an alias for Gateway. |
22 | | -ShadeClient = Gateway |
23 | | - |
24 | 35 | __all__ = [ |
| 36 | + "AssetBalance", |
25 | 37 | "AsyncHTTPClient", |
26 | 38 | "AuthenticationError", |
| 39 | + "Balance", |
| 40 | + "BaseResource", |
27 | 41 | "Environment", |
28 | 42 | "Gateway", |
29 | 43 | "HTTPError", |
30 | 44 | "InvalidRequestError", |
| 45 | + "Merchant", |
31 | 46 | "NetworkError", |
32 | 47 | "NotFoundError", |
33 | 48 | "RateLimitError", |
34 | 49 | "ShadeClient", |
35 | 50 | "ShadeError", |
| 51 | + "SignatureVerificationError", |
| 52 | + "ShadeObject", |
| 53 | + "StellarError", |
36 | 54 | "SyncHTTPClient", |
| 55 | + "Transfer", |
| 56 | + "TransferStatus", |
| 57 | + "WebhookEvent", |
| 58 | + "WebhookEventType", |
37 | 59 | "config", |
| 60 | + "get_config", |
38 | 61 | "api_base", |
| 62 | + "api_key", |
| 63 | + "default_client", |
39 | 64 | "environment", |
40 | 65 | "max_retries", |
| 66 | + "reset_default_client", |
41 | 67 | "timeout", |
| 68 | + "wrap_stellar_errors", |
42 | 69 | ] |
43 | 70 |
|
44 | 71 | class _ShadeModule(ModuleType): |
45 | 72 | """Module subclass that exposes config-backed attributes on the shade package.""" |
46 | 73 |
|
| 74 | + @property |
| 75 | + def api_key(self) -> Optional[str]: |
| 76 | + from . import config as _config |
| 77 | + return _config.api_key |
| 78 | + |
| 79 | + @api_key.setter |
| 80 | + def api_key(self, value: Optional[str]) -> None: |
| 81 | + from . import config as _config |
| 82 | + _config.api_key = value |
| 83 | + |
47 | 84 | @property |
48 | 85 | def api_base(self) -> Optional[str]: |
49 | 86 | from . import config as _config |
@@ -86,3 +123,4 @@ def environment(self, value: str | Environment) -> None: |
86 | 123 |
|
87 | 124 |
|
88 | 125 | sys.modules[__name__].__class__ = _ShadeModule |
| 126 | + |
0 commit comments