< Summary

Class:Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.ErrorBody
Assembly:Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Runtime\src\Generated\Models\ErrorBody.cs
Covered lines:3
Uncovered lines:10
Coverable lines:13
Total lines:77
Line coverage:23% (3 of 13)
Covered branches:0
Total branches:4
Branch coverage:0% (0 of 4)

Metrics

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

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Runtime\src\Generated\Models\ErrorBody.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.Language.LUIS.Runtime.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Linq;
 16
 17    /// <summary>
 18    /// Represents the definition of the error that occurred.
 19    /// </summary>
 20    public partial class ErrorBody
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the ErrorBody class.
 24        /// </summary>
 225        public ErrorBody()
 26        {
 27            CustomInit();
 228        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the ErrorBody class.
 32        /// </summary>
 33        /// <param name="code">The error code.</param>
 34        /// <param name="message">The error message.</param>
 035        public ErrorBody(string code, string message)
 36        {
 037            Code = code;
 038            Message = message;
 39            CustomInit();
 040        }
 41
 42        /// <summary>
 43        /// An initialization method that performs custom operations like setting defaults
 44        /// </summary>
 45        partial void CustomInit();
 46
 47        /// <summary>
 48        /// Gets or sets the error code.
 49        /// </summary>
 50        [JsonProperty(PropertyName = "code")]
 451        public string Code { get; set; }
 52
 53        /// <summary>
 54        /// Gets or sets the error message.
 55        /// </summary>
 56        [JsonProperty(PropertyName = "message")]
 057        public string Message { get; set; }
 58
 59        /// <summary>
 60        /// Validate the object.
 61        /// </summary>
 62        /// <exception cref="ValidationException">
 63        /// Thrown if validation fails
 64        /// </exception>
 65        public virtual void Validate()
 66        {
 067            if (Code == null)
 68            {
 069                throw new ValidationException(ValidationRules.CannotBeNull, "Code");
 70            }
 071            if (Message == null)
 72            {
 073                throw new ValidationException(ValidationRules.CannotBeNull, "Message");
 74            }
 075        }
 76    }
 77}