v3.1.2
2020.3+

Class PageableResult<T, TSelf>

The base class used for providing pageable results from the service e.g. GetBalancesResult.

Inheritance
PageableResult<T, TSelf>
Namespace: Unity.Services.Economy.Model
Syntax
[Preserve]
public abstract class PageableResult<T, TSelf>
    where TSelf : PageableResult<T, TSelf>
Type Parameters
NameDescription
T

The type of resource that is being fetched. E.g. for GetBalancesResult, the type is PlayerBalance.

TSelf

Constructors

PageableResult(List<T>, Boolean)

Declaration
[Preserve]
protected PageableResult(List<T> results, bool hasNext)
Parameters
TypeNameDescription
List<T>results
BooleanhasNext

Fields

HasNext

True if there are more pages of results to fetch.

Declaration
[Preserve]
public bool HasNext
Field Value
TypeDescription
Boolean

m_Results

The list of fetched results of type T.

Declaration
[Preserve]
protected List<T> m_Results
Field Value
TypeDescription
List<T>

Methods

GetNextAsync(Int32)

Fetches the next page of results.

Declaration
[Preserve]
public async Task<TSelf> GetNextAsync(int itemsPerFetch = 20)
Parameters
TypeNameDescription
Int32itemsPerFetch

The number of items to fetch. Can be between 1-100 inclusive and defaults to 20.

Returns
TypeDescription
Task<TSelf>

A new results of type TSelf

Exceptions
TypeCondition
EconomyException

Thrown if request is unsuccessful

GetNextResultsAsync(Int32)

Declaration
[Preserve]
protected abstract Task<TSelf> GetNextResultsAsync(int itemsPerFetch)
Parameters
TypeNameDescription
Int32itemsPerFetch
Returns
TypeDescription
Task<TSelf>