Skip to content

Commit a2ac1bd

Browse files
feat(api): api update
1 parent 4bbfdd1 commit a2ac1bd

20 files changed

Lines changed: 287 additions & 269 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-901d18ae0073230cbc072f729528c17043fde31d4a7a993dd1d1ed1a786e9dce.yml
3-
openapi_spec_hash: ed64e03b24764680ba2d50c82d9cb426
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-7fb04b7318a956be18b88bb8ec2c972ef3225505d36876b1cabd703546d81590.yml
3+
openapi_spec_hash: 4d67fe9decba5dca8538c3a8e5bd584f
44
config_hash: 397c91e15c0024f8b5bbed9b82c2348c

src/onlyfansapi/resources/statistics/statistics.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ def get_subscriber_metrics(
184184
end_date: str,
185185
start_date: str,
186186
detailed: Optional[bool] | Omit = omit,
187+
detailed_type: Optional[Literal["total", "renew", "new"]] | Omit = omit,
187188
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
188189
# The extra values given here take precedence over values defined on the client or passed to this method.
189190
extra_headers: Headers | None = None,
@@ -204,6 +205,9 @@ def get_subscriber_metrics(
204205
detailed: Include paid and free fan metrics. Will slow down the response time, and might
205206
time out if timeframe is too large. Default = `false`
206207
208+
detailed_type: Use only with `detailed=true` - otherwise, it has no effect. Filter the
209+
subscriber statistics (default = total)
210+
207211
extra_headers: Send extra headers
208212
209213
extra_query: Add additional query parameters to the request
@@ -226,6 +230,7 @@ def get_subscriber_metrics(
226230
"end_date": end_date,
227231
"start_date": start_date,
228232
"detailed": detailed,
233+
"detailed_type": detailed_type,
229234
},
230235
statistic_get_subscriber_metrics_params.StatisticGetSubscriberMetricsParams,
231236
),
@@ -372,6 +377,7 @@ async def get_subscriber_metrics(
372377
end_date: str,
373378
start_date: str,
374379
detailed: Optional[bool] | Omit = omit,
380+
detailed_type: Optional[Literal["total", "renew", "new"]] | Omit = omit,
375381
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
376382
# The extra values given here take precedence over values defined on the client or passed to this method.
377383
extra_headers: Headers | None = None,
@@ -392,6 +398,9 @@ async def get_subscriber_metrics(
392398
detailed: Include paid and free fan metrics. Will slow down the response time, and might
393399
time out if timeframe is too large. Default = `false`
394400
401+
detailed_type: Use only with `detailed=true` - otherwise, it has no effect. Filter the
402+
subscriber statistics (default = total)
403+
395404
extra_headers: Send extra headers
396405
397406
extra_query: Add additional query parameters to the request
@@ -414,6 +423,7 @@ async def get_subscriber_metrics(
414423
"end_date": end_date,
415424
"start_date": start_date,
416425
"detailed": detailed,
426+
"detailed_type": detailed_type,
417427
},
418428
statistic_get_subscriber_metrics_params.StatisticGetSubscriberMetricsParams,
419429
),

src/onlyfansapi/types/statistic_get_subscriber_metrics_params.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
__all__ = ["StatisticGetSubscriberMetricsParams"]
99

@@ -21,3 +21,9 @@ class StatisticGetSubscriberMetricsParams(TypedDict, total=False):
2121
Will slow down the response time, and might time out if timeframe is too large.
2222
Default = `false`
2323
"""
24+
25+
detailed_type: Optional[Literal["total", "renew", "new"]]
26+
"""Use only with `detailed=true` - otherwise, it has no effect.
27+
28+
Filter the subscriber statistics (default = total)
29+
"""

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

0 commit comments

Comments
 (0)