public async Task <Response <PrivateEndpointConnectionData> > GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) { if (subscriptionId == null) { throw new ArgumentNullException(nameof(subscriptionId)); } if (resourceGroupName == null) { throw new ArgumentNullException(nameof(resourceGroupName)); } if (vaultName == null) { throw new ArgumentNullException(nameof(vaultName)); } if (privateEndpointConnectionName == null) { throw new ArgumentNullException(nameof(privateEndpointConnectionName)); } using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { PrivateEndpointConnectionData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); value = PrivateEndpointConnectionData.DeserializePrivateEndpointConnectionData(document.RootElement); return(Response.FromValue(value, message.Response)); }
PrivateEndpointConnection IOperationSource <PrivateEndpointConnection> .CreateResult(Response response, CancellationToken cancellationToken) { using var document = JsonDocument.Parse(response.ContentStream); var data = PrivateEndpointConnectionData.DeserializePrivateEndpointConnectionData(document.RootElement); return(new PrivateEndpointConnection(_client, data)); }