dub 0.2.2.pre.alpha.97 → 0.2.2.pre.alpha.101
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.
- checksums.yaml +4 -4
- data/lib/dub.rb +1 -0
- data/lib/open_api_sdk/commissions.rb +298 -0
- data/lib/open_api_sdk/dub.rb +2 -1
- data/lib/open_api_sdk/models/operations/createcustomer_partner.rb +4 -4
- data/lib/open_api_sdk/models/operations/createpartner_responsebody.rb +41 -23
- data/lib/open_api_sdk/models/operations/createpartner_status.rb +22 -0
- data/lib/open_api_sdk/models/operations/getcustomer_partner.rb +4 -4
- data/lib/open_api_sdk/models/operations/getcustomers_partner.rb +4 -4
- data/lib/open_api_sdk/models/operations/listcommissions_queryparam_interval.rb +25 -0
- data/lib/open_api_sdk/models/operations/listcommissions_queryparam_sortby.rb +18 -0
- data/lib/open_api_sdk/models/operations/listcommissions_queryparam_sortorder.rb +18 -0
- data/lib/open_api_sdk/models/operations/listcommissions_request.rb +60 -0
- data/lib/open_api_sdk/models/operations/listcommissions_response.rb +60 -0
- data/lib/open_api_sdk/models/operations/{updatepartnersale_responsebody.rb → listcommissions_responsebody.rb} +6 -6
- data/lib/open_api_sdk/models/operations/{updatepartnersale_status.rb → listcommissions_status.rb} +1 -1
- data/lib/open_api_sdk/models/operations/listcommissions_type.rb +19 -0
- data/lib/open_api_sdk/models/operations/queryparam_status.rb +23 -0
- data/lib/open_api_sdk/models/operations/status.rb +5 -7
- data/lib/open_api_sdk/models/operations/type.rb +1 -1
- data/lib/open_api_sdk/models/operations/updatecommission_request.rb +27 -0
- data/lib/open_api_sdk/models/operations/updatecommission_requestbody.rb +33 -0
- data/lib/open_api_sdk/models/operations/{updatepartnersale_response.rb → updatecommission_response.rb} +4 -4
- data/lib/open_api_sdk/models/operations/updatecommission_responsebody.rb +48 -0
- data/lib/open_api_sdk/models/operations/updatecommission_status.rb +23 -0
- data/lib/open_api_sdk/models/operations/updatecommission_type.rb +19 -0
- data/lib/open_api_sdk/models/operations/updatecustomer_partner.rb +4 -4
- data/lib/open_api_sdk/models/operations.rb +17 -5
- data/lib/open_api_sdk/partners.rb +0 -139
- data/lib/open_api_sdk/sdkconfiguration.rb +2 -2
- metadata +19 -6
- data/lib/open_api_sdk/models/operations/updatepartnersale_requestbody.rb +0 -36
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5649d40ee0fd4cc4703aaf822f578c915d41a0f9703643c43c02dbbfb180be22
|
4
|
+
data.tar.gz: 474cfbfdaa80bf21d83f1abefcc255a354dbb3c6e8089635ef588cbc81307c07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35631686093e25eeb130d5c896e6e31f31656c0448ca45ad909ab95f747bb8b5c8c503c2e64b4e1032bb0f2750041f1af0c28d2f5860693f3f000f04e87f034d
|
7
|
+
data.tar.gz: 10395c31eec17d77cfe898302d6b3f940e4f50fe40cb6ef4a1852decc6dcdbb5f3dd75cfd02814d298fedfd7d350a5375b0f5c85ea07a664362047a77e5c1910
|
data/lib/dub.rb
CHANGED
@@ -16,6 +16,7 @@ module OpenApiSDK
|
|
16
16
|
autoload :Track, 'open_api_sdk/track'
|
17
17
|
autoload :Customers, 'open_api_sdk/customers'
|
18
18
|
autoload :Partners, 'open_api_sdk/partners'
|
19
|
+
autoload :Commissions, 'open_api_sdk/commissions'
|
19
20
|
autoload :Workspaces, 'open_api_sdk/workspaces'
|
20
21
|
autoload :EmbedTokens, 'open_api_sdk/embed_tokens'
|
21
22
|
autoload :QRCodes, 'open_api_sdk/qr_codes'
|
@@ -0,0 +1,298 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
require 'faraday'
|
7
|
+
require 'faraday/multipart'
|
8
|
+
require 'faraday/retry'
|
9
|
+
require 'sorbet-runtime'
|
10
|
+
require_relative 'sdk_hooks/hooks'
|
11
|
+
require_relative 'utils/retries'
|
12
|
+
|
13
|
+
module OpenApiSDK
|
14
|
+
extend T::Sig
|
15
|
+
class Commissions
|
16
|
+
extend T::Sig
|
17
|
+
|
18
|
+
|
19
|
+
sig { params(sdk_config: SDKConfiguration).void }
|
20
|
+
def initialize(sdk_config)
|
21
|
+
@sdk_configuration = sdk_config
|
22
|
+
end
|
23
|
+
|
24
|
+
|
25
|
+
sig { params(request: T.nilable(::OpenApiSDK::Operations::ListCommissionsRequest), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::ListCommissionsResponse) }
|
26
|
+
def list(request, timeout_ms = nil)
|
27
|
+
# list - Get commissions for a program.
|
28
|
+
# Retrieve a list of commissions for a program.
|
29
|
+
url, params = @sdk_configuration.get_server_details
|
30
|
+
base_url = Utils.template_url(url, params)
|
31
|
+
url = "#{base_url}/commissions"
|
32
|
+
headers = {}
|
33
|
+
query_params = Utils.get_query_params(::OpenApiSDK::Operations::ListCommissionsRequest, request)
|
34
|
+
headers['Accept'] = 'application/json'
|
35
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
36
|
+
|
37
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
38
|
+
|
39
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
40
|
+
timeout ||= @sdk_configuration.timeout
|
41
|
+
|
42
|
+
connection = @sdk_configuration.client
|
43
|
+
|
44
|
+
hook_ctx = SDKHooks::HookContext.new(
|
45
|
+
base_url: base_url,
|
46
|
+
oauth2_scopes: nil,
|
47
|
+
operation_id: 'listCommissions',
|
48
|
+
security_source: @sdk_configuration.security_source
|
49
|
+
)
|
50
|
+
|
51
|
+
error = T.let(nil, T.nilable(StandardError))
|
52
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
53
|
+
|
54
|
+
begin
|
55
|
+
r = connection.get(url) do |req|
|
56
|
+
req.headers.merge!(headers)
|
57
|
+
req.options.timeout = timeout unless timeout.nil?
|
58
|
+
req.params = query_params
|
59
|
+
Utils.configure_request_security(req, security)
|
60
|
+
|
61
|
+
@sdk_configuration.hooks.before_request(
|
62
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
63
|
+
hook_ctx: hook_ctx
|
64
|
+
),
|
65
|
+
request: req
|
66
|
+
)
|
67
|
+
end
|
68
|
+
rescue StandardError => e
|
69
|
+
error = e
|
70
|
+
ensure
|
71
|
+
if r.nil? || Utils.error_status?(r.status)
|
72
|
+
r = @sdk_configuration.hooks.after_error(
|
73
|
+
error: error,
|
74
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
75
|
+
hook_ctx: hook_ctx
|
76
|
+
),
|
77
|
+
response: r
|
78
|
+
)
|
79
|
+
else
|
80
|
+
r = @sdk_configuration.hooks.after_success(
|
81
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
82
|
+
hook_ctx: hook_ctx
|
83
|
+
),
|
84
|
+
response: r
|
85
|
+
)
|
86
|
+
end
|
87
|
+
|
88
|
+
if r.nil?
|
89
|
+
raise error if !error.nil?
|
90
|
+
raise 'no response'
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
95
|
+
|
96
|
+
res = ::OpenApiSDK::Operations::ListCommissionsResponse.new(
|
97
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
98
|
+
)
|
99
|
+
if r.status == 200
|
100
|
+
if Utils.match_content_type(content_type, 'application/json')
|
101
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), T::Array[::OpenApiSDK::Operations::ListCommissionsResponseBody])
|
102
|
+
res.response_bodies = out
|
103
|
+
end
|
104
|
+
elsif r.status == 400
|
105
|
+
if Utils.match_content_type(content_type, 'application/json')
|
106
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
107
|
+
res.bad_request = out
|
108
|
+
end
|
109
|
+
elsif r.status == 401
|
110
|
+
if Utils.match_content_type(content_type, 'application/json')
|
111
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
112
|
+
res.unauthorized = out
|
113
|
+
end
|
114
|
+
elsif r.status == 403
|
115
|
+
if Utils.match_content_type(content_type, 'application/json')
|
116
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
117
|
+
res.forbidden = out
|
118
|
+
end
|
119
|
+
elsif r.status == 404
|
120
|
+
if Utils.match_content_type(content_type, 'application/json')
|
121
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
122
|
+
res.not_found = out
|
123
|
+
end
|
124
|
+
elsif r.status == 409
|
125
|
+
if Utils.match_content_type(content_type, 'application/json')
|
126
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
127
|
+
res.conflict = out
|
128
|
+
end
|
129
|
+
elsif r.status == 410
|
130
|
+
if Utils.match_content_type(content_type, 'application/json')
|
131
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
132
|
+
res.invite_expired = out
|
133
|
+
end
|
134
|
+
elsif r.status == 422
|
135
|
+
if Utils.match_content_type(content_type, 'application/json')
|
136
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
137
|
+
res.unprocessable_entity = out
|
138
|
+
end
|
139
|
+
elsif r.status == 429
|
140
|
+
if Utils.match_content_type(content_type, 'application/json')
|
141
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
142
|
+
res.rate_limit_exceeded = out
|
143
|
+
end
|
144
|
+
elsif r.status == 500
|
145
|
+
if Utils.match_content_type(content_type, 'application/json')
|
146
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
147
|
+
res.internal_server_error = out
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
res
|
152
|
+
end
|
153
|
+
|
154
|
+
|
155
|
+
sig { params(request: T.nilable(::OpenApiSDK::Operations::UpdateCommissionRequest), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::UpdateCommissionResponse) }
|
156
|
+
def update(request, timeout_ms = nil)
|
157
|
+
# update - Update a commission.
|
158
|
+
# Update an existing commission amount. This is useful for handling refunds (partial or full) or fraudulent sales.
|
159
|
+
url, params = @sdk_configuration.get_server_details
|
160
|
+
base_url = Utils.template_url(url, params)
|
161
|
+
url = Utils.generate_url(
|
162
|
+
::OpenApiSDK::Operations::UpdateCommissionRequest,
|
163
|
+
base_url,
|
164
|
+
'/commissions/{id}',
|
165
|
+
request
|
166
|
+
)
|
167
|
+
headers = {}
|
168
|
+
req_content_type, data, form = Utils.serialize_request_body(request, :request_body, :json)
|
169
|
+
headers['content-type'] = req_content_type
|
170
|
+
|
171
|
+
if form
|
172
|
+
body = Utils.encode_form(form)
|
173
|
+
elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
|
174
|
+
body = URI.encode_www_form(data)
|
175
|
+
else
|
176
|
+
body = data
|
177
|
+
end
|
178
|
+
headers['Accept'] = 'application/json'
|
179
|
+
headers['user-agent'] = @sdk_configuration.user_agent
|
180
|
+
|
181
|
+
security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
|
182
|
+
|
183
|
+
timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
|
184
|
+
timeout ||= @sdk_configuration.timeout
|
185
|
+
|
186
|
+
connection = @sdk_configuration.client
|
187
|
+
|
188
|
+
hook_ctx = SDKHooks::HookContext.new(
|
189
|
+
base_url: base_url,
|
190
|
+
oauth2_scopes: nil,
|
191
|
+
operation_id: 'updateCommission',
|
192
|
+
security_source: @sdk_configuration.security_source
|
193
|
+
)
|
194
|
+
|
195
|
+
error = T.let(nil, T.nilable(StandardError))
|
196
|
+
r = T.let(nil, T.nilable(Faraday::Response))
|
197
|
+
|
198
|
+
begin
|
199
|
+
r = connection.patch(url) do |req|
|
200
|
+
req.body = body
|
201
|
+
req.headers.merge!(headers)
|
202
|
+
req.options.timeout = timeout unless timeout.nil?
|
203
|
+
Utils.configure_request_security(req, security)
|
204
|
+
|
205
|
+
@sdk_configuration.hooks.before_request(
|
206
|
+
hook_ctx: SDKHooks::BeforeRequestHookContext.new(
|
207
|
+
hook_ctx: hook_ctx
|
208
|
+
),
|
209
|
+
request: req
|
210
|
+
)
|
211
|
+
end
|
212
|
+
rescue StandardError => e
|
213
|
+
error = e
|
214
|
+
ensure
|
215
|
+
if r.nil? || Utils.error_status?(r.status)
|
216
|
+
r = @sdk_configuration.hooks.after_error(
|
217
|
+
error: error,
|
218
|
+
hook_ctx: SDKHooks::AfterErrorHookContext.new(
|
219
|
+
hook_ctx: hook_ctx
|
220
|
+
),
|
221
|
+
response: r
|
222
|
+
)
|
223
|
+
else
|
224
|
+
r = @sdk_configuration.hooks.after_success(
|
225
|
+
hook_ctx: SDKHooks::AfterSuccessHookContext.new(
|
226
|
+
hook_ctx: hook_ctx
|
227
|
+
),
|
228
|
+
response: r
|
229
|
+
)
|
230
|
+
end
|
231
|
+
|
232
|
+
if r.nil?
|
233
|
+
raise error if !error.nil?
|
234
|
+
raise 'no response'
|
235
|
+
end
|
236
|
+
end
|
237
|
+
|
238
|
+
content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
|
239
|
+
|
240
|
+
res = ::OpenApiSDK::Operations::UpdateCommissionResponse.new(
|
241
|
+
status_code: r.status, content_type: content_type, raw_response: r
|
242
|
+
)
|
243
|
+
if r.status == 200
|
244
|
+
if Utils.match_content_type(content_type, 'application/json')
|
245
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Operations::UpdateCommissionResponseBody)
|
246
|
+
res.object = out
|
247
|
+
end
|
248
|
+
elsif r.status == 400
|
249
|
+
if Utils.match_content_type(content_type, 'application/json')
|
250
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
|
251
|
+
res.bad_request = out
|
252
|
+
end
|
253
|
+
elsif r.status == 401
|
254
|
+
if Utils.match_content_type(content_type, 'application/json')
|
255
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
|
256
|
+
res.unauthorized = out
|
257
|
+
end
|
258
|
+
elsif r.status == 403
|
259
|
+
if Utils.match_content_type(content_type, 'application/json')
|
260
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
|
261
|
+
res.forbidden = out
|
262
|
+
end
|
263
|
+
elsif r.status == 404
|
264
|
+
if Utils.match_content_type(content_type, 'application/json')
|
265
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
|
266
|
+
res.not_found = out
|
267
|
+
end
|
268
|
+
elsif r.status == 409
|
269
|
+
if Utils.match_content_type(content_type, 'application/json')
|
270
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
|
271
|
+
res.conflict = out
|
272
|
+
end
|
273
|
+
elsif r.status == 410
|
274
|
+
if Utils.match_content_type(content_type, 'application/json')
|
275
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
|
276
|
+
res.invite_expired = out
|
277
|
+
end
|
278
|
+
elsif r.status == 422
|
279
|
+
if Utils.match_content_type(content_type, 'application/json')
|
280
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
|
281
|
+
res.unprocessable_entity = out
|
282
|
+
end
|
283
|
+
elsif r.status == 429
|
284
|
+
if Utils.match_content_type(content_type, 'application/json')
|
285
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
|
286
|
+
res.rate_limit_exceeded = out
|
287
|
+
end
|
288
|
+
elsif r.status == 500
|
289
|
+
if Utils.match_content_type(content_type, 'application/json')
|
290
|
+
out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
|
291
|
+
res.internal_server_error = out
|
292
|
+
end
|
293
|
+
end
|
294
|
+
|
295
|
+
res
|
296
|
+
end
|
297
|
+
end
|
298
|
+
end
|
data/lib/open_api_sdk/dub.rb
CHANGED
@@ -16,7 +16,7 @@ module OpenApiSDK
|
|
16
16
|
class Dub
|
17
17
|
extend T::Sig
|
18
18
|
|
19
|
-
attr_accessor :links, :analytics, :events, :tags, :folders, :domains, :track, :customers, :partners, :workspaces, :embed_tokens, :qr_codes
|
19
|
+
attr_accessor :links, :analytics, :events, :tags, :folders, :domains, :track, :customers, :partners, :commissions, :workspaces, :embed_tokens, :qr_codes
|
20
20
|
|
21
21
|
sig do
|
22
22
|
params(
|
@@ -90,6 +90,7 @@ module OpenApiSDK
|
|
90
90
|
@track = Track.new(@sdk_configuration)
|
91
91
|
@customers = Customers.new(@sdk_configuration)
|
92
92
|
@partners = Partners.new(@sdk_configuration)
|
93
|
+
@commissions = Commissions.new(@sdk_configuration)
|
93
94
|
@workspaces = Workspaces.new(@sdk_configuration)
|
94
95
|
@embed_tokens = EmbedTokens.new(@sdk_configuration)
|
95
96
|
@qr_codes = QRCodes.new(@sdk_configuration)
|
@@ -11,13 +11,13 @@ module OpenApiSDK
|
|
11
11
|
class CreateCustomerPartner < ::Crystalline::FieldAugmented
|
12
12
|
extend T::Sig
|
13
13
|
|
14
|
-
|
14
|
+
# The partner's email address. Should be a unique value across Dub.
|
15
15
|
field :email, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('email') } }
|
16
|
-
|
16
|
+
# The partner's unique ID on Dub.
|
17
17
|
field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } }
|
18
|
-
|
18
|
+
# The partner's avatar image.
|
19
19
|
field :image, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('image') } }
|
20
|
-
|
20
|
+
# The partner's full legal name.
|
21
21
|
field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } }
|
22
22
|
|
23
23
|
|
@@ -11,50 +11,62 @@ module OpenApiSDK
|
|
11
11
|
class CreatePartnerResponseBody < ::Crystalline::FieldAugmented
|
12
12
|
extend T::Sig
|
13
13
|
|
14
|
-
|
14
|
+
# The total number of clicks on the partner's links.
|
15
15
|
field :clicks, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('clicks') } }
|
16
|
-
|
16
|
+
# The partner's country (required for tax purposes).
|
17
17
|
field :country, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('country') } }
|
18
|
-
|
18
|
+
# The date when the partner was created on Dub.
|
19
19
|
field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt') } }
|
20
|
-
|
20
|
+
# The total earnings/commissions accrued by the partner's links.
|
21
21
|
field :earnings, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('earnings') } }
|
22
|
-
|
22
|
+
# The partner's email address. Should be a unique value across Dub.
|
23
23
|
field :email, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('email') } }
|
24
|
-
|
24
|
+
# The partner's unique ID on Dub.
|
25
25
|
field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } }
|
26
|
-
|
26
|
+
# The partner's avatar image.
|
27
27
|
field :image, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('image') } }
|
28
|
-
|
28
|
+
# The partner's Instagram username (e.g. `johndoe`).
|
29
|
+
field :instagram, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('instagram') } }
|
30
|
+
# The total number of leads generated by the partner's links.
|
29
31
|
field :leads, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('leads') } }
|
30
|
-
|
32
|
+
# The partner's LinkedIn username (e.g. `johndoe`).
|
33
|
+
field :linkedin, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('linkedin') } }
|
34
|
+
# The partner's referral links in this program.
|
31
35
|
field :links, T::Array[::OpenApiSDK::Operations::CreatePartnerLink], { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('links') } }
|
32
|
-
|
36
|
+
# The partner's full legal name.
|
33
37
|
field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } }
|
34
|
-
|
38
|
+
# The date when the partner enabled payouts.
|
35
39
|
field :payouts_enabled_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('payoutsEnabledAt') } }
|
36
|
-
|
40
|
+
# The partner's PayPal email (for receiving payouts via PayPal).
|
37
41
|
field :paypal_email, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('paypalEmail') } }
|
38
|
-
|
42
|
+
# The program's unique ID on Dub.
|
39
43
|
field :program_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('programId') } }
|
40
|
-
|
44
|
+
# The total amount of sales (in cents) generated by the partner's links.
|
41
45
|
field :sale_amount, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('saleAmount') } }
|
42
|
-
|
46
|
+
# The total number of sales generated by the partner's links.
|
43
47
|
field :sales, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('sales') } }
|
44
|
-
|
45
|
-
field :status, ::OpenApiSDK::Operations::
|
46
|
-
|
48
|
+
# The status of the partner's enrollment in the program.
|
49
|
+
field :status, ::OpenApiSDK::Operations::CreatePartnerStatus, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Operations::CreatePartnerStatus, false) } }
|
50
|
+
# The partner's Stripe Connect ID (for receiving payouts via Stripe).
|
47
51
|
field :stripe_connect_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('stripeConnectId') } }
|
48
|
-
|
52
|
+
# 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.
|
49
53
|
field :tenant_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('tenantId') } }
|
50
|
-
|
54
|
+
# The partner's TikTok username (e.g. `johndoe`).
|
55
|
+
field :tiktok, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('tiktok') } }
|
56
|
+
# The partner's Twitter username (e.g. `johndoe`).
|
57
|
+
field :twitter, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('twitter') } }
|
58
|
+
# The partner's website URL (including the https protocol).
|
59
|
+
field :website, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('website') } }
|
60
|
+
# The partner's YouTube channel username (e.g. `johndoe`).
|
61
|
+
field :youtube, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('youtube') } }
|
62
|
+
# If the partner submitted an application to join the program, this is the ID of the application.
|
51
63
|
field :application_id, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('applicationId') } }
|
52
|
-
|
64
|
+
# A brief description of the partner and their background.
|
53
65
|
field :description, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('description') } }
|
54
66
|
|
55
67
|
|
56
|
-
sig { params(clicks: ::Float, country: ::String, created_at: ::String, earnings: ::Float, email: ::String, id: ::String, image: ::String, leads: ::Float, links: T::Array[::OpenApiSDK::Operations::CreatePartnerLink], name: ::String, payouts_enabled_at: ::String, paypal_email: ::String, program_id: ::String, sale_amount: ::Float, sales: ::Float, status: ::OpenApiSDK::Operations::
|
57
|
-
def initialize(clicks: nil, country: nil, created_at: nil, earnings: nil, email: nil, id: nil, image: nil, leads: nil, links: nil, name: nil, payouts_enabled_at: nil, paypal_email: nil, program_id: nil, sale_amount: nil, sales: nil, status: nil, stripe_connect_id: nil, tenant_id: nil, application_id: nil, description: nil)
|
68
|
+
sig { params(clicks: ::Float, country: ::String, created_at: ::String, earnings: ::Float, email: ::String, id: ::String, image: ::String, instagram: ::String, leads: ::Float, linkedin: ::String, links: T::Array[::OpenApiSDK::Operations::CreatePartnerLink], name: ::String, payouts_enabled_at: ::String, paypal_email: ::String, program_id: ::String, sale_amount: ::Float, sales: ::Float, status: ::OpenApiSDK::Operations::CreatePartnerStatus, stripe_connect_id: ::String, tenant_id: ::String, tiktok: ::String, twitter: ::String, website: ::String, youtube: ::String, application_id: T.nilable(::String), description: T.nilable(::String)).void }
|
69
|
+
def initialize(clicks: nil, country: nil, created_at: nil, earnings: nil, email: nil, id: nil, image: nil, instagram: nil, leads: nil, linkedin: nil, links: nil, name: nil, payouts_enabled_at: nil, paypal_email: nil, program_id: nil, sale_amount: nil, sales: nil, status: nil, stripe_connect_id: nil, tenant_id: nil, tiktok: nil, twitter: nil, website: nil, youtube: nil, application_id: nil, description: nil)
|
58
70
|
@clicks = clicks
|
59
71
|
@country = country
|
60
72
|
@created_at = created_at
|
@@ -62,7 +74,9 @@ module OpenApiSDK
|
|
62
74
|
@email = email
|
63
75
|
@id = id
|
64
76
|
@image = image
|
77
|
+
@instagram = instagram
|
65
78
|
@leads = leads
|
79
|
+
@linkedin = linkedin
|
66
80
|
@links = links
|
67
81
|
@name = name
|
68
82
|
@payouts_enabled_at = payouts_enabled_at
|
@@ -73,6 +87,10 @@ module OpenApiSDK
|
|
73
87
|
@status = status
|
74
88
|
@stripe_connect_id = stripe_connect_id
|
75
89
|
@tenant_id = tenant_id
|
90
|
+
@tiktok = tiktok
|
91
|
+
@twitter = twitter
|
92
|
+
@website = website
|
93
|
+
@youtube = youtube
|
76
94
|
@application_id = application_id
|
77
95
|
@description = description
|
78
96
|
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
|
7
|
+
module OpenApiSDK
|
8
|
+
module Operations
|
9
|
+
|
10
|
+
# CreatePartnerStatus - The status of the partner's enrollment in the program.
|
11
|
+
class CreatePartnerStatus < T::Enum
|
12
|
+
enums do
|
13
|
+
PENDING = new('pending')
|
14
|
+
APPROVED = new('approved')
|
15
|
+
REJECTED = new('rejected')
|
16
|
+
INVITED = new('invited')
|
17
|
+
DECLINED = new('declined')
|
18
|
+
BANNED = new('banned')
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -11,13 +11,13 @@ module OpenApiSDK
|
|
11
11
|
class GetCustomerPartner < ::Crystalline::FieldAugmented
|
12
12
|
extend T::Sig
|
13
13
|
|
14
|
-
|
14
|
+
# The partner's email address. Should be a unique value across Dub.
|
15
15
|
field :email, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('email') } }
|
16
|
-
|
16
|
+
# The partner's unique ID on Dub.
|
17
17
|
field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } }
|
18
|
-
|
18
|
+
# The partner's avatar image.
|
19
19
|
field :image, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('image') } }
|
20
|
-
|
20
|
+
# The partner's full legal name.
|
21
21
|
field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } }
|
22
22
|
|
23
23
|
|
@@ -11,13 +11,13 @@ module OpenApiSDK
|
|
11
11
|
class GetCustomersPartner < ::Crystalline::FieldAugmented
|
12
12
|
extend T::Sig
|
13
13
|
|
14
|
-
|
14
|
+
# The partner's email address. Should be a unique value across Dub.
|
15
15
|
field :email, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('email') } }
|
16
|
-
|
16
|
+
# The partner's unique ID on Dub.
|
17
17
|
field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } }
|
18
|
-
|
18
|
+
# The partner's avatar image.
|
19
19
|
field :image, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('image') } }
|
20
|
-
|
20
|
+
# The partner's full legal name.
|
21
21
|
field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } }
|
22
22
|
|
23
23
|
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
|
7
|
+
module OpenApiSDK
|
8
|
+
module Operations
|
9
|
+
|
10
|
+
# ListCommissionsQueryParamInterval - The interval to retrieve commissions for.
|
11
|
+
class ListCommissionsQueryParamInterval < T::Enum
|
12
|
+
enums do
|
13
|
+
TWENTY_FOURH = new('24h')
|
14
|
+
SEVEND = new('7d')
|
15
|
+
THIRTYD = new('30d')
|
16
|
+
NINETYD = new('90d')
|
17
|
+
ONEY = new('1y')
|
18
|
+
MTD = new('mtd')
|
19
|
+
QTD = new('qtd')
|
20
|
+
YTD = new('ytd')
|
21
|
+
ALL = new('all')
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
|
7
|
+
module OpenApiSDK
|
8
|
+
module Operations
|
9
|
+
|
10
|
+
# ListCommissionsQueryParamSortBy - The field to sort the list of commissions by.
|
11
|
+
class ListCommissionsQueryParamSortBy < T::Enum
|
12
|
+
enums do
|
13
|
+
CREATED_AT = new('createdAt')
|
14
|
+
AMOUNT = new('amount')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
|
7
|
+
module OpenApiSDK
|
8
|
+
module Operations
|
9
|
+
|
10
|
+
# ListCommissionsQueryParamSortOrder - The sort order for the list of commissions.
|
11
|
+
class ListCommissionsQueryParamSortOrder < T::Enum
|
12
|
+
enums do
|
13
|
+
ASC = new('asc')
|
14
|
+
DESC = new('desc')
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1,60 @@
|
|
1
|
+
# Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
2
|
+
|
3
|
+
# typed: true
|
4
|
+
# frozen_string_literal: true
|
5
|
+
|
6
|
+
|
7
|
+
module OpenApiSDK
|
8
|
+
module Operations
|
9
|
+
|
10
|
+
|
11
|
+
class ListCommissionsRequest < ::Crystalline::FieldAugmented
|
12
|
+
extend T::Sig
|
13
|
+
|
14
|
+
# Filter the list of commissions by the associated customer.
|
15
|
+
field :customer_id, T.nilable(::String), { 'query_param': { 'field_name': 'customerId', 'style': 'form', 'explode': true } }
|
16
|
+
# The end date of the date range to filter the commissions by.
|
17
|
+
field :end_, T.nilable(::String), { 'query_param': { 'field_name': 'end', 'style': 'form', 'explode': true } }
|
18
|
+
# The interval to retrieve commissions for.
|
19
|
+
field :interval, T.nilable(::OpenApiSDK::Operations::ListCommissionsQueryParamInterval), { 'query_param': { 'field_name': 'interval', 'style': 'form', 'explode': true } }
|
20
|
+
# 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.
|
21
|
+
field :invoice_id, T.nilable(::String), { 'query_param': { 'field_name': 'invoiceId', 'style': 'form', 'explode': true } }
|
22
|
+
# The page number for pagination.
|
23
|
+
field :page, T.nilable(::Float), { 'query_param': { 'field_name': 'page', 'style': 'form', 'explode': true } }
|
24
|
+
# The number of items per page.
|
25
|
+
field :page_size, T.nilable(::Float), { 'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': true } }
|
26
|
+
# Filter the list of commissions by the associated partner.
|
27
|
+
field :partner_id, T.nilable(::String), { 'query_param': { 'field_name': 'partnerId', 'style': 'form', 'explode': true } }
|
28
|
+
# Filter the list of commissions by the associated payout.
|
29
|
+
field :payout_id, T.nilable(::String), { 'query_param': { 'field_name': 'payoutId', 'style': 'form', 'explode': true } }
|
30
|
+
# The field to sort the list of commissions by.
|
31
|
+
field :sort_by, T.nilable(::OpenApiSDK::Operations::ListCommissionsQueryParamSortBy), { 'query_param': { 'field_name': 'sortBy', 'style': 'form', 'explode': true } }
|
32
|
+
# The sort order for the list of commissions.
|
33
|
+
field :sort_order, T.nilable(::OpenApiSDK::Operations::ListCommissionsQueryParamSortOrder), { 'query_param': { 'field_name': 'sortOrder', 'style': 'form', 'explode': true } }
|
34
|
+
# The start date of the date range to filter the commissions by.
|
35
|
+
field :start, T.nilable(::String), { 'query_param': { 'field_name': 'start', 'style': 'form', 'explode': true } }
|
36
|
+
# Filter the list of commissions by their corresponding status.
|
37
|
+
field :status, T.nilable(::OpenApiSDK::Operations::QueryParamStatus), { 'query_param': { 'field_name': 'status', 'style': 'form', 'explode': true } }
|
38
|
+
|
39
|
+
field :type, T.nilable(::OpenApiSDK::Operations::Type), { 'query_param': { 'field_name': 'type', 'style': 'form', 'explode': true } }
|
40
|
+
|
41
|
+
|
42
|
+
sig { params(customer_id: T.nilable(::String), end_: T.nilable(::String), interval: T.nilable(::OpenApiSDK::Operations::ListCommissionsQueryParamInterval), invoice_id: T.nilable(::String), page: T.nilable(::Float), page_size: T.nilable(::Float), partner_id: T.nilable(::String), payout_id: T.nilable(::String), sort_by: T.nilable(::OpenApiSDK::Operations::ListCommissionsQueryParamSortBy), sort_order: T.nilable(::OpenApiSDK::Operations::ListCommissionsQueryParamSortOrder), start: T.nilable(::String), status: T.nilable(::OpenApiSDK::Operations::QueryParamStatus), type: T.nilable(::OpenApiSDK::Operations::Type)).void }
|
43
|
+
def initialize(customer_id: nil, end_: nil, interval: nil, invoice_id: nil, page: nil, page_size: nil, partner_id: nil, payout_id: nil, sort_by: nil, sort_order: nil, start: nil, status: nil, type: nil)
|
44
|
+
@customer_id = customer_id
|
45
|
+
@end_ = end_
|
46
|
+
@interval = interval
|
47
|
+
@invoice_id = invoice_id
|
48
|
+
@page = page
|
49
|
+
@page_size = page_size
|
50
|
+
@partner_id = partner_id
|
51
|
+
@payout_id = payout_id
|
52
|
+
@sort_by = sort_by
|
53
|
+
@sort_order = sort_order
|
54
|
+
@start = start
|
55
|
+
@status = status
|
56
|
+
@type = type
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|