diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-01-14 12:38:25 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | 2e64309e8094fe7409a0d97d32dfe8d35fed689c (patch) | |
tree | 3a5005daa653ff907b6c72b7a43666082f4bd86c /typings | |
parent | 570f855c7aa29168e2c883066e4b878068646caf (diff) | |
download | wee-slack-2e64309e8094fe7409a0d97d32dfe8d35fed689c.tar.gz |
Add typings for users.conversations
Diffstat (limited to 'typings')
-rw-r--r-- | typings/slack_api/slack_users_conversations.pyi | 114 |
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 +) |