orb-billing 1.43.0 → 1.44.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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +8 -0
  3. data/README.md +1 -1
  4. data/lib/orb/client.rb +6 -0
  5. data/lib/orb/models/alert_create_for_plan_params.rb +156 -0
  6. data/lib/orb/models/dimensional_price_groups/price_create_params.rb +147 -0
  7. data/lib/orb/models/dimensional_price_groups/price_create_response.rb +19 -0
  8. data/lib/orb/models/dimensional_price_groups/price_list_params.rb +65 -0
  9. data/lib/orb/models/plan_created_webhook_event.rb +91 -0
  10. data/lib/orb/models/plan_edited_webhook_event.rb +131 -0
  11. data/lib/orb/models/tax_amount.rb +32 -1
  12. data/lib/orb/models/unwrap_webhook_event.rb +7 -1
  13. data/lib/orb/models/webhook_endpoint.rb +56 -0
  14. data/lib/orb/models/webhook_endpoint_create_params.rb +34 -0
  15. data/lib/orb/models/webhook_endpoint_delete_params.rb +20 -0
  16. data/lib/orb/models/webhook_endpoint_disable_params.rb +20 -0
  17. data/lib/orb/models/webhook_endpoint_enable_params.rb +20 -0
  18. data/lib/orb/models/webhook_endpoint_list_params.rb +34 -0
  19. data/lib/orb/models/webhook_endpoint_retrieve_params.rb +20 -0
  20. data/lib/orb/models/webhook_endpoint_update_params.rb +41 -0
  21. data/lib/orb/models/webhook_endpoint_with_secret.rb +65 -0
  22. data/lib/orb/models.rb +24 -0
  23. data/lib/orb/resources/alerts.rb +55 -0
  24. data/lib/orb/resources/dimensional_price_groups/prices.rb +87 -0
  25. data/lib/orb/resources/dimensional_price_groups.rb +4 -0
  26. data/lib/orb/resources/webhook_endpoints.rb +183 -0
  27. data/lib/orb/resources/webhooks.rb +1 -1
  28. data/lib/orb/version.rb +1 -1
  29. data/lib/orb.rb +17 -0
  30. data/rbi/orb/client.rbi +5 -0
  31. data/rbi/orb/models/alert_create_for_plan_params.rbi +290 -0
  32. data/rbi/orb/models/dimensional_price_groups/price_create_params.rbi +298 -0
  33. data/rbi/orb/models/dimensional_price_groups/price_create_response.rbi +76 -0
  34. data/rbi/orb/models/dimensional_price_groups/price_list_params.rbi +134 -0
  35. data/rbi/orb/models/plan_created_webhook_event.rbi +140 -0
  36. data/rbi/orb/models/plan_edited_webhook_event.rbi +259 -0
  37. data/rbi/orb/models/tax_amount.rbi +41 -3
  38. data/rbi/orb/models/unwrap_webhook_event.rbi +2 -0
  39. data/rbi/orb/models/webhook_endpoint.rbi +71 -0
  40. data/rbi/orb/models/webhook_endpoint_create_params.rbi +53 -0
  41. data/rbi/orb/models/webhook_endpoint_delete_params.rbi +35 -0
  42. data/rbi/orb/models/webhook_endpoint_disable_params.rbi +35 -0
  43. data/rbi/orb/models/webhook_endpoint_enable_params.rbi +35 -0
  44. data/rbi/orb/models/webhook_endpoint_list_params.rbi +56 -0
  45. data/rbi/orb/models/webhook_endpoint_retrieve_params.rbi +35 -0
  46. data/rbi/orb/models/webhook_endpoint_update_params.rbi +59 -0
  47. data/rbi/orb/models/webhook_endpoint_with_secret.rbi +83 -0
  48. data/rbi/orb/models.rbi +24 -0
  49. data/rbi/orb/resources/alerts.rbi +59 -0
  50. data/rbi/orb/resources/dimensional_price_groups/prices.rbi +82 -0
  51. data/rbi/orb/resources/dimensional_price_groups.rbi +3 -0
  52. data/rbi/orb/resources/webhook_endpoints.rbi +116 -0
  53. data/rbi/orb/resources/webhooks.rbi +2 -0
  54. data/sig/orb/client.rbs +2 -0
  55. data/sig/orb/models/alert_create_for_plan_params.rbs +126 -0
  56. data/sig/orb/models/dimensional_price_groups/price_create_params.rbs +123 -0
  57. data/sig/orb/models/dimensional_price_groups/price_create_response.rbs +15 -0
  58. data/sig/orb/models/dimensional_price_groups/price_list_params.rbs +61 -0
  59. data/sig/orb/models/plan_created_webhook_event.rbs +72 -0
  60. data/sig/orb/models/plan_edited_webhook_event.rbs +116 -0
  61. data/sig/orb/models/tax_amount.rbs +31 -3
  62. data/sig/orb/models/unwrap_webhook_event.rbs +2 -0
  63. data/sig/orb/models/webhook_endpoint.rbs +40 -0
  64. data/sig/orb/models/webhook_endpoint_create_params.rbs +28 -0
  65. data/sig/orb/models/webhook_endpoint_delete_params.rbs +23 -0
  66. data/sig/orb/models/webhook_endpoint_disable_params.rbs +23 -0
  67. data/sig/orb/models/webhook_endpoint_enable_params.rbs +23 -0
  68. data/sig/orb/models/webhook_endpoint_list_params.rbs +30 -0
  69. data/sig/orb/models/webhook_endpoint_retrieve_params.rbs +23 -0
  70. data/sig/orb/models/webhook_endpoint_update_params.rbs +36 -0
  71. data/sig/orb/models/webhook_endpoint_with_secret.rbs +45 -0
  72. data/sig/orb/models.rbs +24 -0
  73. data/sig/orb/resources/alerts.rbs +12 -0
  74. data/sig/orb/resources/dimensional_price_groups/prices.rbs +28 -0
  75. data/sig/orb/resources/dimensional_price_groups.rbs +2 -0
  76. data/sig/orb/resources/webhook_endpoints.rbs +46 -0
  77. data/sig/orb/resources/webhooks.rbs +2 -0
  78. metadata +52 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a5dc40a201faac67ea9e72b07425ff535bee8c7963fb6eb92d3ba2e5bc224034
