aboutsummaryrefslogtreecommitdiffstats
path: root/typings
diff options
context:
space:
mode:
Diffstat (limited to 'typings')
-rw-r--r--typings/slack_api/slack_users_conversations.pyi114
1 files changed, 114 insertions, 0 deletions
diff --git a/typings/slack_api/slack_users_conversations.pyi b/typings/slack_api/slack_users_conversations.pyi
new file mode 100644
index 0000000..ec394a0
--- /dev/null
+++ b/typings/slack_api/slack_users_conversations.pyi
@@ -0,0 +1,114 @@
+from __future__ import annotations
+
+from typing import Generic, List, Literal, TypedDict, TypeVar, final
+
+T = TypeVar("T")
+
+@final
+class SlackTopic(TypedDict):
+ value: str
+ creator: str
+ last_set: int
+
+@final
+class SlackPurpose(TypedDict):
+ value: str
+ creator: str
+ last_set: int
+
+class SlackUsersConversationsCommon(TypedDict):
+ id: str
+ created: int
+ is_archived: bool
+ is_org_shared: bool
+ context_team_id: str
+ updated: int
+
+class SlackUsersConversationsCommonNotIm(SlackUsersConversationsCommon):
+ name: str
+ is_channel: bool
+ is_group: bool
+ is_im: Literal[False]
+ is_general: bool
+ unlinked: int
+ name_normalized: str
+ is_shared: bool
+ is_pending_ext_shared: bool
+ pending_shared: List # pyright: ignore [reportMissingTypeArgument]
+ parent_conversation: None
+ creator: str
+ is_ext_shared: bool
+ shared_team_ids: List[str]
+ pending_connected_team_ids: List # pyright: ignore [reportMissingTypeArgument]
+ topic: SlackTopic
+ purpose: SlackPurpose
+
+@final
+class SlackUsersConversationsPublic(SlackUsersConversationsCommonNotIm):
+ is_mpim: Literal[False]
+ is_private: Literal[False]
+ previous_names: List[str] # TODO: Check if private and mpim has this
+
+@final
+class SlackUsersConversationsPrivate(SlackUsersConversationsCommonNotIm):
+ is_mpim: Literal[False]
+ is_private: Literal[True]
+
+@final
+class SlackUsersConversationsMpim(SlackUsersConversationsCommonNotIm):
+ is_mpim: Literal[True]
+ is_private: Literal[True]
+
+@final
+class SlackUsersConversationsIm(SlackUsersConversationsCommon):
+ is_im: Literal[True]
+ user: str
+ is_user_deleted: bool
+ priority: int
+
+SlackUsersConversationsNotIm = (
+ SlackUsersConversationsPublic
+ | SlackUsersConversationsPrivate
+ | SlackUsersConversationsMpim
+)
+SlackUsersConversations = SlackUsersConversationsNotIm | SlackUsersConversationsIm
+
+@final
+class SlackUsersConversationsErrorResponse(TypedDict):
+ ok: Literal[False]
+ error: str
+
+@final
+class SlackResponseMetadata(TypedDict):
+ next_cursor: str
+
+@final
+class SlackUsersConversationsSuccessResponse(TypedDict, Generic[T]):
+ ok: Literal[True]
+ channels: List[T]
+ response_metadata: SlackResponseMetadata
+
+SlackUsersConversationsPublicResponse = (
+ SlackUsersConversationsSuccessResponse[SlackUsersConversationsPublic]
+ | SlackUsersConversationsErrorResponse
+)
+SlackUsersConversationsPrivateResponse = (
+ SlackUsersConversationsSuccessResponse[SlackUsersConversationsPrivate]
+ | SlackUsersConversationsErrorResponse
+)
+SlackUsersConversationsMpimResponse = (
+ SlackUsersConversationsSuccessResponse[SlackUsersConversationsMpim]
+ | SlackUsersConversationsErrorResponse
+)
+SlackUsersConversationsImResponse = (
+ SlackUsersConversationsSuccessResponse[SlackUsersConversationsIm]
+ | SlackUsersConversationsErrorResponse
+)
+SlackUsersConversationsNotImResponse = (
+ SlackUsersConversationsSuccessResponse[SlackUsersConversationsNotIm]
+ | SlackUsersConversationsErrorResponse
+)
+SlackUsersConversationsResponse = (
+ SlackUsersConversationsSuccessResponse[SlackUsersConversations]
+ | SlackUsersConversationsErrorResponse
+)