dub 0.27.4__py3-none-any.whl → 0.28.1__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.
Files changed (40) hide show
  1. dub/_version.py +3 -3
  2. dub/models/components/__init__.py +0 -56
  3. dub/models/components/clickevent.py +5 -764
  4. dub/models/components/leadcreatedevent.py +5 -764
  5. dub/models/components/leadevent.py +5 -764
  6. dub/models/components/linkclickedevent.py +5 -764
  7. dub/models/components/linkschema.py +5 -764
  8. dub/models/components/linkwebhookevent.py +5 -764
  9. dub/models/components/partnerenrolledevent.py +20 -7
  10. dub/models/components/salecreatedevent.py +5 -764
  11. dub/models/components/saleevent.py +13 -772
  12. dub/models/components/tagschema.py +1 -1
  13. dub/models/components/workspaceschema.py +5 -5
  14. dub/models/operations/__init__.py +0 -6
  15. dub/models/operations/bulkcreatelinks.py +5 -6
  16. dub/models/operations/bulkupdatelinks.py +5 -6
  17. dub/models/operations/createcustomer.py +0 -3
  18. dub/models/operations/createlink.py +5 -6
  19. dub/models/operations/createpartner.py +30 -266
  20. dub/models/operations/createreferralsembedtoken.py +10 -260
  21. dub/models/operations/createtag.py +4 -4
  22. dub/models/operations/getcustomer.py +0 -3
  23. dub/models/operations/getcustomers.py +0 -3
  24. dub/models/operations/listcommissions.py +9 -0
  25. dub/models/operations/listevents.py +4 -5
  26. dub/models/operations/listpartners.py +23 -9
  27. dub/models/operations/retrieveanalytics.py +4 -5
  28. dub/models/operations/retrievepartneranalytics.py +8 -0
  29. dub/models/operations/tracksale.py +8 -7
  30. dub/models/operations/updatecustomer.py +0 -3
  31. dub/models/operations/updatelink.py +5 -6
  32. dub/models/operations/updatetag.py +4 -4
  33. dub/models/operations/updateworkspace.py +2 -13
  34. dub/models/operations/upsertlink.py +5 -6
  35. {dub-0.27.4.dist-info → dub-0.28.1.dist-info}/METADATA +12 -4
  36. {dub-0.27.4.dist-info → dub-0.28.1.dist-info}/RECORD +38 -40
  37. dub/models/components/countrycode.py +0 -259
  38. dub/models/components/linkgeotargeting.py +0 -766
  39. {dub-0.27.4.dist-info → dub-0.28.1.dist-info}/LICENSE +0 -0
  40. {dub-0.27.4.dist-info → dub-0.28.1.dist-info}/WHEEL +0 -0
@@ -2,268 +2,12 @@
2
2
 
3
3
  from __future__ import annotations
4
4
  from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
5
- from enum import Enum
6
5
  import pydantic
7
6
  from pydantic import model_serializer
8
7
  from typing import List, Optional, Union
9
8
  from typing_extensions import Annotated, NotRequired, TypeAliasType, TypedDict
10
9
 
11
10
 
