maxon.AssetLinkInterface¶
Description¶
An AssetLink is a symbolic link to an asset identified by its id and version. Also an ASSET_UPDATE_POLICY is stored to control the behavior of the link when newer versions of the linked asset exists.
Alternatively an maxon.AssetLink can also just wrap a maxon.Url from which an asset can be loaded directly.
Attributes¶
Methods Signature¶
|
Creates a new |
Returns the update policy which this link uses. |
|
|
Returns the |
|
Resolves this |
|
Returns the update policy which this link uses. |
Methods Definition¶
-
static
AssetLinkInterface.Create(type, aid, up=None)¶ Creates a new
maxon.AssetLink.Use anmaxon.Urlfor assets which aren’t stored in a repository, but shall be read directly from a Url such as a local image file.Only one of the next calls is possible:- Parameters
type (
maxon.Id) – The expected type of the asset.aid (Union[
maxon.Url,maxon.Tuple[maxon.Id,maxon.Id]]) – Themaxon.Urlwhere the asset can be read from or the identifier and version of the asset.up (Optional[
maxon.ASSET_UPDATE_POLICY]) – The update policy which the created link shall use. Only used when an tuple is passed for aid.
- Returns
A new AssetLink.
- Return type
-
AssetLinkInterface.GetUpdatePolicy()¶ Returns the update policy which this link uses.
- Returns
The update policy of this link.
- Return type
maxon.ASSET_UPDATE_POLICY
-
AssetLinkInterface.GetUrl()¶ Returns the
maxon.Urlfor a Url-basedmaxon.AssetLink.- Returns
The
maxon.Urlto which thismaxon.AssetLinkpoints. Or a null value when thismaxon.AssetLinkuses an asset identifier instead of amaxon.Url.- Return type
-
AssetLinkInterface.Resolve(context)¶ Resolves this
maxon.AssetLinkto anmaxon.AssetDescriptionin the given context.The asset identifier of this link is used to find the asset in context, and if this link uses the policy maxon.ASSET_UPDATE_POLICY.IMPLICIT the latest version of the asset is used, otherwise the version recorded in this link.
- Parameters
context (
maxon.AssetRepositoryRef) – The repository to use for the asset lookup.- Returns
The found AssetDescription or a null value when no asset could be found.
- Return type
-
AssetLinkInterface.SetUpdatePolicy(up)¶ Returns the update policy which this link uses.
- Parameters
up (
maxon.ASSET_UPDATE_POLICY) – The new update policy for this link.