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