orb-billing 0.10.0 → 0.12.0

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +32 -0
  3. data/README.md +1 -1
  4. data/lib/orb/internal/type/union.rb +3 -8
  5. data/lib/orb/internal/util.rb +8 -9
  6. data/lib/orb/models/amount_discount.rb +65 -1
  7. data/lib/orb/models/beta/external_plan_id_create_plan_version_params.rb +1437 -15
  8. data/lib/orb/models/beta_create_plan_version_params.rb +1435 -15
  9. data/lib/orb/models/percentage_discount.rb +65 -1
  10. data/lib/orb/models/subscription_create_params.rb +1435 -15
  11. data/lib/orb/models/subscription_price_intervals_params.rb +715 -5
  12. data/lib/orb/models/subscription_redeem_coupon_params.rb +17 -9
  13. data/lib/orb/models/subscription_schedule_plan_change_params.rb +1435 -15
  14. data/lib/orb/models/trial_discount.rb +65 -1
  15. data/lib/orb/models/usage_discount.rb +65 -1
  16. data/lib/orb/resources/subscriptions.rb +6 -4
  17. data/lib/orb/version.rb +1 -1
  18. data/rbi/orb/internal/util.rbi +2 -0
  19. data/rbi/orb/models/amount_discount.rbi +117 -0
  20. data/rbi/orb/models/beta/external_plan_id_create_plan_version_params.rbi +6145 -3045
  21. data/rbi/orb/models/beta_create_plan_version_params.rbi +6096 -2996
  22. data/rbi/orb/models/percentage_discount.rbi +131 -0
  23. data/rbi/orb/models/subscription_create_params.rbi +6037 -2937
  24. data/rbi/orb/models/subscription_price_intervals_params.rbi +1633 -83
  25. data/rbi/orb/models/subscription_redeem_coupon_params.rbi +16 -8
  26. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +6948 -3848
  27. data/rbi/orb/models/trial_discount.rbi +109 -0
  28. data/rbi/orb/models/usage_discount.rbi +109 -0
  29. data/rbi/orb/resources/subscriptions.rbi +7 -4
  30. data/sig/orb/models/amount_discount.rbs +58 -0
  31. data/sig/orb/models/beta/external_plan_id_create_plan_version_params.rbs +1130 -20
  32. data/sig/orb/models/beta_create_plan_version_params.rbs +1130 -20
  33. data/sig/orb/models/percentage_discount.rbs +58 -0
  34. data/sig/orb/models/subscription_create_params.rbs +1130 -20
  35. data/sig/orb/models/subscription_price_intervals_params.rbs +565 -10
  36. data/sig/orb/models/subscription_redeem_coupon_params.rbs +11 -6
  37. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +1130 -20
  38. data/sig/orb/models/trial_discount.rbs +58 -0
  39. data/sig/orb/models/usage_discount.rbs +58 -0
  40. data/sig/orb/resources/subscriptions.rbs +2 -1
  41. metadata +2 -2
@@ -16,10 +16,6 @@ module Orb
16
16
  end
17
17
  attr_accessor :change_option
18
18
 
19
- # Coupon ID to be redeemed for this subscription.
20
- sig { returns(String) }
21
- attr_accessor :coupon_id
22
-
23
19
  # If false, this request will fail if it would void an issued invoice or create a
24
20
  # credit note. Consider using this as a safety mechanism if you do not expect
25
21
  # existing invoices to be changed.
@@ -31,20 +27,27 @@ module Orb
31
27
  sig { returns(T.nilable(Time)) }
32
28
  attr_accessor :change_date
33
29
 
30
+ # Coupon ID to be redeemed for this subscription.
31
+ sig { returns(T.nilable(String)) }
32
+ attr_accessor :coupon_id
33
+
34
+ # Redemption code of the coupon to be redeemed for this subscription.
35
+ sig { returns(T.nilable(String)) }
36
+ attr_accessor :coupon_redemption_code
37
+
34
38
  sig do
35
39
  params(
36
40
  change_option:
37
41
  Orb::SubscriptionRedeemCouponParams::ChangeOption::OrSymbol,
38
- coupon_id: String,
39
42
  allow_invoice_credit_or_void: T.nilable(T::Boolean),
40
43
  change_date: T.nilable(Time),
44
+ coupon_id: T.nilable(String),
45
+ coupon_redemption_code: T.nilable(String),
41
46
  request_options: Orb::RequestOptions::OrHash
42
47
  ).returns(T.attached_class)
43
48
  end
44
49
  def self.new(
45
50
  change_option:,
46
- # Coupon ID to be redeemed for this subscription.
47
- coupon_id:,
48
51
  # If false, this request will fail if it would void an issued invoice or create a
49
52
  # credit note. Consider using this as a safety mechanism if you do not expect
50
53
  # existing invoices to be changed.
@@ -52,6 +55,10 @@ module Orb
52
55
  # The date that the coupon discount should take effect. This parameter can only be
53
56
  # passed if the `change_option` is `requested_date`.
54
57
  change_date: nil,
58
+ # Coupon ID to be redeemed for this subscription.
59
+ coupon_id: nil,
60
+ # Redemption code of the coupon to be redeemed for this subscription.
61
+ coupon_redemption_code: nil,
55
62
  request_options: {}
56
63
  )
57
64
  end
@@ -61,9 +68,10 @@ module Orb
61
68
  {
62
69
  change_option:
63
70
  Orb::SubscriptionRedeemCouponParams::ChangeOption::OrSymbol,
64
- coupon_id: String,
65
71
  allow_invoice_credit_or_void: T.nilable(T::Boolean),
66
72
  change_date: T.nilable(Time),
73
+ coupon_id: T.nilable(String),
74
+ coupon_redemption_code: T.nilable(String),
67
75
  request_options: Orb::RequestOptions
68
76
  }
69
77
  )