Created
May 28, 2024 02:35
-
-
Save wooparadog/aaf9de36aa60f96cfb9f6723f57f6717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/orion/biz/connectors/im/imessage/common.py b/orion/biz/connectors/im/imessage/common.py | |
index cb045292..97f10f01 100644 | |
--- a/orion/biz/connectors/im/imessage/common.py | |
+++ b/orion/biz/connectors/im/imessage/common.py | |
@@ -2,7 +2,8 @@ import datetime | |
from enum import StrEnum | |
from typing import Dict, List, Optional | |
-from pydantic.v1 import BaseModel as PydanticV1BaseModel, Field as PydanticV1Field | |
+from pydantic.v1 import BaseModel as PydanticV1BaseModel | |
+from pydantic.v1 import Field as PydanticV1Field | |
class LiveChatEventType(StrEnum): | |
@@ -56,6 +57,7 @@ class LiveChatFileResponse(LiveChatEventResponse): | |
class LiveChatRichMessageType(StrEnum): | |
QUICK_REPLIES = "quick_replies" | |
+ CARDS = "cards" | |
class LiveChatRichMessageBaseRequest(PydanticV1BaseModel): | |
@@ -86,3 +88,25 @@ class LiveChatRichMessageElement(PydanticV1BaseModel): | |
class LiveChatRichMessageQuickReplyRequest(LiveChatRichMessageBaseRequest): | |
template_id: LiveChatRichMessageType = LiveChatRichMessageType.QUICK_REPLIES | |
elements: List[LiveChatRichMessageElement] | |
+ | |
+ | |
+class CardElementImage(PydanticV1BaseModel): | |
+ url: str | |
+ name: Optional[str] = None | |
+ content_type: Optional[str] = None | |
+ size: Optional[int] = None | |
+ width: Optional[int] = None | |
+ height: Optional[int] = None | |
+ alternative_text: Optional[str] = None | |
+ | |
+ | |
+class CardRichMessageElement(PydanticV1BaseModel): | |
+ title: str | |
+ subtitle: str | |
+ image: CardElementImage | |
+ | |
+ | |
+class LiveChatRichMessageRequest(LiveChatRichMessageBaseRequest): | |
+ template_id: LiveChatRichMessageType = LiveChatRichMessageType.CARDS | |
+ elements: List[CardRichMessageElement] | |
+ buttons: List[LiveChatRichMessageBTN] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment