-
Notifications
You must be signed in to change notification settings - Fork 0
/
__init__.py
115 lines (99 loc) · 2.62 KB
/
__init__.py
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
"""A Python client library for accessing the Stateset API
This library provides a convenient interface to interact with the Stateset API,
offering support for all Stateset resources including returns, warranties, orders,
inventory management, and more.
Basic usage:
```python
from stateset import Stateset
# Initialize the client
client = Stateset(api_key="your_api_key")
# Make API calls
async with client:
# Get a list of returns
returns = await client.returns.list()
# Create a new order
order = await client.orders.create({
"customer_id": "cust_123",
"items": [{"product_id": "prod_456", "quantity": 1}]
})
```
"""
from .client import AuthenticatedClient, Client
from .stateset import Stateset
from .types import (
StatesetID,
Timestamp,
Metadata,
StatesetObject,
OrderStatus,
ReturnStatus,
WarrantyStatus,
PaginationParams,
PaginatedList,
File,
FileUploadError,
UNSET
)
from .errors import (
StatesetError,
StatesetInvalidRequestError,
StatesetAPIError,
StatesetAuthenticationError,
StatesetPermissionError,
StatesetNotFoundError,
StatesetConnectionError,
StatesetRateLimitError
)
# Semantic version of the SDK
__version__ = "1.0.0"
# API version supported by this SDK
__api_version__ = "2024-01"
__all__ = [
# Main client
"Stateset",
# Base clients
"AuthenticatedClient",
"Client",
# Types
"StatesetID",
"Timestamp",
"Metadata",
"StatesetObject",
"OrderStatus",
"ReturnStatus",
"WarrantyStatus",
"PaginationParams",
"PaginatedList",
"File",
"FileUploadError",
"UNSET",
# Errors
"StatesetError",
"StatesetInvalidRequestError",
"StatesetAPIError",
"StatesetAuthenticationError",
"StatesetPermissionError",
"StatesetNotFoundError",
"StatesetConnectionError",
"StatesetRateLimitError",
# Version info
"__version__",
"__api_version__",
]
# Set default logging handler to avoid "No handler found" warnings.
import logging
try:
from logging import NullHandler
except ImportError:
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger(__name__).addHandler(NullHandler())
# Type checking
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from .resources.return_resource import Returns
from .resources.warranty_resource import Warranties
from .resources.order_resource import Orders
from .resources.inventory_resource import Inventory
# Add other resource types as needed