public virtual Response <RestorePointGroup> Get(RestorePointCollectionExpandOptions?expand = null, CancellationToken cancellationToken = default) { using var scope = _restorePointGroupRestorePointCollectionsClientDiagnostics.CreateScope("RestorePointGroup.Get"); scope.Start(); try { var response = _restorePointGroupRestorePointCollectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expand, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new RestorePointGroup(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <RestorePointGroupResource> Get(string restorePointGroupName, RestorePointGroupExpand?expand = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(restorePointGroupName, nameof(restorePointGroupName)); using var scope = _restorePointGroupRestorePointCollectionsClientDiagnostics.CreateScope("RestorePointGroupCollection.Get"); scope.Start(); try { var response = _restorePointGroupRestorePointCollectionsRestClient.Get(restorePointGroupName, Id.SubscriptionId, Id.ResourceGroupName, expand, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new RestorePointGroupResource(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <RestorePointCollection> Get(string restorePointCollectionName, RestorePointCollectionExpandOptions?expand = null, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("RestorePointCollectionContainer.Get"); scope.Start(); try { if (restorePointCollectionName == null) { throw new ArgumentNullException(nameof(restorePointCollectionName)); } var response = _restClient.Get(Id.ResourceGroupName, restorePointCollectionName, expand, cancellationToken: cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new RestorePointCollection(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }