LensStudio:AssetLibrary.AssetListResponse
ClassA handle returned by the "LensStudio:AssetLibrary".AssetListService.
Index
Example
// AssetListResponse is returned by AssetListService.fetchAsync().
// It has a protected constructor -- inspect ok, then read data or error.
const { IAssetLibraryProvider, AssetFilter, AssetListRequest, EnvironmentSetting, Environment, Space } = await import('LensStudio:AssetLibrary');
const provider = this.pluginSystem.findInterface(IAssetLibraryProvider.interfaceId) as import('LensStudio:AssetLibrary').IAssetLibraryProvider;
const envSetting = new EnvironmentSetting();
envSetting.environment = Environment.Production;
envSetting.space = Space.Public;
const filter = new AssetFilter();
filter.searchText = 'hat';
const request = new AssetListRequest(envSetting, filter);
const response = await provider.assetService.fetchAsync(request);
console.log('ok:', response.ok);
console.log('cancelled:', response.cancelled);
if (response.ok && response.data) {
console.log('Asset count:', response.data.assets.length);
} else if (response.error) {
console.log('Error:', response.error);
}
Properties
cancelled
readonlycancelled:boolean
Indicates whether the asset list request was cancelled before completion.
data?
readonlyoptionaldata?:AssetListSuccess
The successful result payload of the asset list request, present when the request succeeded.
error?
readonlyoptionalerror?:ServiceError
The error details from the asset list request, present when the request failed.
ok
readonlyok:boolean
Indicates whether the asset list request completed successfully without errors.