Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
cd21bde
DEVX-10006: Adding tests for RCS Suggestion Base Model
superchilled Mar 11, 2026
f1023ab
DEVX-10006: Implementing RCS Suggestion Base model
superchilled Mar 11, 2026
3acc1eb
DEVX-10006: Adding RCS Suggestion Reply test
superchilled Mar 11, 2026
88e23b1
DEVX-10006: Implementing RCS Suggested Reply model
superchilled Mar 11, 2026
267709a
DEVX-10006: Adding tests for RCS suggestion action dial
superchilled Mar 11, 2026
563cc67
DEVX-10006: Implementing RCS suggestion action dial
superchilled Mar 11, 2026
1f4ccdb
DEVX-10006: Adding tests and implementation for RCS view location sug…
superchilled Mar 11, 2026
9c55ae2
DEVX-10006: adding tests and implementation for RCS Share Location su…
superchilled Mar 11, 2026
0211442
DEVX-10006: adding tests and implementation for RCS Open URL suggesti…
superchilled Mar 11, 2026
352b43d
DEVX-10006: Adding tests and implementation for RCS Open URL in Webvi…
superchilled Mar 11, 2026
e8cbd36
DEVX-10006: addig tests and implementation for RCS Create Calendar Ev…
superchilled Mar 11, 2026
efcb0c0
DEVX-10006: Adding test and implemention for RCS Category model
superchilled Mar 12, 2026
c9d4e5b
DEVX-10006: Add tests and implementation for RCS Card Options model
superchilled Mar 13, 2026
4f7b518
DEVX-10006: Updating RCS Text model and adding initial RCS Card imple…
superchilled Mar 13, 2026
91d3d33
DEVX-10006: adding more RCS Card tests
superchilled Mar 16, 2026
9b8fc73
DEVX-10006: Adding tests and implementation for RCS CardContent model
superchilled Mar 16, 2026
5a2b335
DEVX-10006: Refactoring RCS Card model
superchilled Mar 16, 2026
0f31306
DEVX-10006: Adding initial RCS Carousel tests and implementation
superchilled Mar 16, 2026
9bf8e0e
DEVX-10006: Fixing RCS Card models and tests
superchilled Mar 17, 2026
0b9be71
DEVX-10006: fix linting issues
superchilled Mar 17, 2026
5353ffc
DEVX-10006: Updating RCS models exports list
superchilled Mar 17, 2026
5ca3b6d
DEVX-10006: updating RCS Carousel implementation and tests
superchilled Mar 17, 2026
f4ed88f
DEVX-10006: linting
superchilled Mar 17, 2026
f760a58
DEVX-10006: Updating doc blocks
superchilled Mar 18, 2026
7a853a9
DEVX-10043: Updating implementaton and tests for MMS caption max length
superchilled Mar 24, 2026
4c267fc
DEVX-10815: Adding tests for MMS trusted_recipient param
superchilled Mar 24, 2026
e1edd98
DEVX-10815: adding trusted_recipient param to BaseMms model
superchilled Mar 24, 2026
d86f58f
DEVX-10815: Updating SMS tests for trusted_recipient param
superchilled Mar 24, 2026
6f717b6
DEVX-10815: updating Sms model to add trusted_recipient param
superchilled Mar 24, 2026
1499a67
DEVX-10815: updating RCS model tests to include trusted_recipient param
superchilled Mar 24, 2026
83534fa
DEVX-10815: updating BaseRcs model to include trusted_recipient param
superchilled Mar 24, 2026
e5dc525
DEVX-10815: updating doc blocks
superchilled Mar 24, 2026
fcfc16d
DEVX-10013: Updating SMS tests to include pool_id param
superchilled Mar 24, 2026
0c85567
DEVX-10013: implemeting pool_id param in Sms model
superchilled Mar 24, 2026
123150f
DEVX-10013: updating doc block for pool_id param in SmsOptions model
superchilled Mar 24, 2026
ec27bc8
DEVX-10043: linting
superchilled Mar 24, 2026
e8f1b5b
DEVX-9451: Adding tests for new MmsText model
superchilled Mar 24, 2026
5dbe7be
DEVX-9451: Implementing MmsText Model
superchilled Mar 24, 2026
cbb55dd
DEVX-9451: Adding tests and implementation for MmsFile model
superchilled Mar 25, 2026
c4df580
DEVX-9451: adding tests and implementation for MmsContent model
superchilled Mar 25, 2026
95648e2
DEVX-9451: updating imports lists
superchilled Mar 25, 2026
819475d
DEVX-9451: linting
superchilled Mar 25, 2026
3eed3e6
DEVX-9451: class ordering
superchilled Mar 25, 2026
2e3a263
DEVX-10770: adding tests and implementation for typing indicators
superchilled Mar 27, 2026
afc7897
DEVX-10770: linting
superchilled Mar 27, 2026
f86e7fe
DEVX-10006: fixing RCS card and carousel implementation
superchilled Mar 30, 2026
294fe5a
DEVX-10006: linting
superchilled Mar 30, 2026
0ba7029
feat: add missing validation tests for SMS, MMS, RCS and WhatsApp models
Copilot Apr 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions messages/src/vonage_messages/messages.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pydantic import validate_call
from vonage_http_client.http_client import HttpClient

