orb-billing 0.5.5 → 0.6.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 (210) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +13 -0
  3. data/README.md +1 -1
  4. data/lib/orb/internal/type/base_model.rb +2 -2
  5. data/lib/orb/internal/type/union.rb +6 -6
  6. data/lib/orb/models/alert.rb +33 -1
  7. data/lib/orb/models/amount_discount.rb +10 -10
  8. data/lib/orb/models/credit_note_create_params.rb +9 -9
  9. data/lib/orb/models/customer_create_params.rb +21 -3
  10. data/lib/orb/models/customer_update_by_external_id_params.rb +21 -3
  11. data/lib/orb/models/customer_update_params.rb +21 -3
  12. data/lib/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rb +9 -1
  13. data/lib/orb/models/customers/credits/ledger_create_entry_response.rb +9 -1
  14. data/lib/orb/models/customers/credits/ledger_list_by_external_id_response.rb +9 -1
  15. data/lib/orb/models/customers/credits/ledger_list_response.rb +9 -1
  16. data/lib/orb/models/customers/credits/top_up_create_by_external_id_params.rb +1 -1
  17. data/lib/orb/models/customers/credits/top_up_create_params.rb +1 -1
  18. data/lib/orb/models/invoice.rb +626 -9
  19. data/lib/orb/models/invoice_fetch_upcoming_response.rb +624 -9
  20. data/lib/orb/models/invoice_line_item_create_response.rb +486 -7
  21. data/lib/orb/models/item.rb +18 -1
  22. data/lib/orb/models/item_archive_params.rb +14 -0
  23. data/lib/orb/models/item_create_params.rb +14 -1
  24. data/lib/orb/models/item_update_params.rb +16 -1
  25. data/lib/orb/models/percentage_discount.rb +10 -10
  26. data/lib/orb/models/plan.rb +618 -9
  27. data/lib/orb/models/plan_create_params.rb +2066 -30
  28. data/lib/orb/models/plan_set_default_version_params.rb +22 -0
  29. data/lib/orb/models/plans/external_plan_id/version_create_params.rb +17948 -0
  30. data/lib/orb/models/plans/external_plan_id/version_create_response.rb +819 -0
  31. data/lib/orb/models/plans/external_plan_id/version_retrieve_params.rb +24 -0
  32. data/lib/orb/models/plans/external_plan_id/version_retrieve_response.rb +819 -0
  33. data/lib/orb/models/plans/external_plan_id_set_default_version_params.rb +24 -0
  34. data/lib/orb/models/plans/version_create_params.rb +17794 -0
  35. data/lib/orb/models/plans/version_create_response.rb +814 -0
  36. data/lib/orb/models/plans/version_retrieve_params.rb +22 -0
  37. data/lib/orb/models/plans/version_retrieve_response.rb +814 -0
  38. data/lib/orb/models/price.rb +4124 -70
  39. data/lib/orb/models/price_create_params.rb +45 -1
  40. data/lib/orb/models/price_evaluate_params.rb +8529 -21
  41. data/lib/orb/models/price_evaluate_response.rb +38 -3
  42. data/lib/orb/models/subscription.rb +730 -54
  43. data/lib/orb/models/subscription_cancel_response.rb +706 -54
  44. data/lib/orb/models/subscription_change_apply_response.rb +728 -54
  45. data/lib/orb/models/subscription_change_cancel_response.rb +728 -54
  46. data/lib/orb/models/subscription_change_retrieve_response.rb +728 -54
  47. data/lib/orb/models/subscription_create_params.rb +5992 -1698
  48. data/lib/orb/models/subscription_create_response.rb +706 -54
  49. data/lib/orb/models/subscription_fetch_schedule_response.rb +3 -3
  50. data/lib/orb/models/subscription_price_intervals_params.rb +1392 -76
  51. data/lib/orb/models/subscription_price_intervals_response.rb +712 -54
  52. data/lib/orb/models/subscription_schedule_plan_change_params.rb +6005 -1723
  53. data/lib/orb/models/subscription_schedule_plan_change_response.rb +716 -54
  54. data/lib/orb/models/subscription_trigger_phase_response.rb +708 -54
  55. data/lib/orb/models/subscription_unschedule_cancellation_response.rb +720 -54
  56. data/lib/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rb +728 -54
  57. data/lib/orb/models/subscription_unschedule_pending_plan_changes_response.rb +728 -54
  58. data/lib/orb/models/subscription_update_fixed_fee_quantity_params.rb +1 -1
  59. data/lib/orb/models/subscription_update_fixed_fee_quantity_response.rb +720 -54
  60. data/lib/orb/models/subscription_update_trial_response.rb +706 -54
  61. data/lib/orb/models/trial_discount.rb +10 -10
  62. data/lib/orb/models/usage_discount.rb +10 -10
  63. data/lib/orb/models.rb +4 -0
  64. data/lib/orb/resources/credit_notes.rb +3 -3
  65. data/lib/orb/resources/customers/balance_transactions.rb +0 -7
  66. data/lib/orb/resources/customers.rb +4 -7
  67. data/lib/orb/resources/dimensional_price_groups.rb +1 -1
  68. data/lib/orb/resources/items.rb +34 -2
  69. data/lib/orb/resources/plans/external_plan_id/versions.rb +88 -0
  70. data/lib/orb/resources/plans/external_plan_id.rb +32 -1
  71. data/lib/orb/resources/plans/versions.rb +86 -0
  72. data/lib/orb/resources/plans.rb +33 -2
  73. data/lib/orb/resources/prices.rb +23 -17
  74. data/lib/orb/resources/subscriptions.rb +5 -1
  75. data/lib/orb/version.rb +1 -1
  76. data/lib/orb.rb +13 -0
  77. data/rbi/orb/models/alert.rbi +50 -3
  78. data/rbi/orb/models/amount_discount.rbi +8 -8
  79. data/rbi/orb/models/credit_note_create_params.rbi +8 -8
  80. data/rbi/orb/models/customer_create_params.rbi +38 -4
  81. data/rbi/orb/models/customer_update_by_external_id_params.rbi +38 -4
  82. data/rbi/orb/models/customer_update_params.rbi +38 -4
  83. data/rbi/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbi +9 -1
  84. data/rbi/orb/models/customers/credits/ledger_create_entry_response.rbi +9 -1
  85. data/rbi/orb/models/customers/credits/ledger_list_by_external_id_response.rbi +9 -1
  86. data/rbi/orb/models/customers/credits/ledger_list_response.rbi +9 -1
  87. data/rbi/orb/models/customers/credits/top_up_create_by_external_id_params.rbi +2 -2
  88. data/rbi/orb/models/customers/credits/top_up_create_params.rbi +2 -2
  89. data/rbi/orb/models/invoice.rbi +1451 -35
  90. data/rbi/orb/models/invoice_fetch_upcoming_response.rbi +1524 -4
  91. data/rbi/orb/models/invoice_line_item_create_response.rbi +1184 -2
  92. data/rbi/orb/models/item.rbi +20 -1
  93. data/rbi/orb/models/item_archive_params.rbi +25 -0
  94. data/rbi/orb/models/item_create_params.rbi +18 -1
  95. data/rbi/orb/models/item_update_params.rbi +17 -1
  96. data/rbi/orb/models/percentage_discount.rbi +10 -10
  97. data/rbi/orb/models/plan.rbi +1339 -4
  98. data/rbi/orb/models/plan_create_params.rbi +3833 -29
  99. data/rbi/orb/models/plan_set_default_version_params.rbi +40 -0
  100. data/rbi/orb/models/plans/external_plan_id/version_create_params.rbi +32668 -0
  101. data/rbi/orb/models/plans/external_plan_id/version_create_response.rbi +1562 -0
  102. data/rbi/orb/models/plans/external_plan_id/version_retrieve_params.rbi +42 -0
  103. data/rbi/orb/models/plans/external_plan_id/version_retrieve_response.rbi +1562 -0
  104. data/rbi/orb/models/plans/external_plan_id_set_default_version_params.rbi +45 -0
  105. data/rbi/orb/models/plans/version_create_params.rbi +32607 -0
  106. data/rbi/orb/models/plans/version_create_response.rbi +1556 -0
  107. data/rbi/orb/models/plans/version_retrieve_params.rbi +37 -0
  108. data/rbi/orb/models/plans/version_retrieve_response.rbi +1558 -0
  109. data/rbi/orb/models/price.rbi +9447 -441
  110. data/rbi/orb/models/price_create_params.rbi +80 -0
  111. data/rbi/orb/models/price_evaluate_params.rbi +15684 -25
  112. data/rbi/orb/models/price_evaluate_response.rbi +68 -5
  113. data/rbi/orb/models/subscription.rbi +1654 -44
  114. data/rbi/orb/models/subscription_cancel_response.rbi +1692 -44
  115. data/rbi/orb/models/subscription_change_apply_response.rbi +1692 -44
  116. data/rbi/orb/models/subscription_change_cancel_response.rbi +1692 -44
  117. data/rbi/orb/models/subscription_change_retrieve_response.rbi +1692 -44
  118. data/rbi/orb/models/subscription_create_params.rbi +10400 -2710
  119. data/rbi/orb/models/subscription_create_response.rbi +1692 -44
  120. data/rbi/orb/models/subscription_fetch_schedule_response.rbi +13 -4
  121. data/rbi/orb/models/subscription_price_intervals_params.rbi +2401 -49
  122. data/rbi/orb/models/subscription_price_intervals_response.rbi +1692 -44
  123. data/rbi/orb/models/subscription_schedule_plan_change_params.rbi +10423 -2753
  124. data/rbi/orb/models/subscription_schedule_plan_change_response.rbi +1692 -44
  125. data/rbi/orb/models/subscription_trigger_phase_response.rbi +1692 -44
  126. data/rbi/orb/models/subscription_unschedule_cancellation_response.rbi +1692 -44
  127. data/rbi/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbi +1692 -44
  128. data/rbi/orb/models/subscription_unschedule_pending_plan_changes_response.rbi +1692 -44
  129. data/rbi/orb/models/subscription_update_fixed_fee_quantity_params.rbi +2 -2
  130. data/rbi/orb/models/subscription_update_fixed_fee_quantity_response.rbi +1692 -44
  131. data/rbi/orb/models/subscription_update_trial_response.rbi +1692 -44
  132. data/rbi/orb/models/trial_discount.rbi +8 -8
  133. data/rbi/orb/models/usage_discount.rbi +10 -10
  134. data/rbi/orb/models.rbi +4 -0
  135. data/rbi/orb/resources/credit_notes.rbi +3 -3
  136. data/rbi/orb/resources/customers/balance_transactions.rbi +0 -7
  137. data/rbi/orb/resources/customers/credits/top_ups.rbi +2 -2
  138. data/rbi/orb/resources/customers.rbi +7 -7
  139. data/rbi/orb/resources/dimensional_price_groups.rbi +1 -1
  140. data/rbi/orb/resources/items.rbi +20 -0
  141. data/rbi/orb/resources/plans/external_plan_id/versions.rbi +103 -0
  142. data/rbi/orb/resources/plans/external_plan_id.rbi +23 -1
  143. data/rbi/orb/resources/plans/versions.rbi +91 -0
  144. data/rbi/orb/resources/plans.rbi +27 -2
  145. data/rbi/orb/resources/prices.rbi +27 -17
  146. data/rbi/orb/resources/subscriptions.rbi +9 -1
  147. data/sig/orb/models/alert.rbs +20 -3
  148. data/sig/orb/models/amount_discount.rbs +5 -5
  149. data/sig/orb/models/credit_note_create_params.rbs +6 -6
  150. data/sig/orb/models/customer_create_params.rbs +13 -0
  151. data/sig/orb/models/customer_update_by_external_id_params.rbs +13 -0
  152. data/sig/orb/models/customer_update_params.rbs +13 -0
  153. data/sig/orb/models/customers/credits/ledger_create_entry_by_external_id_response.rbs +7 -2
  154. data/sig/orb/models/customers/credits/ledger_create_entry_response.rbs +7 -2
  155. data/sig/orb/models/customers/credits/ledger_list_by_external_id_response.rbs +7 -2
  156. data/sig/orb/models/customers/credits/ledger_list_response.rbs +7 -2
  157. data/sig/orb/models/invoice.rbs +558 -4
  158. data/sig/orb/models/invoice_fetch_upcoming_response.rbs +558 -4
  159. data/sig/orb/models/invoice_line_item_create_response.rbs +414 -2
  160. data/sig/orb/models/item.rbs +5 -0
  161. data/sig/orb/models/item_archive_params.rbs +14 -0
  162. data/sig/orb/models/item_create_params.rbs +10 -2
  163. data/sig/orb/models/item_update_params.rbs +5 -0
  164. data/sig/orb/models/percentage_discount.rbs +5 -5
  165. data/sig/orb/models/plan.rbs +538 -4
  166. data/sig/orb/models/plan_create_params.rbs +1460 -3
  167. data/sig/orb/models/plan_set_default_version_params.rbs +20 -0
  168. data/sig/orb/models/plans/external_plan_id/version_create_params.rbs +12923 -0
  169. data/sig/orb/models/plans/external_plan_id/version_create_response.rbs +664 -0
  170. data/sig/orb/models/plans/external_plan_id/version_retrieve_params.rbs +27 -0
  171. data/sig/orb/models/plans/external_plan_id/version_retrieve_response.rbs +664 -0
  172. data/sig/orb/models/plans/external_plan_id_set_default_version_params.rbs +25 -0
  173. data/sig/orb/models/plans/version_create_params.rbs +12898 -0
  174. data/sig/orb/models/plans/version_create_response.rbs +662 -0
  175. data/sig/orb/models/plans/version_retrieve_params.rbs +25 -0
  176. data/sig/orb/models/plans/version_retrieve_response.rbs +662 -0
  177. data/sig/orb/models/price.rbs +3512 -96
  178. data/sig/orb/models/price_create_params.rbs +32 -0
  179. data/sig/orb/models/price_evaluate_params.rbs +6187 -10
  180. data/sig/orb/models/price_evaluate_response.rbs +41 -4
  181. data/sig/orb/models/subscription.rbs +609 -29
  182. data/sig/orb/models/subscription_cancel_response.rbs +609 -29
  183. data/sig/orb/models/subscription_change_apply_response.rbs +621 -29
  184. data/sig/orb/models/subscription_change_cancel_response.rbs +621 -29
  185. data/sig/orb/models/subscription_change_retrieve_response.rbs +621 -29
  186. data/sig/orb/models/subscription_create_params.rbs +4450 -1466
  187. data/sig/orb/models/subscription_create_response.rbs +609 -29
  188. data/sig/orb/models/subscription_fetch_schedule_response.rbs +4 -4
  189. data/sig/orb/models/subscription_price_intervals_params.rbs +920 -24
  190. data/sig/orb/models/subscription_price_intervals_response.rbs +609 -29
  191. data/sig/orb/models/subscription_schedule_plan_change_params.rbs +4440 -1466
  192. data/sig/orb/models/subscription_schedule_plan_change_response.rbs +609 -29
  193. data/sig/orb/models/subscription_trigger_phase_response.rbs +609 -29
  194. data/sig/orb/models/subscription_unschedule_cancellation_response.rbs +609 -29
  195. data/sig/orb/models/subscription_unschedule_fixed_fee_quantity_updates_response.rbs +609 -29
  196. data/sig/orb/models/subscription_unschedule_pending_plan_changes_response.rbs +609 -29
  197. data/sig/orb/models/subscription_update_fixed_fee_quantity_response.rbs +609 -29
  198. data/sig/orb/models/subscription_update_trial_response.rbs +609 -29
  199. data/sig/orb/models/trial_discount.rbs +5 -5
  200. data/sig/orb/models/usage_discount.rbs +5 -5
  201. data/sig/orb/models.rbs +4 -0
  202. data/sig/orb/resources/credit_notes.rbs +1 -1
  203. data/sig/orb/resources/items.rbs +7 -0
  204. data/sig/orb/resources/plans/external_plan_id/versions.rbs +30 -0
  205. data/sig/orb/resources/plans/external_plan_id.rbs +8 -0
  206. data/sig/orb/resources/plans/versions.rbs +28 -0
  207. data/sig/orb/resources/plans.rbs +8 -0
  208. data/sig/orb/resources/prices.rbs +3 -3
  209. data/sig/orb/resources/subscriptions.rbs +2 -0
  210. metadata +40 -1
