stigg 0.1.0.pre.alpha.31 → 0.1.0.pre.alpha.32

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: 1f76677364b48fa19978b6c1be54ce03e13b82eed41369b2f464afb9b702cb18
4
- data.tar.gz: cff78ceace6922608322816eda5180687139d9259e5ac9d1eae15e8a3d2ba6a7
3
+ metadata.gz: 1970872531257b548e6bc9d969c71559ccff3069ed072a557c6f889f04f2bf6f
4
+ data.tar.gz: ff0dbeaec065ffa03567b2d51146b431ecb95887980cd7d3200a8134fe822c2b
5
5
  SHA512:
6
- metadata.gz: 988742a7d39b4841dd00dc4d4501a359f1ad8017a0934be4961dbe9e8dbd90a9e6aa714a05e3bff8f6db321385ea183a0eb107637bdca4f32543d3fae9d6be32
7
- data.tar.gz: 04be3076ce1c92172b63e2394073c25b2022b2fd27574073beb1f600c2b8a4eab9bb2ce896ddf22229222220b8b89a364096950b6a481c7021edbe97fbe5a83d
6
+ metadata.gz: 97211f61f9da955119dd1d8802244c12105db6795f092018782a955e73d5ba4ddd4bd30d3d516160b1cb0a3a5e4e269525872aeb03e0c1676f3f040797de715e
7
+ data.tar.gz: 7b2cfa97d3b7251232c3de69f37b7c0dafd5b5a8f930b48e24f504a3511fccabb77a13641ef292876de8b445c8d1d9f07b0952220fef645ead16fd7c42b567b2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.32 (2026-05-06)
4
+
5
+ Full Changelog: [v0.1.0-alpha.31...v0.1.0-alpha.32](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-alpha.31...v0.1.0-alpha.32)
6
+
7
+ ### Features
8
+
9
+ * **api:** add check_entitlement method to customers ([9674756](https://github.com/stiggio/stigg-ruby/commit/9674756aad61c7a93dc4eb27947563c35eec46a5))
10
+
11
+
12
+ ### Chores
13
+
14
+ * **internal:** regenerate SDK with no functional changes ([c50162d](https://github.com/stiggio/stigg-ruby/commit/c50162dea06451169a1edede170c995999c6d4fb))
15
+
3
16
  ## 0.1.0-alpha.31 (2026-04-29)
4
17
 
5
18
  Full Changelog: [v0.1.0-alpha.30...v0.1.0-alpha.31](https://github.com/stiggio/stigg-ruby/compare/v0.1.0-alpha.30...v0.1.0-alpha.31)
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.alpha.31"
27
+ gem "stigg", "~> 0.1.0.pre.alpha.32"
28
28
  ```
29
29
 
30
30
  <!-- x-release-please-end -->
data/lib/stigg/client.rb CHANGED
@@ -21,6 +21,9 @@ module Stigg
21
21
  # @return [Stigg::Resources::V1]
22
22
  attr_reader :v1
23
23
 
24
+ # @return [Stigg::Resources::Internal]
25
+ attr_reader :internal
26
+
24
27
  # @api private
25
28
  #
26
29
  # @return [Hash{String=>String}]
@@ -81,6 +84,7 @@ module Stigg
81
84
  )
82
85
 
83
86
  @v1 = Stigg::Resources::V1.new(client: self)
87
+ @internal = Stigg::Resources::Internal.new(client: self)
84
88
  end
85
89
  end
86
90
  end
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ # @see Stigg::Resources::V1::Customers#check_entitlement
7
+ class CustomerCheckEntitlementParams < Stigg::Internal::Type::BaseModel
8
+ extend Stigg::Internal::Type::RequestParameters::Converter
9
+ include Stigg::Internal::Type::RequestParameters
10
+
11
+ # @!attribute id
12
+ #
13
+ # @return [String]
14
+ required :id, String
15
+
16
+ # @!attribute currency_id
17
+ # Currency ID (refId) to check for credit entitlements. Mutually exclusive with
18
+ # `featureId`.
19
+ #
20
+ # @return [String, nil]
21
+ optional :currency_id, String
22
+
23
+ # @!attribute feature_id
24
+ # Feature ID (refId) to check. Mutually exclusive with `currencyId`.
25
+ #
26
+ # @return [String, nil]
27
+ optional :feature_id, String
28
+
29
+ # @!attribute requested_usage
30
+ # Requested usage amount to evaluate against the entitlement limit (numeric
31
+ # features only)
32
+ #
33
+ # @return [Integer, nil]
34
+ optional :requested_usage, Integer
35
+
36
+ # @!attribute requested_values
37
+ # Requested values to evaluate against allowed values (enum features only)
38
+ #
39
+ # @return [Array<String>, nil]
40
+ optional :requested_values, Stigg::Internal::Type::ArrayOf[String]
41
+
42
+ # @!attribute resource_id
43
+ # Resource ID to scope the entitlement check to a specific resource
44
+ #
45
+ # @return [String, nil]
46
+ optional :resource_id, String
47
+
48
+ # @!method initialize(id:, currency_id: nil, feature_id: nil, requested_usage: nil, requested_values: nil, resource_id: nil, request_options: {})
49
+ # Some parameter documentations has been truncated, see
50
+ # {Stigg::Models::V1::CustomerCheckEntitlementParams} for more details.
51
+ #
52
+ # @param id [String]
53
+ #
54
+ # @param currency_id [String] Currency ID (refId) to check for credit entitlements. Mutually exclusive with `f
55
+ #
56
+ # @param feature_id [String] Feature ID (refId) to check. Mutually exclusive with `currencyId`.
57
+ #
58
+ # @param requested_usage [Integer] Requested usage amount to evaluate against the entitlement limit (numeric featur
59
+ #
60
+ # @param requested_values [Array<String>] Requested values to evaluate against allowed values (enum features only)
61
+ #
62
+ # @param resource_id [String] Resource ID to scope the entitlement check to a specific resource
63
+ #
64
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}]
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,409 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Models
5
+ module V1
6
+ # @see Stigg::Resources::V1::Customers#check_entitlement
7
+ class CustomerCheckEntitlementResponse < Stigg::Internal::Type::BaseModel
8
+ # @!attribute data
9
+ #
10
+ # @return [Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit]
11
+ required :data, union: -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data }
12
+
13
+ # @!method initialize(data:)
14
+ # Response object
15
+ #
16
+ # @param data [Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit]
17
+
18
+ # @see Stigg::Models::V1::CustomerCheckEntitlementResponse#data
19
+ module Data
20
+ extend Stigg::Internal::Type::Union
21
+
22
+ discriminator :type
23
+
24
+ variant :FEATURE, -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature }
25
+
26
+ variant :CREDIT, -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit }
27
+
28
+ class Feature < Stigg::Internal::Type::BaseModel
29
+ # @!attribute access_denied_reason
30
+ #
31
+ # @return [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::AccessDeniedReason, nil]
32
+ required :access_denied_reason,
33
+ enum: -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::AccessDeniedReason },
34
+ api_name: :accessDeniedReason,
35
+ nil?: true
36
+
37
+ # @!attribute is_granted
38
+ #
39
+ # @return [Boolean]
40
+ required :is_granted, Stigg::Internal::Type::Boolean, api_name: :isGranted
41
+
42
+ # @!attribute type
43
+ #
44
+ # @return [Symbol, :FEATURE]
45
+ required :type, const: :FEATURE
46
+
47
+ # @!attribute current_usage
48
+ #
49
+ # @return [Float, nil]
50
+ optional :current_usage, Float, api_name: :currentUsage
51
+
52
+ # @!attribute entitlement_updated_at
53
+ # Timestamp of the last update to the entitlement grant or configuration.
54
+ #
55
+ # @return [Time, nil]
56
+ optional :entitlement_updated_at, Time, api_name: :entitlementUpdatedAt
57
+
58
+ # @!attribute feature
59
+ #
60
+ # @return [Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature, nil]
61
+ optional :feature, -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature }
62
+
63
+ # @!attribute has_unlimited_usage
64
+ #
65
+ # @return [Boolean, nil]
66
+ optional :has_unlimited_usage, Stigg::Internal::Type::Boolean, api_name: :hasUnlimitedUsage
67
+
68
+ # @!attribute reset_period
69
+ #
70
+ # @return [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::ResetPeriod, nil]
71
+ optional :reset_period,
72
+ enum: -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::ResetPeriod },
73
+ api_name: :resetPeriod,
74
+ nil?: true
75
+
76
+ # @!attribute usage_limit
77
+ #
78
+ # @return [Float, nil]
79
+ optional :usage_limit, Float, api_name: :usageLimit, nil?: true
80
+
81
+ # @!attribute usage_period_anchor
82
+ # The anchor for calculating the usage period for metered entitlements with a
83
+ # reset period configured
84
+ #
85
+ # @return [Time, nil]
86
+ optional :usage_period_anchor, Time, api_name: :usagePeriodAnchor
87
+
88
+ # @!attribute usage_period_end
89
+ # The end date of the usage period for metered entitlements with a reset period
90
+ # configured
91
+ #
92
+ # @return [Time, nil]
93
+ optional :usage_period_end, Time, api_name: :usagePeriodEnd
94
+
95
+ # @!attribute usage_period_start
96
+ # The start date of the usage period for metered entitlements with a reset period
97
+ # configured
98
+ #
99
+ # @return [Time, nil]
100
+ optional :usage_period_start, Time, api_name: :usagePeriodStart
101
+
102
+ # @!attribute valid_until
103
+ # The next time the entitlement should be recalculated
104
+ #
105
+ # @return [Time, nil]
106
+ optional :valid_until, Time, api_name: :validUntil
107
+
108
+ # @!method initialize(access_denied_reason:, is_granted:, 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)
109
+ # Some parameter documentations has been truncated, see
110
+ # {Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature} for more
111
+ # details.
112
+ #
113
+ # @param access_denied_reason [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::AccessDeniedReason, nil]
114
+ #
115
+ # @param is_granted [Boolean]
116
+ #
117
+ # @param current_usage [Float]
118
+ #
119
+ # @param entitlement_updated_at [Time] Timestamp of the last update to the entitlement grant or configuration.
120
+ #
121
+ # @param feature [Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature]
122
+ #
123
+ # @param has_unlimited_usage [Boolean]
124
+ #
125
+ # @param reset_period [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::ResetPeriod, nil]
126
+ #
127
+ # @param usage_limit [Float, nil]
128
+ #
129
+ # @param usage_period_anchor [Time] The anchor for calculating the usage period for metered entitlements with a rese
130
+ #
131
+ # @param usage_period_end [Time] The end date of the usage period for metered entitlements with a reset period co
132
+ #
133
+ # @param usage_period_start [Time] The start date of the usage period for metered entitlements with a reset period
134
+ #
135
+ # @param valid_until [Time] The next time the entitlement should be recalculated
136
+ #
137
+ # @param type [Symbol, :FEATURE]
138
+
139
+ # @see Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature#access_denied_reason
140
+ module AccessDeniedReason
141
+ extend Stigg::Internal::Type::Enum
142
+
143
+ FEATURE_NOT_FOUND = :FeatureNotFound
144
+ CUSTOMER_NOT_FOUND = :CustomerNotFound
145
+ CUSTOMER_IS_ARCHIVED = :CustomerIsArchived
146
+ CUSTOMER_RESOURCE_NOT_FOUND = :CustomerResourceNotFound
147
+ NO_ACTIVE_SUBSCRIPTION = :NoActiveSubscription
148
+ NO_FEATURE_ENTITLEMENT_IN_SUBSCRIPTION = :NoFeatureEntitlementInSubscription
149
+ REQUESTED_USAGE_EXCEEDING_LIMIT = :RequestedUsageExceedingLimit
150
+ REQUESTED_VALUES_MISMATCH = :RequestedValuesMismatch
151
+ BUDGET_EXCEEDED = :BudgetExceeded
152
+ UNKNOWN = :Unknown
153
+ FEATURE_TYPE_MISMATCH = :FeatureTypeMismatch
154
+ REVOKED = :Revoked
155
+ INSUFFICIENT_CREDITS = :InsufficientCredits
156
+ ENTITLEMENT_NOT_FOUND = :EntitlementNotFound
157
+
158
+ # @!method self.values
159
+ # @return [Array<Symbol>]
160
+ end
161
+
162
+ # @see Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature#feature
163
+ class Feature < Stigg::Internal::Type::BaseModel
164
+ # @!attribute id
165
+ # The unique reference ID of the entitlement.
166
+ #
167
+ # @return [String]
168
+ required :id, String
169
+
170
+ # @!attribute display_name
171
+ # The human-readable name of the entitlement, shown in UI elements.
172
+ #
173
+ # @return [String]
174
+ required :display_name, String, api_name: :displayName
175
+
176
+ # @!attribute feature_status
177
+ # The current status of the feature.
178
+ #
179
+ # @return [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature::FeatureStatus]
180
+ required :feature_status,
181
+ enum: -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature::FeatureStatus },
182
+ api_name: :featureStatus
183
+
184
+ # @!attribute feature_type
185
+ # The type of feature associated with the entitlement.
186
+ #
187
+ # @return [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature::FeatureType]
188
+ required :feature_type,
189
+ enum: -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature::FeatureType },
190
+ api_name: :featureType
191
+
192
+ # @!method initialize(id:, display_name:, feature_status:, feature_type:)
193
+ # @param id [String] The unique reference ID of the entitlement.
194
+ #
195
+ # @param display_name [String] The human-readable name of the entitlement, shown in UI elements.
196
+ #
197
+ # @param feature_status [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature::FeatureStatus] The current status of the feature.
198
+ #
199
+ # @param feature_type [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature::FeatureType] The type of feature associated with the entitlement.
200
+
201
+ # The current status of the feature.
202
+ #
203
+ # @see Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature#feature_status
204
+ module FeatureStatus
205
+ extend Stigg::Internal::Type::Enum
206
+
207
+ NEW = :NEW
208
+ SUSPENDED = :SUSPENDED
209
+ ACTIVE = :ACTIVE
210
+
211
+ # @!method self.values
212
+ # @return [Array<Symbol>]
213
+ end
214
+
215
+ # The type of feature associated with the entitlement.
216
+ #
217
+ # @see Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature::Feature#feature_type
218
+ module FeatureType
219
+ extend Stigg::Internal::Type::Enum
220
+
221
+ BOOLEAN = :BOOLEAN
222
+ NUMBER = :NUMBER
223
+ ENUM = :ENUM
224
+
225
+ # @!method self.values
226
+ # @return [Array<Symbol>]
227
+ end
228
+ end
229
+
230
+ # @see Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature#reset_period
231
+ module ResetPeriod
232
+ extend Stigg::Internal::Type::Enum
233
+
234
+ YEAR = :YEAR
235
+ MONTH = :MONTH
236
+ WEEK = :WEEK
237
+ DAY = :DAY
238
+ HOUR = :HOUR
239
+
240
+ # @!method self.values
241
+ # @return [Array<Symbol>]
242
+ end
243
+ end
244
+
245
+ class Credit < Stigg::Internal::Type::BaseModel
246
+ # @!attribute access_denied_reason
247
+ #
248
+ # @return [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit::AccessDeniedReason, nil]
249
+ required :access_denied_reason,
250
+ enum: -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit::AccessDeniedReason },
251
+ api_name: :accessDeniedReason,
252
+ nil?: true
253
+
254
+ # @!attribute currency
255
+ # The currency associated with a credit entitlement.
256
+ #
257
+ # @return [Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit::Currency]
258
+ required :currency, -> { Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit::Currency }
259
+
260
+ # @!attribute current_usage
261
+ #
262
+ # @return [Float]
263
+ required :current_usage, Float, api_name: :currentUsage
264
+
265
+ # @!attribute is_granted
266
+ #
267
+ # @return [Boolean]
268
+ required :is_granted, Stigg::Internal::Type::Boolean, api_name: :isGranted
269
+
270
+ # @!attribute type
271
+ #
272
+ # @return [Symbol, :CREDIT]
273
+ required :type, const: :CREDIT
274
+
275
+ # @!attribute usage_limit
276
+ #
277
+ # @return [Float]
278
+ required :usage_limit, Float, api_name: :usageLimit
279
+
280
+ # @!attribute usage_updated_at
281
+ # Timestamp of the last update to the credit usage.
282
+ #
283
+ # @return [Time]
284
+ required :usage_updated_at, Time, api_name: :usageUpdatedAt
285
+
286
+ # @!attribute entitlement_updated_at
287
+ # Timestamp of the last update to the entitlement grant or configuration.
288
+ #
289
+ # @return [Time, nil]
290
+ optional :entitlement_updated_at, Time, api_name: :entitlementUpdatedAt
291
+
292
+ # @!attribute usage_period_end
293
+ # The end date of the current billing period for recurring credit grants.
294
+ #
295
+ # @return [Time, nil]
296
+ optional :usage_period_end, Time, api_name: :usagePeriodEnd
297
+
298
+ # @!attribute valid_until
299
+ # The next time the entitlement should be recalculated
300
+ #
301
+ # @return [Time, nil]
302
+ optional :valid_until, Time, api_name: :validUntil
303
+
304
+ # @!method initialize(access_denied_reason:, currency:, current_usage:, is_granted:, usage_limit:, usage_updated_at:, entitlement_updated_at: nil, usage_period_end: nil, valid_until: nil, type: :CREDIT)
305
+ # @param access_denied_reason [Symbol, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit::AccessDeniedReason, nil]
306
+ #
307
+ # @param currency [Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit::Currency] The currency associated with a credit entitlement.
308
+ #
309
+ # @param current_usage [Float]
310
+ #
311
+ # @param is_granted [Boolean]
312
+ #
313
+ # @param usage_limit [Float]
314
+ #
315
+ # @param usage_updated_at [Time] Timestamp of the last update to the credit usage.
316
+ #
317
+ # @param entitlement_updated_at [Time] Timestamp of the last update to the entitlement grant or configuration.
318
+ #
319
+ # @param usage_period_end [Time] The end date of the current billing period for recurring credit grants.
320
+ #
321
+ # @param valid_until [Time] The next time the entitlement should be recalculated
322
+ #
323
+ # @param type [Symbol, :CREDIT]
324
+
325
+ # @see Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit#access_denied_reason
326
+ module AccessDeniedReason
327
+ extend Stigg::Internal::Type::Enum
328
+
329
+ FEATURE_NOT_FOUND = :FeatureNotFound
330
+ CUSTOMER_NOT_FOUND = :CustomerNotFound
331
+ CUSTOMER_IS_ARCHIVED = :CustomerIsArchived
332
+ CUSTOMER_RESOURCE_NOT_FOUND = :CustomerResourceNotFound
333
+ NO_ACTIVE_SUBSCRIPTION = :NoActiveSubscription
334
+ NO_FEATURE_ENTITLEMENT_IN_SUBSCRIPTION = :NoFeatureEntitlementInSubscription
335
+ REQUESTED_USAGE_EXCEEDING_LIMIT = :RequestedUsageExceedingLimit
336
+ REQUESTED_VALUES_MISMATCH = :RequestedValuesMismatch
337
+ BUDGET_EXCEEDED = :BudgetExceeded
338
+ UNKNOWN = :Unknown
339
+ FEATURE_TYPE_MISMATCH = :FeatureTypeMismatch
340
+ REVOKED = :Revoked
341
+ INSUFFICIENT_CREDITS = :InsufficientCredits
342
+ ENTITLEMENT_NOT_FOUND = :EntitlementNotFound
343
+
344
+ # @!method self.values
345
+ # @return [Array<Symbol>]
346
+ end
347
+
348
+ # @see Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit#currency
349
+ class Currency < Stigg::Internal::Type::BaseModel
350
+ # @!attribute currency_id
351
+ # The unique identifier of the custom currency.
352
+ #
353
+ # @return [String]
354
+ required :currency_id, String, api_name: :currencyId
355
+
356
+ # @!attribute display_name
357
+ # The display name of the currency.
358
+ #
359
+ # @return [String]
360
+ required :display_name, String, api_name: :displayName
361
+
362
+ # @!attribute description
363
+ # A description of the currency.
364
+ #
365
+ # @return [String, nil]
366
+ optional :description, String, nil?: true
367
+
368
+ # @!attribute metadata
369
+ # Additional metadata associated with the currency.
370
+ #
371
+ # @return [Hash{Symbol=>String}, nil]
372
+ optional :metadata, Stigg::Internal::Type::HashOf[String], nil?: true
373
+
374
+ # @!attribute unit_plural
375
+ # The plural form of the currency unit.
376
+ #
377
+ # @return [String, nil]
378
+ optional :unit_plural, String, api_name: :unitPlural, nil?: true
379
+
380
+ # @!attribute unit_singular
381
+ # The singular form of the currency unit.
382
+ #
383
+ # @return [String, nil]
384
+ optional :unit_singular, String, api_name: :unitSingular, nil?: true
385
+
386
+ # @!method initialize(currency_id:, display_name:, description: nil, metadata: nil, unit_plural: nil, unit_singular: nil)
387
+ # The currency associated with a credit entitlement.
388
+ #
389
+ # @param currency_id [String] The unique identifier of the custom currency.
390
+ #
391
+ # @param display_name [String] The display name of the currency.
392
+ #
393
+ # @param description [String, nil] A description of the currency.
394
+ #
395
+ # @param metadata [Hash{Symbol=>String}, nil] Additional metadata associated with the currency.
396
+ #
397
+ # @param unit_plural [String, nil] The plural form of the currency unit.
398
+ #
399
+ # @param unit_singular [String, nil] The singular form of the currency unit.
400
+ end
401
+ end
402
+
403
+ # @!method self.variants
404
+ # @return [Array(Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Feature, Stigg::Models::V1::CustomerCheckEntitlementResponse::Data::Credit)]
405
+ end
406
+ end
407
+ end
408
+ end
409
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Resources
5
+ class Internal
6
+ class Beta
7
+ class EventQueues
8
+ # @api private
9
+ #
10
+ # @param client [Stigg::Client]
11
+ def initialize(client:)
12
+ @client = client
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Resources
5
+ class Internal
6
+ class Beta
7
+ # @return [Stigg::Resources::Internal::Beta::EventQueues]
8
+ attr_reader :event_queues
9
+
10
+ # @api private
11
+ #
12
+ # @param client [Stigg::Client]
13
+ def initialize(client:)
14
+ @client = client
15
+ @event_queues = Stigg::Resources::Internal::Beta::EventQueues.new(client: client)
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Stigg
4
+ module Resources
5
+ class Internal
6
+ # @return [Stigg::Resources::Internal::Beta]
7
+ attr_reader :beta
8
+
9
+ # @api private
10
+ #
11
+ # @param client [Stigg::Client]
12
+ def initialize(client:)
13
+ @client = client
14
+ @beta = Stigg::Resources::Internal::Beta.new(client: client)
15
+ end
16
+ end
17
+ end
18
+ end
@@ -134,6 +134,55 @@ module Stigg
134
134
  )
