public virtual Response <VpnSiteLinkConnection> Get(string linkConnectionName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(linkConnectionName, nameof(linkConnectionName)); using var scope = _vpnSiteLinkConnectionClientDiagnostics.CreateScope("VpnSiteLinkConnectionCollection.Get"); scope.Start(); try { var response = _vpnSiteLinkConnectionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, linkConnectionName, cancellationToken); if (response.Value == null) { throw new RequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new VpnSiteLinkConnection(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual Response <VpnSiteLinkConnection> Get(CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("VpnSiteLinkConnection.Get"); scope.Start(); try { var response = _vpnSiteLinkConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) { throw _clientDiagnostics.CreateRequestFailedException(response.GetRawResponse()); } return(Response.FromValue(new VpnSiteLinkConnection(this, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }