public async virtual Task <Response <DeletedSite> > GetAsync(string deletedSiteId, CancellationToken cancellationToken = default)
        {
            if (deletedSiteId == null)
            {
                throw new ArgumentNullException(nameof(deletedSiteId));
            }

            using var scope = _clientDiagnostics.CreateScope("DeletedSiteCollection.Get");
            scope.Start();
            try
            {
                var response = await _globalRestClient.GetDeletedWebAppAsync(Id.SubscriptionId, deletedSiteId, cancellationToken).ConfigureAwait(false);

                if (response.Value == null)
                {
                    throw await _clientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false);
                }
                return(Response.FromValue(new DeletedSite(Parent, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Esempio n. 2
0
        public async virtual Task <Response <DeletedSite> > GetAsync(CancellationToken cancellationToken = default)
        {
            using var scope = _deletedSiteGlobalClientDiagnostics.CreateScope("DeletedSite.Get");
            scope.Start();
            try
            {
                var response = await _deletedSiteGlobalRestClient.GetDeletedWebAppAsync(Id.SubscriptionId, Id.Name, cancellationToken).ConfigureAwait(false);

                if (response.Value == null)
                {
                    throw await _deletedSiteGlobalClientDiagnostics.CreateRequestFailedExceptionAsync(response.GetRawResponse()).ConfigureAwait(false);
                }
                return(Response.FromValue(new DeletedSite(Client, response.Value), response.GetRawResponse()));
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }