public virtual Response Restore(DeletedShare deletedShare, CancellationToken cancellationToken = default)
        {
            Argument.AssertNotNull(deletedShare, nameof(deletedShare));

            using var scope = _fileShareClientDiagnostics.CreateScope("FileShareResource.Restore");
            scope.Start();
            try
            {
                var response = _fileShareRestClient.Restore(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, deletedShare, cancellationToken);
                return(response);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }
Exemplo n.º 2
0
        public virtual Response Restore(DeletedShare deletedShare, CancellationToken cancellationToken = default)
        {
            if (deletedShare == null)
            {
                throw new ArgumentNullException(nameof(deletedShare));
            }

            using var scope = _clientDiagnostics.CreateScope("FileShare.Restore");
            scope.Start();
            try
            {
                var response = _restClient.Restore(Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, deletedShare, cancellationToken);
                return(response);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }