dub 0.12.12 → 0.12.14

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 (39) hide show
  1. checksums.yaml +4 -4
  2. data/lib/open_api_sdk/commissions.rb +2 -1
  3. data/lib/open_api_sdk/domains.rb +1 -1
  4. data/lib/open_api_sdk/links.rb +1 -1
  5. data/lib/open_api_sdk/models/operations/bulkupdatecommissions_commissions_status.rb +1 -1
  6. data/lib/open_api_sdk/models/operations/bulkupdatecommissions_responsebody.rb +1 -1
  7. data/lib/open_api_sdk/models/operations/lead.rb +38 -0
  8. data/lib/open_api_sdk/models/operations/lead.rbi +15 -0
  9. data/lib/open_api_sdk/models/operations/listcommissions_request.rb +6 -2
  10. data/lib/open_api_sdk/models/operations/listcommissions_request.rbi +2 -0
  11. data/lib/open_api_sdk/models/operations/listcommissions_responsebody.rb +19 -15
  12. data/lib/open_api_sdk/models/operations/listcommissions_responsebody.rbi +4 -2
  13. data/lib/open_api_sdk/models/operations/listcommissions_status.rb +1 -1
  14. data/lib/open_api_sdk/models/operations/listcommissions_type.rb +1 -1
  15. data/lib/open_api_sdk/models/operations/paymentprocessor.rb +1 -0
  16. data/lib/open_api_sdk/models/operations/requestbody_1.rb +2 -3
  17. data/lib/open_api_sdk/models/operations/requestbody_2.rb +15 -3
  18. data/lib/open_api_sdk/models/operations/requestbody_2.rbi +4 -0
  19. data/lib/open_api_sdk/models/operations/requestbody_3.rb +25 -9
  20. data/lib/open_api_sdk/models/operations/requestbody_3.rbi +6 -2
  21. data/lib/open_api_sdk/models/operations/requestbody_paymentprocessor.rb +28 -0
  22. data/lib/open_api_sdk/models/operations/requestbody_paymentprocessor.rbi +11 -0
  23. data/lib/open_api_sdk/models/operations/responsebody_paymentprocessor.rb +1 -0
  24. data/lib/open_api_sdk/models/operations/sale.rb +20 -16
  25. data/lib/open_api_sdk/models/operations/sale.rbi +4 -2
  26. data/lib/open_api_sdk/models/operations/tracksale_responsebody.rb +2 -2
  27. data/lib/open_api_sdk/models/operations/tracksale_sale.rb +50 -0
  28. data/lib/open_api_sdk/models/operations/tracksale_sale.rbi +21 -0
  29. data/lib/open_api_sdk/models/operations/updatecommission_responsebody.rb +19 -15
  30. data/lib/open_api_sdk/models/operations/updatecommission_responsebody.rbi +4 -2
  31. data/lib/open_api_sdk/models/operations/updatecommission_status.rb +1 -1
  32. data/lib/open_api_sdk/models/operations/updatecommission_type.rb +1 -1
  33. data/lib/open_api_sdk/models/operations.rb +3 -0
  34. data/lib/open_api_sdk/models/shared/commissioncreatedevent_data.rb +19 -15
  35. data/lib/open_api_sdk/models/shared/commissioncreatedevent_data.rbi +4 -2
  36. data/lib/open_api_sdk/models/shared/commissioncreatedevent_status.rb +1 -1
  37. data/lib/open_api_sdk/models/shared/commissioncreatedevent_type.rb +1 -1
  38. data/lib/open_api_sdk/sdkconfiguration.rb +3 -3
  39. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f9d4e98b42c180855882da7c6000cc2c06c44fb1422d90fe41950232a2ec1f9c
4
- data.tar.gz: 588e2f021f32850d9758d50b83f2d7e42d322f3ffdb412689574881394c0a93d
3
+ metadata.gz: 569fd3c56e7e3d9e294a766f70b19923b04a61904f08f8b76e09a60a84eb4e67
4
+ data.tar.gz: e14871bf6e3503001955d5e433bb498ae4e43384747ecc1847fef5c1c4f5b192
5
5
  SHA512:
6
- metadata.gz: 94f66f9b73b45f5042d765a1a88cde80b68465f51609148e50d5c715639f0d1868b49ec6f6e0e88f0558478995609f4287c5d4fbaec52087eb6d3181fc1a9b2a
7
- data.tar.gz: 9cb2de8b0b671f77226b60c3f17e59ad9d50aca3ad46f044b498693bdf12972e2f3468a5faef09ee91ff56b07d99044b50140dabfd4c5081d9309e7234090022
6
+ metadata.gz: a66e6268d4078956766e6a35cc9437a05f8d1af86a1efb24e77135271e5307e6e3ff3bd83f3b9d8db06fed735577dde79ee3bb7069c9e09d634677ab9d3066d7
7
+ data.tar.gz: 849d3e1678ae977d46382d4cc5cd9fd7a9188cb23145f9a6844ae6a59e1709f63ace280836b6fbd12cdffef844551b85d3f908e44d8a018867d8ca4894f1277b
@@ -165,6 +165,7 @@ module OpenApiSDK
165
165
  start: request.start,
166
166
  end_: request.end_,
167
167
  timezone: request.timezone,
168
+ query: request.query,
168
169
  ending_before: request.ending_before,
169
170
  starting_after: next_cursor,
170
171
  page: request.page,
@@ -319,7 +320,7 @@ module OpenApiSDK
319
320
  sig { params(request: T.nilable(T.any(Models::Operations::RequestBody1, Models::Operations::RequestBody2, Models::Operations::RequestBody3)), timeout_ms: T.nilable(Integer), http_headers: T.nilable(T::Hash[T.any(String, Symbol), String])).returns(Models::Operations::CreateCommissionResponseBody) }
320
321
  def create(request: nil, timeout_ms: nil, http_headers: nil)
321
322
  # create - Create commission
322
- # Create one or more commissions (custom, lead or sale) for a partner. Custom commissions accept a negative `amount` to create a clawback; in that case `description` is required and may be a known clawback reason or any other string. Commission creation is processed asynchronously. Use the List Commissions endpoint or webhooks to be notified when the commission is created.
323
+ # Create one or more commissions (custom, lead or sale) for a partner. Custom commissions accept a negative `amount` to create a clawback. Commission creation is processed asynchronously use the GET /commissions endpoint or webhooks to be notified when the commission is created.
323
324
  url, params = @sdk_configuration.get_server_details
324
325
  base_url = Utils.template_url(url, params)
325
326
  url = "#{base_url}/commissions"
@@ -150,7 +150,7 @@ module OpenApiSDK
150
150
  if results.count.zero?
151
151
  next nil
152
152
  end
153
- request_limit = !request.page_size.nil? ? request.page_size : 1
153
+ request_limit = !request.page_size.nil? ? request.page_size : 50
154
154
  if results.count < request_limit
155
155
  next nil
156
156
  end
@@ -150,7 +150,7 @@ module OpenApiSDK
150
150
  if results.count.zero?
151
151
  next nil
152
152
  end
153
- request_limit = !request.page_size.nil? ? request.page_size : 1
153
+ request_limit = !request.page_size.nil? ? request.page_size : 100
154
154
  if results.count < request_limit
155
155
  next nil
156
156
  end
@@ -9,7 +9,7 @@
9
9
  module OpenApiSDK
10
10
  module Models
11
11
  module Operations
12
-
12
+ # BulkUpdateCommissionsCommissionsStatus - The current status of the commission.
13
13
  class BulkUpdateCommissionsCommissionsStatus < T::Enum
14
14
  enums do
15
15
  PENDING = new('pending')
