stigg 0.1.0.pre.beta.5 → 0.1.0.pre.beta.6

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: fb33dd085e92df5b9e882e960572d26107cf6e9af280da8f363352693c6334b3
4
- data.tar.gz: 7166fc3ca3ffb073aba4f449b02f2ce99fe27c9e20a1432294dc62b777875bdf
3
+ metadata.gz: 8306af9f56c2866b0124eb07cd3302843917ee34605e8a3e05fd4184f6ec8e2c
4
+ data.tar.gz: 31872e5d20a38209c1c554a08af61d49326dee4ca86ca95cd663d4ac05992e38
5
5
  SHA512:
6
- metadata.gz: 4e63697819fa56fd1c010609aaaea1af3f9c82a973d6c1e53863f42c69451f37cc8e5fc1e60dd9b0e41d103d82f5de7d6493f43d5e3b3dd2c122ef892f060d93
7
- data.tar.gz: 9c0292861b81f765d0ea15b40391590787559ee3591c42cc1e16a61a0312dcd69884bd5f4aef54fe7591ee4866bce4c0acdc36984915dd42ab5de6d405dc569c
6
+ metadata.gz: 1461061f7a986b6070ae919e702152e50dc75bb1adcf893175cc2c5476096334334de5e89eedefe19a78f51f398dd9f2aefcb48efda70da72675201b6f63d969
7
+ data.tar.gz: 408a782be980012bd23a8a8a2edef308b90a761fa2c57d2007b6cd52d1a7b7ccb47b22a590ad21b8cf6e3e66ca139aaf9944a7fd8939a6ff0dac86d190307bdd
data/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-beta.6 (2026-05-21)
4
+
5
+ Full Changelog: [v0.1.0-beta.5...v0.1.0-beta.6](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.5...v0.1.0-beta.6)
6
+
7
+ ### Features
8
+
9
+ * **api:** add beta customers entitlements check endpoint ([32d8d3e](https://github.com/stiggio/stigg-ruby/commit/32d8d3ef5170e3c760875e50a35d7e7c71e3d5ec))
10
+
11
+
12
+ ### Chores
13
+
14
+ * **internal:** regenerate SDK with no functional changes ([6214a4c](https://github.com/stiggio/stigg-ruby/commit/6214a4c2860f0fbe4fd3f00d0b8f4cee3c51799a))
15
+ * **internal:** regenerate SDK with no functional changes ([b422b48](https://github.com/stiggio/stigg-ruby/commit/b422b48ab03166551a1f462412b632ac139a51b9))
16
+
3
17
  ## 0.1.0-beta.5 (2026-05-18)
4
18
 
5
19
  Full Changelog: [v0.1.0-beta.4...v0.1.0-beta.5](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-beta.4...v0.1.0-beta.5)
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.5"
27
+ gem "stigg", "~> 0.1.0.pre.beta.6"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
@@ -0,0 +1,84 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ module Events
7
+ module Beta
8
+ module Customers
9
+ # @see Stigg::Resources::V1::Events::Beta::Customers::Entitlements#check
10
+ class EntitlementCheckParams < Stigg::Internal::Type::BaseModel
11
+ extend Stigg::Internal::Type::RequestParameters::Converter
12
+ include Stigg::Internal::Type::RequestParameters
13
+
14
+ # @!attribute id
15
+ #
16
+ # @return [String]
17
+ required :id, String
18
+
19
+ # @!attribute currency_id
20
+ # Currency ID (refId) to check for credit entitlements. Mutually exclusive with
21
+ # `featureId`.
22
+ #
23
+ # @return [String, nil]
24
+ optional :currency_id, String
25
+
26
+ # @!attribute dimensions
27
+ # Optional attribution map (e.g. `dimensions[userId]=u1`). When provided, the
28
+ # response includes a `chains` array with per-entity governance limits.
29
+ #
30
+ # @return [Hash{Symbol=>String}, nil]
31
+ optional :dimensions, Stigg::Internal::Type::HashOf[String]
32
+
33
+ # @!attribute feature_id
34
+ # Feature ID (refId) to check. Mutually exclusive with `currencyId`.
35
+ #
36
+ # @return [String, nil]
37
+ optional :feature_id, String
38
+
39
+ # @!attribute requested_usage
40
+ # Requested usage amount to evaluate against the entitlement limit (numeric
41
+ # features only)
42
+ #
43
+ # @return [Integer, nil]
44
+ optional :requested_usage, Integer
45
+
46
+ # @!attribute requested_values
47
+ # Requested values to evaluate against allowed values (enum features only)
48
+ #
49
+ # @return [Array<String>, nil]
50
+ optional :requested_values, Stigg::Internal::Type::ArrayOf[String]
51
+
52
+ # @!attribute resource_id
53
+ # Resource ID to scope the entitlement check to a specific resource
54
+ #
55
+ # @return [String, nil]
56
+ optional :resource_id, String
57
+
58
+ # @!method initialize(id:, currency_id: nil, dimensions: nil, feature_id: nil, requested_usage: nil, requested_values: nil, resource_id: nil, request_options: {})
59
+ # Some parameter documentations has been truncated, see
60
+ # {Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckParams} for more
61
+ # details.
62
+ #
63
+ # @param id [String]
64
+ #
65
+ # @param currency_id [String] Currency ID (refId) to check for credit entitlements. Mutually exclusive with `f
66
+ #
67
+ # @param dimensions [Hash{Symbol=>String}] Optional attribution map (e.g. `dimensions[userId]=u1`). When provided, the resp
68
+ #
69
+ # @param feature_id [String] Feature ID (refId) to check. Mutually exclusive with `currencyId`.
70
+ #
71
+ # @param requested_usage [Integer] Requested usage amount to evaluate against the entitlement limit (numeric featur
72
+ #
73
+ # @param requested_values [Array<String>] Requested values to evaluate against allowed values (enum features only)
74
+ #
75
+ # @param resource_id [String] Resource ID to scope the entitlement check to a specific resource
76
+ #
77
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,535 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ module Events
7
+ module Beta
8
+ module Customers
9
+ # @see Stigg::Resources::V1::Events::Beta::Customers::Entitlements#check
10
+ class EntitlementCheckResponse < Stigg::Internal::Type::BaseModel
11
+ # @!attribute data
12
+ # Feature entitlement with optional governance chains attached.
13
+ #
14
+ # @return [Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit]
15
+ required :data, union: -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data }
16
+
17
+ # @!method initialize(data:)
18
+ # Response object
19
+ #
20
+ # @param data [Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit] Feature entitlement with optional governance chains attached.
21
+
22
+ # Feature entitlement with optional governance chains attached.
23
+ #
24
+ # @see Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse#data
25
+ module Data
26
+ extend Stigg::Internal::Type::Union
27
+
28
+ discriminator :type
29
+
30
+ # Feature entitlement with optional governance chains attached.
31
+ variant :FEATURE,
32
+ -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature }
33
+
34
+ # Credit entitlement with optional governance chains attached.
35
+ variant :CREDIT, -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit }
36
+
37
+ class Feature < Stigg::Internal::Type::BaseModel
38
+ # @!attribute access_denied_reason
39
+ #
40
+ # @return [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::AccessDeniedReason, nil]
41
+ required :access_denied_reason,
42
+ enum: -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::AccessDeniedReason },
43
+ api_name: :accessDeniedReason,
44
+ nil?: true
45
+
46
+ # @!attribute is_granted
47
+ #
48
+ # @return [Boolean]
49
+ required :is_granted, Stigg::Internal::Type::Boolean, api_name: :isGranted
50
+
51
+ # @!attribute type
52
+ #
53
+ # @return [Symbol, :FEATURE]
54
+ required :type, const: :FEATURE
55
+
56
+ # @!attribute chains
57
+ # Per-entity rollups, one chain per resolved dimension. Omitted when dimensions
58
+ # was not provided.
59
+ #
60
+ # @return [Array<Array<Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Chain>>, nil]
61
+ optional :chains,
62
+ -> do
63
+ Stigg::Internal::Type::ArrayOf[
64
+ Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Chain]
65
+ ]
66
+ end
67
+
68
+ # @!attribute current_usage
69
+ #
70
+ # @return [Float, nil]
71
+ optional :current_usage, Float, api_name: :currentUsage
72
+
73
+ # @!attribute entitlement_updated_at
74
+ # Timestamp of the last update to the entitlement grant or configuration.
75
+ #
76
+ # @return [Time, nil]
77
+ optional :entitlement_updated_at, Time, api_name: :entitlementUpdatedAt
78
+
79
+ # @!attribute feature
80
+ #
81
+ # @return [Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature, nil]
82
+ optional :feature,
83
+ -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature }
84
+
85
+ # @!attribute has_unlimited_usage
86
+ #
87
+ # @return [Boolean, nil]
88
+ optional :has_unlimited_usage, Stigg::Internal::Type::Boolean, api_name: :hasUnlimitedUsage
89
+
90
+ # @!attribute reset_period
91
+ #
92
+ # @return [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::ResetPeriod, nil]
93
+ optional :reset_period,
94
+ enum: -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::ResetPeriod },
95
+ api_name: :resetPeriod,
96
+ nil?: true
97
+
98
+ # @!attribute usage_limit
99
+ #
100
+ # @return [Float, nil]
101
+ optional :usage_limit, Float, api_name: :usageLimit, nil?: true
102
+
103
+ # @!attribute usage_period_anchor
104
+ # The anchor for calculating the usage period for metered entitlements with a
105
+ # reset period configured
106
+ #
107
+ # @return [Time, nil]
108
+ optional :usage_period_anchor, Time, api_name: :usagePeriodAnchor
109
+
110
+ # @!attribute usage_period_end
111
+ # The end date of the usage period for metered entitlements with a reset period
112
+ # configured
113
+ #
114
+ # @return [Time, nil]
115
+ optional :usage_period_end, Time, api_name: :usagePeriodEnd
116
+
117
+ # @!attribute usage_period_start
118
+ # The start date of the usage period for metered entitlements with a reset period
119
+ # configured
120
+ #
121
+ # @return [Time, nil]
122
+ optional :usage_period_start, Time, api_name: :usagePeriodStart
123
+
124
+ # @!attribute valid_until
125
+ # The next time the entitlement should be recalculated
126
+ #
127
+ # @return [Time, nil]
128
+ optional :valid_until, Time, api_name: :validUntil
129
+
130
+ # @!method initialize(access_denied_reason:, is_granted:, chains: nil, current_usage: nil, entitlement_updated_at: nil, feature: nil, has_unlimited_usage: nil, reset_period: nil, usage_limit: nil, usage_period_anchor: nil, usage_period_end: nil, usage_period_start: nil, valid_until: nil, type: :FEATURE)
131
+ # Some parameter documentations has been truncated, see
132
+ # {Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature}
133
+ # for more details.
134
+ #
135
+ # Feature entitlement with optional governance chains attached.
136
+ #
137
+ # @param access_denied_reason [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::AccessDeniedReason, nil]
138
+ #
139
+ # @param is_granted [Boolean]
140
+ #
141
+ # @param chains [Array<Array<Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Chain>>] Per-entity rollups, one chain per resolved dimension. Omitted when dimensions wa
142
+ #
143
+ # @param current_usage [Float]
144
+ #
145
+ # @param entitlement_updated_at [Time] Timestamp of the last update to the entitlement grant or configuration.
146
+ #
147
+ # @param feature [Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature]
148
+ #
149
+ # @param has_unlimited_usage [Boolean]
150
+ #
151
+ # @param reset_period [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::ResetPeriod, nil]
152
+ #
153
+ # @param usage_limit [Float, nil]
154
+ #
155
+ # @param usage_period_anchor [Time] The anchor for calculating the usage period for metered entitlements with a rese
156
+ #
157
+ # @param usage_period_end [Time] The end date of the usage period for metered entitlements with a reset period co
158
+ #
159
+ # @param usage_period_start [Time] The start date of the usage period for metered entitlements with a reset period
160
+ #
161
+ # @param valid_until [Time] The next time the entitlement should be recalculated
162
+ #
163
+ # @param type [Symbol, :FEATURE]
164
+
165
+ # @see Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature#access_denied_reason
166
+ module AccessDeniedReason
167
+ extend Stigg::Internal::Type::Enum
168
+
169
+ FEATURE_NOT_FOUND = :FeatureNotFound
170
+ CUSTOMER_NOT_FOUND = :CustomerNotFound
171
+ CUSTOMER_IS_ARCHIVED = :CustomerIsArchived
172
+ CUSTOMER_RESOURCE_NOT_FOUND = :CustomerResourceNotFound
173
+ NO_ACTIVE_SUBSCRIPTION = :NoActiveSubscription
174
+ NO_FEATURE_ENTITLEMENT_IN_SUBSCRIPTION = :NoFeatureEntitlementInSubscription
175
+ REQUESTED_USAGE_EXCEEDING_LIMIT = :RequestedUsageExceedingLimit
176
+ REQUESTED_VALUES_MISMATCH = :RequestedValuesMismatch
177
+ BUDGET_EXCEEDED = :BudgetExceeded
178
+ UNKNOWN = :Unknown
179
+ FEATURE_TYPE_MISMATCH = :FeatureTypeMismatch
180
+ REVOKED = :Revoked
181
+ INSUFFICIENT_CREDITS = :InsufficientCredits
182
+ ENTITLEMENT_NOT_FOUND = :EntitlementNotFound
183
+
184
+ # @!method self.values
185
+ # @return [Array<Symbol>]
186
+ end
187
+
188
+ class Chain < Stigg::Internal::Type::BaseModel
189
+ # @!attribute current_usage
190
+ # Amount consumed by this entity in the current cadence period.
191
+ #
192
+ # @return [Float]
193
+ required :current_usage, Float, api_name: :currentUsage
194
+
195
+ # @!attribute entity_id
196
+ # External id of the entity within the customer.
197
+ #
198
+ # @return [String]
199
+ required :entity_id, String, api_name: :entityId
200
+
201
+ # @!attribute is_granted
202
+ # Whether this node alone permits the requested usage.
203
+ #
204
+ # @return [Boolean]
205
+ required :is_granted, Stigg::Internal::Type::Boolean, api_name: :isGranted
206
+
207
+ # @!attribute usage_limit
208
+ # Hard usage limit for this node; null when no assignment is configured.
209
+ #
210
+ # @return [Float, nil]
211
+ required :usage_limit, Float, api_name: :usageLimit, nil?: true
212
+
213
+ # @!method initialize(current_usage:, entity_id:, is_granted:, usage_limit:)
214
+ # Per-entity governance node — limit and current usage for a single resolved
215
+ # entity.
216
+ #
217
+ # @param current_usage [Float] Amount consumed by this entity in the current cadence period.
218
+ #
219
+ # @param entity_id [String] External id of the entity within the customer.
220
+ #
221
+ # @param is_granted [Boolean] Whether this node alone permits the requested usage.
222
+ #
223
+ # @param usage_limit [Float, nil] Hard usage limit for this node; null when no assignment is configured.
224
+ end
225
+
226
+ # @see Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature#feature
227
+ class Feature < Stigg::Internal::Type::BaseModel
228
+ # @!attribute id
229
+ # The unique reference ID of the entitlement.
230
+ #
231
+ # @return [String]
232
+ required :id, String
233
+
234
+ # @!attribute display_name
235
+ # The human-readable name of the entitlement, shown in UI elements.
236
+ #
237
+ # @return [String]
238
+ required :display_name, String, api_name: :displayName
239
+
240
+ # @!attribute feature_status
241
+ # The current status of the feature.
242
+ #
243
+ # @return [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature::FeatureStatus]
244
+ required :feature_status,
245
+ enum: -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature::FeatureStatus },
246
+ api_name: :featureStatus
247
+
248
+ # @!attribute feature_type
249
+ # The type of feature associated with the entitlement.
250
+ #
251
+ # @return [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature::FeatureType]
252
+ required :feature_type,
253
+ enum: -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature::FeatureType },
254
+ api_name: :featureType
255
+
256
+ # @!method initialize(id:, display_name:, feature_status:, feature_type:)
257
+ # @param id [String] The unique reference ID of the entitlement.
258
+ #
259
+ # @param display_name [String] The human-readable name of the entitlement, shown in UI elements.
260
+ #
261
+ # @param feature_status [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature::FeatureStatus] The current status of the feature.
262
+ #
263
+ # @param feature_type [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature::FeatureType] The type of feature associated with the entitlement.
264
+
265
+ # The current status of the feature.
266
+ #
267
+ # @see Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature#feature_status
268
+ module FeatureStatus
269
+ extend Stigg::Internal::Type::Enum
270
+
271
+ NEW = :NEW
272
+ SUSPENDED = :SUSPENDED
273
+ ACTIVE = :ACTIVE
274
+
275
+ # @!method self.values
276
+ # @return [Array<Symbol>]
277
+ end
278
+
279
+ # The type of feature associated with the entitlement.
280
+ #
281
+ # @see Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature::Feature#feature_type
282
+ module FeatureType
283
+ extend Stigg::Internal::Type::Enum
284
+
285
+ BOOLEAN = :BOOLEAN
286
+ NUMBER = :NUMBER
287
+ ENUM = :ENUM
288
+
289
+ # @!method self.values
290
+ # @return [Array<Symbol>]
291
+ end
292
+ end
293
+
294
+ # @see Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature#reset_period
295
+ module ResetPeriod
296
+ extend Stigg::Internal::Type::Enum
297
+
298
+ YEAR = :YEAR
299
+ MONTH = :MONTH
300
+ WEEK = :WEEK
301
+ DAY = :DAY
302
+ HOUR = :HOUR
303
+
304
+ # @!method self.values
305
+ # @return [Array<Symbol>]
306
+ end
307
+ end
308
+
309
+ class Credit < Stigg::Internal::Type::BaseModel
310
+ # @!attribute access_denied_reason
311
+ #
312
+ # @return [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit::AccessDeniedReason, nil]
313
+ required :access_denied_reason,
314
+ enum: -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit::AccessDeniedReason },
315
+ api_name: :accessDeniedReason,
316
+ nil?: true
317
+
318
+ # @!attribute currency
319
+ # The currency associated with a credit entitlement.
320
+ #
321
+ # @return [Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit::Currency]
322
+ required :currency,
323
+ -> { Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit::Currency }
324
+
325
+ # @!attribute current_usage
326
+ #
327
+ # @return [Float]
328
+ required :current_usage, Float, api_name: :currentUsage
329
+
330
+ # @!attribute is_granted
331
+ #
332
+ # @return [Boolean]
333
+ required :is_granted, Stigg::Internal::Type::Boolean, api_name: :isGranted
334
+
335
+ # @!attribute type
336
+ #
337
+ # @return [Symbol, :CREDIT]
338
+ required :type, const: :CREDIT
339
+
340
+ # @!attribute usage_limit
341
+ #
342
+ # @return [Float]
343
+ required :usage_limit, Float, api_name: :usageLimit
344
+
345
+ # @!attribute usage_updated_at
346
+ # Timestamp of the last update to the credit usage.
347
+ #
348
+ # @return [Time]
349
+ required :usage_updated_at, Time, api_name: :usageUpdatedAt
350
+
351
+ # @!attribute chains
352
+ # Per-entity rollups, one chain per resolved dimension. Omitted when dimensions
353
+ # was not provided.
354
+ #
355
+ # @return [Array<Array<Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit::Chain>>, nil]
356
+ optional :chains,
357
+ -> do
358
+ Stigg::Internal::Type::ArrayOf[
359
+ Stigg::Internal::Type::ArrayOf[Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit::Chain]
360
+ ]
361
+ end
362
+
363
+ # @!attribute entitlement_updated_at
364
+ # Timestamp of the last update to the entitlement grant or configuration.
365
+ #
366
+ # @return [Time, nil]
367
+ optional :entitlement_updated_at, Time, api_name: :entitlementUpdatedAt
368
+
369
+ # @!attribute usage_period_end
370
+ # The end date of the current billing period for recurring credit grants.
371
+ #
372
+ # @return [Time, nil]
373
+ optional :usage_period_end, Time, api_name: :usagePeriodEnd
374
+
375
+ # @!attribute valid_until
376
+ # The next time the entitlement should be recalculated
377
+ #
378
+ # @return [Time, nil]
379
+ optional :valid_until, Time, api_name: :validUntil
380
+
381
+ # @!method initialize(access_denied_reason:, currency:, current_usage:, is_granted:, usage_limit:, usage_updated_at:, chains: nil, entitlement_updated_at: nil, usage_period_end: nil, valid_until: nil, type: :CREDIT)
382
+ # Some parameter documentations has been truncated, see
383
+ # {Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit}
384
+ # for more details.
385
+ #
386
+ # Credit entitlement with optional governance chains attached.
387
+ #
388
+ # @param access_denied_reason [Symbol, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit::AccessDeniedReason, nil]
389
+ #
390
+ # @param currency [Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit::Currency] The currency associated with a credit entitlement.
391
+ #
392
+ # @param current_usage [Float]
393
+ #
394
+ # @param is_granted [Boolean]
395
+ #
396
+ # @param usage_limit [Float]
397
+ #
398
+ # @param usage_updated_at [Time] Timestamp of the last update to the credit usage.
399
+ #
400
+ # @param chains [Array<Array<Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit::Chain>>] Per-entity rollups, one chain per resolved dimension. Omitted when dimensions wa
401
+ #
402
+ # @param entitlement_updated_at [Time] Timestamp of the last update to the entitlement grant or configuration.
403
+ #
404
+ # @param usage_period_end [Time] The end date of the current billing period for recurring credit grants.
405
+ #
406
+ # @param valid_until [Time] The next time the entitlement should be recalculated
407
+ #
408
+ # @param type [Symbol, :CREDIT]
409
+
410
+ # @see Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit#access_denied_reason
411
+ module AccessDeniedReason
412
+ extend Stigg::Internal::Type::Enum
413
+
414
+ FEATURE_NOT_FOUND = :FeatureNotFound
415
+ CUSTOMER_NOT_FOUND = :CustomerNotFound
416
+ CUSTOMER_IS_ARCHIVED = :CustomerIsArchived
417
+ CUSTOMER_RESOURCE_NOT_FOUND = :CustomerResourceNotFound
418
+ NO_ACTIVE_SUBSCRIPTION = :NoActiveSubscription
419
+ NO_FEATURE_ENTITLEMENT_IN_SUBSCRIPTION = :NoFeatureEntitlementInSubscription
420
+ REQUESTED_USAGE_EXCEEDING_LIMIT = :RequestedUsageExceedingLimit
421
+ REQUESTED_VALUES_MISMATCH = :RequestedValuesMismatch
422
+ BUDGET_EXCEEDED = :BudgetExceeded
423
+ UNKNOWN = :Unknown
424
+ FEATURE_TYPE_MISMATCH = :FeatureTypeMismatch
425
+ REVOKED = :Revoked
426
+ INSUFFICIENT_CREDITS = :InsufficientCredits
427
+ ENTITLEMENT_NOT_FOUND = :EntitlementNotFound
428
+
429
+ # @!method self.values
430
+ # @return [Array<Symbol>]
431
+ end
432
+
433
+ # @see Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit#currency
434
+ class Currency < Stigg::Internal::Type::BaseModel
435
+ # @!attribute currency_id
436
+ # The unique identifier of the custom currency.
437
+ #
438
+ # @return [String]
439
+ required :currency_id, String, api_name: :currencyId
440
+
441
+ # @!attribute display_name
442
+ # The display name of the currency.
443
+ #
444
+ # @return [String]
445
+ required :display_name, String, api_name: :displayName
446
+
447
+ # @!attribute description
448
+ # A description of the currency.
449
+ #
450
+ # @return [String, nil]
451
+ optional :description, String, nil?: true
452
+
453
+ # @!attribute metadata
454
+ # Additional metadata associated with the currency.
455
+ #
456
+ # @return [Hash{Symbol=>String}, nil]
457
+ optional :metadata, Stigg::Internal::Type::HashOf[String], nil?: true
458
+
459
+ # @!attribute unit_plural
460
+ # The plural form of the currency unit.
461
+ #
462
+ # @return [String, nil]
463
+ optional :unit_plural, String, api_name: :unitPlural, nil?: true
464
+
465
+ # @!attribute unit_singular
466
+ # The singular form of the currency unit.
467
+ #
468
+ # @return [String, nil]
469
+ optional :unit_singular, String, api_name: :unitSingular, nil?: true
470
+
471
+ # @!method initialize(currency_id:, display_name:, description: nil, metadata: nil, unit_plural: nil, unit_singular: nil)
472
+ # The currency associated with a credit entitlement.
473
+ #
474
+ # @param currency_id [String] The unique identifier of the custom currency.
475
+ #
476
+ # @param display_name [String] The display name of the currency.
477
+ #
478
+ # @param description [String, nil] A description of the currency.
479
+ #
480
+ # @param metadata [Hash{Symbol=>String}, nil] Additional metadata associated with the currency.
481
+ #
482
+ # @param unit_plural [String, nil] The plural form of the currency unit.
483
+ #
484
+ # @param unit_singular [String, nil] The singular form of the currency unit.
485
+ end
486
+
487
+ class Chain < Stigg::Internal::Type::BaseModel
488
+ # @!attribute current_usage
489
+ # Amount consumed by this entity in the current cadence period.
490
+ #
491
+ # @return [Float]
492
+ required :current_usage, Float, api_name: :currentUsage
493
+
494
+ # @!attribute entity_id
495
+ # External id of the entity within the customer.
496
+ #
497
+ # @return [String]
498
+ required :entity_id, String, api_name: :entityId
499
+
500
+ # @!attribute is_granted
501
+ # Whether this node alone permits the requested usage.
502
+ #
503
+ # @return [Boolean]
504
+ required :is_granted, Stigg::Internal::Type::Boolean, api_name: :isGranted
505
+
506
+ # @!attribute usage_limit
507
+ # Hard usage limit for this node; null when no assignment is configured.
508
+ #
509
+ # @return [Float, nil]
510
+ required :usage_limit, Float, api_name: :usageLimit, nil?: true
511
+
512
+ # @!method initialize(current_usage:, entity_id:, is_granted:, usage_limit:)
513
+ # Per-entity governance node — limit and current usage for a single resolved
514
+ # entity.
515
+ #
516
+ # @param current_usage [Float] Amount consumed by this entity in the current cadence period.
517
+ #
518
+ # @param entity_id [String] External id of the entity within the customer.
519
+ #
520
+ # @param is_granted [Boolean] Whether this node alone permits the requested usage.
521
+ #
522
+ # @param usage_limit [Float, nil] Hard usage limit for this node; null when no assignment is configured.
523
+ end
524
+ end
525
+
526
+ # @!method self.variants
527
+ # @return [Array(Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Feature, Stigg::Models::V1::Events::Beta::Customers::EntitlementCheckResponse::Data::Credit)]
528
+ end
529
+ end
530
+ end
531
+ end
532
+ end
533
+ end
534
+ end
535
+ end