Downloads
Download benefit schema and validated constructor; constructing a benefit does not authorize or deliver a file.
Declaration
Section titled “Declaration”const Downloads: Schema.Union<readonly [Schema.Struct<{ type: Schema.tag<"download">; asset: Schema.Struct<{ key: Schema.brand<Schema.String, "DownloadAssetKey">; revision: Schema.brand<Schema.Int, "DefinitionRevision">; }>; duration: Schema.Union<readonly [Schema.Literals<readonly ...>, Schema.Struct<{ type: ...; months: ...; anchor: ...; calendar: ...; }>]>;}>]> & { discriminants: readonly ["download"]; cases: { download: Schema.Struct<{ type: Schema.tag<"download">; asset: Schema.Struct<{ key: Schema.brand<Schema.String, "DownloadAssetKey">; revision: Schema.brand<Schema.Int, "DefinitionRevision">; }>; duration: Schema.Union<readonly [Schema.Literals<readonly [..., ...]>, Schema.Struct<{ type: Schema.tag<...>; months: Schema.brand<..., ...>; anchor: Schema.Literal<...>; calendar: Schema.Literal<...>; }>]>; }>; }; isAnyOf: <Keys>(keys) => (value) => value is Extract<{ type: "download"; asset: { key: string & any; revision: number & any }; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } }, { type: Keys }>; guards: { download: (u) => u is { type: "download"; asset: { key: string & any; revision: number & any }; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } }; }; match: { <Cases> (value, cases): Cases[keyof Cases] extends (value) => R ? any : never; <Cases> (cases): (value) => Cases[keyof Cases] extends (value) => R ? any : never; };} & { download: (input) => Effect.Effect<typeof DownloadBenefit.Type, Schema.SchemaError>;};Type Declaration
Section titled “Type Declaration”discriminants
Section titled “discriminants”readonly discriminants: readonly ["download"];readonly cases: { download: Schema.Struct<{ type: Schema.tag<"download">; asset: Schema.Struct<{ key: Schema.brand<Schema.String, "DownloadAssetKey">; revision: Schema.brand<Schema.Int, "DefinitionRevision">; }>; duration: Schema.Union<readonly [Schema.Literals<readonly [..., ...]>, Schema.Struct<{ type: Schema.tag<...>; months: Schema.brand<..., ...>; anchor: Schema.Literal<...>; calendar: Schema.Literal<...>; }>]>; }>;};cases.download
Section titled “cases.download”download: Schema.Struct<{ type: Schema.tag<"download">; asset: Schema.Struct<{ key: Schema.brand<Schema.String, "DownloadAssetKey">; revision: Schema.brand<Schema.Int, "DefinitionRevision">; }>; duration: Schema.Union<readonly [Schema.Literals<readonly [..., ...]>, Schema.Struct<{ type: Schema.tag<...>; months: Schema.brand<..., ...>; anchor: Schema.Literal<...>; calendar: Schema.Literal<...>; }>]>;}>;isAnyOf
Section titled “isAnyOf”readonly isAnyOf: <Keys>(keys) => (value) => value is Extract<{ type: "download"; asset: { key: string & any; revision: number & any }; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } }, { type: Keys }>;Type Parameters
Section titled “Type Parameters”Keys
Parameters
Section titled “Parameters”readonly Keys[]
Returns
Section titled “Returns”(value) => value is Extract<{ type: “download”; asset: { key: string & any; revision: number & any }; duration: “perpetual” | “purchased_period” | { type: “fixed”; months: number & any; anchor: “settlement”; calendar: “utc_clamped” } }, { type: Keys }>
guards
Section titled “guards”readonly guards: { download: (u) => u is { type: "download"; asset: { key: string & any; revision: number & any }; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } };};guards.download
Section titled “guards.download”download: (u) => u is { type: "download"; asset: { key: string & any; revision: number & any }; duration: "perpetual" | "purchased_period" | { type: "fixed"; months: number & any; anchor: "settlement"; calendar: "utc_clamped" } };Parameters
Section titled “Parameters”unknown
Returns
Section titled “Returns”u is { type: “download”; asset: { key: string & any; revision: number & any }; duration: “perpetual” | “purchased_period” | { type: “fixed”; months: number & any; anchor: “settlement”; calendar: “utc_clamped” } }
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”"download"
{
key: string & any;
revision: number & any;
}
asset.key
Section titled “asset.key”string & any
asset.revision
Section titled “asset.revision”number & any
duration
Section titled “duration”| "perpetual"
| "purchased_period"
| {
type: "fixed";
months: number & any;
anchor: "settlement";
calendar: "utc_clamped";
}
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”download
Section titled “download”download: (input) => Effect.Effect<typeof DownloadBenefit.Type, Schema.SchemaError>;Parses download eligibility without requiring its wire-format tag.
Parameters
Section titled “Parameters”Omit<typeof DownloadBenefit.Encoded, "type">
Returns
Section titled “Returns”Effect.Effect<typeof DownloadBenefit.Type, Schema.SchemaError>