< Summary

Class:Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models.UpdateQnaDTO
Assembly:Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Knowledge.QnAMaker\src\Generated\Models\UpdateQnaDTO.cs
Covered lines:0
Uncovered lines:24
Coverable lines:24
Total lines:122
Line coverage:0% (0 of 24)
Covered branches:0
Total branches:8
Branch coverage:0% (0 of 8)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-0%100%
.ctor(...)-0%100%
get_Id()-0%100%
get_Answer()-0%100%
get_Source()-0%100%
get_Questions()-0%100%
get_Metadata()-0%100%
get_Context()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Knowledge.QnAMaker\src\Generated\Models\UpdateQnaDTO.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.Knowledge.QnAMaker.Models
 12{
 13    using Microsoft.Rest;
 14    using Newtonsoft.Json;
 15    using System.Linq;
 16
 17    /// <summary>
 18    /// PATCH Body schema for Update Qna List
 19    /// </summary>
 20    public partial class UpdateQnaDTO
 21    {
 22        /// <summary>
 23        /// Initializes a new instance of the UpdateQnaDTO class.
 24        /// </summary>
 025        public UpdateQnaDTO()
 26        {
 27            CustomInit();
 028        }
 29
 30        /// <summary>
 31        /// Initializes a new instance of the UpdateQnaDTO class.
 32        /// </summary>
 33        /// <param name="id">Unique id for the Q-A</param>
 34        /// <param name="answer">Answer text</param>
 35        /// <param name="source">Source from which Q-A was indexed. eg.
 36        /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs</param>
 37        /// <param name="questions">List of questions associated with the
 38        /// answer.</param>
 39        /// <param name="metadata">List of metadata associated with the answer
 40        /// to be updated</param>
 41        /// <param name="context">Context associated with Qna to be
 42        /// updated.</param>
 043        public UpdateQnaDTO(int? id = default(int?), string answer = default(string), string source = default(string), U
 44        {
 045            Id = id;
 046            Answer = answer;
 047            Source = source;
 048            Questions = questions;
 049            Metadata = metadata;
 050            Context = context;
 51            CustomInit();
 052        }
 53
 54        /// <summary>
 55        /// An initialization method that performs custom operations like setting defaults
 56        /// </summary>
 57        partial void CustomInit();
 58
 59        /// <summary>
 60        /// Gets or sets unique id for the Q-A
 61        /// </summary>
 62        [JsonProperty(PropertyName = "id")]
 063        public int? Id { get; set; }
 64
 65        /// <summary>
 66        /// Gets or sets answer text
 67        /// </summary>
 68        [JsonProperty(PropertyName = "answer")]
 069        public string Answer { get; set; }
 70
 71        /// <summary>
 72        /// Gets or sets source from which Q-A was indexed. eg.
 73        /// https://docs.microsoft.com/en-us/azure/cognitive-services/QnAMaker/FAQs
 74        /// </summary>
 75        [JsonProperty(PropertyName = "source")]
 076        public string Source { get; set; }
 77
 78        /// <summary>
 79        /// Gets or sets list of questions associated with the answer.
 80        /// </summary>
 81        [JsonProperty(PropertyName = "questions")]
 082        public UpdateQnaDTOQuestions Questions { get; set; }
 83
 84        /// <summary>
 85        /// Gets or sets list of metadata associated with the answer to be
 86        /// updated
 87        /// </summary>
 88        [JsonProperty(PropertyName = "metadata")]
 089        public UpdateQnaDTOMetadata Metadata { get; set; }
 90
 91        /// <summary>
 92        /// Gets or sets context associated with Qna to be updated.
 93        /// </summary>
 94        [JsonProperty(PropertyName = "context")]
 095        public UpdateQnaDTOContext Context { get; set; }
 96
 97        /// <summary>
 98        /// Validate the object.
 99        /// </summary>
 100        /// <exception cref="ValidationException">
 101        /// Thrown if validation fails
 102        /// </exception>
 103        public virtual void Validate()
 104        {
 0105            if (Id > 2147483647)
 106            {
 0107                throw new ValidationException(ValidationRules.InclusiveMaximum, "Id", 2147483647);
 108            }
 0109            if (Id < 0)
 110            {
 0111                throw new ValidationException(ValidationRules.InclusiveMinimum, "Id", 0);
 112            }
 0113            if (Source != null)
 114            {
 0115                if (Source.Length > 300)
 116                {
 0117                    throw new ValidationException(ValidationRules.MaxLength, "Source", 300);
 118                }
 119            }
 0120        }
 121    }
 122}