Skip to content

Commit 89c4de4

Browse files
feat(api): api update
1 parent d0e5322 commit 89c4de4

22 files changed

Lines changed: 373 additions & 313 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-02449c7bd0ee06a1b5581c42d74655e56bd85c35f6d15f866331750c288a3221.yml
3-
openapi_spec_hash: 9d4de106d4e6df753ada574f4c637d28
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-f140a250991f032346b7608fc1537772544176a5415f903ea8c1575bd526f21c.yml
3+
openapi_spec_hash: 8d2af7aeb4b1adf6e44d2314ff7cab03
44
config_hash: 397c91e15c0024f8b5bbed9b82c2348c

src/onlyfansapi/resources/mass_messaging.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ def retrieve(
6262
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6363
) -> MassMessagingRetrieveResponse:
6464
"""
65-
Get the content of a mass message.
65+
Get the content and settings of a mass message, including a message scheduled
66+
for later.
6667
6768
Args:
6869
extra_headers: Send extra headers
@@ -108,7 +109,8 @@ def update(
108109
timeout: float | httpx.Timeout | None | NotGiven = not_given,
109110
) -> MassMessagingUpdateResponse:
110111
"""
111-
Update a mass message.
112+
Update the content, recipients, media, price, or scheduled send time of an
113+
existing mass message.
112114
113115
Args:
114116
text: The message text content
@@ -185,8 +187,10 @@ def list(
185187
extra_body: Body | None = None,
186188
timeout: float | httpx.Timeout | None | NotGiven = not_given,
187189
) -> MassMessagingListResponse:
188-
"""
189-
List the pending or recently sent mass messages in the message queue.
190+
"""List pending, scheduled, and recently sent mass messages.
191+
192+
Use an item ID to
193+
retrieve, update, reschedule, delete, or unsend the message.
190194
191195
Args:
192196
extra_headers: Send extra headers
@@ -446,7 +450,8 @@ async def retrieve(
446450
timeout: float | httpx.Timeout | None | NotGiven = not_given,
447451
) -> MassMessagingRetrieveResponse:
448452
"""
449-
Get the content of a mass message.
453+
Get the content and settings of a mass message, including a message scheduled
454+
for later.
450455
451456
Args:
452457
extra_headers: Send extra headers
@@ -492,7 +497,8 @@ async def update(
492497
timeout: float | httpx.Timeout | None | NotGiven = not_given,
493498
) -> MassMessagingUpdateResponse:
494499
"""
495-
Update a mass message.
500+
Update the content, recipients, media, price, or scheduled send time of an
501+
existing mass message.
496502
497503
Args:
498504
text: The message text content
@@ -569,8 +575,10 @@ async def list(
569575
extra_body: Body | None = None,
570576
timeout: float | httpx.Timeout | None | NotGiven = not_given,
571577
) -> MassMessagingListResponse:
572-
"""
573-
List the pending or recently sent mass messages in the message queue.
578+
"""List pending, scheduled, and recently sent mass messages.
579+
580+
Use an item ID to
581+
retrieve, update, reschedule, delete, or unsend the message.
574582
575583
Args:
576584
extra_headers: Send extra headers

src/onlyfansapi/resources/queue.py

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22

33
from __future__ import annotations
44

5+
from typing import List
6+
from typing_extensions import Literal
7+
58
import httpx
69

