예제 #1
0
        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));
        }
예제 #2
0
        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));
            }