Limits
Resource limit benefit schema and validated constructor; no host resource mutation occurs.
Declaration
Section titled “Declaration”const Limits: Schema.Union<readonly [Schema.Struct<{ resource: Schema.brand<Schema.String, "ResourceLimitKey">; quantity: Schema.brand<Schema.Int, "ResourceLimitQuantity">; entitlement: Schema.brand<Schema.String, "EntitlementKey">; validity: Schema.Literal<"while_entitled">; type: Schema.tag<"resource_limit">;}>]> & { discriminants: readonly ["resource_limit"]; cases: { resource_limit: Schema.Struct<{ resource: Schema.brand<Schema.String, "ResourceLimitKey">; quantity: Schema.brand<Schema.Int, "ResourceLimitQuantity">; entitlement: Schema.brand<Schema.String, "EntitlementKey">; validity: Schema.Literal<"while_entitled">; type: Schema.tag<"resource_limit">; }>; }; isAnyOf: <Keys>(keys) => (value) => value is Extract<{ resource: string & any; quantity: number & any; entitlement: string & any; validity: "while_entitled"; type: "resource_limit" }, { type: Keys }>; guards: { resource_limit: (u) => u is { resource: string & any; quantity: number & any; entitlement: string & any; validity: "while_entitled"; type: "resource_limit" }; }; match: { <Cases> (value, cases): Cases[keyof Cases] extends (value) => R ? any : never; <Cases> (cases): (value) => Cases[keyof Cases] extends (value) => R ? any : never; };} & { resource: (input) => Effect.Effect<typeof ResourceLimitBenefitDefinition.Type, Schema.SchemaError>;};Type Declaration
Section titled “Type Declaration”discriminants
Section titled “discriminants”readonly discriminants: readonly ["resource_limit"];readonly cases: { resource_limit: Schema.Struct<{ resource: Schema.brand<Schema.String, "ResourceLimitKey">; quantity: Schema.brand<Schema.Int, "ResourceLimitQuantity">; entitlement: Schema.brand<Schema.String, "EntitlementKey">; validity: Schema.Literal<"while_entitled">; type: Schema.tag<"resource_limit">; }>;};cases.resource_limit
Section titled “cases.resource_limit”resource_limit: Schema.Struct<{ resource: Schema.brand<Schema.String, "ResourceLimitKey">; quantity: Schema.brand<Schema.Int, "ResourceLimitQuantity">; entitlement: Schema.brand<Schema.String, "EntitlementKey">; validity: Schema.Literal<"while_entitled">; type: Schema.tag<"resource_limit">;}>;isAnyOf
Section titled “isAnyOf”readonly isAnyOf: <Keys>(keys) => (value) => value is Extract<{ resource: string & any; quantity: number & any; entitlement: string & any; validity: "while_entitled"; type: "resource_limit" }, { type: Keys }>;Type Parameters
Section titled “Type Parameters”Keys
Parameters
Section titled “Parameters”readonly Keys[]
Returns
Section titled “Returns”(value) => value is Extract<{ resource: string & any; quantity: number & any; entitlement: string & any; validity: "while_entitled"; type: "resource_limit" }, { type: Keys }>
guards
Section titled “guards”readonly guards: { resource_limit: (u) => u is { resource: string & any; quantity: number & any; entitlement: string & any; validity: "while_entitled"; type: "resource_limit" };};guards.resource_limit
Section titled “guards.resource_limit”resource_limit: (u) => u is { resource: string & any; quantity: number & any; entitlement: string & any; validity: "while_entitled"; type: "resource_limit" };Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”u is { resource: string & any; quantity: number & any; entitlement: string & any; validity: "while_entitled"; type: "resource_limit" }
readonly match: {<Cases> (value, cases): Cases[keyof Cases] extends (value) => R ? any : never;<Cases> (cases): (value) => Cases[keyof Cases] extends (value) => R ? any : never;};Call Signature
Section titled “Call Signature”<Cases>(value, cases): Cases[keyof Cases] extends (value) => R ? any : never;Type Parameters
Section titled “Type Parameters”Cases extends {
[key: string]: (value) => any;
}
Parameters
Section titled “Parameters”resource
Section titled “resource”string & any
quantity
Section titled “quantity”number & any
entitlement
Section titled “entitlement”string & any
validity
Section titled “validity”"while_entitled"
"resource_limit"
Cases
Returns
Section titled “Returns”Cases[keyof Cases] extends (value) => R ? any : never
Call Signature
Section titled “Call Signature”<Cases>(cases): (value) => Cases[keyof Cases] extends (value) => R ? any : never;Type Parameters
Section titled “Type Parameters”Cases extends {
[key: string]: (value) => any;
}
Parameters
Section titled “Parameters”Cases
Returns
Section titled “Returns”(value) => Cases[keyof Cases] extends (value) => R ? any : never
Type Declaration
Section titled “Type Declaration”resource
Section titled “resource”resource: (input) => Effect.Effect<typeof ResourceLimitBenefitDefinition.Type, Schema.SchemaError>;Parses a resource limit associated with a same-purchase entitlement.
Parameters
Section titled “Parameters”Omit<typeof ResourceLimitBenefitDefinition.Encoded, "type" | "validity">
Returns
Section titled “Returns”Effect.Effect<typeof ResourceLimitBenefitDefinition.Type, Schema.SchemaError>