Class PageableResult<T, TSelf>
The base class used for providing pageable results from the service e.g. GetBalancesResult.
Inherited Members
Namespace: Unity.Services.Economy.Model
Assembly: Unity.Services.Economy.dll
Syntax
[Preserve]
public abstract class PageableResult<T, TSelf> where TSelf : PageableResult<T, TSelf>
Type Parameters
Name | Description |
---|---|
T | The type of resource that is being fetched. E.g. for GetBalancesResult, the type is PlayerBalance. |
TSelf | The type of the request result |
Constructors
PageableResult(List<T>, bool)
Creates an instance of PageableResult
Declaration
[Preserve]
protected PageableResult(List<T> results, bool hasNext)
Parameters
Type | Name | Description |
---|---|---|
List<T> | results | List of results |
bool | hasNext | Whether there's more results |
Fields
HasNext
True if there are more pages of results to fetch.
Declaration
[Preserve]
public bool HasNext
Field Value
Type | Description |
---|---|
bool |
m_Results
The list of fetched results of type T.
Declaration
[Preserve]
protected List<T> m_Results
Field Value
Type | Description |
---|---|
List<T> |
Methods
GetNextAsync(int)
Fetches the next page of results.
Declaration
[Preserve]
public Task<TSelf> GetNextAsync(int itemsPerFetch = 20)
Parameters
Type | Name | Description |
---|---|---|
int | itemsPerFetch | The number of items to fetch. Can be between 1-100 inclusive and defaults to 20. |
Returns
Type | Description |
---|---|
Task<TSelf> | A new results of type TSelf |
Exceptions
Type | Condition |
---|---|
EconomyException | Thrown if request is unsuccessful |
GetNextResultsAsync(int)
Gets the next page
Declaration
[Preserve]
protected abstract Task<TSelf> GetNextResultsAsync(int itemsPerFetch)
Parameters
Type | Name | Description |
---|---|---|
int | itemsPerFetch | How many items to fetch |
Returns
Type | Description |
---|---|
Task<TSelf> | Task with the next page |