Skip to content

Commit 3d9b549

Browse files
committed
Refactored to simplify Async implementation
- Unified ResourceClient and CollectionClient in Service - Renamed Resource Client to Service - Renamed Collection Client to Service - Renamed Resource to Model - Unified naming by adding Async as prefix to all Async implementation - Removed required custom collections in Services (CollectionClient) - Removed Resource Registry - Added Async Orders - Added Async MPT
1 parent ea71df4 commit 3d9b549

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1058
-1705
lines changed

mpt_api_client/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from mpt_api_client.mptclient import MPTClient
1+
from mpt_api_client.mpt_client import AsyncMPTClient, MPTClient
22
from mpt_api_client.rql import RQLQuery
33

4-
__all__ = ["MPTClient", "RQLQuery"] # noqa: WPS410
4+
__all__ = ["AsyncMPTClient", "MPTClient", "RQLQuery"] # noqa: WPS410

mpt_api_client/http/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from mpt_api_client.http.client import AsyncHTTPClient, HTTPClient
2+
from mpt_api_client.http.service import AsyncServiceBase, SyncServiceBase
3+
4+
__all__ = ["AsyncHTTPClient", "AsyncServiceBase", "HTTPClient", "SyncServiceBase"] # noqa: WPS410

mpt_api_client/http/client.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,15 @@ def __init__(
3333
"User-Agent": "swo-marketplace-client/1.0",
3434
"Authorization": f"Bearer {api_token}",
3535
}
36-
Client.__init__(
37-
self,
36+
super().__init__(
3837
base_url=base_url,
3938
headers=base_headers,
4039
timeout=timeout,
4140
transport=HTTPTransport(retries=retries),
4241
)
4342

4443

45-
class HTTPClientAsync(AsyncClient):
44+
class AsyncHTTPClient(AsyncClient):
4645
"""Async HTTP client for interacting with SoftwareOne Marketplace Platform API."""
4746

4847
def __init__(
@@ -72,8 +71,7 @@ def __init__(
7271
"User-Agent": "swo-marketplace-client/1.0",
7372
"Authorization": f"Bearer {api_token}",
7473
}
75-
AsyncClient.__init__(
76-
self,
74+
super().__init__(
7775
base_url=base_url,
7876
headers=base_headers,
7977
timeout=timeout,

mpt_api_client/http/resource.py

Lines changed: 0 additions & 264 deletions
This file was deleted.

0 commit comments

Comments
 (0)