710
from ..types import queue_list_params, queue_count_params
8-
from .._types import Body, Query, Headers, NotGiven, not_given
11+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
912
from .._utils import path_template, maybe_transform, async_maybe_transform
1013
from .._compat import cached_property
1114
from .._resource import SyncAPIResource, AsyncAPIResource
@@ -47,29 +50,36 @@ def list(
4750
self,
4851
account: str,
4952
*,
50-
limit: int,
5153
publish_date_end: str,
5254
publish_date_start: str,
5355
timezone: str,
56+
limit: int | Omit = omit,
57+
type: List[Literal["chat", "post"]] | Omit = omit,
5458
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5559
# The extra values given here take precedence over values defined on the client or passed to this method.
5660
extra_headers: Headers | None = None,
5761
extra_query: Query | None = None,
5862
extra_body: Body | None = None,
5963
timeout: float | httpx.Timeout | None | NotGiven = not_given,
6064
) -> QueueListResponse:
61-
"""
62-
List posts and messages in the queue.
65+
"""List scheduled posts and mass messages for a date range.
66+
67+
Use the type filter to
68+
return only posts, messages, or both.
6369
6470
Args:
65-
limit: Maximum number of queue items to return (default = 20)
71+
publish_date_end: Latest publish date to return. Must be a valid date. Must be a valid date. Must
72+
be a date after or equal to <code>publishDateStart</code>.
6673
67-
publish_date_end: Latest publish date to return
74+
publish_date_start: Earliest publish date to return (must be at least today). Must be a valid date.
75+
Must be a valid date. Must be a date after or equal to <code>today</code>.
6876
69-
publish_date_start: Earliest publish date to return (must be at least today)
77+
timezone: Timezone of the provided dates.
78+
[View available timezone values](https://www.php.net/manual/en/timezones.php).
79+
Must be a valid time zone, such as <code>Africa/Accra</code>.
7080
71-
timezone: Time timezone of the provided dates.
72-
[View available timezone values](https://www.php.net/manual/en/timezones.php)
81+
limit: Maximum number of queue items to return (default 20). Must be at least 1. Must
82+
not be greater than 100.
7383
7484
extra_headers: Send extra headers
7585
@@ -90,10 +100,11 @@ def list(
90100
timeout=timeout,
91101
query=maybe_transform(
92102
{
93-
"limit": limit,
94103
"publish_date_end": publish_date_end,
95104
"publish_date_start": publish_date_start,
96105
"timezone": timezone,
106+
"limit": limit,
107+
"type": type,
97108
},
98109
queue_list_params.QueueListParams,
99110
),
@@ -218,29 +229,36 @@ async def list(
218229
self,
219230
account: str,
220231
*,
221-
limit: int,
222232
publish_date_end: str,
223233
publish_date_start: str,
224234
timezone: str,
235+
limit: int | Omit = omit,
236+
type: List[Literal["chat", "post"]] | Omit = omit,
225237
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
226238
# The extra values given here take precedence over values defined on the client or passed to this method.
227239
extra_headers: Headers | None = None,
228240
extra_query: Query | None = None,
229241
extra_body: Body | None = None,
230242
timeout: float | httpx.Timeout | None | NotGiven = not_given,
231243
) -> QueueListResponse:
232-
"""
233-
List posts and messages in the queue.
244+
"""List scheduled posts and mass messages for a date range.
245+
246+
Use the type filter to
247+
return only posts, messages, or both.
234248
235249
Args:
236-
limit: Maximum number of queue items to return (default = 20)
250+
publish_date_end: Latest publish date to return. Must be a valid date. Must be a valid date. Must
251+
be a date after or equal to <code>publishDateStart</code>.
237252
238-
publish_date_end: Latest publish date to return
253+
publish_date_start: Earliest publish date to return (must be at least today). Must be a valid date.
254+
Must be a valid date. Must be a date after or equal to <code>today</code>.
239255
240-
publish_date_start: Earliest publish date to return (must be at least today)
256+
timezone: Timezone of the provided dates.
257+
[View available timezone values](https://www.php.net/manual/en/timezones.php).
258+
Must be a valid time zone, such as <code>Africa/Accra</code>.
241259
242-
timezone: Time timezone of the provided dates.
243-
[View available timezone values](https://www.php.net/manual/en/timezones.php)
260+
limit: Maximum number of queue items to return (default 20). Must be at least 1. Must
261+
not be greater than 100.
244262
245263
extra_headers: Send extra headers
246264
@@ -261,10 +279,11 @@ async def list(
261279
timeout=timeout,
262280
query=await async_maybe_transform(
263281
{
264-
"limit": limit,
265282
"publish_date_end": publish_date_end,
266283
"publish_date_start": publish_date_start,
267284
"timezone": timezone,
285+
"limit": limit,
286+
"type": type,
268287
},
269288
queue_list_params.QueueListParams,
270289
),

src/onlyfansapi/types/queue_list_params.py

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,40 @@
22

33
from __future__ import annotations
44

5-
from typing_extensions import Required, Annotated, TypedDict
5+
from typing import List
6+
from typing_extensions import Literal, Required, Annotated, TypedDict
67

78
from .._utils import PropertyInfo
89

910
__all__ = ["QueueListParams"]
1011

1112

1213
class QueueListParams(TypedDict, total=False):
13-
limit: Required[int]
14-
"""Maximum number of queue items to return (default = 20)"""
15-
1614
publish_date_end: Required[Annotated[str, PropertyInfo(alias="publishDateEnd")]]
17-
"""Latest publish date to return"""
15+
"""Latest publish date to return.
16+
17+
Must be a valid date. Must be a valid date. Must be a date after or equal to
18+
<code>publishDateStart</code>.
19+
"""
1820

1921
publish_date_start: Required[Annotated[str, PropertyInfo(alias="publishDateStart")]]
20-
"""Earliest publish date to return (must be at least today)"""
22+
"""Earliest publish date to return (must be at least today).
23+
24+
Must be a valid date. Must be a valid date. Must be a date after or equal to
25+
<code>today</code>.
26+
"""
2127

2228
timezone: Required[str]
23-
"""Time timezone of the provided dates.
29+
"""Timezone of the provided dates.
2430
25-
[View available timezone values](https://www.php.net/manual/en/timezones.php)
31+
[View available timezone values](https://www.php.net/manual/en/timezones.php).
32+
Must be a valid time zone, such as <code>Africa/Accra</code>.
2633
"""
34+
35+
limit: int
36+
"""Maximum number of queue items to return (default 20).
37+
38+
Must be at least 1. Must not be greater than 100.
39+
"""
40+
41+
type: List[Literal["chat", "post"]]

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="maiores",
27+
message_id="eos",
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="maiores",
36+
message_id="eos",
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="maiores",
50+
message_id="eos",
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="maiores",
63+
message_id="eos",
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="maiores",
79+
message_id="eos",
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="maiores",
151+
message_id="eos",
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="maiores",
160+
message_id="eos",
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="maiores",
174+
message_id="eos",
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="maiores",
187+
message_id="eos",
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="maiores",
203+
message_id="eos",
204204
account="",
205205
)
206206

0 commit comments

Comments
 (0)