public virtual Pageable <AutoApprovedPrivateLinkService> GetAutoApprovedPrivateLinkServicesByResourceGroup(CancellationToken cancellationToken = default) { Page <AutoApprovedPrivateLinkService> FirstPageFunc(int?pageSizeHint) { using var scope = _clientDiagnostics.CreateScope("PrivateLinkService.GetAutoApprovedPrivateLinkServicesByResourceGroup"); scope.Start(); try { var response = _restClient.GetAutoApprovedPrivateLinkServicesByResourceGroup(Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } } Page <AutoApprovedPrivateLinkService> NextPageFunc(string nextLink, int?pageSizeHint) { using var scope = _clientDiagnostics.CreateScope("PrivateLinkService.GetAutoApprovedPrivateLinkServicesByResourceGroup"); scope.Start(); try { var response = _restClient.GetAutoApprovedPrivateLinkServicesByResourceGroupNextPage(nextLink, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken); return(Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } } return(PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc)); }