Skip to content

Commit 582b587

Browse files
committed
udpate get messages with status
1 parent 0f48a20 commit 582b587

File tree

6 files changed

+15
-4
lines changed

6 files changed

+15
-4
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [3.3.17] - 2024-08-30
8+
## [3.3.18] - 2024-08-30
99

1010
- Update get messages
1111

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,7 @@ following arguments:
509509
- `endTime`: Use ISO format, e.g. "2024-01-24T16:39:00Z".
510510
- `reverse`: If set to Ture the results will be returned in reverse order.
511511
- `direction`: Filter your messages by direction: outgoing or incoming.
512+
- `status`: Filter your messages by status.
512513

513514
Raises `telstra.messaging.exceptions.MessageError` if anything goes wrong.
514515

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "telstra.messaging"
3-
version = "3.3.17"
3+
version = "3.3.18"
44
readme = "README.md"
55
description = "SDK for the Telstra Messaging API V3 - Beta"
66
license = "Apache-2.0"

telstra/messaging/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""Messaging."""
22

3-
__version__ = "3.3.17"
3+
__version__ = "3.3.18"

telstra/messaging/message.py

+10-1
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,7 @@ def _validate_get_all_args(
683683
endTime: typing.Optional[types.TEndTime] = None,
684684
reverse: typing.Optional[types.TReverse] = None,
685685
direction: typing.Optional[types.TDirection] = None,
686+
status: typing.Optional[types.TStatus] = None,
686687
) -> None:
687688
# Validate limit
688689
if (limit is not None and not isinstance(limit, types.TLimit)) or (
@@ -737,6 +738,12 @@ def _validate_get_all_args(
737738
f'received "{direction}"'
738739
)
739740

741+
if status is not None and not isinstance(status, types.TStatus):
742+
raise exceptions.MessageError(
743+
'the value of "status" is not valid, expected a string, '
744+
f'received "{status}"'
745+
)
746+
740747

741748
def get_all(
742749
limit: typing.Optional[types.TLimit] = None,
@@ -746,6 +753,7 @@ def get_all(
746753
endTime: typing.Optional[types.TEndTime] = None,
747754
reverse: typing.Optional[types.TReverse] = None,
748755
direction: typing.Optional[types.TDirection] = None,
756+
status: typing.Optional[types.TStatus] = None,
749757
) -> TMessages:
750758
"""
751759
Retrieve all messages.
@@ -765,6 +773,7 @@ def get_all(
765773
endTime=endTime,
766774
reverse=reverse,
767775
direction=direction,
776+
status=status,
768777
)
769778

770779
try:
@@ -783,7 +792,7 @@ def get_all(
783792
}
784793

785794
messages_get_request = request.Request(
786-
f"{_URL}{querystring.build(limit=limit, offset=offset, filter=filter,startTime=startTime,endTime=endTime,reverse=reverse,direction=direction)}",
795+
f"{_URL}{querystring.build(limit=limit, offset=offset, filter=filter,startTime=startTime,endTime=endTime,reverse=reverse,direction=direction,status=status)}",
787796
headers=headers,
788797
method="GET",
789798
)

telstra/messaging/types.py

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
TEndTime = str
2020
TReverse = bool
2121
TDirection = str
22+
TStatus = str
2223

2324

2425
class TMultimediaContentTypes(Enum):

0 commit comments

Comments
 (0)