public sealed class RestPagedEnumerable<TRequest, TResponse, TResource> : PagedEnumerable<TResponse, TResource>, IEnumerable<TResource>, IEnumerable where TRequest : class, IClientServiceRequest<TResponse> where TResponse : class
A sequence of resources, obtained lazily via API operations which retrieve a page at a time.
public override Page<TResource> ReadPage(int pageSize)
Eagerly reads a single page of results with a fixed maximum size. The returned page is guaranteed
to have that many results, unless there is no more data available.
"Natural" pages returned by the API may contain a smaller number of resources than requested.
For example, a request for a page with 100 resources may return a page with 80 resources but
a next page token for more to be retrieved. This is suitable for batch-processing, but not
for user-visible paging such as in a web application, where fixed-size pages are expected.
This method may make more than one API call in order to fill the page, but after the page has been
returned, all the data will have been loaded. (In particular, iterating over the items in the page
multiple times will not make any further requests.)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eRestPagedEnumerable\u003c/code\u003e class provides a lazy sequence of resources retrieved from an API, fetching one page at a time.\u003c/p\u003e\n"],["\u003cp\u003eIt supports various .NET versions, with the latest being 4.10.0, and older versions like 4.8.0, 4.4.0, 4.3.1, 4.2.0, 4.0.0, and 3.2.0 are also documented.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eRestPagedEnumerable\u003c/code\u003e inherits from \u003ccode\u003ePagedEnumerable\u003c/code\u003e and implements \u003ccode\u003eIEnumerable<TResource>\u003c/code\u003e and \u003ccode\u003eIEnumerable\u003c/code\u003e, allowing it to be used in various collection scenarios.\u003c/p\u003e\n"],["\u003cp\u003eThe class offers methods like \u003ccode\u003eAsRawResponses()\u003c/code\u003e, which provides a sequence of raw API responses, and \u003ccode\u003eReadPage(int)\u003c/code\u003e, which retrieves a fixed-size page of resources, potentially making multiple API calls to fill the requested page size.\u003c/p\u003e\n"],["\u003cp\u003eThe class is designed for types \u003ccode\u003eTRequest\u003c/code\u003e, \u003ccode\u003eTResponse\u003c/code\u003e, \u003ccode\u003eTResource\u003c/code\u003e, where they respectively represent the API request, response, and resource types, offering flexibility in how to handle the data from the API.\u003c/p\u003e\n"]]],[],null,["# Class RestPagedEnumerable<TRequest, TResponse, TResource> (4.10.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.10.0 (latest)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest.RestPagedEnumerable-3)\n- [4.8.0](/dotnet/docs/reference/Google.Api.Gax/4.8.0/Google.Api.Gax.Rest.RestPagedEnumerable-3)\n- [4.4.0](/dotnet/docs/reference/Google.Api.Gax/4.4.0/Google.Api.Gax.Rest.RestPagedEnumerable-3)\n- [4.3.1](/dotnet/docs/reference/Google.Api.Gax/4.3.1/Google.Api.Gax.Rest.RestPagedEnumerable-3)\n- [4.2.0](/dotnet/docs/reference/Google.Api.Gax/4.2.0/Google.Api.Gax.Rest.RestPagedEnumerable-3)\n- [4.0.0](/dotnet/docs/reference/Google.Api.Gax/4.0.0/Google.Api.Gax.Rest.RestPagedEnumerable-3)\n- [3.2.0](/dotnet/docs/reference/Google.Api.Gax/3.2.0/Google.Api.Gax.Rest.RestPagedEnumerable-3) \n\n public sealed class RestPagedEnumerable\u003cTRequest, TResponse, TResource\u003e : PagedEnumerable\u003cTResponse, TResource\u003e, IEnumerable\u003cTResource\u003e, IEnumerable where TRequest : class, IClientServiceRequest\u003cTResponse\u003e where TResponse : class\n\nA sequence of resources, obtained lazily via API operations which retrieve a page at a time. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e [PagedEnumerable](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2) \\\u003e RestPagedEnumerable\\\u003cTRequest, TResponse, TResource\\\u003e \n\nImplements\n----------\n\n[IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1), [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.ienumerable) \n\nInherited Members\n-----------------\n\n[PagedEnumerable\\\u003cTResponse, TResource\\\u003e.AsRawResponses()](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2#Google_Api_Gax_PagedEnumerable_2_AsRawResponses) \n[PagedEnumerable\\\u003cTResponse, TResource\\\u003e.ReadPage(int)](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2#Google_Api_Gax_PagedEnumerable_2_ReadPage_System_Int32_) \n[PagedEnumerable\\\u003cTResponse, TResource\\\u003e.GetEnumerator()](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.PagedEnumerable-2#Google_Api_Gax_PagedEnumerable_2_GetEnumerator) \n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Api.Gax.Rest](/dotnet/docs/reference/Google.Api.Gax/latest/Google.Api.Gax.Rest)\n\nAssembly\n--------\n\nGoogle.Api.Gax.Rest.dll\n\nConstructors\n------------\n\n### RestPagedEnumerable(Func\\\u003cTRequest\\\u003e, IPageManager\\\u003cTRequest, TResponse, TResource\\\u003e)\n\n public RestPagedEnumerable(Func\u003cTRequest\u003e requestProvider, IPageManager\u003cTRequest, TResponse, TResource\u003e pageManager)\n\nCreates a new lazily-evaluated sequence from the given API call, initial request, and call settings.\n\nMethods\n-------\n\n### AsRawResponses()\n\n public override IEnumerable\u003cTResponse\u003e AsRawResponses()\n\nReturns the sequence of raw API responses, each of which contributes a page of\nresources to this sequence.\n\n**Overrides** \nGoogle.Api.Gax.PagedEnumerable\\\u003cTResponse, TResource\\\u003e.AsRawResponses()\n\n### GetEnumerator()\n\n public override IEnumerator\u003cTResource\u003e GetEnumerator()\n\n**Overrides** \nGoogle.Api.Gax.PagedEnumerable\\\u003cTResponse, TResource\\\u003e.GetEnumerator()\n\n### ReadPage(int)\n\n public override Page\u003cTResource\u003e ReadPage(int pageSize)\n\nEagerly reads a single page of results with a fixed maximum size. The returned page is guaranteed\nto have that many results, unless there is no more data available.\n\n**Overrides** \n[PagedEnumerable\\\u003cTResponse, TResource\\\u003e.ReadPage(int)](https://learn.microsoft.com/dotnet/api/system.int32)\n**Remarks** \n\"Natural\" pages returned by the API may contain a smaller number of resources than requested.\nFor example, a request for a page with 100 resources may return a page with 80 resources but\na next page token for more to be retrieved. This is suitable for batch-processing, but not\nfor user-visible paging such as in a web application, where fixed-size pages are expected.\nThis method may make more than one API call in order to fill the page, but after the page has been\nreturned, all the data will have been loaded. (In particular, iterating over the items in the page\nmultiple times will not make any further requests.)"]]