dub 0.34.1__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/models/components/__init__.py +108 -26
  4. dub/models/components/analyticsbrowsers.py +18 -1
  5. dub/models/components/analyticscities.py +18 -1
  6. dub/models/components/analyticscontinents.py +18 -1
  7. dub/models/components/analyticscount.py +18 -1
  8. dub/models/components/analyticscountries.py +20 -1
  9. dub/models/components/analyticsdevices.py +18 -1
  10. dub/models/components/analyticsos.py +18 -1
  11. dub/models/components/analyticsreferers.py +18 -1
  12. dub/models/components/analyticsrefererurls.py +18 -1
  13. dub/models/components/analyticsregions.py +18 -1
  14. dub/models/components/analyticstimeseries.py +18 -1
  15. dub/models/components/analyticstoplinks.py +16 -26
  16. dub/models/components/analyticstopurls.py +18 -1
  17. dub/models/components/analyticstriggers.py +18 -1
  18. dub/models/components/commissioncreatedevent.py +96 -64
  19. dub/models/components/domainschema.py +31 -50
  20. dub/models/components/folderschema.py +18 -19
  21. dub/models/components/leadcreatedevent.py +151 -134
  22. dub/models/components/linkclickedevent.py +57 -70
  23. dub/models/components/linkschema.py +63 -64
  24. dub/models/components/linkwebhookevent.py +43 -51
  25. dub/models/components/partneranalyticscount.py +18 -1
  26. dub/models/components/partneranalyticstimeseries.py +18 -1
  27. dub/models/components/partneranalyticstoplinks.py +16 -27
  28. dub/models/components/partnerapplicationsubmittedevent.py +42 -75
  29. dub/models/components/partnerenrolledevent.py +477 -83
  30. dub/models/components/salecreatedevent.py +152 -151
  31. dub/models/errors/badrequest.py +18 -1
  32. dub/models/errors/conflict.py +18 -1
  33. dub/models/errors/forbidden.py +18 -1
  34. dub/models/errors/internalservererror.py +18 -1
  35. dub/models/errors/inviteexpired.py +18 -1
  36. dub/models/errors/notfound.py +18 -1
  37. dub/models/errors/ratelimitexceeded.py +18 -1
  38. dub/models/errors/unauthorized.py +18 -1
  39. dub/models/errors/unprocessableentity.py +18 -1
  40. dub/models/operations/__init__.py +230 -19
  41. dub/models/operations/approvebountysubmission.py +71 -45
  42. dub/models/operations/banpartner.py +14 -19
  43. dub/models/operations/bulkcreatelinks.py +86 -87
  44. dub/models/operations/bulkupdatelinks.py +97 -82
  45. dub/models/operations/checkdomainstatus.py +1 -17
  46. dub/models/operations/createdomain.py +33 -34
  47. dub/models/operations/createfolder.py +18 -19
  48. dub/models/operations/createlink.py +86 -87
  49. dub/models/operations/createpartner.py +560 -168
  50. dub/models/operations/createpartnerlink.py +74 -85
  51. dub/models/operations/createreferralsembedtoken.py +99 -87
  52. dub/models/operations/createtag.py +18 -1
  53. dub/models/operations/deactivatepartner.py +65 -0
  54. dub/models/operations/getcustomer.py +106 -105
  55. dub/models/operations/getcustomers.py +123 -105
  56. dub/models/operations/getlinkinfo.py +18 -1
  57. dub/models/operations/getlinks.py +36 -1
  58. dub/models/operations/getlinkscount.py +32 -1
  59. dub/models/operations/getqrcode.py +29 -1
  60. dub/models/operations/gettags.py +20 -1
  61. dub/models/operations/listbountysubmissions.py +63 -26
  62. dub/models/operations/listcommissions.py +129 -64
  63. dub/models/operations/listdomains.py +18 -1
  64. dub/models/operations/listevents.py +414 -389
  65. dub/models/operations/listfolders.py +18 -1
  66. dub/models/operations/listpartners.py +510 -84
  67. dub/models/operations/registerdomain.py +1 -17
  68. dub/models/operations/rejectbountysubmission.py +71 -26
  69. dub/models/operations/retrieveanalytics.py +65 -66
  70. dub/models/operations/retrievelinks.py +30 -19
  71. dub/models/operations/retrievepartneranalytics.py +25 -28
  72. dub/models/operations/tracklead.py +38 -83
  73. dub/models/operations/tracksale.py +52 -95
  74. dub/models/operations/updatecommission.py +126 -64
  75. dub/models/operations/updatecustomer.py +122 -131
  76. dub/models/operations/updatedomain.py +50 -35
  77. dub/models/operations/updatefolder.py +34 -19
  78. dub/models/operations/updatelink.py +101 -86
  79. dub/models/operations/updatetag.py +34 -1
  80. dub/models/operations/upsertlink.py +86 -87
  81. dub/models/operations/upsertpartnerlink.py +72 -78
  82. dub/partners.py +288 -0
  83. dub/sdk.py +0 -3
  84. dub/utils/__init__.py +10 -1
  85. {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/METADATA +4 -8
  86. dub-0.35.0.dist-info/RECORD +143 -0
  87. dub/models/components/workspaceschema.py +0 -328
  88. dub/models/operations/getworkspace.py +0 -21
  89. dub/models/operations/updateworkspace.py +0 -78
  90. dub/workspaces.py +0 -561
  91. dub-0.34.1.dist-info/RECORD +0 -146
  92. {dub-0.34.1.dist-info → dub-0.35.0.dist-info}/WHEEL +0 -0
  93. {dub-0.34.1.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
@@ -38,10 +38,28 @@ class RejectBountySubmissionRequestBody(BaseModel):
38
38
  )
39
39
  r"""The note for rejecting the submission."""
40
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
+
41
57
 
42
58
  class RejectBountySubmissionRequestTypedDict(TypedDict):
43
59
  bounty_id: str
60
+ r"""The ID of the bounty"""
44
61
  submission_id: str
62
+ r"""The ID of the bounty submission"""
45
63
  request_body: NotRequired[RejectBountySubmissionRequestBodyTypedDict]
46
64
 
47
65
 
@@ -51,34 +69,60 @@ class RejectBountySubmissionRequest(BaseModel):
51
69
  pydantic.Field(alias="bountyId"),
52
70
  FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
53
71
  ]
72
+ r"""The ID of the bounty"""
54
73
 
55
74
  submission_id: Annotated[
56
75
  str,
57
76
  pydantic.Field(alias="submissionId"),
58
77
  FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
59
78
  ]
79
+ r"""The ID of the bounty submission"""
60
80
 
61
81
  request_body: Annotated[
62
82
  Optional[RejectBountySubmissionRequestBody],
63
83
  FieldMetadata(request=RequestMetadata(media_type="application/json")),
64
84
  ] = None
65
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
+
66
102
 
67
103
  class RejectBountySubmissionFilesTypedDict(TypedDict):
68
104
  url: str
105
+ r"""The URL of the uploaded file."""
69
106
  file_name: str
107
+ r"""The original file name."""
70
108
  size: float
109
+ r"""The file size in bytes."""
71
110
 
72
111
 
73
112
  class RejectBountySubmissionFiles(BaseModel):
74
113
  url: str
114
+ r"""The URL of the uploaded file."""
75
115
 
76
116
  file_name: Annotated[str, pydantic.Field(alias="fileName")]
117
+ r"""The original file name."""
77
118
 
78
119
  size: float
120
+ r"""The file size in bytes."""
79
121
 
80
122
 
81
123
  class RejectBountySubmissionStatus(str, Enum):
124
+ r"""The status of the submission"""
125
+
82
126
  DRAFT = "draft"
83
127
  SUBMITTED = "submitted"
84
128
  APPROVED = "approved"
@@ -89,86 +133,87 @@ class RejectBountySubmissionResponseBodyTypedDict(TypedDict):
89
133
  r"""The rejected bounty submission."""
90
134
 
91
135
  id: str
136
+ r"""The ID of the bounty submission"""
92
137
  bounty_id: str
138
+ r"""The ID of the bounty"""
93
139
  partner_id: str
140
+ r"""The ID of the partner"""
94
141
  description: Nullable[str]
142
+ r"""The description of the submission"""
95
143
  urls: Nullable[List[str]]
144
+ r"""The URLs submitted for the submission"""
96
145
  files: Nullable[List[RejectBountySubmissionFilesTypedDict]]
146
+ r"""The files uploaded for the submission"""
97
147
  status: RejectBountySubmissionStatus
148
+ r"""The status of the submission"""
98
149
  performance_count: Nullable[float]
150
+ r"""The performance count of the submission"""
99
151
  created_at: str
152
+ r"""The date and time the submission was created"""
100
153
  completed_at: Nullable[str]
154
+ r"""The date and time the submission was completed"""
101
155
  reviewed_at: Nullable[str]
156
+ r"""The date and time the submission was reviewed"""
102
157
  rejection_reason: Nullable[str]
158
+ r"""The reason for rejecting the submission"""
103
159
  rejection_note: Nullable[str]
160
+ r"""The note for rejecting the submission"""
104
161
 
105
162
 
106
163
  class RejectBountySubmissionResponseBody(BaseModel):
107
164
  r"""The rejected bounty submission."""
108
165
 
109
166
  id: str
167
+ r"""The ID of the bounty submission"""
110
168
 
111
169
  bounty_id: Annotated[str, pydantic.Field(alias="bountyId")]
170
+ r"""The ID of the bounty"""
112
171
 
113
172
  partner_id: Annotated[str, pydantic.Field(alias="partnerId")]
173
+ r"""The ID of the partner"""
114
174
 
115
175
  description: Nullable[str]
176
+ r"""The description of the submission"""
116
177
 
117
178
  urls: Nullable[List[str]]
179
+ r"""The URLs submitted for the submission"""
118
180
 
119
181
  files: Nullable[List[RejectBountySubmissionFiles]]
182
+ r"""The files uploaded for the submission"""
120
183
 
121
184
  status: RejectBountySubmissionStatus
185
+ r"""The status of the submission"""
122
186
 
123
187
  performance_count: Annotated[
124
188
  Nullable[float], pydantic.Field(alias="performanceCount")
125
189
  ]
190
+ r"""The performance count of the submission"""
126
191
 
127
192
  created_at: Annotated[str, pydantic.Field(alias="createdAt")]
193
+ r"""The date and time the submission was created"""
128
194
 
129
195
  completed_at: Annotated[Nullable[str], pydantic.Field(alias="completedAt")]
196
+ r"""The date and time the submission was completed"""
130
197
 
131
198
  reviewed_at: Annotated[Nullable[str], pydantic.Field(alias="reviewedAt")]
199
+ r"""The date and time the submission was reviewed"""
132
200
 
133
201
  rejection_reason: Annotated[Nullable[str], pydantic.Field(alias="rejectionReason")]
202
+ r"""The reason for rejecting the submission"""
134
203
 
135
204
  rejection_note: Annotated[Nullable[str], pydantic.Field(alias="rejectionNote")]
205
+ r"""The note for rejecting the submission"""
136
206
 
137
207
  @model_serializer(mode="wrap")
138
208
  def serialize_model(self, handler):
139
- optional_fields = []
140
- nullable_fields = [
141
- "description",
142
- "urls",
143
- "files",
144
- "performanceCount",
145
- "completedAt",
146
- "reviewedAt",
147
- "rejectionReason",
148
- "rejectionNote",
149
- ]
150
- null_default_fields = []
151
-
152
209
  serialized = handler(self)
153
-
154
210
  m = {}
155
211
 
156
212
  for n, f in type(self).model_fields.items():
157
213
  k = f.alias or n
158
214
  val = serialized.get(k)
159
- serialized.pop(k, None)
160
-
161
- optional_nullable = k in optional_fields and k in nullable_fields
162
- is_set = (
163
- self.__pydantic_fields_set__.intersection({n})
164
- or k in null_default_fields
165
- ) # pylint: disable=no-member
166
215
 
167
- if val is not None and val != UNSET_SENTINEL:
168
- m[k] = val
169
- elif val != UNSET_SENTINEL and (
170
- not k in optional_fields or (optional_nullable and is_set)
171
- ):
216
+ if val != UNSET_SENTINEL:
172
217
  m[k] = val
173
218
 
174
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