4
- data.tar.gz: f895167c6a7d1f9333e90ff8cbecff8e29728b4154d91312b9ebfbd26ee77678
3
+ metadata.gz: cd059e42a0bc32f497b8d1732f74f0eabe55ea23967eaa351b5e4effc2fb81e8
4
+ data.tar.gz: 196741b32eb376ae1814cac93aa45e6aff6a470830269c3fcf200c1a27b58283
5
5
  SHA512:
6
- metadata.gz: 00aefa80fd013628e189a38423ce551e8e4efffde14221d9532eaef6830287d0ac51e2b878d1c5ef4f7d7057b3f9f27a9627b9c3fc03a70afd72e7f644b124ff
7
- data.tar.gz: ee6b01f1ef20639b49d8bbacb86da21eb4441d4a6ece28aa4324f4e8a1437dd35394ad909dc7c812c493ca60283e583b551354499d8ab00f0fde0cdc0f52776a
6
+ metadata.gz: 670d061bbe37e35134fc6230add9db785ff9c0ebc50db153f0beb136180c4c5feb392a9ce33b7148d806956ee87ff11716f2d154ae67cd939e44f131625a6c0a
7
+ data.tar.gz: e89f8e57d4e47e14b72b1ac6b113a0744ad0ebf6113563136d536ff7a7cda237cd7754f02b0b1613c171547fdb0f882376a67fcca88b7686f88e57362a8fd08d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.44.0](https://github.com/orbcorp/orb-ruby/compare/v1.43.0...v1.44.0) (2026-10-20)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** add `plan.created` and `plan.edited` webhook events ([9413030](https://github.com/orbcorp/orb-ruby/commit/9413030251c1fd9ac58b583a369afbfb7c02672d))
9
+ * **api:** add `tax_reason` field to tax amount entries ([8d1c0db](https://github.com/orbcorp/orb-ruby/commit/8d1c0db96ed1accbe3ff654d1e87bdad7a1d6ad2))
10
+
3
11
  ## [1.43.0](https://github.com/orbcorp/orb-ruby/compare/v1.42.0...v1.43.0) (2026-10-16)
4
12
 
5
13
 
data/README.md CHANGED
@@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application
15
15
  <!-- x-release-please-start-version -->
16
16
 
17
17
  ```ruby
18
- gem "orb-billing", "~> 1.43.0"
18
+ gem "orb-billing", "~> 1.44.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
data/lib/orb/client.rb CHANGED
@@ -96,6 +96,11 @@ module Orb
96
96
  # @return [Orb::Resources::Items]
97
97
  attr_reader :items
98
98
 
99
+ # A webhook endpoint is an HTTPS URL that Orb sends
100
+ # [webhook events](/integrations-and-exports/webhooks) to.
101
+ # @return [Orb::Resources::WebhookEndpoints]
102
+ attr_reader :webhook_endpoints
103
+
99
104
  # The Metric resource represents a calculation of a quantity based on events.
100
105
  # Metrics are defined by the query that transforms raw usage events into
101
106
  # meaningful values for your customers.
@@ -232,6 +237,7 @@ module Orb
232
237
  @invoice_line_items = Orb::Resources::InvoiceLineItems.new(client: self)
233
238
  @invoices = Orb::Resources::Invoices.new(client: self)
234
239
  @items = Orb::Resources::Items.new(client: self)
240
+ @webhook_endpoints = Orb::Resources::WebhookEndpoints.new(client: self)
235
241
  @metrics = Orb::Resources::Metrics.new(client: self)
236
242
  @plans = Orb::Resources::Plans.new(client: self)
237
243
  @prices = Orb::Resources::Prices.new(client: self)
@@ -0,0 +1,156 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ # @see Orb::Resources::Alerts#create_for_plan
6
+ class AlertCreateForPlanParams < Orb::Internal::Type::BaseModel
7
+ extend Orb::Internal::Type::RequestParameters::Converter
8
+ include Orb::Internal::Type::RequestParameters
9
+
10
+ # @!attribute plan_id
11
+ #
12
+ # @return [String]
13
+ required :plan_id, String
14
+
15
+ # @!attribute thresholds
16
+ # The thresholds that define the values at which the alert will be triggered.
17
+ #
18
+ # @return [Array<Orb::Models::Threshold>]
19
+ required :thresholds, -> { Orb::Internal::Type::ArrayOf[Orb::Threshold] }
20
+
21
+ # @!attribute type
22
+ # The type of alert to create. This must be a valid alert type.
23
+ #
24
+ # @return [Symbol, Orb::Models::AlertCreateForPlanParams::Type]
25
+ required :type, enum: -> { Orb::AlertCreateForPlanParams::Type }
26
+
27
+ # @!attribute currency
28
+ # The case sensitive currency or custom pricing unit the alert is denominated in.
29
+ # Required for spend_exceeded alerts and when grouping_keys is set.
30
+ #
31
+ # @return [String, nil]
32
+ optional :currency, String, nil?: true
33
+
34
+ # @!attribute grouping_keys
35
+ # The property keys to group cost alerts by. Only applicable for cost_exceeded
36
+ # alerts.
37
+ #
38
+ # @return [Array<String>, nil]
39
+ optional :grouping_keys, Orb::Internal::Type::ArrayOf[String], nil?: true
40
+
41
+ # @!attribute metric_id
42
+ # The metric to track usage for.
43
+ #
44
+ # @return [String, nil]
45
+ optional :metric_id, String, nil?: true
46
+
47
+ # @!attribute plan_version
48
+ # The plan version to create alerts for. If not specified, the default will be the
49
+ # plan's active plan version.
50
+ #
51
+ # @return [Integer, nil]
52
+ optional :plan_version, Integer, nil?: true
53
+
54
+ # @!attribute price_filters
55
+ # Filters to scope which prices are included in alert evaluation. Supports
56
+ # filtering by price_id, item_id, or price_type with includes/excludes operators.
57
+ # Only applicable to spend_exceeded alerts and to cost_exceeded alerts with
58
+ # grouping_keys set.
59
+ #
60
+ # @return [Array<Orb::Models::AlertCreateForPlanParams::PriceFilter>, nil]
61
+ optional :price_filters,
62
+ -> { Orb::Internal::Type::ArrayOf[Orb::AlertCreateForPlanParams::PriceFilter] },
63
+ nil?: true
64
+
65
+ # @!method initialize(plan_id:, thresholds:, type:, currency: nil, grouping_keys: nil, metric_id: nil, plan_version: nil, price_filters: nil, request_options: {})
66
+ # Some parameter documentations has been truncated, see
67
+ # {Orb::Models::AlertCreateForPlanParams} for more details.
68
+ #
69
+ # @param plan_id [String]
70
+ #
71
+ # @param thresholds [Array<Orb::Models::Threshold>] The thresholds that define the values at which the alert will be triggered.
72
+ #
73
+ # @param type [Symbol, Orb::Models::AlertCreateForPlanParams::Type] The type of alert to create. This must be a valid alert type.
74
+ #
75
+ # @param currency [String, nil] The case sensitive currency or custom pricing unit the alert is denominated in.
76
+ #
77
+ # @param grouping_keys [Array<String>, nil] The property keys to group cost alerts by. Only applicable for cost_exceeded ale
78
+ #
79
+ # @param metric_id [String, nil] The metric to track usage for.
80
+ #
81
+ # @param plan_version [Integer, nil] The plan version to create alerts for. If not specified, the default will be the
82
+ #
83
+ # @param price_filters [Array<Orb::Models::AlertCreateForPlanParams::PriceFilter>, nil] Filters to scope which prices are included in alert evaluation. Supports filteri
84
+ #
85
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
86
+
87
+ # The type of alert to create. This must be a valid alert type.
88
+ module Type
89
+ extend Orb::Internal::Type::Enum
90
+
91
+ USAGE_EXCEEDED = :usage_exceeded
92
+ COST_EXCEEDED = :cost_exceeded
93
+ SPEND_EXCEEDED = :spend_exceeded
94
+
95
+ # @!method self.values
96
+ # @return [Array<Symbol>]
97
+ end
98
+
99
+ class PriceFilter < Orb::Internal::Type::BaseModel
100
+ # @!attribute field
101
+ # The property of the price to filter on.
102
+ #
103
+ # @return [Symbol, Orb::Models::AlertCreateForPlanParams::PriceFilter::Field]
104
+ required :field, enum: -> { Orb::AlertCreateForPlanParams::PriceFilter::Field }
105
+
106
+ # @!attribute operator
107
+ # Should prices that match the filter be included or excluded.
108
+ #
109
+ # @return [Symbol, Orb::Models::AlertCreateForPlanParams::PriceFilter::Operator]
110
+ required :operator, enum: -> { Orb::AlertCreateForPlanParams::PriceFilter::Operator }
111
+
112
+ # @!attribute values
113
+ # The IDs or values that match this filter.
114
+ #
115
+ # @return [Array<String>]
116
+ required :values, Orb::Internal::Type::ArrayOf[String]
117
+
118
+ # @!method initialize(field:, operator:, values:)
119
+ # @param field [Symbol, Orb::Models::AlertCreateForPlanParams::PriceFilter::Field] The property of the price to filter on.
120
+ #
121
+ # @param operator [Symbol, Orb::Models::AlertCreateForPlanParams::PriceFilter::Operator] Should prices that match the filter be included or excluded.
122
+ #
123
+ # @param values [Array<String>] The IDs or values that match this filter.
124
+
125
+ # The property of the price to filter on.
126
+ #
127
+ # @see Orb::Models::AlertCreateForPlanParams::PriceFilter#field
128
+ module Field
129
+ extend Orb::Internal::Type::Enum
130
+
131
+ PRICE_ID = :price_id
132
+ ITEM_ID = :item_id
133
+ PRICE_TYPE = :price_type
134
+ CURRENCY = :currency
135
+ PRICING_UNIT_ID = :pricing_unit_id
136
+
137
+ # @!method self.values
138
+ # @return [Array<Symbol>]
139
+ end
140
+
141
+ # Should prices that match the filter be included or excluded.
142
+ #
143
+ # @see Orb::Models::AlertCreateForPlanParams::PriceFilter#operator
144
+ module Operator
145
+ extend Orb::Internal::Type::Enum
146
+
147
+ INCLUDES = :includes
148
+ EXCLUDES = :excludes
149
+
150
+ # @!method self.values
151
+ # @return [Array<Symbol>]
152
+ end
153
+ end
154
+ end
155
+ end
156
+ end
@@ -0,0 +1,147 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ module DimensionalPriceGroups
6
+ # @see Orb::Resources::DimensionalPriceGroups::Prices#create
7
+ class PriceCreateParams < Orb::Internal::Type::BaseModel
8
+ extend Orb::Internal::Type::RequestParameters::Converter
9
+ include Orb::Internal::Type::RequestParameters
10
+
11
+ # @!attribute dimensional_price_group_id
12
+ #
13
+ # @return [String]
14
+ required :dimensional_price_group_id, String
15
+
16
+ # @!attribute cadence
17
+ # Billing cadence for every price
18
+ #
19
+ # @return [Symbol, Orb::Models::DimensionalPriceGroups::PriceCreateParams::Cadence]
20
+ required :cadence, enum: -> { Orb::DimensionalPriceGroups::PriceCreateParams::Cadence }
21
+
22
+ # @!attribute currency
23
+ # An ISO 4217 currency string for every price.
24
+ #
25
+ # @return [String]
26
+ required :currency, String
27
+
28
+ # @!attribute item_id
29
+ # The item for every price. Must be the group's billable metric item.
30
+ #
31
+ # @return [String]
32
+ required :item_id, String
33
+
34
+ # @!attribute model_type
35
+ #
36
+ # @return [Symbol, Orb::Models::DimensionalPriceGroups::PriceCreateParams::ModelType]
37
+ required :model_type, enum: -> { Orb::DimensionalPriceGroups::PriceCreateParams::ModelType }
38
+
39
+ # @!attribute prices
40
+ #
41
+ # @return [Array<Orb::Models::DimensionalPriceGroups::PriceCreateParams::Price>]
42
+ required :prices,
43
+ -> { Orb::Internal::Type::ArrayOf[Orb::DimensionalPriceGroups::PriceCreateParams::Price] }
44
+
45
+ # @!attribute tiers
46
+ # Shared tier boundaries. Required for tiered prices and omitted for unit prices.
47
+ #
48
+ # @return [Array<Orb::Models::DimensionalPriceGroups::PriceCreateParams::Tier>, nil]
49
+ optional :tiers,
50
+ -> { Orb::Internal::Type::ArrayOf[Orb::DimensionalPriceGroups::PriceCreateParams::Tier] },
51
+ nil?: true
52
+
53
+ # @!method initialize(dimensional_price_group_id:, cadence:, currency:, item_id:, model_type:, prices:, tiers: nil, request_options: {})
54
+ # @param dimensional_price_group_id [String]
55
+ #
56
+ # @param cadence [Symbol, Orb::Models::DimensionalPriceGroups::PriceCreateParams::Cadence] Billing cadence for every price
57
+ #
58
+ # @param currency [String] An ISO 4217 currency string for every price.
59
+ #
60
+ # @param item_id [String] The item for every price. Must be the group's billable metric item.
61
+ #
62
+ # @param model_type [Symbol, Orb::Models::DimensionalPriceGroups::PriceCreateParams::ModelType]
63
+ #
64
+ # @param prices [Array<Orb::Models::DimensionalPriceGroups::PriceCreateParams::Price>]
65
+ #
66
+ # @param tiers [Array<Orb::Models::DimensionalPriceGroups::PriceCreateParams::Tier>, nil] Shared tier boundaries. Required for tiered prices and omitted for unit prices.
67
+ #
68
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
69
+
70
+ # Billing cadence for every price
71
+ module Cadence
72
+ extend Orb::Internal::Type::Enum
73
+
74
+ ONE_TIME = :one_time
75
+ MONTHLY = :monthly
76
+ QUARTERLY = :quarterly
77
+ SEMI_ANNUAL = :semi_annual
78
+ ANNUAL = :annual
79
+
80
+ # @!method self.values
81
+ # @return [Array<Symbol>]
82
+ end
83
+
84
+ module ModelType
85
+ extend Orb::Internal::Type::Enum
86
+
87
+ UNIT = :unit
88
+ TIERED = :tiered
89
+
90
+ # @!method self.values
91
+ # @return [Array<Symbol>]
92
+ end
93
+
94
+ class Price < Orb::Internal::Type::BaseModel
95
+ # @!attribute amounts
96
+ # One amount for a unit price. One amount per tier for a tiered price, in tier
97
+ # order.
98
+ #
99
+ # @return [Array<Float>]
100
+ required :amounts, Orb::Internal::Type::ArrayOf[Float]
101
+
102
+ # @!attribute dimension_values
103
+ # Dimension values, in the group's dimension order.
104
+ #
105
+ # @return [Array<String>]
106
+ required :dimension_values, Orb::Internal::Type::ArrayOf[String]
107
+
108
+ # @!attribute name
109
+ # Price name. Defaults to the dimension values.
110
+ #
111
+ # @return [String, nil]
112
+ optional :name, String, nil?: true
113
+
114
+ # @!method initialize(amounts:, dimension_values:, name: nil)
115
+ # Some parameter documentations has been truncated, see
116
+ # {Orb::Models::DimensionalPriceGroups::PriceCreateParams::Price} for more
117
+ # details.
118
+ #
119
+ # @param amounts [Array<Float>] One amount for a unit price. One amount per tier for a tiered price, in tier ord
120
+ #
121
+ # @param dimension_values [Array<String>] Dimension values, in the group's dimension order.
122
+ #
123
+ # @param name [String, nil] Price name. Defaults to the dimension values.
124
+ end
125
+
126
+ class Tier < Orb::Internal::Type::BaseModel
127
+ # @!attribute first_unit
128
+ # Exclusive tier starting value
129
+ #
130
+ # @return [Float]
131
+ required :first_unit, Float
132
+
133
+ # @!attribute last_unit
134
+ # Inclusive tier ending value. Null on the last tier.
135
+ #
136
+ # @return [Float, nil]
137
+ optional :last_unit, Float, nil?: true
138
+
139
+ # @!method initialize(first_unit:, last_unit: nil)
140
+ # @param first_unit [Float] Exclusive tier starting value
141
+ #
142
+ # @param last_unit [Float, nil] Inclusive tier ending value. Null on the last tier.
143
+ end
144
+ end
145
+ end
146
+ end
147
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ module DimensionalPriceGroups
6
+ # @see Orb::Resources::DimensionalPriceGroups::Prices#create
7
+ class PriceCreateResponse < Orb::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ # The prices created by this request, in request order.
10
+ #
11
+ # @return [Array<Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::BulkWithFilters, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::GroupedTieredMatrix, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredMatrixWithAllocation, Orb::Models::Price::MatrixWithThresholdDiscounts, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::CumulativeGroupedAllocation, Orb::Models::Price::DailyCreditAllowance, Orb::Models::Price::MeteredAllowance, Orb::Models::Price::MinimumComposite, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput>]
12
+ required :data, -> { Orb::Internal::Type::ArrayOf[union: Orb::Price] }
13
+
14
+ # @!method initialize(data:)
15
+ # @param data [Array<Orb::Models::Price::Unit, Orb::Models::Price::Tiered, Orb::Models::Price::Bulk, Orb::Models::Price::BulkWithFilters, Orb::Models::Price::Package, Orb::Models::Price::Matrix, Orb::Models::Price::ThresholdTotalAmount, Orb::Models::Price::TieredPackage, Orb::Models::Price::TieredWithMinimum, Orb::Models::Price::GroupedTiered, Orb::Models::Price::GroupedTieredMatrix, Orb::Models::Price::TieredPackageWithMinimum, Orb::Models::Price::PackageWithAllocation, Orb::Models::Price::UnitWithPercent, Orb::Models::Price::MatrixWithAllocation, Orb::Models::Price::TieredMatrixWithAllocation, Orb::Models::Price::MatrixWithThresholdDiscounts, Orb::Models::Price::TieredWithProration, Orb::Models::Price::UnitWithProration, Orb::Models::Price::GroupedAllocation, Orb::Models::Price::BulkWithProration, Orb::Models::Price::GroupedWithProratedMinimum, Orb::Models::Price::GroupedWithMeteredMinimum, Orb::Models::Price::GroupedWithMinMaxThresholds, Orb::Models::Price::MatrixWithDisplayName, Orb::Models::Price::GroupedTieredPackage, Orb::Models::Price::MaxGroupTieredPackage, Orb::Models::Price::ScalableMatrixWithUnitPricing, Orb::Models::Price::ScalableMatrixWithTieredPricing, Orb::Models::Price::CumulativeGroupedBulk, Orb::Models::Price::CumulativeGroupedAllocation, Orb::Models::Price::DailyCreditAllowance, Orb::Models::Price::MeteredAllowance, Orb::Models::Price::MinimumComposite, Orb::Models::Price::Percent, Orb::Models::Price::EventOutput>] The prices created by this request, in request order.
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ module DimensionalPriceGroups
6
+ # @see Orb::Resources::DimensionalPriceGroups::Prices#list
7
+ class PriceListParams < Orb::Internal::Type::BaseModel
8
+ extend Orb::Internal::Type::RequestParameters::Converter
9
+ include Orb::Internal::Type::RequestParameters
10
+
11
+ # @!attribute dimensional_price_group_id
12
+ #
13
+ # @return [String]
14
+ required :dimensional_price_group_id, String
15
+
16
+ # @!attribute cursor
17
+ # Cursor for pagination. This can be populated by the `next_cursor` value returned
18
+ # from the initial request.
19
+ #
20
+ # @return [String, nil]
21
+ optional :cursor, String, nil?: true
22
+
23
+ # @!attribute limit
24
+ # The number of items to fetch. Defaults to 20.
25
+ #
26
+ # @return [Integer, nil]
27
+ optional :limit, Integer
28
+
29
+ # @!attribute status
30
+ # active omits archived prices. archived returns only archived prices. all returns
31
+ # both.
32
+ #
33
+ # @return [Symbol, Orb::Models::DimensionalPriceGroups::PriceListParams::Status, nil]
34
+ optional :status, enum: -> { Orb::DimensionalPriceGroups::PriceListParams::Status }
35
+
36
+ # @!method initialize(dimensional_price_group_id:, cursor: nil, limit: nil, status: nil, request_options: {})
37
+ # Some parameter documentations has been truncated, see
38
+ # {Orb::Models::DimensionalPriceGroups::PriceListParams} for more details.
39
+ #
40
+ # @param dimensional_price_group_id [String]
41
+ #
42
+ # @param cursor [String, nil] Cursor for pagination. This can be populated by the `next_cursor` value returned
43
+ #
44
+ # @param limit [Integer] The number of items to fetch. Defaults to 20.
45
+ #
46
+ # @param status [Symbol, Orb::Models::DimensionalPriceGroups::PriceListParams::Status] active omits archived prices. archived returns only archived prices. all returns
47
+ #
48
+ # @param request_options [Orb::RequestOptions, Hash{Symbol=>Object}]
49
+
50
+ # active omits archived prices. archived returns only archived prices. all returns
51
+ # both.
52
+ module Status
53
+ extend Orb::Internal::Type::Enum
54
+
55
+ ACTIVE = :active
56
+ ARCHIVED = :archived
57
+ ALL = :all
58
+
59
+ # @!method self.values
60
+ # @return [Array<Symbol>]
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,91 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ class PlanCreatedWebhookEvent < Orb::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # The ID of this webhook event.
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute created_at
13
+ # The time at which this event was created, to the second.
14
+ #
15
+ # @return [Time]
16
+ required :created_at, Time
17
+
18
+ # @!attribute plan
19
+ #
20
+ # @return [Orb::Models::PlanCreatedWebhookEvent::Plan]
21
+ required :plan, -> { Orb::PlanCreatedWebhookEvent::Plan }
22
+
23
+ # @!attribute properties
24
+ #
25
+ # @return [Object]
26
+ required :properties, Orb::Internal::Type::Unknown
27
+
28
+ # @!attribute type
29
+ # The event this payload describes.
30
+ #
31
+ # @return [Symbol, Orb::Models::PlanCreatedWebhookEvent::Type]
32
+ required :type, enum: -> { Orb::PlanCreatedWebhookEvent::Type }
33
+
34
+ # @!method initialize(id:, created_at:, plan:, properties:, type:)
35
+ # Issued when a plan is created, or when a draft plan is published.
36
+ #
37
+ # @param id [String] The ID of this webhook event.
38
+ #
39
+ # @param created_at [Time] The time at which this event was created, to the second.
40
+ #
41
+ # @param plan [Orb::Models::PlanCreatedWebhookEvent::Plan]
42
+ #
43
+ # @param properties [Object]
44
+ #
45
+ # @param type [Symbol, Orb::Models::PlanCreatedWebhookEvent::Type] The event this payload describes.
46
+
47
+ # @see Orb::Models::PlanCreatedWebhookEvent#plan
48
+ class Plan < Orb::Internal::Type::BaseModel
49
+ # @!attribute id
50
+ #
51
+ # @return [String, nil]
52
+ required :id, String, nil?: true
53
+
54
+ # @!attribute external_plan_id
55
+ # An optional user-defined ID for this plan resource, used throughout the system
56
+ # as an alias for this Plan. Use this field to identify a plan by an existing
57
+ # identifier in your system.
58
+ #
59
+ # @return [String, nil]
60
+ required :external_plan_id, String, nil?: true
61
+
62
+ # @!attribute name
63
+ #
64
+ # @return [String, nil]
65
+ required :name, String, nil?: true
66
+
67
+ # @!method initialize(id:, external_plan_id:, name:)
68
+ # Some parameter documentations has been truncated, see
69
+ # {Orb::Models::PlanCreatedWebhookEvent::Plan} for more details.
70
+ #
71
+ # @param id [String, nil]
72
+ #
73
+ # @param external_plan_id [String, nil] An optional user-defined ID for this plan resource, used throughout the system a
74
+ #
75
+ # @param name [String, nil]
76
+ end
77
+
78
+ # The event this payload describes.
79
+ #
80
+ # @see Orb::Models::PlanCreatedWebhookEvent#type
81
+ module Type
82
+ extend Orb::Internal::Type::Enum
83
+
84
+ PLAN_CREATED = :"plan.created"
85
+
86
+ # @!method self.values
87
+ # @return [Array<Symbol>]
88
+ end
89
+ end
90
+ end
91
+ end
@@ -0,0 +1,131 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Orb
4
+ module Models
5
+ class PlanEditedWebhookEvent < Orb::Internal::Type::BaseModel
6
+ # @!attribute id
7
+ # The ID of this webhook event.
8
+ #
9
+ # @return [String]
10
+ required :id, String
11
+
12
+ # @!attribute created_at
13
+ # The time at which this event was created, to the second.
14
+ #
15
+ # @return [Time]
16
+ required :created_at, Time
17
+
18
+ # @!attribute plan
19
+ # The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
20
+ # subscribed to by a customer. Plans define the billing behavior of the
21
+ # subscription. You can see more about how to configure prices in the
22
+ # [Price resource](/reference/price).
23
+ #
24
+ # @return [Orb::Models::Plan]
25
+ required :plan, -> { Orb::Plan }
26
+
27
+ # @!attribute properties
28
+ #
29
+ # @return [Orb::Models::PlanEditedWebhookEvent::Properties]
30
+ required :properties, -> { Orb::PlanEditedWebhookEvent::Properties }
31
+
32
+ # @!attribute type
33
+ # The event this payload describes.
34
+ #
35
+ # @return [Symbol, Orb::Models::PlanEditedWebhookEvent::Type]
36
+ required :type, enum: -> { Orb::PlanEditedWebhookEvent::Type }
37
+
38
+ # @!method initialize(id:, created_at:, plan:, properties:, type:)
39
+ # Some parameter documentations has been truncated, see
40
+ # {Orb::Models::PlanEditedWebhookEvent} for more details.
41
+ #
42
+ # Issued when a plan's name, description, external plan ID, metadata or status is
43
+ # edited.
44
+ #
45
+ # @param id [String] The ID of this webhook event.
46
+ #
47
+ # @param created_at [Time] The time at which this event was created, to the second.
48
+ #
49
+ # @param plan [Orb::Models::Plan] The [Plan](/core-concepts#plan-and-price) resource represents a plan that can be
50
+ #
51
+ # @param properties [Orb::Models::PlanEditedWebhookEvent::Properties]
52
+ #
53
+ # @param type [Symbol, Orb::Models::PlanEditedWebhookEvent::Type] The event this payload describes.
54
+
55
+ # @see Orb::Models::PlanEditedWebhookEvent#properties
56
+ class Properties < Orb::Internal::Type::BaseModel
57
+ # @!attribute previous_attributes
58
+ # metadata values are non-null on the wire, as on the price event.
59
+ #
60
+ # @return [Orb::Models::PlanEditedWebhookEvent::Properties::PreviousAttributes]
61
+ required :previous_attributes, -> { Orb::PlanEditedWebhookEvent::Properties::PreviousAttributes }
62
+
63
+ # @!method initialize(previous_attributes:)
64
+ # @param previous_attributes [Orb::Models::PlanEditedWebhookEvent::Properties::PreviousAttributes] metadata values are non-null on the wire, as on the price event.
65
+
66
+ # @see Orb::Models::PlanEditedWebhookEvent::Properties#previous_attributes
67
+ class PreviousAttributes < Orb::Internal::Type::BaseModel
68
+ # @!attribute description
69
+ #
70
+ # @return [String, nil]
71
+ optional :description, String, nil?: true
72
+
73
+ # @!attribute external_plan_id
74
+ #
75
+ # @return [String, nil]
76
+ optional :external_plan_id, String, nil?: true
77
+
78
+ # @!attribute metadata
79
+ #
80
+ # @return [Hash{Symbol=>String}, nil]
81
+ optional :metadata, Orb::Internal::Type::HashOf[String], nil?: true
82
+
83
+ # @!attribute name
84
+ #
85
+ # @return [String, nil]
86
+ optional :name, String, nil?: true
87
+
88
+ # @!attribute status
89
+ #
90
+ # @return [Symbol, Orb::Models::PlanEditedWebhookEvent::Properties::PreviousAttributes::Status, nil]
91
+ optional :status,
92
+ enum: -> { Orb::PlanEditedWebhookEvent::Properties::PreviousAttributes::Status },
93
+ nil?: true
94
+
95
+ # @!method initialize(description: nil, external_plan_id: nil, metadata: nil, name: nil, status: nil)
96
+ # metadata values are non-null on the wire, as on the price event.
97
+ #
98
+ # @param description [String, nil]
99
+ # @param external_plan_id [String, nil]
100
+ # @param metadata [Hash{Symbol=>String}, nil]
101
+ # @param name [String, nil]
102
+ # @param status [Symbol, Orb::Models::PlanEditedWebhookEvent::Properties::PreviousAttributes::Status, nil]
103
+
104
+ # @see Orb::Models::PlanEditedWebhookEvent::Properties::PreviousAttributes#status
105
+ module Status
106
+ extend Orb::Internal::Type::Enum
107
+
108
+ ACTIVE = :active
109
+ ARCHIVED = :archived
110
+ DRAFT = :draft
111
+
112
+ # @!method self.values
113
+ # @return [Array<Symbol>]
114
+ end
115
+ end
116
+ end
117
+
118
+ # The event this payload describes.
119
+ #
120
+ # @see Orb::Models::PlanEditedWebhookEvent#type
121
+ module Type
122
+ extend Orb::Internal::Type::Enum
123
+
124
+ PLAN_EDITED = :"plan.edited"
125
+
126
+ # @!method self.values
127
+ # @return [Array<Symbol>]
128
+ end
129
+ end
130
+ end
131
+ end