| | 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 |
| | 12 | | { |
| | 13 | | using Microsoft.Rest; |
| | 14 | | using Microsoft.Rest.Serialization; |
| | 15 | | using Models; |
| | 16 | | using Newtonsoft.Json; |
| | 17 | | using System.Collections; |
| | 18 | | using System.Collections.Generic; |
| | 19 | | using System.Net; |
| | 20 | | using System.Net.Http; |
| | 21 | |
|
| | 22 | | public partial class LUISRuntimeClient : ServiceClient<LUISRuntimeClient>, ILUISRuntimeClient |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// The base URI of the service. |
| | 26 | | /// </summary> |
| 14 | 27 | | internal string BaseUri {get; set;} |
| | 28 | |
|
| | 29 | | /// <summary> |
| | 30 | | /// Gets or sets json serialization settings. |
| | 31 | | /// </summary> |
| 28 | 32 | | public JsonSerializerSettings SerializationSettings { get; private set; } |
| | 33 | |
|
| | 34 | | /// <summary> |
| | 35 | | /// Gets or sets json deserialization settings. |
| | 36 | | /// </summary> |
| 14 | 37 | | public JsonSerializerSettings DeserializationSettings { get; private set; } |
| | 38 | |
|
| | 39 | | /// <summary> |
| | 40 | | /// Supported Cognitive Services endpoints (protocol and hostname, for example: |
| | 41 | | /// https://westus.api.cognitive.microsoft.com). |
| | 42 | | /// </summary> |
| 22 | 43 | | public string Endpoint { get; set; } |
| | 44 | |
|
| | 45 | | /// <summary> |
| | 46 | | /// Subscription credentials which uniquely identify client subscription. |
| | 47 | | /// </summary> |
| 36 | 48 | | public ServiceClientCredentials Credentials { get; private set; } |
| | 49 | |
|
| | 50 | | /// <summary> |
| | 51 | | /// Gets the IPredictionOperations. |
| | 52 | | /// </summary> |
| 16 | 53 | | public virtual IPredictionOperations Prediction { get; private set; } |
| | 54 | |
|
| | 55 | | /// <summary> |
| | 56 | | /// Initializes a new instance of the LUISRuntimeClient class. |
| | 57 | | /// </summary> |
| | 58 | | /// <param name='httpClient'> |
| | 59 | | /// HttpClient to be used |
| | 60 | | /// </param> |
| | 61 | | /// <param name='disposeHttpClient'> |
| | 62 | | /// True: will dispose the provided httpClient on calling LUISRuntimeClient.Dispose(). False: will not dispose p |
| 0 | 63 | | protected LUISRuntimeClient(HttpClient httpClient, bool disposeHttpClient) : base(httpClient, disposeHttpClient) |
| | 64 | | { |
| 0 | 65 | | Initialize(); |
| 0 | 66 | | } |
| | 67 | |
|
| | 68 | | /// <summary> |
| | 69 | | /// Initializes a new instance of the LUISRuntimeClient class. |
| | 70 | | /// </summary> |
| | 71 | | /// <param name='handlers'> |
| | 72 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 73 | | /// </param> |
| 8 | 74 | | protected LUISRuntimeClient(params DelegatingHandler[] handlers) : base(handlers) |
| | 75 | | { |
| 8 | 76 | | Initialize(); |
| 8 | 77 | | } |
| | 78 | |
|
| | 79 | | /// <summary> |
| | 80 | | /// Initializes a new instance of the LUISRuntimeClient class. |
| | 81 | | /// </summary> |
| | 82 | | /// <param name='rootHandler'> |
| | 83 | | /// Optional. The http client handler used to handle http transport. |
| | 84 | | /// </param> |
| | 85 | | /// <param name='handlers'> |
| | 86 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 87 | | /// </param> |
| 0 | 88 | | protected LUISRuntimeClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers) : base(rootHandl |
| | 89 | | { |
| 0 | 90 | | Initialize(); |
| 0 | 91 | | } |
| | 92 | |
|
| | 93 | | /// <summary> |
| | 94 | | /// Initializes a new instance of the LUISRuntimeClient class. |
| | 95 | | /// </summary> |
| | 96 | | /// <param name='credentials'> |
| | 97 | | /// Required. Subscription credentials which uniquely identify client subscription. |
| | 98 | | /// </param> |
| | 99 | | /// <param name='handlers'> |
| | 100 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 101 | | /// </param> |
| | 102 | | /// <exception cref="System.ArgumentNullException"> |
| | 103 | | /// Thrown when a required parameter is null |
| | 104 | | /// </exception> |
| 8 | 105 | | public LUISRuntimeClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers) : this(handl |
| | 106 | | { |
| 8 | 107 | | if (credentials == null) |
| | 108 | | { |
| 0 | 109 | | throw new System.ArgumentNullException("credentials"); |
| | 110 | | } |
| 8 | 111 | | Credentials = credentials; |
| 8 | 112 | | if (Credentials != null) |
| | 113 | | { |
| 8 | 114 | | Credentials.InitializeServiceClient(this); |
| | 115 | | } |
| 8 | 116 | | } |
| | 117 | |
|
| | 118 | | /// <summary> |
| | 119 | | /// Initializes a new instance of the LUISRuntimeClient class. |
| | 120 | | /// </summary> |
| | 121 | | /// <param name='credentials'> |
| | 122 | | /// Required. Subscription credentials which uniquely identify client subscription. |
| | 123 | | /// </param> |
| | 124 | | /// <param name='httpClient'> |
| | 125 | | /// HttpClient to be used |
| | 126 | | /// </param> |
| | 127 | | /// <param name='disposeHttpClient'> |
| | 128 | | /// True: will dispose the provided httpClient on calling LUISRuntimeClient.Dispose(). False: will not dispose p |
| | 129 | | /// <exception cref="System.ArgumentNullException"> |
| | 130 | | /// Thrown when a required parameter is null |
| | 131 | | /// </exception> |
| 0 | 132 | | public LUISRuntimeClient(ServiceClientCredentials credentials, HttpClient httpClient, bool disposeHttpClient) : |
| | 133 | | { |
| 0 | 134 | | if (credentials == null) |
| | 135 | | { |
| 0 | 136 | | throw new System.ArgumentNullException("credentials"); |
| | 137 | | } |
| 0 | 138 | | Credentials = credentials; |
| 0 | 139 | | if (Credentials != null) |
| | 140 | | { |
| 0 | 141 | | Credentials.InitializeServiceClient(this); |
| | 142 | | } |
| 0 | 143 | | } |
| | 144 | |
|
| | 145 | | /// <summary> |
| | 146 | | /// Initializes a new instance of the LUISRuntimeClient class. |
| | 147 | | /// </summary> |
| | 148 | | /// <param name='credentials'> |
| | 149 | | /// Required. Subscription credentials which uniquely identify client subscription. |
| | 150 | | /// </param> |
| | 151 | | /// <param name='rootHandler'> |
| | 152 | | /// Optional. The http client handler used to handle http transport. |
| | 153 | | /// </param> |
| | 154 | | /// <param name='handlers'> |
| | 155 | | /// Optional. The delegating handlers to add to the http client pipeline. |
| | 156 | | /// </param> |
| | 157 | | /// <exception cref="System.ArgumentNullException"> |
| | 158 | | /// Thrown when a required parameter is null |
| | 159 | | /// </exception> |
| 0 | 160 | | public LUISRuntimeClient(ServiceClientCredentials credentials, HttpClientHandler rootHandler, params DelegatingH |
| | 161 | | { |
| 0 | 162 | | if (credentials == null) |
| | 163 | | { |
| 0 | 164 | | throw new System.ArgumentNullException("credentials"); |
| | 165 | | } |
| 0 | 166 | | Credentials = credentials; |
| 0 | 167 | | if (Credentials != null) |
| | 168 | | { |
| 0 | 169 | | Credentials.InitializeServiceClient(this); |
| | 170 | | } |
| 0 | 171 | | } |
| | 172 | |
|
| | 173 | | /// <summary> |
| | 174 | | /// An optional partial-method to perform custom initialization. |
| | 175 | | ///</summary> |
| | 176 | | partial void CustomInitialize(); |
| | 177 | | /// <summary> |
| | 178 | | /// Initializes client properties. |
| | 179 | | /// </summary> |
| | 180 | | private void Initialize() |
| | 181 | | { |
| 8 | 182 | | Prediction = new PredictionOperations(this); |
| 8 | 183 | | BaseUri = "{Endpoint}/luis/prediction/v3.0"; |
| 8 | 184 | | SerializationSettings = new JsonSerializerSettings |
| 8 | 185 | | { |
| 8 | 186 | | Formatting = Newtonsoft.Json.Formatting.Indented, |
| 8 | 187 | | DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, |
| 8 | 188 | | DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, |
| 8 | 189 | | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, |
| 8 | 190 | | ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, |
| 8 | 191 | | ContractResolver = new ReadOnlyJsonContractResolver(), |
| 8 | 192 | | Converters = new List<JsonConverter> |
| 8 | 193 | | { |
| 8 | 194 | | new Iso8601TimeSpanConverter() |
| 8 | 195 | | } |
| 8 | 196 | | }; |
| 8 | 197 | | DeserializationSettings = new JsonSerializerSettings |
| 8 | 198 | | { |
| 8 | 199 | | DateFormatHandling = Newtonsoft.Json.DateFormatHandling.IsoDateFormat, |
| 8 | 200 | | DateTimeZoneHandling = Newtonsoft.Json.DateTimeZoneHandling.Utc, |
| 8 | 201 | | NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore, |
| 8 | 202 | | ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Serialize, |
| 8 | 203 | | ContractResolver = new ReadOnlyJsonContractResolver(), |
| 8 | 204 | | Converters = new List<JsonConverter> |
| 8 | 205 | | { |
| 8 | 206 | | new Iso8601TimeSpanConverter() |
| 8 | 207 | | } |
| 8 | 208 | | }; |
| | 209 | | CustomInitialize(); |
| 8 | 210 | | } |
| | 211 | | } |
| | 212 | | } |