< Summary

Class:Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker.Models.ReplaceKbDTO
Assembly:Microsoft.Azure.CognitiveServices.Knowledge.QnAMaker
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Knowledge.QnAMaker\src\Generated\Models\ReplaceKbDTO.cs
Covered lines:0
Uncovered lines:13
Coverable lines:13
Total lines:80
Line coverage:0% (0 of 13)
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_QnAList()-0%100%
Validate()-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Knowledge.QnAMaker\src\Generated\Models\ReplaceKbDTO.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.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// Post body schema for Replace KB operation.
 21    /// </summary>
 22    public partial class ReplaceKbDTO
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the ReplaceKbDTO class.
 26        /// </summary>
 027        public ReplaceKbDTO()
 28        {
 29            CustomInit();
 030        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the ReplaceKbDTO class.
 34        /// </summary>
 35        /// <param name="qnAList">List of Q-A (QnADTO) to be added to the
 36        /// knowledgebase. Q-A Ids are assigned by the service and should be
 37        /// omitted.</param>
 038        public ReplaceKbDTO(IList<QnADTO> qnAList)
 39        {
 040            QnAList = qnAList;
 41            CustomInit();
 042        }
 43
 44        /// <summary>
 45        /// An initialization method that performs custom operations like setting defaults
 46        /// </summary>
 47        partial void CustomInit();
 48
 49        /// <summary>
 50        /// Gets or sets list of Q-A (QnADTO) to be added to the knowledgebase.
 51        /// Q-A Ids are assigned by the service and should be omitted.
 52        /// </summary>
 53        [JsonProperty(PropertyName = "qnAList")]
 054        public IList<QnADTO> QnAList { get; set; }
 55
 56        /// <summary>
 57        /// Validate the object.
 58        /// </summary>
 59        /// <exception cref="ValidationException">
 60        /// Thrown if validation fails
 61        /// </exception>
 62        public virtual void Validate()
 63        {
 064            if (QnAList == null)
 65            {
 066                throw new ValidationException(ValidationRules.CannotBeNull, "QnAList");
 67            }
 068            if (QnAList != null)
 69            {
 070                foreach (var element in QnAList)
 71                {
 072                    if (element != null)
 73                    {
 074                        element.Validate();
 75                    }
 76                }
 77            }
 078        }
 79    }
 80}