< Summary

Class:Azure.AI.FormRecognizer.Models.ErrorResponse
Assembly:Azure.AI.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ErrorResponse.cs
C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ErrorResponse.Serialization.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:59
Line coverage:0% (0 of 11)
Covered branches:0
Total branches:6
Branch coverage:0% (0 of 6)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
get_Error()-0%100%
DeserializeErrorResponse(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ErrorResponse.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9
 10namespace Azure.AI.FormRecognizer.Models
 11{
 12    /// <summary> The ErrorResponse. </summary>
 13    internal partial class ErrorResponse
 14    {
 15        /// <summary> Initializes a new instance of ErrorResponse. </summary>
 16        /// <param name="error"> . </param>
 17        /// <exception cref="ArgumentNullException"> <paramref name="error"/> is null. </exception>
 018        internal ErrorResponse(FormRecognizerError error)
 19        {
 020            if (error == null)
 21            {
 022                throw new ArgumentNullException(nameof(error));
 23            }
 24
 025            Error = error;
 026        }
 27
 028        public FormRecognizerError Error { get; }
 29    }
 30}

C:\Git\azure-sdk-for-net\sdk\formrecognizer\Azure.AI.FormRecognizer\src\Generated\Models\ErrorResponse.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.AI.FormRecognizer.Models
 12{
 13    internal partial class ErrorResponse
 14    {
 15        internal static ErrorResponse DeserializeErrorResponse(JsonElement element)
 16        {
 017            FormRecognizerError error = default;
 018            foreach (var property in element.EnumerateObject())
 19            {
 020                if (property.NameEquals("error"))
 21                {
 022                    error = FormRecognizerError.DeserializeFormRecognizerError(property.Value);
 23                    continue;
 24                }
 25            }
 026            return new ErrorResponse(error);
 27        }
 28    }
 29}