| | 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.Authoring.Models |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Newtonsoft.Json; |
| | 15 | | using System.Linq; |
| | 16 | |
|
| | 17 | | /// <summary> |
| | 18 | | /// Properties for creating a new LUIS Application |
| | 19 | | /// </summary> |
| | 20 | | public partial class ApplicationCreateObject |
| | 21 | | { |
| | 22 | | /// <summary> |
| | 23 | | /// Initializes a new instance of the ApplicationCreateObject class. |
| | 24 | | /// </summary> |
| 27 | 25 | | public ApplicationCreateObject() |
| | 26 | | { |
| | 27 | | CustomInit(); |
| 27 | 28 | | } |
| | 29 | |
|
| | 30 | | /// <summary> |
| | 31 | | /// Initializes a new instance of the ApplicationCreateObject class. |
| | 32 | | /// </summary> |
| | 33 | | /// <param name="culture">The culture for the new application. It is |
| | 34 | | /// the language that your app understands and speaks. E.g.: "en-us". |
| | 35 | | /// Note: the culture cannot be changed after the app is |
| | 36 | | /// created.</param> |
| | 37 | | /// <param name="name">The name for the new application.</param> |
| | 38 | | /// <param name="domain">The domain for the new application. Optional. |
| | 39 | | /// E.g.: Comics.</param> |
| | 40 | | /// <param name="description">Description of the new application. |
| | 41 | | /// Optional.</param> |
| | 42 | | /// <param name="initialVersionId">The initial version ID. Optional. |
| | 43 | | /// Default value is: "0.1"</param> |
| | 44 | | /// <param name="usageScenario">Defines the scenario for the new |
| | 45 | | /// application. Optional. E.g.: IoT.</param> |
| 0 | 46 | | public ApplicationCreateObject(string culture, string name, string domain = default(string), string description |
| | 47 | | { |
| 0 | 48 | | Culture = culture; |
| 0 | 49 | | Domain = domain; |
| 0 | 50 | | Description = description; |
| 0 | 51 | | InitialVersionId = initialVersionId; |
| 0 | 52 | | UsageScenario = usageScenario; |
| 0 | 53 | | Name = name; |
| | 54 | | CustomInit(); |
| 0 | 55 | | } |
| | 56 | |
|
| | 57 | | /// <summary> |
| | 58 | | /// An initialization method that performs custom operations like setting defaults |
| | 59 | | /// </summary> |
| | 60 | | partial void CustomInit(); |
| | 61 | |
|
| | 62 | | /// <summary> |
| | 63 | | /// Gets or sets the culture for the new application. It is the |
| | 64 | | /// language that your app understands and speaks. E.g.: "en-us". Note: |
| | 65 | | /// the culture cannot be changed after the app is created. |
| | 66 | | /// </summary> |
| | 67 | | [JsonProperty(PropertyName = "culture")] |
| 81 | 68 | | public string Culture { get; set; } |
| | 69 | |
|
| | 70 | | /// <summary> |
| | 71 | | /// Gets or sets the domain for the new application. Optional. E.g.: |
| | 72 | | /// Comics. |
| | 73 | | /// </summary> |
| | 74 | | [JsonProperty(PropertyName = "domain")] |
| 54 | 75 | | public string Domain { get; set; } |
| | 76 | |
|
| | 77 | | /// <summary> |
| | 78 | | /// Gets or sets description of the new application. Optional. |
| | 79 | | /// </summary> |
| | 80 | | [JsonProperty(PropertyName = "description")] |
| 54 | 81 | | public string Description { get; set; } |
| | 82 | |
|
| | 83 | | /// <summary> |
| | 84 | | /// Gets or sets the initial version ID. Optional. Default value is: |
| | 85 | | /// "0.1" |
| | 86 | | /// </summary> |
| | 87 | | [JsonProperty(PropertyName = "initialVersionId")] |
| 0 | 88 | | public string InitialVersionId { get; set; } |
| | 89 | |
|
| | 90 | | /// <summary> |
| | 91 | | /// Gets or sets defines the scenario for the new application. |
| | 92 | | /// Optional. E.g.: IoT. |
| | 93 | | /// </summary> |
| | 94 | | [JsonProperty(PropertyName = "usageScenario")] |
| 54 | 95 | | public string UsageScenario { get; set; } |
| | 96 | |
|
| | 97 | | /// <summary> |
| | 98 | | /// Gets or sets the name for the new application. |
| | 99 | | /// </summary> |
| | 100 | | [JsonProperty(PropertyName = "name")] |
| 81 | 101 | | public string Name { get; set; } |
| | 102 | |
|
| | 103 | | /// <summary> |
| | 104 | | /// Validate the object. |
| | 105 | | /// </summary> |
| | 106 | | /// <exception cref="ValidationException"> |
| | 107 | | /// Thrown if validation fails |
| | 108 | | /// </exception> |
| | 109 | | public virtual void Validate() |
| | 110 | | { |
| 27 | 111 | | if (Culture == null) |
| | 112 | | { |
| 0 | 113 | | throw new ValidationException(ValidationRules.CannotBeNull, "Culture"); |
| | 114 | | } |
| 27 | 115 | | if (Name == null) |
| | 116 | | { |
| 0 | 117 | | throw new ValidationException(ValidationRules.CannotBeNull, "Name"); |
| | 118 | | } |
| 27 | 119 | | } |
| | 120 | | } |
| | 121 | | } |