@@ -16,7 +16,7 @@ module OpenApiSDK
16
16
 
17
17
  # The commission's unique ID on Dub.
18
18
  field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id'), required: true } }
19
-
19
+ # The current status of the commission.
20
20
  field :status, Models::Operations::BulkUpdateCommissionsCommissionsStatus, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), required: true, 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Operations::BulkUpdateCommissionsCommissionsStatus, false) } }
21
21
 
22
22
  sig { params(id: ::String, status: Models::Operations::BulkUpdateCommissionsCommissionsStatus).void }
@@ -0,0 +1,38 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+ # Generated under the AGPL-3.0-only license.
3
+ # SPDX-License-Identifier: AGPL-3.0-only
4
+
5
+ # typed: true
6
+ # frozen_string_literal: true
7
+
8
+
9
+ module OpenApiSDK
10
+ module Models
11
+ module Operations
12
+ # The lead event object to associate the commission with.
13
+ class Lead
14
+ extend T::Sig
15
+ include Crystalline::MetadataFields
16
+
17
+ # The name of the lead event to track. If not provided, defaults to 'Sign up'.
18
+ field :event_name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('eventName') } }
19
+ # Additional metadata to be stored with the lead event. Max 10,000 characters.
20
+ field :metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('metadata') } }
21
+
22
+ sig { params(event_name: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::Object])).void }
23
+ def initialize(event_name: nil, metadata: nil)
24
+ @event_name = event_name
25
+ @metadata = metadata
26
+ end
27
+
28
+ sig { params(other: T.untyped).returns(T::Boolean) }
29
+ def ==(other)
30
+ return false unless other.is_a? self.class
31
+ return false unless @event_name == other.event_name
32
+ return false unless @metadata == other.metadata
33
+ true
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,15 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class OpenApiSDK::Models::Operations::Lead
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class OpenApiSDK::Models::Operations::Lead
11
+ def event_name(); end
12
+ def event_name=(str_); end
13
+ def metadata(); end
14
+ def metadata=(str_); end
15
+ end
@@ -38,6 +38,8 @@ module OpenApiSDK
38
38
  field :end_, Crystalline::Nilable.new(::String), { 'query_param': { 'field_name': 'end', 'style': 'form', 'explode': true } }
39
39
 
40
40
  field :timezone, Crystalline::Nilable.new(::String), { 'query_param': { 'field_name': 'timezone', 'style': 'form', 'explode': true } }
41
+ # Filter by lead or sale event metadata. Top-level keys only. Compares string values only — numeric and boolean metadata values are not matched.
42
+ field :query, Crystalline::Nilable.new(::String), { 'query_param': { 'field_name': 'query', 'style': 'form', 'explode': true } }
41
43
  # If specified, the query only searches for results before this cursor. Mutually exclusive with `startingAfter`.
42
44
  field :ending_before, Crystalline::Nilable.new(::String), { 'query_param': { 'field_name': 'endingBefore', 'style': 'form', 'explode': true } }
43
45
  # If specified, the query only searches for results after this cursor. Mutually exclusive with `endingBefore`.
@@ -53,8 +55,8 @@ module OpenApiSDK
53
55
  # The number of items per page.
54
56
  field :page_size, Crystalline::Nilable.new(::Integer), { 'query_param': { 'field_name': 'pageSize', 'style': 'form', 'explode': true } }
55
57
 
56
- sig { params(type: T.nilable(Models::Operations::Type), customer_id: T.nilable(::String), payout_id: T.nilable(::String), partner_id: T.nilable(::String), tenant_id: T.nilable(::String), group_id: T.nilable(::String), partner_tag_id: T.nilable(::String), invoice_id: T.nilable(::String), status: T.nilable(Models::Operations::QueryParamStatus), start: T.nilable(::String), end_: T.nilable(::String), timezone: T.nilable(::String), ending_before: T.nilable(::String), starting_after: T.nilable(::String), page: T.nilable(::Integer), sort_by: T.nilable(Models::Operations::ListCommissionsQueryParamSortBy), sort_order: T.nilable(Models::Operations::ListCommissionsQueryParamSortOrder), interval: T.nilable(Models::Operations::ListCommissionsQueryParamInterval), page_size: T.nilable(::Integer)).void }
57
- def initialize(type: nil, customer_id: nil, payout_id: nil, partner_id: nil, tenant_id: nil, group_id: nil, partner_tag_id: nil, invoice_id: nil, status: nil, start: nil, end_: nil, timezone: nil, ending_before: nil, starting_after: nil, page: nil, sort_by: Models::Operations::ListCommissionsQueryParamSortBy::CREATED_AT, sort_order: Models::Operations::ListCommissionsQueryParamSortOrder::DESC, interval: Models::Operations::ListCommissionsQueryParamInterval::ALL, page_size: 100)
58
+ sig { params(type: T.nilable(Models::Operations::Type), customer_id: T.nilable(::String), payout_id: T.nilable(::String), partner_id: T.nilable(::String), tenant_id: T.nilable(::String), group_id: T.nilable(::String), partner_tag_id: T.nilable(::String), invoice_id: T.nilable(::String), status: T.nilable(Models::Operations::QueryParamStatus), start: T.nilable(::String), end_: T.nilable(::String), timezone: T.nilable(::String), query: T.nilable(::String), ending_before: T.nilable(::String), starting_after: T.nilable(::String), page: T.nilable(::Integer), sort_by: T.nilable(Models::Operations::ListCommissionsQueryParamSortBy), sort_order: T.nilable(Models::Operations::ListCommissionsQueryParamSortOrder), interval: T.nilable(Models::Operations::ListCommissionsQueryParamInterval), page_size: T.nilable(::Integer)).void }
59
+ def initialize(type: nil, customer_id: nil, payout_id: nil, partner_id: nil, tenant_id: nil, group_id: nil, partner_tag_id: nil, invoice_id: nil, status: nil, start: nil, end_: nil, timezone: nil, query: nil, ending_before: nil, starting_after: nil, page: nil, sort_by: Models::Operations::ListCommissionsQueryParamSortBy::CREATED_AT, sort_order: Models::Operations::ListCommissionsQueryParamSortOrder::DESC, interval: Models::Operations::ListCommissionsQueryParamInterval::ALL, page_size: 100)
58
60
  @type = type
59
61
  @customer_id = customer_id
60
62
  @payout_id = payout_id
@@ -67,6 +69,7 @@ module OpenApiSDK
67
69
  @start = start
68
70
  @end_ = end_
69
71
  @timezone = timezone
72
+ @query = query
70
73
  @ending_before = ending_before
71
74
  @starting_after = starting_after
72
75
  @page = page
@@ -91,6 +94,7 @@ module OpenApiSDK
91
94
  return false unless @start == other.start
92
95
  return false unless @end_ == other.end_
93
96
  return false unless @timezone == other.timezone
97
+ return false unless @query == other.query
94
98
  return false unless @ending_before == other.ending_before
95
99
  return false unless @starting_after == other.starting_after
96
100
  return false unless @page == other.page
@@ -32,6 +32,8 @@ class OpenApiSDK::Models::Operations::ListCommissionsRequest
32
32
  def end_=(str_); end
33
33
  def timezone(); end
34
34
  def timezone=(str_); end
35
+ def query(); end
36
+ def query=(str_); end
35
37
  def ending_before(); end
36
38
  def ending_before=(str_); end
37
39
  def starting_after(); end
@@ -16,28 +16,30 @@ module OpenApiSDK
16
16
 
17
17
  # The commission's unique ID on Dub.
18
18
  field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id'), required: true } }
