public async virtual Task <Response <IReadOnlyList <Snapshot> > > GetDeletedWebAppSnapshotsAsync(CancellationToken cancellationToken = default)
        {
            using var scope = _clientDiagnostics.CreateScope("DeletedSite.GetDeletedWebAppSnapshots");
            scope.Start();
            try
            {
                var response = await _globalRestClient.GetDeletedWebAppSnapshotsAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false);

                return(Response.FromValue(response.Value, response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemple #2
0
        public virtual AsyncPageable <Snapshot> GetDeletedWebAppSnapshotsAsync(CancellationToken cancellationToken = default)
        {
            async Task <Page <Snapshot> > FirstPageFunc(int?pageSizeHint)
            {
                using var scope = _deletedSiteGlobalClientDiagnostics.CreateScope("DeletedSite.GetDeletedWebAppSnapshots");
                scope.Start();
                try
                {
                    var response = await _deletedSiteGlobalRestClient.GetDeletedWebAppSnapshotsAsync(Id.SubscriptionId, Id.Name, cancellationToken : cancellationToken).ConfigureAwait(false);

                    return(Page.FromValues(response.Value, null, response.GetRawResponse()));
                }
                catch (Exception e)
                {
                    scope.Failed(e);
                    throw;
                }
            }

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