| | | 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 | | /// Represents the prediction response. |
| | | 19 | | /// </summary> |
| | | 20 | | public partial class PredictionResponse |
| | | 21 | | { |
| | | 22 | | /// <summary> |
| | | 23 | | /// Initializes a new instance of the PredictionResponse class. |
| | | 24 | | /// </summary> |
| | 4 | 25 | | public PredictionResponse() |
| | | 26 | | { |
| | | 27 | | CustomInit(); |
| | 4 | 28 | | } |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// Initializes a new instance of the PredictionResponse class. |
| | | 32 | | /// </summary> |
| | | 33 | | /// <param name="query">The query used in the prediction.</param> |
| | | 34 | | /// <param name="prediction">The prediction of the requested |
| | | 35 | | /// query.</param> |
| | 0 | 36 | | public PredictionResponse(string query, Prediction prediction) |
| | | 37 | | { |
| | 0 | 38 | | Query = query; |
| | 0 | 39 | | Prediction = prediction; |
| | | 40 | | CustomInit(); |
| | 0 | 41 | | } |
| | | 42 | | |
| | | 43 | | /// <summary> |
| | | 44 | | /// An initialization method that performs custom operations like setting defaults |
| | | 45 | | /// </summary> |
| | | 46 | | partial void CustomInit(); |
| | | 47 | | |
| | | 48 | | /// <summary> |
| | | 49 | | /// Gets or sets the query used in the prediction. |
| | | 50 | | /// </summary> |
| | | 51 | | [JsonProperty(PropertyName = "query")] |
| | 8 | 52 | | public string Query { get; set; } |
| | | 53 | | |
| | | 54 | | /// <summary> |
| | | 55 | | /// Gets or sets the prediction of the requested query. |
| | | 56 | | /// </summary> |
| | | 57 | | [JsonProperty(PropertyName = "prediction")] |
| | 12 | 58 | | public Prediction Prediction { get; set; } |
| | | 59 | | |
| | | 60 | | /// <summary> |
| | | 61 | | /// Validate the object. |
| | | 62 | | /// </summary> |
| | | 63 | | /// <exception cref="ValidationException"> |
| | | 64 | | /// Thrown if validation fails |
| | | 65 | | /// </exception> |
| | | 66 | | public virtual void Validate() |
| | | 67 | | { |
| | 0 | 68 | | if (Query == null) |
| | | 69 | | { |
| | 0 | 70 | | throw new ValidationException(ValidationRules.CannotBeNull, "Query"); |
| | | 71 | | } |
| | 0 | 72 | | if (Prediction == null) |
| | | 73 | | { |
| | 0 | 74 | | throw new ValidationException(ValidationRules.CannotBeNull, "Prediction"); |
| | | 75 | | } |
| | 0 | 76 | | if (Prediction != null) |
| | | 77 | | { |
| | 0 | 78 | | Prediction.Validate(); |
| | | 79 | | } |
| | 0 | 80 | | } |
| | | 81 | | } |
| | | 82 | | } |