public virtual Response <DiskRestorePointResource> Get(string diskRestorePointName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(diskRestorePointName, nameof(diskRestorePointName)); using var scope = _diskRestorePointClientDiagnostics.CreateScope("DiskRestorePointCollection.Get"); scope.Start(); try { var response = _diskRestorePointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, diskRestorePointName, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new DiskRestorePointResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <DiskRestorePoint> Get(string diskRestorePointName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("DiskRestorePointCollection.Get"); scope.Start(); try { if (diskRestorePointName == null) { throw new ArgumentNullException(nameof(diskRestorePointName)); } var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, Id.Name, diskRestorePointName, cancellationToken: cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new DiskRestorePoint(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <DiskRestorePoint> Get(CancellationToken cancellationToken = default) { using var scope = _diskRestorePointClientDiagnostics.CreateScope("DiskRestorePoint.Get"); scope.Start(); try { var response = _diskRestorePointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _diskRestorePointClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new DiskRestorePoint(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }