dub 0.2.2.pre.alpha.99 → 0.2.2.pre.alpha.103

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 (30) hide show
  1. checksums.yaml +4 -4
  2. data/lib/dub.rb +1 -0
  3. data/lib/open_api_sdk/commissions.rb +298 -0
  4. data/lib/open_api_sdk/dub.rb +2 -1
  5. data/lib/open_api_sdk/models/operations/createpartner_responsebody.rb +2 -2
  6. data/lib/open_api_sdk/models/operations/createpartner_status.rb +22 -0
  7. data/lib/open_api_sdk/models/operations/listcommissions_queryparam_interval.rb +25 -0
  8. data/lib/open_api_sdk/models/operations/listcommissions_queryparam_sortby.rb +18 -0
  9. data/lib/open_api_sdk/models/operations/listcommissions_queryparam_sortorder.rb +18 -0
  10. data/lib/open_api_sdk/models/operations/listcommissions_request.rb +60 -0
  11. data/lib/open_api_sdk/models/operations/listcommissions_response.rb +60 -0
  12. data/lib/open_api_sdk/models/operations/{updatepartnersale_responsebody.rb → listcommissions_responsebody.rb} +6 -6
  13. data/lib/open_api_sdk/models/operations/{updatepartnersale_status.rb → listcommissions_status.rb} +1 -1
  14. data/lib/open_api_sdk/models/operations/listcommissions_type.rb +19 -0
  15. data/lib/open_api_sdk/models/operations/listfolders_request.rb +2 -5
  16. data/lib/open_api_sdk/models/operations/queryparam_status.rb +23 -0
  17. data/lib/open_api_sdk/models/operations/status.rb +5 -7
  18. data/lib/open_api_sdk/models/operations/type.rb +1 -1
  19. data/lib/open_api_sdk/models/operations/updatecommission_request.rb +27 -0
  20. data/lib/open_api_sdk/models/operations/updatecommission_requestbody.rb +33 -0
  21. data/lib/open_api_sdk/models/operations/{updatepartnersale_response.rb → updatecommission_response.rb} +4 -4
  22. data/lib/open_api_sdk/models/operations/updatecommission_responsebody.rb +48 -0
  23. data/lib/open_api_sdk/models/operations/updatecommission_status.rb +23 -0
  24. data/lib/open_api_sdk/models/operations/updatecommission_type.rb +19 -0
  25. data/lib/open_api_sdk/models/operations.rb +17 -5
  26. data/lib/open_api_sdk/models/shared/folderschema.rb +2 -5
  27. data/lib/open_api_sdk/partners.rb +0 -139
  28. data/lib/open_api_sdk/sdkconfiguration.rb +2 -2
  29. metadata +19 -6
  30. 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: 74ce17506ef15256bb058d9f57c8a40f1675295748496ebdbbf5e17ce453193e
4
- data.tar.gz: df63a4ca77053b430cc927dbbdd63d16399911b96924b43f5a0ef3aeea820a6e
3
+ metadata.gz: 439d1e5a6ac73824311d71aee1d046eb7204fcebe3a00fbedec29555f170daec
4
+ data.tar.gz: 8bdd284b68dbba46e0819d52f7382ed835fb6e08ea59b2f1884193dbfe77e4f5
5
5
  SHA512:
6
- metadata.gz: d264499aca5ef489e5f7bc89200a4151c72d53ee36a339eb4513558cabb82d1693ecb28cdf4200edb85bf1f2728f91fe6e3a5d1aa5e862a4a5c9509b5b870386
7
- data.tar.gz: 0edbd95d10f64d78b9853bd0521730cee8d37297e0d3365330939c9d0d3363c1eecf80b27f6d9ac7843b4a183f085cffb14eab0c220b79c8ef979287e803b2c8
6
+ metadata.gz: 463cfcb15f6752aeada49c8611e63197c3def1e82eb7ed3facb381509e462d743db96ec4afc5329ed97cfaf4c975521ac2c96144e8c172d67841bd1ab954b247
7
+ data.tar.gz: 8a349bbc7d1dea2dda563dc90a5e81ecd1801d7610e5982f96b06230ee03073b0f85d8b7dd83ebbb80578cd2f784c935840f2ae4147e32d8ae8fc4cafd2437cc
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
@@ -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)
@@ -46,7 +46,7 @@ module OpenApiSDK
46
46
  # The total number of sales generated by the partner's links.
47
47
  field :sales, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('sales') } }
48
48
  # The status of the partner's enrollment in the program.
49
- field :status, ::OpenApiSDK::Operations::Status, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Operations::Status, false) } }
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
50
  # The partner's Stripe Connect ID (for receiving payouts via Stripe).
51
51
  field :stripe_connect_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('stripeConnectId') } }
52
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.
@@ -65,7 +65,7 @@ module OpenApiSDK
65
65
  field :description, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('description') } }
66
66
 
67
67
 
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::Status, 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 }
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
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)
70
70
  @clicks = clicks
71
71
  @country = country
@@ -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
@@ -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
@@ -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 ListCommissionsResponse < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # HTTP response content type for this operation
15
+ field :content_type, ::String
16
+ # Raw HTTP response; suitable for custom response parsing
17
+ field :raw_response, ::Faraday::Response
18
+ # HTTP response status code for this operation
19
+ field :status_code, ::Integer
20
+ # The server cannot or will not process the request due to something that is perceived to be a client error (e.g., malformed request syntax, invalid request message framing, or deceptive request routing).
21
+ field :bad_request, T.nilable(::OpenApiSDK::Shared::BadRequest)
22
+ # This response is sent when a request conflicts with the current state of the server.
23
+ field :conflict, T.nilable(::OpenApiSDK::Shared::Conflict)
24
+ # The client does not have access rights to the content; that is, it is unauthorized, so the server is refusing to give the requested resource. Unlike 401 Unauthorized, the client's identity is known to the server.
25
+ field :forbidden, T.nilable(::OpenApiSDK::Shared::Forbidden)
26
+ # The server has encountered a situation it does not know how to handle.
27
+ field :internal_server_error, T.nilable(::OpenApiSDK::Shared::InternalServerError)
28
+ # This response is sent when the requested content has been permanently deleted from server, with no forwarding address.
29
+ field :invite_expired, T.nilable(::OpenApiSDK::Shared::InviteExpired)
30
+ # The server cannot find the requested resource.
31
+ field :not_found, T.nilable(::OpenApiSDK::Shared::NotFound)
32
+ # The user has sent too many requests in a given amount of time ("rate limiting")
33
+ field :rate_limit_exceeded, T.nilable(::OpenApiSDK::Shared::RateLimitExceeded)
34
+ # The list of commissions.
35
+ field :response_bodies, T.nilable(T::Array[::OpenApiSDK::Operations::ListCommissionsResponseBody])
36
+ # Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
37
+ field :unauthorized, T.nilable(::OpenApiSDK::Shared::Unauthorized)
38
+ # The request was well-formed but was unable to be followed due to semantic errors.
39
+ field :unprocessable_entity, T.nilable(::OpenApiSDK::Shared::UnprocessableEntity)
40
+
41
+
42
+ sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, bad_request: T.nilable(::OpenApiSDK::Shared::BadRequest), conflict: T.nilable(::OpenApiSDK::Shared::Conflict), forbidden: T.nilable(::OpenApiSDK::Shared::Forbidden), internal_server_error: T.nilable(::OpenApiSDK::Shared::InternalServerError), invite_expired: T.nilable(::OpenApiSDK::Shared::InviteExpired), not_found: T.nilable(::OpenApiSDK::Shared::NotFound), rate_limit_exceeded: T.nilable(::OpenApiSDK::Shared::RateLimitExceeded), response_bodies: T.nilable(T::Array[::OpenApiSDK::Operations::ListCommissionsResponseBody]), unauthorized: T.nilable(::OpenApiSDK::Shared::Unauthorized), unprocessable_entity: T.nilable(::OpenApiSDK::Shared::UnprocessableEntity)).void }
43
+ def initialize(content_type: nil, raw_response: nil, status_code: nil, bad_request: nil, conflict: nil, forbidden: nil, internal_server_error: nil, invite_expired: nil, not_found: nil, rate_limit_exceeded: nil, response_bodies: nil, unauthorized: nil, unprocessable_entity: nil)
44
+ @content_type = content_type
45
+ @raw_response = raw_response
46
+ @status_code = status_code
47
+ @bad_request = bad_request
48
+ @conflict = conflict
49
+ @forbidden = forbidden
50
+ @internal_server_error = internal_server_error
51
+ @invite_expired = invite_expired
52
+ @not_found = not_found
53
+ @rate_limit_exceeded = rate_limit_exceeded
54
+ @response_bodies = response_bodies
55
+ @unauthorized = unauthorized
56
+ @unprocessable_entity = unprocessable_entity
57
+ end
58
+ end
59
+ end
60
+ end
@@ -7,8 +7,8 @@
7
7
  module OpenApiSDK
8
8
  module Operations
9
9
 
10
- # The updated sale.
11
- class UpdatePartnerSaleResponseBody < ::Crystalline::FieldAugmented
10
+
11
+ class ListCommissionsResponseBody < ::Crystalline::FieldAugmented
12
12
  extend T::Sig
13
13
 
14
14
 
@@ -19,19 +19,19 @@ module OpenApiSDK
19
19
  field :currency, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency') } }
20
20
 
21
21
  field :earnings, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('earnings') } }
22
-
22
+ # The commission's unique ID on Dub.
23
23
  field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } }
24
24
 
25
- field :status, ::OpenApiSDK::Operations::UpdatePartnerSaleStatus, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Operations::UpdatePartnerSaleStatus, false) } }
25
+ field :status, ::OpenApiSDK::Operations::ListCommissionsStatus, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Operations::ListCommissionsStatus, false) } }
26
26
 
27
27
  field :updated_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('updatedAt') } }
28
28
 
29
29
  field :invoice_id, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId') } }
30
30
 
31
- field :type, T.nilable(::OpenApiSDK::Operations::Type), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Operations::Type, true) } }
31
+ field :type, T.nilable(::OpenApiSDK::Operations::ListCommissionsType), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Operations::ListCommissionsType, true) } }
32
32
 
33
33
 
34
- sig { params(amount: ::Float, created_at: ::String, currency: ::String, earnings: ::Float, id: ::String, status: ::OpenApiSDK::Operations::UpdatePartnerSaleStatus, updated_at: ::String, invoice_id: T.nilable(::String), type: T.nilable(::OpenApiSDK::Operations::Type)).void }
34
+ sig { params(amount: ::Float, created_at: ::String, currency: ::String, earnings: ::Float, id: ::String, status: ::OpenApiSDK::Operations::ListCommissionsStatus, updated_at: ::String, invoice_id: T.nilable(::String), type: T.nilable(::OpenApiSDK::Operations::ListCommissionsType)).void }
35
35
  def initialize(amount: nil, created_at: nil, currency: nil, earnings: nil, id: nil, status: nil, updated_at: nil, invoice_id: nil, type: nil)
36
36
  @amount = amount
37
37
  @created_at = created_at
@@ -8,7 +8,7 @@ module OpenApiSDK
8
8
  module Operations
9
9
 
10
10
 
11
- class UpdatePartnerSaleStatus < T::Enum
11
+ class ListCommissionsStatus < T::Enum
12
12
  enums do
13
13
  PENDING = new('pending')
14
14
  PROCESSED = new('processed')
@@ -0,0 +1,19 @@
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 ListCommissionsType < T::Enum
12
+ enums do
13
+ CLICK = new('click')
14
+ LEAD = new('lead')
15
+ SALE = new('sale')
16
+ end
17
+ end
18
+ end
19
+ end
@@ -11,8 +11,6 @@ module OpenApiSDK
11
11
  class ListFoldersRequest < ::Crystalline::FieldAugmented
12
12
  extend T::Sig
13
13
 
14
- # Whether to include the link count in the response.
15
- field :include_link_count, T.nilable(T::Boolean), { 'query_param': { 'field_name': 'includeLinkCount', 'style': 'form', 'explode': true } }
16
14
  # The page number for pagination.
17
15
  field :page, T.nilable(::Float), { 'query_param': { 'field_name': 'page', 'style': 'form', 'explode': true } }
18
16
  # The number of items per page.
@@ -21,9 +19,8 @@ module OpenApiSDK
21
19
  field :search, T.nilable(::String), { 'query_param': { 'field_name': 'search', 'style': 'form', 'explode': true } }
22
20
 
23
21
 
24
- sig { params(include_link_count: T.nilable(T::Boolean), page: T.nilable(::Float), page_size: T.nilable(::Float), search: T.nilable(::String)).void }
25
- def initialize(include_link_count: nil, page: nil, page_size: nil, search: nil)
26
- @include_link_count = include_link_count
22
+ sig { params(page: T.nilable(::Float), page_size: T.nilable(::Float), search: T.nilable(::String)).void }
23
+ def initialize(page: nil, page_size: nil, search: nil)
27
24
  @page = page
28
25
  @page_size = page_size
29
26
  @search = search
@@ -0,0 +1,23 @@
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
+ # QueryParamStatus - Filter the list of commissions by their corresponding status.
11
+ class QueryParamStatus < T::Enum
12
+ enums do
13
+ PENDING = new('pending')
14
+ PROCESSED = new('processed')
15
+ PAID = new('paid')
16
+ REFUNDED = new('refunded')
17
+ DUPLICATE = new('duplicate')
18
+ FRAUD = new('fraud')
19
+ CANCELED = new('canceled')
20
+ end
21
+ end
22
+ end
23
+ end
@@ -7,15 +7,13 @@
7
7
  module OpenApiSDK
8
8
  module Operations
9
9
 
10
- # Status - The status of the partner's enrollment in the program.
10
+ # Status - Useful for marking a commission as refunded, duplicate, canceled, or fraudulent. Takes precedence over `amount` and `modifyAmount`. When a commission is marked as refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated.
11
11
  class Status < T::Enum
12
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')
13
+ REFUNDED = new('refunded')
14
+ DUPLICATE = new('duplicate')
15
+ CANCELED = new('canceled')
16
+ FRAUD = new('fraud')
19
17
  end
20
18
  end
21
19
  end
@@ -7,7 +7,7 @@
7
7
  module OpenApiSDK
8
8
  module Operations
9
9
 
10
-
10
+ # Type
11
11
  class Type < T::Enum
12
12
  enums do
13
13
  CLICK = new('click')
@@ -0,0 +1,27 @@
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 UpdateCommissionRequest < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The commission's unique ID on Dub.
15
+ field :id, ::String, { 'path_param': { 'field_name': 'id', 'style': 'simple', 'explode': false } }
16
+
17
+ field :request_body, T.nilable(::OpenApiSDK::Operations::UpdateCommissionRequestBody), { 'request': { 'media_type': 'application/json' } }
18
+
19
+
20
+ sig { params(id: ::String, request_body: T.nilable(::OpenApiSDK::Operations::UpdateCommissionRequestBody)).void }
21
+ def initialize(id: nil, request_body: nil)
22
+ @id = id
23
+ @request_body = request_body
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,33 @@
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 UpdateCommissionRequestBody < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+ # The new absolute amount for the sale. Paid commissions cannot be updated.
15
+ field :amount, T.nilable(::Float), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount') } }
16
+ # The currency of the sale amount to update. Accepts ISO 4217 currency codes.
17
+ field :currency, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency') } }
18
+ # Modify the current sale amount: use positive values to increase the amount, negative values to decrease it. Takes precedence over `amount`. Paid commissions cannot be updated.
19
+ field :modify_amount, T.nilable(::Float), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('modifyAmount') } }
20
+ # Useful for marking a commission as refunded, duplicate, canceled, or fraudulent. Takes precedence over `amount` and `modifyAmount`. When a commission is marked as refunded, duplicate, canceled, or fraudulent, it will be omitted from the payout, and the payout amount will be recalculated accordingly. Paid commissions cannot be updated.
21
+ field :status, T.nilable(::OpenApiSDK::Operations::Status), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Operations::Status, true) } }
22
+
23
+
24
+ sig { params(amount: T.nilable(::Float), currency: T.nilable(::String), modify_amount: T.nilable(::Float), status: T.nilable(::OpenApiSDK::Operations::Status)).void }
25
+ def initialize(amount: nil, currency: nil, modify_amount: nil, status: nil)
26
+ @amount = amount
27
+ @currency = currency
28
+ @modify_amount = modify_amount
29
+ @status = status
30
+ end
31
+ end
32
+ end
33
+ end
@@ -8,7 +8,7 @@ module OpenApiSDK
8
8
  module Operations
9
9
 
10
10
 
11
- class UpdatePartnerSaleResponse < ::Crystalline::FieldAugmented
11
+ class UpdateCommissionResponse < ::Crystalline::FieldAugmented
12
12
  extend T::Sig
13
13
 
14
14
  # HTTP response content type for this operation
@@ -29,8 +29,8 @@ module OpenApiSDK
29
29
  field :invite_expired, T.nilable(::OpenApiSDK::Shared::InviteExpired)
30
30
  # The server cannot find the requested resource.
31
31
  field :not_found, T.nilable(::OpenApiSDK::Shared::NotFound)
32
- # The updated sale.
33
- field :object, T.nilable(::OpenApiSDK::Operations::UpdatePartnerSaleResponseBody)
32
+ # The updated commission.
33
+ field :object, T.nilable(::OpenApiSDK::Operations::UpdateCommissionResponseBody)
34
34
  # The user has sent too many requests in a given amount of time ("rate limiting")
35
35
  field :rate_limit_exceeded, T.nilable(::OpenApiSDK::Shared::RateLimitExceeded)
36
36
  # Although the HTTP standard specifies "unauthorized", semantically this response means "unauthenticated". That is, the client must authenticate itself to get the requested response.
@@ -39,7 +39,7 @@ module OpenApiSDK
39
39
  field :unprocessable_entity, T.nilable(::OpenApiSDK::Shared::UnprocessableEntity)
40
40
 
41
41
 
42
- sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, bad_request: T.nilable(::OpenApiSDK::Shared::BadRequest), conflict: T.nilable(::OpenApiSDK::Shared::Conflict), forbidden: T.nilable(::OpenApiSDK::Shared::Forbidden), internal_server_error: T.nilable(::OpenApiSDK::Shared::InternalServerError), invite_expired: T.nilable(::OpenApiSDK::Shared::InviteExpired), not_found: T.nilable(::OpenApiSDK::Shared::NotFound), object: T.nilable(::OpenApiSDK::Operations::UpdatePartnerSaleResponseBody), rate_limit_exceeded: T.nilable(::OpenApiSDK::Shared::RateLimitExceeded), unauthorized: T.nilable(::OpenApiSDK::Shared::Unauthorized), unprocessable_entity: T.nilable(::OpenApiSDK::Shared::UnprocessableEntity)).void }
42
+ sig { params(content_type: ::String, raw_response: ::Faraday::Response, status_code: ::Integer, bad_request: T.nilable(::OpenApiSDK::Shared::BadRequest), conflict: T.nilable(::OpenApiSDK::Shared::Conflict), forbidden: T.nilable(::OpenApiSDK::Shared::Forbidden), internal_server_error: T.nilable(::OpenApiSDK::Shared::InternalServerError), invite_expired: T.nilable(::OpenApiSDK::Shared::InviteExpired), not_found: T.nilable(::OpenApiSDK::Shared::NotFound), object: T.nilable(::OpenApiSDK::Operations::UpdateCommissionResponseBody), rate_limit_exceeded: T.nilable(::OpenApiSDK::Shared::RateLimitExceeded), unauthorized: T.nilable(::OpenApiSDK::Shared::Unauthorized), unprocessable_entity: T.nilable(::OpenApiSDK::Shared::UnprocessableEntity)).void }
43
43
  def initialize(content_type: nil, raw_response: nil, status_code: nil, bad_request: nil, conflict: nil, forbidden: nil, internal_server_error: nil, invite_expired: nil, not_found: nil, object: nil, rate_limit_exceeded: nil, unauthorized: nil, unprocessable_entity: nil)
44
44
  @content_type = content_type
45
45
  @raw_response = raw_response
@@ -0,0 +1,48 @@
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
+ # The updated commission.
11
+ class UpdateCommissionResponseBody < ::Crystalline::FieldAugmented
12
+ extend T::Sig
13
+
14
+
15
+ field :amount, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount') } }
16
+
17
+ field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt') } }
18
+
19
+ field :currency, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency') } }
20
+
21
+ field :earnings, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('earnings') } }
22
+ # The commission's unique ID on Dub.
23
+ field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } }
24
+
25
+ field :status, ::OpenApiSDK::Operations::UpdateCommissionStatus, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Operations::UpdateCommissionStatus, false) } }
26
+
27
+ field :updated_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('updatedAt') } }
28
+
29
+ field :invoice_id, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId') } }
30
+
31
+ field :type, T.nilable(::OpenApiSDK::Operations::UpdateCommissionType), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), 'decoder': Utils.enum_from_string(::OpenApiSDK::Operations::UpdateCommissionType, true) } }
32
+
33
+
34
+ sig { params(amount: ::Float, created_at: ::String, currency: ::String, earnings: ::Float, id: ::String, status: ::OpenApiSDK::Operations::UpdateCommissionStatus, updated_at: ::String, invoice_id: T.nilable(::String), type: T.nilable(::OpenApiSDK::Operations::UpdateCommissionType)).void }
35
+ def initialize(amount: nil, created_at: nil, currency: nil, earnings: nil, id: nil, status: nil, updated_at: nil, invoice_id: nil, type: nil)
36
+ @amount = amount
37
+ @created_at = created_at
38
+ @currency = currency
39
+ @earnings = earnings
40
+ @id = id
41
+ @status = status
42
+ @updated_at = updated_at
43
+ @invoice_id = invoice_id
44
+ @type = type
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,23 @@
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 UpdateCommissionStatus < T::Enum
12
+ enums do
13
+ PENDING = new('pending')
14
+ PROCESSED = new('processed')
15
+ PAID = new('paid')
16
+ REFUNDED = new('refunded')
17
+ DUPLICATE = new('duplicate')
18
+ FRAUD = new('fraud')
19
+ CANCELED = new('canceled')
20
+ end
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,19 @@
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 UpdateCommissionType < T::Enum
12
+ enums do
13
+ CLICK = new('click')
14
+ LEAD = new('lead')
15
+ SALE = new('sale')
16
+ end
17
+ end
18
+ end
19
+ end
@@ -137,7 +137,7 @@ module OpenApiSDK
137
137
  autoload :CreatePartnerTestVariants, 'open_api_sdk/models/operations/createpartner_testvariants.rb'
138
138
  autoload :LinkProps, 'open_api_sdk/models/operations/linkprops.rb'
139
139
  autoload :CreatePartnerRequestBody, 'open_api_sdk/models/operations/createpartner_requestbody.rb'
140
- autoload :Status, 'open_api_sdk/models/operations/status.rb'
140
+ autoload :CreatePartnerStatus, 'open_api_sdk/models/operations/createpartner_status.rb'
141
141
  autoload :CreatePartnerLink, 'open_api_sdk/models/operations/createpartner_link.rb'
142
142
  autoload :CreatePartnerResponseBody, 'open_api_sdk/models/operations/createpartner_responsebody.rb'
143
143
  autoload :CreatePartnerResponse, 'open_api_sdk/models/operations/createpartner_response.rb'
@@ -156,11 +156,23 @@ module OpenApiSDK
156
156
  autoload :QueryParamGroupBy, 'open_api_sdk/models/operations/queryparam_groupby.rb'
157
157
  autoload :RetrievePartnerAnalyticsRequest, 'open_api_sdk/models/operations/retrievepartneranalytics_request.rb'
158
158
  autoload :RetrievePartnerAnalyticsResponse, 'open_api_sdk/models/operations/retrievepartneranalytics_response.rb'
159
- autoload :UpdatePartnerSaleRequestBody, 'open_api_sdk/models/operations/updatepartnersale_requestbody.rb'
160
159
  autoload :Type, 'open_api_sdk/models/operations/type.rb'
161
- autoload :UpdatePartnerSaleStatus, 'open_api_sdk/models/operations/updatepartnersale_status.rb'
162
- autoload :UpdatePartnerSaleResponseBody, 'open_api_sdk/models/operations/updatepartnersale_responsebody.rb'
163
- autoload :UpdatePartnerSaleResponse, 'open_api_sdk/models/operations/updatepartnersale_response.rb'
160
+ autoload :QueryParamStatus, 'open_api_sdk/models/operations/queryparam_status.rb'
161
+ autoload :ListCommissionsQueryParamSortBy, 'open_api_sdk/models/operations/listcommissions_queryparam_sortby.rb'
162
+ autoload :ListCommissionsQueryParamSortOrder, 'open_api_sdk/models/operations/listcommissions_queryparam_sortorder.rb'
163
+ autoload :ListCommissionsQueryParamInterval, 'open_api_sdk/models/operations/listcommissions_queryparam_interval.rb'
164
+ autoload :ListCommissionsRequest, 'open_api_sdk/models/operations/listcommissions_request.rb'
165
+ autoload :ListCommissionsType, 'open_api_sdk/models/operations/listcommissions_type.rb'
166
+ autoload :ListCommissionsStatus, 'open_api_sdk/models/operations/listcommissions_status.rb'
167
+ autoload :ListCommissionsResponseBody, 'open_api_sdk/models/operations/listcommissions_responsebody.rb'
168
+ autoload :ListCommissionsResponse, 'open_api_sdk/models/operations/listcommissions_response.rb'
169
+ autoload :Status, 'open_api_sdk/models/operations/status.rb'
170
+ autoload :UpdateCommissionRequestBody, 'open_api_sdk/models/operations/updatecommission_requestbody.rb'
171
+ autoload :UpdateCommissionRequest, 'open_api_sdk/models/operations/updatecommission_request.rb'
172
+ autoload :UpdateCommissionType, 'open_api_sdk/models/operations/updatecommission_type.rb'
173
+ autoload :UpdateCommissionStatus, 'open_api_sdk/models/operations/updatecommission_status.rb'
174
+ autoload :UpdateCommissionResponseBody, 'open_api_sdk/models/operations/updatecommission_responsebody.rb'
175
+ autoload :UpdateCommissionResponse, 'open_api_sdk/models/operations/updatecommission_response.rb'
164
176
  autoload :GetWorkspaceRequest, 'open_api_sdk/models/operations/getworkspace_request.rb'
165
177
  autoload :GetWorkspaceResponse, 'open_api_sdk/models/operations/getworkspace_response.rb'
166
178
  autoload :UpdateWorkspaceRequestBody, 'open_api_sdk/models/operations/updateworkspace_requestbody.rb'
@@ -17,8 +17,6 @@ module OpenApiSDK
17
17
  field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt') } }
18
18
  # The unique ID of the folder.
19
19
  field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id') } }
20
- # The number of links in the folder.
21
- field :link_count, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('linkCount') } }
22
20
  # The name of the folder.
23
21
  field :name, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('name') } }
24
22
 
@@ -27,12 +25,11 @@ module OpenApiSDK
27
25
  field :updated_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('updatedAt') } }
28
26
 
29
27
 
30
- sig { params(access_level: ::OpenApiSDK::Shared::AccessLevel, created_at: ::String, id: ::String, link_count: ::Float, name: ::String, type: ::OpenApiSDK::Shared::Type, updated_at: ::String).void }
31
- def initialize(access_level: nil, created_at: nil, id: nil, link_count: nil, name: nil, type: nil, updated_at: nil)
28
+ sig { params(access_level: ::OpenApiSDK::Shared::AccessLevel, created_at: ::String, id: ::String, name: ::String, type: ::OpenApiSDK::Shared::Type, updated_at: ::String).void }
29
+ def initialize(access_level: nil, created_at: nil, id: nil, name: nil, type: nil, updated_at: nil)
32
30
  @access_level = access_level
33
31
  @created_at = created_at
34
32
  @id = id
35
- @link_count = link_count
36
33
  @name = name
37
34
  @type = type
38
35
  @updated_at = updated_at
@@ -697,144 +697,5 @@ module OpenApiSDK
697
697
 
698
698
  res
699
699
  end
