Licensing
Licensing benefit schema and validated eligibility constructor; never automatic key issuance.
Declaration
Section titled “Declaration”const Licensing: Schema.Union<readonly [Schema.Struct<{ entitlement: Schema.brand<Schema.String, "EntitlementKey">; activationLimit: Schema.Int; type: Schema.tag<"license_eligibility">; validity: Schema.withConstructorDefault<Schema.Literal<"while_entitled">>;}>]> & { discriminants: readonly ["license_eligibility"]; cases: { license_eligibility: Schema.Struct<{ entitlement: Schema.brand<Schema.String, "EntitlementKey">; activationLimit: Schema.Int; type: Schema.tag<"license_eligibility">; validity: Schema.withConstructorDefault<Schema.Literal<"while_entitled">>; }>; }; isAnyOf: <Keys>(keys) => (value) => value is Extract<{ entitlement: string & any; activationLimit: number; type: "license_eligibility"; validity: "while_entitled" }, { type: Keys }>; guards: { license_eligibility: (u) => u is { entitlement: string & any; activationLimit: number; type: "license_eligibility"; validity: "while_entitled" }; }; match: { <Cases> (value, cases): Cases[keyof Cases] extends (value) => R ? any : never; <Cases> (cases): (value) => Cases[keyof Cases] extends (value) => R ? any : never; };} & { eligibility: (input) => Effect.Effect<typeof LicensingBenefit.Type, Schema.SchemaError>;};Type Declaration
Section titled “Type Declaration”discriminants
Section titled “discriminants”readonly discriminants: readonly ["license_eligibility"];readonly cases: { license_eligibility: Schema.Struct<{ entitlement: Schema.brand<Schema.String, "EntitlementKey">; activationLimit: Schema.Int; type: Schema.tag<"license_eligibility">; validity: Schema.withConstructorDefault<Schema.Literal<"while_entitled">>; }>;};cases.license_eligibility
Section titled “cases.license_eligibility”license_eligibility: Schema.Struct<{ entitlement: Schema.brand<Schema.String, "EntitlementKey">; activationLimit: Schema.Int; type: Schema.tag<"license_eligibility">; validity: Schema.withConstructorDefault<Schema.Literal<"while_entitled">>;}>;isAnyOf
Section titled “isAnyOf”readonly isAnyOf: <Keys>(keys) => (value) => value is Extract<{ entitlement: string & any; activationLimit: number; type: "license_eligibility"; validity: "while_entitled" }, { type: Keys }>;Type Parameters
Section titled “Type Parameters”Keys
Parameters
Section titled “Parameters”readonly Keys[]
Returns
Section titled “Returns”(value) => value is Extract<{ entitlement: string & any; activationLimit: number; type: "license_eligibility"; validity: "while_entitled" }, { type: Keys }>
guards
Section titled “guards”readonly guards: { license_eligibility: (u) => u is { entitlement: string & any; activationLimit: number; type: "license_eligibility"; validity: "while_entitled" };};guards.license_eligibility
Section titled “guards.license_eligibility”license_eligibility: (u) => u is { entitlement: string & any; activationLimit: number; type: "license_eligibility"; validity: "while_entitled" };Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”u is { entitlement: string & any; activationLimit: number; type: "license_eligibility"; validity: "while_entitled" }
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”entitlement
Section titled “entitlement”string & any
activationLimit
Section titled “activationLimit”number
"license_eligibility"
validity
Section titled “validity”"while_entitled"
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”eligibility
Section titled “eligibility”eligibility: (input) => Effect.Effect<typeof LicensingBenefit.Type, Schema.SchemaError>;Parses license eligibility without requiring its wire-format tag or fixed validity value.
Parameters
Section titled “Parameters”Omit<typeof LicensingBenefit.Encoded, "type" | "validity">
Returns
Section titled “Returns”Effect.Effect<typeof LicensingBenefit.Type, Schema.SchemaError>