stigg 0.1.0.pre.beta.57 → 0.1.0.pre.beta.59

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +34 -0
  3. data/README.md +1 -1
  4. data/lib/stigg/models/v1/addon_update_params.rb +2 -2
  5. data/lib/stigg/models/v1/credit_list_ledger_params.rb +9 -1
  6. data/lib/stigg/models/v1/credit_list_ledger_response.rb +157 -3
  7. data/lib/stigg/models/v1/credits/reservation_release_params.rb +76 -0
  8. data/lib/stigg/models/v1/credits/reservation_release_response.rb +165 -0
  9. data/lib/stigg/models/v1/customer_check_entitlement_params.rb +45 -1
  10. data/lib/stigg/models/v1/customer_check_entitlement_response.rb +93 -1
  11. data/lib/stigg/models/v1/customer_retrieve_entitlements_response.rb +93 -1
  12. data/lib/stigg/models/v1/plan_update_params.rb +2 -2
  13. data/lib/stigg/models/v1/subscription_provision_response.rb +93 -1
  14. data/lib/stigg/models/v1/usage_estimate_params.rb +7 -6
  15. data/lib/stigg/models/v1/usage_report_params.rb +7 -6
  16. data/lib/stigg/models/v1/usage_report_response.rb +3 -3
  17. data/lib/stigg/models/v1_beta/customers/entitlement_check_response.rb +89 -1
  18. data/lib/stigg/models/v2/usage_report_params.rb +7 -6
  19. data/lib/stigg/models/v2/usage_report_response.rb +3 -3
  20. data/lib/stigg/resources/v1/credits/reservations.rb +59 -0
  21. data/lib/stigg/resources/v1/credits.rb +10 -2
  22. data/lib/stigg/resources/v1/customers.rb +29 -2
  23. data/lib/stigg/resources/v1/usage.rb +1 -1
  24. data/lib/stigg/version.rb +1 -1
  25. data/lib/stigg.rb +3 -0
  26. data/rbi/stigg/models/v1/addon_update_params.rbi +2 -2
  27. data/rbi/stigg/models/v1/credit_list_ledger_params.rbi +11 -0
  28. data/rbi/stigg/models/v1/credit_list_ledger_response.rbi +263 -2
  29. data/rbi/stigg/models/v1/credits/reservation_release_params.rbi +105 -0
  30. data/rbi/stigg/models/v1/credits/reservation_release_response.rbi +328 -0
  31. data/rbi/stigg/models/v1/customer_check_entitlement_params.rbi +63 -0
  32. data/rbi/stigg/models/v1/customer_check_entitlement_response.rbi +164 -0
  33. data/rbi/stigg/models/v1/customer_retrieve_entitlements_response.rbi +164 -0
  34. data/rbi/stigg/models/v1/plan_update_params.rbi +2 -2
  35. data/rbi/stigg/models/v1/subscription_provision_response.rbi +164 -0
  36. data/rbi/stigg/models/v1/usage_estimate_params.rbi +11 -9
  37. data/rbi/stigg/models/v1/usage_report_params.rbi +11 -9
  38. data/rbi/stigg/models/v1/usage_report_response.rbi +3 -3
  39. data/rbi/stigg/models/v1_beta/customers/entitlement_check_response.rbi +164 -0
  40. data/rbi/stigg/models/v2/usage_report_params.rbi +11 -9
  41. data/rbi/stigg/models/v2/usage_report_response.rbi +3 -3
  42. data/rbi/stigg/resources/v1/credits/reservations.rbi +55 -0
  43. data/rbi/stigg/resources/v1/credits.rbi +6 -0
  44. data/rbi/stigg/resources/v1/customers.rbi +20 -0
  45. data/rbi/stigg/resources/v1/usage.rbi +5 -5
  46. data/sig/stigg/models/v1/credit_list_ledger_params.rbs +7 -0
  47. data/sig/stigg/models/v1/credit_list_ledger_response.rbs +117 -0
  48. data/sig/stigg/models/v1/credits/reservation_release_params.rbs +66 -0
  49. data/sig/stigg/models/v1/credits/reservation_release_response.rbs +129 -0
  50. data/sig/stigg/models/v1/customer_check_entitlement_params.rbs +35 -0
  51. data/sig/stigg/models/v1/customer_check_entitlement_response.rbs +62 -0
  52. data/sig/stigg/models/v1/customer_retrieve_entitlements_response.rbs +62 -0
  53. data/sig/stigg/models/v1/subscription_provision_response.rbs +62 -0
  54. data/sig/stigg/models/v1/usage_estimate_params.rbs +4 -4
  55. data/sig/stigg/models/v1/usage_report_params.rbs +4 -4
  56. data/sig/stigg/models/v1/usage_report_response.rbs +4 -4
  57. data/sig/stigg/models/v1_beta/customers/entitlement_check_response.rbs +62 -0
  58. data/sig/stigg/models/v2/usage_report_params.rbs +4 -4
  59. data/sig/stigg/models/v2/usage_report_response.rbs +4 -4
  60. data/sig/stigg/resources/v1/credits/reservations.rbs +22 -0
  61. data/sig/stigg/resources/v1/credits.rbs +3 -0
  62. data/sig/stigg/resources/v1/customers.rbs +5 -0
  63. data/sig/stigg/resources/v1/usage.rbs +1 -1
  64. metadata +11 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 708a857f78b38d4be04cdf9404746325027c0e77ed8f8bb1b2cd33345d2c7e68
4
- data.tar.gz: 8a6916176a4d58c67b6e8f23367799f0f1fb6df268da57d9985364148342f561
3
+ metadata.gz: b110182dabf0144099cb775786f7cbd2c23130d8f7cbf652dc23bdeb7b91aa8e
4
+ data.tar.gz: baab0f7102a3d40e12a398e22bf0b745c295d359455857541fff9a0457c0bb97
5
5
  SHA512:
6
- metadata.gz: '0019d4cf46f41394aa8edd73d1ce79d9a5f8e04a8917d47897f752c1888969c2f1943a7c53cba3bba1ced27b5aff3537a2f1c1ee123f6bc5fddaa7604df102d2'
7
- data.tar.gz: e2e66982a8445532733a13a3ed7ee52c3859b54de54e73bfddc9821ff9b3158fc5e1ed39d2830c2480f8c1998809e43223bb583cebcdee17b1b3a2a3e8183f15
6
+ metadata.gz: 9a274dfef112b685dad6a6fcd69a966a446defcdfe554d5ce12d3f5b4e831a92a33ce6165307bd1920a640a446bf991dad0abad6f3c57266ed29342ce2016ead
7
+ data.tar.gz: 67f5d938b25e4aa07a3ce4ada5e8bfde9789c3a639dbf116ebf1e860281693d60a4ef8794327b20dc846c6a23f31acc083568da11be5d9c6610791531379470c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.1.0-beta.59](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.58...v0.1.0-beta.59) (2026-10-22)
4
+
5
+
6
+ ### Features
7
+
8
+ * **STIGG-10078:** credit reservation release in the sdks ([1304cf9](https://github.com/stiggio/stigg-ruby/commit/1304cf9c429ff4a0e4b3e8ef189e514e826d4f19))
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * sync OpenAPI spec from stigg-api ([5802632](https://github.com/stiggio/stigg-ruby/commit/5802632aea5bea5172def86c993df4a5939178d2))
14
+ * sync OpenAPI spec from stigg-api ([7bca63d](https://github.com/stiggio/stigg-ruby/commit/7bca63d0923f273c08252b867fe5735aae7a6d94))
15
+ * sync OpenAPI spec from stigg-api ([1308798](https://github.com/stiggio/stigg-ruby/commit/13087983769464b32eceea095e9b360db2529d2b))
16
+ * sync OpenAPI spec from stigg-api ([5ee5986](https://github.com/stiggio/stigg-ruby/commit/5ee5986d11a9122559e8ec364c8059bb26b0f5a6))
17
+ * sync OpenAPI spec from stigg-api ([61ee37f](https://github.com/stiggio/stigg-ruby/commit/61ee37f0461ae7ead5876618a5bae322ab21910c))
18
+
19
+
20
+ ### Chores
21
+
22
+ * normalize version.rb to gem prerelease format for stlc codegen ([732312c](https://github.com/stiggio/stigg-ruby/commit/732312c75f6f23c560fd49244f76af8a10643f2c))
23
+
24
+ ## [0.1.0-beta.58](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.57...v0.1.0-beta.58) (2026-10-20)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * sync OpenAPI spec from stigg-api ([d5d10f1](https://github.com/stiggio/stigg-ruby/commit/d5d10f164c3e066f9f77fb0e2fbac391e671eaeb))
30
+ * sync OpenAPI spec from stigg-api ([84889fd](https://github.com/stiggio/stigg-ruby/commit/84889fd36858b92f1e5ee94530af6f788e03c9c2))
31
+
32
+
33
+ ### Chores
34
+
35
+ * normalize version.rb to gem prerelease format for stlc codegen ([f535762](https://github.com/stiggio/stigg-ruby/commit/f53576294a3e52bbdae9035bdf3ffdd16907a7a5))
36
+
3
37
  ## [0.1.0-beta.57](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.56...v0.1.0-beta.57) (2026-10-15)
4
38
 
5
39
 
data/README.md CHANGED
@@ -24,7 +24,7 @@ To use this gem, install via Bundler by adding the following to your application
24
24
  <!-- x-release-please-start-version -->
25
25
 
26
26
  ```ruby
27
- gem "stigg", "~> 0.1.0.pre.beta.56"
27
+ gem "stigg", "~> 0.1.0.pre.beta.58"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -1343,7 +1343,7 @@ module Stigg
1343
1343
  optional :feature_id, String, api_name: :featureId
1344
1344
 
1345
1345
  # @!attribute max_unit_quantity
1346
- # Maximum number of units (max 999999)
1346
+ # Maximum number of units
1347
1347
  #
1348
1348
  # @return [Integer, nil]
1349
1349
  optional :max_unit_quantity, Integer, api_name: :maxUnitQuantity
@@ -1417,7 +1417,7 @@ module Stigg
1417
1417
  #
1418
1418
  # @param feature_id [String] The feature ID this pricing model is associated with
1419
1419
  #
1420
- # @param max_unit_quantity [Integer] Maximum number of units (max 999999)
1420
+ # @param max_unit_quantity [Integer] Maximum number of units
1421
1421
  #
1422
1422
  # @param min_unit_quantity [Integer] Minimum number of units
1423
1423
  #
@@ -44,6 +44,12 @@ module Stigg
44
44
  # @return [Integer, nil]
45
45
  optional :limit, Integer
46
46
 
47
+ # @!attribute reservation_id
48
+ # Filter by credit reservation ID
49
+ #
50
+ # @return [String, nil]
51
+ optional :reservation_id, String
52
+
47
53
  # @!attribute resource_id
48
54
  # Filter by resource ID
49
55
  #
@@ -60,7 +66,7 @@ module Stigg
60
66
  # @return [String, nil]
61
67
  optional :x_environment_id, String
62
68
 
63
- # @!method initialize(customer_id:, after: nil, before: nil, currency_id: nil, event_type: nil, limit: nil, resource_id: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
69
+ # @!method initialize(customer_id:, after: nil, before: nil, currency_id: nil, event_type: nil, limit: nil, reservation_id: nil, resource_id: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
64
70
  # @param customer_id [String] Filter by customer ID (required)
65
71
  #
66
72
  # @param after [String] Return items that come after this cursor
@@ -73,6 +79,8 @@ module Stigg
73
79
  #
74
80
  # @param limit [Integer] Maximum number of items to return
75
81
  #
82
+ # @param reservation_id [String] Filter by credit reservation ID
83
+ #
76
84
  # @param resource_id [String] Filter by resource ID
77
85
  #
78
86
  # @param x_account_id [String]
@@ -6,11 +6,21 @@ module Stigg
6
6
  # @see Stigg::Resources::V1::Credits#list_ledger
7
7
  class CreditListLedgerResponse < Stigg::Internal::Type::BaseModel
8
8
  # @!attribute amount
9
- # The credit amount for this event
9
+ # The amount of the ledger event. Reservation events carry their net effect on the
10
+ # balance: a reserve is negative, and so is a release that consumed more than was
11
+ # held
10
12
  #
11
13
  # @return [Float]
12
14
  required :amount, Float
13
15
 
16
+ # @!attribute breakdown
17
+ # On a released reservation, the credits consumed from each grant
18
+ #
19
+ # @return [Array<Stigg::Models::V1::CreditListLedgerResponse::Breakdown>, nil]
20
+ required :breakdown,
21
+ -> { Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::CreditListLedgerResponse::Breakdown] },
22
+ nil?: true
23
+
14
24
  # @!attribute credit_currency_id
15
25
  # The credit currency ID
16
26
  #
@@ -49,6 +59,25 @@ module Stigg
49
59
  # @return [String, nil]
50
60
  required :feature_id, String, api_name: :featureId, nil?: true
51
61
 
62
+ # @!attribute hold_returned_amount
63
+ # On a released reservation, the held amount returned to the balance before
64
+ # consumed credits are deducted
65
+ #
66
+ # @return [Float, nil]
67
+ required :hold_returned_amount, Float, api_name: :holdReturnedAmount, nil?: true
68
+
69
+ # @!attribute metadata
70
+ # The metadata sent with the credit reservation
71
+ #
72
+ # @return [Hash{Symbol=>String}, nil]
73
+ required :metadata, Stigg::Internal::Type::HashOf[String], nil?: true
74
+
75
+ # @!attribute reservation_id
76
+ # The credit reservation this event belongs to
77
+ #
78
+ # @return [String, nil]
79
+ required :reservation_id, String, api_name: :reservationId, nil?: true
80
+
52
81
  # @!attribute resource_id
53
82
  # The resource ID this event is scoped to
54
83
  #
@@ -61,10 +90,15 @@ module Stigg
61
90
  # @return [Time]
62
91
  required :timestamp, Time
63
92
 
64
- # @!method initialize(amount:, credit_currency_id:, credit_grant_id:, customer_id:, event_id:, event_type:, feature_id:, resource_id:, timestamp:)
93
+ # @!method initialize(amount:, breakdown:, credit_currency_id:, credit_grant_id:, customer_id:, event_id:, event_type:, feature_id:, hold_returned_amount:, metadata:, reservation_id:, resource_id:, timestamp:)
94
+ # Some parameter documentations has been truncated, see
95
+ # {Stigg::Models::V1::CreditListLedgerResponse} for more details.
96
+ #
65
97
  # A credit ledger event representing a change to credit balance
66
98
  #
67
- # @param amount [Float] The credit amount for this event
99
+ # @param amount [Float] The amount of the ledger event. Reservation events carry their net effect on the
100
+ #
101
+ # @param breakdown [Array<Stigg::Models::V1::CreditListLedgerResponse::Breakdown>, nil] On a released reservation, the credits consumed from each grant
68
102
  #
69
103
  # @param credit_currency_id [String] The credit currency ID
70
104
  #
@@ -78,10 +112,127 @@ module Stigg
78
112
  #
79
113
  # @param feature_id [String, nil] The feature ID associated with this event
80
114
  #
115
+ # @param hold_returned_amount [Float, nil] On a released reservation, the held amount returned to the balance before consum
116
+ #
117
+ # @param metadata [Hash{Symbol=>String}, nil] The metadata sent with the credit reservation
118
+ #
119
+ # @param reservation_id [String, nil] The credit reservation this event belongs to
120
+ #
81
121
  # @param resource_id [String, nil] The resource ID this event is scoped to
82
122
  #
83
123
  # @param timestamp [Time] The timestamp when the event occurred
84
124
 
125
+ class Breakdown < Stigg::Internal::Type::BaseModel
126
+ # @!attribute amount
127
+ # The amount of the ledger event. Reservation events carry their net effect on the
128
+ # balance: a reserve is negative, and so is a release that consumed more than was
129
+ # held
130
+ #
131
+ # @return [Float]
132
+ required :amount, Float
133
+
134
+ # @!attribute credit_currency_id
135
+ # The credit currency ID
136
+ #
137
+ # @return [String]
138
+ required :credit_currency_id, String, api_name: :creditCurrencyId
139
+
140
+ # @!attribute credit_grant_id
141
+ # The credit grant ID associated with this event
142
+ #
143
+ # @return [String]
144
+ required :credit_grant_id, String, api_name: :creditGrantId
145
+
146
+ # @!attribute customer_id
147
+ # The customer ID this event belongs to
148
+ #
149
+ # @return [String]
150
+ required :customer_id, String, api_name: :customerId
151
+
152
+ # @!attribute event_id
153
+ # The unique event identifier
154
+ #
155
+ # @return [String, nil]
156
+ required :event_id, String, api_name: :eventId, nil?: true
157
+
158
+ # @!attribute event_type
159
+ # The type of credit event
160
+ #
161
+ # @return [Symbol, Stigg::Models::V1::CreditListLedgerResponse::Breakdown::EventType]
162
+ required :event_type,
163
+ enum: -> { Stigg::Models::V1::CreditListLedgerResponse::Breakdown::EventType },
164
+ api_name: :eventType
165
+
166
+ # @!attribute feature_id
167
+ # The feature ID associated with this event
168
+ #
169
+ # @return [String, nil]
170
+ required :feature_id, String, api_name: :featureId, nil?: true
171
+
172
+ # @!attribute reservation_id
173
+ # The credit reservation this event belongs to
174
+ #
175
+ # @return [String, nil]
176
+ required :reservation_id, String, api_name: :reservationId, nil?: true
177
+
178
+ # @!attribute resource_id
179
+ # The resource ID this event is scoped to
180
+ #
181
+ # @return [String, nil]
182
+ required :resource_id, String, api_name: :resourceId, nil?: true
183
+
184
+ # @!attribute timestamp
185
+ # The timestamp when the event occurred
186
+ #
187
+ # @return [Time]
188
+ required :timestamp, Time
189
+
190
+ # @!method initialize(amount:, credit_currency_id:, credit_grant_id:, customer_id:, event_id:, event_type:, feature_id:, reservation_id:, resource_id:, timestamp:)
191
+ # Some parameter documentations has been truncated, see
192
+ # {Stigg::Models::V1::CreditListLedgerResponse::Breakdown} for more details.
193
+ #
194
+ # @param amount [Float] The amount of the ledger event. Reservation events carry their net effect on the
195
+ #
196
+ # @param credit_currency_id [String] The credit currency ID
197
+ #
198
+ # @param credit_grant_id [String] The credit grant ID associated with this event
199
+ #
200
+ # @param customer_id [String] The customer ID this event belongs to
201
+ #
202
+ # @param event_id [String, nil] The unique event identifier
203
+ #
204
+ # @param event_type [Symbol, Stigg::Models::V1::CreditListLedgerResponse::Breakdown::EventType] The type of credit event
205
+ #
206
+ # @param feature_id [String, nil] The feature ID associated with this event
207
+ #
208
+ # @param reservation_id [String, nil] The credit reservation this event belongs to
209
+ #
210
+ # @param resource_id [String, nil] The resource ID this event is scoped to
211
+ #
212
+ # @param timestamp [Time] The timestamp when the event occurred
213
+
214
+ # The type of credit event
215
+ #
216
+ # @see Stigg::Models::V1::CreditListLedgerResponse::Breakdown#event_type
217
+ module EventType
218
+ extend Stigg::Internal::Type::Enum
219
+
220
+ CREDITS_GRANTED = :CREDITS_GRANTED
221
+ CREDITS_EXPIRED = :CREDITS_EXPIRED
222
+ CREDITS_CONSUMED = :CREDITS_CONSUMED
223
+ CREDITS_VOIDED = :CREDITS_VOIDED
224
+ CREDITS_UPDATED = :CREDITS_UPDATED
225
+ CREDITS_CONSUMPTION_TRANSFER_SOURCE = :CREDITS_CONSUMPTION_TRANSFER_SOURCE
226
+ CREDITS_CONSUMPTION_TRANSFER_TARGET = :CREDITS_CONSUMPTION_TRANSFER_TARGET
227
+ CREDITS_RESERVED = :CREDITS_RESERVED
228
+ CREDITS_RESERVATION_RELEASED = :CREDITS_RESERVATION_RELEASED
229
+ CREDITS_RESERVATION_EXPIRED = :CREDITS_RESERVATION_EXPIRED
230
+
231
+ # @!method self.values
232
+ # @return [Array<Symbol>]
233
+ end
234
+ end
235
+
85
236
  # The type of credit event
86
237
  #
87
238
  # @see Stigg::Models::V1::CreditListLedgerResponse#event_type
@@ -95,6 +246,9 @@ module Stigg
95
246
  CREDITS_UPDATED = :CREDITS_UPDATED
96
247
  CREDITS_CONSUMPTION_TRANSFER_SOURCE = :CREDITS_CONSUMPTION_TRANSFER_SOURCE
97
248
  CREDITS_CONSUMPTION_TRANSFER_TARGET = :CREDITS_CONSUMPTION_TRANSFER_TARGET
249
+ CREDITS_RESERVED = :CREDITS_RESERVED
250
+ CREDITS_RESERVATION_RELEASED = :CREDITS_RESERVATION_RELEASED
251
+ CREDITS_RESERVATION_EXPIRED = :CREDITS_RESERVATION_EXPIRED
98
252
 
99
253
  # @!method self.values
100
254
  # @return [Array<Symbol>]
@@ -0,0 +1,76 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ module Credits
7
+ # @see Stigg::Resources::V1::Credits::Reservations#release
8
+ class ReservationReleaseParams < Stigg::Internal::Type::BaseModel
9
+ extend Stigg::Internal::Type::RequestParameters::Converter
10
+ include Stigg::Internal::Type::RequestParameters
11
+
12
+ # @!attribute reservation_id
13
+ #
14
+ # @return [String]
15
+ required :reservation_id, String
16
+
17
+ # @!attribute consumed_amount
18
+ # The amount of credits to consume at release. Up to the reserved amount is
19
+ # charged to the credits that backed the reservation; the rest returns to the
20
+ # balance, and any amount above the reservation is consumed normally.
21
+ #
22
+ # @return [Float]
23
+ required :consumed_amount, Float, api_name: :consumedAmount
24
+
25
+ # @!attribute currency_id
26
+ # The credit currency of the reservation
27
+ #
28
+ # @return [String]
29
+ required :currency_id, String, api_name: :currencyId
30
+
31
+ # @!attribute customer_id
32
+ # The customer the reservation was made for
33
+ #
34
+ # @return [String]
35
+ required :customer_id, String, api_name: :customerId
36
+
37
+ # @!attribute resource_id
38
+ # The resource the reservation was made for, if any
39
+ #
40
+ # @return [String, nil]
41
+ optional :resource_id, String, api_name: :resourceId
42
+
43
+ # @!attribute x_account_id
44
+ #
45
+ # @return [String, nil]
46
+ optional :x_account_id, String
47
+
48
+ # @!attribute x_environment_id
49
+ #
50
+ # @return [String, nil]
51
+ optional :x_environment_id, String
52
+
53
+ # @!method initialize(reservation_id:, consumed_amount:, currency_id:, customer_id:, resource_id: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
54
+ # Some parameter documentations has been truncated, see
55
+ # {Stigg::Models::V1::Credits::ReservationReleaseParams} for more details.
56
+ #
57
+ # @param reservation_id [String]
58
+ #
59
+ # @param consumed_amount [Float] The amount of credits to consume at release. Up to the reserved amount is charge
60
+ #
61
+ # @param currency_id [String] The credit currency of the reservation
62
+ #
63
+ # @param customer_id [String] The customer the reservation was made for
64
+ #
65
+ # @param resource_id [String] The resource the reservation was made for, if any
66
+ #
67
+ # @param x_account_id [String]
68
+ #
69
+ # @param x_environment_id [String]
70
+ #
71
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
72
+ end
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,165 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ module Credits
7
+ # @see Stigg::Resources::V1::Credits::Reservations#release
8
+ class ReservationReleaseResponse < Stigg::Internal::Type::BaseModel
9
+ # @!attribute data
10
+ # Result of releasing a credit reservation
11
+ #
12
+ # @return [Stigg::Models::V1::Credits::ReservationReleaseResponse::Data]
13
+ required :data, -> { Stigg::Models::V1::Credits::ReservationReleaseResponse::Data }
14
+
15
+ # @!method initialize(data:)
16
+ # Response object
17
+ #
18
+ # @param data [Stigg::Models::V1::Credits::ReservationReleaseResponse::Data] Result of releasing a credit reservation
19
+
20
+ # @see Stigg::Models::V1::Credits::ReservationReleaseResponse#data
21
+ class Data < Stigg::Internal::Type::BaseModel
22
+ # @!attribute credit
23
+ # The optimistic credit balance after the release
24
+ #
25
+ # @return [Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Credit, nil]
26
+ required :credit, -> { Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Credit }, nil?: true
27
+
28
+ # @!attribute reservation
29
+ # The released reservation
30
+ #
31
+ # @return [Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Reservation]
32
+ required :reservation, -> { Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Reservation }
33
+
34
+ # @!method initialize(credit:, reservation:)
35
+ # Result of releasing a credit reservation
36
+ #
37
+ # @param credit [Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Credit, nil] The optimistic credit balance after the release
38
+ #
39
+ # @param reservation [Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Reservation] The released reservation
40
+
41
+ # @see Stigg::Models::V1::Credits::ReservationReleaseResponse::Data#credit
42
+ class Credit < Stigg::Internal::Type::BaseModel
43
+ # @!attribute currency_id
44
+ # The credit currency identifier
45
+ #
46
+ # @return [String]
47
+ required :currency_id, String, api_name: :currencyId
48
+
49
+ # @!attribute current_usage
50
+ # The wallet's total consumed credits for this currency (optimistic — includes
51
+ # not-yet-reconciled usage), shared across every feature that draws on the
52
+ # currency. This is the running balance, not this call's deduction — see
53
+ # `consumed` for that.
54
+ #
55
+ # @return [Float]
56
+ required :current_usage, Float, api_name: :currentUsage
57
+
58
+ # @!attribute timestamp
59
+ # The grant-version timestamp of this balance, used by the SDK for last-write-wins
60
+ # reconciliation
61
+ #
62
+ # @return [Time]
63
+ required :timestamp, Time
64
+
65
+ # @!attribute usage_limit
66
+ # The total credits granted
67
+ #
68
+ # @return [Float]
69
+ required :usage_limit, Float, api_name: :usageLimit
70
+
71
+ # @!attribute usage_period_end
72
+ # End of the current credit grant period (when recurring credits reset), if
73
+ # applicable
74
+ #
75
+ # @return [Time, nil]
76
+ optional :usage_period_end, Time, api_name: :usagePeriodEnd, nil?: true
77
+
78
+ # @!method initialize(currency_id:, current_usage:, timestamp:, usage_limit:, usage_period_end: nil)
79
+ # Some parameter documentations has been truncated, see
80
+ # {Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Credit} for more
81
+ # details.
82
+ #
83
+ # The optimistic credit balance after the release
84
+ #
85
+ # @param currency_id [String] The credit currency identifier
86
+ #
87
+ # @param current_usage [Float] The wallet's total consumed credits for this currency (optimistic — includes not
88
+ #
89
+ # @param timestamp [Time] The grant-version timestamp of this balance, used by the SDK for last-write-wins
90
+ #
91
+ # @param usage_limit [Float] The total credits granted
92
+ #
93
+ # @param usage_period_end [Time, nil] End of the current credit grant period (when recurring credits reset), if applic
94
+ end
95
+
96
+ # @see Stigg::Models::V1::Credits::ReservationReleaseResponse::Data#reservation
97
+ class Reservation < Stigg::Internal::Type::BaseModel
98
+ # @!attribute id
99
+ # The client-provided reservation ID.
100
+ #
101
+ # @return [String]
102
+ required :id, String
103
+
104
+ # @!attribute amount
105
+ # The amount of credits held.
106
+ #
107
+ # @return [Float]
108
+ required :amount, Float
109
+
110
+ # @!attribute consumed_amount
111
+ # The amount consumed at release
112
+ #
113
+ # @return [Float, nil]
114
+ required :consumed_amount, Float, api_name: :consumedAmount, nil?: true
115
+
116
+ # @!attribute expires_at
117
+ # When the reservation expires. Unreleased credits return to the balance at this
118
+ # time.
119
+ #
120
+ # @return [Time]
121
+ required :expires_at, Time, api_name: :expiresAt
122
+
123
+ # @!attribute status
124
+ # The status of the reservation.
125
+ #
126
+ # @return [Symbol, Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Reservation::Status]
127
+ required :status,
128
+ enum: -> { Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Reservation::Status }
129
+
130
+ # @!method initialize(id:, amount:, consumed_amount:, expires_at:, status:)
131
+ # Some parameter documentations has been truncated, see
132
+ # {Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Reservation} for
133
+ # more details.
134
+ #
135
+ # The released reservation
136
+ #
137
+ # @param id [String] The client-provided reservation ID.
138
+ #
139
+ # @param amount [Float] The amount of credits held.
140
+ #
141
+ # @param consumed_amount [Float, nil] The amount consumed at release
142
+ #
143
+ # @param expires_at [Time] When the reservation expires. Unreleased credits return to the balance at this t
144
+ #
145
+ # @param status [Symbol, Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Reservation::Status] The status of the reservation.
146
+
147
+ # The status of the reservation.
148
+ #
149
+ # @see Stigg::Models::V1::Credits::ReservationReleaseResponse::Data::Reservation#status
150
+ module Status
151
+ extend Stigg::Internal::Type::Enum
152
+
153
+ ACTIVE = :ACTIVE
154
+ RELEASED = :RELEASED
155
+
156
+ # @!method self.values
157
+ # @return [Array<Symbol>]
158
+ end
159
+ end
160
+ end
161
+ end
162
+ end
163
+ end
164
+ end
165
+ end
@@ -39,6 +39,40 @@ module Stigg
39
39
  # @return [Array<String>, nil]
40
40
  optional :requested_values, Stigg::Internal::Type::ArrayOf[String]
41
41
 
42
+ # @!attribute reservation_expires_at
43
+ # When the reservation expires (ISO 8601, at most 24 hours ahead). Mutually
44
+ # exclusive with `reservationTtlSeconds`.
45
+ #
46
+ # @return [Time, nil]
47
+ optional :reservation_expires_at, Time
48
+
49
+ # @!attribute reservation_id
50
+ # Client-provided reservation ID, required with `reserveAmount`. Retry with the
51
+ # same ID to get the same result; reuse with different parameters is a conflict.
52
+ #
53
+ # @return [String, nil]
54
+ optional :reservation_id, String
55
+
56
+ # @!attribute reservation_metadata
57
+ # JSON-encoded object of string values to attach to the reservation.
58
+ #
59
+ # @return [String, nil]
60
+ optional :reservation_metadata, String
61
+
62
+ # @!attribute reservation_ttl_seconds
63
+ # How long the reservation holds the credits, in seconds (1–86400, default 3600).
64
+ # Mutually exclusive with `reservationExpiresAt`.
65
+ #
66
+ # @return [Integer, nil]
67
+ optional :reservation_ttl_seconds, Integer
68
+
69
+ # @!attribute reserve_amount
70
+ # Credits to reserve (credit entitlements only). The check is decided and the
71
+ # credits held atomically; `requestedUsage` is ignored.
72
+ #
73
+ # @return [Float, nil]
74
+ optional :reserve_amount, Float
75
+
42
76
  # @!attribute resource_id
43
77
  # Resource ID to scope the entitlement check to a specific resource
44
78
  #
@@ -55,7 +89,7 @@ module Stigg
55
89
  # @return [String, nil]
56
90
  optional :x_environment_id, String
57
91
 
58
- # @!method initialize(id:, currency_id: nil, feature_id: nil, requested_usage: nil, requested_values: nil, resource_id: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
92
+ # @!method initialize(id:, currency_id: nil, feature_id: nil, requested_usage: nil, requested_values: nil, reservation_expires_at: nil, reservation_id: nil, reservation_metadata: nil, reservation_ttl_seconds: nil, reserve_amount: nil, resource_id: nil, x_account_id: nil, x_environment_id: nil, request_options: {})
59
93
  # Some parameter documentations has been truncated, see
60
94
  # {Stigg::Models::V1::CustomerCheckEntitlementParams} for more details.
61
95
  #
@@ -69,6 +103,16 @@ module Stigg
69
103
  #
70
104
  # @param requested_values [Array<String>] Requested values to evaluate against allowed values (enum features only)
71
105
  #
106
+ # @param reservation_expires_at [Time] When the reservation expires (ISO 8601, at most 24 hours ahead). Mutually exclus
107
+ #
108
+ # @param reservation_id [String] Client-provided reservation ID, required with `reserveAmount`. Retry with the sa
109
+ #
110
+ # @param reservation_metadata [String] JSON-encoded object of string values to attach to the reservation.
111
+ #
112
+ # @param reservation_ttl_seconds [Integer] How long the reservation holds the credits, in seconds (1–86400, default 3600).
113
+ #
114
+ # @param reserve_amount [Float] Credits to reserve (credit entitlements only). The check is decided and the cred
115
+ #
72
116
  # @param resource_id [String] Resource ID to scope the entitlement check to a specific resource
73
117
  #
74
118
  # @param x_account_id [String]