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