700
-
701
-
702
- sig { params(request: T.nilable(::OpenApiSDK::Operations::UpdatePartnerSaleRequestBody), timeout_ms: T.nilable(Integer)).returns(::OpenApiSDK::Operations::UpdatePartnerSaleResponse) }
703
- def update_sale(request, timeout_ms = nil)
704
- # update_sale - Update a sale for a partner.
705
- # Update an existing sale amount. This is useful for handling refunds (partial or full) or fraudulent sales.
706
- url, params = @sdk_configuration.get_server_details
707
- base_url = Utils.template_url(url, params)
708
- url = "#{base_url}/partners/sales"
709
- headers = {}
710
- req_content_type, data, form = Utils.serialize_request_body(request, :request, :json)
711
- headers['content-type'] = req_content_type
712
-
713
- if form
714
- body = Utils.encode_form(form)
715
- elsif Utils.match_content_type(req_content_type, 'application/x-www-form-urlencoded')
716
- body = URI.encode_www_form(data)
717
- else
718
- body = data
719
- end
720
- headers['Accept'] = 'application/json'
721
- headers['user-agent'] = @sdk_configuration.user_agent
722
-
723
- security = !@sdk_configuration.nil? && !@sdk_configuration.security_source.nil? ? @sdk_configuration.security_source.call : nil
724
-
725
- timeout = (timeout_ms.to_f / 1000) unless timeout_ms.nil?
726
- timeout ||= @sdk_configuration.timeout
727
-
728
- connection = @sdk_configuration.client
729
-
730
- hook_ctx = SDKHooks::HookContext.new(
731
- base_url: base_url,
732
- oauth2_scopes: nil,
733
- operation_id: 'updatePartnerSale',
734
- security_source: @sdk_configuration.security_source
735
- )
736
-
737
- error = T.let(nil, T.nilable(StandardError))
738
- r = T.let(nil, T.nilable(Faraday::Response))
739
-
740
- begin
741
- r = connection.patch(url) do |req|
742
- req.body = body
743
- req.headers.merge!(headers)
744
- req.options.timeout = timeout unless timeout.nil?
745
- Utils.configure_request_security(req, security)
746
-
747
- @sdk_configuration.hooks.before_request(
748
- hook_ctx: SDKHooks::BeforeRequestHookContext.new(
749
- hook_ctx: hook_ctx
750
- ),
751
- request: req
752
- )
753
- end
754
- rescue StandardError => e
755
- error = e
756
- ensure
757
- if r.nil? || Utils.error_status?(r.status)
758
- r = @sdk_configuration.hooks.after_error(
759
- error: error,
760
- hook_ctx: SDKHooks::AfterErrorHookContext.new(
761
- hook_ctx: hook_ctx
762
- ),
763
- response: r
764
- )
765
- else
766
- r = @sdk_configuration.hooks.after_success(
767
- hook_ctx: SDKHooks::AfterSuccessHookContext.new(
768
- hook_ctx: hook_ctx
769
- ),
770
- response: r
771
- )
772
- end
773
-
774
- if r.nil?
775
- raise error if !error.nil?
776
- raise 'no response'
777
- end
778
- end
779
-
780
- content_type = r.headers.fetch('Content-Type', 'application/octet-stream')
781
-
782
- res = ::OpenApiSDK::Operations::UpdatePartnerSaleResponse.new(
783
- status_code: r.status, content_type: content_type, raw_response: r
784
- )
785
- if r.status == 200
786
- if Utils.match_content_type(content_type, 'application/json')
787
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Operations::UpdatePartnerSaleResponseBody)
788
- res.object = out
789
- end
790
- elsif r.status == 400
791
- if Utils.match_content_type(content_type, 'application/json')
792
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::BadRequest)
793
- res.bad_request = out
794
- end
795
- elsif r.status == 401
796
- if Utils.match_content_type(content_type, 'application/json')
797
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Unauthorized)
798
- res.unauthorized = out
799
- end
800
- elsif r.status == 403
801
- if Utils.match_content_type(content_type, 'application/json')
802
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Forbidden)
803
- res.forbidden = out
804
- end
805
- elsif r.status == 404
806
- if Utils.match_content_type(content_type, 'application/json')
807
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::NotFound)
808
- res.not_found = out
809
- end
810
- elsif r.status == 409
811
- if Utils.match_content_type(content_type, 'application/json')
812
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::Conflict)
813
- res.conflict = out
814
- end
815
- elsif r.status == 410
816
- if Utils.match_content_type(content_type, 'application/json')
817
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InviteExpired)
818
- res.invite_expired = out
819
- end
820
- elsif r.status == 422
821
- if Utils.match_content_type(content_type, 'application/json')
822
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::UnprocessableEntity)
823
- res.unprocessable_entity = out
824
- end
825
- elsif r.status == 429
826
- if Utils.match_content_type(content_type, 'application/json')
827
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::RateLimitExceeded)
828
- res.rate_limit_exceeded = out
829
- end
830
- elsif r.status == 500
831
- if Utils.match_content_type(content_type, 'application/json')
832
- out = Crystalline.unmarshal_json(JSON.parse(r.env.response_body), ::OpenApiSDK::Shared::InternalServerError)
833
- res.internal_server_error = out
834
- end
835
- end
836
-
837
- res
838
- end
839
700
  end
840
701
  end
@@ -61,9 +61,9 @@ module OpenApiSDK
61
61
  end
62
62
  @language = 'ruby'
63
63
  @openapi_doc_version = '0.0.1'
64
- @sdk_version = '0.2.2-alpha.99'
64
+ @sdk_version = '0.2.2-alpha.103'
65
65
  @gen_version = '2.563.0'
66
- @user_agent = 'speakeasy-sdk/ruby 0.2.2-alpha.99 2.563.0 0.0.1 dub'
66
+ @user_agent = 'speakeasy-sdk/ruby 0.2.2-alpha.103 2.563.0 0.0.1 dub'
67
67
  end
68
68
 
69
69
  sig { returns([String, T::Hash[Symbol, String]]) }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2.pre.alpha.99
4
+ version: 0.2.2.pre.alpha.103
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-05-18 00:00:00.000000000 Z
11
+ date: 2025-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -190,6 +190,7 @@ files:
190
190
  - lib/crystalline/utils.rb
191
191
  - lib/dub.rb
192
192
  - lib/open_api_sdk/analytics.rb
193
+ - lib/open_api_sdk/commissions.rb
193
194
  - lib/open_api_sdk/customers.rb
194
195
  - lib/open_api_sdk/domains.rb
195
196
  - lib/open_api_sdk/dub.rb
@@ -227,6 +228,7 @@ files:
227
228
  - lib/open_api_sdk/models/operations/createpartner_requestbody.rb
228
229
  - lib/open_api_sdk/models/operations/createpartner_response.rb
229
230
  - lib/open_api_sdk/models/operations/createpartner_responsebody.rb
231
+ - lib/open_api_sdk/models/operations/createpartner_status.rb
230
232
  - lib/open_api_sdk/models/operations/createpartner_testvariants.rb
