-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcatalog.py
More file actions
51 lines (39 loc) · 1.61 KB
/
catalog.py
File metadata and controls
51 lines (39 loc) · 1.61 KB
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
from mpt_api_client.http import AsyncHTTPClient, HTTPClient
from mpt_api_client.resources.catalog.authorizations import (
AsyncAuthorizationsService,
AuthorizationsService,
)
from mpt_api_client.resources.catalog.items import AsyncItemsService, ItemsService
from mpt_api_client.resources.catalog.products import AsyncProductsService, ProductsService
class Catalog:
"""Catalog MPT API Module."""
def __init__(self, *, http_client: HTTPClient):
self.http_client = http_client
@property
def authorizations(self) -> AuthorizationsService:
"""Authorizations service."""
return AuthorizationsService(http_client=self.http_client)
@property
def products(self) -> ProductsService:
"""Products service."""
return ProductsService(http_client=self.http_client)
@property
def items(self) -> ItemsService: # noqa: WPS110
"""Items service."""
return ItemsService(http_client=self.http_client)
class AsyncCatalog:
"""Catalog MPT API Module."""
def __init__(self, *, http_client: AsyncHTTPClient):
self.http_client = http_client
@property
def authorizations(self) -> AsyncAuthorizationsService:
"""Authorizations service."""
return AsyncAuthorizationsService(http_client=self.http_client)
@property
def products(self) -> AsyncProductsService:
"""Products service."""
return AsyncProductsService(http_client=self.http_client)
@property
def items(self) -> AsyncItemsService: # noqa: WPS110
"""Items service."""
return AsyncItemsService(http_client=self.http_client)