public virtual Response <PrivateEndpointConnection> Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnectionContainer.Get"); scope.Start(); try { if (privateEndpointConnectionName == null) { throw new ArgumentNullException(nameof(privateEndpointConnectionName)); } var response = _restClient.Get(Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new PrivateEndpointConnection(Parent, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <PrivateEndpointConnection> Get(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("PrivateEndpointConnection.Get"); scope.Start(); try { var response = _restClient.Get(Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new PrivateEndpointConnection(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }