Coverage for venv\Lib\site-packages\rid_lib\types\slack_channel.py: 100%
15 statements
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-20 16:40 +0800
« prev ^ index » next coverage.py v7.6.7, created at 2024-11-20 16:40 +0800
1from rid_lib.core import RID, ORN
3class SlackChannel(ORN):
4 namespace = "slack.channel"
6 def __init__(
7 self,
8 team_id: str,
9 channel_id: str,
10 ):
11 self.team_id = team_id
12 self.channel_id = channel_id
14 @property
15 def reference(self):
16 return f"{self.team_id}/{self.channel_id}"
18 @classmethod
19 def from_reference(cls, reference):
20 components = reference.split("/")
21 if len(components) == 2:
22 return cls(*components)
24RID.register_context(SlackChannel)