12
- class CreateReferralsEmbedTokenCountry(str, Enum):
13
- r"""The partner's country of residence. Must be passed as a 2-letter ISO 3166-1 country code. Learn more: https://d.to/geo"""
14
-
15
- AF = "AF"
16
- AL = "AL"
17
- DZ = "DZ"
18
- AS = "AS"
19
- AD = "AD"
20
- AO = "AO"
21
- AI = "AI"
22
- AQ = "AQ"
23
- AG = "AG"
24
- AR = "AR"
25
- AM = "AM"
26
- AW = "AW"
27
- AU = "AU"
28
- AT = "AT"
29
- AZ = "AZ"
30
- BS = "BS"
31
- BH = "BH"
32
- BD = "BD"
33
- BB = "BB"
34
- BY = "BY"
35
- BE = "BE"
36
- BZ = "BZ"
37
- BJ = "BJ"
38
- BM = "BM"
39
- BT = "BT"
40
- BO = "BO"
41
- BA = "BA"
42
- BW = "BW"
43
- BV = "BV"
44
- BR = "BR"
45
- IO = "IO"
46
- BN = "BN"
47
- BG = "BG"
48
- BF = "BF"
49
- BI = "BI"
50
- KH = "KH"
51
- CM = "CM"
52
- CA = "CA"
53
- CV = "CV"
54
- KY = "KY"
55
- CF = "CF"
56
- TD = "TD"
57
- CL = "CL"
58
- CN = "CN"
59
- CX = "CX"
60
- CC = "CC"
61
- CO = "CO"
62
- KM = "KM"
63
- CG = "CG"
64
- CD = "CD"
65
- CK = "CK"
66
- CR = "CR"
67
- CI = "CI"
68
- HR = "HR"
69
- CU = "CU"
70
- CY = "CY"
71
- CZ = "CZ"
72
- DK = "DK"
73
- DJ = "DJ"
74
- DM = "DM"
75
- DO = "DO"
76
- EC = "EC"
77
- EG = "EG"
78
- SV = "SV"
79
- GQ = "GQ"
80
- ER = "ER"
81
- EE = "EE"
82
- ET = "ET"
83
- FK = "FK"
84
- FO = "FO"
85
- FJ = "FJ"
86
- FI = "FI"
87
- FR = "FR"
88
- GF = "GF"
89
- PF = "PF"
90
- TF = "TF"
91
- GA = "GA"
92
- GM = "GM"
93
- GE = "GE"
94
- DE = "DE"
95
- GH = "GH"
96
- GI = "GI"
97
- GR = "GR"
98
- GL = "GL"
99
- GD = "GD"
100
- GP = "GP"
101
- GU = "GU"
102
- GT = "GT"
103
- GN = "GN"
104
- GW = "GW"
105
- GY = "GY"
106
- HT = "HT"
107
- HM = "HM"
108
- VA = "VA"
109
- HN = "HN"
110
- HK = "HK"
111
- HU = "HU"
112
- IS = "IS"
113
- IN = "IN"
114
- ID = "ID"
115
- IR = "IR"
116
- IQ = "IQ"
117
- IE = "IE"
118
- IL = "IL"
119
- IT = "IT"
120
- JM = "JM"
121
- JP = "JP"
122
- JO = "JO"
123
- KZ = "KZ"
124
- KE = "KE"
125
- KI = "KI"
126
- KP = "KP"
127
- KR = "KR"
128
- KW = "KW"
129
- KG = "KG"
130
- LA = "LA"
131
- LV = "LV"
132
- LB = "LB"
133
- LS = "LS"
134
- LR = "LR"
135
- LY = "LY"
136
- LI = "LI"
137
- LT = "LT"
138
- LU = "LU"
139
- MO = "MO"
140
- MG = "MG"
141
- MW = "MW"
142
- MY = "MY"
143
- MV = "MV"
144
- ML = "ML"
145
- MT = "MT"
146
- MH = "MH"
147
- MQ = "MQ"
148
- MR = "MR"
149
- MU = "MU"
150
- YT = "YT"
151
- MX = "MX"
152
- FM = "FM"
153
- MD = "MD"
154
- MC = "MC"
155
- MN = "MN"
156
- MS = "MS"
157
- MA = "MA"
158
- MZ = "MZ"
159
- MM = "MM"
160
- NA = "NA"
161
- NR = "NR"
162
- NP = "NP"
163
- NL = "NL"
164
- NC = "NC"
165
- NZ = "NZ"
166
- NI = "NI"
167
- NE = "NE"
168
- NG = "NG"
169
- NU = "NU"
170
- NF = "NF"
171
- MK = "MK"
172
- MP = "MP"
173
- NO = "NO"
174
- OM = "OM"
175
- PK = "PK"
176
- PW = "PW"
177
- PS = "PS"
178
- PA = "PA"
179
- PG = "PG"
180
- PY = "PY"
181
- PE = "PE"
182
- PH = "PH"
183
- PN = "PN"
184
- PL = "PL"
185
- PT = "PT"
186
- PR = "PR"
187
- QA = "QA"
188
- RE = "RE"
189
- RO = "RO"
190
- RU = "RU"
191
- RW = "RW"
192
- SH = "SH"
193
- KN = "KN"
194
- LC = "LC"
195
- PM = "PM"
196
- VC = "VC"
197
- WS = "WS"
198
- SM = "SM"
199
- ST = "ST"
200
- SA = "SA"
201
- SN = "SN"
202
- SC = "SC"
203
- SL = "SL"
204
- SG = "SG"
205
- SK = "SK"
206
- SI = "SI"
207
- SB = "SB"
208
- SO = "SO"
209
- ZA = "ZA"
210
- GS = "GS"
211
- ES = "ES"
212
- LK = "LK"
213
- SD = "SD"
214
- SR = "SR"
215
- SJ = "SJ"
216
- SZ = "SZ"
217
- SE = "SE"
218
- CH = "CH"
219
- SY = "SY"
220
- TW = "TW"
221
- TJ = "TJ"
222
- TZ = "TZ"
223
- TH = "TH"
224
- TL = "TL"
225
- TG = "TG"
226
- TK = "TK"
227
- TO = "TO"
228
- TT = "TT"
229
- TN = "TN"
230
- TR = "TR"
231
- TM = "TM"
232
- TC = "TC"
233
- TV = "TV"
234
- UG = "UG"
235
- UA = "UA"
236
- AE = "AE"
237
- GB = "GB"
238
- US = "US"
239
- UM = "UM"
240
- UY = "UY"
241
- UZ = "UZ"
242
- VU = "VU"
243
- VE = "VE"
244
- VN = "VN"
245
- VG = "VG"
246
- VI = "VI"
247
- WF = "WF"
248
- EH = "EH"
249
- YE = "YE"
250
- ZM = "ZM"
251
- ZW = "ZW"
252
- AX = "AX"
253
- BQ = "BQ"
254
- CW = "CW"
255
- GG = "GG"
256
- IM = "IM"
257
- JE = "JE"
258
- ME = "ME"
259
- BL = "BL"
260
- MF = "MF"
261
- RS = "RS"
262
- SX = "SX"
263
- SS = "SS"
264
- XK = "XK"
265
-
266
-
267
11
  CreateReferralsEmbedTokenTagIdsTypedDict = TypeAliasType(
268
12
  "CreateReferralsEmbedTokenTagIdsTypedDict", Union[str, List[str]]
269
13
  )
