EntitlementsCatalog field in PublicPoliciesProduct (parity with TS / Rust / Python 0.3.0)
Mirrors keysat 0014 + the v0.3.0 cuts of the other three SDKs. New EntitlementDef type with Slug + Name + Description; PublicPoliciesProduct gains EntitlementsCatalog []EntitlementDef. SDK consumers' in-app tier pickers can render display names + tooltip descriptions instead of raw slugs. Empty slice on legacy products without a catalog. No breaking change.
This commit is contained in:
@@ -247,13 +247,25 @@ type PublicPolicy struct {
|
|||||||
TrialDays int64 `json:"trial_days"`
|
TrialDays int64 `json:"trial_days"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// EntitlementDef is one entry in a product's entitlements catalog
|
||||||
|
// (Keysat migration 0014). Operator declares the closed list once per
|
||||||
|
// product; policies pick from this list. Use Name as the human-readable
|
||||||
|
// label when rendering an in-app tier picker (e.g. "AI summaries"
|
||||||
|
// instead of the raw "ai_summaries" slug).
|
||||||
|
type EntitlementDef struct {
|
||||||
|
Slug string `json:"slug"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Description string `json:"description"`
|
||||||
|
}
|
||||||
|
|
||||||
// PublicPoliciesProduct is the product-level fields on the public
|
// PublicPoliciesProduct is the product-level fields on the public
|
||||||
// policies response.
|
// policies response.
|
||||||
type PublicPoliciesProduct struct {
|
type PublicPoliciesProduct struct {
|
||||||
Slug string `json:"slug"`
|
Slug string `json:"slug"`
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
BasePriceSats int64 `json:"base_price_sats"`
|
BasePriceSats int64 `json:"base_price_sats"`
|
||||||
|
EntitlementsCatalog []EntitlementDef `json:"entitlements_catalog"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// PublicPoliciesResponse is the response from GET /v1/products/<slug>/policies.
|
// PublicPoliciesResponse is the response from GET /v1/products/<slug>/policies.
|
||||||
|
|||||||
Reference in New Issue
Block a user