19
-
19
+ # The type of commission. Can be `click`, `lead`, `sale`, `referral`, or `custom`.
20
+ field :type, Models::Operations::ListCommissionsType, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), required: true, 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Operations::ListCommissionsType, false) } }
21
+ # The associated event amount in cents. For sale commissions, this is the sale amount.
20
22
  field :amount, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount'), required: true } }
21
-
23
+ # The amount earned by the partner, in cents.
22
24
  field :earnings, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('earnings'), required: true } }
23
-
25
+ # The currency of the commission, as an ISO 4217 currency code.
24
26
  field :currency, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency'), required: true } }
25
-
27
+ # The current status of the commission.
26
28
  field :status, Models::Operations::ListCommissionsStatus, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), required: true, 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Operations::ListCommissionsStatus, false) } }
27
-
29
+ # The event quantity. Used for click and lead commissions; typically `1` for sale and custom commissions.
28
30
  field :quantity, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('quantity'), required: true } }
29
-
31
+ # The date and time when the commission was created.
30
32
  field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt'), required: true } }
31
-
33
+ # The date and time when the commission was last updated.
32
34
  field :updated_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('updatedAt'), required: true } }
33
35
 
34
36
  field :partner, Models::Operations::ListCommissionsPartner, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('partner'), required: true } }
35
-
36
- field :type, Crystalline::Nilable.new(Models::Operations::ListCommissionsType), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Operations::ListCommissionsType, true) } }
37
-
37
+ # The associated invoice ID. Only set for sale commissions.
38
38
  field :invoice_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId'), required: true } }
39
-
39
+ # An optional description of the commission.
40
40
  field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('description'), required: true } }
41
+ # User-provided metadata from the associated lead or sale event (`lead.metadata` / `sale.metadata`).
42
+ field :metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('metadata'), required: true } }
41
43
  # The date the commission was paid out to the partner. Null if not paid yet.
42
44
  field :paid_at, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('paidAt'), required: true } }
43
45
  # The user who created the manual commission.
@@ -45,9 +47,10 @@ module OpenApiSDK
45
47
 
46
48
  field :customer, Crystalline::Nilable.new(Models::Operations::ListCommissionsCustomer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('customer') } }
47
49
 
48
- sig { params(id: ::String, amount: ::Float, earnings: ::Float, currency: ::String, status: Models::Operations::ListCommissionsStatus, quantity: ::Float, created_at: ::String, updated_at: ::String, partner: Models::Operations::ListCommissionsPartner, type: T.nilable(Models::Operations::ListCommissionsType), invoice_id: T.nilable(::String), description: T.nilable(::String), paid_at: T.nilable(::String), user_id: T.nilable(::String), customer: T.nilable(Models::Operations::ListCommissionsCustomer)).void }
49
- def initialize(id:, amount:, earnings:, currency:, status:, quantity:, created_at:, updated_at:, partner:, type: nil, invoice_id: nil, description: nil, paid_at: nil, user_id: nil, customer: nil)
50
+ sig { params(id: ::String, type: Models::Operations::ListCommissionsType, amount: ::Float, earnings: ::Float, currency: ::String, status: Models::Operations::ListCommissionsStatus, quantity: ::Float, created_at: ::String, updated_at: ::String, partner: Models::Operations::ListCommissionsPartner, invoice_id: T.nilable(::String), description: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::Object]), paid_at: T.nilable(::String), user_id: T.nilable(::String), customer: T.nilable(Models::Operations::ListCommissionsCustomer)).void }
51
+ def initialize(id:, type:, amount:, earnings:, currency:, status:, quantity:, created_at:, updated_at:, partner:, invoice_id: nil, description: nil, metadata: nil, paid_at: nil, user_id: nil, customer: nil)
50
52
  @id = id
53
+ @type = type
51
54
  @amount = amount
52
55
  @earnings = earnings
53
56
  @currency = currency
@@ -56,9 +59,9 @@ module OpenApiSDK
56
59
  @created_at = created_at
57
60
  @updated_at = updated_at
58
61
  @partner = partner
59
- @type = type
60
62
  @invoice_id = invoice_id
61
63
  @description = description
64
+ @metadata = metadata
62
65
  @paid_at = paid_at
63
66
  @user_id = user_id
64
67
  @customer = customer
@@ -68,6 +71,7 @@ module OpenApiSDK
68
71
  def ==(other)
69
72
  return false unless other.is_a? self.class
70
73
  return false unless @id == other.id
74
+ return false unless @type == other.type
71
75
  return false unless @amount == other.amount
72
76
  return false unless @earnings == other.earnings
73
77
  return false unless @currency == other.currency
@@ -76,9 +80,9 @@ module OpenApiSDK
76
80
  return false unless @created_at == other.created_at
77
81
  return false unless @updated_at == other.updated_at
78
82
  return false unless @partner == other.partner
79
- return false unless @type == other.type
80
83
  return false unless @invoice_id == other.invoice_id
81
84
  return false unless @description == other.description
85
+ return false unless @metadata == other.metadata
82
86
  return false unless @paid_at == other.paid_at
83
87
  return false unless @user_id == other.user_id
84
88
  return false unless @customer == other.customer
@@ -10,6 +10,8 @@ end
10
10
  class OpenApiSDK::Models::Operations::ListCommissionsResponseBody
11
11
  def id(); end
12
12
  def id=(str_); end
13
+ def type(); end
14
+ def type=(str_); end
13
15
  def amount(); end
14
16
  def amount=(str_); end
15
17
  def earnings(); end
@@ -26,12 +28,12 @@ class OpenApiSDK::Models::Operations::ListCommissionsResponseBody
26
28
  def updated_at=(str_); end
27
29
  def partner(); end
28
30
  def partner=(str_); end
29
- def type(); end
30
- def type=(str_); end
31
31
  def invoice_id(); end
32
32
  def invoice_id=(str_); end
33
33
  def description(); end
34
34
  def description=(str_); end
35
+ def metadata(); end
36
+ def metadata=(str_); end
35
37
  def paid_at(); end
36
38
  def paid_at=(str_); end
37
39
  def user_id(); end
@@ -9,7 +9,7 @@
9
9
  module OpenApiSDK
10
10
  module Models
11
11
  module Operations
12
-
12
+ # ListCommissionsStatus - The current status of the commission.
13
13
  class ListCommissionsStatus < T::Enum
14
14
  enums do
15
15
  PENDING = new('pending')
@@ -9,7 +9,7 @@
9
9
  module OpenApiSDK
10
10
  module Models
11
11
  module Operations
12
-
12
+ # ListCommissionsType - The type of commission. Can be `click`, `lead`, `sale`, `referral`, or `custom`.
13
13
  class ListCommissionsType < T::Enum
14
14
  enums do
15
15
  CLICK = new('click')
@@ -18,6 +18,7 @@ module OpenApiSDK
18
18
  PADDLE = new('paddle')
19
19
  APPLE = new('apple')
20
20
  REVENUECAT = new('revenuecat')
21
+ LEMONSQUEEZY = new('lemonsqueezy')
21
22
  DUB = new('dub')
22
23
  CUSTOM = new('custom')
23
24
  end
@@ -18,12 +18,11 @@ module OpenApiSDK
18
18
  field :type, Models::Operations::RequestBodyType, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), required: true, 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Operations::RequestBodyType, false) } }
19
19
  # The ID of the partner to create the commission for.
20
20
  field :partner_id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('partnerId'), required: true } }
21
- # The commission amount in cents. Use a negative amount to create a clawback.
21
+ # The commission earnings amount in cents. Use a negative amount to create a clawback.
22
22
  field :amount, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount'), required: true } }
23
23
  # If not provided, the current date will be used.
