Adds a new version of this asset, keeping the previous ones.
Path to the file, or a File object.
This asset, now with the new version as its latest.
Deletes a version of this asset, or the whole asset.
OptionalversionNumber: number
Zero-based version to delete, or omit for the whole asset.
Destructive and not undoable. With no argument this deletes the entire asset and every version — unless Asset.selectVersion was called, in which case it deletes only that version. Once the last version is gone the asset no longer exists and every method on this object throws.
This asset's metadata, merged with one version's.
OptionalversionNumber: number
Which version to report; the one set by Asset.selectVersion, or the latest, when omitted.
Metadata for one version: when it was uploaded, by whom, and how large it is.
Zero-based version index, so the first upload is 0.
Makes this version the one other methods act on.
Zero-based version index.
This asset, for chaining.
Mutates this object rather than returning a new one, and it sticks: a later Asset.delete with no argument then removes this version instead of the whole asset.
Downloads this asset to a file.
Where to write it.
OptionalversionNumber: number
Which version to download; the selected or latest one when omitted.
Downloads this asset as a stream, for a file too large to hold in memory.
OptionalversionNumber: number
Which version to read; the selected or latest one when omitted.
A file attached to a Dataset, stored alongside its graphs and versioned.
Remarks
Obtain one with Dataset.getAsset, iterate them with Dataset.getAssets, or create one with Dataset.uploadAsset. Assets are never constructed directly.
Example: Get an asset and save it to disk
Example: Upload one, overwriting any asset already using that name