Class GroupAndCountAssetsQueryBuilder
A class that builds and executes a query to return an asset count.
Inherited Members
Namespace: Unity.Cloud.Assets
Assembly: Unity.Cloud.Assets.dll
Syntax
public class GroupAndCountAssetsQueryBuilder
Methods
ExecuteAsync(IEnumerable<Groupable>, CancellationToken)
Executes the query and returns the result.
Declaration
public IAsyncEnumerable<KeyValuePair<IEnumerable<GroupableFieldValue>, int>> ExecuteAsync(IEnumerable<Groupable> groupBy, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<Groupable> | groupBy | A combination of GroupableField and metadata field keys by which to group the assets. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<KeyValuePair<IEnumerable<GroupableFieldValue>, int>> | An async enumeration of GroupableFieldValue and its corresponding asset count. |
ExecuteAsync(Groupable, CancellationToken)
Executes the query and returns the result.
Declaration
public IAsyncEnumerable<KeyValuePair<GroupableFieldValue, int>> ExecuteAsync(Groupable groupBy, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Groupable | groupBy | A GroupableField by which to group the assets. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
IAsyncEnumerable<KeyValuePair<GroupableFieldValue, int>> | An async enumeration of GroupableFieldValue and its corresponding asset count. |
ExecuteAsync(GroupableField, CancellationToken)
Executes the query and returns the result.
Declaration
[Obsolete("Use ExecuteAsync((Groupable)groupBy, cancellationToken) instead.")]
public Task<IReadOnlyDictionary<string, int>> ExecuteAsync(GroupableField groupBy, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GroupableField | groupBy | The field by which to group the assets. |
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyDictionary<string, int>> | A task whose result is a dictionary of groups and their counts. |
GroupByCollectionAndExecuteAsync(CancellationToken)
Executes the query and returns the result.
Declaration
[Obsolete("Use ExecuteAsync(GroupableField.Collections, cancellationToken) instead.")]
public Task<IReadOnlyDictionary<CollectionDescriptor, int>> GroupByCollectionAndExecuteAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | A token that can be used to cancel the request. |
Returns
Type | Description |
---|---|
Task<IReadOnlyDictionary<CollectionDescriptor, int>> | A task whose result is a dictionary of . |
LimitTo(int)
Sets the limit of the counters.
Declaration
public GroupAndCountAssetsQueryBuilder LimitTo(int limit)
Parameters
Type | Name | Description |
---|---|---|
int | limit | The max count to return for each value. |
Returns
Type | Description |
---|---|
GroupAndCountAssetsQueryBuilder | The calling GroupAndCountAssetsQueryBuilder. |
SelectWhereMatchesFilter(IAssetSearchFilter)
Sets the filter to be used when querying assets.
Declaration
public GroupAndCountAssetsQueryBuilder SelectWhereMatchesFilter(IAssetSearchFilter assetSearchFilter)
Parameters
Type | Name | Description |
---|---|---|
IAssetSearchFilter | assetSearchFilter | The query filter. |
Returns
Type | Description |
---|---|
GroupAndCountAssetsQueryBuilder | The calling GroupAndCountAssetsQueryBuilder. |