dub 0.32.0__py3-none-any.whl → 0.34.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dub/_version.py +3 -3
- dub/analytics.py +6 -4
- dub/basesdk.py +6 -0
- dub/commissions.py +12 -8
- dub/customers.py +24 -313
- dub/domains.py +34 -26
- dub/embed_tokens.py +6 -4
- dub/events.py +6 -4
- dub/folders.py +24 -20
- dub/links.py +58 -54
- dub/models/components/__init__.py +81 -149
- dub/models/components/analyticstopurls.py +2 -2
- dub/models/components/leadcreatedevent.py +15 -14
- dub/models/components/linkclickedevent.py +19 -18
- dub/models/components/linkerrorschema.py +12 -12
- dub/models/components/linkschema.py +9 -3
- dub/models/components/linktagschema.py +3 -3
- dub/models/components/linktagschemaoutput.py +38 -0
- dub/models/components/linkwebhookevent.py +15 -16
- dub/models/components/partnerapplicationsubmittedevent.py +269 -0
- dub/models/components/partnerenrolledevent.py +68 -8
- dub/models/components/salecreatedevent.py +15 -14
- dub/models/components/webhookevent.py +6 -0
- dub/models/components/workspaceschema.py +6 -0
- dub/models/operations/__init__.py +147 -57
- dub/models/operations/banpartner.py +83 -0
- dub/models/operations/createpartner.py +68 -59
- dub/models/operations/createpartnerlink.py +0 -51
- dub/models/operations/createreferralsembedtoken.py +0 -51
- dub/models/operations/getcustomers.py +18 -0
- dub/models/operations/getlinkinfo.py +0 -2
- dub/models/operations/getlinks.py +2 -2
- dub/models/operations/getlinkscount.py +2 -2
- dub/models/operations/getqrcode.py +1 -1
- dub/models/operations/listcommissions.py +13 -2
- dub/models/operations/listdomains.py +1 -1
- dub/models/operations/listevents.py +2026 -21
- dub/models/operations/listpartners.py +75 -8
- dub/models/operations/retrieveanalytics.py +28 -5
- dub/models/operations/retrievelinks.py +44 -9
- dub/models/operations/retrievepartneranalytics.py +51 -11
- dub/models/operations/tracklead.py +4 -4
- dub/models/operations/updatecommission.py +7 -2
- dub/models/operations/updatecustomer.py +23 -11
- dub/models/operations/updatelink.py +0 -2
- dub/models/operations/updateworkspace.py +3 -3
- dub/models/operations/upsertpartnerlink.py +0 -51
- dub/partners.py +316 -24
- dub/qr_codes.py +4 -2
- dub/tags.py +24 -20
- dub/track.py +12 -16
- dub/types/basemodel.py +41 -3
- dub/utils/__init__.py +0 -3
- dub/utils/enums.py +60 -0
- dub/utils/forms.py +21 -10
- dub/utils/queryparams.py +14 -2
- dub/utils/requestbodies.py +3 -3
- dub/utils/retries.py +69 -5
- dub/utils/serializers.py +0 -20
- dub/utils/unmarshal_json_response.py +15 -1
- dub/workspaces.py +12 -16
- {dub-0.32.0.dist-info → dub-0.34.0.dist-info}/METADATA +15 -33
- {dub-0.32.0.dist-info → dub-0.34.0.dist-info}/RECORD +65 -67
- dub/models/components/clickevent.py +0 -556
- dub/models/components/continentcode.py +0 -16
- dub/models/components/leadevent.py +0 -680
- dub/models/components/saleevent.py +0 -779
- dub/models/operations/createcustomer.py +0 -382
- {dub-0.32.0.dist-info → dub-0.34.0.dist-info}/WHEEL +0 -0
- {dub-0.32.0.dist-info → dub-0.34.0.dist-info}/licenses/LICENSE +0 -0
|
@@ -3,41 +3,41 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
from dub.types import BaseModel
|
|
5
5
|
from enum import Enum
|
|
6
|
-
from typing import Any
|
|
7
|
-
from typing_extensions import
|
|
6
|
+
from typing import Any
|
|
7
|
+
from typing_extensions import TypedDict
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class Code(str, Enum):
|
|
11
11
|
r"""The error code."""
|
|
12
12
|
|
|
13
13
|
BAD_REQUEST = "bad_request"
|
|
14
|
-
NOT_FOUND = "not_found"
|
|
15
|
-
INTERNAL_SERVER_ERROR = "internal_server_error"
|
|
16
14
|
UNAUTHORIZED = "unauthorized"
|
|
17
15
|
FORBIDDEN = "forbidden"
|
|
18
|
-
RATE_LIMIT_EXCEEDED = "rate_limit_exceeded"
|
|
19
|
-
INVITE_EXPIRED = "invite_expired"
|
|
20
|
-
INVITE_PENDING = "invite_pending"
|
|
21
16
|
EXCEEDED_LIMIT = "exceeded_limit"
|
|
17
|
+
NOT_FOUND = "not_found"
|
|
22
18
|
CONFLICT = "conflict"
|
|
19
|
+
INVITE_PENDING = "invite_pending"
|
|
20
|
+
INVITE_EXPIRED = "invite_expired"
|
|
23
21
|
UNPROCESSABLE_ENTITY = "unprocessable_entity"
|
|
22
|
+
RATE_LIMIT_EXCEEDED = "rate_limit_exceeded"
|
|
23
|
+
INTERNAL_SERVER_ERROR = "internal_server_error"
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
class LinkErrorSchemaTypedDict(TypedDict):
|
|
27
|
+
link: Any
|
|
28
|
+
r"""The link that caused the error."""
|
|
27
29
|
error: str
|
|
28
30
|
r"""The error message."""
|
|
29
31
|
code: Code
|
|
30
32
|
r"""The error code."""
|
|
31
|
-
link: NotRequired[Any]
|
|
32
|
-
r"""The link that caused the error."""
|
|
33
33
|
|
|
34
34
|
|
|
35
35
|
class LinkErrorSchema(BaseModel):
|
|
36
|
+
link: Any
|
|
37
|
+
r"""The link that caused the error."""
|
|
38
|
+
|
|
36
39
|
error: str
|
|
37
40
|
r"""The error message."""
|
|
38
41
|
|
|
39
42
|
code: Code
|
|
40
43
|
r"""The error code."""
|
|
41
|
-
|
|
42
|
-
link: Optional[Any] = None
|
|
43
|
-
r"""The link that caused the error."""
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
|
-
from .
|
|
4
|
+
from .linktagschemaoutput import LinkTagSchemaOutput, LinkTagSchemaOutputTypedDict
|
|
5
5
|
from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
6
6
|
import pydantic
|
|
7
7
|
from pydantic import model_serializer
|
|
@@ -45,6 +45,8 @@ class LinkSchemaTypedDict(TypedDict):
|
|
|
45
45
|
r"""The date and time when the short link will expire in ISO-8601 format."""
|
|
46
46
|
expired_url: Nullable[str]
|
|
47
47
|
r"""The URL to redirect to when the short link has expired."""
|
|
48
|
+
disabled_at: Nullable[str]
|
|
49
|
+
r"""The date and time when the short link was disabled. When a short link is disabled, it will redirect to its domain's not found URL, and its stats will be excluded from your overall stats."""
|
|
48
50
|
password: Nullable[str]
|
|
49
51
|
r"""The password required to access the destination URL of the short link."""
|
|
50
52
|
title: Nullable[str]
|
|
@@ -61,7 +63,7 @@ class LinkSchemaTypedDict(TypedDict):
|
|
|
61
63
|
r"""The Android destination URL for the short link for Android device targeting."""
|
|
62
64
|
geo: Nullable[Dict[str, str]]
|
|
63
65
|
r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
|
|
64
|
-
tags: Nullable[List[
|
|
66
|
+
tags: Nullable[List[LinkTagSchemaOutputTypedDict]]
|
|
65
67
|
r"""The tags assigned to the short link."""
|
|
66
68
|
folder_id: Nullable[str]
|
|
67
69
|
r"""The unique ID of the folder assigned to the short link."""
|
|
@@ -158,6 +160,9 @@ class LinkSchema(BaseModel):
|
|
|
158
160
|
expired_url: Annotated[Nullable[str], pydantic.Field(alias="expiredUrl")]
|
|
159
161
|
r"""The URL to redirect to when the short link has expired."""
|
|
160
162
|
|
|
163
|
+
disabled_at: Annotated[Nullable[str], pydantic.Field(alias="disabledAt")]
|
|
164
|
+
r"""The date and time when the short link was disabled. When a short link is disabled, it will redirect to its domain's not found URL, and its stats will be excluded from your overall stats."""
|
|
165
|
+
|
|
161
166
|
password: Nullable[str]
|
|
162
167
|
r"""The password required to access the destination URL of the short link."""
|
|
163
168
|
|
|
@@ -182,7 +187,7 @@ class LinkSchema(BaseModel):
|
|
|
182
187
|
geo: Nullable[Dict[str, str]]
|
|
183
188
|
r"""Geo targeting information for the short link in JSON format `{[COUNTRY]: https://example.com }`. See https://d.to/geo for more information."""
|
|
184
189
|
|
|
185
|
-
tags: Nullable[List[
|
|
190
|
+
tags: Nullable[List[LinkTagSchemaOutput]]
|
|
186
191
|
r"""The tags assigned to the short link."""
|
|
187
192
|
|
|
188
193
|
folder_id: Annotated[Nullable[str], pydantic.Field(alias="folderId")]
|
|
@@ -323,6 +328,7 @@ class LinkSchema(BaseModel):
|
|
|
323
328
|
"partnerId",
|
|
324
329
|
"expiresAt",
|
|
325
330
|
"expiredUrl",
|
|
331
|
+
"disabledAt",
|
|
326
332
|
"password",
|
|
327
333
|
"title",
|
|
328
334
|
"description",
|
|
@@ -6,7 +6,7 @@ from enum import Enum
|
|
|
6
6
|
from typing_extensions import TypedDict
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
class
|
|
9
|
+
class LinkTagSchemaColor(str, Enum):
|
|
10
10
|
r"""The color of the tag."""
|
|
11
11
|
|
|
12
12
|
RED = "red"
|
|
@@ -23,7 +23,7 @@ class LinkTagSchemaTypedDict(TypedDict):
|
|
|
23
23
|
r"""The unique ID of the tag."""
|
|
24
24
|
name: str
|
|
25
25
|
r"""The name of the tag."""
|
|
26
|
-
color:
|
|
26
|
+
color: LinkTagSchemaColor
|
|
27
27
|
r"""The color of the tag."""
|
|
28
28
|
|
|
29
29
|
|
|
@@ -34,5 +34,5 @@ class LinkTagSchema(BaseModel):
|
|
|
34
34
|
name: str
|
|
35
35
|
r"""The name of the tag."""
|
|
36
36
|
|
|
37
|
-
color:
|
|
37
|
+
color: LinkTagSchemaColor
|
|
38
38
|
r"""The color of the tag."""
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from dub.types import BaseModel
|
|
5
|
+
from enum import Enum
|
|
6
|
+
from typing_extensions import TypedDict
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class Color(str, Enum):
|
|
10
|
+
r"""The color of the tag."""
|
|
11
|
+
|
|
12
|
+
RED = "red"
|
|
13
|
+
YELLOW = "yellow"
|
|
14
|
+
GREEN = "green"
|
|
15
|
+
BLUE = "blue"
|
|
16
|
+
PURPLE = "purple"
|
|
17
|
+
BROWN = "brown"
|
|
18
|
+
PINK = "pink"
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class LinkTagSchemaOutputTypedDict(TypedDict):
|
|
22
|
+
id: str
|
|
23
|
+
r"""The unique ID of the tag."""
|
|
24
|
+
name: str
|
|
25
|
+
r"""The name of the tag."""
|
|
26
|
+
color: Color
|
|
27
|
+
r"""The color of the tag."""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class LinkTagSchemaOutput(BaseModel):
|
|
31
|
+
id: str
|
|
32
|
+
r"""The unique ID of the tag."""
|
|
33
|
+
|
|
34
|
+
name: str
|
|
35
|
+
r"""The name of the tag."""
|
|
36
|
+
|
|
37
|
+
color: Color
|
|
38
|
+
r"""The color of the tag."""
|
|
@@ -22,12 +22,10 @@ class One(str, Enum):
|
|
|
22
22
|
LINK_CREATED = "link.created"
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
"LinkWebhookEventEventTypedDict", Union[One, Two, Three]
|
|
27
|
-
)
|
|
25
|
+
EventTypedDict = TypeAliasType("EventTypedDict", Union[One, Two, Three])
|
|
28
26
|
|
|
29
27
|
|
|
30
|
-
|
|
28
|
+
Event = TypeAliasType("Event", Union[One, Two, Three])
|
|
31
29
|
|
|
32
30
|
|
|
33
31
|
class LinkWebhookEventTestVariantsTypedDict(TypedDict):
|
|
@@ -41,7 +39,7 @@ class LinkWebhookEventTestVariants(BaseModel):
|
|
|
41
39
|
percentage: float
|
|
42
40
|
|
|
43
41
|
|
|
44
|
-
class
|
|
42
|
+
class DataTypedDict(TypedDict):
|
|
45
43
|
id: str
|
|
46
44
|
r"""The unique ID of the short link."""
|
|
47
45
|
domain: str
|
|
@@ -61,6 +59,7 @@ class LinkWebhookEventLinkTypedDict(TypedDict):
|
|
|
61
59
|
archived: bool
|
|
62
60
|
expires_at: str
|
|
63
61
|
expired_url: Nullable[str]
|
|
62
|
+
disabled_at: str
|
|
64
63
|
password: Nullable[str]
|
|
65
64
|
r"""The password required to access the destination URL of the short link."""
|
|
66
65
|
proxy: bool
|
|
@@ -103,8 +102,8 @@ class LinkWebhookEventLinkTypedDict(TypedDict):
|
|
|
103
102
|
r"""The UTM term of the short link."""
|
|
104
103
|
utm_content: Nullable[str]
|
|
105
104
|
r"""The UTM content of the short link."""
|
|
106
|
-
test_started_at:
|
|
107
|
-
test_completed_at:
|
|
105
|
+
test_started_at: str
|
|
106
|
+
test_completed_at: str
|
|
108
107
|
user_id: Nullable[str]
|
|
109
108
|
workspace_id: str
|
|
110
109
|
r"""The workspace ID of the short link."""
|
|
@@ -129,7 +128,7 @@ class LinkWebhookEventLinkTypedDict(TypedDict):
|
|
|
129
128
|
r"""The total dollar value of sales (in cents) generated by the short link."""
|
|
130
129
|
|
|
131
130
|
|
|
132
|
-
class
|
|
131
|
+
class Data(BaseModel):
|
|
133
132
|
id: str
|
|
134
133
|
r"""The unique ID of the short link."""
|
|
135
134
|
|
|
@@ -161,6 +160,8 @@ class LinkWebhookEventLink(BaseModel):
|
|
|
161
160
|
|
|
162
161
|
expired_url: Annotated[Nullable[str], pydantic.Field(alias="expiredUrl")]
|
|
163
162
|
|
|
163
|
+
disabled_at: Annotated[str, pydantic.Field(alias="disabledAt")]
|
|
164
|
+
|
|
164
165
|
password: Nullable[str]
|
|
165
166
|
r"""The password required to access the destination URL of the short link."""
|
|
166
167
|
|
|
@@ -226,9 +227,9 @@ class LinkWebhookEventLink(BaseModel):
|
|
|
226
227
|
utm_content: Nullable[str]
|
|
227
228
|
r"""The UTM content of the short link."""
|
|
228
229
|
|
|
229
|
-
test_started_at: Annotated[
|
|
230
|
+
test_started_at: Annotated[str, pydantic.Field(alias="testStartedAt")]
|
|
230
231
|
|
|
231
|
-
test_completed_at: Annotated[
|
|
232
|
+
test_completed_at: Annotated[str, pydantic.Field(alias="testCompletedAt")]
|
|
232
233
|
|
|
233
234
|
user_id: Annotated[Nullable[str], pydantic.Field(alias="userId")]
|
|
234
235
|
|
|
@@ -313,8 +314,6 @@ class LinkWebhookEventLink(BaseModel):
|
|
|
313
314
|
"utm_term",
|
|
314
315
|
"utm_content",
|
|
315
316
|
"testVariants",
|
|
316
|
-
"testStartedAt",
|
|
317
|
-
"testCompletedAt",
|
|
318
317
|
"userId",
|
|
319
318
|
"tagId",
|
|
320
319
|
]
|
|
@@ -349,9 +348,9 @@ class LinkWebhookEventTypedDict(TypedDict):
|
|
|
349
348
|
r"""Triggered when a link is created, updated, or deleted."""
|
|
350
349
|
|
|
351
350
|
id: str
|
|
352
|
-
event:
|
|
351
|
+
event: EventTypedDict
|
|
353
352
|
created_at: str
|
|
354
|
-
data:
|
|
353
|
+
data: DataTypedDict
|
|
355
354
|
|
|
356
355
|
|
|
357
356
|
class LinkWebhookEvent(BaseModel):
|
|
@@ -359,8 +358,8 @@ class LinkWebhookEvent(BaseModel):
|
|
|
359
358
|
|
|
360
359
|
id: str
|
|
361
360
|
|
|
362
|
-
event:
|
|
361
|
+
event: Event
|
|
363
362
|
|
|
364
363
|
created_at: Annotated[str, pydantic.Field(alias="createdAt")]
|
|
365
364
|
|
|
366
|
-
data:
|
|
365
|
+
data: Data
|
|
@@ -0,0 +1,269 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
|
|
5
|
+
from enum import Enum
|
|
6
|
+
import pydantic
|
|
7
|
+
from pydantic import model_serializer
|
|
8
|
+
from typing import List
|
|
9
|
+
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class PartnerApplicationSubmittedEventEvent(str, Enum):
|
|
13
|
+
PARTNER_APPLICATION_SUBMITTED = "partner.application_submitted"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class PartnerApplicationSubmittedEventStatus(str, Enum):
|
|
17
|
+
r"""The status of the partner's enrollment in the program."""
|
|
18
|
+
|
|
19
|
+
PENDING = "pending"
|
|
20
|
+
APPROVED = "approved"
|
|
21
|
+
REJECTED = "rejected"
|
|
22
|
+
INVITED = "invited"
|
|
23
|
+
DECLINED = "declined"
|
|
24
|
+
DEACTIVATED = "deactivated"
|
|
25
|
+
BANNED = "banned"
|
|
26
|
+
ARCHIVED = "archived"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class PartnerApplicationSubmittedEventPartnerTypedDict(TypedDict):
|
|
30
|
+
id: str
|
|
31
|
+
r"""The partner's unique ID on Dub."""
|
|
32
|
+
name: str
|
|
33
|
+
r"""The partner's full legal name."""
|
|
34
|
+
company_name: Nullable[str]
|
|
35
|
+
r"""If the partner profile type is a company, this is the partner's legal company name."""
|
|
36
|
+
email: Nullable[str]
|
|
37
|
+
r"""The partner's email address. Should be a unique value across Dub."""
|
|
38
|
+
image: Nullable[str]
|
|
39
|
+
r"""The partner's avatar image."""
|
|
40
|
+
country: Nullable[str]
|
|
41
|
+
r"""The partner's country (required for tax purposes)."""
|
|
42
|
+
status: PartnerApplicationSubmittedEventStatus
|
|
43
|
+
r"""The status of the partner's enrollment in the program."""
|
|
44
|
+
description: NotRequired[Nullable[str]]
|
|
45
|
+
r"""A brief description of the partner and their background."""
|
|
46
|
+
group_id: NotRequired[Nullable[str]]
|
|
47
|
+
r"""The partner's group ID on Dub."""
|
|
48
|
+
website: NotRequired[Nullable[str]]
|
|
49
|
+
r"""The partner's website URL (including the https protocol)."""
|
|
50
|
+
youtube: NotRequired[Nullable[str]]
|
|
51
|
+
r"""The partner's YouTube channel username (e.g. `johndoe`)."""
|
|
52
|
+
twitter: NotRequired[Nullable[str]]
|
|
53
|
+
r"""The partner's Twitter username (e.g. `johndoe`)."""
|
|
54
|
+
linkedin: NotRequired[Nullable[str]]
|
|
55
|
+
r"""The partner's LinkedIn username (e.g. `johndoe`)."""
|
|
56
|
+
instagram: NotRequired[Nullable[str]]
|
|
57
|
+
r"""The partner's Instagram username (e.g. `johndoe`)."""
|
|
58
|
+
tiktok: NotRequired[Nullable[str]]
|
|
59
|
+
r"""The partner's TikTok username (e.g. `johndoe`)."""
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class PartnerApplicationSubmittedEventPartner(BaseModel):
|
|
63
|
+
id: str
|
|
64
|
+
r"""The partner's unique ID on Dub."""
|
|
65
|
+
|
|
66
|
+
name: str
|
|
67
|
+
r"""The partner's full legal name."""
|
|
68
|
+
|
|
69
|
+
company_name: Annotated[Nullable[str], pydantic.Field(alias="companyName")]
|
|
70
|
+
r"""If the partner profile type is a company, this is the partner's legal company name."""
|
|
71
|
+
|
|
72
|
+
email: Nullable[str]
|
|
73
|
+
r"""The partner's email address. Should be a unique value across Dub."""
|
|
74
|
+
|
|
75
|
+
image: Nullable[str]
|
|
76
|
+
r"""The partner's avatar image."""
|
|
77
|
+
|
|
78
|
+
country: Nullable[str]
|
|
79
|
+
r"""The partner's country (required for tax purposes)."""
|
|
80
|
+
|
|
81
|
+
status: PartnerApplicationSubmittedEventStatus
|
|
82
|
+
r"""The status of the partner's enrollment in the program."""
|
|
83
|
+
|
|
84
|
+
description: OptionalNullable[str] = UNSET
|
|
85
|
+
r"""A brief description of the partner and their background."""
|
|
86
|
+
|
|
87
|
+
group_id: Annotated[OptionalNullable[str], pydantic.Field(alias="groupId")] = UNSET
|
|
88
|
+
r"""The partner's group ID on Dub."""
|
|
89
|
+
|
|
90
|
+
website: OptionalNullable[str] = UNSET
|
|
91
|
+
r"""The partner's website URL (including the https protocol)."""
|
|
92
|
+
|
|
93
|
+
youtube: OptionalNullable[str] = UNSET
|
|
94
|
+
r"""The partner's YouTube channel username (e.g. `johndoe`)."""
|
|
95
|
+
|
|
96
|
+
twitter: OptionalNullable[str] = UNSET
|
|
97
|
+
r"""The partner's Twitter username (e.g. `johndoe`)."""
|
|
98
|
+
|
|
99
|
+
linkedin: OptionalNullable[str] = UNSET
|
|
100
|
+
r"""The partner's LinkedIn username (e.g. `johndoe`)."""
|
|
101
|
+
|
|
102
|
+
instagram: OptionalNullable[str] = UNSET
|
|
103
|
+
r"""The partner's Instagram username (e.g. `johndoe`)."""
|
|
104
|
+
|
|
105
|
+
tiktok: OptionalNullable[str] = UNSET
|
|
106
|
+
r"""The partner's TikTok username (e.g. `johndoe`)."""
|
|
107
|
+
|
|
108
|
+
@model_serializer(mode="wrap")
|
|
109
|
+
def serialize_model(self, handler):
|
|
110
|
+
optional_fields = [
|
|
111
|
+
"description",
|
|
112
|
+
"groupId",
|
|
113
|
+
"website",
|
|
114
|
+
"youtube",
|
|
115
|
+
"twitter",
|
|
116
|
+
"linkedin",
|
|
117
|
+
"instagram",
|
|
118
|
+
"tiktok",
|
|
119
|
+
]
|
|
120
|
+
nullable_fields = [
|
|
121
|
+
"companyName",
|
|
122
|
+
"email",
|
|
123
|
+
"image",
|
|
124
|
+
"description",
|
|
125
|
+
"country",
|
|
126
|
+
"groupId",
|
|
127
|
+
"website",
|
|
128
|
+
"youtube",
|
|
129
|
+
"twitter",
|
|
130
|
+
"linkedin",
|
|
131
|
+
"instagram",
|
|
132
|
+
"tiktok",
|
|
133
|
+
]
|
|
134
|
+
null_default_fields = []
|
|
135
|
+
|
|
136
|
+
serialized = handler(self)
|
|
137
|
+
|
|
138
|
+
m = {}
|
|
139
|
+
|
|
140
|
+
for n, f in type(self).model_fields.items():
|
|
141
|
+
k = f.alias or n
|
|
142
|
+
val = serialized.get(k)
|
|
143
|
+
serialized.pop(k, None)
|
|
144
|
+
|
|
145
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
146
|
+
is_set = (
|
|
147
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
148
|
+
or k in null_default_fields
|
|
149
|
+
) # pylint: disable=no-member
|
|
150
|
+
|
|
151
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
152
|
+
m[k] = val
|
|
153
|
+
elif val != UNSET_SENTINEL and (
|
|
154
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
155
|
+
):
|
|
156
|
+
m[k] = val
|
|
157
|
+
|
|
158
|
+
return m
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
class ApplicationFormDataTypedDict(TypedDict):
|
|
162
|
+
label: str
|
|
163
|
+
value: Nullable[str]
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
class ApplicationFormData(BaseModel):
|
|
167
|
+
label: str
|
|
168
|
+
|
|
169
|
+
value: Nullable[str]
|
|
170
|
+
|
|
171
|
+
@model_serializer(mode="wrap")
|
|
172
|
+
def serialize_model(self, handler):
|
|
173
|
+
optional_fields = []
|
|
174
|
+
nullable_fields = ["value"]
|
|
175
|
+
null_default_fields = []
|
|
176
|
+
|
|
177
|
+
serialized = handler(self)
|
|
178
|
+
|
|
179
|
+
m = {}
|
|
180
|
+
|
|
181
|
+
for n, f in type(self).model_fields.items():
|
|
182
|
+
k = f.alias or n
|
|
183
|
+
val = serialized.get(k)
|
|
184
|
+
serialized.pop(k, None)
|
|
185
|
+
|
|
186
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
187
|
+
is_set = (
|
|
188
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
189
|
+
or k in null_default_fields
|
|
190
|
+
) # pylint: disable=no-member
|
|
191
|
+
|
|
192
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
193
|
+
m[k] = val
|
|
194
|
+
elif val != UNSET_SENTINEL and (
|
|
195
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
196
|
+
):
|
|
197
|
+
m[k] = val
|
|
198
|
+
|
|
199
|
+
return m
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
class PartnerApplicationSubmittedEventDataTypedDict(TypedDict):
|
|
203
|
+
id: str
|
|
204
|
+
created_at: str
|
|
205
|
+
partner: PartnerApplicationSubmittedEventPartnerTypedDict
|
|
206
|
+
application_form_data: Nullable[List[ApplicationFormDataTypedDict]]
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
class PartnerApplicationSubmittedEventData(BaseModel):
|
|
210
|
+
id: str
|
|
211
|
+
|
|
212
|
+
created_at: Annotated[str, pydantic.Field(alias="createdAt")]
|
|
213
|
+
|
|
214
|
+
partner: PartnerApplicationSubmittedEventPartner
|
|
215
|
+
|
|
216
|
+
application_form_data: Annotated[
|
|
217
|
+
Nullable[List[ApplicationFormData]], pydantic.Field(alias="applicationFormData")
|
|
218
|
+
]
|
|
219
|
+
|
|
220
|
+
@model_serializer(mode="wrap")
|
|
221
|
+
def serialize_model(self, handler):
|
|
222
|
+
optional_fields = []
|
|
223
|
+
nullable_fields = ["applicationFormData"]
|
|
224
|
+
null_default_fields = []
|
|
225
|
+
|
|
226
|
+
serialized = handler(self)
|
|
227
|
+
|
|
228
|
+
m = {}
|
|
229
|
+
|
|
230
|
+
for n, f in type(self).model_fields.items():
|
|
231
|
+
k = f.alias or n
|
|
232
|
+
val = serialized.get(k)
|
|
233
|
+
serialized.pop(k, None)
|
|
234
|
+
|
|
235
|
+
optional_nullable = k in optional_fields and k in nullable_fields
|
|
236
|
+
is_set = (
|
|
237
|
+
self.__pydantic_fields_set__.intersection({n})
|
|
238
|
+
or k in null_default_fields
|
|
239
|
+
) # pylint: disable=no-member
|
|
240
|
+
|
|
241
|
+
if val is not None and val != UNSET_SENTINEL:
|
|
242
|
+
m[k] = val
|
|
243
|
+
elif val != UNSET_SENTINEL and (
|
|
244
|
+
not k in optional_fields or (optional_nullable and is_set)
|
|
245
|
+
):
|
|
246
|
+
m[k] = val
|
|
247
|
+
|
|
248
|
+
return m
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
class PartnerApplicationSubmittedEventTypedDict(TypedDict):
|
|
252
|
+
r"""Triggered when a partner submits an application to join a program."""
|
|
253
|
+
|
|
254
|
+
id: str
|
|
255
|
+
event: PartnerApplicationSubmittedEventEvent
|
|
256
|
+
created_at: str
|
|
257
|
+
data: PartnerApplicationSubmittedEventDataTypedDict
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
class PartnerApplicationSubmittedEvent(BaseModel):
|
|
261
|
+
r"""Triggered when a partner submits an application to join a program."""
|
|
262
|
+
|
|
263
|
+
id: str
|
|
264
|
+
|
|
265
|
+
event: PartnerApplicationSubmittedEventEvent
|
|
266
|
+
|
|
267
|
+
created_at: Annotated[str, pydantic.Field(alias="createdAt")]
|
|
268
|
+
|
|
269
|
+
data: PartnerApplicationSubmittedEventData
|