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