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