Skip to content

Administration client

The IAdministrationClient is the entry point for operations related to features adminstration. You can construct it manually, but typically you will use a DI container to inject an instance of the class. In the following examples we will assume that the variable administrationClient holds a reference to an instance of IAdministrationClient.

How to use the administration client

The most common usage is getting features and their details.

var features = await administrationClient.GetFeaturesListAsync();

// this is just a sample code on how to consume the features list
var featuresDetails = await Task.WhenAll(
                features.Select(async id => (id, detail: await administrationClient.GetFeatureAsync(id)))
);

var enabledFeatures = featuresDetails
                .Where(featureDetail => featureDetail.detail.Enabled);

How to get available credits

Use GetCreditsAsync to get information on the amount of available credits.

var availableCredits = await administrationClient
                .GetCreditsAsync(cancellationToken);

How to get the list of cost assets

Use the GetAssetCostListAsync method to retrieve the list of assets:

var assetCostList = await administrationClient
                .GetAssetCostListAsync(cancellationToken);