< Summary

Class:Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models.PredictionRequest
Assembly:Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime
File(s):C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Runtime\src\Generated\Models\PredictionRequest.cs
Covered lines:17
Uncovered lines:6
Coverable lines:23
Total lines:115
Line coverage:73.9% (17 of 23)
Covered branches:14
Total branches:14
Branch coverage:100% (14 of 14)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor()-100%100%
.ctor(...)-0%100%
get_Query()-100%100%
get_Options()-100%100%
get_ExternalEntities()-100%100%
get_DynamicLists()-100%100%
Validate()-100%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\cognitiveservices\Language.LUIS.Runtime\src\Generated\Models\PredictionRequest.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.Collections;
 16    using System.Collections.Generic;
 17    using System.Linq;
 18
 19    /// <summary>
 20    /// Represents the prediction request parameters.
 21    /// </summary>
 22    public partial class PredictionRequest
 23    {
 24        /// <summary>
 25        /// Initializes a new instance of the PredictionRequest class.
 26        /// </summary>
 827        public PredictionRequest()
 28        {
 29            CustomInit();
 830        }
 31
 32        /// <summary>
 33        /// Initializes a new instance of the PredictionRequest class.
 34        /// </summary>
 35        /// <param name="query">The query to predict.</param>
 36        /// <param name="options">The custom options defined for this
 37        /// request.</param>
 38        /// <param name="externalEntities">The externally predicted entities
 39        /// for this request.</param>
 40        /// <param name="dynamicLists">The dynamically created list entities
 41        /// for this request.</param>
 042        public PredictionRequest(string query, PredictionRequestOptions options = default(PredictionRequestOptions), ILi
 43        {
 044            Query = query;
 045            Options = options;
 046            ExternalEntities = externalEntities;
 047            DynamicLists = dynamicLists;
 48            CustomInit();
 049        }
 50
 51        /// <summary>
 52        /// An initialization method that performs custom operations like setting defaults
 53        /// </summary>
 54        partial void CustomInit();
 55
 56        /// <summary>
 57        /// Gets or sets the query to predict.
 58        /// </summary>
 59        [JsonProperty(PropertyName = "query")]
 2060        public string Query { get; set; }
 61
 62        /// <summary>
 63        /// Gets or sets the custom options defined for this request.
 64        /// </summary>
 65        [JsonProperty(PropertyName = "options")]
 1066        public PredictionRequestOptions Options { get; set; }
 67
 68        /// <summary>
 69        /// Gets or sets the externally predicted entities for this request.
 70        /// </summary>
 71        [JsonProperty(PropertyName = "externalEntities")]
 2072        public IList<ExternalEntity> ExternalEntities { get; set; }
 73
 74        /// <summary>
 75        /// Gets or sets the dynamically created list entities for this
 76        /// request.
 77        /// </summary>
 78        [JsonProperty(PropertyName = "dynamicLists")]
 2079        public IList<DynamicList> DynamicLists { get; set; }
 80
 81        /// <summary>
 82        /// Validate the object.
 83        /// </summary>
 84        /// <exception cref="ValidationException">
 85        /// Thrown if validation fails
 86        /// </exception>
 87        public virtual void Validate()
 88        {
 889            if (Query == null)
 90            {
 291                throw new ValidationException(ValidationRules.CannotBeNull, "Query");
 92            }
 693            if (ExternalEntities != null)
 94            {
 1695                foreach (var element in ExternalEntities)
 96                {
 497                    if (element != null)
 98                    {
 499                        element.Validate();
 100                    }
 101                }
 102            }
 6103            if (DynamicLists != null)
 104            {
 16105                foreach (var element1 in DynamicLists)
 106                {
 4107                    if (element1 != null)
 108                    {
 4109                        element1.Validate();
 110                    }
 111                }
 112            }
 6113        }
 114    }
 115}