public async Task UploadRevocationResultsAsync()

in src/CsrValidation/csharp/ScepValidation/IntuneRevocationClient.cs [181:209]


        public async Task UploadRevocationResultsAsync(string transactionId, List<CARevocationResult> requestResults)
        {
            // Validate the parameters
            if (string.IsNullOrWhiteSpace(transactionId))
            {
                throw new ArgumentNullException(nameof(transactionId));
            }
            if (requestResults == null || requestResults.Count == 0)
            {
                throw new ArgumentNullException(nameof(requestResults));
            }

            // Create the Request body containing the results to send to Intune
            JObject requestBody = new JObject(new JProperty("results", JToken.FromObject(requestResults)));

            // Perform the Upload results call 
            JObject result = await PostAsync(requestBody, UPLOADREVOCATIONRESULTS_URL, transactionId);

            if (result == null || result["value"] == null)
            {
                throw new IntuneClientException($"Unable to deeserialize value returned from Intune. No 'value' property is present in the resposne. JSON: {result}.");
            }

            // Parse the result being sent back from Intune
            if (!bool.TryParse((string)result["value"], out bool postSuccessful) || !postSuccessful)
            {
                throw new IntuneClientException($"Results not successfully recorded in Intune. Expected 'true' from service. Recieved: '{result}'");
            }
        }