Exemple #1
0
 public virtual Response <IReadOnlyList <ServiceAssociationLink> > GetServiceAssociationLinks(CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("Subnet.GetServiceAssociationLinks");
     scope.Start();
     try
     {
         var response = _serviceAssociationLinksRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
         return(Response.FromValue(response.Value.Value, response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
Exemple #2
0
        public virtual Pageable <ServiceAssociationLink> GetServiceAssociationLinks(CancellationToken cancellationToken = default)
        {
            Page <ServiceAssociationLink> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _serviceAssociationLinksClientDiagnostics.CreateScope("Subnet.GetServiceAssociationLinks");
                scope.Start();
                try
                {
                    var response = _serviceAssociationLinksRestClient.List(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, 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));
        }