from .models import BaseMessage
from .models import BaseMessage, ReplyingIndicatorText
from .responses import SendMessageResponse


Expand Down Expand Up @@ -66,7 +66,9 @@ def send(
return SendMessageResponse(**response)

@validate_call
def mark_whatsapp_message_read(self, message_uuid: str) -> None:
def mark_whatsapp_message_read(
self, message_uuid: str, replying_indicator: ReplyingIndicatorText = None
) -> None:
"""Mark a WhatsApp message as read.

Note: to use this method, update the `api_host` attribute of the
Expand All @@ -78,11 +80,18 @@ def mark_whatsapp_message_read(self, message_uuid: str) -> None:

Args:
message_uuid (str): The unique identifier of the WhatsApp message to mark as read.
replying_indicator (ReplyingIndicatorText, optional): An object indicating whether to show the replying indicator on the WhatsApp message.
"""
body = {'status': 'read'}
if replying_indicator is not None:
body['replying_indicator'] = replying_indicator.model_dump(
by_alias=True, exclude_none=True
)

self._http_client.patch(
self._http_client.api_host,
f'/v1/messages/{message_uuid}',
{'status': 'read'},
body,
self._auth_type,
)

Expand Down
84 changes: 81 additions & 3 deletions messages/src/vonage_messages/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
from .base_message import BaseMessage
from .enums import ChannelType, EncodingType, MessageType, WebhookVersion
from .enums import (
ChannelType,
EncodingType,
MessageType,
MmsContentItemType,
RcsCardOrientation,
RcsCardWidth,
RcsCategory,
RcsImageAlignment,
RcsMediaHeight,
WebhookVersion,
)
from .messenger import (
MessengerAudio,
MessengerFile,
Expand All @@ -9,8 +20,44 @@
MessengerText,
MessengerVideo,
)
from .mms import MmsAudio, MmsImage, MmsResource, MmsVcard, MmsVideo
from .rcs import RcsCustom, RcsFile, RcsImage, RcsResource, RcsText, RcsVideo
from .mms import (
MmsAudio,
MmsContent,
MmsContentItemAudio,
MmsContentItemFile,
MmsContentItemImage,
MmsContentItemVcard,
MmsContentItemVideo,
MmsFile,
MmsImage,
MmsResource,
MmsText,
MmsVcard,
MmsVideo,
)
from .rcs import (
RcsCard,
RcsCardMessage,
RcsCarousel,
RcsCarouselMessage,
RcsCustom,
RcsFile,
RcsImage,
RcsOptions,
RcsOptionsCard,
RcsOptionsCarousel,
RcsResource,
RcsSuggestionActionCreateCalendarEvent,
RcsSuggestionActionDial,
RcsSuggestionActionOpenUrl,
RcsSuggestionActionOpenUrlWebview,
RcsSuggestionActionShareLocation,
RcsSuggestionActionViewLocation,
RcsSuggestionBase,
RcsSuggestionReply,
RcsText,
RcsVideo,
)
from .sms import Sms, SmsOptions
from .viber import (
ViberAction,
Expand All @@ -27,6 +74,7 @@
ViberVideoResource,
)
from .whatsapp import (
ReplyingIndicatorText,
WhatsappAudio,
WhatsappAudioResource,
WhatsappContext,
Expand Down Expand Up @@ -59,16 +107,46 @@
'MessengerText',
'MessengerVideo',
'MmsAudio',
'MmsContent',
'MmsContentItemImage',
'MmsContentItemAudio',
'MmsContentItemVideo',
'MmsContentItemFile',
'MmsContentItemVcard',
'MmsContentItemType',
'MmsFile',
'MmsImage',
'MmsResource',
'MmsText',
'MmsVcard',
'MmsVideo',
'RcsCard',
'RcsCardMessage',
'RcsCarousel',
'RcsCarouselMessage',
'RcsCustom',
'RcsFile',
'RcsImage',
'RcsOptions',
'RcsOptionsCard',
'RcsOptionsCarousel',
'RcsResource',
'RcsSuggestionActionCreateCalendarEvent',
'RcsSuggestionActionDial',
'RcsSuggestionActionOpenUrl',
'RcsSuggestionActionOpenUrlWebview',
'RcsSuggestionActionShareLocation',
'RcsSuggestionActionViewLocation',
'RcsSuggestionBase',
'RcsSuggestionReply',
'RcsText',
'RcsVideo',
'RcsCategory',
'RcsCardOrientation',
'RcsImageAlignment',
'RcsCardWidth',
'RcsMediaHeight',
'ReplyingIndicatorText',
'Sms',
'SmsOptions',
'ViberAction',
Expand Down
78 changes: 78 additions & 0 deletions messages/src/vonage_messages/models/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class MessageType(str, Enum):
STICKER = 'sticker'
CUSTOM = 'custom'
VCARD = 'vcard'
CARD = 'card'
CAROUSEL = 'carousel'
CONTENT = 'content'


class ChannelType(str, Enum):
Expand All @@ -37,3 +40,78 @@ class EncodingType(str, Enum):
TEXT = 'text'
UNICODE = 'unicode'
AUTO = 'auto'


class SuggestionType(str, Enum):
"""The type of RCS suggestion."""

REPLY = 'reply'
DIAL = 'dial'
VIEW_LOCATION = 'view_location'
SHARE_LOCATION = 'share_location'
OPEN_URL = 'open_url'
OPEN_URL_IN_WEBVIEW = 'open_url_in_webview'
CREATE_CALENDAR_EVENT = 'create_calendar_event'


class UrlWebviewViewMode(str, Enum):
"""The view mode for an RCS suggestion that opens a URL in a webview."""

FULL = 'FULL'
TALL = 'TALL'
HALF = 'HALF'


class RcsCategory(str, Enum):
"""The category of an RCS message."""

ACKNOWLEDGEMENT = 'acknowledgement'
AUTHENTICATION = 'authentication'
PROMOTION = 'promotion'
SERVICE_REQUEST = 'service-request'
TRANSACTION = 'transaction'


class RcsCardOrientation(str, Enum):
"""The orientation of an RCS card."""

VERTICAL = 'VERTICAL'
HORIZONTAL = 'HORIZONTAL'


class RcsImageAlignment(str, Enum):
"""The alignment of an image on an RCS card."""

LEFT = 'LEFT'
RIGHT = 'RIGHT'


class RcsCardWidth(str, Enum):
"""The width of a card in an RCS carousel."""

SMALL = 'SMALL'
MEDIUM = 'MEDIUM'


class RcsMediaHeight(str, Enum):
"""The height of media on an RCS card."""

SHORT = 'SHORT'
MEDIUM = 'MEDIUM'
TALL = 'TALL'


class MmsContentItemType(str, Enum):
"""The type of a content item in an MMS Content message."""

IMAGE = 'image'
AUDIO = 'audio'
VIDEO = 'video'
FILE = 'file'
VCARD = 'vcard'


class ReplyingIndicatorType(str, Enum):
"""The type of a WhatsApp replying indicator."""

TEXT = 'text'
Loading
Loading