-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccount_users.py
More file actions
66 lines (55 loc) · 1.81 KB
/
account_users.py
File metadata and controls
66 lines (55 loc) · 1.81 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from mpt_api_client.http import AsyncService, Service
from mpt_api_client.http.mixins import (
AsyncCollectionMixin,
AsyncCreateMixin,
AsyncGetMixin,
CollectionMixin,
CreateMixin,
GetMixin,
)
from mpt_api_client.models import Model
from mpt_api_client.resources.accounts.account_user_groups import (
AccountUserGroupsService,
AsyncAccountUserGroupsService,
)
from mpt_api_client.resources.accounts.mixins import (
AsyncInvitableMixin,
InvitableMixin,
)
class AccountUser(Model):
"""Account User Model."""
class AccountUsersServiceConfig:
"""Account Users Service Configuration."""
_endpoint = "/public/v1/accounts/account-users"
_model_class = AccountUser
_collection_key = "data"
class AccountUsersService(
CreateMixin[AccountUser],
InvitableMixin[AccountUser],
GetMixin[AccountUser],
CollectionMixin[AccountUser],
Service[AccountUser],
AccountUsersServiceConfig,
):
"""Account Users Service."""
def groups(self, account_user_id: str) -> AccountUserGroupsService:
"""Return account user groups service."""
return AccountUserGroupsService(
http_client=self.http_client,
endpoint_params={"account_user_id": account_user_id},
)
class AsyncAccountUsersService(
AsyncCreateMixin[AccountUser],
AsyncInvitableMixin[AccountUser],
AsyncGetMixin[AccountUser],
AsyncCollectionMixin[AccountUser],
AsyncService[AccountUser],
AccountUsersServiceConfig,
):
"""Asynchronous Account Users Service."""
def groups(self, account_user_id: str) -> AsyncAccountUserGroupsService:
"""Return account user groups service."""
return AsyncAccountUserGroupsService(
http_client=self.http_client,
endpoint_params={"account_user_id": account_user_id},
)