Skip to main content

LensStudio:AssetLibrary.AssetListService

Class

A handle to the "LensStudio:AssetLibrary".AssetListService which can provide a list of assets based on the passed in parameters.

Index

Example

// AssetListService provides fetchAsync() to query the asset library.
// Obtain it from IAssetLibraryProvider.assetService.
const provider = this.pluginSystem.findInterface(
IAssetLibraryProvider.interfaceId
) as import('LensStudio:AssetLibrary').IAssetLibraryProvider;
const service = provider.assetService;

const envSetting = new EnvironmentSetting();
envSetting.environment = Environment.Production;
envSetting.space = Space.Public;

const filter = new AssetFilter();
filter.searchText = 'material';

const request = new AssetListRequest(envSetting, filter);
const response = await service.fetchAsync(request);
if (response.ok && response.data) {
console.log('Found', response.data.assets.length, 'assets');
}

Extends

Methods

fetchAsync()

fetchAsync(request): Promise<AssetListResponse>

Fetches a list of assets from the Asset Library matching the given request, returning a promise that resolves to an AssetListResponse.

Parameters

ParameterType
requestAssetListRequest

Returns

Promise<AssetListResponse>


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

ScriptObject.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

ScriptObject.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

ScriptObject.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

ScriptObject.isSame

See also

"LensStudio:AssetLibrary".Asset.