@@ -576,8 +320,10 @@ class PartnerTypedDict(TypedDict):
576
320
  r"""The partner's avatar image. If not provided, a default avatar will be used."""
577
321
  tenant_id: NotRequired[str]
578
322
  r"""The partner's unique ID in your system. Useful for retrieving the partner's links and stats later on. If not provided, the partner will be created as a standalone partner."""
579
- country: NotRequired[Nullable[CreateReferralsEmbedTokenCountry]]
580
- r"""The partner's country of residence. Must be passed as a 2-letter ISO 3166-1 country code. Learn more: https://d.to/geo"""
323
+ group_id: NotRequired[str]
324
+ r"""The group ID to add the partner to. If not provided, the partner will be added to the default group."""
325
+ country: NotRequired[Nullable[str]]
326
+ r"""The partner's country of residence. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information."""
581
327
  description: NotRequired[Nullable[str]]
582
328
  r"""A brief description of the partner and their background. Max 5,000 characters."""
583
329
  link_props: NotRequired[CreateReferralsEmbedTokenLinkPropsTypedDict]
@@ -600,8 +346,11 @@ class Partner(BaseModel):
600
346
  tenant_id: Annotated[Optional[str], pydantic.Field(alias="tenantId")] = None
601
347
  r"""The partner's unique ID in your system. Useful for retrieving the partner's links and stats later on. If not provided, the partner will be created as a standalone partner."""
602
348
 
603
- country: OptionalNullable[CreateReferralsEmbedTokenCountry] = UNSET
604
- r"""The partner's country of residence. Must be passed as a 2-letter ISO 3166-1 country code. Learn more: https://d.to/geo"""
349
+ group_id: Annotated[Optional[str], pydantic.Field(alias="groupId")] = None
350
+ r"""The group ID to add the partner to. If not provided, the partner will be added to the default group."""
351
+
352
+ country: OptionalNullable[str] = UNSET
353
+ r"""The partner's country of residence. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information."""
605
354
 
606
355
  description: OptionalNullable[str] = UNSET
607
356
  r"""A brief description of the partner and their background. Max 5,000 characters."""
@@ -618,6 +367,7 @@ class Partner(BaseModel):
618
367
  "username",
619
368
  "image",
620
369
  "tenantId",
370
+ "groupId",
621
371
  "country",
622
372
  "description",
623
373
  "linkProps",
@@ -9,22 +9,22 @@ from typing_extensions import Annotated, NotRequired, TypedDict
9
9
 
10
10
 
11
11
  class Color(str, Enum):
12
- r"""The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, pink, brown."""
12
+ r"""The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, brown."""
13
13
 
14
14
  RED = "red"
15
15
  YELLOW = "yellow"
16
16
  GREEN = "green"
17
17
  BLUE = "blue"
18
18
  PURPLE = "purple"
19
- PINK = "pink"
20
19
  BROWN = "brown"
20
+ PINK = "pink"
21
21
 
22
22
 
23
23
  class CreateTagRequestBodyTypedDict(TypedDict):
24
24
  name: NotRequired[str]
25
25
  r"""The name of the tag to create."""
26
26
  color: NotRequired[Color]
27
- r"""The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, pink, brown."""
27
+ r"""The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, brown."""
28
28
  tag: NotRequired[str]
29
29
  r"""The name of the tag to create."""
30
30
 
@@ -34,7 +34,7 @@ class CreateTagRequestBody(BaseModel):
34
34
  r"""The name of the tag to create."""
35
35
 
36
36
  color: Optional[Color] = None
37
- r"""The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, pink, brown."""
37
+ r"""The color of the tag. If not provided, a random color will be used from the list: red, yellow, green, blue, purple, brown."""
38
38
 
39
39
  tag: Annotated[
40
40
  Optional[str],
@@ -163,7 +163,6 @@ class GetCustomerDiscountTypedDict(TypedDict):
163
163
  max_duration: Nullable[float]
164
164
  coupon_id: Nullable[str]
165
165
  coupon_test_id: Nullable[str]
166
- default: bool
167
166
  description: NotRequired[Nullable[str]]
168
167
  partners_count: NotRequired[Nullable[float]]
169
168
 
@@ -181,8 +180,6 @@ class GetCustomerDiscount(BaseModel):
181
180
 
182
181
  coupon_test_id: Annotated[Nullable[str], pydantic.Field(alias="couponTestId")]
183
182
 
184
- default: bool
185
-
186
183
  description: OptionalNullable[str] = UNSET
187
184
 
188
185
  partners_count: Annotated[
@@ -247,7 +247,6 @@ class DiscountTypedDict(TypedDict):
247
247
  max_duration: Nullable[float]
248
248
  coupon_id: Nullable[str]
249
249
  coupon_test_id: Nullable[str]
250
- default: bool
251
250
  description: NotRequired[Nullable[str]]
252
251
  partners_count: NotRequired[Nullable[float]]
253
252
 
@@ -265,8 +264,6 @@ class Discount(BaseModel):
265
264
 
266
265
  coupon_test_id: Annotated[Nullable[str], pydantic.Field(alias="couponTestId")]
267
266
 
268
- default: bool
269
-
270
267
  description: OptionalNullable[str] = UNSET
271
268
 
272
269
  partners_count: Annotated[
@@ -65,6 +65,8 @@ class ListCommissionsRequestTypedDict(TypedDict):
65
65
  r"""Filter the list of commissions by the associated payout."""
66
66
  partner_id: NotRequired[str]
67
67
  r"""Filter the list of commissions by the associated partner."""
68
+ group_id: NotRequired[str]
69
+ r"""Filter the list of commissions by the associated partner group."""
68
70
  invoice_id: NotRequired[str]
69
71
  r"""Filter the list of commissions by the associated invoice. Since invoiceId is unique on a per-program basis, this will only return one commission per invoice."""
70
72
  status: NotRequired[QueryParamStatus]
@@ -112,6 +114,13 @@ class ListCommissionsRequest(BaseModel):
112
114
  ] = None
113
115
  r"""Filter the list of commissions by the associated partner."""
114
116
 
117
+ group_id: Annotated[
118
+ Optional[str],
119
+ pydantic.Field(alias="groupId"),
120
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
121
+ ] = None
122
+ r"""Filter the list of commissions by the associated partner group."""
123
+
115
124
  invoice_id: Annotated[
116
125
  Optional[str],
117
126
  pydantic.Field(alias="invoiceId"),
@@ -4,7 +4,6 @@ from __future__ import annotations
4
4
  from dub.models.components import (
5
5
  clickevent as components_clickevent,
6
6
  continentcode as components_continentcode,
7
- countrycode as components_countrycode,
8
7
  leadevent as components_leadevent,
9
8
  saleevent as components_saleevent,
10
9
  )
@@ -123,8 +122,8 @@ class ListEventsRequestTypedDict(TypedDict):
123
122
  r"""The end date and time when to retrieve analytics from. If not provided, defaults to the current date. If set along with `start`, takes precedence over `interval`."""
124
123
  timezone: NotRequired[str]
125
124
  r"""The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC."""
126
- country: NotRequired[components_countrycode.CountryCode]
127
- r"""The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. Learn more: https://d.to/geo"""
125
+ country: NotRequired[str]
126
+ r"""The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information."""
128
127
  city: NotRequired[str]
129
128
  r"""The city to retrieve analytics for."""
130
129
  region: NotRequired[str]
@@ -265,10 +264,10 @@ class ListEventsRequest(BaseModel):
265
264
  r"""The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC."""
266
265
 
267
266
  country: Annotated[
268
- Optional[components_countrycode.CountryCode],
267
+ Optional[str],
269
268
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
270
269
  ] = None
271
- r"""The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. Learn more: https://d.to/geo"""
270
+ r"""The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information."""
272
271
 
273
272
  city: Annotated[
274
273
  Optional[str],
@@ -28,6 +28,7 @@ class ListPartnersQueryParamSortBy(str, Enum):
28
28
  CREATED_AT = "createdAt"
29
29
  CLICKS = "clicks"
30
30
  LEADS = "leads"
31
+ CONVERSIONS = "conversions"
31
32
  SALES = "sales"
32
33
  SALE_AMOUNT = "saleAmount"
33
34
  COMMISSIONS = "commissions"
@@ -53,7 +54,7 @@ class ListPartnersRequestTypedDict(TypedDict):
53
54
  tenant_id: NotRequired[str]
54
55
  r"""A case-sensitive filter on the list based on the partner's `tenantId` field. The value must be a string. Takes precedence over `search`."""
55
56
  include_expanded_fields: NotRequired[bool]
56
- r"""Whether to include stats fields on the partner (`clicks`, `leads`, `sales`, `saleAmount`, `commissions`, `netRevenue`). If false, those fields will be returned as 0."""
57
+ r"""Whether to include stats fields on the partner (`clicks`, `leads`, `conversions`, `sales`, `saleAmount`, `commissions`, `netRevenue`). If false, those fields will be returned as 0."""
57
58
  search: NotRequired[str]
58
59
  r"""A search query to filter partners by name, email, or tenantId."""
59
60
  page: NotRequired[float]
@@ -101,7 +102,7 @@ class ListPartnersRequest(BaseModel):
101
102
  pydantic.Field(alias="includeExpandedFields"),
102
103
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
103
104
  ] = None
104
- r"""Whether to include stats fields on the partner (`clicks`, `leads`, `sales`, `saleAmount`, `commissions`, `netRevenue`). If false, those fields will be returned as 0."""
105
+ r"""Whether to include stats fields on the partner (`clicks`, `leads`, `conversions`, `sales`, `saleAmount`, `commissions`, `netRevenue`). If false, those fields will be returned as 0."""
105
106
 
106
107
  search: Annotated[
107
108
  Optional[str],
@@ -213,12 +214,12 @@ class ListPartnersResponseBodyTypedDict(TypedDict):
213
214
  r"""The partner's Stripe Connect ID (for receiving payouts via Stripe)."""
214
215
  payouts_enabled_at: Nullable[str]
215
216
  r"""The date when the partner enabled payouts."""
217
+ program_id: str
218
+ r"""The program's unique ID on Dub."""
216
219
  partner_id: str
217
220
  r"""The partner's unique ID on Dub."""
218
221
  tenant_id: Nullable[str]
219
222
  r"""The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future."""
220
- program_id: str
221
- r"""The program's unique ID on Dub."""
222
223
  created_at: str
223
224
  status: ListPartnersStatus
224
225
  r"""The status of the partner's enrollment in the program."""
@@ -226,6 +227,8 @@ class ListPartnersResponseBodyTypedDict(TypedDict):
226
227
  r"""The partner's referral links in this program."""
227
228
  description: NotRequired[Nullable[str]]
228
229
  r"""A brief description of the partner and their background."""
230
+ group_id: NotRequired[Nullable[str]]
231
+ r"""The partner's group ID on Dub."""
229
232
  total_commissions: NotRequired[float]
230
233
  r"""The total commissions paid to the partner for their referrals. Defaults to 0 if `includeExpandedFields` is false."""
231
234
  click_reward_id: NotRequired[Nullable[str]]
@@ -242,8 +245,10 @@ class ListPartnersResponseBodyTypedDict(TypedDict):
242
245
  r"""The total number of clicks on the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
243
246
  leads: NotRequired[float]
244
247
  r"""The total number of leads generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
248
+ conversions: NotRequired[float]
249
+ r"""The total number of leads that converted to paying customers. Defaults to 0 if `includeExpandedFields` is false."""
245
250
  sales: NotRequired[float]
246
- r"""The total number of sales generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
251
+ r"""The total number of sales generated by the partner's links (includes recurring sales). Defaults to 0 if `includeExpandedFields` is false."""
247
252
  sale_amount: NotRequired[float]
248
253
  r"""The total amount of sales (in cents) generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
249
254
  net_revenue: NotRequired[float]
@@ -298,15 +303,15 @@ class ListPartnersResponseBody(BaseModel):
298
303
  ]
299
304
  r"""The date when the partner enabled payouts."""
300
305
 
306
+ program_id: Annotated[str, pydantic.Field(alias="programId")]
307
+ r"""The program's unique ID on Dub."""
308
+
301
309
  partner_id: Annotated[str, pydantic.Field(alias="partnerId")]
302
310
  r"""The partner's unique ID on Dub."""
303
311
 
304
312
  tenant_id: Annotated[Nullable[str], pydantic.Field(alias="tenantId")]
305
313
  r"""The partner's unique ID within your database. Can be useful for associating the partner with a user in your database and retrieving/update their data in the future."""
306
314
 
307
- program_id: Annotated[str, pydantic.Field(alias="programId")]
308
- r"""The program's unique ID on Dub."""
309
-
310
315
  created_at: Annotated[str, pydantic.Field(alias="createdAt")]
311
316
 
312
317
  status: ListPartnersStatus
@@ -318,6 +323,9 @@ class ListPartnersResponseBody(BaseModel):
318
323
  description: OptionalNullable[str] = UNSET
319
324
  r"""A brief description of the partner and their background."""
320
325
 
326
+ group_id: Annotated[OptionalNullable[str], pydantic.Field(alias="groupId")] = UNSET
327
+ r"""The partner's group ID on Dub."""
328
+
321
329
  total_commissions: Annotated[
322
330
  Optional[float], pydantic.Field(alias="totalCommissions")
323
331
  ] = 0
@@ -360,8 +368,11 @@ class ListPartnersResponseBody(BaseModel):
360
368
  leads: Optional[float] = 0
361
369
  r"""The total number of leads generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
362
370
 
371
+ conversions: Optional[float] = 0
372
+ r"""The total number of leads that converted to paying customers. Defaults to 0 if `includeExpandedFields` is false."""
373
+
363
374
  sales: Optional[float] = 0
364
- r"""The total number of sales generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
375
+ r"""The total number of sales generated by the partner's links (includes recurring sales). Defaults to 0 if `includeExpandedFields` is false."""
365
376
 
366
377
  sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
367
378
  r"""The total amount of sales (in cents) generated by the partner's links. Defaults to 0 if `includeExpandedFields` is false."""
@@ -427,6 +438,7 @@ class ListPartnersResponseBody(BaseModel):
427
438
  def serialize_model(self, handler):
428
439
  optional_fields = [
429
440
  "description",
441
+ "groupId",
430
442
  "totalCommissions",
431
443
  "clickRewardId",
432
444
  "leadRewardId",
@@ -437,6 +449,7 @@ class ListPartnersResponseBody(BaseModel):
437
449
  "bannedReason",
438
450
  "clicks",
439
451
  "leads",
452
+ "conversions",
440
453
  "sales",
441
454
  "saleAmount",
442
455
  "netRevenue",
@@ -464,6 +477,7 @@ class ListPartnersResponseBody(BaseModel):
464
477
  "paypalEmail",
465
478
  "stripeConnectId",
466
479
  "payoutsEnabledAt",
480
+ "groupId",
467
481
  "tenantId",
468
482
  "links",
469
483
  "clickRewardId",
@@ -17,7 +17,6 @@ from dub.models.components import (
17
17
  analyticstopurls as components_analyticstopurls,
18
18
  analyticstriggers as components_analyticstriggers,
19
19
  continentcode as components_continentcode,
20
- countrycode as components_countrycode,
21
20
  )
22
21
  from dub.types import BaseModel, Nullable, OptionalNullable, UNSET, UNSET_SENTINEL
23
22
  from dub.utils import FieldMetadata, QueryParamMetadata
@@ -134,8 +133,8 @@ class RetrieveAnalyticsRequestTypedDict(TypedDict):
134
133
  r"""The end date and time when to retrieve analytics from. If not provided, defaults to the current date. If set along with `start`, takes precedence over `interval`."""
135
134
  timezone: NotRequired[str]
136
135
  r"""The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC."""
137
- country: NotRequired[components_countrycode.CountryCode]
138
- r"""The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. Learn more: https://d.to/geo"""
136
+ country: NotRequired[str]
137
+ r"""The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information."""
139
138
  city: NotRequired[str]
140
139
  r"""The city to retrieve analytics for."""
141
140
  region: NotRequired[str]
@@ -275,10 +274,10 @@ class RetrieveAnalyticsRequest(BaseModel):
275
274
  r"""The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC."""
276
275
 
277
276
  country: Annotated[
278
- Optional[components_countrycode.CountryCode],
277
+ Optional[str],
279
278
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
280
279
  ] = None
281
- r"""The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. Learn more: https://d.to/geo"""
280
+ r"""The country to retrieve analytics for. Must be passed as a 2-letter ISO 3166-1 country code. See https://d.to/geo for more information."""
282
281
 
283
282
  city: Annotated[
284
283
  Optional[str],
@@ -49,6 +49,8 @@ class RetrievePartnerAnalyticsRequestTypedDict(TypedDict):
49
49
  r"""The end date and time when to retrieve analytics from. If not provided, defaults to the current date. If set along with `start`, takes precedence over `interval`."""
50
50
  timezone: NotRequired[str]
51
51
  r"""The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC."""
52
+ query: NotRequired[str]
53
+ r"""Search the events by a custom metadata value. Only available for lead and sale events."""
52
54
  group_by: NotRequired[RetrievePartnerAnalyticsQueryParamGroupBy]
53
55
  r"""The parameter to group the analytics data points by. Defaults to `count` if undefined."""
54
56
 
@@ -92,6 +94,12 @@ class RetrievePartnerAnalyticsRequest(BaseModel):
92
94
  ] = "UTC"
93
95
  r"""The IANA time zone code for aligning timeseries granularity (e.g. America/New_York). Defaults to UTC."""
94
96
 
97
+ query: Annotated[
98
+ Optional[str],
99
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
100
+ ] = None
101
+ r"""Search the events by a custom metadata value. Only available for lead and sale events."""
102
+
95
103
  group_by: Annotated[
96
104
  Optional[RetrievePartnerAnalyticsQueryParamGroupBy],
97
105
  pydantic.Field(alias="groupBy"),
@@ -25,12 +25,12 @@ class TrackSaleRequestBodyTypedDict(TypedDict):
25
25
  r"""The unique ID of the customer in your system. Will be used to identify and attribute all future events to this customer."""
26
26
  amount: int
27
27
  r"""The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency"""
28
- payment_processor: PaymentProcessor
29
- r"""The payment processor via which the sale was made."""
30
28
  currency: NotRequired[str]
31
29
  r"""The currency of the sale. Accepts ISO 4217 currency codes. Sales will be automatically converted and stored as USD at the latest exchange rates. Learn more: https://d.to/currency"""
32
30
  event_name: NotRequired[str]
33
31
  r"""The name of the sale event. Recommended format: `Invoice paid` or `Subscription created`."""
32
+ payment_processor: NotRequired[PaymentProcessor]
33
+ r"""The payment processor via which the sale was made."""
34
34
  invoice_id: NotRequired[Nullable[str]]
35
35
  r"""The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID."""
36
36
  lead_event_name: NotRequired[Nullable[str]]
@@ -46,17 +46,17 @@ class TrackSaleRequestBody(BaseModel):
46
46
  amount: int
47
47
  r"""The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1437` JPY). Learn more: https://d.to/currency"""
48
48
 
49
- payment_processor: Annotated[
50
- PaymentProcessor, pydantic.Field(alias="paymentProcessor")
51
- ]
52
- r"""The payment processor via which the sale was made."""
53
-
54
49
  currency: Optional[str] = "usd"
55
50
  r"""The currency of the sale. Accepts ISO 4217 currency codes. Sales will be automatically converted and stored as USD at the latest exchange rates. Learn more: https://d.to/currency"""
56
51
 
57
52
  event_name: Annotated[Optional[str], pydantic.Field(alias="eventName")] = "Purchase"
58
53
  r"""The name of the sale event. Recommended format: `Invoice paid` or `Subscription created`."""
59
54
 
55
+ payment_processor: Annotated[
56
+ Optional[PaymentProcessor], pydantic.Field(alias="paymentProcessor")
57
+ ] = PaymentProcessor.CUSTOM
58
+ r"""The payment processor via which the sale was made."""
59
+
60
60
  invoice_id: Annotated[OptionalNullable[str], pydantic.Field(alias="invoiceId")] = (
61
61
  None
62
62
  )
@@ -75,6 +75,7 @@ class TrackSaleRequestBody(BaseModel):
75
75
  optional_fields = [
76
76
  "currency",
77
77
  "eventName",
78
+ "paymentProcessor",
78
79
  "invoiceId",
79
80
  "leadEventName",
80
81
  "metadata",
@@ -229,7 +229,6 @@ class UpdateCustomerDiscountTypedDict(TypedDict):
229
229
  max_duration: Nullable[float]
230
230
  coupon_id: Nullable[str]
231
231
  coupon_test_id: Nullable[str]
232
- default: bool
233
232
  description: NotRequired[Nullable[str]]
234
233
  partners_count: NotRequired[Nullable[float]]
235
234
 
@@ -247,8 +246,6 @@ class UpdateCustomerDiscount(BaseModel):
247
246
 
248
247
  coupon_test_id: Annotated[Nullable[str], pydantic.Field(alias="couponTestId")]
249
248
 
250
- default: bool
251
-
252
249
  description: OptionalNullable[str] = UNSET
253
250
 
254
251
  partners_count: Annotated[