135
135
  end
136
136
 
137
+ # Some parameter documentations has been truncated, see
138
+ # {Stigg::Models::V1::CustomerCheckEntitlementParams} for more details.
139
+ #
140
+ # Checks a single entitlement (feature or credit) for a customer or resource.
141
+ # Supports `requestedUsage` and `requestedValues` to evaluate against limits or
142
+ # enum values.
143
+ #
144
+ # **Warning:** This REST API endpoint lacks built-in client-side caching, fallback
145
+ # mechanisms, and low-latency guarantees. It is not recommended for hot-path
146
+ # entitlement checks. For production use, consider using the Stigg Node Server SDK
147
+ # with caching or the Sidecar for low-latency cached responses.
148
+ #
149
+ # @overload check_entitlement(id, currency_id: nil, feature_id: nil, requested_usage: nil, requested_values: nil, resource_id: nil, request_options: {})
150
+ #
151
+ # @param id [String] The unique identifier of the entity
152
+ #
153
+ # @param currency_id [String] Currency ID (refId) to check for credit entitlements. Mutually exclusive with `f
154
+ #
155
+ # @param feature_id [String] Feature ID (refId) to check. Mutually exclusive with `currencyId`.
156
+ #
157
+ # @param requested_usage [Integer] Requested usage amount to evaluate against the entitlement limit (numeric featur
158
+ #
159
+ # @param requested_values [Array<String>] Requested values to evaluate against allowed values (enum features only)
160
+ #
161
+ # @param resource_id [String] Resource ID to scope the entitlement check to a specific resource
162
+ #
163
+ # @param request_options [Stigg::RequestOptions, Hash{Symbol=>Object}, nil]
164
+ #
165
+ # @return [Stigg::Models::V1::CustomerCheckEntitlementResponse]
166
+ #
167
+ # @see Stigg::Models::V1::CustomerCheckEntitlementParams
168
+ def check_entitlement(id, params = {})
169
+ parsed, options = Stigg::V1::CustomerCheckEntitlementParams.dump_request(params)
170
+ query = Stigg::Internal::Util.encode_query_params(parsed)
171
+ @client.request(
172
+ method: :get,
173
+ path: ["api/v1/customers/%1$s/entitlements/check", id],
174
+ query: query.transform_keys(
175
+ currency_id: "currencyId",
176
+ feature_id: "featureId",
177
+ requested_usage: "requestedUsage",
178
+ requested_values: "requestedValues",
179
+ resource_id: "resourceId"
180
+ ),
181
+ model: Stigg::Models::V1::CustomerCheckEntitlementResponse,
182
+ options: options
183
+ )
184
+ end
185
+
137
186
  # Imports multiple customers in bulk. Used for migrating customer data from
