Show / Hide Table of Contents

Class PaginatedCollection<TEntries>

A paginated collection of EasyPostObjects.

Inheritance
System.Object
EphemeralEasyPostObject
EasyPostObject
PaginatedCollection<TEntries>
AddressCollection
BatchCollection
ChildUserCollection
ClaimCollection
EndShipperCollection
EventCollection
InsuranceCollection
PickupCollection
ReferralCustomerCollection
RefundCollection
ReportCollection
ScanFormCollection
ShipmentCollection
TrackerCollection
Implements
IEasyPostObject
Inherited Members
EasyPostObject.CreatedAt
EasyPostObject.Id
EasyPostObject.UpdatedAt
EasyPostObject.Prefix
EasyPostObject.AsDictionary()
EasyPostObject.ToString()
EasyPostObject.Equals(Nullable<Object>)
EasyPostObject.GetHashCode()
EphemeralEasyPostObject.Mode
EphemeralEasyPostObject.AsJson()
Namespace: EasyPost.Models.Shared
Assembly: EasyPost.dll
Syntax
public abstract class PaginatedCollection<TEntries> : EasyPostObject, IEasyPostObject where TEntries : EasyPostObject
Type Parameters
Name Description
TEntries

The type of EasyPostObject contained in the collection.

Properties

| Improve this Doc View Source

HasMore

Whether there are more items to retrieve server-side.

Declaration
public bool? HasMore { get; set; }
Property Value
Type Description
System.Nullable<System.Boolean>

Methods

| Improve this Doc View Source

BuildNextPageParameters<TParameters>(IEnumerable<TEntries>, Nullable<Int32>)

Build the parameters to retrieve the next page of a paginated collection.

Declaration
public abstract TParameters BuildNextPageParameters<TParameters>(IEnumerable<TEntries> entries, int? pageSize = null)
    where TParameters : BaseParameters<TEntries>
Parameters
Type Name Description
IEnumerable<TEntries> entries

The entries of the collection.

System.Nullable<System.Int32> pageSize

The size of the next page.

Returns
Type Description
TParameters

A TParameters-type set of parameters to use for the subsequent API call.

Type Parameters
Name Description
TParameters

The type of BaseParameters<TMatchInputType> to construct for the API call.

Exceptions
Type Condition
EndOfPaginationError

Thrown if there are no more items to retrieve for the paginated collection.

| Improve this Doc View Source

GetNextPage<TCollection, TParameters>(Func<TParameters, Task<TCollection>>, Nullable<List<TEntries>>, Nullable<Int32>)

Get the next page of a paginated collection.

Declaration
public async Task<TCollection> GetNextPage<TCollection, TParameters>(Func<TParameters, Task<TCollection>> apiCallFunction, List<TEntries>? currentEntries, int? pageSize = null)
    where TCollection : PaginatedCollection<TEntries> where TParameters : BaseParameters<TEntries>
Parameters
Type Name Description
Func<TParameters, Task<TCollection>> apiCallFunction

The function to execute to retrieve a page (most likely an All function).

System.Nullable<List<TEntries>> currentEntries

The results on the current page. Used to determine the API call parameters to retrieve the next page.

System.Nullable<System.Int32> pageSize

The size of the next page.

Returns
Type Description
Task<TCollection>

The next page of a paginated collection.

Type Parameters
Name Description
TCollection

The type of PaginatedCollection<TEntries> to get the next page of.

TParameters

The type of BaseParameters<TMatchInputType> to construct for the API call.

Exceptions
Type Condition
EndOfPaginationError

Thrown if there is no next page to retrieve.

Implements

IEasyPostObject
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX