Skip to content

Commit 6b9ad4e

Browse files
feat(api): api update
1 parent 98a84e7 commit 6b9ad4e

22 files changed

Lines changed: 461 additions & 262 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-bee7507b20d149239fdbacb3de6b342dcefd08eefeabf1fd35d38cd898264298.yml
3-
openapi_spec_hash: 6fe4334c602d4eaeef46c509545a17b3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/onlyfansapi/onlyfansapi-5a86517cb84478db1099c218ff317bf61ec3b1a0e6b5559f18d86724c714c460.yml
3+
openapi_spec_hash: ef07d9eb4d7cb67521c6e7a82cb3cc5e
44
config_hash: 397c91e15c0024f8b5bbed9b82c2348c

src/onlyfansapi/resources/smart_link_postbacks.py

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Optional
5+
from typing import Iterable, Optional
66
from typing_extensions import Literal
77

88
import httpx
@@ -56,6 +56,9 @@ def create(
5656
conversion_types: SequenceNotStr[str],
5757
smart_link_scope: Literal["global", "campaign_specific"],
5858
url: str,
59+
body: str | Omit = omit,
60+
headers: Iterable[smart_link_postback_create_params.Header] | Omit = omit,
61+
http_method: Literal["GET", "POST"] | Omit = omit,
5962
smart_link_ids: SequenceNotStr[str] | Omit = omit,
6063
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
6164
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -76,6 +79,13 @@ def create(
7679
url: The destination URL. Variables such as `{external_click_id}`, `{fbclid}`,
7780
`{gclid}`, and `{ttclid}` are replaced when the postback is dispatched.
7881
82+
body: Optional request body template for POST postbacks. Variables are replaced when
83+
the postback is dispatched.
84+
85+
headers: Optional request headers. Header values may include postback variables.
86+
87+
http_method: HTTP method used for the postback request. Defaults to `GET` when omitted.
88+
7989
smart_link_ids: Smart Link ULIDs. Required when `smart_link_scope` is `campaign_specific`.
8090
8191
extra_headers: Send extra headers
@@ -93,6 +103,9 @@ def create(
93103
"conversion_types": conversion_types,
94104
"smart_link_scope": smart_link_scope,
95105
"url": url,
106+
"body": body,
107+
"headers": headers,
108+
"http_method": http_method,
96109
"smart_link_ids": smart_link_ids,
97110
},
98111
smart_link_postback_create_params.SmartLinkPostbackCreateParams,
@@ -141,6 +154,9 @@ def update(
141154
conversion_types: SequenceNotStr[str],
142155
smart_link_scope: Literal["global", "campaign_specific"],
143156
url: str,
157+
body: str | Omit = omit,
158+
headers: Iterable[smart_link_postback_update_params.Header] | Omit = omit,
159+
http_method: Literal["GET", "POST"] | Omit = omit,
144160
smart_link_ids: SequenceNotStr[str] | Omit = omit,
145161
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
146162
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -159,6 +175,13 @@ def update(
159175
160176
url: The destination URL.
161177
178+
body: Optional request body template for POST postbacks. Variables are replaced when
179+
the postback is dispatched.
180+
181+
headers: Optional request headers. Header values may include postback variables.
182+
183+
http_method: HTTP method used for the postback request. Existing value is kept when omitted.
184+
162185
smart_link_ids: Smart Link ULIDs. Required when `smart_link_scope` is `campaign_specific`.
163186
164187
extra_headers: Send extra headers
@@ -176,6 +199,9 @@ def update(
176199
"conversion_types": conversion_types,
177200
"smart_link_scope": smart_link_scope,
178201
"url": url,
202+
"body": body,
203+
"headers": headers,
204+
"http_method": http_method,
179205
"smart_link_ids": smart_link_ids,
180206
},
181207
smart_link_postback_update_params.SmartLinkPostbackUpdateParams,
@@ -265,6 +291,9 @@ async def create(
265291
conversion_types: SequenceNotStr[str],
266292
smart_link_scope: Literal["global", "campaign_specific"],
267293
url: str,
294+
body: str | Omit = omit,
295+
headers: Iterable[smart_link_postback_create_params.Header] | Omit = omit,
296+
http_method: Literal["GET", "POST"] | Omit = omit,
268297
smart_link_ids: SequenceNotStr[str] | Omit = omit,
269298
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
270299
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -285,6 +314,13 @@ async def create(
285314
url: The destination URL. Variables such as `{external_click_id}`, `{fbclid}`,
286315
`{gclid}`, and `{ttclid}` are replaced when the postback is dispatched.
287316
317+
body: Optional request body template for POST postbacks. Variables are replaced when
318+
the postback is dispatched.
319+
320+
headers: Optional request headers. Header values may include postback variables.
321+
322+
http_method: HTTP method used for the postback request. Defaults to `GET` when omitted.
323+
288324
smart_link_ids: Smart Link ULIDs. Required when `smart_link_scope` is `campaign_specific`.
289325
290326
extra_headers: Send extra headers
@@ -302,6 +338,9 @@ async def create(
302338
"conversion_types": conversion_types,
303339
"smart_link_scope": smart_link_scope,
304340
"url": url,
341+
"body": body,
342+
"headers": headers,
343+
"http_method": http_method,
305344
"smart_link_ids": smart_link_ids,
306345
},
307346
smart_link_postback_create_params.SmartLinkPostbackCreateParams,
@@ -350,6 +389,9 @@ async def update(
350389
conversion_types: SequenceNotStr[str],
351390
smart_link_scope: Literal["global", "campaign_specific"],
352391
url: str,
392+
body: str | Omit = omit,
393+
headers: Iterable[smart_link_postback_update_params.Header] | Omit = omit,
394+
http_method: Literal["GET", "POST"] | Omit = omit,
353395
smart_link_ids: SequenceNotStr[str] | Omit = omit,
354396
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
355397
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -368,6 +410,13 @@ async def update(
368410
369411
url: The destination URL.
370412
413+
body: Optional request body template for POST postbacks. Variables are replaced when
414+
the postback is dispatched.
415+
416+
headers: Optional request headers. Header values may include postback variables.
417+
418+
http_method: HTTP method used for the postback request. Existing value is kept when omitted.
419+
371420
smart_link_ids: Smart Link ULIDs. Required when `smart_link_scope` is `campaign_specific`.
372421
373422
extra_headers: Send extra headers
@@ -385,6 +434,9 @@ async def update(
385434
"conversion_types": conversion_types,
386435
"smart_link_scope": smart_link_scope,
387436
"url": url,
437+
"body": body,
438+
"headers": headers,
439+
"http_method": http_method,
388440
"smart_link_ids": smart_link_ids,
389441
},
390442
smart_link_postback_update_params.SmartLinkPostbackUpdateParams,

src/onlyfansapi/types/smart_link_postback_create_params.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
from __future__ import annotations
44

5+
from typing import Iterable, Optional
56
from typing_extensions import Literal, Required, TypedDict
67

78
from .._types import SequenceNotStr
89

9-
__all__ = ["SmartLinkPostbackCreateParams"]
10+
__all__ = ["SmartLinkPostbackCreateParams", "Header"]
1011

1112

1213
class SmartLinkPostbackCreateParams(TypedDict, total=False):
@@ -26,5 +27,29 @@ class SmartLinkPostbackCreateParams(TypedDict, total=False):
2627
are replaced when the postback is dispatched.
2728
"""
2829

30+
body: str
31+
"""Optional request body template for POST postbacks.
32+
33+
Variables are replaced when the postback is dispatched.
34+
"""
35+
36+
headers: Iterable[Header]
37+
"""Optional request headers. Header values may include postback variables."""
38+
39+
http_method: Literal["GET", "POST"]
40+
"""HTTP method used for the postback request. Defaults to `GET` when omitted."""
41+
2942
smart_link_ids: SequenceNotStr[str]
3043
"""Smart Link ULIDs. Required when `smart_link_scope` is `campaign_specific`."""
44+
45+
46+
class Header(TypedDict, total=False):
47+
name: Optional[str]
48+
"""This field is required when <code>headers.\\**.value</code> is present.
49+
50+
Must match the regex /\\AA[A-Za-z0-9!#$%&'*+.^_`|~-]+\\zz/. Must not be greater than
51+
100 characters.
52+
"""
53+
54+
value: Optional[str]
55+
"""Must not be greater than 2000 characters."""

src/onlyfansapi/types/smart_link_postback_create_response.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from .._models import BaseModel
88

9-
__all__ = ["SmartLinkPostbackCreateResponse", "_Meta", "_Meta_Cache", "_Meta_Credits", "Data"]
9+
__all__ = ["SmartLinkPostbackCreateResponse", "_Meta", "_Meta_Cache", "_Meta_Credits", "Data", "DataHeader"]
1010

1111

1212
class _Meta_Cache(BaseModel):
@@ -29,13 +29,25 @@ class _Meta(BaseModel):
2929
api_credits: Optional[_Meta_Credits] = FieldInfo(alias="_credits", default=None)
3030

3131

32+
class DataHeader(BaseModel):
33+
name: Optional[str] = None
34+
35+
value: Optional[str] = None
36+
37+
3238
class Data(BaseModel):
3339
id: Optional[int] = None
3440

41+
body: Optional[str] = None
42+
3543
conversion_types: Optional[List[str]] = None
3644

3745
created_at: Optional[str] = None
3846

47+
headers: Optional[List[DataHeader]] = None
48+
49+
http_method: Optional[str] = None
50+
3951
latest_response: Optional[str] = None
4052

4153
smart_link_ids: Optional[List[object]] = None

src/onlyfansapi/types/smart_link_postback_list_response.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"_Meta_Cache",
1313
"_Meta_Credits",
1414
"Data",
15+
"DataHeader",
1516
"DataLatestResponse",
1617
"DataSmartLink",
1718
]
@@ -37,6 +38,12 @@ class _Meta(BaseModel):
3738
api_credits: Optional[_Meta_Credits] = FieldInfo(alias="_credits", default=None)
3839

3940

41+
class DataHeader(BaseModel):
42+
name: Optional[str] = None
43+
44+
value: Optional[str] = None
45+
46+
4047
class DataLatestResponse(BaseModel):
4148
id: Optional[int] = None
4249

@@ -68,10 +75,16 @@ class DataSmartLink(BaseModel):
6875
class Data(BaseModel):
6976
id: Optional[int] = None
7077

78+
body: Optional[str] = None
79+
7180
conversion_types: Optional[List[str]] = None
7281

7382
created_at: Optional[str] = None
7483

84+
headers: Optional[List[DataHeader]] = None
85+
86+
http_method: Optional[str] = None
87+
7588
latest_response: Optional[DataLatestResponse] = None
7689

7790
smart_link_ids: Optional[List[str]] = None

src/onlyfansapi/types/smart_link_postback_retrieve_response.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66

77
from .._models import BaseModel
88

9-
__all__ = ["SmartLinkPostbackRetrieveResponse", "_Meta", "_Meta_Cache", "_Meta_Credits", "Data", "DataSmartLink"]
9+
__all__ = [
10+
"SmartLinkPostbackRetrieveResponse",
11+
"_Meta",
12+
"_Meta_Cache",
13+
"_Meta_Credits",
14+
"Data",
15+
"DataHeader",
16+
"DataSmartLink",
17+
]
1018

1119

1220
class _Meta_Cache(BaseModel):
@@ -29,6 +37,12 @@ class _Meta(BaseModel):
2937
api_credits: Optional[_Meta_Credits] = FieldInfo(alias="_credits", default=None)
3038

3139

40+
class DataHeader(BaseModel):
41+
name: Optional[str] = None
42+
43+
value: Optional[str] = None
44+
45+
3246
class DataSmartLink(BaseModel):
3347
account_display_name: Optional[str] = None
3448

@@ -42,10 +56,16 @@ class DataSmartLink(BaseModel):
4256
class Data(BaseModel):
4357
id: Optional[int] = None
4458

59+
body: Optional[str] = None
60+
4561
conversion_types: Optional[List[str]] = None
4662

4763
created_at: Optional[str] = None
4864

65+
headers: Optional[List[DataHeader]] = None
66+
67+
http_method: Optional[str] = None
68+
4969
latest_response: Optional[str] = None
5070

5171
smart_link_ids: Optional[List[str]] = None

src/onlyfansapi/types/smart_link_postback_update_params.py

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22

33
from __future__ import annotations
44

5+
from typing import Iterable, Optional
56
from typing_extensions import Literal, Required, TypedDict
67

78
from .._types import SequenceNotStr
89

9-
__all__ = ["SmartLinkPostbackUpdateParams"]
10+
__all__ = ["SmartLinkPostbackUpdateParams", "Header"]
1011

1112

1213
class SmartLinkPostbackUpdateParams(TypedDict, total=False):
@@ -19,5 +20,29 @@ class SmartLinkPostbackUpdateParams(TypedDict, total=False):
1920
url: Required[str]
2021
"""The destination URL."""
2122

23+
body: str
24+
"""Optional request body template for POST postbacks.
25+
26+
Variables are replaced when the postback is dispatched.
27+
"""
28+
29+
headers: Iterable[Header]
30+
"""Optional request headers. Header values may include postback variables."""
31+
32+
http_method: Literal["GET", "POST"]
33+
"""HTTP method used for the postback request. Existing value is kept when omitted."""
34+
2235
smart_link_ids: SequenceNotStr[str]
2336
"""Smart Link ULIDs. Required when `smart_link_scope` is `campaign_specific`."""
37+
38+
39+
class Header(TypedDict, total=False):
40+
name: Optional[str]
41+
"""This field is required when <code>headers.\\**.value</code> is present.
42+
43+
Must match the regex /\\AA[A-Za-z0-9!#$%&'*+.^_`|~-]+\\zz/. Must not be greater than
44+
100 characters.
45+
"""
46+
47+
value: Optional[str]
48+
"""Must not be greater than 2000 characters."""

0 commit comments

Comments
 (0)