CompositeEntity.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 
22  public partial class CompositeEntity
23  {
27  public CompositeEntity() { }
28 
32  public CompositeEntity(string parentType, string value, IList<CompositeChild> children)
33  {
34  ParentType = parentType;
35  Value = value;
36  Children = children;
37  }
38 
42  [JsonProperty(PropertyName = "parentType")]
43  public string ParentType { get; set; }
44 
48  [JsonProperty(PropertyName = "value")]
49  public string Value { get; set; }
50 
53  [JsonProperty(PropertyName = "children")]
54  public IList<CompositeChild> Children { get; set; }
55 
59  public virtual void Validate()
60  {
61  if (ParentType == null)
62  {
63  throw new ValidationException(ValidationRules.CannotBeNull, "ParentType");
64  }
65  if (Value == null)
66  {
67  throw new ValidationException(ValidationRules.CannotBeNull, "Value");
68  }
69  if (Children == null)
70  {
71  throw new ValidationException(ValidationRules.CannotBeNull, "Children");
72  }
73  if (this.Children != null)
74  {
75  foreach (var element in this.Children)
76  {
77  if (element != null)
78  {
79  element.Validate();
80  }
81  }
82  }
83  }
84  }
85 }
virtual void Validate()
Validate the object. Throws ValidationException if validation fails.
CompositeEntity(string parentType, string value, IList< CompositeChild > children)
Initializes a new instance of the CompositeEntity class.
Luis composite entity. Look at https://www.luis.ai/Help for more information.
CompositeEntity()
Initializes a new instance of the CompositeEntity class.