2626 async_to_raw_response_wrapper ,
2727 async_to_streamed_response_wrapper ,
2828)
29- from .mark_as_read import (
30- MarkAsReadResource ,
31- AsyncMarkAsReadResource ,
32- MarkAsReadResourceWithRawResponse ,
33- AsyncMarkAsReadResourceWithRawResponse ,
34- MarkAsReadResourceWithStreamingResponse ,
35- AsyncMarkAsReadResourceWithStreamingResponse ,
36- )
3729from ..._base_client import make_request_options
30+ from .mark_all_as_read import (
31+ MarkAllAsReadResource ,
32+ AsyncMarkAllAsReadResource ,
33+ MarkAllAsReadResourceWithRawResponse ,
34+ AsyncMarkAllAsReadResourceWithRawResponse ,
35+ MarkAllAsReadResourceWithStreamingResponse ,
36+ AsyncMarkAllAsReadResourceWithStreamingResponse ,
37+ )
3838from ...types .chat_hide_response import ChatHideResponse
3939from ...types .chat_list_response import ChatListResponse
4040from ...types .chat_mute_response import ChatMuteResponse
4141from ...types .chat_delete_response import ChatDeleteResponse
4242from ...types .chat_unmute_response import ChatUnmuteResponse
4343from ...types .chat_list_media_response import ChatListMediaResponse
44+ from ...types .chat_mark_as_read_response import ChatMarkAsReadResponse
4445from ...types .chat_start_typing_response import ChatStartTypingResponse
4546from ...types .chat_mark_as_unread_response import ChatMarkAsUnreadResponse
4647
@@ -53,8 +54,8 @@ def messages(self) -> MessagesResource:
5354 return MessagesResource (self ._client )
5455
5556 @cached_property
56- def mark_as_read (self ) -> MarkAsReadResource :
57- return MarkAsReadResource (self ._client )
57+ def mark_all_as_read (self ) -> MarkAllAsReadResource :
58+ return MarkAllAsReadResource (self ._client )
5859
5960 @cached_property
6061 def with_raw_response (self ) -> ChatsResourceWithRawResponse :
@@ -274,6 +275,44 @@ def list_media(
274275 cast_to = ChatListMediaResponse ,
275276 )
276277
278+ def mark_as_read (
279+ self ,
280+ chat_id : str ,
281+ * ,
282+ account : str ,
283+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
284+ # The extra values given here take precedence over values defined on the client or passed to this method.
285+ extra_headers : Headers | None = None ,
286+ extra_query : Query | None = None ,
287+ extra_body : Body | None = None ,
288+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
289+ ) -> ChatMarkAsReadResponse :
290+ """Mark a specific chat as read.
291+
292+ Alternative to List Chat Messages endpoint, if you
293+ just want to mark the chat as read without fetching messages.
294+
295+ Args:
296+ extra_headers: Send extra headers
297+
298+ extra_query: Add additional query parameters to the request
299+
300+ extra_body: Add additional JSON properties to the request
301+
302+ timeout: Override the client-level default timeout for this request, in seconds
303+ """
304+ if not account :
305+ raise ValueError (f"Expected a non-empty value for `account` but received { account !r} " )
306+ if not chat_id :
307+ raise ValueError (f"Expected a non-empty value for `chat_id` but received { chat_id !r} " )
308+ return self ._post (
309+ path_template ("/api/{account}/chats/{chat_id}/mark-as-read" , account = account , chat_id = chat_id ),
310+ options = make_request_options (
311+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
312+ ),
313+ cast_to = ChatMarkAsReadResponse ,
314+ )
315+
277316 def mark_as_unread (
278317 self ,
279318 chat_id : str ,
@@ -427,8 +466,8 @@ def messages(self) -> AsyncMessagesResource:
427466 return AsyncMessagesResource (self ._client )
428467
429468 @cached_property
430- def mark_as_read (self ) -> AsyncMarkAsReadResource :
431- return AsyncMarkAsReadResource (self ._client )
469+ def mark_all_as_read (self ) -> AsyncMarkAllAsReadResource :
470+ return AsyncMarkAllAsReadResource (self ._client )
432471
433472 @cached_property
434473 def with_raw_response (self ) -> AsyncChatsResourceWithRawResponse :
@@ -648,6 +687,44 @@ async def list_media(
648687 cast_to = ChatListMediaResponse ,
649688 )
650689
690+ async def mark_as_read (
691+ self ,
692+ chat_id : str ,
693+ * ,
694+ account : str ,
695+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
696+ # The extra values given here take precedence over values defined on the client or passed to this method.
697+ extra_headers : Headers | None = None ,
698+ extra_query : Query | None = None ,
699+ extra_body : Body | None = None ,
700+ timeout : float | httpx .Timeout | None | NotGiven = not_given ,
701+ ) -> ChatMarkAsReadResponse :
702+ """Mark a specific chat as read.
703+
704+ Alternative to List Chat Messages endpoint, if you
705+ just want to mark the chat as read without fetching messages.
706+
707+ Args:
708+ extra_headers: Send extra headers
709+
710+ extra_query: Add additional query parameters to the request
711+
712+ extra_body: Add additional JSON properties to the request
713+
714+ timeout: Override the client-level default timeout for this request, in seconds
715+ """
716+ if not account :
717+ raise ValueError (f"Expected a non-empty value for `account` but received { account !r} " )
718+ if not chat_id :
719+ raise ValueError (f"Expected a non-empty value for `chat_id` but received { chat_id !r} " )
720+ return await self ._post (
721+ path_template ("/api/{account}/chats/{chat_id}/mark-as-read" , account = account , chat_id = chat_id ),
722+ options = make_request_options (
723+ extra_headers = extra_headers , extra_query = extra_query , extra_body = extra_body , timeout = timeout
724+ ),
725+ cast_to = ChatMarkAsReadResponse ,
726+ )
727+
651728 async def mark_as_unread (
652729 self ,
653730 chat_id : str ,
@@ -811,6 +888,9 @@ def __init__(self, chats: ChatsResource) -> None:
811888 self .list_media = to_raw_response_wrapper (
812889 chats .list_media ,
813890 )
891+ self .mark_as_read = to_raw_response_wrapper (
892+ chats .mark_as_read ,
893+ )
814894 self .mark_as_unread = to_raw_response_wrapper (
815895 chats .mark_as_unread ,
816896 )
@@ -829,8 +909,8 @@ def messages(self) -> MessagesResourceWithRawResponse:
829909 return MessagesResourceWithRawResponse (self ._chats .messages )
830910
831911 @cached_property
832- def mark_as_read (self ) -> MarkAsReadResourceWithRawResponse :
833- return MarkAsReadResourceWithRawResponse (self ._chats .mark_as_read )
912+ def mark_all_as_read (self ) -> MarkAllAsReadResourceWithRawResponse :
913+ return MarkAllAsReadResourceWithRawResponse (self ._chats .mark_all_as_read )
834914
835915
836916class AsyncChatsResourceWithRawResponse :
@@ -849,6 +929,9 @@ def __init__(self, chats: AsyncChatsResource) -> None:
849929 self .list_media = async_to_raw_response_wrapper (
850930 chats .list_media ,
851931 )
932+ self .mark_as_read = async_to_raw_response_wrapper (
933+ chats .mark_as_read ,
934+ )
852935 self .mark_as_unread = async_to_raw_response_wrapper (
853936 chats .mark_as_unread ,
854937 )
@@ -867,8 +950,8 @@ def messages(self) -> AsyncMessagesResourceWithRawResponse:
867950 return AsyncMessagesResourceWithRawResponse (self ._chats .messages )
868951
869952 @cached_property
870- def mark_as_read (self ) -> AsyncMarkAsReadResourceWithRawResponse :
871- return AsyncMarkAsReadResourceWithRawResponse (self ._chats .mark_as_read )
953+ def mark_all_as_read (self ) -> AsyncMarkAllAsReadResourceWithRawResponse :
954+ return AsyncMarkAllAsReadResourceWithRawResponse (self ._chats .mark_all_as_read )
872955
873956
874957class ChatsResourceWithStreamingResponse :
@@ -887,6 +970,9 @@ def __init__(self, chats: ChatsResource) -> None:
887970 self .list_media = to_streamed_response_wrapper (
888971 chats .list_media ,
889972 )
973+ self .mark_as_read = to_streamed_response_wrapper (
974+ chats .mark_as_read ,
975+ )
890976 self .mark_as_unread = to_streamed_response_wrapper (
891977 chats .mark_as_unread ,
892978 )
@@ -905,8 +991,8 @@ def messages(self) -> MessagesResourceWithStreamingResponse:
905991 return MessagesResourceWithStreamingResponse (self ._chats .messages )
906992
907993 @cached_property
908- def mark_as_read (self ) -> MarkAsReadResourceWithStreamingResponse :
909- return MarkAsReadResourceWithStreamingResponse (self ._chats .mark_as_read )
994+ def mark_all_as_read (self ) -> MarkAllAsReadResourceWithStreamingResponse :
995+ return MarkAllAsReadResourceWithStreamingResponse (self ._chats .mark_all_as_read )
910996
911997
912998class AsyncChatsResourceWithStreamingResponse :
@@ -925,6 +1011,9 @@ def __init__(self, chats: AsyncChatsResource) -> None:
9251011 self .list_media = async_to_streamed_response_wrapper (
9261012 chats .list_media ,
9271013 )
1014+ self .mark_as_read = async_to_streamed_response_wrapper (
1015+ chats .mark_as_read ,
1016+ )
9281017 self .mark_as_unread = async_to_streamed_response_wrapper (
9291018 chats .mark_as_unread ,
9301019 )
@@ -943,5 +1032,5 @@ def messages(self) -> AsyncMessagesResourceWithStreamingResponse:
9431032 return AsyncMessagesResourceWithStreamingResponse (self ._chats .messages )
9441033
9451034 @cached_property
946- def mark_as_read (self ) -> AsyncMarkAsReadResourceWithStreamingResponse :
947- return AsyncMarkAsReadResourceWithStreamingResponse (self ._chats .mark_as_read )
1035+ def mark_all_as_read (self ) -> AsyncMarkAllAsReadResourceWithStreamingResponse :
1036+ return AsyncMarkAllAsReadResourceWithStreamingResponse (self ._chats .mark_all_as_read )
0 commit comments