orb-billing 1.27.0 → 1.28.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9963c97978a5d148cea925094ef65f1f198cb85230d9ea6fdfc0988d6c92df2e
4
- data.tar.gz: 39ada2b3ae8568cbf46ed3d80a8c6a4bf9539546cd510f9cc7cca83912fd964f
3
+ metadata.gz: e696c92aadec856a97cadfc85a5efaa55b51947b6d261e23afb9b038fc291203
4
+ data.tar.gz: b5fb963b9ab31969d11a701a07e188843e5f4f19560ddea000223f3bbd95f16f
5
5
  SHA512:
6
- metadata.gz: 376cf1aa3abd49b701bfba2b33bdbd4976c5916e798014a83b08ea2e6f0b709bf981046616fbef1f475559f9dd6f0e2738f147d1c221da7ced3695c9b98bc8eb
7
- data.tar.gz: aee8e43ed717d30c552b3b7a021113c9079615282fcdbff4c43fc1be3a60ff9a8f079287240b07151346b0630c324856c650eda5c4f1ab4773405a6251319a6f
6
+ metadata.gz: 22f4131bc53e513d7d4a9735bd04ef912b276aec5abe2fb8653ee4ff02f6ff471123a20d296bcb8c226bd6a4b1a623ff03eeb1678dfac39fc5b9edb751c1fcaa
7
+ data.tar.gz: 37ad33761702700de24810b0a5bb8b4df17cb21543bf8f9362405392dc2d28521fdfcc37f2dae1fe129df459301c3be044af577427d6d04322a3dfd936d3c243
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.28.0](https://github.com/orbcorp/orb-ruby/compare/v1.27.0...v1.28.0) (2026-08-25)
4
+
5
+
6
+ ### Features
7
+
8
+ * **api:** restore deprecated `scaling_factor` field on unit and matrix price configs ([31e58e0](https://github.com/orbcorp/orb-ruby/commit/31e58e08017b5b80f8cce123106b585d5f7d7f2d))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * **api:** reject empty or missing dimension values in dimensional price configuration ([31e58e0](https://github.com/orbcorp/orb-ruby/commit/31e58e08017b5b80f8cce123106b585d5f7d7f2d))
14
+
3
15
  ## [1.27.0](https://github.com/orbcorp/orb-ruby/compare/v1.26.0...v1.27.0) (2026-08-19)
4
16
 
5
17
 
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.27.0"
18
+ gem "orb-billing", "~> 1.28.0"
19
19
  ```
20
20
 
21
21
  <!-- x-release-please-end -->
@@ -21,7 +21,19 @@ module Orb
21
21
  # @return [Array<Orb::Models::MatrixValue>]
22
22
  required :matrix_values, -> { Orb::Internal::Type::ArrayOf[Orb::MatrixValue] }
23
23
 
24
- # @!method initialize(default_unit_amount:, dimensions:, matrix_values:)
24
+ # @!attribute scaling_factor
25
+ # @deprecated
26
+ #
27
+ # Optional multiplier applied to default-bucket quantity before
28
+ # default_unit_amount.
29
+ #
30
+ # @return [Float, nil]
31
+ optional :scaling_factor, Float, nil?: true
32
+
33
+ # @!method initialize(default_unit_amount:, dimensions:, matrix_values:, scaling_factor: nil)
34
+ # Some parameter documentations has been truncated, see
35
+ # {Orb::Models::MatrixConfig} for more details.
36
+ #
25
37
  # Configuration for matrix pricing
26
38
  #
27
39
  # @param default_unit_amount [String] Default per unit rate for any usage not bucketed into a specified matrix_value
@@ -29,6 +41,8 @@ module Orb
29
41
  # @param dimensions [Array<String, nil>] One or two event property values to evaluate matrix groups by
30
42
  #
31
43
  # @param matrix_values [Array<Orb::Models::MatrixValue>] Matrix values configuration
44
+ #
45
+ # @param scaling_factor [Float, nil] Optional multiplier applied to default-bucket quantity before default_unit_amoun
32
46
  end
33
47
  end
34
48
  end
@@ -15,12 +15,22 @@ module Orb
15
15
  # @return [String]
16
16
  required :unit_amount, String
17
17
 
18
- # @!method initialize(dimension_values:, unit_amount:)
18
+ # @!attribute scaling_factor
19
+ # @deprecated
20
+ #
21
+ # Optional multiplier applied to rated quantity before unit_amount.
22
+ #
23
+ # @return [Float, nil]
24
+ optional :scaling_factor, Float, nil?: true
25
+
26
+ # @!method initialize(dimension_values:, unit_amount:, scaling_factor: nil)
19
27
  # Configuration for a single matrix value
20
28
  #
21
29
  # @param dimension_values [Array<String, nil>] One or two matrix keys to filter usage to this Matrix value by
22
30
  #
23
31
  # @param unit_amount [String] Unit price for the specified dimension_values
32
+ #
33
+ # @param scaling_factor [Float, nil] Optional multiplier applied to rated quantity before unit_amount.
24
34
  end
25
35
  end
26
36
  end
@@ -27,7 +27,19 @@ module Orb
27
27
  # @return [Array<Orb::Models::MatrixWithAllocationConfig::MatrixValue>]
28
28
  required :matrix_values, -> { Orb::Internal::Type::ArrayOf[Orb::MatrixWithAllocationConfig::MatrixValue] }
29
29
 
30
- # @!method initialize(allocation:, default_unit_amount:, dimensions:, matrix_values:)
30
+ # @!attribute scaling_factor
31
+ # @deprecated
32
+ #
33
+ # Optional multiplier applied to default-bucket quantity before
34
+ # default_unit_amount.
35
+ #
36
+ # @return [String, nil]
37
+ optional :scaling_factor, String, nil?: true
38
+
39
+ # @!method initialize(allocation:, default_unit_amount:, dimensions:, matrix_values:, scaling_factor: nil)
40
+ # Some parameter documentations has been truncated, see
41
+ # {Orb::Models::MatrixWithAllocationConfig} for more details.
42
+ #
31
43
  # Configuration for matrix pricing with usage allocation
32
44
  #
33
45
  # @param allocation [String] Usage allocation
@@ -37,6 +49,8 @@ module Orb
37
49
  # @param dimensions [Array<String, nil>] One or two event property values to evaluate matrix groups by
38
50
  #
39
51
  # @param matrix_values [Array<Orb::Models::MatrixWithAllocationConfig::MatrixValue>] Matrix values configuration
52
+ #
53
+ # @param scaling_factor [String, nil] Optional multiplier applied to default-bucket quantity before default_unit_amoun
40
54
 
41
55
  class MatrixValue < Orb::Internal::Type::BaseModel
42
56
  # @!attribute dimension_values
@@ -53,7 +67,15 @@ module Orb
53
67
  # @return [String]
54
68
  required :unit_amount, String
55
69
 
56
- # @!method initialize(dimension_values:, unit_amount:)
70
+ # @!attribute scaling_factor
71
+ # @deprecated
72
+ #
73
+ # Optional multiplier applied to rated quantity before unit_amount.
74
+ #
75
+ # @return [String, nil]
76
+ optional :scaling_factor, String, nil?: true
77
+
78
+ # @!method initialize(dimension_values:, unit_amount:, scaling_factor: nil)
57
79
  # Some parameter documentations has been truncated, see
58
80
  # {Orb::Models::MatrixWithAllocationConfig::MatrixValue} for more details.
59
81
  #
@@ -62,6 +84,8 @@ module Orb
62
84
  # @param dimension_values [Array<String, nil>] One or two matrix keys to filter usage to this Matrix value by. For example, ["r
63
85
  #
64
86
  # @param unit_amount [String] Unit price for the specified dimension_values
87
+ #
88
+ # @param scaling_factor [String, nil] Optional multiplier applied to rated quantity before unit_amount.
65
89
  end
66
90
  end
67
91
  end
@@ -15,12 +15,22 @@ module Orb
15
15
  # @return [Boolean, nil]
16
16
  optional :prorated, Orb::Internal::Type::Boolean
17
17
 
18
- # @!method initialize(unit_amount:, prorated: nil)
18
+ # @!attribute scaling_factor
19
+ # @deprecated
20
+ #
21
+ # Optional multiplier applied to rated quantity before unit_amount.
22
+ #
23
+ # @return [Float, nil]
24
+ optional :scaling_factor, Float, nil?: true
25
+
26
+ # @!method initialize(unit_amount:, prorated: nil, scaling_factor: nil)
19
27
  # Configuration for unit pricing
20
28
  #
21
29
  # @param unit_amount [String] Rate per unit of usage
22
30
  #
23
31
  # @param prorated [Boolean] If true, subtotals from this price are prorated based on the service period
32
+ #
33
+ # @param scaling_factor [Float, nil] Optional multiplier applied to rated quantity before unit_amount.
24
34
  end
25
35
  end
26
36
  end
data/lib/orb/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Orb
4
- VERSION = "1.27.0"
4
+ VERSION = "1.28.0"
5
5
  end
@@ -17,12 +17,18 @@ module Orb
17
17
  sig { returns(T::Array[Orb::MatrixValue]) }
18
18
  attr_accessor :matrix_values
19
19
 
20
+ # Optional multiplier applied to default-bucket quantity before
21
+ # default_unit_amount.
22
+ sig { returns(T.nilable(Float)) }
23
+ attr_accessor :scaling_factor
24
+
20
25
  # Configuration for matrix pricing
21
26
  sig do
22
27
  params(
23
28
  default_unit_amount: String,
24
29
  dimensions: T::Array[T.nilable(String)],
25
- matrix_values: T::Array[Orb::MatrixValue::OrHash]
30
+ matrix_values: T::Array[Orb::MatrixValue::OrHash],
31
+ scaling_factor: T.nilable(Float)
26
32
  ).returns(T.attached_class)
27
33
  end
28
34
  def self.new(
@@ -31,7 +37,10 @@ module Orb
31
37
  # One or two event property values to evaluate matrix groups by
32
38
  dimensions:,
33
39
  # Matrix values configuration
34
- matrix_values:
40
+ matrix_values:,
41
+ # Optional multiplier applied to default-bucket quantity before
42
+ # default_unit_amount.
43
+ scaling_factor: nil
35
44
  )
36
45
  end
37
46
 
@@ -40,7 +49,8 @@ module Orb
40
49
  {
41
50
  default_unit_amount: String,
42
51
  dimensions: T::Array[T.nilable(String)],
43
- matrix_values: T::Array[Orb::MatrixValue]
52
+ matrix_values: T::Array[Orb::MatrixValue],
53
+ scaling_factor: T.nilable(Float)
44
54
  }
45
55
  )
46
56
  end
@@ -13,24 +13,35 @@ module Orb
13
13
  sig { returns(String) }
14
14
  attr_accessor :unit_amount
15
15
 
16
+ # Optional multiplier applied to rated quantity before unit_amount.
17
+ sig { returns(T.nilable(Float)) }
18
+ attr_accessor :scaling_factor
19
+
16
20
  # Configuration for a single matrix value
17
21
  sig do
18
22
  params(
19
23
  dimension_values: T::Array[T.nilable(String)],
20
- unit_amount: String
24
+ unit_amount: String,
25
+ scaling_factor: T.nilable(Float)
21
26
  ).returns(T.attached_class)
22
27
  end
23
28
  def self.new(
24
29
  # One or two matrix keys to filter usage to this Matrix value by
25
30
  dimension_values:,
26
31
  # Unit price for the specified dimension_values
27
- unit_amount:
32
+ unit_amount:,
33
+ # Optional multiplier applied to rated quantity before unit_amount.
34
+ scaling_factor: nil
28
35
  )
29
36
  end
30
37
 
31
38
  sig do
32
39
  override.returns(
33
- { dimension_values: T::Array[T.nilable(String)], unit_amount: String }
40
+ {
41
+ dimension_values: T::Array[T.nilable(String)],
42
+ unit_amount: String,
43
+ scaling_factor: T.nilable(Float)
44
+ }
34
45
  )
35
46
  end
36
47
  def to_hash
@@ -24,6 +24,11 @@ module Orb
24
24
  sig { returns(T::Array[Orb::MatrixWithAllocationConfig::MatrixValue]) }
25
25
  attr_accessor :matrix_values
26
26
 
27
+ # Optional multiplier applied to default-bucket quantity before
28
+ # default_unit_amount.
29
+ sig { returns(T.nilable(String)) }
30
+ attr_accessor :scaling_factor
31
+
27
32
  # Configuration for matrix pricing with usage allocation
28
33
  sig do
29
34
  params(
@@ -31,7 +36,8 @@ module Orb
31
36
  default_unit_amount: String,
32
37
  dimensions: T::Array[T.nilable(String)],
33
38
  matrix_values:
34
- T::Array[Orb::MatrixWithAllocationConfig::MatrixValue::OrHash]
39
+ T::Array[Orb::MatrixWithAllocationConfig::MatrixValue::OrHash],
40
+ scaling_factor: T.nilable(String)
35
41
  ).returns(T.attached_class)
36
42
  end
37
43
  def self.new(
@@ -42,7 +48,10 @@ module Orb
42
48
  # One or two event property values to evaluate matrix groups by
43
49
  dimensions:,
44
50
  # Matrix values configuration
45
- matrix_values:
51
+ matrix_values:,
52
+ # Optional multiplier applied to default-bucket quantity before
53
+ # default_unit_amount.
54
+ scaling_factor: nil
46
55
  )
47
56
  end
48
57
 
@@ -53,7 +62,8 @@ module Orb
53
62
  default_unit_amount: String,
54
63
  dimensions: T::Array[T.nilable(String)],
55
64
  matrix_values:
56
- T::Array[Orb::MatrixWithAllocationConfig::MatrixValue]
65
+ T::Array[Orb::MatrixWithAllocationConfig::MatrixValue],
66
+ scaling_factor: T.nilable(String)
57
67
  }
58
68
  )
59
69
  end
@@ -79,11 +89,16 @@ module Orb
79
89
  sig { returns(String) }
80
90
  attr_accessor :unit_amount
81
91
 
92
+ # Optional multiplier applied to rated quantity before unit_amount.
93
+ sig { returns(T.nilable(String)) }
94
+ attr_accessor :scaling_factor
95
+
82
96
  # Configuration for a single matrix value
83
97
  sig do
84
98
  params(
85
99
  dimension_values: T::Array[T.nilable(String)],
86
- unit_amount: String
100
+ unit_amount: String,
101
+ scaling_factor: T.nilable(String)
87
102
  ).returns(T.attached_class)
88
103
  end
89
104
  def self.new(
@@ -92,7 +107,9 @@ module Orb
92
107
  # instance tier.
93
108
  dimension_values:,
94
109
  # Unit price for the specified dimension_values
95
- unit_amount:
110
+ unit_amount:,
111
+ # Optional multiplier applied to rated quantity before unit_amount.
112
+ scaling_factor: nil
96
113
  )
97
114
  end
98
115
 
@@ -100,7 +117,8 @@ module Orb
100
117
  override.returns(
101
118
  {
102
119
  dimension_values: T::Array[T.nilable(String)],
103
- unit_amount: String
120
+ unit_amount: String,
121
+ scaling_factor: T.nilable(String)
104
122
  }
105
123
  )
106
124
  end
@@ -16,21 +16,37 @@ module Orb
16
16
  sig { params(prorated: T::Boolean).void }
17
17
  attr_writer :prorated
18
18
 
19
+ # Optional multiplier applied to rated quantity before unit_amount.
20
+ sig { returns(T.nilable(Float)) }
21
+ attr_accessor :scaling_factor
22
+
19
23
  # Configuration for unit pricing
20
24
  sig do
21
- params(unit_amount: String, prorated: T::Boolean).returns(
22
- T.attached_class
23
- )
25
+ params(
26
+ unit_amount: String,
27
+ prorated: T::Boolean,
28
+ scaling_factor: T.nilable(Float)
29
+ ).returns(T.attached_class)
24
30
  end
25
31
  def self.new(
26
32
  # Rate per unit of usage
27
33
  unit_amount:,
28
34
  # If true, subtotals from this price are prorated based on the service period
29
- prorated: nil
35
+ prorated: nil,
36
+ # Optional multiplier applied to rated quantity before unit_amount.
37
+ scaling_factor: nil
30
38
  )
31
39
  end
32
40
 
33
- sig { override.returns({ unit_amount: String, prorated: T::Boolean }) }
41
+ sig do
42
+ override.returns(
43
+ {
44
+ unit_amount: String,
45
+ prorated: T::Boolean,
46
+ scaling_factor: T.nilable(Float)
47
+ }
48
+ )
49
+ end
34
50
  def to_hash
35
51
  end
36
52
  end
@@ -4,7 +4,8 @@ module Orb
4
4
  {
5
5
  default_unit_amount: String,
6
6
  dimensions: ::Array[String?],
7
- matrix_values: ::Array[Orb::MatrixValue]
7
+ matrix_values: ::Array[Orb::MatrixValue],
8
+ scaling_factor: Float?
8
9
  }
9
10
 
10
11
  class MatrixConfig < Orb::Internal::Type::BaseModel
@@ -14,16 +15,20 @@ module Orb
14
15
 
15
16
  attr_accessor matrix_values: ::Array[Orb::MatrixValue]
16
17
 
18
+ attr_accessor scaling_factor: Float?
19
+
17
20
  def initialize: (
18
21
  default_unit_amount: String,
19
22
  dimensions: ::Array[String?],
20
- matrix_values: ::Array[Orb::MatrixValue]
23
+ matrix_values: ::Array[Orb::MatrixValue],
24
+ ?scaling_factor: Float?
21
25
  ) -> void
22
26
 
23
27
  def to_hash: -> {
24
28
  default_unit_amount: String,
25
29
  dimensions: ::Array[String?],
26
- matrix_values: ::Array[Orb::MatrixValue]
30
+ matrix_values: ::Array[Orb::MatrixValue],
31
+ scaling_factor: Float?
27
32
  }
28
33
  end
29
34
  end
@@ -1,21 +1,29 @@
1
1
  module Orb
2
2
  module Models
3
3
  type matrix_value =
4
- { dimension_values: ::Array[String?], unit_amount: String }
4
+ {
5
+ dimension_values: ::Array[String?],
6
+ unit_amount: String,
7
+ scaling_factor: Float?
8
+ }
5
9
 
6
10
  class MatrixValue < Orb::Internal::Type::BaseModel
7
11
  attr_accessor dimension_values: ::Array[String?]
8
12
 
9
13
  attr_accessor unit_amount: String
10
14
 
15
+ attr_accessor scaling_factor: Float?
16
+
11
17
  def initialize: (
12
18
  dimension_values: ::Array[String?],
13
- unit_amount: String
19
+ unit_amount: String,
20
+ ?scaling_factor: Float?
14
21
  ) -> void
15
22
 
16
23
  def to_hash: -> {
17
24
  dimension_values: ::Array[String?],
18
- unit_amount: String
25
+ unit_amount: String,
26
+ scaling_factor: Float?
19
27
  }
20
28
  end
21
29
  end
@@ -5,7 +5,8 @@ module Orb
5
5
  allocation: String,
6
6
  default_unit_amount: String,
7
7
  dimensions: ::Array[String?],
8
- matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue]
8
+ matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue],
9
+ scaling_factor: String?
9
10
  }
10
11
 
11
12
  class MatrixWithAllocationConfig < Orb::Internal::Type::BaseModel
@@ -17,36 +18,48 @@ module Orb
17
18
 
18
19
  attr_accessor matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue]
19
20
 
21
+ attr_accessor scaling_factor: String?
22
+
20
23
  def initialize: (
21
24
  allocation: String,
22
25
  default_unit_amount: String,
23
26
  dimensions: ::Array[String?],
24
- matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue]
27
+ matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue],
28
+ ?scaling_factor: String?
25
29
  ) -> void
26
30
 
27
31
  def to_hash: -> {
28
32
  allocation: String,
29
33
  default_unit_amount: String,
30
34
  dimensions: ::Array[String?],
31
- matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue]
35
+ matrix_values: ::Array[Orb::MatrixWithAllocationConfig::MatrixValue],
36
+ scaling_factor: String?
32
37
  }
33
38
 
34
39
  type matrix_value =
35
- { dimension_values: ::Array[String?], unit_amount: String }
40
+ {
41
+ dimension_values: ::Array[String?],
42
+ unit_amount: String,
43
+ scaling_factor: String?
44
+ }
36
45
 
37
46
  class MatrixValue < Orb::Internal::Type::BaseModel
38
47
  attr_accessor dimension_values: ::Array[String?]
39
48
 
40
49
  attr_accessor unit_amount: String
41
50
 
51
+ attr_accessor scaling_factor: String?
52
+
42
53
  def initialize: (
43
54
  dimension_values: ::Array[String?],
44
- unit_amount: String
55
+ unit_amount: String,
56
+ ?scaling_factor: String?
45
57
  ) -> void
46
58
 
47
59
  def to_hash: -> {
48
60
  dimension_values: ::Array[String?],
49
- unit_amount: String
61
+ unit_amount: String,
62
+ scaling_factor: String?
50
63
  }
51
64
  end
52
65
  end
@@ -1,6 +1,7 @@
1
1
  module Orb
2
2
  module Models
3
- type unit_config = { unit_amount: String, prorated: bool }
3
+ type unit_config =
4
+ { unit_amount: String, prorated: bool, scaling_factor: Float? }
4
5
 
5
6
  class UnitConfig < Orb::Internal::Type::BaseModel
6
7
  attr_accessor unit_amount: String
@@ -9,9 +10,19 @@ module Orb
9
10
 
10
11
  def prorated=: (bool) -> bool
11
12
 
12
- def initialize: (unit_amount: String, ?prorated: bool) -> void
13
+ attr_accessor scaling_factor: Float?
13
14
 
14
- def to_hash: -> { unit_amount: String, prorated: bool }
15
+ def initialize: (
16
+ unit_amount: String,
17
+ ?prorated: bool,
18
+ ?scaling_factor: Float?
19
+ ) -> void
20
+
21
+ def to_hash: -> {
22
+ unit_amount: String,
23
+ prorated: bool,
24
+ scaling_factor: Float?
25
+ }
15
26
  end
16
27
  end
17
28
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orb-billing
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.27.0
4
+ version: 1.28.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Orb
@@ -1407,7 +1407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1407
1407
  - !ruby/object:Gem::Version
1408
1408
  version: '0'
1409
1409
  requirements: []
1410
- rubygems_version: 4.0.18
1410
+ rubygems_version: 4.0.19
1411
1411
  specification_version: 4
1412
1412
  summary: Ruby library to access the Orb API
1413
1413
  test_files: []