Skip to content

Commit 4c4cfa1

Browse files
feat(api): api update
1 parent 0b55736 commit 4c4cfa1

17 files changed

Lines changed: 304 additions & 284 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-f92ae4fe2cbe0e40a4203678b0e818719b08ce7a689cef395885b634d2296918.yml
3-
openapi_spec_hash: fea736e41949abdeb6a786244046ad8a
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-0ccbed2a4e10a047b507bd5e365e4ece367a1592e55e85bb61803a610eec30e3.yml
3+
openapi_spec_hash: b49ac8c8ce9e05c81a82a6d3fe6be877
44
config_hash: 397c91e15c0024f8b5bbed9b82c2348c

‎src/onlyfansapi/resources/webhooks.py‎

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,19 @@ def create(
6767
Create a new webhook for your Team
6868
6969
Args:
70-
account_scope: The account scope for the webhook. Use "global" for all accounts, "inclusive"
71-
for only selected accounts, or "exclusive" for all except selected accounts.
70+
account_scope: The account scope for the webhook (OnlyFans and Fansly webhooks alike). Use
71+
"global" for all accounts, "inclusive" for only selected accounts, or
72+
"exclusive" for all except selected accounts.
7273
7374
endpoint_url: The URL of your webhook endpoint.
7475
7576
events: An array of webhook events to subscribe to. For all options, refer to our **List
76-
Available Events** endpoint.
77+
Available Events** endpoint. A webhook is single-platform: subscribe to either
78+
OnlyFans events or Fansly (`fansly.*`) events, never both in one webhook.
7779
78-
account_ids: An array of account IDs to apply the scope to. Required unless account_scope is
79-
"global".
80+
account_ids: An array of account IDs to apply the scope to. Use OnlyFans account IDs
81+
(`acct_...`) for OnlyFans webhooks and Fansly account IDs (`fansly_acct_...`)
82+
for Fansly webhooks. Required unless account_scope is "global".
8083
8184
signing_secret: Optionally, add a signing secret to protect your webhook.
8285
@@ -159,16 +162,19 @@ def update(
159162
Update an existing webhook
160163
161164
Args:
162-
account_scope: The account scope for the webhook. Use "global" for all accounts, "inclusive"
163-
for only selected accounts, or "exclusive" for all except selected accounts.
165+
account_scope: The account scope for the webhook (OnlyFans and Fansly webhooks alike). Use
166+
"global" for all accounts, "inclusive" for only selected accounts, or
167+
"exclusive" for all except selected accounts.
164168
165169
endpoint_url: The URL of your webhook endpoint.
166170
167171
events: An array of webhook events to subscribe to. For all options, refer to our **List
168-
Available Events** endpoint.
172+
Available Events** endpoint. A webhook is single-platform: subscribe to either
173+
OnlyFans events or Fansly (`fansly.*`) events, never both in one webhook.
169174
170-
account_ids: An array of account IDs to apply the scope to. Required unless account_scope is
171-
"global".
175+
account_ids: An array of account IDs to apply the scope to. Use OnlyFans account IDs
176+
(`acct_...`) for OnlyFans webhooks and Fansly account IDs (`fansly_acct_...`)
177+
for Fansly webhooks. Required unless account_scope is "global".
172178
173179
enabled: Optionally, enabled/disable the webhook. This will stop/resume the sending of
174180
events, without having to delete the webhook.
@@ -312,16 +318,19 @@ async def create(
312318
Create a new webhook for your Team
313319
314320
Args:
315-
account_scope: The account scope for the webhook. Use "global" for all accounts, "inclusive"
316-
for only selected accounts, or "exclusive" for all except selected accounts.
321+
account_scope: The account scope for the webhook (OnlyFans and Fansly webhooks alike). Use
322+
"global" for all accounts, "inclusive" for only selected accounts, or
323+
"exclusive" for all except selected accounts.
317324
318325
endpoint_url: The URL of your webhook endpoint.
319326
320327
events: An array of webhook events to subscribe to. For all options, refer to our **List
321-
Available Events** endpoint.
328+
Available Events** endpoint. A webhook is single-platform: subscribe to either
329+
OnlyFans events or Fansly (`fansly.*`) events, never both in one webhook.
322330
323-
account_ids: An array of account IDs to apply the scope to. Required unless account_scope is
324-
"global".
331+
account_ids: An array of account IDs to apply the scope to. Use OnlyFans account IDs
332+
(`acct_...`) for OnlyFans webhooks and Fansly account IDs (`fansly_acct_...`)
333+
for Fansly webhooks. Required unless account_scope is "global".
325334
326335
signing_secret: Optionally, add a signing secret to protect your webhook.
327336
@@ -404,16 +413,19 @@ async def update(
404413
Update an existing webhook
405414
406415
Args:
407-
account_scope: The account scope for the webhook. Use "global" for all accounts, "inclusive"
408-
for only selected accounts, or "exclusive" for all except selected accounts.
416+
account_scope: The account scope for the webhook (OnlyFans and Fansly webhooks alike). Use
417+
"global" for all accounts, "inclusive" for only selected accounts, or
418+
"exclusive" for all except selected accounts.
409419
410420
endpoint_url: The URL of your webhook endpoint.
411421
412422
events: An array of webhook events to subscribe to. For all options, refer to our **List
413-
Available Events** endpoint.
423+
Available Events** endpoint. A webhook is single-platform: subscribe to either
424+
OnlyFans events or Fansly (`fansly.*`) events, never both in one webhook.
414425
415-
account_ids: An array of account IDs to apply the scope to. Required unless account_scope is
416-
"global".
426+
account_ids: An array of account IDs to apply the scope to. Use OnlyFans account IDs
427+
(`acct_...`) for OnlyFans webhooks and Fansly account IDs (`fansly_acct_...`)
428+
for Fansly webhooks. Required unless account_scope is "global".
417429
418430
enabled: Optionally, enabled/disable the webhook. This will stop/resume the sending of
419431
events, without having to delete the webhook.

‎src/onlyfansapi/types/webhook_create_params.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class WebhookCreateParams(TypedDict, total=False):
1414
account_scope: Required[str]
15-
"""The account scope for the webhook.
15+
"""The account scope for the webhook (OnlyFans and Fansly webhooks alike).
1616
1717
Use "global" for all accounts, "inclusive" for only selected accounts, or
1818
"exclusive" for all except selected accounts.
@@ -24,13 +24,17 @@ class WebhookCreateParams(TypedDict, total=False):
2424
events: Required[SequenceNotStr[str]]
2525
"""An array of webhook events to subscribe to.
2626
27-
For all options, refer to our **List Available Events** endpoint.
27+
For all options, refer to our **List Available Events** endpoint. A webhook is
28+
single-platform: subscribe to either OnlyFans events or Fansly (`fansly.*`)
29+
events, never both in one webhook.
2830
"""
2931

3032
account_ids: SequenceNotStr[str]
3133
"""An array of account IDs to apply the scope to.
3234
33-
Required unless account_scope is "global".
35+
Use OnlyFans account IDs (`acct_...`) for OnlyFans webhooks and Fansly account
36+
IDs (`fansly_acct_...`) for Fansly webhooks. Required unless account_scope is
37+
"global".
3438
"""
3539

3640
signing_secret: Optional[str]

‎src/onlyfansapi/types/webhook_update_params.py‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
class WebhookUpdateParams(TypedDict, total=False):
1414
account_scope: Required[str]
15-
"""The account scope for the webhook.
15+
"""The account scope for the webhook (OnlyFans and Fansly webhooks alike).
1616
1717
Use "global" for all accounts, "inclusive" for only selected accounts, or
1818
"exclusive" for all except selected accounts.
@@ -24,13 +24,17 @@ class WebhookUpdateParams(TypedDict, total=False):
2424
events: Required[SequenceNotStr[str]]
2525
"""An array of webhook events to subscribe to.
2626
27-
For all options, refer to our **List Available Events** endpoint.
27+
For all options, refer to our **List Available Events** endpoint. A webhook is
28+
single-platform: subscribe to either OnlyFans events or Fansly (`fansly.*`)
29+
events, never both in one webhook.
2830
"""
2931

3032
account_ids: SequenceNotStr[str]
3133
"""An array of account IDs to apply the scope to.
3234
33-
Required unless account_scope is "global".
35+
Use OnlyFans account IDs (`acct_...`) for OnlyFans webhooks and Fansly account
36+
IDs (`fansly_acct_...`) for Fansly webhooks. Required unless account_scope is
37+
"global".
3438
"""
3539

3640
enabled: Optional[bool]

‎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="soluta",
27+
message_id="veritatis",
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="soluta",
36+
message_id="veritatis",
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="soluta",
50+
message_id="veritatis",
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="soluta",
63+
message_id="veritatis",
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="soluta",
79+
message_id="veritatis",
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="soluta",
151+
message_id="veritatis",
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="soluta",
160+
message_id="veritatis",
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="soluta",
174+
message_id="veritatis",
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="soluta",
187+
message_id="veritatis",
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="soluta",
203+
message_id="veritatis",
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="accusantium",
27+
list_id="labore",
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="accusantium",
37+
list_id="labore",
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="accusantium",
51+
list_id="labore",
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="accusantium",
68+
list_id="labore",
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="accusantium",
84+
list_id="labore",
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="accusantium",
94+
list_id="labore",
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="accusantium",
108+
list_id="labore",
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="accusantium",
125+
list_id="labore",
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="accusantium",
147+
list_id="labore",
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="accusantium",
157+
list_id="labore",
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="accusantium",
171+
list_id="labore",
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="accusantium",
188+
list_id="labore",
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="accusantium",
204+
list_id="labore",
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="accusantium",
214+
list_id="labore",
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="accusantium",
228+
list_id="labore",
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="accusantium",
245+
list_id="labore",
246246
account="",
247247
media_ids=["string"],
248248
)

0 commit comments

Comments
 (0)