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