dub 0.33.0__py3-none-any.whl → 0.34.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 (65) hide show
  1. dub/_version.py +3 -3
  2. dub/analytics.py +2 -0
  3. dub/basesdk.py +6 -0
  4. dub/bounties.py +841 -0
  5. dub/commissions.py +4 -0
  6. dub/customers.py +8 -0
  7. dub/domains.py +12 -0
  8. dub/embed_tokens.py +2 -0
  9. dub/events.py +2 -0
  10. dub/folders.py +8 -0
  11. dub/links.py +20 -0
  12. dub/models/components/__init__.py +55 -149
  13. dub/models/components/commissioncreatedevent.py +29 -1
  14. dub/models/components/leadcreatedevent.py +8 -8
  15. dub/models/components/linkclickedevent.py +12 -12
  16. dub/models/components/linkerrorschema.py +12 -12
  17. dub/models/components/linkschema.py +3 -3
  18. dub/models/components/linktagschema.py +3 -3
  19. dub/models/components/linktagschemaoutput.py +38 -0
  20. dub/models/components/linkwebhookevent.py +8 -10
  21. dub/models/components/partnerenrolledevent.py +4 -4
  22. dub/models/components/salecreatedevent.py +8 -8
  23. dub/models/operations/__init__.py +223 -22
  24. dub/models/operations/approvebountysubmission.py +185 -0
  25. dub/models/operations/createpartner.py +4 -55
  26. dub/models/operations/createpartnerlink.py +0 -51
  27. dub/models/operations/createreferralsembedtoken.py +0 -51
  28. dub/models/operations/getcustomers.py +18 -0
  29. dub/models/operations/getlinkinfo.py +0 -2
  30. dub/models/operations/getlinks.py +2 -2
  31. dub/models/operations/getlinkscount.py +2 -2
  32. dub/models/operations/getqrcode.py +1 -1
  33. dub/models/operations/listbountysubmissions.py +212 -0
  34. dub/models/operations/listdomains.py +1 -1
  35. dub/models/operations/listevents.py +2016 -21
  36. dub/models/operations/listpartners.py +4 -4
  37. dub/models/operations/rejectbountysubmission.py +174 -0
  38. dub/models/operations/retrieveanalytics.py +16 -5
  39. dub/models/operations/retrievelinks.py +2 -2
  40. dub/models/operations/tracklead.py +4 -4
  41. dub/models/operations/updatecustomer.py +23 -11
  42. dub/models/operations/updatelink.py +0 -2
  43. dub/models/operations/updateworkspace.py +3 -3
  44. dub/models/operations/upsertpartnerlink.py +7 -65
  45. dub/partners.py +22 -4
  46. dub/qr_codes.py +2 -0
  47. dub/sdk.py +3 -0
  48. dub/tags.py +24 -12
  49. dub/track.py +4 -0
  50. dub/types/basemodel.py +41 -3
  51. dub/utils/__init__.py +0 -3
  52. dub/utils/enums.py +60 -0
  53. dub/utils/forms.py +21 -10
  54. dub/utils/queryparams.py +14 -2
  55. dub/utils/requestbodies.py +3 -3
  56. dub/utils/serializers.py +0 -20
  57. dub/workspaces.py +4 -0
  58. {dub-0.33.0.dist-info → dub-0.34.1.dist-info}/METADATA +20 -14
  59. {dub-0.33.0.dist-info → dub-0.34.1.dist-info}/RECORD +61 -60
  60. dub/models/components/clickevent.py +0 -557
  61. dub/models/components/continentcode.py +0 -16
  62. dub/models/components/leadevent.py +0 -681
  63. dub/models/components/saleevent.py +0 -780
  64. {dub-0.33.0.dist-info → dub-0.34.1.dist-info}/WHEEL +0 -0
  65. {dub-0.33.0.dist-info → dub-0.34.1.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,212 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from dub.types import BaseModel, Nullable, UNSET_SENTINEL
5
+ from dub.utils import FieldMetadata, PathParamMetadata, QueryParamMetadata
6
+ from enum import Enum
7
+ import pydantic
8
+ from pydantic import model_serializer
9
+ from typing import List, Optional
10
+ from typing_extensions import Annotated, NotRequired, TypedDict
11
+
12
+
13
+ class ListBountySubmissionsQueryParamStatus(str, Enum):
14
+ r"""The status of the submissions to list."""
15
+
16
+ DRAFT = "draft"
17
+ SUBMITTED = "submitted"
18
+ APPROVED = "approved"
19
+ REJECTED = "rejected"
20
+
21
+
22
+ class ListBountySubmissionsQueryParamSortBy(str, Enum):
23
+ r"""The field to sort the submissions by."""
24
+
25
+ COMPLETED_AT = "completedAt"
26
+ PERFORMANCE_COUNT = "performanceCount"
27
+
28
+
29
+ class ListBountySubmissionsQueryParamSortOrder(str, Enum):
30
+ r"""The order to sort the submissions by."""
31
+
32
+ ASC = "asc"
33
+ DESC = "desc"
34
+
35
+
36
+ class ListBountySubmissionsRequestTypedDict(TypedDict):
37
+ bounty_id: str
38
+ status: NotRequired[ListBountySubmissionsQueryParamStatus]
39
+ r"""The status of the submissions to list."""
40
+ group_id: NotRequired[str]
41
+ r"""The ID of the group to list submissions for."""
42
+ partner_id: NotRequired[str]
43
+ r"""The ID of the partner to list submissions for."""
44
+ sort_by: NotRequired[ListBountySubmissionsQueryParamSortBy]
45
+ r"""The field to sort the submissions by."""
46
+ sort_order: NotRequired[ListBountySubmissionsQueryParamSortOrder]
47
+ r"""The order to sort the submissions by."""
48
+ page: NotRequired[float]
49
+ r"""The page number for pagination."""
50
+ page_size: NotRequired[float]
51
+ r"""The number of items per page."""
52
+
53
+
54
+ class ListBountySubmissionsRequest(BaseModel):
55
+ bounty_id: Annotated[
56
+ str,
57
+ pydantic.Field(alias="bountyId"),
58
+ FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
59
+ ]
60
+
61
+ status: Annotated[
62
+ Optional[ListBountySubmissionsQueryParamStatus],
63
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
64
+ ] = None
65
+ r"""The status of the submissions to list."""
66
+
67
+ group_id: Annotated[
68
+ Optional[str],
69
+ pydantic.Field(alias="groupId"),
70
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
71
+ ] = None
72
+ r"""The ID of the group to list submissions for."""
73
+
74
+ partner_id: Annotated[
75
+ Optional[str],
76
+ pydantic.Field(alias="partnerId"),
77
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
78
+ ] = None
79
+ r"""The ID of the partner to list submissions for."""
80
+
81
+ sort_by: Annotated[
82
+ Optional[ListBountySubmissionsQueryParamSortBy],
83
+ pydantic.Field(alias="sortBy"),
84
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
85
+ ] = ListBountySubmissionsQueryParamSortBy.COMPLETED_AT
86
+ r"""The field to sort the submissions by."""
87
+
88
+ sort_order: Annotated[
89
+ Optional[ListBountySubmissionsQueryParamSortOrder],
90
+ pydantic.Field(alias="sortOrder"),
91
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
92
+ ] = ListBountySubmissionsQueryParamSortOrder.ASC
93
+ r"""The order to sort the submissions by."""
94
+
95
+ page: Annotated[
96
+ Optional[float],
97
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
98
+ ] = 1
99
+ r"""The page number for pagination."""
100
+
101
+ page_size: Annotated[
102
+ Optional[float],
103
+ pydantic.Field(alias="pageSize"),
104
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
105
+ ] = 100
106
+ r"""The number of items per page."""
107
+
108
+
109
+ class FilesTypedDict(TypedDict):
110
+ url: str
111
+ file_name: str
112
+ size: float
113
+
114
+
115
+ class Files(BaseModel):
116
+ url: str
117
+
118
+ file_name: Annotated[str, pydantic.Field(alias="fileName")]
119
+
120
+ size: float
121
+
122
+
123
+ class ListBountySubmissionsStatus(str, Enum):
124
+ DRAFT = "draft"
125
+ SUBMITTED = "submitted"
126
+ APPROVED = "approved"
127
+ REJECTED = "rejected"
128
+
129
+
130
+ class ListBountySubmissionsResponseBodyTypedDict(TypedDict):
131
+ id: str
132
+ bounty_id: str
133
+ partner_id: str
134
+ description: Nullable[str]
135
+ urls: Nullable[List[str]]
136
+ files: Nullable[List[FilesTypedDict]]
137
+ status: ListBountySubmissionsStatus
138
+ performance_count: Nullable[float]
139
+ created_at: str
140
+ completed_at: Nullable[str]
141
+ reviewed_at: Nullable[str]
142
+ rejection_reason: Nullable[str]
143
+ rejection_note: Nullable[str]
144
+
145
+
146
+ class ListBountySubmissionsResponseBody(BaseModel):
147
+ id: str
148
+
149
+ bounty_id: Annotated[str, pydantic.Field(alias="bountyId")]
150
+
151
+ partner_id: Annotated[str, pydantic.Field(alias="partnerId")]
152
+
153
+ description: Nullable[str]
154
+
155
+ urls: Nullable[List[str]]
156
+
157
+ files: Nullable[List[Files]]
158
+
159
+ status: ListBountySubmissionsStatus
160
+
161
+ performance_count: Annotated[
162
+ Nullable[float], pydantic.Field(alias="performanceCount")
163
+ ]
164
+
165
+ created_at: Annotated[str, pydantic.Field(alias="createdAt")]
166
+
167
+ completed_at: Annotated[Nullable[str], pydantic.Field(alias="completedAt")]
168
+
169
+ reviewed_at: Annotated[Nullable[str], pydantic.Field(alias="reviewedAt")]
170
+
171
+ rejection_reason: Annotated[Nullable[str], pydantic.Field(alias="rejectionReason")]
172
+
173
+ rejection_note: Annotated[Nullable[str], pydantic.Field(alias="rejectionNote")]
174
+
175
+ @model_serializer(mode="wrap")
176
+ def serialize_model(self, handler):
177
+ optional_fields = []
178
+ nullable_fields = [
179
+ "description",
180
+ "urls",
181
+ "files",
182
+ "performanceCount",
183
+ "completedAt",
184
+ "reviewedAt",
185
+ "rejectionReason",
186
+ "rejectionNote",
187
+ ]
188
+ null_default_fields = []
189
+
190
+ serialized = handler(self)
191
+
192
+ m = {}
193
+
194
+ for n, f in type(self).model_fields.items():
195
+ k = f.alias or n
196
+ val = serialized.get(k)
197
+ serialized.pop(k, None)
198
+
199
+ optional_nullable = k in optional_fields and k in nullable_fields
200
+ is_set = (
201
+ self.__pydantic_fields_set__.intersection({n})
202
+ or k in null_default_fields
203
+ ) # pylint: disable=no-member
204
+
205
+ if val is not None and val != UNSET_SENTINEL:
206
+ m[k] = val
207
+ elif val != UNSET_SENTINEL and (
208
+ not k in optional_fields or (optional_nullable and is_set)
209
+ ):
210
+ m[k] = val
211
+
212
+ return m
@@ -24,7 +24,7 @@ class ListDomainsRequest(BaseModel):
24
24
  archived: Annotated[
25
25
  Optional[bool],
26
26
  FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
27
- ] = True
27
+ ] = False
28
28
  r"""Whether to include archived domains in the response. Defaults to `false` if not provided."""
29
29
 
30
30
  search: Annotated[