Skip to content

Commit 9888463

Browse files
feat(api): manual updates
1 parent e89ce9e commit 9888463

11 files changed

Lines changed: 343 additions & 95 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 265
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-03fa3b4bcb7366349018abcfc80d638bbbf01914ddaec6c316fa86d50668baf9.yml
1+
configured_endpoints: 266
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-c10e28d8a41faf5cc21a8d8660175932704d6f9ce4f74544554993f91ce8772c.yml
33
openapi_spec_hash: d880cb4e4a8105f9bb48453cdd151fde
4-
config_hash: af5f7bc4785bef767bfc36504cb43554
4+
config_hash: b35617df571c3e46d2e845c5e293f1c5

api.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ from onlyfansapi.types import (
171171
ChatDeleteResponse,
172172
ChatHideResponse,
173173
ChatListMediaResponse,
174+
ChatMarkAsReadResponse,
174175
ChatMarkAsUnreadResponse,
175176
ChatMuteResponse,
176177
ChatStartTypingResponse,
@@ -184,6 +185,7 @@ Methods:
184185
- <code title="delete /api/{account}/chats/{chat_id}">client.chats.<a href="./src/onlyfansapi/resources/chats/chats.py">delete</a>(chat_id, \*, account) -> <a href="./src/onlyfansapi/types/chat_delete_response.py">ChatDeleteResponse</a></code>
185186
- <code title="post /api/{account}/chats/{chat_id}/hide">client.chats.<a href="./src/onlyfansapi/resources/chats/chats.py">hide</a>(chat_id, \*, account) -> <a href="./src/onlyfansapi/types/chat_hide_response.py">ChatHideResponse</a></code>
186187
- <code title="get /api/{account}/chats/{chat_id}/media">client.chats.<a href="./src/onlyfansapi/resources/chats/chats.py">list_media</a>(chat_id, \*, account, \*\*<a href="src/onlyfansapi/types/chat_list_media_params.py">params</a>) -> <a href="./src/onlyfansapi/types/chat_list_media_response.py">ChatListMediaResponse</a></code>
188+
- <code title="post /api/{account}/chats/{chat_id}/mark-as-read">client.chats.<a href="./src/onlyfansapi/resources/chats/chats.py">mark_as_read</a>(chat_id, \*, account) -> <a href="./src/onlyfansapi/types/chat_mark_as_read_response.py">ChatMarkAsReadResponse</a></code>
187189
- <code title="post /api/{account}/chats/{chat_id}/mark-as-unread">client.chats.<a href="./src/onlyfansapi/resources/chats/chats.py">mark_as_unread</a>(chat_id, \*, account) -> <a href="./src/onlyfansapi/types/chat_mark_as_unread_response.py">ChatMarkAsUnreadResponse</a></code>
188190
- <code title="post /api/{account}/chats/{chat_id}/mute">client.chats.<a href="./src/onlyfansapi/resources/chats/chats.py">mute</a>(chat_id, \*, account) -> <a href="./src/onlyfansapi/types/chat_mute_response.py">ChatMuteResponse</a></code>
189191
- <code title="post /api/{account}/chats/{chat_id}/typing">client.chats.<a href="./src/onlyfansapi/resources/chats/chats.py">start_typing</a>(chat_id, \*, account) -> <a href="./src/onlyfansapi/types/chat_start_typing_response.py">ChatStartTypingResponse</a></code>
@@ -219,17 +221,17 @@ Methods:
219221
- <code title="delete /api/{account}/chats/{chat_id}/messages/{message_id}/unlike">client.chats.messages.<a href="./src/onlyfansapi/resources/chats/messages.py">unlike</a>(message_id, \*, account, chat_id) -> <a href="./src/onlyfansapi/types/chats/message_unlike_response.py">MessageUnlikeResponse</a></code>
220222
- <code title="delete /api/{account}/chats/{chat_id}/messages/{message_id}/unpin">client.chats.messages.<a href="./src/onlyfansapi/resources/chats/messages.py">unpin</a>(message_id, \*, account, chat_id) -> <a href="./src/onlyfansapi/types/chats/message_unpin_response.py">MessageUnpinResponse</a></code>
221223

222-
## MarkAsRead
224+
## MarkAllAsRead
223225

224226
Types:
225227

226228
```python
227-
from onlyfansapi.types.chats import MarkAsReadAllResponse
229+
from onlyfansapi.types.chats import MarkAllAsReadAllResponse
228230
```
229231

230232
Methods:
231233

232-
- <code title="post /api/{account}/chats/mark-as-read">client.chats.mark_as_read.<a href="./src/onlyfansapi/resources/chats/mark_as_read.py">all</a>(account) -> <a href="./src/onlyfansapi/types/chats/mark_as_read_all_response.py">MarkAsReadAllResponse</a></code>
234+
- <code title="post /api/{account}/chats/mark-as-read">client.chats.mark_all_as_read.<a href="./src/onlyfansapi/resources/chats/mark_all_as_read.py">all</a>(account) -> <a href="./src/onlyfansapi/types/chats/mark_all_as_read_all_response.py">MarkAllAsReadAllResponse</a></code>
233235

234236
# Messages
235237

src/onlyfansapi/resources/chats/__init__.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616
MessagesResourceWithStreamingResponse,
1717
AsyncMessagesResourceWithStreamingResponse,
1818
)
19-
from .mark_as_read import (
20-
MarkAsReadResource,
21-
AsyncMarkAsReadResource,
22-
MarkAsReadResourceWithRawResponse,
23-
AsyncMarkAsReadResourceWithRawResponse,
24-
MarkAsReadResourceWithStreamingResponse,
25-
AsyncMarkAsReadResourceWithStreamingResponse,
19+
from .mark_all_as_read import (
20+
MarkAllAsReadResource,
21+
AsyncMarkAllAsReadResource,
22+
MarkAllAsReadResourceWithRawResponse,
23+
AsyncMarkAllAsReadResourceWithRawResponse,
24+
MarkAllAsReadResourceWithStreamingResponse,
25+
AsyncMarkAllAsReadResourceWithStreamingResponse,
2626
)
2727

2828
__all__ = [
@@ -32,12 +32,12 @@
3232
"AsyncMessagesResourceWithRawResponse",
3333
"MessagesResourceWithStreamingResponse",
3434
"AsyncMessagesResourceWithStreamingResponse",
35-
"MarkAsReadResource",
36-
"AsyncMarkAsReadResource",
37-
"MarkAsReadResourceWithRawResponse",
38-
"AsyncMarkAsReadResourceWithRawResponse",
39-
"MarkAsReadResourceWithStreamingResponse",
40-
"AsyncMarkAsReadResourceWithStreamingResponse",
35+
"MarkAllAsReadResource",
36+
"AsyncMarkAllAsReadResource",
37+
"MarkAllAsReadResourceWithRawResponse",
38+
"AsyncMarkAllAsReadResourceWithRawResponse",
39+
"MarkAllAsReadResourceWithStreamingResponse",
40+
"AsyncMarkAllAsReadResourceWithStreamingResponse",
4141
"ChatsResource",
4242
"AsyncChatsResource",
4343
"ChatsResourceWithRawResponse",

src/onlyfansapi/resources/chats/chats.py

Lines changed: 109 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,21 +26,22 @@
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-
)
3729
from ..._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+
)
3838
from ...types.chat_hide_response import ChatHideResponse
3939
from ...types.chat_list_response import ChatListResponse
4040
from ...types.chat_mute_response import ChatMuteResponse
4141
from ...types.chat_delete_response import ChatDeleteResponse
4242
from ...types.chat_unmute_response import ChatUnmuteResponse
4343
from ...types.chat_list_media_response import ChatListMediaResponse
44+
from ...types.chat_mark_as_read_response import ChatMarkAsReadResponse
4445
from ...types.chat_start_typing_response import ChatStartTypingResponse
4546
from ...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

836916
class 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

874957
class 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

912998
class 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

Comments
 (0)