Skip to content

Commit 021fb01

Browse files
feat(api): api update
1 parent 9888463 commit 021fb01

30 files changed

Lines changed: 496 additions & 478 deletions

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 266
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-c10e28d8a41faf5cc21a8d8660175932704d6f9ce4f74544554993f91ce8772c.yml
3-
openapi_spec_hash: d880cb4e4a8105f9bb48453cdd151fde
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-98f99bf644a3e5855dea42d567d86cc2d9150c1b96ee37dae3641b3af774a33e.yml
3+
openapi_spec_hash: df45bde0a256fd87ddf78b3775a0e050
44
config_hash: b35617df571c3e46d2e845c5e293f1c5

src/onlyfansapi/resources/analytics/financial/profitability.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def get_history(
4848
self,
4949
account: str,
5050
*,
51+
account_prefixed_id: str,
5152
months: int | Omit = omit,
5253
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5354
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -60,7 +61,10 @@ def get_history(
6061
Get historical profitability data for a specific account over multiple months.
6162
6263
Args:
63-
months: Number of months of history to retrieve (1-60, default 12)
64+
account_prefixed_id: The account prefixed ID.
65+
66+
months: Number of months of history to retrieve (1-60, default 12). Must be at least 1.
67+
Must not be greater than 60.
6468
6569
extra_headers: Send extra headers
6670
@@ -80,7 +84,11 @@ def get_history(
8084
extra_body=extra_body,
8185
timeout=timeout,
8286
query=maybe_transform(
83-
{"months": months}, profitability_get_history_params.ProfitabilityGetHistoryParams
87+
{
88+
"account_prefixed_id": account_prefixed_id,
89+
"months": months,
90+
},
91+
profitability_get_history_params.ProfitabilityGetHistoryParams,
8492
),
8593
),
8694
cast_to=ProfitabilityGetHistoryResponse,
@@ -161,6 +169,7 @@ async def get_history(
161169
self,
162170
account: str,
163171
*,
172+
account_prefixed_id: str,
164173
months: int | Omit = omit,
165174
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
166175
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -173,7 +182,10 @@ async def get_history(
173182
Get historical profitability data for a specific account over multiple months.
174183
175184
Args:
176-
months: Number of months of history to retrieve (1-60, default 12)
185+
account_prefixed_id: The account prefixed ID.
186+
187+
months: Number of months of history to retrieve (1-60, default 12). Must be at least 1.
188+
Must not be greater than 60.
177189
178190
extra_headers: Send extra headers
179191
@@ -193,7 +205,11 @@ async def get_history(
193205
extra_body=extra_body,
194206
timeout=timeout,
195207
query=await async_maybe_transform(
196-
{"months": months}, profitability_get_history_params.ProfitabilityGetHistoryParams
208+
{
209+
"account_prefixed_id": account_prefixed_id,
210+
"months": months,
211+
},
212+
profitability_get_history_params.ProfitabilityGetHistoryParams,
197213
),
198214
),
199215
cast_to=ProfitabilityGetHistoryResponse,

src/onlyfansapi/resources/chats/messages.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ def search(
325325
search query.
326326
327327
Args:
328-
query: The query search in messages
328+
query: The query search in messages.
329329
330330
extra_headers: Send extra headers
331331
@@ -820,7 +820,7 @@ async def search(
820820
search query.
821821
822822
Args:
823-
query: The query search in messages
823+
query: The query search in messages.
824824
825825
extra_headers: Send extra headers
826826

src/onlyfansapi/resources/fans/fans.py

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,10 @@ def list_latest(
311311
account: str,
312312
*,
313313
end_date: Optional[str] | Omit = omit,
314-
limit: Optional[str] | Omit = omit,
315-
offset: Optional[str] | Omit = omit,
314+
limit: int | Omit = omit,
315+
offset: int | Omit = omit,
316316
start_date: Optional[str] | Omit = omit,
317-
type: Optional[str] | Omit = omit,
317+
type: Optional[Literal["total", "renew", "new"]] | Omit = omit,
318318
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
319319
# The extra values given here take precedence over values defined on the client or passed to this method.
320320
extra_headers: Headers | None = None,
@@ -327,15 +327,18 @@ def list_latest(
327327
renewals. Newest fans are first.
328328
329329
Args:
330-
end_date: End date for filtering (required with start_date)
330+
end_date: End date for filtering (required with start_date). This field is required when
331+
<code>start_date</code> is present.
331332
332-
limit: Number of fans to return (1-50)
333+
limit: Number of fans to return (1-50). Must be at least 1. Must not be greater
334+
than 100.
333335
334-
offset: Number of fans to skip
336+
offset: Number of fans to skip. Must be at least 0.
335337
336-
start_date: Start date for filtering (required with end_date)
338+
start_date: Start date for filtering (required with end_date). This field is required when
339+
<code>end_date</code> is present.
337340
338-
type: Filter by type: total, renew, or new
341+
type: Filter by type: total, renew, or new.
339342
340343
extra_headers: Send extra headers
341344
@@ -725,10 +728,10 @@ async def list_latest(
725728
account: str,
726729
*,
727730
end_date: Optional[str] | Omit = omit,
728-
limit: Optional[str] | Omit = omit,
729-
offset: Optional[str] | Omit = omit,
731+
limit: int | Omit = omit,
732+
offset: int | Omit = omit,
730733
start_date: Optional[str] | Omit = omit,
731-
type: Optional[str] | Omit = omit,
734+
type: Optional[Literal["total", "renew", "new"]] | Omit = omit,
732735
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
733736
# The extra values given here take precedence over values defined on the client or passed to this method.
734737
extra_headers: Headers | None = None,
@@ -741,15 +744,18 @@ async def list_latest(
741744
renewals. Newest fans are first.
742745
743746
Args:
744-
end_date: End date for filtering (required with start_date)
747+
end_date: End date for filtering (required with start_date). This field is required when
748+
<code>start_date</code> is present.
745749
746-
limit: Number of fans to return (1-50)
750+
limit: Number of fans to return (1-50). Must be at least 1. Must not be greater
751+
than 100.
747752
748-
offset: Number of fans to skip
753+
offset: Number of fans to skip. Must be at least 0.
749754
750-
start_date: Start date for filtering (required with end_date)
755+
start_date: Start date for filtering (required with end_date). This field is required when
756+
<code>end_date</code> is present.
751757
752-
type: Filter by type: total, renew, or new
758+
type: Filter by type: total, renew, or new.
753759
754760
extra_headers: Send extra headers
755761

src/onlyfansapi/resources/smart_links.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
56
from typing_extensions import Literal
67

78
import httpx
@@ -154,10 +155,10 @@ def retrieve(
154155
def list(
155156
self,
156157
*,
157-
account_ids: str | Omit = omit,
158+
account_ids: Optional[str] | Omit = omit,
158159
limit: int | Omit = omit,
159-
meta_pixel_ids: str | Omit = omit,
160-
name: str | Omit = omit,
160+
meta_pixel_ids: Optional[str] | Omit = omit,
161+
name: Optional[str] | Omit = omit,
161162
offset: int | Omit = omit,
162163
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
163164
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -172,13 +173,14 @@ def list(
172173
Args:
173174
account_ids: Comma-separated account prefixed IDs to include.
174175
175-
limit: The number of Smart Links to return. Default `50`
176+
limit: The number of Smart Links to return. Default `50`. Must be at least 1. Must not
177+
be greater than 1000.
176178
177179
meta_pixel_ids: Comma-separated Meta Pixel IDs to include.
178180
179-
name: Filter Smart Links by name.
181+
name: Filter Smart Links by name. Must not be greater than 255 characters.
180182
181-
offset: The offset used for pagination. Default `0`
183+
offset: The offset used for pagination. Default `0`. Must be at least 0.
182184
183185
extra_headers: Send extra headers
184186
@@ -734,10 +736,10 @@ async def retrieve(
734736
async def list(
735737
self,
736738
*,
737-
account_ids: str | Omit = omit,
739+
account_ids: Optional[str] | Omit = omit,
738740
limit: int | Omit = omit,
739-
meta_pixel_ids: str | Omit = omit,
740-
name: str | Omit = omit,
741+
meta_pixel_ids: Optional[str] | Omit = omit,
742+
name: Optional[str] | Omit = omit,
741743
offset: int | Omit = omit,
742744
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
743745
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -752,13 +754,14 @@ async def list(
752754
Args:
753755
account_ids: Comma-separated account prefixed IDs to include.
754756
755-
limit: The number of Smart Links to return. Default `50`
757+
limit: The number of Smart Links to return. Default `50`. Must be at least 1. Must not
758+
be greater than 1000.
756759
757760
meta_pixel_ids: Comma-separated Meta Pixel IDs to include.
758761
759-
name: Filter Smart Links by name.
762+
name: Filter Smart Links by name. Must not be greater than 255 characters.
760763
761-
offset: The offset used for pagination. Default `0`
764+
offset: The offset used for pagination. Default `0`. Must be at least 0.
762765
763766
extra_headers: Send extra headers
764767

0 commit comments

Comments
 (0)