Ejemplo n.º 1
0
 public virtual Response <IReadOnlyList <PrivateLinkResource> > GetPrivateLinkResources(CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("DiskAccess.GetPrivateLinkResources");
     scope.Start();
     try
     {
         var response = _diskAccessesRestClient.GetPrivateLinkResources(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         return(Response.FromValue(response.Value.Value, response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Ejemplo n.º 2
0
        public virtual Pageable <PrivateLinkResource> GetPrivateLinkResources(CancellationToken cancellationToken = default)
        {
            Page <PrivateLinkResource> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _diskAccessClientDiagnostics.CreateScope("DiskAccess.GetPrivateLinkResources");
                scope.Start();
                try
                {
                    var response = _diskAccessRestClient.GetPrivateLinkResources(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken: cancellationToken);
                    return(Page.FromValues(response.Value.Value, null, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

            return(PageableHelpers.CreateEnumerable(FirstPageFunc, null));
        }