231
233
  - lib/open_api_sdk/models/operations/createpartnerlink_linkprops.rb
232
234
  - lib/open_api_sdk/models/operations/createpartnerlink_requestbody.rb
@@ -292,6 +294,14 @@ files:
292
294
  - lib/open_api_sdk/models/operations/level.rb
293
295
  - lib/open_api_sdk/models/operations/link.rb
294
296
  - lib/open_api_sdk/models/operations/linkprops.rb
297
+ - lib/open_api_sdk/models/operations/listcommissions_queryparam_interval.rb
298
+ - lib/open_api_sdk/models/operations/listcommissions_queryparam_sortby.rb
299
+ - lib/open_api_sdk/models/operations/listcommissions_queryparam_sortorder.rb
300
+ - lib/open_api_sdk/models/operations/listcommissions_request.rb
301
+ - lib/open_api_sdk/models/operations/listcommissions_response.rb
302
+ - lib/open_api_sdk/models/operations/listcommissions_responsebody.rb
303
+ - lib/open_api_sdk/models/operations/listcommissions_status.rb
304
+ - lib/open_api_sdk/models/operations/listcommissions_type.rb
295
305
  - lib/open_api_sdk/models/operations/listdomains_request.rb
296
306
  - lib/open_api_sdk/models/operations/listdomains_response.rb
297
307
  - lib/open_api_sdk/models/operations/listevents_request.rb
@@ -307,6 +317,7 @@ files:
307
317
  - lib/open_api_sdk/models/operations/queryparam_interval.rb
308
318
  - lib/open_api_sdk/models/operations/queryparam_sortby.rb
309
319
  - lib/open_api_sdk/models/operations/queryparam_sortorder.rb
320
+ - lib/open_api_sdk/models/operations/queryparam_status.rb
310
321
  - lib/open_api_sdk/models/operations/queryparam_trigger.rb
311
322
  - lib/open_api_sdk/models/operations/requestbody.rb
312
323
  - lib/open_api_sdk/models/operations/responsebody.rb
@@ -332,6 +343,12 @@ files:
332
343
  - lib/open_api_sdk/models/operations/tracksale_responsebody.rb
333
344
  - lib/open_api_sdk/models/operations/trigger.rb
334
345
  - lib/open_api_sdk/models/operations/type.rb
346
+ - lib/open_api_sdk/models/operations/updatecommission_request.rb
347
+ - lib/open_api_sdk/models/operations/updatecommission_requestbody.rb
348
+ - lib/open_api_sdk/models/operations/updatecommission_response.rb
349
+ - lib/open_api_sdk/models/operations/updatecommission_responsebody.rb
350
+ - lib/open_api_sdk/models/operations/updatecommission_status.rb
351
+ - lib/open_api_sdk/models/operations/updatecommission_type.rb
335
352
  - lib/open_api_sdk/models/operations/updatecustomer_discount.rb
336
353
  - lib/open_api_sdk/models/operations/updatecustomer_link.rb
337
354
  - lib/open_api_sdk/models/operations/updatecustomer_partner.rb
@@ -351,10 +368,6 @@ files:
351
368
  - lib/open_api_sdk/models/operations/updatelink_requestbody.rb
352
369
  - lib/open_api_sdk/models/operations/updatelink_response.rb
353
370
  - lib/open_api_sdk/models/operations/updatelink_testvariants.rb
354
- - lib/open_api_sdk/models/operations/updatepartnersale_requestbody.rb
355
- - lib/open_api_sdk/models/operations/updatepartnersale_response.rb
356
- - lib/open_api_sdk/models/operations/updatepartnersale_responsebody.rb
357
- - lib/open_api_sdk/models/operations/updatepartnersale_status.rb
358
371
  - lib/open_api_sdk/models/operations/updatetag_color.rb
359
372
  - lib/open_api_sdk/models/operations/updatetag_request.rb
360
373
  - lib/open_api_sdk/models/operations/updatetag_requestbody.rb
@@ -1,36 +0,0 @@
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 UpdatePartnerSaleRequestBody < ::Crystalline::FieldAugmented
12
- extend T::Sig
13
-
14
-
15
- field :invoice_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId') } }
16
-
17
- field :program_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('programId') } }
18
- # The new absolute amount for the sale.
19
- field :amount, T.nilable(::Float), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount') } }
20
- # The currency of the sale amount to update. Accepts ISO 4217 currency codes.
21
- field :currency, T.nilable(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency') } }
22
- # Modify the current sale amount: use positive values to increase the amount, negative values to decrease it.
23
- field :modify_amount, T.nilable(::Float), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('modifyAmount') } }
24
-
25
-
26
- sig { params(invoice_id: ::String, program_id: ::String, amount: T.nilable(::Float), currency: T.nilable(::String), modify_amount: T.nilable(::Float)).void }
27
- def initialize(invoice_id: nil, program_id: nil, amount: nil, currency: nil, modify_amount: nil)
28
- @invoice_id = invoice_id
29
- @program_id = program_id
30
- @amount = amount
31
- @currency = currency
32
- @modify_amount = modify_amount
33
- end
34
- end
35
- end
36
- end