Skip to content

Commit

Permalink
feat: access entitlement value via featureKey (#1084)
Browse files Browse the repository at this point in the history
* feat: access entitlement value via featureKey

* fix: pr comments

* fix: balance tests

* fix: feature is required on entitlement
  • Loading branch information
GAlexIHU authored Jun 27, 2024
1 parent eaa76d6 commit bdd9baf
Show file tree
Hide file tree
Showing 23 changed files with 872 additions and 450 deletions.
385 changes: 213 additions & 172 deletions api/api.gen.go

Large diffs are not rendered by default.

385 changes: 213 additions & 172 deletions api/client/go/client.gen.go

Large diffs are not rendered by default.

30 changes: 23 additions & 7 deletions api/client/node/schemas/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,18 @@ export interface components {
EntitlementCreateSharedFields: {
/**
* @description The feature the subject is entitled to use.
* Either featureKey or featureId is required.
*
* @example example-feature-key
*/
featureKey?: string
/**
* @description The feature the subject is entitled to use.
* Either featureKey or featureId is required.
*
* @example 01ARZ3NDEKTSV4RRFFQ69G5FAV
*/
featureId: string
featureId?: string
/** @description Additional metadata for the feature. */
metadata?: {
[key: string]: string
Expand Down Expand Up @@ -777,18 +785,26 @@ export interface components {
expiration: components['schemas']['ExpirationPeriod']
/**
* Format: double
* @description The maximum amount of the grant that can be rolled over. Defaults to 0.
*
* - maxAmount = {original_amount} -> rollover original amount
* - maxAmount = 0 -> no rollover
* - maxAmount = 90 -> rollover 90 max
* @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset.
*
* If it's larger than 0 then the grant's balance will be the MAX(maxRollover, balance) + amount.
* Balance after the reset is calculated as:
* Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))
*
* @default 0
* @example 100
*/
maxRolloverAmount?: number
/**
* Format: double
* @description Grants are rolled over at reset, after which they can have a different balance compared to what they had before the reset.
*
* Balance after the reset is calculated as:
* Balance_After_Reset = MIN(MaxRolloverAmount, MAX(Balance_Before_Reset, MinRolloverAmount))
*
* @default 0
* @example 100
*/
minRolloverAmount?: number
/**
* @example {
* "stripePaymentId": "pi_4OrAkhLvyihio9p51h9iiFnB"
Expand Down
105 changes: 70 additions & 35 deletions api/client/python/src/openmeter/_operations/_operations.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bdd9baf

Please sign in to comment.