Skip to content

Commit 1797055

Browse files
feat(api): api update
1 parent d04955a commit 1797055

21 files changed

Lines changed: 322 additions & 300 deletions

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 265
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-311ea92e93accea58de461f512922cfb1a813d364efbe497445aeb4750787803.yml
3-
openapi_spec_hash: eb9fb6fad9ef96da57e0ce97487bec14
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-d5cb1f65c57690fa0181161b625fdd23296457354935ae3c865bb2d5f2d5b04c.yml
3+
openapi_spec_hash: 06c8fd48bd926beb1b1e7076a23f72fd
44
config_hash: 397c91e15c0024f8b5bbed9b82c2348c

‎src/onlyfansapi/resources/chats/messages.py‎

Lines changed: 42 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,17 @@ def list(
118118
) -> MessageListResponse:
119119
"""Get messages from a specific chat.
120120
121-
Args:
122-
filter: Filter by certain messages.
121+
Use `filter=pinned` or
122+
[List Pinned Chat Messages](https://docs.onlyfansapi.com/api-reference/chat-messages/list-pinned-chat-messages)
123+
to retrieve only pinned messages. Follow `_pagination.next_page` until it is
124+
null; a short page can still have more results.
123125
124-
Currently, only pins are filterable.
126+
Args:
127+
filter: Filter by certain messages. Currently, only pins are filterable.
125128
126-
first_id: Use for pagination when `order=desc` (newest to oldest). Include this message ID
127-
as the first message in the results. Used to retrieve messages from e.g. the
128-
Search Chat Messages endpoint IDs.
129+
first_id: Use for pagination when `order=desc` (newest to oldest). Pass the last message
130+
ID from the previous page to retrieve older messages, excluding that cursor
131+
message.
129132
130133
last_id: Use for pagination when `order=asc` (oldest to newest). Include this message ID
131134
as the first message in the results. WARNING! The response list of messages will
@@ -275,8 +278,12 @@ def pin(
275278
extra_body: Body | None = None,
276279
timeout: float | httpx.Timeout | None | NotGiven = not_given,
277280
) -> MessagePinResponse:
278-
"""
279-
Pin a message from a chat.
281+
"""Pin a message from a chat.
282+
283+
Requires API-key write permission. No request body is
284+
needed. Use
285+
[List Pinned Chat Messages](https://docs.onlyfansapi.com/api-reference/chat-messages/list-pinned-chat-messages)
286+
to read the current pins.
280287
281288
Args:
282289
extra_headers: Send extra headers
@@ -528,8 +535,12 @@ def unpin(
528535
extra_body: Body | None = None,
529536
timeout: float | httpx.Timeout | None | NotGiven = not_given,
530537
) -> MessageUnpinResponse:
531-
"""
532-
Unpin a message from a chat.
538+
"""Unpin a message from a chat.
539+
540+
Requires API-key delete permission; a read_write
541+
key cannot unpin. No request body is needed. Use
542+
[List Pinned Chat Messages](https://docs.onlyfansapi.com/api-reference/chat-messages/list-pinned-chat-messages)
543+
to read the current pins.
533544
534545
Args:
535546
extra_headers: Send extra headers
@@ -646,14 +657,17 @@ async def list(
646657
) -> MessageListResponse:
647658
"""Get messages from a specific chat.
648659
649-
Args:
650-
filter: Filter by certain messages.
660+
Use `filter=pinned` or
661+
[List Pinned Chat Messages](https://docs.onlyfansapi.com/api-reference/chat-messages/list-pinned-chat-messages)
662+
to retrieve only pinned messages. Follow `_pagination.next_page` until it is
663+
null; a short page can still have more results.
651664
652-
Currently, only pins are filterable.
665+
Args:
666+
filter: Filter by certain messages. Currently, only pins are filterable.
653667
654-
first_id: Use for pagination when `order=desc` (newest to oldest). Include this message ID
655-
as the first message in the results. Used to retrieve messages from e.g. the
656-
Search Chat Messages endpoint IDs.
668+
first_id: Use for pagination when `order=desc` (newest to oldest). Pass the last message
669+
ID from the previous page to retrieve older messages, excluding that cursor
670+
message.
657671
658672
last_id: Use for pagination when `order=asc` (oldest to newest). Include this message ID
659673
as the first message in the results. WARNING! The response list of messages will
@@ -803,8 +817,12 @@ async def pin(
803817
extra_body: Body | None = None,
804818
timeout: float | httpx.Timeout | None | NotGiven = not_given,
805819
) -> MessagePinResponse:
806-
"""
807-
Pin a message from a chat.
820+
"""Pin a message from a chat.
821+
822+
Requires API-key write permission. No request body is
823+
needed. Use
824+
[List Pinned Chat Messages](https://docs.onlyfansapi.com/api-reference/chat-messages/list-pinned-chat-messages)
825+
to read the current pins.
808826
809827
Args:
810828
extra_headers: Send extra headers
@@ -1056,8 +1074,12 @@ async def unpin(
10561074
extra_body: Body | None = None,
10571075
timeout: float | httpx.Timeout | None | NotGiven = not_given,
10581076
) -> MessageUnpinResponse:
1059-
"""
1060-
Unpin a message from a chat.
1077+
"""Unpin a message from a chat.
1078+
1079+
Requires API-key delete permission; a read_write
1080+
key cannot unpin. No request body is needed. Use
1081+
[List Pinned Chat Messages](https://docs.onlyfansapi.com/api-reference/chat-messages/list-pinned-chat-messages)
1082+
to read the current pins.
10611083
10621084
Args:
10631085
extra_headers: Send extra headers

‎src/onlyfansapi/types/chats/message_list_params.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ class MessageListParams(TypedDict, total=False):
1717
first_id: Optional[str]
1818
"""Use for pagination when `order=desc` (newest to oldest).
1919
20-
Include this message ID as the first message in the results. Used to retrieve
21-
messages from e.g. the Search Chat Messages endpoint IDs.
20+
Pass the last message ID from the previous page to retrieve older messages,
21+
excluding that cursor message.
2222
"""
2323

2424
last_id: Optional[str]

‎tests/api_resources/engagement/test_messages.py‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TestMessages:
2424
@parametrize
2525
def test_method_get_message_buyers(self, client: OnlyFansAPI) -> None:
2626
message = client.engagement.messages.get_message_buyers(
27-
message_id="veritatis",
27+
message_id="natus",
2828
account="acct_XXXXXXXXXXXXXXX",
2929
)
3030
assert_matches_type(MessageGetMessageBuyersResponse, message, path=["response"])
@@ -33,7 +33,7 @@ def test_method_get_message_buyers(self, client: OnlyFansAPI) -> None:
3333
@parametrize
3434
def test_method_get_message_buyers_with_all_params(self, client: OnlyFansAPI) -> None:
3535
message = client.engagement.messages.get_message_buyers(
36-
message_id="veritatis",
36+
message_id="natus",
3737
account="acct_XXXXXXXXXXXXXXX",
3838
limit=10,
3939
marker=0,
@@ -47,7 +47,7 @@ def test_method_get_message_buyers_with_all_params(self, client: OnlyFansAPI) ->
4747
@parametrize
4848
def test_raw_response_get_message_buyers(self, client: OnlyFansAPI) -> None:
4949
response = client.engagement.messages.with_raw_response.get_message_buyers(
50-
message_id="veritatis",
50+
message_id="natus",
5151
account="acct_XXXXXXXXXXXXXXX",
5252
)
5353

@@ -60,7 +60,7 @@ def test_raw_response_get_message_buyers(self, client: OnlyFansAPI) -> None:
6060
@parametrize
6161
def test_streaming_response_get_message_buyers(self, client: OnlyFansAPI) -> None:
6262
with client.engagement.messages.with_streaming_response.get_message_buyers(
63-
message_id="veritatis",
63+
message_id="natus",
6464
account="acct_XXXXXXXXXXXXXXX",
6565
) as response:
6666
assert not response.is_closed
@@ -76,7 +76,7 @@ def test_streaming_response_get_message_buyers(self, client: OnlyFansAPI) -> Non
7676
def test_path_params_get_message_buyers(self, client: OnlyFansAPI) -> None:
7777
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account` but received ''"):
7878
client.engagement.messages.with_raw_response.get_message_buyers(
79-
message_id="veritatis",
79+
message_id="natus",
8080
account="",
8181
)
8282

@@ -148,7 +148,7 @@ class TestAsyncMessages:
148148
@parametrize
149149
async def test_method_get_message_buyers(self, async_client: AsyncOnlyFansAPI) -> None:
150150
message = await async_client.engagement.messages.get_message_buyers(
151-
message_id="veritatis",
151+
message_id="natus",
152152
account="acct_XXXXXXXXXXXXXXX",
153153
)
154154
assert_matches_type(MessageGetMessageBuyersResponse, message, path=["response"])
@@ -157,7 +157,7 @@ async def test_method_get_message_buyers(self, async_client: AsyncOnlyFansAPI) -
157157
@parametrize
158158
async def test_method_get_message_buyers_with_all_params(self, async_client: AsyncOnlyFansAPI) -> None:
159159
message = await async_client.engagement.messages.get_message_buyers(
160-
message_id="veritatis",
160+
message_id="natus",
161161
account="acct_XXXXXXXXXXXXXXX",
162162
limit=10,
163163
marker=0,
@@ -171,7 +171,7 @@ async def test_method_get_message_buyers_with_all_params(self, async_client: Asy
171171
@parametrize
172172
async def test_raw_response_get_message_buyers(self, async_client: AsyncOnlyFansAPI) -> None:
173173
response = await async_client.engagement.messages.with_raw_response.get_message_buyers(
174-
message_id="veritatis",
174+
message_id="natus",
175175
account="acct_XXXXXXXXXXXXXXX",
176176
)
177177

@@ -184,7 +184,7 @@ async def test_raw_response_get_message_buyers(self, async_client: AsyncOnlyFans
184184
@parametrize
185185
async def test_streaming_response_get_message_buyers(self, async_client: AsyncOnlyFansAPI) -> None:
186186
async with async_client.engagement.messages.with_streaming_response.get_message_buyers(
187-
message_id="veritatis",
187+
message_id="natus",
188188
account="acct_XXXXXXXXXXXXXXX",
189189
) as response:
190190
assert not response.is_closed
@@ -200,7 +200,7 @@ async def test_streaming_response_get_message_buyers(self, async_client: AsyncOn
200200
async def test_path_params_get_message_buyers(self, async_client: AsyncOnlyFansAPI) -> None:
201201
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account` but received ''"):
202202
await async_client.engagement.messages.with_raw_response.get_message_buyers(
203-
message_id="veritatis",
203+
message_id="natus",
204204
account="",
205205
)
206206

‎tests/api_resources/media/vault/lists/test_media.py‎

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TestMedia:
2424
@parametrize
2525
def test_method_add(self, client: OnlyFansAPI) -> None:
2626
media = client.media.vault.lists.media.add(
27-
list_id="maiores",
27+
list_id="accusamus",
2828
account="acct_XXXXXXXXXXXXXXX",
2929
media_ids=["string"],
3030
)
@@ -34,7 +34,7 @@ def test_method_add(self, client: OnlyFansAPI) -> None:
3434
@parametrize
3535
def test_raw_response_add(self, client: OnlyFansAPI) -> None:
3636
response = client.media.vault.lists.media.with_raw_response.add(
37-
list_id="maiores",
37+
list_id="accusamus",
3838
account="acct_XXXXXXXXXXXXXXX",
3939
media_ids=["string"],
4040
)
@@ -48,7 +48,7 @@ def test_raw_response_add(self, client: OnlyFansAPI) -> None:
4848
@parametrize
4949
def test_streaming_response_add(self, client: OnlyFansAPI) -> None:
5050
with client.media.vault.lists.media.with_streaming_response.add(
51-
list_id="maiores",
51+
list_id="accusamus",
5252
account="acct_XXXXXXXXXXXXXXX",
5353
media_ids=["string"],
5454
) as response:
@@ -65,7 +65,7 @@ def test_streaming_response_add(self, client: OnlyFansAPI) -> None:
6565
def test_path_params_add(self, client: OnlyFansAPI) -> None:
6666
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account` but received ''"):
6767
client.media.vault.lists.media.with_raw_response.add(
68-
list_id="maiores",
68+
list_id="accusamus",
6969
account="",
7070
media_ids=["string"],
7171
)
@@ -81,7 +81,7 @@ def test_path_params_add(self, client: OnlyFansAPI) -> None:
8181
@parametrize
8282
def test_method_remove(self, client: OnlyFansAPI) -> None:
8383
media = client.media.vault.lists.media.remove(
84-
list_id="maiores",
84+
list_id="accusamus",
8585
account="acct_XXXXXXXXXXXXXXX",
8686
media_ids=["string"],
8787
)
@@ -91,7 +91,7 @@ def test_method_remove(self, client: OnlyFansAPI) -> None:
9191
@parametrize
9292
def test_raw_response_remove(self, client: OnlyFansAPI) -> None:
9393
response = client.media.vault.lists.media.with_raw_response.remove(
94-
list_id="maiores",
94+
list_id="accusamus",
9595
account="acct_XXXXXXXXXXXXXXX",
9696
media_ids=["string"],
9797
)
@@ -105,7 +105,7 @@ def test_raw_response_remove(self, client: OnlyFansAPI) -> None:
105105
@parametrize
106106
def test_streaming_response_remove(self, client: OnlyFansAPI) -> None:
107107
with client.media.vault.lists.media.with_streaming_response.remove(
108-
list_id="maiores",
108+
list_id="accusamus",
109109
account="acct_XXXXXXXXXXXXXXX",
110110
media_ids=["string"],
111111
) as response:
@@ -122,7 +122,7 @@ def test_streaming_response_remove(self, client: OnlyFansAPI) -> None:
122122
def test_path_params_remove(self, client: OnlyFansAPI) -> None:
123123
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account` but received ''"):
124124
client.media.vault.lists.media.with_raw_response.remove(
125-
list_id="maiores",
125+
list_id="accusamus",
126126
account="",
127127
media_ids=["string"],
128128
)
@@ -144,7 +144,7 @@ class TestAsyncMedia:
144144
@parametrize
145145
async def test_method_add(self, async_client: AsyncOnlyFansAPI) -> None:
146146
media = await async_client.media.vault.lists.media.add(
147-
list_id="maiores",
147+
list_id="accusamus",
148148
account="acct_XXXXXXXXXXXXXXX",
149149
media_ids=["string"],
150150
)
@@ -154,7 +154,7 @@ async def test_method_add(self, async_client: AsyncOnlyFansAPI) -> None:
154154
@parametrize
155155
async def test_raw_response_add(self, async_client: AsyncOnlyFansAPI) -> None:
156156
response = await async_client.media.vault.lists.media.with_raw_response.add(
157-
list_id="maiores",
157+
list_id="accusamus",
158158
account="acct_XXXXXXXXXXXXXXX",
159159
media_ids=["string"],
160160
)
@@ -168,7 +168,7 @@ async def test_raw_response_add(self, async_client: AsyncOnlyFansAPI) -> None:
168168
@parametrize
169169
async def test_streaming_response_add(self, async_client: AsyncOnlyFansAPI) -> None:
170170
async with async_client.media.vault.lists.media.with_streaming_response.add(
171-
list_id="maiores",
171+
list_id="accusamus",
172172
account="acct_XXXXXXXXXXXXXXX",
173173
media_ids=["string"],
174174
) as response:
@@ -185,7 +185,7 @@ async def test_streaming_response_add(self, async_client: AsyncOnlyFansAPI) -> N
185185
async def test_path_params_add(self, async_client: AsyncOnlyFansAPI) -> None:
186186
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account` but received ''"):
187187
await async_client.media.vault.lists.media.with_raw_response.add(
188-
list_id="maiores",
188+
list_id="accusamus",
189189
account="",
190190
media_ids=["string"],
191191
)
@@ -201,7 +201,7 @@ async def test_path_params_add(self, async_client: AsyncOnlyFansAPI) -> None:
201201
@parametrize
202202
async def test_method_remove(self, async_client: AsyncOnlyFansAPI) -> None:
203203
media = await async_client.media.vault.lists.media.remove(
204-
list_id="maiores",
204+
list_id="accusamus",
205205
account="acct_XXXXXXXXXXXXXXX",
206206
media_ids=["string"],
207207
)
@@ -211,7 +211,7 @@ async def test_method_remove(self, async_client: AsyncOnlyFansAPI) -> None:
211211
@parametrize
212212
async def test_raw_response_remove(self, async_client: AsyncOnlyFansAPI) -> None:
213213
response = await async_client.media.vault.lists.media.with_raw_response.remove(
214-
list_id="maiores",
214+
list_id="accusamus",
215215
account="acct_XXXXXXXXXXXXXXX",
216216
media_ids=["string"],
217217
)
@@ -225,7 +225,7 @@ async def test_raw_response_remove(self, async_client: AsyncOnlyFansAPI) -> None
225225
@parametrize
226226
async def test_streaming_response_remove(self, async_client: AsyncOnlyFansAPI) -> None:
227227
async with async_client.media.vault.lists.media.with_streaming_response.remove(
228-
list_id="maiores",
228+
list_id="accusamus",
229229
account="acct_XXXXXXXXXXXXXXX",
230230
media_ids=["string"],
231231
) as response:
@@ -242,7 +242,7 @@ async def test_streaming_response_remove(self, async_client: AsyncOnlyFansAPI) -
242242
async def test_path_params_remove(self, async_client: AsyncOnlyFansAPI) -> None:
243243
with pytest.raises(ValueError, match=r"Expected a non-empty value for `account` but received ''"):
244244
await async_client.media.vault.lists.media.with_raw_response.remove(
245-
list_id="maiores",
245+
list_id="accusamus",
246246
account="",
247247
media_ids=["string"],
248248
)

0 commit comments

Comments
 (0)