Class GrpcPagedAsyncEnumerable<TRequest, TResponse, TResource>
An asynchronous sequence of resources, obtained lazily via API operations which retrieve a page at a time.
Inheritance
System.Object
PagedAsyncEnumerable<TResponse, TResource>
GrpcPagedAsyncEnumerable<TRequest, TResponse, TResource>
Implements
System.Collections.Generic.IAsyncEnumerable<TResource>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Google.Api.Gax.Grpc
Assembly: Google.Api.Gax.Grpc.dll
Syntax
public sealed class GrpcPagedAsyncEnumerable<TRequest, TResponse, TResource> : PagedAsyncEnumerable<TResponse, TResource>, IAsyncEnumerable<TResource> where TRequest : class, IPageRequest, IMessage<TRequest> where TResponse : class, IPageResponse<TResource>, IMessage<TResponse>
Type Parameters
Name | Description |
---|---|
TRequest | The API request type. |
TResponse | The API response type. Each response contains a page of resources. |
TResource | The resource type contained within the response. |
Constructors
GrpcPagedAsyncEnumerable(ApiCall<TRequest, TResponse>, TRequest, CallSettings)
Creates a new lazily-evaluated asynchronous sequence from the given API call, initial request, and call settings.
Declaration
public GrpcPagedAsyncEnumerable(ApiCall<TRequest, TResponse> apiCall, TRequest request, CallSettings callSettings)
Parameters
Type | Name | Description |
---|---|---|
ApiCall<TRequest, TResponse> | apiCall | The API call made each time a page is required. |
TRequest | request | The initial request. |
CallSettings | callSettings | The settings to apply to each API call. |
Remarks
The request is cloned each time the sequence is evaluated.
Methods
AsRawResponses()
Declaration
public override IAsyncEnumerable<TResponse> AsRawResponses()
Returns
Type | Description |
---|---|
System.Collections.Generic.IAsyncEnumerable<TResponse> |
Overrides
Google.Api.Gax.PagedAsyncEnumerable<TResponse, TResource>.AsRawResponses()
GetEnumerator()
Declaration
public override IAsyncEnumerator<TResource> GetEnumerator()
Returns
Type | Description |
---|---|
System.Collections.Generic.IAsyncEnumerator<TResource> |
Overrides
Google.Api.Gax.PagedAsyncEnumerable<TResponse, TResource>.GetEnumerator()
ReadPageAsync(Int32, CancellationToken)
Declaration
public override Task<Page<TResource>> ReadPageAsync(int pageSize, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | pageSize | |
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Page<TResource>> |
Overrides
Google.Api.Gax.PagedAsyncEnumerable<TResponse, TResource>.ReadPageAsync(System.Int32, System.Threading.CancellationToken)