public virtual Pageable <AppPlatformAppResource> GetAll(CancellationToken cancellationToken = default) { Page <AppPlatformAppResource> FirstPageFunc(int?pageSizeHint) { using var scope = _appPlatformAppResourceAppsClientDiagnostics.CreateScope("AppPlatformAppResourceCollection.GetAll"); scope.Start(); try { var response = _appPlatformAppResourceAppsRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); return(Page.FromValues(response.Value.Value.Select(value => new AppPlatformAppResource(Client, value)), response.Value.NextLink, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } } Page <AppPlatformAppResource> NextPageFunc(string nextLink, int?pageSizeHint) { using var scope = _appPlatformAppResourceAppsClientDiagnostics.CreateScope("AppPlatformAppResourceCollection.GetAll"); scope.Start(); try { var response = _appPlatformAppResourceAppsRestClient.ListNextPage(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); 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.CreateEnumerable(FirstPageFunc, NextPageFunc)); }