138
187
  # external systems.
139
188
  #
data/lib/stigg/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stigg
4
- VERSION = "0.1.0.pre.alpha.31"
4
+ VERSION = "0.1.0.pre.alpha.32"
5
5
  end
data/lib/stigg.rb CHANGED
@@ -80,6 +80,8 @@ require_relative "stigg/models/v1/coupon_list_response"
80
80
  require_relative "stigg/models/v1/coupon_retrieve_params"
81
81
  require_relative "stigg/models/v1/coupon_update_coupon_params"
82
82
  require_relative "stigg/models/v1/customer_archive_params"
83
+ require_relative "stigg/models/v1/customer_check_entitlement_params"
84
+ require_relative "stigg/models/v1/customer_check_entitlement_response"
83
85
  require_relative "stigg/models/v1/customer_import_params"
84
86
  require_relative "stigg/models/v1/customer_import_response"
85
87
  require_relative "stigg/models/v1/customer_integration_response"
@@ -185,6 +187,9 @@ require_relative "stigg/models/v1/usage_history_response"
185
187
  require_relative "stigg/models/v1/usage_report_params"
186
188
  require_relative "stigg/models/v1/usage_report_response"
187
189
  require_relative "stigg/models"
190
+ require_relative "stigg/resources/internal"
191
+ require_relative "stigg/resources/internal/beta"
192
+ require_relative "stigg/resources/internal/beta/event_queues"
188
193
  require_relative "stigg/resources/v1"
189
194
  require_relative "stigg/resources/v1/addons"
190
195
  require_relative "stigg/resources/v1/addons/entitlements"