-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchannels.py
More file actions
56 lines (45 loc) · 1.56 KB
/
channels.py
File metadata and controls
56 lines (45 loc) · 1.56 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
from mpt_api_client.http import AsyncService, Service, mixins
from mpt_api_client.models import Model
from mpt_api_client.resources.helpdesk.channel_messages import (
AsyncChannelMessagesService,
ChannelMessagesService,
)
class Channel(Model):
"""Helpdesk Channel resource."""
class ChannelsServiceConfig:
"""Helpdesk Channels service configuration."""
_endpoint = "/public/v1/helpdesk/channels"
_model_class = Channel
_collection_key = "data"
class ChannelsService(
mixins.CreateMixin[Channel],
mixins.UpdateMixin[Channel],
mixins.GetMixin[Channel],
mixins.DeleteMixin,
mixins.CollectionMixin[Channel],
Service[Channel],
ChannelsServiceConfig,
):
"""Helpdesk Channels service."""
def messages(self, channel_id: str) -> ChannelMessagesService:
"""Return channel messages service."""
return ChannelMessagesService(
http_client=self.http_client,
endpoint_params={"channel_id": channel_id},
)
class AsyncChannelsService(
mixins.AsyncCreateMixin[Channel],
mixins.AsyncUpdateMixin[Channel],
mixins.AsyncGetMixin[Channel],
mixins.AsyncDeleteMixin,
mixins.AsyncCollectionMixin[Channel],
AsyncService[Channel],
ChannelsServiceConfig,
):
"""Async Helpdesk Channels service."""
def messages(self, channel_id: str) -> AsyncChannelMessagesService:
"""Return async channel messages service."""
return AsyncChannelMessagesService(
http_client=self.http_client,
endpoint_params={"channel_id": channel_id},
)