24
24
  field :date, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('date') } }
25
- # The description of the commission. Required for clawbacks (negative `amount`).
26
- # May be a known clawback reason (`order_canceled`, `fraud`, `terms_violation`, `tracking_error`, `payment_failed`, `ineligible_partner`, `duplicate_commission`) or an arbitrary string (max 190 characters).
25
+ # The description of the commission. Required for clawbacks (negative `amount`). May be a known clawback reason (`order_canceled`, `fraud`, `terms_violation`, `tracking_error`, `payment_failed`, `ineligible_partner`, `duplicate_commission`) or an arbitrary string (max 190 characters).
27
26
  field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('description') } }
28
27
 
29
28
  sig { params(type: Models::Operations::RequestBodyType, partner_id: ::String, amount: ::Float, date: T.nilable(::String), description: T.nilable(::String)).void }
@@ -25,17 +25,27 @@ module OpenApiSDK
25
25
  # The partner link ID to associate the commission with. If not provided, default to the link with the most revenue.
26
26
  field :link_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('linkId') } }
27
27
  # The date and time of the lead event. If not provided, defaults to the current date and time.
28
+ field :date, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('date') } }
29
+ # The lead event object to associate the commission with.
30
+ field :lead, Crystalline::Nilable.new(Models::Operations::Lead), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('lead') } }
31
+ # Deprecated: Use `date` instead. The date and time of the lead event. If not provided, defaults to the current date and time.
32
+ #
33
+ # @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
28
34
  field :lead_event_date, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('leadEventDate') } }
29
- # The name of the lead event. If not provided, defaults to 'Sign up'.
35
+ # Deprecated: Use `lead.eventName` instead. The name of the lead event. If not provided, defaults to 'Sign up'.
36
+ #
37
+ # @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
30
38
  field :lead_event_name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('leadEventName') } }
31
39
 
32
- sig { params(type: Models::Operations::CreateCommissionRequestBodyType, partner_id: ::String, customer_id: T.nilable(::String), customer: T.nilable(Models::Operations::Customer), link_id: T.nilable(::String), lead_event_date: T.nilable(::String), lead_event_name: T.nilable(::String)).void }
33
- def initialize(type:, partner_id:, customer_id: nil, customer: nil, link_id: nil, lead_event_date: nil, lead_event_name: 'Sign up')
40
+ sig { params(type: Models::Operations::CreateCommissionRequestBodyType, partner_id: ::String, customer_id: T.nilable(::String), customer: T.nilable(Models::Operations::Customer), link_id: T.nilable(::String), date: T.nilable(::String), lead: T.nilable(Models::Operations::Lead), lead_event_date: T.nilable(::String), lead_event_name: T.nilable(::String)).void }
41
+ def initialize(type:, partner_id:, customer_id: nil, customer: nil, link_id: nil, date: nil, lead: nil, lead_event_date: nil, lead_event_name: 'Sign up')
34
42
  @type = type
35
43
  @partner_id = partner_id
36
44
  @customer_id = customer_id
37
45
  @customer = customer
38
46
  @link_id = link_id
47
+ @date = date
48
+ @lead = lead
39
49
  @lead_event_date = lead_event_date
40
50
  @lead_event_name = lead_event_name
41
51
  end
@@ -48,6 +58,8 @@ module OpenApiSDK
48
58
  return false unless @customer_id == other.customer_id
49
59
  return false unless @customer == other.customer
50
60
  return false unless @link_id == other.link_id
61
+ return false unless @date == other.date
62
+ return false unless @lead == other.lead
51
63
  return false unless @lead_event_date == other.lead_event_date
52
64
  return false unless @lead_event_name == other.lead_event_name
53
65
  true
@@ -18,6 +18,10 @@ class OpenApiSDK::Models::Operations::RequestBody2
18
18
  def customer=(str_); end
19
19
  def link_id(); end
20
20
  def link_id=(str_); end
21
+ def date(); end
22
+ def date=(str_); end
23
+ def lead(); end
24
+ def lead=(str_); end
21
25
  def lead_event_date(); end
22
26
  def lead_event_date=(str_); end
23
27
  def lead_event_name(); end
@@ -24,26 +24,40 @@ module OpenApiSDK
24
24
  field :customer, Crystalline::Nilable.new(Models::Operations::RequestBodyCustomer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('customer') } }
25
25
  # The partner link ID to associate the commission with. If not provided, default to the link with the most revenue.
26
26
  field :link_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('linkId') } }
27
- # Required when `importStripeInvoices` is `false`. The sale amount in cents for the manual sale event. Ignored when importing from Stripe.
28
- field :sale_amount, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('saleAmount') } }
29
27
  # Only used when `importStripeInvoices` is `false`. The date of the manual sale event. Defaults to the current date and time if not provided.
28
+ field :date, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('date') } }
29
+ # The sale event object to associate the commission with.
30
+ field :sale, Crystalline::Nilable.new(Models::Operations::Sale), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('sale') } }
31
+ # Deprecated: Use `date` instead.
32
+ #
33
+ # @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
30
34
  field :sale_event_date, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('saleEventDate') } }
31
- # Only used when `importStripeInvoices` is `false`. An optional invoice ID to attach to the generated sale event and commission entry for deduplication.
35
+ # Deprecated: Use `sale.amount` instead.
36
+ #
37
+ # @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
38
+ field :sale_amount, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('saleAmount') } }
39
+ # Deprecated: Use `sale.invoiceId` instead.
40
+ #
41
+ # @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
32
42
  field :invoice_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId') } }
33
- # Only used when `importStripeInvoices` is `false`. An optional product ID stored on the sale event metadata – will also impact commission earnings calculation (if a `Sale` `Product ID` modifier is set).
43
+ # Deprecated: Use `sale.metadata.productId` instead.
44
+ #
45
+ # @deprecated true: This will be removed in a future release, please migrate away from it as soon as possible.
34
46
  field :product_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('productId') } }
35
- # When `true`, import all unimported paid Stripe invoices for the customer and create a commission for each. When `false`, create a single manual sale event using `saleAmount`.
47
+ # When `true`, import all unimported paid Stripe invoices for the customer and create a commission for each. When `false`, create a single manual sale event using `sale.amount` (or deprecated `saleAmount`).
36
48
  field :import_stripe_invoices, Crystalline::Nilable.new(Crystalline::Boolean.new), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('importStripeInvoices') } }
37
49
 
38
- sig { params(type: Models::Operations::CreateCommissionRequestBodyCommissionsType, partner_id: ::String, customer_id: T.nilable(::String), customer: T.nilable(Models::Operations::RequestBodyCustomer), link_id: T.nilable(::String), sale_amount: T.nilable(::Float), sale_event_date: T.nilable(::String), invoice_id: T.nilable(::String), product_id: T.nilable(::String), import_stripe_invoices: T.nilable(T::Boolean)).void }
39
- def initialize(type:, partner_id:, customer_id: nil, customer: nil, link_id: nil, sale_amount: nil, sale_event_date: nil, invoice_id: nil, product_id: nil, import_stripe_invoices: false)
50
+ sig { params(type: Models::Operations::CreateCommissionRequestBodyCommissionsType, partner_id: ::String, customer_id: T.nilable(::String), customer: T.nilable(Models::Operations::RequestBodyCustomer), link_id: T.nilable(::String), date: T.nilable(::String), sale: T.nilable(Models::Operations::Sale), sale_event_date: T.nilable(::String), sale_amount: T.nilable(::Float), invoice_id: T.nilable(::String), product_id: T.nilable(::String), import_stripe_invoices: T.nilable(T::Boolean)).void }
51
+ def initialize(type:, partner_id:, customer_id: nil, customer: nil, link_id: nil, date: nil, sale: nil, sale_event_date: nil, sale_amount: nil, invoice_id: nil, product_id: nil, import_stripe_invoices: false)
40
52
  @type = type
41
53
  @partner_id = partner_id
42
54
  @customer_id = customer_id
43
55
  @customer = customer
44
56
  @link_id = link_id
45
- @sale_amount = sale_amount
57
+ @date = date
58
+ @sale = sale
46
59
  @sale_event_date = sale_event_date
60
+ @sale_amount = sale_amount
47
61
  @invoice_id = invoice_id
48
62
  @product_id = product_id
49
63
  @import_stripe_invoices = import_stripe_invoices
@@ -57,8 +71,10 @@ module OpenApiSDK
57
71
  return false unless @customer_id == other.customer_id
58
72
  return false unless @customer == other.customer
59
73
  return false unless @link_id == other.link_id
60
- return false unless @sale_amount == other.sale_amount
74
+ return false unless @date == other.date
75
+ return false unless @sale == other.sale
61
76
  return false unless @sale_event_date == other.sale_event_date
77
+ return false unless @sale_amount == other.sale_amount
62
78
  return false unless @invoice_id == other.invoice_id
63
79
  return false unless @product_id == other.product_id
64
80
  return false unless @import_stripe_invoices == other.import_stripe_invoices
@@ -18,10 +18,14 @@ class OpenApiSDK::Models::Operations::RequestBody3
18
18
  def customer=(str_); end
19
19
  def link_id(); end
20
20
  def link_id=(str_); end
21
- def sale_amount(); end
22
- def sale_amount=(str_); end
21
+ def date(); end
22
+ def date=(str_); end
23
+ def sale(); end
24
+ def sale=(str_); end
23
25
  def sale_event_date(); end
24
26
  def sale_event_date=(str_); end
27
+ def sale_amount(); end
28
+ def sale_amount=(str_); end
25
29
  def invoice_id(); end
26
30
  def invoice_id=(str_); end
27
31
  def product_id(); end
@@ -0,0 +1,28 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+ # Generated under the AGPL-3.0-only license.
3
+ # SPDX-License-Identifier: AGPL-3.0-only
4
+
5
+ # typed: true
6
+ # frozen_string_literal: true
7
+
8
+
9
+ module OpenApiSDK
10
+ module Models
11
+ module Operations
12
+ # RequestBodyPaymentProcessor - The payment processor via which the sale was made.
13
+ class RequestBodyPaymentProcessor < T::Enum
14
+ enums do
15
+ STRIPE = new('stripe')
16
+ SHOPIFY = new('shopify')
17
+ POLAR = new('polar')
18
+ PADDLE = new('paddle')
19
+ APPLE = new('apple')
20
+ REVENUECAT = new('revenuecat')
21
+ LEMONSQUEEZY = new('lemonsqueezy')
22
+ DUB = new('dub')
23
+ CUSTOM = new('custom')
24
+ end
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,11 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class OpenApiSDK::Models::Operations::RequestBodyPaymentProcessor
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class OpenApiSDK::Models::Operations::RequestBodyPaymentProcessor
11
+ end
@@ -18,6 +18,7 @@ module OpenApiSDK
18
18
  PADDLE = new('paddle')
19
19
  APPLE = new('apple')
20
20
  REVENUECAT = new('revenuecat')
21
+ LEMONSQUEEZY = new('lemonsqueezy')
21
22
  DUB = new('dub')
22
23
  CUSTOM = new('custom')
23
24
  end
@@ -9,29 +9,32 @@
9
9
  module OpenApiSDK
10
10
  module Models
11
11
  module Operations
12
-
12
+ # The sale event object to associate the commission with.
13
13
  class Sale
14
14
  extend T::Sig
15
15
  include Crystalline::MetadataFields
16
16
 
17
-
18
- field :amount, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount'), required: true } }
19
-
20
- field :currency, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency'), required: true } }
21
-
22
- field :payment_processor, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('paymentProcessor'), required: true } }
23
-
24
- field :invoice_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId'), required: true } }
25
-
26
- field :metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('metadata'), required: true } }
27
-
28
- sig { params(amount: ::Float, currency: ::String, payment_processor: ::String, invoice_id: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::Object])).void }
29
- def initialize(amount:, currency:, payment_processor:, invoice_id: nil, metadata: nil)
17
+ # The amount of the sale in cents (for all two-decimal currencies). If the sale is in a zero-decimal currency, pass the full integer value (e.g. `1580` JPY). Learn more: https://d.to/currency
18
+ field :amount, Crystalline::Nilable.new(::Float), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount') } }
19
+ # The currency of the sale. Accepts ISO 4217 currency codes. Sales will be automatically converted and stored as USD at the latest exchange rates. Learn more: https://d.to/currency
20
+ field :currency, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency') } }
21
+ # The name of the sale event. Recommended format: `Invoice paid` or `Subscription created`.
22
+ field :event_name, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('eventName') } }
23
+ # The payment processor via which the sale was made.
24
+ field :payment_processor, Crystalline::Nilable.new(Models::Operations::RequestBodyPaymentProcessor), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('paymentProcessor'), 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Operations::RequestBodyPaymentProcessor, true) } }
25
+ # Additional metadata to be stored with the sale event. Max 10,000 characters when stringified.
26
+ field :metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('metadata') } }
27
+ # The invoice ID of the sale. Can be used as a idempotency key – only one sale event can be recorded for a given invoice ID.
28
+ field :invoice_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId') } }
29
+
30
+ sig { params(amount: T.nilable(::Float), currency: T.nilable(::String), event_name: T.nilable(::String), payment_processor: T.nilable(Models::Operations::RequestBodyPaymentProcessor), metadata: T.nilable(T::Hash[Symbol, ::Object]), invoice_id: T.nilable(::String)).void }
31
+ def initialize(amount: nil, currency: 'usd', event_name: 'Purchase', payment_processor: Models::Operations::RequestBodyPaymentProcessor::CUSTOM, metadata: nil, invoice_id: nil)
30
32
  @amount = amount
31
33
  @currency = currency
34
+ @event_name = event_name
32
35
  @payment_processor = payment_processor
33
- @invoice_id = invoice_id
34
36
  @metadata = metadata
37
+ @invoice_id = invoice_id
35
38
  end
36
39
 
37
40
  sig { params(other: T.untyped).returns(T::Boolean) }
@@ -39,9 +42,10 @@ module OpenApiSDK
39
42
  return false unless other.is_a? self.class
40
43
  return false unless @amount == other.amount
41
44
  return false unless @currency == other.currency
45
+ return false unless @event_name == other.event_name
42
46
  return false unless @payment_processor == other.payment_processor
43
- return false unless @invoice_id == other.invoice_id
44
47
  return false unless @metadata == other.metadata
48
+ return false unless @invoice_id == other.invoice_id
45
49
  true
46
50
  end
47
51
  end
@@ -12,10 +12,12 @@ class OpenApiSDK::Models::Operations::Sale
12
12
  def amount=(str_); end
13
13
  def currency(); end
14
14
  def currency=(str_); end
15
+ def event_name(); end
16
+ def event_name=(str_); end
15
17
  def payment_processor(); end
16
18
  def payment_processor=(str_); end
17
- def invoice_id(); end
18
- def invoice_id=(str_); end
19
19
  def metadata(); end
20
20
  def metadata=(str_); end
21
+ def invoice_id(); end
22
+ def invoice_id=(str_); end
21
23
  end
@@ -19,9 +19,9 @@ module OpenApiSDK
19
19
 
