LuisResult.cs
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // Licensed under the MIT License. See License.txt in the project root for
3 // license information.
4 //
5 // Code generated by Microsoft (R) AutoRest Code Generator 0.16.0.0
6 // Changes may cause incorrect behavior and will be lost if the code is
7 // regenerated.
8 
9 namespace Microsoft.Bot.Builder.Luis.Models
10 {
11  using System;
12  using System.Linq;
13  using System.Collections.Generic;
14  using Newtonsoft.Json;
15  using Microsoft.Rest;
16  using Microsoft.Rest.Serialization;
17 
18  public partial class LuisResult
19  {
23  public LuisResult() { }
24 
28  public LuisResult(string query, IList<EntityRecommendation> entities, IntentRecommendation topScoringIntent = default(IntentRecommendation), IList<IntentRecommendation> intents = default(IList<IntentRecommendation>), IList<CompositeEntity> compositeEntities = default(IList<CompositeEntity>), DialogResponse dialog = default(DialogResponse), string alteredQuery = default(string))
29  {
30  Query = query;
31  TopScoringIntent = topScoringIntent;
32  Intents = intents;
33  Entities = entities;
34  CompositeEntities = compositeEntities;
35  Dialog = dialog;
36  AlteredQuery = alteredQuery;
37  }
38 
42  [JsonProperty(PropertyName = "query")]
43  public string Query { get; set; }
44 
47  [JsonProperty(PropertyName = "topScoringIntent")]
48  public IntentRecommendation TopScoringIntent { get; set; }
49 
53  [JsonProperty(PropertyName = "intents")]
54  public IList<IntentRecommendation> Intents { get; set; }
55 
59  [JsonProperty(PropertyName = "entities")]
60  public IList<EntityRecommendation> Entities { get; set; }
61 
65  [JsonProperty(PropertyName = "compositeEntities")]
66  public IList<CompositeEntity> CompositeEntities { get; set; }
67 
70  [JsonProperty(PropertyName = "dialog")]
71  public DialogResponse Dialog { get; set; }
72 
78  [JsonProperty(PropertyName = "alteredQuery")]
79  public string AlteredQuery { get; set; }
80 
84  public virtual void Validate()
85  {
86  if (Query == null)
87  {
88  throw new ValidationException(ValidationRules.CannotBeNull, "Query");
89  }
90  if (Entities == null)
91  {
92  throw new ValidationException(ValidationRules.CannotBeNull, "Entities");
93  }
94  if (this.Entities != null)
95  {
96  foreach (var element in this.Entities)
97  {
98  if (element != null)
99  {
100  element.Validate();
101  }
102  }
103  }
104  if (this.CompositeEntities != null)
105  {
106  foreach (var element1 in this.CompositeEntities)
107  {
108  if (element1 != null)
109  {
110  element1.Validate();
111  }
112  }
113  }
114  }
115  }
116 }
LuisResult(string query, IList< EntityRecommendation > entities, IntentRecommendation topScoringIntent=default(IntentRecommendation), IList< IntentRecommendation > intents=default(IList< IntentRecommendation >), IList< CompositeEntity > compositeEntities=default(IList< CompositeEntity >), DialogResponse dialog=default(DialogResponse), string alteredQuery=default(string))
Initializes a new instance of the LuisResult class.
Definition: LuisResult.cs:28
LuisResult()
Initializes a new instance of the LuisResult class.
Definition: LuisResult.cs:23
LUIS intent recommendation. Look at https://www.luis.ai/Help for more information.
Definition: FormDialog.cs:845
virtual void Validate()
Validate the object. Throws ValidationException if validation fails.
Definition: LuisResult.cs:84