Class: AssetCoreService
Core asset operations. Move, Copy, Delete, Update, Refresh, Get, Create Thumbnail, Delete Thumbnail.
Implements
Constructors
new AssetCoreService()
new AssetCoreService(
connectClient
,assetMapper
):AssetCoreService
Constructor for AssetCoreService.
Parameters
Parameter | Type | Description |
---|---|---|
connectClient | ConnectClientInterface | Connect client to make API calls from the Connect SDK |
assetMapper | AssetMapper | Mapper to map asset API response to asset object. |
Returns
Remarks
It is easier to use the AssetCoreServiceFactory
to create an instance of this class as it will inject the required dependencies.
Defined in
service/assetCoreService.ts:76 (opens in a new tab)
Methods
copyAsset()
copyAsset(
id
,folderId
):Promise
<CopyAssetResult
>
Copy an asset by its id to a destination folder by its id.
Parameters
Parameter | Type |
---|---|
id | AssetInstanceId |
folderId | string |
Returns
Promise
<CopyAssetResult
>
Implementation of
AssetCoreServiceInterface
.copyAsset
Defined in
service/assetCoreService.ts:220 (opens in a new tab)
copyMultiAssets()
copyMultiAssets(
ids
,folderId
):Promise
<CopyMultiAssetResult
[]>
Copy multiple assets by their ids to a destination folder by its id. This is not transactional, so some assets may be copied while others fail.
Parameters
Parameter | Type |
---|---|
ids | AssetInstanceId [] |
folderId | string |
Returns
Promise
<CopyMultiAssetResult
[]>
Defined in
service/assetCoreService.ts:245 (opens in a new tab)
createThumbnail()
createThumbnail(
id
):Promise
<CreateThumbnailResult
>
Create a thumbnail for an asset by its id. This wil return an upload URL that needs to be used to upload the thumbnail.
Parameters
Parameter | Type |
---|---|
id | AssetInstanceId |
Returns
Promise
<CreateThumbnailResult
>
Implementation of
AssetCoreServiceInterface
.createThumbnail
Defined in
service/assetCoreService.ts:265 (opens in a new tab)
deleteAsset()
deleteAsset(
id
):Promise
<DeleteAssetResult
>
Delete an asset by its id.
Parameters
Parameter | Type |
---|---|
id | AssetInstanceId |
Returns
Promise
<DeleteAssetResult
>
Implementation of
AssetCoreServiceInterface
.deleteAsset
Defined in
service/assetCoreService.ts:126 (opens in a new tab)
deleteThumbnail()
deleteThumbnail(
id
):Promise
<DeleteThumbnailResult
>
Remove the thumbnail for an asset by its id.
Parameters
Parameter | Type |
---|---|
id | AssetInstanceId |
Returns
Promise
<DeleteThumbnailResult
>
Implementation of
AssetCoreServiceInterface
.deleteThumbnail
Defined in
service/assetCoreService.ts:292 (opens in a new tab)
getAsset()
getAsset(
id
):Promise
<GetAssetResult
>
Load an asset by its id.
Parameters
Parameter | Type |
---|---|
id | AssetInstanceId |
Returns
Promise
<GetAssetResult
>
Implementation of
AssetCoreServiceInterface
.getAsset
Defined in
service/assetCoreService.ts:102 (opens in a new tab)
moveAsset()
moveAsset(
id
,folderId
):Promise
<MoveAssetResult
>
Move an asset by its a id to a destination folder by its id.
Parameters
Parameter | Type |
---|---|
id | AssetInstanceId |
folderId | string |
Returns
Promise
<MoveAssetResult
>
Implementation of
AssetCoreServiceInterface
.moveAsset
Defined in
service/assetCoreService.ts:177 (opens in a new tab)
moveMultiAssets()
moveMultiAssets(
ids
,folderId
):Promise
<MoveMultiAssetResult
[]>
Move multiple assets by their ids to a destination folder by its id. This is not transactional, so some assets may be moved while others fail.
Parameters
Parameter | Type |
---|---|
ids | AssetInstanceId [] |
folderId | string |
Returns
Promise
<MoveMultiAssetResult
[]>
Defined in
service/assetCoreService.ts:202 (opens in a new tab)
refreshAsset()
refreshAsset(
id
):Promise
<RefreshAssetResult
>
Refreshes the asset with the given id from the server. This will not return the asset, but will update the cache.
Parameters
Parameter | Type |
---|---|
id | AssetInstanceId |
Returns
Promise
<RefreshAssetResult
>
Implementation of
AssetCoreServiceInterface
.refreshAsset
Defined in
service/assetCoreService.ts:85 (opens in a new tab)
updateAsset()
updateAsset(
id
,variables
):Promise
<UpdateAssetResult
>
Update an asset by its id, setting the name and description.
Parameters
Parameter | Type |
---|---|
id | AssetInstanceId |
variables | object |
variables.description | string |
variables.name | string |
Returns
Promise
<UpdateAssetResult
>
Implementation of
AssetCoreServiceInterface
.updateAsset