コード例 #1
0
 public virtual Response <IReadOnlyList <Models.Sku> > GetSkus(CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("WebPubSub.GetSkus");
     scope.Start();
     try
     {
         var response = _webPubSubRestClient.ListSkus(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken);
         return(Response.FromValue(response.Value.Value, response.GetRawResponse()));
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }
コード例 #2
0
        public virtual Pageable <Sku> GetSkus(CancellationToken cancellationToken = default)
        {
            Page <Sku> FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _webPubSubClientDiagnostics.CreateScope("WebPubSub.GetSkus");
                scope.Start();
                try
                {
                    var response = _webPubSubRestClient.ListSkus(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));
        }