public virtual AsyncPageable <AppPlatformAppResource> GetAllAsync(CancellationToken cancellationToken = default) { async Task <Page <AppPlatformAppResource> > FirstPageFunc(int?pageSizeHint) { using var scope = _appPlatformAppResourceAppsClientDiagnostics.CreateScope("AppPlatformAppResourceCollection.GetAll"); scope.Start(); try { var response = await _appPlatformAppResourceAppsRestClient.ListAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken : cancellationToken).ConfigureAwait(false); return(Page.FromValues(response.Value.Value.Select(value => new AppPlatformAppResource(Client, value)), response.Value.NextLink, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } } async Task <Page <AppPlatformAppResource> > NextPageFunc(string nextLink, int?pageSizeHint) { using var scope = _appPlatformAppResourceAppsClientDiagnostics.CreateScope("AppPlatformAppResourceCollection.GetAll"); scope.Start(); try { var response = await _appPlatformAppResourceAppsRestClient.ListNextPageAsync(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken : cancellationToken).ConfigureAwait(false); return(Page.FromValues(response.Value.Value.Select(value => new AppPlatformAppResource(Client, value)), response.Value.NextLink, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } } return(PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc)); }