< Summary

Class:Microsoft.Azure.CognitiveServices.Personalizer.Models.ErrorResponse
Assembly:Microsoft.Azure.CognitiveServices.Personalizer
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Personalizer\src\Generated\Models\ErrorResponse.cs
Covered lines:0
Uncovered lines:11
Coverable lines:11
Total lines:69
Line coverage:0% (0 of 11)
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_Error()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Personalizer\src\Generated\Models\ErrorResponse.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.Personalizer.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Linq;
 16
 17    /// <summary>
 18    /// Used to return an error to the client
 19    /// </summary>
 20    public partial class ErrorResponse
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the ErrorResponse class.
 24        /// </summary>
 025        public ErrorResponse()
 26        {
 27            CustomInit();
 028        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the ErrorResponse class.
 32        /// </summary>
 33        /// <param name="error">The error object.</param>
 034        public ErrorResponse(PersonalizerError error)
 35        {
 036            Error = error;
 37            CustomInit();
 038        }
 39
 40        /// <summary>
 41        /// An initialization method that performs custom operations like setting defaults
 42        /// </summary>
 43        partial void CustomInit();
 44
 45        /// <summary>
 46        /// Gets or sets the error object.
 47        /// </summary>
 48        [JsonProperty(PropertyName = "error")]
 049        public PersonalizerError Error { get; set; }
 50
 51        /// <summary>
 52        /// Validate the object.
 53        /// </summary>
 54        /// <exception cref="ValidationException">
 55        /// Thrown if validation fails
 56        /// </exception>
 57        public virtual void Validate()
 58        {
 059            if (Error == null)
 60            {
 061                throw new ValidationException(ValidationRules.CannotBeNull, "Error");
 62            }
 063            if (Error != null)
 64            {
 065                Error.Validate();
 66            }
 067        }
 68    }
 69}