dub 0.34.0__py3-none-any.whl → 0.35.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.
Files changed (93) hide show
  1. dub/_version.py +3 -3
  2. dub/basesdk.py +20 -6
  3. dub/{workspaces.py → bounties.py} +349 -69
  4. dub/models/components/__init__.py +114 -26
  5. dub/models/components/analyticsbrowsers.py +18 -1
  6. dub/models/components/analyticscities.py +18 -1
  7. dub/models/components/analyticscontinents.py +18 -1
  8. dub/models/components/analyticscount.py +18 -1
  9. dub/models/components/analyticscountries.py +20 -1
  10. dub/models/components/analyticsdevices.py +18 -1
  11. dub/models/components/analyticsos.py +18 -1
  12. dub/models/components/analyticsreferers.py +18 -1
  13. dub/models/components/analyticsrefererurls.py +18 -1
  14. dub/models/components/analyticsregions.py +18 -1
  15. dub/models/components/analyticstimeseries.py +18 -1
  16. dub/models/components/analyticstoplinks.py +16 -26
  17. dub/models/components/analyticstopurls.py +18 -1
  18. dub/models/components/analyticstriggers.py +18 -1
  19. dub/models/components/commissioncreatedevent.py +123 -63
  20. dub/models/components/domainschema.py +31 -50
  21. dub/models/components/folderschema.py +18 -19
  22. dub/models/components/leadcreatedevent.py +151 -134
  23. dub/models/components/linkclickedevent.py +57 -70
  24. dub/models/components/linkschema.py +63 -64
  25. dub/models/components/linkwebhookevent.py +43 -51
  26. dub/models/components/partneranalyticscount.py +18 -1
  27. dub/models/components/partneranalyticstimeseries.py +18 -1
  28. dub/models/components/partneranalyticstoplinks.py +16 -27
  29. dub/models/components/partnerapplicationsubmittedevent.py +42 -75
  30. dub/models/components/partnerenrolledevent.py +477 -83
  31. dub/models/components/salecreatedevent.py +152 -151
  32. dub/models/errors/badrequest.py +18 -1
  33. dub/models/errors/conflict.py +18 -1
  34. dub/models/errors/forbidden.py +18 -1
  35. dub/models/errors/internalservererror.py +18 -1
  36. dub/models/errors/inviteexpired.py +18 -1
  37. dub/models/errors/notfound.py +18 -1
  38. dub/models/errors/ratelimitexceeded.py +18 -1
  39. dub/models/errors/unauthorized.py +18 -1
  40. dub/models/errors/unprocessableentity.py +18 -1
  41. dub/models/operations/__init__.py +323 -19
  42. dub/models/operations/approvebountysubmission.py +211 -0
  43. dub/models/operations/banpartner.py +14 -19
  44. dub/models/operations/bulkcreatelinks.py +86 -87
  45. dub/models/operations/bulkupdatelinks.py +97 -82
  46. dub/models/operations/checkdomainstatus.py +1 -17
  47. dub/models/operations/createdomain.py +33 -34
  48. dub/models/operations/createfolder.py +18 -19
  49. dub/models/operations/createlink.py +86 -87
  50. dub/models/operations/createpartner.py +560 -168
  51. dub/models/operations/createpartnerlink.py +74 -85
  52. dub/models/operations/createreferralsembedtoken.py +99 -87
  53. dub/models/operations/createtag.py +18 -1
  54. dub/models/operations/deactivatepartner.py +65 -0
  55. dub/models/operations/getcustomer.py +106 -105
  56. dub/models/operations/getcustomers.py +123 -105
  57. dub/models/operations/getlinkinfo.py +18 -1
  58. dub/models/operations/getlinks.py +36 -1
  59. dub/models/operations/getlinkscount.py +32 -1
  60. dub/models/operations/getqrcode.py +29 -1
  61. dub/models/operations/gettags.py +20 -1
  62. dub/models/operations/listbountysubmissions.py +249 -0
  63. dub/models/operations/listcommissions.py +129 -64
  64. dub/models/operations/listdomains.py +18 -1
  65. dub/models/operations/listevents.py +414 -389
  66. dub/models/operations/listfolders.py +18 -1
  67. dub/models/operations/listpartners.py +510 -84
  68. dub/models/operations/registerdomain.py +1 -17
  69. dub/models/operations/rejectbountysubmission.py +219 -0
  70. dub/models/operations/retrieveanalytics.py +65 -66
  71. dub/models/operations/retrievelinks.py +30 -19
  72. dub/models/operations/retrievepartneranalytics.py +25 -28
  73. dub/models/operations/tracklead.py +38 -83
  74. dub/models/operations/tracksale.py +52 -95
  75. dub/models/operations/updatecommission.py +126 -64
  76. dub/models/operations/updatecustomer.py +122 -131
  77. dub/models/operations/updatedomain.py +50 -35
  78. dub/models/operations/updatefolder.py +34 -19
  79. dub/models/operations/updatelink.py +101 -86
  80. dub/models/operations/updatetag.py +34 -1
  81. dub/models/operations/upsertlink.py +86 -87
  82. dub/models/operations/upsertpartnerlink.py +77 -90
  83. dub/partners.py +288 -0
  84. dub/sdk.py +3 -3
  85. dub/utils/__init__.py +10 -1
  86. {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/METADATA +10 -8
  87. dub-0.35.0.dist-info/RECORD +143 -0
  88. dub/models/components/workspaceschema.py +0 -328
  89. dub/models/operations/getworkspace.py +0 -21
  90. dub/models/operations/updateworkspace.py +0 -78
  91. dub-0.34.0.dist-info/RECORD +0 -142
  92. {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/WHEEL +0 -0
  93. {dub-0.34.0.dist-info → dub-0.35.0.dist-info}/licenses/LICENSE +0 -0
@@ -41,30 +41,14 @@ class RegisterDomainResponseBody(BaseModel):
41
41
 
42
42
  @model_serializer(mode="wrap")
43
43
  def serialize_model(self, handler):
44
- optional_fields = []
45
- nullable_fields = ["expiration"]
46
- null_default_fields = []
47
-
48
44
  serialized = handler(self)
49
-
50
45
  m = {}
51
46
 
52
47
  for n, f in type(self).model_fields.items():
53
48
  k = f.alias or n
54
49
  val = serialized.get(k)
55
- serialized.pop(k, None)
56
50
 
57
- optional_nullable = k in optional_fields and k in nullable_fields
58
- is_set = (
59
- self.__pydantic_fields_set__.intersection({n})
60
- or k in null_default_fields
61
- ) # pylint: disable=no-member
62
-
63
- if val is not None and val != UNSET_SENTINEL:
64
- m[k] = val
65
- elif val != UNSET_SENTINEL and (
66
- not k in optional_fields or (optional_nullable and is_set)
67
- ):
51
+ if val != UNSET_SENTINEL:
68
52
  m[k] = val
69
53
 
70
54
  return m
@@ -0,0 +1,219 @@
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, RequestMetadata
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 RejectionReason(str, Enum):
14
+ r"""The reason for rejecting the submission."""
15
+
16
+ INVALID_PROOF = "invalidProof"
17
+ DUPLICATE_SUBMISSION = "duplicateSubmission"
18
+ OUT_OF_TIME_WINDOW = "outOfTimeWindow"
19
+ DID_NOT_MEET_CRITERIA = "didNotMeetCriteria"
20
+ OTHER = "other"
21
+
22
+
23
+ class RejectBountySubmissionRequestBodyTypedDict(TypedDict):
24
+ rejection_reason: NotRequired[RejectionReason]
25
+ r"""The reason for rejecting the submission."""
26
+ rejection_note: NotRequired[str]
27
+ r"""The note for rejecting the submission."""
28
+
29
+
30
+ class RejectBountySubmissionRequestBody(BaseModel):
31
+ rejection_reason: Annotated[
32
+ Optional[RejectionReason], pydantic.Field(alias="rejectionReason")
33
+ ] = None
34
+ r"""The reason for rejecting the submission."""
35
+
36
+ rejection_note: Annotated[Optional[str], pydantic.Field(alias="rejectionNote")] = (
37
+ None
38
+ )
39
+ r"""The note for rejecting the submission."""
40
+
41
+ @model_serializer(mode="wrap")
42
+ def serialize_model(self, handler):
43
+ optional_fields = set(["rejectionReason", "rejectionNote"])
44
+ serialized = handler(self)
45
+ m = {}
46
+
47
+ for n, f in type(self).model_fields.items():
48
+ k = f.alias or n
49
+ val = serialized.get(k)
50
+
51
+ if val != UNSET_SENTINEL:
52
+ if val is not None or k not in optional_fields:
53
+ m[k] = val
54
+
55
+ return m
56
+
57
+
58
+ class RejectBountySubmissionRequestTypedDict(TypedDict):
59
+ bounty_id: str
60
+ r"""The ID of the bounty"""
61
+ submission_id: str
62
+ r"""The ID of the bounty submission"""
63
+ request_body: NotRequired[RejectBountySubmissionRequestBodyTypedDict]
64
+
65
+
66
+ class RejectBountySubmissionRequest(BaseModel):
67
+ bounty_id: Annotated[
68
+ str,
69
+ pydantic.Field(alias="bountyId"),
70
+ FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
71
+ ]
72
+ r"""The ID of the bounty"""
73
+
74
+ submission_id: Annotated[
75
+ str,
76
+ pydantic.Field(alias="submissionId"),
77
+ FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
78
+ ]
79
+ r"""The ID of the bounty submission"""
80
+
81
+ request_body: Annotated[
82
+ Optional[RejectBountySubmissionRequestBody],
83
+ FieldMetadata(request=RequestMetadata(media_type="application/json")),
84
+ ] = None
85
+
86
+ @model_serializer(mode="wrap")
87
+ def serialize_model(self, handler):
88
+ optional_fields = set(["RequestBody"])
89
+ serialized = handler(self)
90
+ m = {}
91
+
92
+ for n, f in type(self).model_fields.items():
93
+ k = f.alias or n
94
+ val = serialized.get(k)
95
+
96
+ if val != UNSET_SENTINEL:
97
+ if val is not None or k not in optional_fields:
98
+ m[k] = val
99
+
100
+ return m
101
+
102
+
103
+ class RejectBountySubmissionFilesTypedDict(TypedDict):
104
+ url: str
105
+ r"""The URL of the uploaded file."""
106
+ file_name: str
107
+ r"""The original file name."""
108
+ size: float
109
+ r"""The file size in bytes."""
110
+
111
+
112
+ class RejectBountySubmissionFiles(BaseModel):
113
+ url: str
114
+ r"""The URL of the uploaded file."""
115
+
116
+ file_name: Annotated[str, pydantic.Field(alias="fileName")]
117
+ r"""The original file name."""
118
+
119
+ size: float
120
+ r"""The file size in bytes."""
121
+
122
+
123
+ class RejectBountySubmissionStatus(str, Enum):
124
+ r"""The status of the submission"""
125
+
126
+ DRAFT = "draft"
127
+ SUBMITTED = "submitted"
128
+ APPROVED = "approved"
129
+ REJECTED = "rejected"
130
+
131
+
132
+ class RejectBountySubmissionResponseBodyTypedDict(TypedDict):
133
+ r"""The rejected bounty submission."""
134
+
135
+ id: str
136
+ r"""The ID of the bounty submission"""
137
+ bounty_id: str
138
+ r"""The ID of the bounty"""
139
+ partner_id: str
140
+ r"""The ID of the partner"""
141
+ description: Nullable[str]
142
+ r"""The description of the submission"""
143
+ urls: Nullable[List[str]]
144
+ r"""The URLs submitted for the submission"""
145
+ files: Nullable[List[RejectBountySubmissionFilesTypedDict]]
146
+ r"""The files uploaded for the submission"""
147
+ status: RejectBountySubmissionStatus
148
+ r"""The status of the submission"""
149
+ performance_count: Nullable[float]
150
+ r"""The performance count of the submission"""
151
+ created_at: str
152
+ r"""The date and time the submission was created"""
153
+ completed_at: Nullable[str]
154
+ r"""The date and time the submission was completed"""
155
+ reviewed_at: Nullable[str]
156
+ r"""The date and time the submission was reviewed"""
157
+ rejection_reason: Nullable[str]
158
+ r"""The reason for rejecting the submission"""
159
+ rejection_note: Nullable[str]
160
+ r"""The note for rejecting the submission"""
161
+
162
+
163
+ class RejectBountySubmissionResponseBody(BaseModel):
164
+ r"""The rejected bounty submission."""
165
+
166
+ id: str
167
+ r"""The ID of the bounty submission"""
168
+
169
+ bounty_id: Annotated[str, pydantic.Field(alias="bountyId")]
170
+ r"""The ID of the bounty"""
171
+
172
+ partner_id: Annotated[str, pydantic.Field(alias="partnerId")]
173
+ r"""The ID of the partner"""
174
+
175
+ description: Nullable[str]
176
+ r"""The description of the submission"""
177
+
178
+ urls: Nullable[List[str]]
179
+ r"""The URLs submitted for the submission"""
180
+
181
+ files: Nullable[List[RejectBountySubmissionFiles]]
182
+ r"""The files uploaded for the submission"""
183
+
184
+ status: RejectBountySubmissionStatus
185
+ r"""The status of the submission"""
186
+
187
+ performance_count: Annotated[
188
+ Nullable[float], pydantic.Field(alias="performanceCount")
189
+ ]
190
+ r"""The performance count of the submission"""
191
+
192
+ created_at: Annotated[str, pydantic.Field(alias="createdAt")]
193
+ r"""The date and time the submission was created"""
194
+
195
+ completed_at: Annotated[Nullable[str], pydantic.Field(alias="completedAt")]
196
+ r"""The date and time the submission was completed"""
197
+
198
+ reviewed_at: Annotated[Nullable[str], pydantic.Field(alias="reviewedAt")]
199
+ r"""The date and time the submission was reviewed"""
200
+
201
+ rejection_reason: Annotated[Nullable[str], pydantic.Field(alias="rejectionReason")]
202
+ r"""The reason for rejecting the submission"""
203
+
204
+ rejection_note: Annotated[Nullable[str], pydantic.Field(alias="rejectionNote")]
205
+ r"""The note for rejecting the submission"""
206
+
207
+ @model_serializer(mode="wrap")
208
+ def serialize_model(self, handler):
209
+ serialized = handler(self)
210
+ m = {}
211
+
212
+ for n, f in type(self).model_fields.items():
213
+ k = f.alias or n
214
+ val = serialized.get(k)
215
+
216
+ if val != UNSET_SENTINEL:
217
+ m[k] = val
218
+
219
+ return m
@@ -451,78 +451,77 @@ class RetrieveAnalyticsRequest(BaseModel):
451
451
 
452
452
  @model_serializer(mode="wrap")
453
453
  def serialize_model(self, handler):
454
- optional_fields = [
455
- "event",
456
- "groupBy",
457
- "domain",
458
- "key",
459
- "linkId",
460
- "externalId",
461
- "tenantId",
462
- "programId",
463
- "partnerId",
464
- "customerId",
465
- "interval",
466
- "start",
467
- "end",
468
- "timezone",
469
- "country",
470
- "city",
471
- "region",
472
- "continent",
473
- "device",
474
- "browser",
475
- "os",
476
- "trigger",
477
- "referer",
478
- "refererUrl",
479
- "url",
480
- "tagIds",
481
- "folderId",
482
- "groupId",
483
- "root",
484
- "saleType",
485
- "query",
486
- "tagId",
487
- "qr",
488
- "utm_source",
489
- "utm_medium",
490
- "utm_campaign",
491
- "utm_term",
492
- "utm_content",
493
- "ref",
494
- ]
495
- nullable_fields = [
496
- "utm_source",
497
- "utm_medium",
498
- "utm_campaign",
499
- "utm_term",
500
- "utm_content",
501
- "ref",
502
- ]
503
- null_default_fields = []
504
-
454
+ optional_fields = set(
455
+ [
456
+ "event",
457
+ "groupBy",
458
+ "domain",
459
+ "key",
460
+ "linkId",
461
+ "externalId",
462
+ "tenantId",
463
+ "programId",
464
+ "partnerId",
465
+ "customerId",
466
+ "interval",
467
+ "start",
468
+ "end",
469
+ "timezone",
470
+ "country",
471
+ "city",
472
+ "region",
473
+ "continent",
474
+ "device",
475
+ "browser",
476
+ "os",
477
+ "trigger",
478
+ "referer",
479
+ "refererUrl",
480
+ "url",
481
+ "tagIds",
482
+ "folderId",
483
+ "groupId",
484
+ "root",
485
+ "saleType",
486
+ "query",
487
+ "tagId",
488
+ "qr",
489
+ "utm_source",
490
+ "utm_medium",
491
+ "utm_campaign",
492
+ "utm_term",
493
+ "utm_content",
494
+ "ref",
495
+ ]
496
+ )
497
+ nullable_fields = set(
498
+ [
499
+ "utm_source",
500
+ "utm_medium",
501
+ "utm_campaign",
502
+ "utm_term",
503
+ "utm_content",
504
+ "ref",
505
+ ]
506
+ )
505
507
  serialized = handler(self)
506
-
507
508
  m = {}
508
509
 
509
510
  for n, f in type(self).model_fields.items():
510
511
  k = f.alias or n
511
512
  val = serialized.get(k)
512
- serialized.pop(k, None)
513
-
514
- optional_nullable = k in optional_fields and k in nullable_fields
515
- is_set = (
516
- self.__pydantic_fields_set__.intersection({n})
517
- or k in null_default_fields
518
- ) # pylint: disable=no-member
519
-
520
- if val is not None and val != UNSET_SENTINEL:
521
- m[k] = val
522
- elif val != UNSET_SENTINEL and (
523
- not k in optional_fields or (optional_nullable and is_set)
524
- ):
525
- m[k] = val
513
+ is_nullable_and_explicitly_set = (
514
+ k in nullable_fields
515
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
516
+ )
517
+
518
+ if val != UNSET_SENTINEL:
519
+ if (
520
+ val is not None
521
+ or k not in optional_fields
522
+ or is_nullable_and_explicitly_set
523
+ ):
524
+ m[k] = val
526
525
 
527
526
  return m
528
527
 
@@ -33,31 +33,26 @@ class RetrieveLinksRequest(BaseModel):
33
33
 
34
34
  @model_serializer(mode="wrap")
35
35
  def serialize_model(self, handler):
36
- optional_fields = ["partnerId", "tenantId"]
37
- nullable_fields = ["partnerId", "tenantId"]
38
- null_default_fields = []
39
-
36
+ optional_fields = set(["partnerId", "tenantId"])
37
+ nullable_fields = set(["partnerId", "tenantId"])
40
38
  serialized = handler(self)
41
-
42
39
  m = {}
43
40
 
44
41
  for n, f in type(self).model_fields.items():
45
42
  k = f.alias or n
46
43
  val = serialized.get(k)
47
- serialized.pop(k, None)
48
-
49
- optional_nullable = k in optional_fields and k in nullable_fields
50
- is_set = (
51
- self.__pydantic_fields_set__.intersection({n})
52
- or k in null_default_fields
53
- ) # pylint: disable=no-member
54
-
55
- if val is not None and val != UNSET_SENTINEL:
56
- m[k] = val
57
- elif val != UNSET_SENTINEL and (
58
- not k in optional_fields or (optional_nullable and is_set)
59
- ):
60
- m[k] = val
44
+ is_nullable_and_explicitly_set = (
45
+ k in nullable_fields
46
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
47
+ )
48
+
49
+ if val != UNSET_SENTINEL:
50
+ if (
51
+ val is not None
52
+ or k not in optional_fields
53
+ or is_nullable_and_explicitly_set
54
+ ):
55
+ m[k] = val
61
56
 
62
57
  return m
63
58
 
@@ -115,3 +110,19 @@ class RetrieveLinksResponseBody(BaseModel):
115
110
 
116
111
  sale_amount: Annotated[Optional[float], pydantic.Field(alias="saleAmount")] = 0
117
112
  r"""The total dollar value of sales (in cents) generated by the short link."""
113
+
114
+ @model_serializer(mode="wrap")
115
+ def serialize_model(self, handler):
116
+ optional_fields = set(["clicks", "leads", "conversions", "sales", "saleAmount"])
117
+ serialized = handler(self)
118
+ m = {}
119
+
120
+ for n, f in type(self).model_fields.items():
121
+ k = f.alias or n
122
+ val = serialized.get(k)
123
+
124
+ if val != UNSET_SENTINEL:
125
+ if val is not None or k not in optional_fields:
126
+ m[k] = val
127
+
128
+ return m
@@ -110,40 +110,37 @@ class RetrievePartnerAnalyticsRequest(BaseModel):
110
110
 
111
111
  @model_serializer(mode="wrap")
112
112
  def serialize_model(self, handler):
113
- optional_fields = [
114
- "partnerId",
115
- "tenantId",
116
- "interval",
117
- "start",
118
- "end",
119
- "timezone",
120
- "query",
121
- "groupBy",
122
- ]
123
- nullable_fields = ["partnerId", "tenantId"]
124
- null_default_fields = []
125
-
113
+ optional_fields = set(
114
+ [
115
+ "partnerId",
116
+ "tenantId",
117
+ "interval",
118
+ "start",
119
+ "end",
120
+ "timezone",
121
+ "query",
122
+ "groupBy",
123
+ ]
124
+ )
125
+ nullable_fields = set(["partnerId", "tenantId"])
126
126
  serialized = handler(self)
127
-
128
127
  m = {}
129
128
 
130
129
  for n, f in type(self).model_fields.items():
131
130
  k = f.alias or n
132
131
  val = serialized.get(k)
133
- serialized.pop(k, None)
134
-
135
- optional_nullable = k in optional_fields and k in nullable_fields
136
- is_set = (
137
- self.__pydantic_fields_set__.intersection({n})
138
- or k in null_default_fields
139
- ) # pylint: disable=no-member
140
-
141
- if val is not None and val != UNSET_SENTINEL:
142
- m[k] = val
143
- elif val != UNSET_SENTINEL and (
144
- not k in optional_fields or (optional_nullable and is_set)
145
- ):
146
- m[k] = val
132
+ is_nullable_and_explicitly_set = (
133
+ k in nullable_fields
134
+ and (self.__pydantic_fields_set__.intersection({n})) # pylint: disable=no-member
135
+ )
136
+
137
+ if val != UNSET_SENTINEL:
138
+ if (
139
+ val is not None
140
+ or k not in optional_fields
141
+ or is_nullable_and_explicitly_set
142
+ ):
143
+ m[k] = val
147
144
 
148
145
  return m
149
146