| | | 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 | | |
| | | 11 | | namespace Microsoft.Azure.CognitiveServices.Language.LUIS.Runtime.Models |
| | | 12 | | { |
| | | 13 | | using Microsoft.Rest; |
| | | 14 | | using Newtonsoft.Json; |
| | | 15 | | using System.Linq; |
| | | 16 | | |
| | | 17 | | /// <summary> |
| | | 18 | | /// Defines a user predicted entity that extends an already existing one. |
| | | 19 | | /// </summary> |
| | | 20 | | public partial class ExternalEntity |
| | | 21 | | { |
| | | 22 | | /// <summary> |
| | | 23 | | /// Initializes a new instance of the ExternalEntity class. |
| | | 24 | | /// </summary> |
| | 4 | 25 | | public ExternalEntity() |
| | | 26 | | { |
| | | 27 | | CustomInit(); |
| | 4 | 28 | | } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Initializes a new instance of the ExternalEntity class. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <param name="entityName">The name of the entity to extend.</param> |
| | | 34 | | /// <param name="startIndex">The start character index of the predicted |
| | | 35 | | /// entity.</param> |
| | | 36 | | /// <param name="entityLength">The length of the predicted |
| | | 37 | | /// entity.</param> |
| | | 38 | | /// <param name="resolution">A user supplied custom resolution to |
| | | 39 | | /// return as the entity's prediction.</param> |
| | | 40 | | /// <param name="score">A user supplied score to return as the entity's |
| | | 41 | | /// prediction score.</param> |
| | 0 | 42 | | public ExternalEntity(string entityName, int startIndex, int entityLength, object resolution = default(object), |
| | | 43 | | { |
| | 0 | 44 | | EntityName = entityName; |
| | 0 | 45 | | StartIndex = startIndex; |
| | 0 | 46 | | EntityLength = entityLength; |
| | 0 | 47 | | Resolution = resolution; |
| | 0 | 48 | | Score = score; |
| | | 49 | | CustomInit(); |
| | 0 | 50 | | } |
| | | 51 | | |
| | | 52 | | /// <summary> |
| | | 53 | | /// An initialization method that performs custom operations like setting defaults |
| | | 54 | | /// </summary> |
| | | 55 | | partial void CustomInit(); |
| | | 56 | | |
| | | 57 | | /// <summary> |
| | | 58 | | /// Gets or sets the name of the entity to extend. |
| | | 59 | | /// </summary> |
| | | 60 | | [JsonProperty(PropertyName = "entityName")] |
| | 12 | 61 | | public string EntityName { get; set; } |
| | | 62 | | |
| | | 63 | | /// <summary> |
| | | 64 | | /// Gets or sets the start character index of the predicted entity. |
| | | 65 | | /// </summary> |
| | | 66 | | [JsonProperty(PropertyName = "startIndex")] |
| | 8 | 67 | | public int StartIndex { get; set; } |
| | | 68 | | |
| | | 69 | | /// <summary> |
| | | 70 | | /// Gets or sets the length of the predicted entity. |
| | | 71 | | /// </summary> |
| | | 72 | | [JsonProperty(PropertyName = "entityLength")] |
| | 8 | 73 | | public int EntityLength { get; set; } |
| | | 74 | | |
| | | 75 | | /// <summary> |
| | | 76 | | /// Gets or sets a user supplied custom resolution to return as the |
| | | 77 | | /// entity's prediction. |
| | | 78 | | /// </summary> |
| | | 79 | | [JsonProperty(PropertyName = "resolution")] |
| | 8 | 80 | | public object Resolution { get; set; } |
| | | 81 | | |
| | | 82 | | /// <summary> |
| | | 83 | | /// Gets or sets a user supplied score to return as the entity's |
| | | 84 | | /// prediction score. |
| | | 85 | | /// </summary> |
| | | 86 | | [JsonProperty(PropertyName = "score")] |
| | 8 | 87 | | public double? Score { get; set; } |
| | | 88 | | |
| | | 89 | | /// <summary> |
| | | 90 | | /// Validate the object. |
| | | 91 | | /// </summary> |
| | | 92 | | /// <exception cref="ValidationException"> |
| | | 93 | | /// Thrown if validation fails |
| | | 94 | | /// </exception> |
| | | 95 | | public virtual void Validate() |
| | | 96 | | { |
| | 4 | 97 | | if (EntityName == null) |
| | | 98 | | { |
| | 0 | 99 | | throw new ValidationException(ValidationRules.CannotBeNull, "EntityName"); |
| | | 100 | | } |
| | 4 | 101 | | } |
| | | 102 | | } |
| | | 103 | | } |