ScVmmAvailabilitySetResource IOperationSource <ScVmmAvailabilitySetResource> .CreateResult(Response response, CancellationToken cancellationToken) { using var document = JsonDocument.Parse(response.ContentStream); var data = ScVmmAvailabilitySetData.DeserializeScVmmAvailabilitySetData(document.RootElement); return(new ScVmmAvailabilitySetResource(_client, data)); }
public async Task <Response <ScVmmAvailabilitySetData> > GetAsync(string subscriptionId, string resourceGroupName, string availabilitySetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(availabilitySetName, nameof(availabilitySetName)); using var message = CreateGetRequest(subscriptionId, resourceGroupName, availabilitySetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { ScVmmAvailabilitySetData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); value = ScVmmAvailabilitySetData.DeserializeScVmmAvailabilitySetData(document.RootElement); return(Response.FromValue(value, message.Response)); }