@@ -0,0 +1,819 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ module Plans
6
+ module ExternalPlanID
7
+ # @see Orb::Resources::Plans::ExternalPlanID::Versions#create
8
+ class VersionCreateResponse < Orb::Internal::Type::BaseModel
9
+ # @!attribute adjustments
10
+ # Adjustments for this plan. If the plan has phases, this includes adjustments
11
+ # across all phases of the plan.
12
+ #
13
+ # @return [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum>]
14
+ required :adjustments,
15
+ -> { Orb::Internal::Type::ArrayOf[union: Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment] }
16
+
17
+ # @!attribute created_at
18
+ #
19
+ # @return [Time]
20
+ required :created_at, Time
21
+
22
+ # @!attribute plan_phases
23
+ #
24
+ # @return [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::PlanPhase>, nil]
25
+ required :plan_phases,
26
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::PlanPhase] },
27
+ nil?: true
28
+
29
+ # @!attribute prices
30
+ # Prices for this plan. If the plan has phases, this includes prices across all
31
+ # phases of the plan.
32
+ #
33
+ # @return [Array<Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBps, Orb::Models::Price::Bps, Orb::Models::Price::BulkBps, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk>]
34
+ required :prices, -> { Orb::Internal::Type::ArrayOf[union: Orb::Price] }
35
+
36
+ # @!attribute version
37
+ #
38
+ # @return [Integer]
39
+ required :version, Integer
40
+
41
+ # @!method initialize(adjustments:, created_at:, plan_phases:, prices:, version:)
42
+ # Some parameter documentations has been truncated, see
43
+ # {Orb::Models::Plans::ExternalPlanID::VersionCreateResponse} for more details.
44
+ #
45
+ # The PlanVersion resource represents the prices and adjustments present on a
46
+ # specific version of a plan.
47
+ #
48
+ # @param adjustments [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum>] Adjustments for this plan. If the plan has phases, this includes adjustments acr
49
+ #
50
+ # @param created_at [Time]
51
+ #
52
+ # @param plan_phases [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::PlanPhase>, nil]
53
+ #
54
+ # @param prices [Array<Orb::Models::Price::Unit, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::Tiered, Orb::Models::Price::TieredBps, Orb::Models::Price::Bps, Orb::Models::Price::BulkBps, Orb::Models::Price::Bulk, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::GroupedTiered, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk>] Prices for this plan. If the plan has phases, this includes prices across all ph
55
+ #
56
+ # @param version [Integer]
57
+
58
+ module Adjustment
59
+ extend Orb::Internal::Type::Union
60
+
61
+ discriminator :adjustment_type
62
+
63
+ variant :usage_discount,
64
+ -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount }
65
+
66
+ variant :amount_discount,
67
+ -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount }
68
+
69
+ variant :percentage_discount,
70
+ -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount }
71
+
72
+ variant :minimum, -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum }
73
+
74
+ variant :maximum, -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum }
75
+
76
+ class UsageDiscount < Orb::Internal::Type::BaseModel
77
+ # @!attribute id
78
+ #
79
+ # @return [String]
80
+ required :id, String
81
+
82
+ # @!attribute adjustment_type
83
+ #
84
+ # @return [Symbol, :usage_discount]
85
+ required :adjustment_type, const: :usage_discount
86
+
87
+ # @!attribute applies_to_price_ids
88
+ # @deprecated
89
+ #
90
+ # The price IDs that this adjustment applies to.
91
+ #
92
+ # @return [Array<String>]
93
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
94
+
95
+ # @!attribute filters
96
+ # The filters that determine which prices to apply this adjustment to.
97
+ #
98
+ # @return [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter>]
99
+ required :filters,
100
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter] }
101
+
102
+ # @!attribute is_invoice_level
103
+ # True for adjustments that apply to an entire invocice, false for adjustments
104
+ # that apply to only one price.
105
+ #
106
+ # @return [Boolean]
107
+ required :is_invoice_level, Orb::Internal::Type::Boolean
108
+
109
+ # @!attribute plan_phase_order
110
+ # The plan phase in which this adjustment is active.
111
+ #
112
+ # @return [Integer, nil]
113
+ required :plan_phase_order, Integer, nil?: true
114
+
115
+ # @!attribute reason
116
+ # The reason for the adjustment.
117
+ #
118
+ # @return [String, nil]
119
+ required :reason, String, nil?: true
120
+
121
+ # @!attribute usage_discount
122
+ # The number of usage units by which to discount the price this adjustment applies
123
+ # to in a given billing period.
124
+ #
125
+ # @return [Float]
126
+ required :usage_discount, Float
127
+
128
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, plan_phase_order:, reason:, usage_discount:, adjustment_type: :usage_discount)
129
+ # Some parameter documentations has been truncated, see
130
+ # {Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount}
131
+ # for more details.
132
+ #
133
+ # @param id [String]
134
+ #
135
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
136
+ #
137
+ # @param filters [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
138
+ #
139
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
140
+ #
141
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
142
+ #
143
+ # @param reason [String, nil] The reason for the adjustment.
144
+ #
145
+ # @param usage_discount [Float] The number of usage units by which to discount the price this adjustment applies
146
+ #
147
+ # @param adjustment_type [Symbol, :usage_discount]
148
+
149
+ class Filter < Orb::Internal::Type::BaseModel
150
+ # @!attribute field
151
+ # The property of the price to filter on.
152
+ #
153
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field]
154
+ required :field,
155
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field }
156
+
157
+ # @!attribute operator
158
+ # Should prices that match the filter be included or excluded.
159
+ #
160
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator]
161
+ required :operator,
162
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator }
163
+
164
+ # @!attribute values
165
+ # The IDs or values that match this filter.
166
+ #
167
+ # @return [Array<String>]
168
+ required :values, Orb::Internal::Type::ArrayOf[String]
169
+
170
+ # @!method initialize(field:, operator:, values:)
171
+ # @param field [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Field] The property of the price to filter on.
172
+ #
173
+ # @param operator [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
174
+ #
175
+ # @param values [Array<String>] The IDs or values that match this filter.
176
+
177
+ # The property of the price to filter on.
178
+ #
179
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter#field
180
+ module Field
181
+ extend Orb::Internal::Type::Enum
182
+
183
+ PRICE_ID = :price_id
184
+ ITEM_ID = :item_id
185
+ PRICE_TYPE = :price_type
186
+ CURRENCY = :currency
187
+ PRICING_UNIT_ID = :pricing_unit_id
188
+
189
+ # @!method self.values
190
+ # @return [Array<Symbol>]
191
+ end
192
+
193
+ # Should prices that match the filter be included or excluded.
194
+ #
195
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount::Filter#operator
196
+ module Operator
197
+ extend Orb::Internal::Type::Enum
198
+
199
+ INCLUDES = :includes
200
+ EXCLUDES = :excludes
201
+
202
+ # @!method self.values
203
+ # @return [Array<Symbol>]
204
+ end
205
+ end
206
+ end
207
+
208
+ class AmountDiscount < Orb::Internal::Type::BaseModel
209
+ # @!attribute id
210
+ #
211
+ # @return [String]
212
+ required :id, String
213
+
214
+ # @!attribute adjustment_type
215
+ #
216
+ # @return [Symbol, :amount_discount]
217
+ required :adjustment_type, const: :amount_discount
218
+
219
+ # @!attribute amount_discount
220
+ # The amount by which to discount the prices this adjustment applies to in a given
221
+ # billing period.
222
+ #
223
+ # @return [String]
224
+ required :amount_discount, String
225
+
226
+ # @!attribute applies_to_price_ids
227
+ # @deprecated
228
+ #
229
+ # The price IDs that this adjustment applies to.
230
+ #
231
+ # @return [Array<String>]
232
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
233
+
234
+ # @!attribute filters
235
+ # The filters that determine which prices to apply this adjustment to.
236
+ #
237
+ # @return [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter>]
238
+ required :filters,
239
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter] }
240
+
241
+ # @!attribute is_invoice_level
242
+ # True for adjustments that apply to an entire invocice, false for adjustments
243
+ # that apply to only one price.
244
+ #
245
+ # @return [Boolean]
246
+ required :is_invoice_level, Orb::Internal::Type::Boolean
247
+
248
+ # @!attribute plan_phase_order
249
+ # The plan phase in which this adjustment is active.
250
+ #
251
+ # @return [Integer, nil]
252
+ required :plan_phase_order, Integer, nil?: true
253
+
254
+ # @!attribute reason
255
+ # The reason for the adjustment.
256
+ #
257
+ # @return [String, nil]
258
+ required :reason, String, nil?: true
259
+
260
+ # @!method initialize(id:, amount_discount:, applies_to_price_ids:, filters:, is_invoice_level:, plan_phase_order:, reason:, adjustment_type: :amount_discount)
261
+ # Some parameter documentations has been truncated, see
262
+ # {Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount}
263
+ # for more details.
264
+ #
265
+ # @param id [String]
266
+ #
267
+ # @param amount_discount [String] The amount by which to discount the prices this adjustment applies to in a given
268
+ #
269
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
270
+ #
271
+ # @param filters [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
272
+ #
273
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
274
+ #
275
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
276
+ #
277
+ # @param reason [String, nil] The reason for the adjustment.
278
+ #
279
+ # @param adjustment_type [Symbol, :amount_discount]
280
+
281
+ class Filter < Orb::Internal::Type::BaseModel
282
+ # @!attribute field
283
+ # The property of the price to filter on.
284
+ #
285
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field]
286
+ required :field,
287
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field }
288
+
289
+ # @!attribute operator
290
+ # Should prices that match the filter be included or excluded.
291
+ #
292
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator]
293
+ required :operator,
294
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator }
295
+
296
+ # @!attribute values
297
+ # The IDs or values that match this filter.
298
+ #
299
+ # @return [Array<String>]
300
+ required :values, Orb::Internal::Type::ArrayOf[String]
301
+
302
+ # @!method initialize(field:, operator:, values:)
303
+ # @param field [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Field] The property of the price to filter on.
304
+ #
305
+ # @param operator [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
306
+ #
307
+ # @param values [Array<String>] The IDs or values that match this filter.
308
+
309
+ # The property of the price to filter on.
310
+ #
311
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter#field
312
+ module Field
313
+ extend Orb::Internal::Type::Enum
314
+
315
+ PRICE_ID = :price_id
316
+ ITEM_ID = :item_id
317
+ PRICE_TYPE = :price_type
318
+ CURRENCY = :currency
319
+ PRICING_UNIT_ID = :pricing_unit_id
320
+
321
+ # @!method self.values
322
+ # @return [Array<Symbol>]
323
+ end
324
+
325
+ # Should prices that match the filter be included or excluded.
326
+ #
327
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount::Filter#operator
328
+ module Operator
329
+ extend Orb::Internal::Type::Enum
330
+
331
+ INCLUDES = :includes
332
+ EXCLUDES = :excludes
333
+
334
+ # @!method self.values
335
+ # @return [Array<Symbol>]
336
+ end
337
+ end
338
+ end
339
+
340
+ class PercentageDiscount < Orb::Internal::Type::BaseModel
341
+ # @!attribute id
342
+ #
343
+ # @return [String]
344
+ required :id, String
345
+
346
+ # @!attribute adjustment_type
347
+ #
348
+ # @return [Symbol, :percentage_discount]
349
+ required :adjustment_type, const: :percentage_discount
350
+
351
+ # @!attribute applies_to_price_ids
352
+ # @deprecated
353
+ #
354
+ # The price IDs that this adjustment applies to.
355
+ #
356
+ # @return [Array<String>]
357
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
358
+
359
+ # @!attribute filters
360
+ # The filters that determine which prices to apply this adjustment to.
361
+ #
362
+ # @return [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter>]
363
+ required :filters,
364
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter] }
365
+
366
+ # @!attribute is_invoice_level
367
+ # True for adjustments that apply to an entire invocice, false for adjustments
368
+ # that apply to only one price.
369
+ #
370
+ # @return [Boolean]
371
+ required :is_invoice_level, Orb::Internal::Type::Boolean
372
+
373
+ # @!attribute percentage_discount
374
+ # The percentage (as a value between 0 and 1) by which to discount the price
375
+ # intervals this adjustment applies to in a given billing period.
376
+ #
377
+ # @return [Float]
378
+ required :percentage_discount, Float
379
+
380
+ # @!attribute plan_phase_order
381
+ # The plan phase in which this adjustment is active.
382
+ #
383
+ # @return [Integer, nil]
384
+ required :plan_phase_order, Integer, nil?: true
385
+
386
+ # @!attribute reason
387
+ # The reason for the adjustment.
388
+ #
389
+ # @return [String, nil]
390
+ required :reason, String, nil?: true
391
+
392
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, percentage_discount:, plan_phase_order:, reason:, adjustment_type: :percentage_discount)
393
+ # Some parameter documentations has been truncated, see
394
+ # {Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount}
395
+ # for more details.
396
+ #
397
+ # @param id [String]
398
+ #
399
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
400
+ #
401
+ # @param filters [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter>] The filters that determine which prices to apply this adjustment to.
402
+ #
403
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
404
+ #
405
+ # @param percentage_discount [Float] The percentage (as a value between 0 and 1) by which to discount the price inter
406
+ #
407
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
408
+ #
409
+ # @param reason [String, nil] The reason for the adjustment.
410
+ #
411
+ # @param adjustment_type [Symbol, :percentage_discount]
412
+
413
+ class Filter < Orb::Internal::Type::BaseModel
414
+ # @!attribute field
415
+ # The property of the price to filter on.
416
+ #
417
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field]
418
+ required :field,
419
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field }
420
+
421
+ # @!attribute operator
422
+ # Should prices that match the filter be included or excluded.
423
+ #
424
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator]
425
+ required :operator,
426
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator }
427
+
428
+ # @!attribute values
429
+ # The IDs or values that match this filter.
430
+ #
431
+ # @return [Array<String>]
432
+ required :values, Orb::Internal::Type::ArrayOf[String]
433
+
434
+ # @!method initialize(field:, operator:, values:)
435
+ # @param field [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Field] The property of the price to filter on.
436
+ #
437
+ # @param operator [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter::Operator] Should prices that match the filter be included or excluded.
438
+ #
439
+ # @param values [Array<String>] The IDs or values that match this filter.
440
+
441
+ # The property of the price to filter on.
442
+ #
443
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter#field
444
+ module Field
445
+ extend Orb::Internal::Type::Enum
446
+
447
+ PRICE_ID = :price_id
448
+ ITEM_ID = :item_id
449
+ PRICE_TYPE = :price_type
450
+ CURRENCY = :currency
451
+ PRICING_UNIT_ID = :pricing_unit_id
452
+
453
+ # @!method self.values
454
+ # @return [Array<Symbol>]
455
+ end
456
+
457
+ # Should prices that match the filter be included or excluded.
458
+ #
459
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount::Filter#operator
460
+ module Operator
461
+ extend Orb::Internal::Type::Enum
462
+
463
+ INCLUDES = :includes
464
+ EXCLUDES = :excludes
465
+
466
+ # @!method self.values
467
+ # @return [Array<Symbol>]
468
+ end
469
+ end
470
+ end
471
+
472
+ class Minimum < Orb::Internal::Type::BaseModel
473
+ # @!attribute id
474
+ #
475
+ # @return [String]
476
+ required :id, String
477
+
478
+ # @!attribute adjustment_type
479
+ #
480
+ # @return [Symbol, :minimum]
481
+ required :adjustment_type, const: :minimum
482
+
483
+ # @!attribute applies_to_price_ids
484
+ # @deprecated
485
+ #
486
+ # The price IDs that this adjustment applies to.
487
+ #
488
+ # @return [Array<String>]
489
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
490
+
491
+ # @!attribute filters
492
+ # The filters that determine which prices to apply this adjustment to.
493
+ #
494
+ # @return [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter>]
495
+ required :filters,
496
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter] }
497
+
498
+ # @!attribute is_invoice_level
499
+ # True for adjustments that apply to an entire invocice, false for adjustments
500
+ # that apply to only one price.
501
+ #
502
+ # @return [Boolean]
503
+ required :is_invoice_level, Orb::Internal::Type::Boolean
504
+
505
+ # @!attribute item_id
506
+ # The item ID that revenue from this minimum will be attributed to.
507
+ #
508
+ # @return [String]
509
+ required :item_id, String
510
+
511
+ # @!attribute minimum_amount
512
+ # The minimum amount to charge in a given billing period for the prices this
513
+ # adjustment applies to.
514
+ #
515
+ # @return [String]
516
+ required :minimum_amount, String
517
+
518
+ # @!attribute plan_phase_order
519
+ # The plan phase in which this adjustment is active.
520
+ #
521
+ # @return [Integer, nil]
522
+ required :plan_phase_order, Integer, nil?: true
523
+
524
+ # @!attribute reason
525
+ # The reason for the adjustment.
526
+ #
527
+ # @return [String, nil]
528
+ required :reason, String, nil?: true
529
+
530
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, item_id:, minimum_amount:, plan_phase_order:, reason:, adjustment_type: :minimum)
531
+ # Some parameter documentations has been truncated, see
532
+ # {Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum}
533
+ # for more details.
534
+ #
535
+ # @param id [String]
536
+ #
537
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
538
+ #
539
+ # @param filters [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter>] The filters that determine which prices to apply this adjustment to.
540
+ #
541
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
542
+ #
543
+ # @param item_id [String] The item ID that revenue from this minimum will be attributed to.
544
+ #
545
+ # @param minimum_amount [String] The minimum amount to charge in a given billing period for the prices this adjus
546
+ #
547
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
548
+ #
549
+ # @param reason [String, nil] The reason for the adjustment.
550
+ #
551
+ # @param adjustment_type [Symbol, :minimum]
552
+
553
+ class Filter < Orb::Internal::Type::BaseModel
554
+ # @!attribute field
555
+ # The property of the price to filter on.
556
+ #
557
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter::Field]
558
+ required :field,
559
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter::Field }
560
+
561
+ # @!attribute operator
562
+ # Should prices that match the filter be included or excluded.
563
+ #
564
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter::Operator]
565
+ required :operator,
566
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter::Operator }
567
+
568
+ # @!attribute values
569
+ # The IDs or values that match this filter.
570
+ #
571
+ # @return [Array<String>]
572
+ required :values, Orb::Internal::Type::ArrayOf[String]
573
+
574
+ # @!method initialize(field:, operator:, values:)
575
+ # @param field [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter::Field] The property of the price to filter on.
576
+ #
577
+ # @param operator [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter::Operator] Should prices that match the filter be included or excluded.
578
+ #
579
+ # @param values [Array<String>] The IDs or values that match this filter.
580
+
581
+ # The property of the price to filter on.
582
+ #
583
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter#field
584
+ module Field
585
+ extend Orb::Internal::Type::Enum
586
+
587
+ PRICE_ID = :price_id
588
+ ITEM_ID = :item_id
589
+ PRICE_TYPE = :price_type
590
+ CURRENCY = :currency
591
+ PRICING_UNIT_ID = :pricing_unit_id
592
+
593
+ # @!method self.values
594
+ # @return [Array<Symbol>]
595
+ end
596
+
597
+ # Should prices that match the filter be included or excluded.
598
+ #
599
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum::Filter#operator
600
+ module Operator
601
+ extend Orb::Internal::Type::Enum
602
+
603
+ INCLUDES = :includes
604
+ EXCLUDES = :excludes
605
+
606
+ # @!method self.values
607
+ # @return [Array<Symbol>]
608
+ end
609
+ end
610
+ end
611
+
612
+ class Maximum < Orb::Internal::Type::BaseModel
613
+ # @!attribute id
614
+ #
615
+ # @return [String]
616
+ required :id, String
617
+
618
+ # @!attribute adjustment_type
619
+ #
620
+ # @return [Symbol, :maximum]
621
+ required :adjustment_type, const: :maximum
622
+
623
+ # @!attribute applies_to_price_ids
624
+ # @deprecated
625
+ #
626
+ # The price IDs that this adjustment applies to.
627
+ #
628
+ # @return [Array<String>]
629
+ required :applies_to_price_ids, Orb::Internal::Type::ArrayOf[String]
630
+
631
+ # @!attribute filters
632
+ # The filters that determine which prices to apply this adjustment to.
633
+ #
634
+ # @return [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter>]
635
+ required :filters,
636
+ -> { Orb::Internal::Type::ArrayOf[Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter] }
637
+
638
+ # @!attribute is_invoice_level
639
+ # True for adjustments that apply to an entire invocice, false for adjustments
640
+ # that apply to only one price.
641
+ #
642
+ # @return [Boolean]
643
+ required :is_invoice_level, Orb::Internal::Type::Boolean
644
+
645
+ # @!attribute maximum_amount
646
+ # The maximum amount to charge in a given billing period for the prices this
647
+ # adjustment applies to.
648
+ #
649
+ # @return [String]
650
+ required :maximum_amount, String
651
+
652
+ # @!attribute plan_phase_order
653
+ # The plan phase in which this adjustment is active.
654
+ #
655
+ # @return [Integer, nil]
656
+ required :plan_phase_order, Integer, nil?: true
657
+
658
+ # @!attribute reason
659
+ # The reason for the adjustment.
660
+ #
661
+ # @return [String, nil]
662
+ required :reason, String, nil?: true
663
+
664
+ # @!method initialize(id:, applies_to_price_ids:, filters:, is_invoice_level:, maximum_amount:, plan_phase_order:, reason:, adjustment_type: :maximum)
665
+ # Some parameter documentations has been truncated, see
666
+ # {Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum}
667
+ # for more details.
668
+ #
669
+ # @param id [String]
670
+ #
671
+ # @param applies_to_price_ids [Array<String>] The price IDs that this adjustment applies to.
672
+ #
673
+ # @param filters [Array<Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter>] The filters that determine which prices to apply this adjustment to.
674
+ #
675
+ # @param is_invoice_level [Boolean] True for adjustments that apply to an entire invocice, false for adjustments tha
676
+ #
677
+ # @param maximum_amount [String] The maximum amount to charge in a given billing period for the prices this adjus
678
+ #
679
+ # @param plan_phase_order [Integer, nil] The plan phase in which this adjustment is active.
680
+ #
681
+ # @param reason [String, nil] The reason for the adjustment.
682
+ #
683
+ # @param adjustment_type [Symbol, :maximum]
684
+
685
+ class Filter < Orb::Internal::Type::BaseModel
686
+ # @!attribute field
687
+ # The property of the price to filter on.
688
+ #
689
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter::Field]
690
+ required :field,
691
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter::Field }
692
+
693
+ # @!attribute operator
694
+ # Should prices that match the filter be included or excluded.
695
+ #
696
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter::Operator]
697
+ required :operator,
698
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter::Operator }
699
+
700
+ # @!attribute values
701
+ # The IDs or values that match this filter.
702
+ #
703
+ # @return [Array<String>]
704
+ required :values, Orb::Internal::Type::ArrayOf[String]
705
+
706
+ # @!method initialize(field:, operator:, values:)
707
+ # @param field [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter::Field] The property of the price to filter on.
708
+ #
709
+ # @param operator [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter::Operator] Should prices that match the filter be included or excluded.
710
+ #
711
+ # @param values [Array<String>] The IDs or values that match this filter.
712
+
713
+ # The property of the price to filter on.
714
+ #
715
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter#field
716
+ module Field
717
+ extend Orb::Internal::Type::Enum
718
+
719
+ PRICE_ID = :price_id
720
+ ITEM_ID = :item_id
721
+ PRICE_TYPE = :price_type
722
+ CURRENCY = :currency
723
+ PRICING_UNIT_ID = :pricing_unit_id
724
+
725
+ # @!method self.values
726
+ # @return [Array<Symbol>]
727
+ end
728
+
729
+ # Should prices that match the filter be included or excluded.
730
+ #
731
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum::Filter#operator
732
+ module Operator
733
+ extend Orb::Internal::Type::Enum
734
+
735
+ INCLUDES = :includes
736
+ EXCLUDES = :excludes
737
+
738
+ # @!method self.values
739
+ # @return [Array<Symbol>]
740
+ end
741
+ end
742
+ end
743
+
744
+ # @!method self.variants
745
+ # @return [Array(Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::UsageDiscount, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::AmountDiscount, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::PercentageDiscount, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Minimum, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::Adjustment::Maximum)]
746
+ end
747
+
748
+ class PlanPhase < Orb::Internal::Type::BaseModel
749
+ # @!attribute id
750
+ #
751
+ # @return [String]
752
+ required :id, String
753
+
754
+ # @!attribute description
755
+ #
756
+ # @return [String, nil]
757
+ required :description, String, nil?: true
758
+
759
+ # @!attribute duration
760
+ # How many terms of length `duration_unit` this phase is active for. If null, this
761
+ # phase is evergreen and active indefinitely
762
+ #
763
+ # @return [Integer, nil]
764
+ required :duration, Integer, nil?: true
765
+
766
+ # @!attribute duration_unit
767
+ #
768
+ # @return [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::PlanPhase::DurationUnit, nil]
769
+ required :duration_unit,
770
+ enum: -> { Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::PlanPhase::DurationUnit },
771
+ nil?: true
772
+
773
+ # @!attribute name
774
+ #
775
+ # @return [String]
776
+ required :name, String
777
+
778
+ # @!attribute order
779
+ # Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.
780
+ #
781
+ # @return [Integer]
782
+ required :order, Integer
783
+
784
+ # @!method initialize(id:, description:, duration:, duration_unit:, name:, order:)
785
+ # Some parameter documentations has been truncated, see
786
+ # {Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::PlanPhase} for more
787
+ # details.
788
+ #
789
+ # @param id [String]
790
+ #
791
+ # @param description [String, nil]
792
+ #
793
+ # @param duration [Integer, nil] How many terms of length `duration_unit` this phase is active for. If null, this
794
+ #
795
+ # @param duration_unit [Symbol, Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::PlanPhase::DurationUnit, nil]
796
+ #
797
+ # @param name [String]
798
+ #
799
+ # @param order [Integer] Determines the ordering of the phase in a plan's lifecycle. 1 = first phase.
800
+
801
+ # @see Orb::Models::Plans::ExternalPlanID::VersionCreateResponse::PlanPhase#duration_unit
802
+ module DurationUnit
803
+ extend Orb::Internal::Type::Enum
804
+
805
+ DAILY = :daily
806
+ MONTHLY = :monthly
807
+ QUARTERLY = :quarterly
808
+ SEMI_ANNUAL = :semi_annual
809
+ ANNUAL = :annual
810
+
811
+ # @!method self.values
812
+ # @return [Array<Symbol>]
813
+ end
814
+ end
815
+ end
816
+ end
817
+ end
818
+ end
819
+ end