Skip to content

PixabayCatalogProvider

ClassAssetInventoryAssetInventory.Editor
public sealed class PixabayCatalogProvider : RemoteCatalogProviderBase, IRemoteCatalogProvider, IRemoteCatalogAccessProbe

Searches Pixabay images and videos using an API key and caches API responses for 24 hours.

public PixabayCatalogProvider(HttpClient client = null)

Creates a Pixabay provider with a caller-owned HTTP client, or an owned default client when none is supplied.

Parameters

Name Type
client System.Net.Http.HttpClient

CheckAccessAsync(RemoteCatalogRequest, CancellationToken)

Section titled “CheckAccessAsync(RemoteCatalogRequest, CancellationToken)”
public override Task<RemoteCatalogAccessResult> CheckAccessAsync(RemoteCatalogRequest request, CancellationToken cancellationToken)

Checks catalog access and marks credentials validated only when the search uses no cached responses.

Parameters

Name Type
request AssetInventory.RemoteCatalogRequest
cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task{AssetInventory.RemoteCatalogAccessResult}

FetchAsync(RemoteCatalogRequest, CancellationToken)

Section titled “FetchAsync(RemoteCatalogRequest, CancellationToken)”
public override Task<RemoteCatalogPage> FetchAsync(RemoteCatalogRequest request, CancellationToken cancellationToken)

Returns safe-search image and video results with independent page cursors, using the API key and the 24-hour response cache.

Parameters

Name Type
request AssetInventory.RemoteCatalogRequest
cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task{AssetInventory.RemoteCatalogPage}

GetVariantsAsync(string, RemoteCatalogRequest, CancellationToken)

Section titled “GetVariantsAsync(string, RemoteCatalogRequest, CancellationToken)”
public override Task<IReadOnlyList<RemoteDownloadVariant>> GetVariantsAsync(string itemId, RemoteCatalogRequest request, CancellationToken cancellationToken)

Returns available original, vector, and large image files or video quality variants from the API or its 24-hour response cache.

Parameters

Name Type
itemId System.String
request AssetInventory.RemoteCatalogRequest
cancellationToken System.Threading.CancellationToken

Returns

System.Threading.Tasks.Task{System.Collections.Generic.IReadOnlyList{AssetInventory.RemoteDownloadVariant}}

protected override int MaximumResponseBytes { get; }

Returns

System.Int32

public override string Id { get; }

Returns

System.String