20
20
  field :customer, Crystalline::Nilable.new(Models::Operations::TrackSaleCustomer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('customer'), required: true } }
21
21
 
22
- field :sale, Crystalline::Nilable.new(Models::Operations::Sale), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('sale'), required: true } }
22
+ field :sale, Crystalline::Nilable.new(Models::Operations::TrackSaleSale), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('sale'), required: true } }
23
23
 
24
- sig { params(event_name: ::String, customer: T.nilable(Models::Operations::TrackSaleCustomer), sale: T.nilable(Models::Operations::Sale)).void }
24
+ sig { params(event_name: ::String, customer: T.nilable(Models::Operations::TrackSaleCustomer), sale: T.nilable(Models::Operations::TrackSaleSale)).void }
25
25
  def initialize(event_name:, customer: nil, sale: nil)
26
26
  @event_name = event_name
27
27
  @customer = customer
@@ -0,0 +1,50 @@
1
+ # Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
2
+ # Generated under the AGPL-3.0-only license.
3
+ # SPDX-License-Identifier: AGPL-3.0-only
4
+
5
+ # typed: true
6
+ # frozen_string_literal: true
7
+
8
+
9
+ module OpenApiSDK
10
+ module Models
11
+ module Operations
12
+
13
+ class TrackSaleSale
14
+ extend T::Sig
15
+ include Crystalline::MetadataFields
16
+
17
+
18
+ field :amount, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount'), required: true } }
19
+
20
+ field :currency, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency'), required: true } }
21
+
22
+ field :payment_processor, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('paymentProcessor'), required: true } }
23
+
24
+ field :invoice_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId'), required: true } }
25
+
26
+ field :metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('metadata'), required: true } }
27
+
28
+ sig { params(amount: ::Float, currency: ::String, payment_processor: ::String, invoice_id: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::Object])).void }
29
+ def initialize(amount:, currency:, payment_processor:, invoice_id: nil, metadata: nil)
30
+ @amount = amount
31
+ @currency = currency
32
+ @payment_processor = payment_processor
33
+ @invoice_id = invoice_id
34
+ @metadata = metadata
35
+ end
36
+
37
+ sig { params(other: T.untyped).returns(T::Boolean) }
38
+ def ==(other)
39
+ return false unless other.is_a? self.class
40
+ return false unless @amount == other.amount
41
+ return false unless @currency == other.currency
42
+ return false unless @payment_processor == other.payment_processor
43
+ return false unless @invoice_id == other.invoice_id
44
+ return false unless @metadata == other.metadata
45
+ true
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,21 @@
1
+ # typed: true
2
+ # frozen_string_literal: true
3
+
4
+
5
+ class OpenApiSDK::Models::Operations::TrackSaleSale
6
+ extend ::Crystalline::MetadataFields::ClassMethods
7
+ end
8
+
9
+
10
+ class OpenApiSDK::Models::Operations::TrackSaleSale
11
+ def amount(); end
12
+ def amount=(str_); end
13
+ def currency(); end
14
+ def currency=(str_); end
15
+ def payment_processor(); end
16
+ def payment_processor=(str_); end
17
+ def invoice_id(); end
18
+ def invoice_id=(str_); end
19
+ def metadata(); end
20
+ def metadata=(str_); end
21
+ end
@@ -16,28 +16,30 @@ module OpenApiSDK
16
16
 
17
17
  # The commission's unique ID on Dub.
18
18
  field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id'), required: true } }
19
-
19
+ # The type of commission. Can be `click`, `lead`, `sale`, `referral`, or `custom`.
20
+ field :type, Models::Operations::UpdateCommissionType, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), required: true, 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Operations::UpdateCommissionType, false) } }
21
+ # The associated event amount in cents. For sale commissions, this is the sale amount.
20
22
  field :amount, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount'), required: true } }
21
-
23
+ # The amount earned by the partner, in cents.
22
24
  field :earnings, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('earnings'), required: true } }
23
-
25
+ # The currency of the commission, as an ISO 4217 currency code.
24
26
  field :currency, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency'), required: true } }
25
-
27
+ # The current status of the commission.
26
28
  field :status, Models::Operations::UpdateCommissionStatus, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), required: true, 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Operations::UpdateCommissionStatus, false) } }
27
-
29
+ # The event quantity. Used for click and lead commissions; typically `1` for sale and custom commissions.
28
30
  field :quantity, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('quantity'), required: true } }
29
-
31
+ # The date and time when the commission was created.
30
32
  field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt'), required: true } }
31
-
33
+ # The date and time when the commission was last updated.
32
34
  field :updated_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('updatedAt'), required: true } }
33
35
 
34
36
  field :partner, Models::Operations::UpdateCommissionPartner, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('partner'), required: true } }
35
-
36
- field :type, Crystalline::Nilable.new(Models::Operations::UpdateCommissionType), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Operations::UpdateCommissionType, true) } }
37
-
37
+ # The associated invoice ID. Only set for sale commissions.
38
38
  field :invoice_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId'), required: true } }
39
-
39
+ # An optional description of the commission.
40
40
  field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('description'), required: true } }
41
+ # User-provided metadata from the associated lead or sale event (`lead.metadata` / `sale.metadata`).
42
+ field :metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('metadata'), required: true } }
41
43
  # The date the commission was paid out to the partner. Null if not paid yet.
42
44
  field :paid_at, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('paidAt'), required: true } }
43
45
  # The user who created the manual commission.
@@ -45,9 +47,10 @@ module OpenApiSDK
45
47
 
46
48
  field :customer, Crystalline::Nilable.new(Models::Operations::UpdateCommissionCustomer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('customer') } }
47
49
 
48
- sig { params(id: ::String, amount: ::Float, earnings: ::Float, currency: ::String, status: Models::Operations::UpdateCommissionStatus, quantity: ::Float, created_at: ::String, updated_at: ::String, partner: Models::Operations::UpdateCommissionPartner, type: T.nilable(Models::Operations::UpdateCommissionType), invoice_id: T.nilable(::String), description: T.nilable(::String), paid_at: T.nilable(::String), user_id: T.nilable(::String), customer: T.nilable(Models::Operations::UpdateCommissionCustomer)).void }
49
- def initialize(id:, amount:, earnings:, currency:, status:, quantity:, created_at:, updated_at:, partner:, type: nil, invoice_id: nil, description: nil, paid_at: nil, user_id: nil, customer: nil)
50
+ sig { params(id: ::String, type: Models::Operations::UpdateCommissionType, amount: ::Float, earnings: ::Float, currency: ::String, status: Models::Operations::UpdateCommissionStatus, quantity: ::Float, created_at: ::String, updated_at: ::String, partner: Models::Operations::UpdateCommissionPartner, invoice_id: T.nilable(::String), description: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::Object]), paid_at: T.nilable(::String), user_id: T.nilable(::String), customer: T.nilable(Models::Operations::UpdateCommissionCustomer)).void }
51
+ def initialize(id:, type:, amount:, earnings:, currency:, status:, quantity:, created_at:, updated_at:, partner:, invoice_id: nil, description: nil, metadata: nil, paid_at: nil, user_id: nil, customer: nil)
50
52
  @id = id
53
+ @type = type
51
54
  @amount = amount
52
55
  @earnings = earnings
53
56
  @currency = currency
@@ -56,9 +59,9 @@ module OpenApiSDK
56
59
  @created_at = created_at
57
60
  @updated_at = updated_at
58
61
  @partner = partner
59
- @type = type
60
62
  @invoice_id = invoice_id
61
63
  @description = description
64
+ @metadata = metadata
62
65
  @paid_at = paid_at
63
66
  @user_id = user_id
64
67
  @customer = customer
