| | | 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 |
| | | 12 | | { |
| | | 13 | | using Models; |
| | | 14 | | using System.Collections; |
| | | 15 | | using System.Collections.Generic; |
| | | 16 | | using System.IO; |
| | | 17 | | using System.Threading; |
| | | 18 | | using System.Threading.Tasks; |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// Extension methods for Versions. |
| | | 22 | | /// </summary> |
| | | 23 | | public static partial class VersionsExtensions |
| | | 24 | | { |
| | | 25 | | /// <summary> |
| | | 26 | | /// Creates a new version from the selected version. |
| | | 27 | | /// </summary> |
| | | 28 | | /// <param name='operations'> |
| | | 29 | | /// The operations group for this extension method. |
| | | 30 | | /// </param> |
| | | 31 | | /// <param name='appId'> |
| | | 32 | | /// The application ID. |
| | | 33 | | /// </param> |
| | | 34 | | /// <param name='versionId'> |
| | | 35 | | /// The version ID. |
| | | 36 | | /// </param> |
| | | 37 | | /// <param name='versionCloneObject'> |
| | | 38 | | /// A model containing the new version ID. |
| | | 39 | | /// </param> |
| | | 40 | | /// <param name='cancellationToken'> |
| | | 41 | | /// The cancellation token. |
| | | 42 | | /// </param> |
| | | 43 | | public static async Task<string> CloneAsync(this IVersions operations, System.Guid appId, string versionId, |
| | | 44 | | { |
| | 3 | 45 | | using (var _result = await operations.CloneWithHttpMessagesAsync(appId, versionId, versionCloneObject, n |
| | | 46 | | { |
| | 2 | 47 | | return _result.Body; |
| | | 48 | | } |
| | 2 | 49 | | } |
| | | 50 | | |
| | | 51 | | /// <summary> |
| | | 52 | | /// Gets a list of versions for this application ID. |
| | | 53 | | /// </summary> |
| | | 54 | | /// <param name='operations'> |
| | | 55 | | /// The operations group for this extension method. |
| | | 56 | | /// </param> |
| | | 57 | | /// <param name='appId'> |
| | | 58 | | /// The application ID. |
| | | 59 | | /// </param> |
| | | 60 | | /// <param name='skip'> |
| | | 61 | | /// The number of entries to skip. Default value is 0. |
| | | 62 | | /// </param> |
| | | 63 | | /// <param name='take'> |
| | | 64 | | /// The number of entries to return. Maximum page size is 500. Default is 100. |
| | | 65 | | /// </param> |
| | | 66 | | /// <param name='cancellationToken'> |
| | | 67 | | /// The cancellation token. |
| | | 68 | | /// </param> |
| | | 69 | | public static async Task<IList<VersionInfo>> ListAsync(this IVersions operations, System.Guid appId, int? sk |
| | | 70 | | { |
| | 21 | 71 | | using (var _result = await operations.ListWithHttpMessagesAsync(appId, skip, take, null, cancellationTok |
| | | 72 | | { |
| | 20 | 73 | | return _result.Body; |
| | | 74 | | } |
| | 20 | 75 | | } |
| | | 76 | | |
| | | 77 | | /// <summary> |
| | | 78 | | /// Gets the version information such as date created, last modified date, |
| | | 79 | | /// endpoint URL, count of intents and entities, training and publishing |
| | | 80 | | /// status. |
| | | 81 | | /// </summary> |
| | | 82 | | /// <param name='operations'> |
| | | 83 | | /// The operations group for this extension method. |
| | | 84 | | /// </param> |
| | | 85 | | /// <param name='appId'> |
| | | 86 | | /// The application ID. |
| | | 87 | | /// </param> |
| | | 88 | | /// <param name='versionId'> |
| | | 89 | | /// The version ID. |
| | | 90 | | /// </param> |
| | | 91 | | /// <param name='cancellationToken'> |
| | | 92 | | /// The cancellation token. |
| | | 93 | | /// </param> |
| | | 94 | | public static async Task<VersionInfo> GetAsync(this IVersions operations, System.Guid appId, string versionI |
| | | 95 | | { |
| | 3 | 96 | | using (var _result = await operations.GetWithHttpMessagesAsync(appId, versionId, null, cancellationToken |
| | | 97 | | { |
| | 2 | 98 | | return _result.Body; |
| | | 99 | | } |
| | 2 | 100 | | } |
| | | 101 | | |
| | | 102 | | /// <summary> |
| | | 103 | | /// Updates the name or description of the application version. |
| | | 104 | | /// </summary> |
| | | 105 | | /// <param name='operations'> |
| | | 106 | | /// The operations group for this extension method. |
| | | 107 | | /// </param> |
| | | 108 | | /// <param name='appId'> |
| | | 109 | | /// The application ID. |
| | | 110 | | /// </param> |
| | | 111 | | /// <param name='versionId'> |
| | | 112 | | /// The version ID. |
| | | 113 | | /// </param> |
| | | 114 | | /// <param name='versionUpdateObject'> |
| | | 115 | | /// A model containing Name and Description of the application. |
| | | 116 | | /// </param> |
| | | 117 | | /// <param name='cancellationToken'> |
| | | 118 | | /// The cancellation token. |
| | | 119 | | /// </param> |
| | | 120 | | public static async Task<OperationStatus> UpdateAsync(this IVersions operations, System.Guid appId, string v |
| | | 121 | | { |
| | 3 | 122 | | using (var _result = await operations.UpdateWithHttpMessagesAsync(appId, versionId, versionUpdateObject, |
| | | 123 | | { |
| | 2 | 124 | | return _result.Body; |
| | | 125 | | } |
| | 2 | 126 | | } |
| | | 127 | | |
| | | 128 | | /// <summary> |
| | | 129 | | /// Deletes an application version. |
| | | 130 | | /// </summary> |
| | | 131 | | /// <param name='operations'> |
| | | 132 | | /// The operations group for this extension method. |
| | | 133 | | /// </param> |
| | | 134 | | /// <param name='appId'> |
| | | 135 | | /// The application ID. |
| | | 136 | | /// </param> |
| | | 137 | | /// <param name='versionId'> |
| | | 138 | | /// The version ID. |
| | | 139 | | /// </param> |
| | | 140 | | /// <param name='cancellationToken'> |
| | | 141 | | /// The cancellation token. |
| | | 142 | | /// </param> |
| | | 143 | | public static async Task<OperationStatus> DeleteAsync(this IVersions operations, System.Guid appId, string v |
| | | 144 | | { |
| | 3 | 145 | | using (var _result = await operations.DeleteWithHttpMessagesAsync(appId, versionId, null, cancellationTo |
| | | 146 | | { |
| | 2 | 147 | | return _result.Body; |
| | | 148 | | } |
| | 2 | 149 | | } |
| | | 150 | | |
| | | 151 | | /// <summary> |
| | | 152 | | /// Exports a LUIS application to JSON format. |
| | | 153 | | /// </summary> |
| | | 154 | | /// <param name='operations'> |
| | | 155 | | /// The operations group for this extension method. |
| | | 156 | | /// </param> |
| | | 157 | | /// <param name='appId'> |
| | | 158 | | /// The application ID. |
| | | 159 | | /// </param> |
| | | 160 | | /// <param name='versionId'> |
| | | 161 | | /// The version ID. |
| | | 162 | | /// </param> |
| | | 163 | | /// <param name='cancellationToken'> |
| | | 164 | | /// The cancellation token. |
| | | 165 | | /// </param> |
| | | 166 | | public static async Task<LuisApp> ExportAsync(this IVersions operations, System.Guid appId, string versionId |
| | | 167 | | { |
| | 1 | 168 | | using (var _result = await operations.ExportWithHttpMessagesAsync(appId, versionId, null, cancellationTo |
| | | 169 | | { |
| | 1 | 170 | | return _result.Body; |
| | | 171 | | } |
| | 1 | 172 | | } |
| | | 173 | | |
| | | 174 | | /// <summary> |
| | | 175 | | /// Imports a new version into a LUIS application. |
| | | 176 | | /// </summary> |
| | | 177 | | /// <param name='operations'> |
| | | 178 | | /// The operations group for this extension method. |
| | | 179 | | /// </param> |
| | | 180 | | /// <param name='appId'> |
| | | 181 | | /// The application ID. |
| | | 182 | | /// </param> |
| | | 183 | | /// <param name='luisApp'> |
| | | 184 | | /// A LUIS application structure. |
| | | 185 | | /// </param> |
| | | 186 | | /// <param name='versionId'> |
| | | 187 | | /// The new versionId to import. If not specified, the versionId will be read |
| | | 188 | | /// from the imported object. |
| | | 189 | | /// </param> |
| | | 190 | | /// <param name='cancellationToken'> |
| | | 191 | | /// The cancellation token. |
| | | 192 | | /// </param> |
| | | 193 | | public static async Task<string> ImportAsync(this IVersions operations, System.Guid appId, LuisApp luisApp, |
| | | 194 | | { |
| | 1 | 195 | | using (var _result = await operations.ImportWithHttpMessagesAsync(appId, luisApp, versionId, null, cance |
| | | 196 | | { |
| | 1 | 197 | | return _result.Body; |
| | | 198 | | } |
| | 1 | 199 | | } |
| | | 200 | | |
| | | 201 | | /// <summary> |
| | | 202 | | /// Deleted an unlabelled utterance in a version of the application. |
| | | 203 | | /// </summary> |
| | | 204 | | /// <param name='operations'> |
| | | 205 | | /// The operations group for this extension method. |
| | | 206 | | /// </param> |
| | | 207 | | /// <param name='appId'> |
| | | 208 | | /// The application ID. |
| | | 209 | | /// </param> |
| | | 210 | | /// <param name='versionId'> |
| | | 211 | | /// The version ID. |
| | | 212 | | /// </param> |
| | | 213 | | /// <param name='utterance'> |
| | | 214 | | /// The utterance text to delete. |
| | | 215 | | /// </param> |
| | | 216 | | /// <param name='cancellationToken'> |
| | | 217 | | /// The cancellation token. |
| | | 218 | | /// </param> |
| | | 219 | | public static async Task<OperationStatus> DeleteUnlabelledUtteranceAsync(this IVersions operations, System.G |
| | | 220 | | { |
| | 0 | 221 | | using (var _result = await operations.DeleteUnlabelledUtteranceWithHttpMessagesAsync(appId, versionId, u |
| | | 222 | | { |
| | 0 | 223 | | return _result.Body; |
| | | 224 | | } |
| | 0 | 225 | | } |
| | | 226 | | |
| | | 227 | | /// <summary> |
| | | 228 | | /// Imports a new version into a LUIS application. |
| | | 229 | | /// </summary> |
| | | 230 | | /// <param name='operations'> |
| | | 231 | | /// The operations group for this extension method. |
| | | 232 | | /// </param> |
| | | 233 | | /// <param name='appId'> |
| | | 234 | | /// The application ID. |
| | | 235 | | /// </param> |
| | | 236 | | /// <param name='luisAppV2'> |
| | | 237 | | /// A LUIS application structure. |
| | | 238 | | /// </param> |
| | | 239 | | /// <param name='versionId'> |
| | | 240 | | /// The new versionId to import. If not specified, the versionId will be read |
| | | 241 | | /// from the imported object. |
| | | 242 | | /// </param> |
| | | 243 | | /// <param name='cancellationToken'> |
| | | 244 | | /// The cancellation token. |
| | | 245 | | /// </param> |
| | | 246 | | public static async Task<string> ImportV2AppAsync(this IVersions operations, System.Guid appId, LuisAppV2 lu |
| | | 247 | | { |
| | 1 | 248 | | using (var _result = await operations.ImportV2AppWithHttpMessagesAsync(appId, luisAppV2, versionId, null |
| | | 249 | | { |
| | 1 | 250 | | return _result.Body; |
| | | 251 | | } |
| | 1 | 252 | | } |
| | | 253 | | |
| | | 254 | | /// <summary> |
| | | 255 | | /// Imports a new version into a LUIS application. |
| | | 256 | | /// </summary> |
| | | 257 | | /// <param name='operations'> |
| | | 258 | | /// The operations group for this extension method. |
| | | 259 | | /// </param> |
| | | 260 | | /// <param name='appId'> |
| | | 261 | | /// The application ID. |
| | | 262 | | /// </param> |
| | | 263 | | /// <param name='luisAppLu'> |
| | | 264 | | /// An LU representing the LUIS application structure. |
| | | 265 | | /// </param> |
| | | 266 | | /// <param name='versionId'> |
| | | 267 | | /// The new versionId to import. If not specified, the versionId will be read |
| | | 268 | | /// from the imported object. |
| | | 269 | | /// </param> |
| | | 270 | | /// <param name='cancellationToken'> |
| | | 271 | | /// The cancellation token. |
| | | 272 | | /// </param> |
| | | 273 | | public static async Task<string> ImportLuFormatAsync(this IVersions operations, System.Guid appId, string lu |
| | | 274 | | { |
| | 1 | 275 | | using (var _result = await operations.ImportLuFormatWithHttpMessagesAsync(appId, luisAppLu, versionId, n |
| | | 276 | | { |
| | 1 | 277 | | return _result.Body; |
| | | 278 | | } |
| | 1 | 279 | | } |
| | | 280 | | |
| | | 281 | | /// <summary> |
| | | 282 | | /// Exports a LUIS application to text format. |
| | | 283 | | /// </summary> |
| | | 284 | | /// <param name='operations'> |
| | | 285 | | /// The operations group for this extension method. |
| | | 286 | | /// </param> |
| | | 287 | | /// <param name='appId'> |
| | | 288 | | /// The application ID. |
| | | 289 | | /// </param> |
| | | 290 | | /// <param name='versionId'> |
| | | 291 | | /// The version ID. |
| | | 292 | | /// </param> |
| | | 293 | | /// <param name='cancellationToken'> |
| | | 294 | | /// The cancellation token. |
| | | 295 | | /// </param> |
| | | 296 | | public static async Task<Stream> ExportLuFormatAsync(this IVersions operations, System.Guid appId, string ve |
| | | 297 | | { |
| | 1 | 298 | | var _result = await operations.ExportLuFormatWithHttpMessagesAsync(appId, versionId, null, cancellationT |
| | 1 | 299 | | _result.Request.Dispose(); |
| | 1 | 300 | | return _result.Body; |
| | 1 | 301 | | } |
| | | 302 | | |
| | | 303 | | } |
| | | 304 | | } |