< Summary

Class:Microsoft.Azure.CognitiveServices.FormRecognizer.Models.ComputerVisionError
Assembly:Microsoft.Azure.CognitiveServices.Vision.FormRecognizer
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\FormRecognizer\src\Generated\Models\ComputerVisionError.cs
Covered lines:0
Uncovered lines:15
Coverable lines:15
Total lines:87
Line coverage:0% (0 of 15)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Code()-0%100%
get_Message()-0%100%
get_RequestId()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\FormRecognizer\src\Generated\Models\ComputerVisionError.cs

#LineLine coverage
 1// <auto-generated>
 2// Copyright (c) Microsoft Corporation. All rights reserved.
 3// Licensed under the MIT License. See License.txt in the project root for
 4// license information.
 5//
 6// Code generated by Microsoft (R) AutoRest Code Generator.
 7// Changes may cause incorrect behavior and will be lost if the code is
 8// regenerated.
 9// </auto-generated>
 10
 11namespace Microsoft.Azure.CognitiveServices.FormRecognizer.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Linq;
 16
 17    /// <summary>
 18    /// Details about the API request error.
 19    /// </summary>
 20    public partial class ComputerVisionError
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the ComputerVisionError class.
 24        /// </summary>
 025        public ComputerVisionError()
 26        {
 27            CustomInit();
 028        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the ComputerVisionError class.
 32        /// </summary>
 33        /// <param name="code">The error code.</param>
 34        /// <param name="message">A message explaining the error reported by
 35        /// the service.</param>
 36        /// <param name="requestId">A unique request identifier.</param>
 037        public ComputerVisionError(object code, string message, string requestId = default(string))
 38        {
 039            Code = code;
 040            Message = message;
 041            RequestId = requestId;
 42            CustomInit();
 043        }
 44
 45        /// <summary>
 46        /// An initialization method that performs custom operations like setting defaults
 47        /// </summary>
 48        partial void CustomInit();
 49
 50        /// <summary>
 51        /// Gets or sets the error code.
 52        /// </summary>
 53        [JsonProperty(PropertyName = "code")]
 054        public object Code { get; set; }
 55
 56        /// <summary>
 57        /// Gets or sets a message explaining the error reported by the
 58        /// service.
 59        /// </summary>
 60        [JsonProperty(PropertyName = "message")]
 061        public string Message { get; set; }
 62
 63        /// <summary>
 64        /// Gets or sets a unique request identifier.
 65        /// </summary>
 66        [JsonProperty(PropertyName = "requestId")]
 067        public string RequestId { get; set; }
 68
 69        /// <summary>
 70        /// Validate the object.
 71        /// </summary>
 72        /// <exception cref="ValidationException">
 73        /// Thrown if validation fails
 74        /// </exception>
 75        public virtual void Validate()
 76        {
 077            if (Code == null)
 78            {
 079                throw new ValidationException(ValidationRules.CannotBeNull, "Code");
 80            }
 081            if (Message == null)
 82            {
 083                throw new ValidationException(ValidationRules.CannotBeNull, "Message");
 84            }
 085        }
 86    }
 87}