public virtual Response <PrivateLinkResource> Get(string groupName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(groupName, nameof(groupName)); using var scope = _privateLinkResourceClientDiagnostics.CreateScope("PrivateLinkResourceCollection.Get"); scope.Start(); try { var response = _privateLinkResourceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, groupName, cancellationToken); if (response.Value == null) { throw _privateLinkResourceClientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new PrivateLinkResource(ArmClient, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <PrivateLinkResource> Get(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("PrivateLinkResource.Get"); scope.Start(); try { var response = _privateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new PrivateLinkResource(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }