/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListRegionCommitmentsRequest, CallSettings) // Create client RegionCommitmentsClient regionCommitmentsClient = RegionCommitmentsClient.Create(); // Initialize request argument(s) ListRegionCommitmentsRequest request = new ListRegionCommitmentsRequest { Region = "", OrderBy = "", Project = "", Filter = "", ReturnPartialSuccess = false, }; // Make the request PagedEnumerable <CommitmentList, Commitment> response = regionCommitmentsClient.List(request); // Iterate over all response items, lazily performing RPCs as required foreach (Commitment item in response) { // Do something with each item Console.WriteLine(item); } // Or iterate over pages (of server-defined size), performing one RPC per page foreach (CommitmentList page in response.AsRawResponses()) { // Do something with each page of items Console.WriteLine("A page of results:"); foreach (Commitment item in page) { // Do something with each item Console.WriteLine(item); } } // Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required int pageSize = 10; Page <Commitment> singlePage = response.ReadPage(pageSize); // Do something with the page of items Console.WriteLine($"A page of {pageSize} results (unless it's the final page):"); foreach (Commitment item in singlePage) { // Do something with each item Console.WriteLine(item); } // Store the pageToken, for when the next page is required. string nextPageToken = singlePage.NextPageToken; // End snippet }
/// <summary>Snippet for List</summary> public void ListRequestObject() { // Snippet: List(ListRegionCommitmentsRequest, CallSettings) // Create client RegionCommitmentsClient regionCommitmentsClient = RegionCommitmentsClient.Create(); // Initialize request argument(s) ListRegionCommitmentsRequest request = new ListRegionCommitmentsRequest { PageToken = "", MaxResults = 0U, Filter = "", Region = "", OrderBy = "", Project = "", ReturnPartialSuccess = false, }; // Make the request CommitmentList response = regionCommitmentsClient.List(request); // End snippet }
/// <summary>Snippet for ListAsync</summary> public async Task ListRequestObjectAsync() { // Snippet: ListAsync(ListRegionCommitmentsRequest, CallSettings) // Additional: ListAsync(ListRegionCommitmentsRequest, CancellationToken) // Create client RegionCommitmentsClient regionCommitmentsClient = await RegionCommitmentsClient.CreateAsync(); // Initialize request argument(s) ListRegionCommitmentsRequest request = new ListRegionCommitmentsRequest { PageToken = "", MaxResults = 0U, Filter = "", Region = "", OrderBy = "", Project = "", ReturnPartialSuccess = false, }; // Make the request CommitmentList response = await regionCommitmentsClient.ListAsync(request); // End snippet }
/// <summary> /// Retrieves a list of commitments contained within the specified region. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A pageable asynchronous sequence of <see cref="Commitment"/> resources.</returns> public override gax::PagedAsyncEnumerable <CommitmentList, Commitment> ListAsync(ListRegionCommitmentsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListRegionCommitmentsRequest(ref request, ref callSettings); return(new gaxgrpc::GrpcPagedAsyncEnumerable <ListRegionCommitmentsRequest, CommitmentList, Commitment>(_callList, request, callSettings)); }
partial void Modify_ListRegionCommitmentsRequest(ref ListRegionCommitmentsRequest request, ref gaxgrpc::CallSettings settings);
/// <summary> /// Retrieves a list of commitments contained within the specified region. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A pageable asynchronous sequence of <see cref="Commitment"/> resources.</returns> public virtual gax::PagedAsyncEnumerable <CommitmentList, Commitment> ListAsync(ListRegionCommitmentsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();
/// <summary> /// Retrieves a list of commitments contained within the specified region. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public override stt::Task <CommitmentList> ListAsync(ListRegionCommitmentsRequest request, gaxgrpc::CallSettings callSettings = null) { Modify_ListRegionCommitmentsRequest(ref request, ref callSettings); return(_callList.Async(request, callSettings)); }
/// <summary> /// Retrieves a list of commitments contained within the specified region. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="cancellationToken">A <see cref="st::CancellationToken"/> to use for this RPC.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <CommitmentList> ListAsync(ListRegionCommitmentsRequest request, st::CancellationToken cancellationToken) => ListAsync(request, gaxgrpc::CallSettings.FromCancellationToken(cancellationToken));
/// <summary> /// Retrieves a list of commitments contained within the specified region. /// </summary> /// <param name="request">The request object containing all of the parameters for the API call.</param> /// <param name="callSettings">If not null, applies overrides to this RPC call.</param> /// <returns>A Task containing the RPC response.</returns> public virtual stt::Task <CommitmentList> ListAsync(ListRegionCommitmentsRequest request, gaxgrpc::CallSettings callSettings = null) => throw new sys::NotImplementedException();