@@ -68,6 +71,7 @@ module OpenApiSDK
68
71
  def ==(other)
69
72
  return false unless other.is_a? self.class
70
73
  return false unless @id == other.id
74
+ return false unless @type == other.type
71
75
  return false unless @amount == other.amount
72
76
  return false unless @earnings == other.earnings
73
77
  return false unless @currency == other.currency
@@ -76,9 +80,9 @@ module OpenApiSDK
76
80
  return false unless @created_at == other.created_at
77
81
  return false unless @updated_at == other.updated_at
78
82
  return false unless @partner == other.partner
79
- return false unless @type == other.type
80
83
  return false unless @invoice_id == other.invoice_id
81
84
  return false unless @description == other.description
85
+ return false unless @metadata == other.metadata
82
86
  return false unless @paid_at == other.paid_at
83
87
  return false unless @user_id == other.user_id
84
88
  return false unless @customer == other.customer
@@ -10,6 +10,8 @@ end
10
10
  class OpenApiSDK::Models::Operations::UpdateCommissionResponseBody
11
11
  def id(); end
12
12
  def id=(str_); end
13
+ def type(); end
14
+ def type=(str_); end
13
15
  def amount(); end
14
16
  def amount=(str_); end
15
17
  def earnings(); end
@@ -26,12 +28,12 @@ class OpenApiSDK::Models::Operations::UpdateCommissionResponseBody
26
28
  def updated_at=(str_); end
27
29
  def partner(); end
28
30
  def partner=(str_); end
29
- def type(); end
30
- def type=(str_); end
31
31
  def invoice_id(); end
32
32
  def invoice_id=(str_); end
33
33
  def description(); end
34
34
  def description=(str_); end
35
+ def metadata(); end
36
+ def metadata=(str_); end
35
37
  def paid_at(); end
36
38
  def paid_at=(str_); end
37
39
  def user_id(); end
@@ -9,7 +9,7 @@
9
9
  module OpenApiSDK
10
10
  module Models
11
11
  module Operations
12
-
12
+ # UpdateCommissionStatus - The current status of the commission.
13
13
  class UpdateCommissionStatus < T::Enum
14
14
  enums do
15
15
  PENDING = new('pending')
@@ -9,7 +9,7 @@
9
9
  module OpenApiSDK
10
10
  module Models
11
11
  module Operations
12
-
12
+ # UpdateCommissionType - The type of commission. Can be `click`, `lead`, `sale`, `referral`, or `custom`.
13
13
  class UpdateCommissionType < T::Enum
14
14
  enums do
15
15
  CLICK = new('click')
@@ -159,6 +159,7 @@ module OpenApiSDK
159
159
  autoload :GroupBy, 'open_api_sdk/models/operations/groupby.rb'
160
160
  autoload :Ids, 'open_api_sdk/models/operations/ids.rb'
161
161
  autoload :Interval, 'open_api_sdk/models/operations/interval.rb'
162
+ autoload :Lead, 'open_api_sdk/models/operations/lead.rb'
162
163
  autoload :Level, 'open_api_sdk/models/operations/level.rb'
163
164
  autoload :Link, 'open_api_sdk/models/operations/link.rb'
164
165
  autoload :LinkProps, 'open_api_sdk/models/operations/linkprops.rb'
@@ -257,6 +258,7 @@ module OpenApiSDK
257
258
  autoload :RequestBody2, 'open_api_sdk/models/operations/requestbody_2.rb'
258
259
  autoload :RequestBody3, 'open_api_sdk/models/operations/requestbody_3.rb'
259
260
  autoload :RequestBodyCustomer, 'open_api_sdk/models/operations/requestbody_customer.rb'
261
+ autoload :RequestBodyPaymentProcessor, 'open_api_sdk/models/operations/requestbody_paymentprocessor.rb'
260
262
  autoload :RequestBodyType, 'open_api_sdk/models/operations/requestbody_type.rb'
261
263
  autoload :ResponseBody, 'open_api_sdk/models/operations/responsebody.rb'
262
264
  autoload :ResponseBodyClick, 'open_api_sdk/models/operations/responsebody_click.rb'
@@ -289,6 +291,7 @@ module OpenApiSDK
289
291
  autoload :TrackSaleCustomer, 'open_api_sdk/models/operations/tracksale_customer.rb'
290
292
  autoload :TrackSaleRequestBody, 'open_api_sdk/models/operations/tracksale_requestbody.rb'
291
293
  autoload :TrackSaleResponseBody, 'open_api_sdk/models/operations/tracksale_responsebody.rb'
294
+ autoload :TrackSaleSale, 'open_api_sdk/models/operations/tracksale_sale.rb'
292
295
  autoload :Type, 'open_api_sdk/models/operations/type.rb'
293
296
  autoload :UpdateCommissionCustomer, 'open_api_sdk/models/operations/updatecommission_customer.rb'
294
297
  autoload :UpdateCommissionPartner, 'open_api_sdk/models/operations/updatecommission_partner.rb'
@@ -16,28 +16,30 @@ module OpenApiSDK
16
16
 
17
17
  # The commission's unique ID on Dub.
18
18
  field :id, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('id'), required: true } }
19
-
19
+ # The type of commission. Can be `click`, `lead`, `sale`, `referral`, or `custom`.
20
+ field :type, Models::Shared::CommissionCreatedEventType, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), required: true, 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Shared::CommissionCreatedEventType, false) } }
21
+ # The associated event amount in cents. For sale commissions, this is the sale amount.
20
22
  field :amount, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('amount'), required: true } }
21
-
23
+ # The amount earned by the partner, in cents.
22
24
  field :earnings, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('earnings'), required: true } }
23
-
25
+ # The currency of the commission, as an ISO 4217 currency code.
24
26
  field :currency, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('currency'), required: true } }
25
-
27
+ # The current status of the commission.
26
28
  field :status, Models::Shared::CommissionCreatedEventStatus, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('status'), required: true, 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Shared::CommissionCreatedEventStatus, false) } }
27
-
29
+ # The event quantity. Used for click and lead commissions; typically `1` for sale and custom commissions.
28
30
  field :quantity, ::Float, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('quantity'), required: true } }
29
-
31
+ # The date and time when the commission was created.
30
32
  field :created_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('createdAt'), required: true } }
31
-
33
+ # The date and time when the commission was last updated.
32
34
  field :updated_at, ::String, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('updatedAt'), required: true } }
33
35
 
34
36
  field :partner, Models::Shared::CommissionCreatedEventPartner, { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('partner'), required: true } }
35
-
36
- field :type, Crystalline::Nilable.new(Models::Shared::CommissionCreatedEventType), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('type'), 'decoder': ::OpenApiSDK::Utils.enum_from_string(Models::Shared::CommissionCreatedEventType, true) } }
37
-
37
+ # The associated invoice ID. Only set for sale commissions.
38
38
  field :invoice_id, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('invoiceId'), required: true } }
39
-
39
+ # An optional description of the commission.
40
40
  field :description, Crystalline::Nilable.new(::String), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('description'), required: true } }
41
+ # User-provided metadata from the associated lead or sale event (`lead.metadata` / `sale.metadata`).
42
+ field :metadata, Crystalline::Nilable.new(Crystalline::Hash.new(Symbol, ::Object)), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('metadata'), required: true } }
41
43
 
42
44
  field :link, Crystalline::Nilable.new(Models::Shared::CommissionCreatedEventLink), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('link'), required: true } }
43
45
  # The user who created the manual commission.
@@ -45,9 +47,10 @@ module OpenApiSDK
45
47
 
46
48
  field :customer, Crystalline::Nilable.new(Models::Shared::CommissionCreatedEventCustomer), { 'format_json': { 'letter_case': ::OpenApiSDK::Utils.field_name('customer') } }
47
49
 
48
- sig { params(id: ::String, amount: ::Float, earnings: ::Float, currency: ::String, status: Models::Shared::CommissionCreatedEventStatus, quantity: ::Float, created_at: ::String, updated_at: ::String, partner: Models::Shared::CommissionCreatedEventPartner, type: T.nilable(Models::Shared::CommissionCreatedEventType), invoice_id: T.nilable(::String), description: T.nilable(::String), link: T.nilable(Models::Shared::CommissionCreatedEventLink), user_id: T.nilable(::String), customer: T.nilable(Models::Shared::CommissionCreatedEventCustomer)).void }
49
- def initialize(id:, amount:, earnings:, currency:, status:, quantity:, created_at:, updated_at:, partner:, type: nil, invoice_id: nil, description: nil, link: nil, user_id: nil, customer: nil)
50
+ sig { params(id: ::String, type: Models::Shared::CommissionCreatedEventType, amount: ::Float, earnings: ::Float, currency: ::String, status: Models::Shared::CommissionCreatedEventStatus, quantity: ::Float, created_at: ::String, updated_at: ::String, partner: Models::Shared::CommissionCreatedEventPartner, invoice_id: T.nilable(::String), description: T.nilable(::String), metadata: T.nilable(T::Hash[Symbol, ::Object]), link: T.nilable(Models::Shared::CommissionCreatedEventLink), user_id: T.nilable(::String), customer: T.nilable(Models::Shared::CommissionCreatedEventCustomer)).void }
51
+ def initialize(id:, type:, amount:, earnings:, currency:, status:, quantity:, created_at:, updated_at:, partner:, invoice_id: nil, description: nil, metadata: nil, link: nil, user_id: nil, customer: nil)
50
52
  @id = id
53
+ @type = type
51
54
  @amount = amount
52
55
  @earnings = earnings
53
56
  @currency = currency
@@ -56,9 +59,9 @@ module OpenApiSDK
56
59
  @created_at = created_at
57
60
  @updated_at = updated_at
58
61
  @partner = partner
59
- @type = type
60
62
  @invoice_id = invoice_id
61
63
  @description = description
64
+ @metadata = metadata
62
65
  @link = link
63
66
  @user_id = user_id
64
67
  @customer = customer
@@ -68,6 +71,7 @@ module OpenApiSDK
68
71
  def ==(other)
69
72
  return false unless other.is_a? self.class
70
73
  return false unless @id == other.id
74
+ return false unless @type == other.type
71
75
  return false unless @amount == other.amount
72
76
  return false unless @earnings == other.earnings
73
77
  return false unless @currency == other.currency
@@ -76,9 +80,9 @@ module OpenApiSDK
76
80
  return false unless @created_at == other.created_at
77
81
  return false unless @updated_at == other.updated_at
78
82
  return false unless @partner == other.partner
79
- return false unless @type == other.type
80
83
  return false unless @invoice_id == other.invoice_id
81
84
  return false unless @description == other.description
85
+ return false unless @metadata == other.metadata
82
86
  return false unless @link == other.link
83
87
  return false unless @user_id == other.user_id
84
88
  return false unless @customer == other.customer
@@ -10,6 +10,8 @@ end
10
10
  class OpenApiSDK::Models::Shared::CommissionCreatedEventData
11
11
  def id(); end
12
12
  def id=(str_); end
13
+ def type(); end
14
+ def type=(str_); end
13
15
  def amount(); end
14
16
  def amount=(str_); end
15
17
  def earnings(); end
@@ -26,12 +28,12 @@ class OpenApiSDK::Models::Shared::CommissionCreatedEventData
26
28
  def updated_at=(str_); end
27
29
  def partner(); end
28
30
  def partner=(str_); end
29
- def type(); end
30
- def type=(str_); end
31
31
  def invoice_id(); end
32
32
  def invoice_id=(str_); end
33
33
  def description(); end
34
34
  def description=(str_); end
35
+ def metadata(); end
36
+ def metadata=(str_); end
35
37
  def link(); end
36
38
  def link=(str_); end
37
39
  def user_id(); end
@@ -9,7 +9,7 @@
9
9
  module OpenApiSDK
10
10
  module Models
11
11
  module Shared
12
-
12
+ # CommissionCreatedEventStatus - The current status of the commission.
13
13
  class CommissionCreatedEventStatus < T::Enum
14
14
  enums do
15
15
  PENDING = new('pending')
@@ -9,7 +9,7 @@
9
9
  module OpenApiSDK
10
10
  module Models
11
11
  module Shared
12
-
12
+ # CommissionCreatedEventType - The type of commission. Can be `click`, `lead`, `sale`, `referral`, or `custom`.
13
13
  class CommissionCreatedEventType < T::Enum
14
14
  enums do
15
15
  CLICK = new('click')
@@ -90,9 +90,9 @@ module OpenApiSDK
90
90
  end
91
91
  @language = 'ruby'
92
92
  @openapi_doc_version = '0.0.1'
93
- @sdk_version = '0.12.12'
94
- @gen_version = '2.932.9'
95
- @user_agent = 'speakeasy-sdk/ruby 0.12.12 2.932.9 0.0.1 dub'
93
+ @sdk_version = '0.12.14'
94
+ @gen_version = '2.933.0'
95
+ @user_agent = 'speakeasy-sdk/ruby 0.12.14 2.933.0 0.0.1 dub'
96
96
  end
97
97
 
98
98
  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.12.12
4
+ version: 0.12.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dub
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-21 00:00:00.000000000 Z
11
+ date: 2026-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -611,6 +611,8 @@ files:
611
611
  - lib/open_api_sdk/models/operations/ids.rbi
612
612
  - lib/open_api_sdk/models/operations/interval.rb
613
613
  - lib/open_api_sdk/models/operations/interval.rbi
614
+ - lib/open_api_sdk/models/operations/lead.rb
615
+ - lib/open_api_sdk/models/operations/lead.rbi
614
616
  - lib/open_api_sdk/models/operations/leadevent.rb
615
617
  - lib/open_api_sdk/models/operations/leadevent.rbi
616
618
  - lib/open_api_sdk/models/operations/level.rb
@@ -811,6 +813,8 @@ files:
811
813
  - lib/open_api_sdk/models/operations/requestbody_3.rbi
812
814
  - lib/open_api_sdk/models/operations/requestbody_customer.rb
813
815
  - lib/open_api_sdk/models/operations/requestbody_customer.rbi
816
+ - lib/open_api_sdk/models/operations/requestbody_paymentprocessor.rb
817
+ - lib/open_api_sdk/models/operations/requestbody_paymentprocessor.rbi
814
818
  - lib/open_api_sdk/models/operations/requestbody_type.rb
815
819
  - lib/open_api_sdk/models/operations/requestbody_type.rbi
816
820
  - lib/open_api_sdk/models/operations/responsebody.rb
@@ -883,6 +887,8 @@ files:
883
887
  - lib/open_api_sdk/models/operations/tracksale_requestbody.rbi
884
888
  - lib/open_api_sdk/models/operations/tracksale_responsebody.rb
885
889
  - lib/open_api_sdk/models/operations/tracksale_responsebody.rbi
890
+ - lib/open_api_sdk/models/operations/tracksale_sale.rb
891
+ - lib/open_api_sdk/models/operations/tracksale_sale.rbi
886
892
  - lib/open_api_sdk/models/operations/two.rb
887
893
  - lib/open_api_sdk/models/operations/two.rbi
888
894
  - lib/open_api_sdk/models/operations/type.rb