| import "../productcatalog/addon.tsp"; | |
| import "../productcatalog/ratecard.tsp"; | |
| namespace Subscriptions; | |
| /** | |
| * Addon purchased with a subscription. | |
| */ | |
| #suppress "@openmeter/api-spec-aip/repeated-prefix-grouping" "active_from and active_to should not be grouped" | |
| model SubscriptionAddon { | |
| ...OmitProperties<Shared.Resource, "name" | "description">; | |
| /** | |
| * Display name of the resource. | |
| * | |
| * Between 1 and 256 characters. | |
| */ | |
| name: string; | |
| /** | |
| * Optional description of the resource. | |
| * | |
| * Maximum 1024 characters. | |
| */ | |
| description?: string; | |
| /** | |
| * The add-on associated with the subscription. | |
| */ | |
| addon: Shared.ResourceReference<ProductCatalog.Addon>; | |
| /** | |
| * The quantity of the add-on. Always 1 for single instance add-ons. | |
| */ | |
| quantity: integer; | |
| /** | |
| * An ISO-8601 timestamp representation of which point in time the quantity was | |
| * resolved to. | |
| */ | |
| quantity_at: Shared.DateTime; | |
| /** | |
| * An ISO-8601 timestamp representation of the cadence start of the resource. | |
| */ | |
| active_from: Shared.DateTime; | |
| /** | |
| * An ISO-8601 timestamp representation of the cadence end of the resource. | |
| */ | |
| active_to?: Shared.DateTime; | |
| /** | |
| * The timing of the operation. After the create or update, a new entry will be | |
| * created in the timeline. | |
| */ | |
| timing: SubscriptionEditTiming; | |
| /** | |
| * The timeline of the add-on. The returned periods are sorted and continuous. | |
| */ | |
| timeline: SubscriptionAddonTimelineSegment[]; | |
| /** | |
| * The rate cards of the add-on. | |
| */ | |
| rate_cards: SubscriptionAddonRateCard[]; | |
| } | |
| /** | |
| * A rate card for a subscription add-on. | |
| */ | |
| model SubscriptionAddonRateCard { | |
| /** | |
| * The rate card. | |
| */ | |
| rate_card: ProductCatalog.RateCard; | |
| /** | |
| * The IDs of the subscription items that this rate card belongs to. | |
| */ | |
| affected_subscription_item_ids: Shared.ULID[]; | |
| } | |
| /** | |
| * A subscription add-on event. | |
| */ | |
| model SubscriptionAddonTimelineSegment { | |
| /** | |
| * An ISO-8601 timestamp representation of the cadence start of the resource. | |
| */ | |
| active_from: Shared.DateTime; | |
| /** | |
| * An ISO-8601 timestamp representation of the cadence end of the resource. | |
| */ | |
| active_to?: Shared.DateTime; | |
| /** | |
| * The quantity of the add-on for the given period. | |
| */ | |
| quantity: integer; | |
| } | |