From ba13503776c92a0a1541acf1f5967b76a4a57bed Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 13 Dec 2018 09:19:38 -0800 Subject: [PATCH] [AutoPR cognitiveservices/data-plane/LUIS/Authoring] Adding azure accounts APIs (#4185) * Generated from 431fadac7b30b7c33b9fa6468874fce839869345 fixing build errors * Generated from 82cee8e19ad81e9d82d712cfabad1649b91b619a Merge pull request #1 from omarelhariry/a-moghan/PublishingResponses Adding Publishing To Regions Status * Generated from 23a7c077da0b751b8ad2b246d8da041d0906f90d Fixing formats * Generated from 4289fc27afed08636bf27abb57ace4a1ff69b7ee Fixing OAV errors * Generated from 3b62ef631bbcf684da8597627f22d1869bb37c7d Merge pull request #2 from omarelhariry/kayousef/Dispatch_APIs Adding dispatch APIs * Generated from 4289fc27afed08636bf27abb57ace4a1ff69b7ee Fixing OAV errors * Generated from c7d11c54fe4f164073a570f2dba2510ddbf91c76 Add application-json as a 2nd prdocues format for packaging APIs, to describe the error responses * Generated from b8ee038af90c620395c27635c989a3a6364335a4 Updating operation ids * Generated from 32e19a3f178eab8d32f3fd79316bbaf7569ca7c8 fix oav and remove error responses --- lib/services/luis/authoring/LICENSE.txt | 42 +- lib/services/luis/authoring/README.md | 89 +- .../authoring/lib/lUISAuthoringClient.d.ts | 2 + .../luis/authoring/lib/lUISAuthoringClient.js | 2 + .../lib/models/appVersionSettingObject.js | 60 + .../lib/models/applicationCreateObject.js | 12 +- .../lib/models/applicationInfoResponse.js | 22 +- .../lib/models/applicationPublishObject.js | 13 +- .../models/applicationSettingUpdateObject.js | 2 +- .../lib/models/applicationSettings.js | 6 +- .../lib/models/applicationUpdateObject.js | 4 +- .../authoring/lib/models/availableCulture.js | 4 +- .../models/availablePrebuiltEntityModel.js | 6 +- .../lib/models/azureAccountInfoObject.js | 68 + .../authoring/lib/models/batchLabelExample.js | 14 +- .../luis/authoring/lib/models/childEntity.js | 4 +- .../luis/authoring/lib/models/closedList.js | 6 +- .../lib/models/closedListEntityExtractor.js | 20 +- .../lib/models/closedListModelCreateObject.js | 4 +- .../lib/models/closedListModelPatchObject.js | 2 +- .../lib/models/closedListModelUpdateObject.js | 4 +- .../lib/models/collaboratorsArray.js | 2 +- .../models/compositeChildModelCreateObject.js | 2 +- .../lib/models/compositeEntityExtractor.js | 20 +- .../lib/models/compositeEntityModel.js | 4 +- .../lib/models/customPrebuiltModel.js | 23 +- .../dispatchConnectedServiceDeleteObject.js | 53 + .../models/dispatchConnectedServiceObject.js | 106 + .../luis/authoring/lib/models/endpointInfo.js | 22 +- .../lib/models/enqueueTrainingResponse.js | 6 +- .../lib/models/entitiesSuggestionExample.js | 8 +- .../authoring/lib/models/entityExtractor.js | 23 +- .../luis/authoring/lib/models/entityLabel.js | 8 +- .../authoring/lib/models/entityLabelObject.js | 6 +- .../authoring/lib/models/entityModelInfo.js | 2 +- .../authoring/lib/models/entityPrediction.js | 10 +- .../luis/authoring/lib/models/entityRole.js | 4 +- .../lib/models/entityRoleCreateObject.js | 2 +- .../lib/models/entityRoleUpdateObject.js | 2 +- .../authoring/lib/models/errorResponse.js | 2 +- .../lib/models/exampleLabelObject.js | 7 +- .../authoring/lib/models/explicitListItem.js | 4 +- .../models/explicitListItemCreateObject.js | 2 +- .../models/explicitListItemUpdateObject.js | 2 +- .../authoring/lib/models/featureInfoObject.js | 6 +- .../lib/models/featuresResponseObject.js | 4 +- .../lib/models/hierarchicalChildEntity.js | 4 +- .../hierarchicalChildModelCreateObject.js | 2 +- .../hierarchicalChildModelUpdateObject.js | 2 +- .../lib/models/hierarchicalEntityExtractor.js | 20 +- .../lib/models/hierarchicalEntityModel.js | 4 +- .../authoring/lib/models/hierarchicalModel.js | 12 +- .../luis/authoring/lib/models/index.d.ts | 1941 +++++++++-------- .../luis/authoring/lib/models/index.js | 2 + .../authoring/lib/models/intentClassifier.js | 5 +- .../authoring/lib/models/intentPrediction.js | 4 +- .../lib/models/intentsSuggestionExample.js | 8 +- .../luis/authoring/lib/models/jSONEntity.js | 8 +- .../authoring/lib/models/jSONModelFeature.js | 12 +- .../authoring/lib/models/jSONRegexFeature.js | 7 +- .../authoring/lib/models/jSONUtterance.js | 6 +- .../lib/models/labelExampleResponse.js | 4 +- .../authoring/lib/models/labelTextObject.js | 4 +- .../authoring/lib/models/labeledUtterance.js | 14 +- .../luis/authoring/lib/models/luisApp.js | 30 +- .../authoring/lib/models/modelCreateObject.js | 2 +- .../luis/authoring/lib/models/modelInfo.js | 16 +- .../authoring/lib/models/modelInfoResponse.js | 31 +- .../lib/models/modelTrainingDetails.js | 12 +- .../authoring/lib/models/modelTrainingInfo.js | 15 +- .../authoring/lib/models/modelUpdateObject.js | 2 +- .../authoring/lib/models/operationError.js | 4 +- .../authoring/lib/models/operationStatus.js | 4 +- .../luis/authoring/lib/models/patternAny.js | 6 +- .../lib/models/patternAnyEntityExtractor.js | 20 +- .../lib/models/patternAnyModelCreateObject.js | 4 +- .../lib/models/patternAnyModelUpdateObject.js | 4 +- .../lib/models/patternCreateObject.js | 4 +- .../lib/models/patternFeatureInfo.js | 2 +- .../luis/authoring/lib/models/patternRule.js | 5 +- .../lib/models/patternRuleCreateObject.js | 5 +- .../authoring/lib/models/patternRuleInfo.js | 7 +- .../lib/models/patternRuleUpdateObject.js | 7 +- .../lib/models/patternUpdateObject.js | 8 +- .../lib/models/personalAssistantsResponse.js | 4 +- .../lib/models/phraseListFeatureInfo.js | 8 +- .../lib/models/phraselistCreateObject.js | 12 +- .../lib/models/phraselistUpdateObject.js | 14 +- .../authoring/lib/models/prebuiltDomain.js | 12 +- .../models/prebuiltDomainCreateBaseObject.js | 2 +- .../lib/models/prebuiltDomainCreateObject.js | 4 +- .../lib/models/prebuiltDomainItem.js | 6 +- .../models/prebuiltDomainModelCreateObject.js | 4 +- .../lib/models/prebuiltDomainObject.js | 4 +- .../authoring/lib/models/prebuiltEntity.js | 4 +- .../lib/models/prebuiltEntityExtractor.js | 18 +- .../models/productionOrStagingEndpointInfo.js | 7 + .../lib/models/publishSettingUpdateObject.js | 10 +- .../authoring/lib/models/publishSettings.js | 13 +- .../luis/authoring/lib/models/regexEntity.js | 6 +- .../lib/models/regexEntityExtractor.js | 20 +- .../lib/models/regexModelCreateObject.js | 4 +- .../lib/models/regexModelUpdateObject.js | 4 +- .../authoring/lib/models/subClosedList.js | 4 +- .../lib/models/subClosedListResponse.js | 2 +- .../authoring/lib/models/taskUpdateObject.js | 2 +- .../authoring/lib/models/userAccessList.js | 4 +- .../authoring/lib/models/userCollaborator.js | 2 +- .../luis/authoring/lib/models/versionInfo.js | 27 +- .../lib/models/wordListBaseUpdateObject.js | 4 +- .../authoring/lib/models/wordListObject.js | 4 +- .../luis/authoring/lib/operations/apps.js | 474 +++- .../authoring/lib/operations/azureAccounts.js | 995 +++++++++ .../luis/authoring/lib/operations/dispatch.js | 964 ++++++++ .../luis/authoring/lib/operations/examples.js | 12 +- .../luis/authoring/lib/operations/index.d.ts | 595 ++++- .../luis/authoring/lib/operations/index.js | 2 + .../luis/authoring/lib/operations/settings.js | 516 +++++ lib/services/luis/authoring/package.json | 2 +- 119 files changed, 5263 insertions(+), 1465 deletions(-) create mode 100644 lib/services/luis/authoring/lib/models/appVersionSettingObject.js create mode 100644 lib/services/luis/authoring/lib/models/azureAccountInfoObject.js create mode 100644 lib/services/luis/authoring/lib/models/dispatchConnectedServiceDeleteObject.js create mode 100644 lib/services/luis/authoring/lib/models/dispatchConnectedServiceObject.js create mode 100644 lib/services/luis/authoring/lib/operations/azureAccounts.js create mode 100644 lib/services/luis/authoring/lib/operations/dispatch.js create mode 100644 lib/services/luis/authoring/lib/operations/settings.js diff --git a/lib/services/luis/authoring/LICENSE.txt b/lib/services/luis/authoring/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/luis/authoring/LICENSE.txt +++ b/lib/services/luis/authoring/LICENSE.txt @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2018 Microsoft - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/luis/authoring/README.md b/lib/services/luis/authoring/README.md index 9f6daa4e1a..02b2f6c914 100644 --- a/lib/services/luis/authoring/README.md +++ b/lib/services/luis/authoring/README.md @@ -1,44 +1,45 @@ ---- -uid: azure-cognitiveservices-luis-authoring -summary: *content - ---- -# Microsoft Azure SDK for Node.js - LUISAuthoringClient -This project provides a Node.js package for accessing Azure. Right now it supports: -- **Node.js version 6.x.x or higher** - -## Features - - -## How to Install - -```bash -npm install azure-cognitiveservices-luis-authoring -``` - -## How to use - -### Authentication, client creation and listPhraseLists features as an example. - -```javascript -const msRest = require("ms-rest"); -const LUISAuthoringClient = require("azure-cognitiveservices-luis-authoring"); -const token = ""; -const creds = new msRest.TokenCredentials(token); -const subscriptionId = ""; -const client = new LUISAuthoringClient(creds, subscriptionId); -const appId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a; -const versionId = "testversionId"; -const skip = 1; -const take = 1; -client.features.listPhraseLists(appId, versionId, skip, take).then((result) => { - console.log("The result is:"); - console.log(result); -}).catch((err) => { - console.log('An error occurred:'); - console.dir(err, {depth: null, colors: true}); -}); - -## Related projects - -- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) +--- +uid: azure-cognitiveservices-luis-authoring +summary: *content + +--- +**This SDK will be deprecated next year and will be replaced by a new TypeScript-based isomorphic SDK (found at https://github.com/Azure/azure-sdk-for-js) which works on Node.js and browsers.** +## Microsoft Azure SDK for Node.js - LUISAuthoringClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +### Features + + +### How to Install + +```bash +npm install azure-cognitiveservices-luis-authoring +``` + +### How to use + +#### Authentication, client creation and listPhraseLists features as an example. + +```javascript +const msRest = require("ms-rest"); +const LUISAuthoringClient = require("azure-cognitiveservices-luis-authoring"); +const token = ""; +const creds = new msRest.TokenCredentials(token); +const subscriptionId = ""; +const client = new LUISAuthoringClient(creds, subscriptionId); +const appId = ec7b1657-199d-4d8a-bbb2-89a11a42e02a; +const versionId = "testversionId"; +const skip = 1; +const take = 1; +client.features.listPhraseLists(appId, versionId, skip, take).then((result) => { + console.log("The result is:"); + console.log(result); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +### Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/luis/authoring/lib/lUISAuthoringClient.d.ts b/lib/services/luis/authoring/lib/lUISAuthoringClient.d.ts index 08ffd0ea4f..0cd61d5b41 100644 --- a/lib/services/luis/authoring/lib/lUISAuthoringClient.d.ts +++ b/lib/services/luis/authoring/lib/lUISAuthoringClient.d.ts @@ -47,6 +47,8 @@ export default class LUISAuthoringClient extends ServiceClient { train: operations.Train; permissions: operations.Permissions; pattern: operations.Pattern; + settings: operations.Settings; + azureAccounts: operations.AzureAccounts; } export { LUISAuthoringClient, models as LUISAuthoringModels }; diff --git a/lib/services/luis/authoring/lib/lUISAuthoringClient.js b/lib/services/luis/authoring/lib/lUISAuthoringClient.js index b5fa344490..f2a5adc93a 100644 --- a/lib/services/luis/authoring/lib/lUISAuthoringClient.js +++ b/lib/services/luis/authoring/lib/lUISAuthoringClient.js @@ -59,6 +59,8 @@ class LUISAuthoringClient extends ServiceClient { this.train = new operations.Train(this); this.permissions = new operations.Permissions(this); this.pattern = new operations.Pattern(this); + this.settings = new operations.Settings(this); + this.azureAccounts = new operations.AzureAccounts(this); this.models = models; msRest.addSerializationMixin(this); } diff --git a/lib/services/luis/authoring/lib/models/appVersionSettingObject.js b/lib/services/luis/authoring/lib/models/appVersionSettingObject.js new file mode 100644 index 0000000000..1f0134e2ac --- /dev/null +++ b/lib/services/luis/authoring/lib/models/appVersionSettingObject.js @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Object model of an application version setting. + * + */ +class AppVersionSettingObject { + /** + * Create a AppVersionSettingObject. + * @property {string} [name] The application version setting name. + * @property {string} [value] The application version setting value. + */ + constructor() { + } + + /** + * Defines the metadata of AppVersionSettingObject + * + * @returns {object} metadata of AppVersionSettingObject + * + */ + mapper() { + return { + required: false, + serializedName: 'AppVersionSettingObject', + type: { + name: 'Composite', + className: 'AppVersionSettingObject', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppVersionSettingObject; diff --git a/lib/services/luis/authoring/lib/models/applicationCreateObject.js b/lib/services/luis/authoring/lib/models/applicationCreateObject.js index 444d2e3ca9..8ae4a89e42 100644 --- a/lib/services/luis/authoring/lib/models/applicationCreateObject.js +++ b/lib/services/luis/authoring/lib/models/applicationCreateObject.js @@ -17,18 +17,18 @@ class ApplicationCreateObject { /** * Create a ApplicationCreateObject. - * @member {string} culture The culture for the new application. It is the + * @property {string} culture The culture for the new application. It is the * language that your app understands and speaks. E.g.: "en-us". Note: the * culture cannot be changed after the app is created. - * @member {string} [domain] The domain for the new application. Optional. + * @property {string} [domain] The domain for the new application. Optional. * E.g.: Comics. - * @member {string} [description] Description of the new application. + * @property {string} [description] Description of the new application. * Optional. - * @member {string} [initialVersionId] The initial version ID. Optional. + * @property {string} [initialVersionId] The initial version ID. Optional. * Default value is: "0.1" - * @member {string} [usageScenario] Defines the scenario for the new + * @property {string} [usageScenario] Defines the scenario for the new * application. Optional. E.g.: IoT. - * @member {string} name The name for the new application. + * @property {string} name The name for the new application. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/applicationInfoResponse.js b/lib/services/luis/authoring/lib/models/applicationInfoResponse.js index 832957f3a4..45d56bf5ca 100644 --- a/lib/services/luis/authoring/lib/models/applicationInfoResponse.js +++ b/lib/services/luis/authoring/lib/models/applicationInfoResponse.js @@ -17,22 +17,22 @@ class ApplicationInfoResponse { /** * Create a ApplicationInfoResponse. - * @member {uuid} [id] The ID (GUID) of the application. - * @member {string} [name] The name of the application. - * @member {string} [description] The description of the application. - * @member {string} [culture] The culture of the application. E.g.: en-us. - * @member {string} [usageScenario] Defines the scenario for the new + * @property {uuid} [id] The ID (GUID) of the application. + * @property {string} [name] The name of the application. + * @property {string} [description] The description of the application. + * @property {string} [culture] The culture of the application. E.g.: en-us. + * @property {string} [usageScenario] Defines the scenario for the new * application. Optional. E.g.: IoT. - * @member {string} [domain] The domain for the new application. Optional. + * @property {string} [domain] The domain for the new application. Optional. * E.g.: Comics. - * @member {number} [versionsCount] Amount of model versions within the + * @property {number} [versionsCount] Amount of model versions within the * application. - * @member {string} [createdDateTime] The version's creation timestamp. - * @member {object} [endpoints] The Runtime endpoint URL for this model + * @property {string} [createdDateTime] The version's creation timestamp. + * @property {object} [endpoints] The Runtime endpoint URL for this model * version. - * @member {number} [endpointHitsCount] Number of calls made to this + * @property {number} [endpointHitsCount] Number of calls made to this * endpoint. - * @member {string} [activeVersion] The version ID currently marked as + * @property {string} [activeVersion] The version ID currently marked as * active. */ constructor() { diff --git a/lib/services/luis/authoring/lib/models/applicationPublishObject.js b/lib/services/luis/authoring/lib/models/applicationPublishObject.js index 3bc2e06e17..deb05fda9a 100644 --- a/lib/services/luis/authoring/lib/models/applicationPublishObject.js +++ b/lib/services/luis/authoring/lib/models/applicationPublishObject.js @@ -17,11 +17,9 @@ class ApplicationPublishObject { /** * Create a ApplicationPublishObject. - * @member {string} [versionId] The version ID to publish. - * @member {boolean} [isStaging] Indicates if the staging slot should be + * @property {string} [versionId] The version ID to publish. + * @property {boolean} [isStaging] Indicates if the staging slot should be * used, instead of the Production one. Default value: false . - * @member {string} [region] The target region that the application is - * published to. */ constructor() { } @@ -54,13 +52,6 @@ class ApplicationPublishObject { type: { name: 'Boolean' } - }, - region: { - required: false, - serializedName: 'region', - type: { - name: 'String' - } } } } diff --git a/lib/services/luis/authoring/lib/models/applicationSettingUpdateObject.js b/lib/services/luis/authoring/lib/models/applicationSettingUpdateObject.js index 4db46ee96e..e6006d7a07 100644 --- a/lib/services/luis/authoring/lib/models/applicationSettingUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/applicationSettingUpdateObject.js @@ -17,7 +17,7 @@ class ApplicationSettingUpdateObject { /** * Create a ApplicationSettingUpdateObject. - * @member {boolean} [publicProperty] Setting your application as public + * @property {boolean} [publicProperty] Setting your application as public * allows other people to use your application's endpoint using their own * keys. */ diff --git a/lib/services/luis/authoring/lib/models/applicationSettings.js b/lib/services/luis/authoring/lib/models/applicationSettings.js index 1e03958229..8aff2a2769 100644 --- a/lib/services/luis/authoring/lib/models/applicationSettings.js +++ b/lib/services/luis/authoring/lib/models/applicationSettings.js @@ -17,9 +17,9 @@ class ApplicationSettings { /** * Create a ApplicationSettings. - * @member {uuid} id The application ID. - * @member {boolean} isPublic Setting your application as public allows other - * people to use your application's endpoint using their own keys. + * @property {uuid} id The application ID. + * @property {boolean} isPublic Setting your application as public allows + * other people to use your application's endpoint using their own keys. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/applicationUpdateObject.js b/lib/services/luis/authoring/lib/models/applicationUpdateObject.js index 71962b8ab1..eaad61f3b7 100644 --- a/lib/services/luis/authoring/lib/models/applicationUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/applicationUpdateObject.js @@ -17,8 +17,8 @@ class ApplicationUpdateObject { /** * Create a ApplicationUpdateObject. - * @member {string} [name] The application's new name. - * @member {string} [description] The application's new description. + * @property {string} [name] The application's new name. + * @property {string} [description] The application's new description. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/availableCulture.js b/lib/services/luis/authoring/lib/models/availableCulture.js index c0ffcfe6cb..7373b8faa2 100644 --- a/lib/services/luis/authoring/lib/models/availableCulture.js +++ b/lib/services/luis/authoring/lib/models/availableCulture.js @@ -17,8 +17,8 @@ class AvailableCulture { /** * Create a AvailableCulture. - * @member {string} [name] The language name. - * @member {string} [code] The ISO value for the language. + * @property {string} [name] The language name. + * @property {string} [code] The ISO value for the language. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/availablePrebuiltEntityModel.js b/lib/services/luis/authoring/lib/models/availablePrebuiltEntityModel.js index 397336bdb6..b236eea6cc 100644 --- a/lib/services/luis/authoring/lib/models/availablePrebuiltEntityModel.js +++ b/lib/services/luis/authoring/lib/models/availablePrebuiltEntityModel.js @@ -17,10 +17,10 @@ class AvailablePrebuiltEntityModel { /** * Create a AvailablePrebuiltEntityModel. - * @member {string} [name] The entity name. - * @member {string} [description] The entity description and usage + * @property {string} [name] The entity name. + * @property {string} [description] The entity description and usage * information. - * @member {string} [examples] Usage examples. + * @property {string} [examples] Usage examples. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/azureAccountInfoObject.js b/lib/services/luis/authoring/lib/models/azureAccountInfoObject.js new file mode 100644 index 0000000000..423feb78a3 --- /dev/null +++ b/lib/services/luis/authoring/lib/models/azureAccountInfoObject.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Defines the azure account information object. + * + */ +class AzureAccountInfoObject { + /** + * Create a AzureAccountInfoObject. + * @property {string} azureSubscriptionId The id for the azure subscription. + * @property {string} resourceGroup The azure resource group name. + * @property {string} accountName The azure account name. + */ + constructor() { + } + + /** + * Defines the metadata of AzureAccountInfoObject + * + * @returns {object} metadata of AzureAccountInfoObject + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureAccountInfoObject', + type: { + name: 'Composite', + className: 'AzureAccountInfoObject', + modelProperties: { + azureSubscriptionId: { + required: true, + serializedName: 'azureSubscriptionId', + type: { + name: 'String' + } + }, + resourceGroup: { + required: true, + serializedName: 'resourceGroup', + type: { + name: 'String' + } + }, + accountName: { + required: true, + serializedName: 'accountName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AzureAccountInfoObject; diff --git a/lib/services/luis/authoring/lib/models/batchLabelExample.js b/lib/services/luis/authoring/lib/models/batchLabelExample.js index d347c3b7d8..654fb30930 100644 --- a/lib/services/luis/authoring/lib/models/batchLabelExample.js +++ b/lib/services/luis/authoring/lib/models/batchLabelExample.js @@ -17,14 +17,14 @@ class BatchLabelExample { /** * Create a BatchLabelExample. - * @member {object} [value] - * @member {string} [value.utteranceText] The sample's utterance. - * @member {number} [value.exampleId] The newly created sample ID. - * @member {boolean} [hasError] - * @member {object} [error] - * @member {string} [error.code] Status Code. Possible values include: + * @property {object} [value] + * @property {string} [value.utteranceText] The sample's utterance. + * @property {number} [value.exampleId] The newly created sample ID. + * @property {boolean} [hasError] + * @property {object} [error] + * @property {string} [error.code] Status Code. Possible values include: * 'Failed', 'FAILED', 'Success' - * @member {string} [error.message] Status details. + * @property {string} [error.message] Status details. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/childEntity.js b/lib/services/luis/authoring/lib/models/childEntity.js index 2e9b7ff54f..60af9a6266 100644 --- a/lib/services/luis/authoring/lib/models/childEntity.js +++ b/lib/services/luis/authoring/lib/models/childEntity.js @@ -17,8 +17,8 @@ class ChildEntity { /** * Create a ChildEntity. - * @member {uuid} id The ID (GUID) belonging to a child entity. - * @member {string} [name] The name of a child entity. + * @property {uuid} id The ID (GUID) belonging to a child entity. + * @property {string} [name] The name of a child entity. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/closedList.js b/lib/services/luis/authoring/lib/models/closedList.js index 59966c5977..7e0395c97f 100644 --- a/lib/services/luis/authoring/lib/models/closedList.js +++ b/lib/services/luis/authoring/lib/models/closedList.js @@ -17,9 +17,9 @@ class ClosedList { /** * Create a ClosedList. - * @member {string} [name] Name of the closed list feature. - * @member {array} [subLists] Sublists for the feature. - * @member {array} [roles] + * @property {string} [name] Name of the closed list feature. + * @property {array} [subLists] Sublists for the feature. + * @property {array} [roles] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/closedListEntityExtractor.js b/lib/services/luis/authoring/lib/models/closedListEntityExtractor.js index 7783f8784c..985dd66555 100644 --- a/lib/services/luis/authoring/lib/models/closedListEntityExtractor.js +++ b/lib/services/luis/authoring/lib/models/closedListEntityExtractor.js @@ -17,16 +17,16 @@ class ClosedListEntityExtractor { /** * Create a ClosedListEntityExtractor. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [subLists] List of sub-lists. + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' + * @property {array} [roles] + * @property {array} [subLists] List of sub-lists. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/closedListModelCreateObject.js b/lib/services/luis/authoring/lib/models/closedListModelCreateObject.js index 1eedda138e..73ef737d1b 100644 --- a/lib/services/luis/authoring/lib/models/closedListModelCreateObject.js +++ b/lib/services/luis/authoring/lib/models/closedListModelCreateObject.js @@ -17,8 +17,8 @@ class ClosedListModelCreateObject { /** * Create a ClosedListModelCreateObject. - * @member {array} [subLists] Sublists for the feature. - * @member {string} [name] Name of the closed list feature. + * @property {array} [subLists] Sublists for the feature. + * @property {string} [name] Name of the closed list feature. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/closedListModelPatchObject.js b/lib/services/luis/authoring/lib/models/closedListModelPatchObject.js index 8a71d88297..89eac27233 100644 --- a/lib/services/luis/authoring/lib/models/closedListModelPatchObject.js +++ b/lib/services/luis/authoring/lib/models/closedListModelPatchObject.js @@ -17,7 +17,7 @@ class ClosedListModelPatchObject { /** * Create a ClosedListModelPatchObject. - * @member {array} [subLists] Sublists to add. + * @property {array} [subLists] Sublists to add. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/closedListModelUpdateObject.js b/lib/services/luis/authoring/lib/models/closedListModelUpdateObject.js index dcacfa7f6d..c55d7cbf6a 100644 --- a/lib/services/luis/authoring/lib/models/closedListModelUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/closedListModelUpdateObject.js @@ -17,8 +17,8 @@ class ClosedListModelUpdateObject { /** * Create a ClosedListModelUpdateObject. - * @member {array} [subLists] The new sublists for the feature. - * @member {string} [name] The new name of the closed list feature. + * @property {array} [subLists] The new sublists for the feature. + * @property {string} [name] The new name of the closed list feature. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/collaboratorsArray.js b/lib/services/luis/authoring/lib/models/collaboratorsArray.js index 6e911824cb..b5b1b0887b 100644 --- a/lib/services/luis/authoring/lib/models/collaboratorsArray.js +++ b/lib/services/luis/authoring/lib/models/collaboratorsArray.js @@ -16,7 +16,7 @@ class CollaboratorsArray { /** * Create a CollaboratorsArray. - * @member {array} [emails] The email address of the users. + * @property {array} [emails] The email address of the users. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/compositeChildModelCreateObject.js b/lib/services/luis/authoring/lib/models/compositeChildModelCreateObject.js index 4c7065b175..005ca930f1 100644 --- a/lib/services/luis/authoring/lib/models/compositeChildModelCreateObject.js +++ b/lib/services/luis/authoring/lib/models/compositeChildModelCreateObject.js @@ -16,7 +16,7 @@ class CompositeChildModelCreateObject { /** * Create a CompositeChildModelCreateObject. - * @member {string} [name] + * @property {string} [name] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/compositeEntityExtractor.js b/lib/services/luis/authoring/lib/models/compositeEntityExtractor.js index b0a4ab6e4d..8e892684c4 100644 --- a/lib/services/luis/authoring/lib/models/compositeEntityExtractor.js +++ b/lib/services/luis/authoring/lib/models/compositeEntityExtractor.js @@ -17,16 +17,16 @@ class CompositeEntityExtractor { /** * Create a CompositeEntityExtractor. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [children] List of child entities. + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' + * @property {array} [roles] + * @property {array} [children] List of child entities. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/compositeEntityModel.js b/lib/services/luis/authoring/lib/models/compositeEntityModel.js index c3da990f6e..cbc7d24c25 100644 --- a/lib/services/luis/authoring/lib/models/compositeEntityModel.js +++ b/lib/services/luis/authoring/lib/models/compositeEntityModel.js @@ -17,8 +17,8 @@ class CompositeEntityModel { /** * Create a CompositeEntityModel. - * @member {array} [children] Child entities. - * @member {string} [name] Entity name. + * @property {array} [children] Child entities. + * @property {string} [name] Entity name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/customPrebuiltModel.js b/lib/services/luis/authoring/lib/models/customPrebuiltModel.js index 92624bcac5..8feba66eab 100644 --- a/lib/services/luis/authoring/lib/models/customPrebuiltModel.js +++ b/lib/services/luis/authoring/lib/models/customPrebuiltModel.js @@ -17,17 +17,18 @@ class CustomPrebuiltModel { /** * Create a CustomPrebuiltModel. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {string} [customPrebuiltDomainName] The domain name. - * @member {string} [customPrebuiltModelName] The intent name or entity name. - * @member {array} [roles] + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' + * @property {string} [customPrebuiltDomainName] The domain name. + * @property {string} [customPrebuiltModelName] The intent name or entity + * name. + * @property {array} [roles] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/dispatchConnectedServiceDeleteObject.js b/lib/services/luis/authoring/lib/models/dispatchConnectedServiceDeleteObject.js new file mode 100644 index 0000000000..cd65db2f78 --- /dev/null +++ b/lib/services/luis/authoring/lib/models/dispatchConnectedServiceDeleteObject.js @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * An intent to delete its disptch connected service. + * + */ +class DispatchConnectedServiceDeleteObject { + /** + * Create a DispatchConnectedServiceDeleteObject. + * @property {string} [intentName] The name of the intent connected to the + * dispatch + */ + constructor() { + } + + /** + * Defines the metadata of DispatchConnectedServiceDeleteObject + * + * @returns {object} metadata of DispatchConnectedServiceDeleteObject + * + */ + mapper() { + return { + required: false, + serializedName: 'DispatchConnectedServiceDeleteObject', + type: { + name: 'Composite', + className: 'DispatchConnectedServiceDeleteObject', + modelProperties: { + intentName: { + required: false, + serializedName: 'intentName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DispatchConnectedServiceDeleteObject; diff --git a/lib/services/luis/authoring/lib/models/dispatchConnectedServiceObject.js b/lib/services/luis/authoring/lib/models/dispatchConnectedServiceObject.js new file mode 100644 index 0000000000..3f703a53d7 --- /dev/null +++ b/lib/services/luis/authoring/lib/models/dispatchConnectedServiceObject.js @@ -0,0 +1,106 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * A disptch connected service. + * + */ +class DispatchConnectedServiceObject { + /** + * Create a DispatchConnectedServiceObject. + * @property {string} [intentName] The name of the intent connected to the + * dispatch + * @property {string} [type] The type of the connected service [luis/qna] + * @property {string} [name] The name of the connected LUIS app (only if type + * is luis) + * @property {uuid} [appId] The ID of the connected LUIS app (only if type is + * luis) + * @property {string} [version] The version ID of the connected LUIS app + * (only if type is luis) + * @property {string} [region] The region of the connected LUIS app (only if + * type is luis) + * @property {uuid} [kbId] The ID of the connected QnA app (only if type is + * qna) + */ + constructor() { + } + + /** + * Defines the metadata of DispatchConnectedServiceObject + * + * @returns {object} metadata of DispatchConnectedServiceObject + * + */ + mapper() { + return { + required: false, + serializedName: 'DispatchConnectedServiceObject', + type: { + name: 'Composite', + className: 'DispatchConnectedServiceObject', + modelProperties: { + intentName: { + required: false, + serializedName: 'intentName', + type: { + name: 'String' + } + }, + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + appId: { + required: false, + serializedName: 'appId', + type: { + name: 'String' + } + }, + version: { + required: false, + serializedName: 'version', + type: { + name: 'String' + } + }, + region: { + required: false, + serializedName: 'region', + type: { + name: 'String' + } + }, + kbId: { + required: false, + serializedName: 'kbId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DispatchConnectedServiceObject; diff --git a/lib/services/luis/authoring/lib/models/endpointInfo.js b/lib/services/luis/authoring/lib/models/endpointInfo.js index dece173db1..b297b86e6d 100644 --- a/lib/services/luis/authoring/lib/models/endpointInfo.js +++ b/lib/services/luis/authoring/lib/models/endpointInfo.js @@ -17,16 +17,17 @@ class EndpointInfo { /** * Create a EndpointInfo. - * @member {string} [versionId] The version ID to publish. - * @member {boolean} [isStaging] Indicates if the staging slot should be + * @property {string} [versionId] The version ID to publish. + * @property {boolean} [isStaging] Indicates if the staging slot should be * used, instead of the Production one. - * @member {string} [endpointUrl] The Runtime endpoint URL for this model + * @property {string} [endpointUrl] The Runtime endpoint URL for this model * version. - * @member {string} [region] The target region that the application is + * @property {string} [region] The target region that the application is * published to. - * @member {string} [assignedEndpointKey] The endpoint key. - * @member {string} [endpointRegion] The endpoint's region. - * @member {string} [publishedDateTime] Timestamp when was last published. + * @property {string} [assignedEndpointKey] The endpoint key. + * @property {string} [endpointRegion] The endpoint's region. + * @property {string} [failedRegions] Regions where publishing failed. + * @property {string} [publishedDateTime] Timestamp when was last published. */ constructor() { } @@ -87,6 +88,13 @@ class EndpointInfo { name: 'String' } }, + failedRegions: { + required: false, + serializedName: 'failedRegions', + type: { + name: 'String' + } + }, publishedDateTime: { required: false, serializedName: 'publishedDateTime', diff --git a/lib/services/luis/authoring/lib/models/enqueueTrainingResponse.js b/lib/services/luis/authoring/lib/models/enqueueTrainingResponse.js index cfa70c0390..d94949ddc9 100644 --- a/lib/services/luis/authoring/lib/models/enqueueTrainingResponse.js +++ b/lib/services/luis/authoring/lib/models/enqueueTrainingResponse.js @@ -17,9 +17,9 @@ class EnqueueTrainingResponse { /** * Create a EnqueueTrainingResponse. - * @member {number} [statusId] The train request status ID. - * @member {string} [status] Possible values include: 'Queued', 'InProgress', - * 'UpToDate', 'Fail', 'Success' + * @property {number} [statusId] The train request status ID. + * @property {string} [status] Possible values include: 'Queued', + * 'InProgress', 'UpToDate', 'Fail', 'Success' */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/entitiesSuggestionExample.js b/lib/services/luis/authoring/lib/models/entitiesSuggestionExample.js index de84bf8d12..2cb443d930 100644 --- a/lib/services/luis/authoring/lib/models/entitiesSuggestionExample.js +++ b/lib/services/luis/authoring/lib/models/entitiesSuggestionExample.js @@ -17,11 +17,11 @@ class EntitiesSuggestionExample { /** * Create a EntitiesSuggestionExample. - * @member {string} [text] The utterance. E.g.: what's the weather like in + * @property {string} [text] The utterance. E.g.: what's the weather like in * seattle? - * @member {array} [tokenizedText] The utterance tokenized. - * @member {array} [intentPredictions] Predicted/suggested intents. - * @member {array} [entityPredictions] Predicted/suggested entities. + * @property {array} [tokenizedText] The utterance tokenized. + * @property {array} [intentPredictions] Predicted/suggested intents. + * @property {array} [entityPredictions] Predicted/suggested entities. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/entityExtractor.js b/lib/services/luis/authoring/lib/models/entityExtractor.js index 1c4c8ae6ca..9125f6c4f0 100644 --- a/lib/services/luis/authoring/lib/models/entityExtractor.js +++ b/lib/services/luis/authoring/lib/models/entityExtractor.js @@ -17,17 +17,18 @@ class EntityExtractor { /** * Create a EntityExtractor. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {string} [customPrebuiltDomainName] The domain name. - * @member {string} [customPrebuiltModelName] The intent name or entity name. + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' + * @property {array} [roles] + * @property {string} [customPrebuiltDomainName] The domain name. + * @property {string} [customPrebuiltModelName] The intent name or entity + * name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/entityLabel.js b/lib/services/luis/authoring/lib/models/entityLabel.js index 6b8c11d0de..a425e091ec 100644 --- a/lib/services/luis/authoring/lib/models/entityLabel.js +++ b/lib/services/luis/authoring/lib/models/entityLabel.js @@ -18,10 +18,10 @@ class EntityLabel { /** * Create a EntityLabel. - * @member {string} entityName The entity type. - * @member {number} startTokenIndex The index within the utterance where the - * extracted entity starts. - * @member {number} endTokenIndex The index within the utterance where the + * @property {string} entityName The entity type. + * @property {number} startTokenIndex The index within the utterance where + * the extracted entity starts. + * @property {number} endTokenIndex The index within the utterance where the * extracted entity ends. */ constructor() { diff --git a/lib/services/luis/authoring/lib/models/entityLabelObject.js b/lib/services/luis/authoring/lib/models/entityLabelObject.js index 93da4a0ff1..583f05800b 100644 --- a/lib/services/luis/authoring/lib/models/entityLabelObject.js +++ b/lib/services/luis/authoring/lib/models/entityLabelObject.js @@ -18,10 +18,10 @@ class EntityLabelObject { /** * Create a EntityLabelObject. - * @member {string} entityName The entity type. - * @member {number} startCharIndex The index within the utterance where the + * @property {string} entityName The entity type. + * @property {number} startCharIndex The index within the utterance where the * extracted entity starts. - * @member {number} endCharIndex The index within the utterance where the + * @property {number} endCharIndex The index within the utterance where the * extracted entity ends. */ constructor() { diff --git a/lib/services/luis/authoring/lib/models/entityModelInfo.js b/lib/services/luis/authoring/lib/models/entityModelInfo.js index 5b93724751..002ec8e453 100644 --- a/lib/services/luis/authoring/lib/models/entityModelInfo.js +++ b/lib/services/luis/authoring/lib/models/entityModelInfo.js @@ -20,7 +20,7 @@ const models = require('./index'); class EntityModelInfo extends models['ModelInfo'] { /** * Create a EntityModelInfo. - * @member {array} [roles] + * @property {array} [roles] */ constructor() { super(); diff --git a/lib/services/luis/authoring/lib/models/entityPrediction.js b/lib/services/luis/authoring/lib/models/entityPrediction.js index e6fc4f16a3..6eb9941f08 100644 --- a/lib/services/luis/authoring/lib/models/entityPrediction.js +++ b/lib/services/luis/authoring/lib/models/entityPrediction.js @@ -17,12 +17,12 @@ class EntityPrediction { /** * Create a EntityPrediction. - * @member {string} entityName The entity's name - * @member {number} startTokenIndex The index within the utterance where the - * extracted entity starts. - * @member {number} endTokenIndex The index within the utterance where the + * @property {string} entityName The entity's name + * @property {number} startTokenIndex The index within the utterance where + * the extracted entity starts. + * @property {number} endTokenIndex The index within the utterance where the * extracted entity ends. - * @member {string} phrase The actual token(s) that comprise the entity. + * @property {string} phrase The actual token(s) that comprise the entity. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/entityRole.js b/lib/services/luis/authoring/lib/models/entityRole.js index 77c4015981..49efef4ff7 100644 --- a/lib/services/luis/authoring/lib/models/entityRole.js +++ b/lib/services/luis/authoring/lib/models/entityRole.js @@ -17,8 +17,8 @@ class EntityRole { /** * Create a EntityRole. - * @member {uuid} [id] The entity role ID. - * @member {string} [name] The entity role name. + * @property {uuid} [id] The entity role ID. + * @property {string} [name] The entity role name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/entityRoleCreateObject.js b/lib/services/luis/authoring/lib/models/entityRoleCreateObject.js index f5db3294bc..46033050e3 100644 --- a/lib/services/luis/authoring/lib/models/entityRoleCreateObject.js +++ b/lib/services/luis/authoring/lib/models/entityRoleCreateObject.js @@ -17,7 +17,7 @@ class EntityRoleCreateObject { /** * Create a EntityRoleCreateObject. - * @member {string} [name] The entity role name. + * @property {string} [name] The entity role name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/entityRoleUpdateObject.js b/lib/services/luis/authoring/lib/models/entityRoleUpdateObject.js index 03ab723a98..9f791249a3 100644 --- a/lib/services/luis/authoring/lib/models/entityRoleUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/entityRoleUpdateObject.js @@ -17,7 +17,7 @@ class EntityRoleUpdateObject { /** * Create a EntityRoleUpdateObject. - * @member {string} [name] The entity role name. + * @property {string} [name] The entity role name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/errorResponse.js b/lib/services/luis/authoring/lib/models/errorResponse.js index c6acbb4f29..1ea302ab17 100644 --- a/lib/services/luis/authoring/lib/models/errorResponse.js +++ b/lib/services/luis/authoring/lib/models/errorResponse.js @@ -17,7 +17,7 @@ class ErrorResponse { /** * Create a ErrorResponse. - * @member {string} [errorType] + * @property {string} [errorType] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/exampleLabelObject.js b/lib/services/luis/authoring/lib/models/exampleLabelObject.js index 07804bc808..5794f1c8d5 100644 --- a/lib/services/luis/authoring/lib/models/exampleLabelObject.js +++ b/lib/services/luis/authoring/lib/models/exampleLabelObject.js @@ -17,9 +17,10 @@ class ExampleLabelObject { /** * Create a ExampleLabelObject. - * @member {string} [text] The sample's utterance. - * @member {array} [entityLabels] The idenfied entities within the utterance. - * @member {string} [intentName] The idenfitied intent representing the + * @property {string} [text] The sample's utterance. + * @property {array} [entityLabels] The identified entities within the + * utterance. + * @property {string} [intentName] The identified intent representing the * utterance. */ constructor() { diff --git a/lib/services/luis/authoring/lib/models/explicitListItem.js b/lib/services/luis/authoring/lib/models/explicitListItem.js index 421f0e13c5..0cdc192aed 100644 --- a/lib/services/luis/authoring/lib/models/explicitListItem.js +++ b/lib/services/luis/authoring/lib/models/explicitListItem.js @@ -17,8 +17,8 @@ class ExplicitListItem { /** * Create a ExplicitListItem. - * @member {number} [id] The explicit list item ID. - * @member {string} [explicitListItem] The explicit list item value. + * @property {number} [id] The explicit list item ID. + * @property {string} [explicitListItem] The explicit list item value. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/explicitListItemCreateObject.js b/lib/services/luis/authoring/lib/models/explicitListItemCreateObject.js index 0f32eb6ed8..f7fe09c0f8 100644 --- a/lib/services/luis/authoring/lib/models/explicitListItemCreateObject.js +++ b/lib/services/luis/authoring/lib/models/explicitListItemCreateObject.js @@ -17,7 +17,7 @@ class ExplicitListItemCreateObject { /** * Create a ExplicitListItemCreateObject. - * @member {string} [explicitListItem] The explicit list item. + * @property {string} [explicitListItem] The explicit list item. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/explicitListItemUpdateObject.js b/lib/services/luis/authoring/lib/models/explicitListItemUpdateObject.js index b987eb25df..5c9ff0a0e3 100644 --- a/lib/services/luis/authoring/lib/models/explicitListItemUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/explicitListItemUpdateObject.js @@ -17,7 +17,7 @@ class ExplicitListItemUpdateObject { /** * Create a ExplicitListItemUpdateObject. - * @member {string} [explicitListItem] The explicit list item. + * @property {string} [explicitListItem] The explicit list item. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/featureInfoObject.js b/lib/services/luis/authoring/lib/models/featureInfoObject.js index f4ac3479f9..255569f8eb 100644 --- a/lib/services/luis/authoring/lib/models/featureInfoObject.js +++ b/lib/services/luis/authoring/lib/models/featureInfoObject.js @@ -17,9 +17,9 @@ class FeatureInfoObject { /** * Create a FeatureInfoObject. - * @member {number} [id] A six-digit ID used for Features. - * @member {string} [name] The name of the Feature. - * @member {boolean} [isActive] Indicates if the feature is enabled. + * @property {number} [id] A six-digit ID used for Features. + * @property {string} [name] The name of the Feature. + * @property {boolean} [isActive] Indicates if the feature is enabled. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/featuresResponseObject.js b/lib/services/luis/authoring/lib/models/featuresResponseObject.js index 1eb800bbf5..d4e8ca9401 100644 --- a/lib/services/luis/authoring/lib/models/featuresResponseObject.js +++ b/lib/services/luis/authoring/lib/models/featuresResponseObject.js @@ -17,8 +17,8 @@ class FeaturesResponseObject { /** * Create a FeaturesResponseObject. - * @member {array} [phraselistFeatures] - * @member {array} [patternFeatures] + * @property {array} [phraselistFeatures] + * @property {array} [patternFeatures] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/hierarchicalChildEntity.js b/lib/services/luis/authoring/lib/models/hierarchicalChildEntity.js index c0097cf6ea..e8ad504b8f 100644 --- a/lib/services/luis/authoring/lib/models/hierarchicalChildEntity.js +++ b/lib/services/luis/authoring/lib/models/hierarchicalChildEntity.js @@ -20,8 +20,8 @@ const models = require('./index'); class HierarchicalChildEntity extends models['ChildEntity'] { /** * Create a HierarchicalChildEntity. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} [readableType] Possible values include: 'Entity + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} [readableType] Possible values include: 'Entity * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity diff --git a/lib/services/luis/authoring/lib/models/hierarchicalChildModelCreateObject.js b/lib/services/luis/authoring/lib/models/hierarchicalChildModelCreateObject.js index 506c78688d..8974784383 100644 --- a/lib/services/luis/authoring/lib/models/hierarchicalChildModelCreateObject.js +++ b/lib/services/luis/authoring/lib/models/hierarchicalChildModelCreateObject.js @@ -16,7 +16,7 @@ class HierarchicalChildModelCreateObject { /** * Create a HierarchicalChildModelCreateObject. - * @member {string} [name] + * @property {string} [name] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/hierarchicalChildModelUpdateObject.js b/lib/services/luis/authoring/lib/models/hierarchicalChildModelUpdateObject.js index 4483afd4e0..f60bc0ef6b 100644 --- a/lib/services/luis/authoring/lib/models/hierarchicalChildModelUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/hierarchicalChildModelUpdateObject.js @@ -16,7 +16,7 @@ class HierarchicalChildModelUpdateObject { /** * Create a HierarchicalChildModelUpdateObject. - * @member {string} [name] + * @property {string} [name] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/hierarchicalEntityExtractor.js b/lib/services/luis/authoring/lib/models/hierarchicalEntityExtractor.js index 4daf9b0a66..066a0a3044 100644 --- a/lib/services/luis/authoring/lib/models/hierarchicalEntityExtractor.js +++ b/lib/services/luis/authoring/lib/models/hierarchicalEntityExtractor.js @@ -17,16 +17,16 @@ class HierarchicalEntityExtractor { /** * Create a HierarchicalEntityExtractor. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [children] List of child entities. + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' + * @property {array} [roles] + * @property {array} [children] List of child entities. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/hierarchicalEntityModel.js b/lib/services/luis/authoring/lib/models/hierarchicalEntityModel.js index d16fc5c417..219d5e24e6 100644 --- a/lib/services/luis/authoring/lib/models/hierarchicalEntityModel.js +++ b/lib/services/luis/authoring/lib/models/hierarchicalEntityModel.js @@ -17,8 +17,8 @@ class HierarchicalEntityModel { /** * Create a HierarchicalEntityModel. - * @member {array} [children] Child entities. - * @member {string} [name] Entity name. + * @property {array} [children] Child entities. + * @property {string} [name] Entity name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/hierarchicalModel.js b/lib/services/luis/authoring/lib/models/hierarchicalModel.js index 4fc2e6e65b..60d689345f 100644 --- a/lib/services/luis/authoring/lib/models/hierarchicalModel.js +++ b/lib/services/luis/authoring/lib/models/hierarchicalModel.js @@ -16,12 +16,12 @@ class HierarchicalModel { /** * Create a HierarchicalModel. - * @member {string} [name] - * @member {array} [children] - * @member {object} [inherits] - * @member {string} [inherits.domainName] - * @member {string} [inherits.modelName] - * @member {array} [roles] + * @property {string} [name] + * @property {array} [children] + * @property {object} [inherits] + * @property {string} [inherits.domainName] + * @property {string} [inherits.modelName] + * @property {array} [roles] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/index.d.ts b/lib/services/luis/authoring/lib/models/index.d.ts index 2613285b07..3bad6fe75e 100644 --- a/lib/services/luis/authoring/lib/models/index.d.ts +++ b/lib/services/luis/authoring/lib/models/index.d.ts @@ -1,569 +1,558 @@ /* * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. + * Licensed under the MIT License. See License.txt in the project root for license information. * * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ import * as moment from "moment"; - /** - * @class - * Initializes a new instance of the EntityLabelObject class. - * @constructor - * Defines the entity type and position of the extracted entity within the - * example. - * - * @member {string} entityName The entity type. - * @member {number} startCharIndex The index within the utterance where the - * extracted entity starts. - * @member {number} endCharIndex The index within the utterance where the - * extracted entity ends. + * Defines the entity type and position of the extracted entity within the example. */ export interface EntityLabelObject { + /** + * The entity type. + */ entityName: string; + /** + * The index within the utterance where the extracted entity starts. + */ startCharIndex: number; + /** + * The index within the utterance where the extracted entity ends. + */ endCharIndex: number; } /** - * @class - * Initializes a new instance of the ApplicationCreateObject class. - * @constructor * Properties for creating a new LUIS Application - * - * @member {string} culture The culture for the new application. It is the - * language that your app understands and speaks. E.g.: "en-us". Note: the - * culture cannot be changed after the app is created. - * @member {string} [domain] The domain for the new application. Optional. - * E.g.: Comics. - * @member {string} [description] Description of the new application. Optional. - * @member {string} [initialVersionId] The initial version ID. Optional. - * Default value is: "0.1" - * @member {string} [usageScenario] Defines the scenario for the new - * application. Optional. E.g.: IoT. - * @member {string} name The name for the new application. */ export interface ApplicationCreateObject { + /** + * The culture for the new application. It is the language that your app understands and speaks. + * E.g.: "en-us". Note: the culture cannot be changed after the app is created. + */ culture: string; + /** + * The domain for the new application. Optional. E.g.: Comics. + */ domain?: string; + /** + * Description of the new application. Optional. + */ description?: string; + /** + * The initial version ID. Optional. Default value is: "0.1" + */ initialVersionId?: string; + /** + * Defines the scenario for the new application. Optional. E.g.: IoT. + */ usageScenario?: string; + /** + * The name for the new application. + */ name: string; } /** - * @class - * Initializes a new instance of the PrebuiltDomainCreateBaseObject class. - * @constructor - * A model object containing the name of the custom prebuilt entity and the - * name of the domain to which this model belongs. - * - * @member {string} [domainName] The domain name. + * A model object containing the name of the custom prebuilt entity and the name of the domain to + * which this model belongs. */ export interface PrebuiltDomainCreateBaseObject { + /** + * The domain name. + */ domainName?: string; } /** - * @class - * Initializes a new instance of the PrebuiltDomainCreateObject class. - * @constructor - * A prebuilt domain create object containing the name and culture of the - * domain. - * - * @member {string} [domainName] The domain name. - * @member {string} [culture] The culture of the new domain. + * A prebuilt domain create object containing the name and culture of the domain. */ export interface PrebuiltDomainCreateObject { + /** + * The domain name. + */ domainName?: string; + /** + * The culture of the new domain. + */ culture?: string; } /** - * @class - * Initializes a new instance of the PrebuiltDomainModelCreateObject class. - * @constructor - * A model object containing the name of the custom prebuilt intent or entity - * and the name of the domain to which this model belongs. - * - * @member {string} [domainName] The domain name. - * @member {string} [modelName] The intent name or entity name. + * A model object containing the name of the custom prebuilt intent or entity and the name of the + * domain to which this model belongs. */ export interface PrebuiltDomainModelCreateObject { + /** + * The domain name. + */ domainName?: string; + /** + * The intent name or entity name. + */ modelName?: string; } /** - * @class - * Initializes a new instance of the HierarchicalEntityModel class. - * @constructor * A Hierarchical Entity Extractor. - * - * @member {array} [children] Child entities. - * @member {string} [name] Entity name. */ export interface HierarchicalEntityModel { + /** + * Child entities. + */ children?: string[]; + /** + * Entity name. + */ name?: string; } /** - * @class - * Initializes a new instance of the CompositeEntityModel class. - * @constructor * A composite entity. - * - * @member {array} [children] Child entities. - * @member {string} [name] Entity name. */ export interface CompositeEntityModel { + /** + * Child entities. + */ children?: string[]; + /** + * Entity name. + */ name?: string; } /** - * @class - * Initializes a new instance of the JSONEntity class. - * @constructor * Exported Model - Extracted Entity from utterance. - * - * @member {number} startPos The index within the utterance where the extracted - * entity starts. - * @member {number} endPos The index within the utterance where the extracted - * entity ends. - * @member {string} entity The entity name. */ export interface JSONEntity { + /** + * The index within the utterance where the extracted entity starts. + */ startPos: number; + /** + * The index within the utterance where the extracted entity ends. + */ endPos: number; + /** + * The entity name. + */ entity: string; } /** - * @class - * Initializes a new instance of the ApplicationSettingUpdateObject class. - * @constructor * Object model for updating an application's settings. - * - * @member {boolean} [publicProperty] Setting your application as public allows - * other people to use your application's endpoint using their own keys. */ export interface ApplicationSettingUpdateObject { + /** + * Setting your application as public allows other people to use your application's endpoint + * using their own keys. + */ publicProperty?: boolean; } /** - * @class - * Initializes a new instance of the PublishSettingUpdateObject class. - * @constructor * Object model for updating an application's publish settings. - * - * @member {boolean} [sentimentAnalysis] Setting sentiment analysis as true - * returns the Sentiment of the input utterance along with the resopnse - * @member {boolean} [speech] Setting speech as public enables speech priming - * in your app - * @member {boolean} [spellChecker] Setting spell checker as public enables - * spell checking the input utterance. */ export interface PublishSettingUpdateObject { + /** + * Setting sentiment analysis as true returns the Sentiment of the input utterance along with the + * response + */ sentimentAnalysis?: boolean; + /** + * Setting speech as public enables speech priming in your app + */ speech?: boolean; + /** + * Setting spell checker as public enables spell checking the input utterance. + */ spellChecker?: boolean; } /** - * @class - * Initializes a new instance of the ExampleLabelObject class. - * @constructor * A labeled example. - * - * @member {string} [text] The sample's utterance. - * @member {array} [entityLabels] The idenfied entities within the utterance. - * @member {string} [intentName] The idenfitied intent representing the - * utterance. */ export interface ExampleLabelObject { + /** + * The sample's utterance. + */ text?: string; + /** + * The identified entities within the utterance. + */ entityLabels?: EntityLabelObject[]; + /** + * The identified intent representing the utterance. + */ intentName?: string; } /** - * @class - * Initializes a new instance of the PhraselistCreateObject class. - * @constructor * Object model for creating a phraselist model. - * - * @member {string} [phrases] List of comma-separated phrases that represent - * the Phraselist. - * @member {string} [name] The Phraselist name. - * @member {boolean} [isExchangeable] An exchangeable phrase list feature are - * serves as single feature to the LUIS underlying training algorithm. It is - * used as a lexicon lookup feature where its value is 1 if the lexicon - * contains a given word or 0 if it doesn’t. Think of an exchangeable as a - * synonyms list. A non-exchangeable phrase list feature has all the phrases in - * the list serve as separate features to the underlying training algorithm. - * So, if you your phrase list feature contains 5 phrases, they will be mapped - * to 5 separate features. You can think of the non-exchangeable phrase list - * feature as an additional bag of words that you are willing to add to LUIS - * existing vocabulary features. Think of a non-exchangeable as set of - * different words. Default value is true. Default value: true . */ export interface PhraselistCreateObject { + /** + * List of comma-separated phrases that represent the Phraselist. + */ phrases?: string; + /** + * The Phraselist name. + */ name?: string; + /** + * An exchangeable phrase list feature are serves as single feature to the LUIS underlying + * training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon + * contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A + * non-exchangeable phrase list feature has all the phrases in the list serve as separate + * features to the underlying training algorithm. So, if you your phrase list feature contains 5 + * phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable + * phrase list feature as an additional bag of words that you are willing to add to LUIS existing + * vocabulary features. Think of a non-exchangeable as set of different words. Default value is + * true. + */ isExchangeable?: boolean; } /** - * @class - * Initializes a new instance of the SubClosedList class. - * @constructor * Sublist of items for a Closed list. - * - * @member {string} [canonicalForm] The standard form that the list represents. - * @member {array} [list] List of synonym words. */ export interface SubClosedList { + /** + * The standard form that the list represents. + */ canonicalForm?: string; + /** + * List of synonym words. + */ list?: string[]; } /** - * @class - * Initializes a new instance of the SubClosedListResponse class. - * @constructor * Sublist of items for a Closed list. - * - * @member {number} [id] The sublist ID */ export interface SubClosedListResponse extends SubClosedList { + /** + * The sublist ID + */ id?: number; } /** - * @class - * Initializes a new instance of the ApplicationUpdateObject class. - * @constructor * Object model for updating the name or description of an application. - * - * @member {string} [name] The application's new name. - * @member {string} [description] The application's new description. */ export interface ApplicationUpdateObject { + /** + * The application's new name. + */ name?: string; + /** + * The application's new description. + */ description?: string; } /** - * @class - * Initializes a new instance of the JSONRegexFeature class. - * @constructor * Exported Model - A Pattern feature. - * - * @member {string} [pattern] The Regular Expression to match. - * @member {boolean} [activated] Indicates if the Pattern feature is enabled. - * @member {string} [name] Name of the feature. */ export interface JSONRegexFeature { + /** + * The Regular Expression to match. + */ pattern?: string; + /** + * Indicates if the Pattern feature is enabled. + */ activated?: boolean; + /** + * Name of the feature. + */ name?: string; } /** - * @class - * Initializes a new instance of the PatternUpdateObject class. - * @constructor * Object model for updating an existing Pattern feature. - * - * @member {string} [pattern] The Regular Expression to match. - * @member {string} [name] Name of the feature. - * @member {boolean} [isActive] Indicates if the Pattern feature is enabled. - * Default value: true . */ export interface PatternUpdateObject { + /** + * The Regular Expression to match. + */ pattern?: string; + /** + * Name of the feature. + */ name?: string; + /** + * Indicates if the Pattern feature is enabled. + */ isActive?: boolean; } /** - * @class - * Initializes a new instance of the ClosedList class. - * @constructor * Exported Model - A Closed List. - * - * @member {string} [name] Name of the closed list feature. - * @member {array} [subLists] Sublists for the feature. - * @member {array} [roles] */ export interface ClosedList { + /** + * Name of the closed list feature. + */ name?: string; + /** + * Sublists for the feature. + */ subLists?: SubClosedList[]; roles?: string[]; } /** - * @class - * Initializes a new instance of the WordListObject class. - * @constructor * Sublist of items for a Closed list. - * - * @member {string} [canonicalForm] The standard form that the list represents. - * @member {array} [list] List of synonym words. - */ +*/ export interface WordListObject { + /** + * The standard form that the list represents. + */ canonicalForm?: string; + /** + * List of synonym words. + */ list?: string[]; } /** - * @class - * Initializes a new instance of the ClosedListModelPatchObject class. - * @constructor * Object model for adding a batch of sublists to an existing closedlist. - * - * @member {array} [subLists] Sublists to add. - */ +*/ export interface ClosedListModelPatchObject { + /** + * Sublists to add. + */ subLists?: WordListObject[]; } /** - * @class - * Initializes a new instance of the JSONModelFeature class. - * @constructor * Exported Model - Phraselist Model Feature. - * - * @member {boolean} [activated] Indicates if the feature is enabled. - * @member {string} [name] The Phraselist name. - * @member {string} [words] List of comma-separated phrases that represent the - * Phraselist. - * @member {boolean} [mode] An exchangeable phrase list feature are serves as - * single feature to the LUIS underlying training algorithm. It is used as a - * lexicon lookup feature where its value is 1 if the lexicon contains a given - * word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A - * non-exchangeable phrase list feature has all the phrases in the list serve - * as separate features to the underlying training algorithm. So, if you your - * phrase list feature contains 5 phrases, they will be mapped to 5 separate - * features. You can think of the non-exchangeable phrase list feature as an - * additional bag of words that you are willing to add to LUIS existing - * vocabulary features. Think of a non-exchangeable as set of different words. - * Default value is true. - */ +*/ export interface JSONModelFeature { + /** + * Indicates if the feature is enabled. + */ activated?: boolean; + /** + * The Phraselist name. + */ name?: string; + /** + * List of comma-separated phrases that represent the Phraselist. + */ words?: string; + /** + * An exchangeable phrase list feature are serves as single feature to the LUIS underlying + * training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon + * contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A + * non-exchangeable phrase list feature has all the phrases in the list serve as separate + * features to the underlying training algorithm. So, if you your phrase list feature contains 5 + * phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable + * phrase list feature as an additional bag of words that you are willing to add to LUIS existing + * vocabulary features. Think of a non-exchangeable as set of different words. Default value is + * true. + */ mode?: boolean; } /** - * @class - * Initializes a new instance of the ModelCreateObject class. - * @constructor * Object model for creating a new entity extractor. - * - * @member {string} [name] Name of the new entity extractor. - */ +*/ export interface ModelCreateObject { + /** + * Name of the new entity extractor. + */ name?: string; } /** - * @class - * Initializes a new instance of the PatternCreateObject class. - * @constructor * Object model for creating a Pattern feature. - * - * @member {string} [pattern] The Regular Expression to match. - * @member {string} [name] Name of the feature. - */ +*/ export interface PatternCreateObject { + /** + * The Regular Expression to match. + */ pattern?: string; + /** + * Name of the feature. + */ name?: string; } /** - * @class - * Initializes a new instance of the WordListBaseUpdateObject class. - * @constructor * Object model for updating one of the closed list's sublists. - * - * @member {string} [canonicalForm] The standard form that the list represents. - * @member {array} [list] List of synonym words. - */ +*/ export interface WordListBaseUpdateObject { + /** + * The standard form that the list represents. + */ canonicalForm?: string; + /** + * List of synonym words. + */ list?: string[]; } /** - * @class - * Initializes a new instance of the JSONUtterance class. - * @constructor * Exported Model - Utterance that was used to train the model. - * - * @member {string} [text] The utterance. - * @member {string} [intent] The matched intent. - * @member {array} [entities] The matched entities. - */ +*/ export interface JSONUtterance { + /** + * The utterance. + */ text?: string; + /** + * The matched intent. + */ intent?: string; + /** + * The matched entities. + */ entities?: JSONEntity[]; } /** - * @class - * Initializes a new instance of the ModelUpdateObject class. - * @constructor * Object model for updating an intent classifier. - * - * @member {string} [name] The entity's new name. - */ +*/ export interface ModelUpdateObject { + /** + * The entity's new name. + */ name?: string; } /** - * @class - * Initializes a new instance of the ClosedListModelUpdateObject class. - * @constructor * Object model for updating a closed list. - * - * @member {array} [subLists] The new sublists for the feature. - * @member {string} [name] The new name of the closed list feature. - */ +*/ export interface ClosedListModelUpdateObject { + /** + * The new sublists for the feature. + */ subLists?: WordListObject[]; + /** + * The new name of the closed list feature. + */ name?: string; } /** - * @class - * Initializes a new instance of the ClosedListModelCreateObject class. - * @constructor * Object model for creating a closed list. - * - * @member {array} [subLists] Sublists for the feature. - * @member {string} [name] Name of the closed list feature. - */ +*/ export interface ClosedListModelCreateObject { + /** + * Sublists for the feature. + */ subLists?: WordListObject[]; + /** + * Name of the closed list feature. + */ name?: string; } /** - * @class - * Initializes a new instance of the VersionInfo class. - * @constructor * Object model of an application version. - * - * @member {string} version The version ID. E.g.: "0.1" - * @member {date} [createdDateTime] The version's creation timestamp. - * @member {date} [lastModifiedDateTime] Timestamp of the last update. - * @member {date} [lastTrainedDateTime] Timestamp of the last time the model - * was trained. - * @member {date} [lastPublishedDateTime] Timestamp when was last published. - * @member {string} [endpointUrl] The Runtime endpoint URL for this model - * version. - * @member {object} [assignedEndpointKey] The endpoint key. - * @member {object} [externalApiKeys] External keys. - * @member {number} [intentsCount] Number of intents in this model. - * @member {number} [entitiesCount] Number of entities in this model. - * @member {number} [endpointHitsCount] Number of calls made to this endpoint. - * @member {string} trainingStatus The current training status. Possible values - * include: 'NeedsTraining', 'InProgress', 'Trained' - */ +*/ export interface VersionInfo { + /** + * The version ID. E.g.: "0.1" + */ version: string; + /** + * The version's creation timestamp. + */ createdDateTime?: Date; + /** + * Timestamp of the last update. + */ lastModifiedDateTime?: Date; + /** + * Timestamp of the last time the model was trained. + */ lastTrainedDateTime?: Date; + /** + * Timestamp when was last published. + */ lastPublishedDateTime?: Date; + /** + * The Runtime endpoint URL for this model version. + */ endpointUrl?: string; + /** + * The endpoint key. + */ assignedEndpointKey?: { [propertyName: string]: string }; + /** + * External keys. + */ externalApiKeys?: any; + /** + * Number of intents in this model. + */ intentsCount?: number; + /** + * Number of entities in this model. + */ entitiesCount?: number; + /** + * Number of calls made to this endpoint. + */ endpointHitsCount?: number; + /** + * The current training status. Possible values include: 'NeedsTraining', 'InProgress', 'Trained' + */ trainingStatus: string; } /** - * @class - * Initializes a new instance of the TaskUpdateObject class. - * @constructor * Object model for cloning an application's version. - * - * @member {string} [version] The new version for the cloned model. - */ +*/ export interface TaskUpdateObject { + /** + * The new version for the cloned model. + */ version?: string; } /** - * @class - * Initializes a new instance of the PhraselistUpdateObject class. - * @constructor * Object model for updating a Phraselist. - * - * @member {string} [phrases] List of comma-separated phrases that represent - * the Phraselist. - * @member {string} [name] The Phraselist name. - * @member {boolean} [isActive] Indicates if the Phraselist is enabled. Default - * value: true . - * @member {boolean} [isExchangeable] An exchangeable phrase list feature are - * serves as single feature to the LUIS underlying training algorithm. It is - * used as a lexicon lookup feature where its value is 1 if the lexicon - * contains a given word or 0 if it doesn’t. Think of an exchangeable as a - * synonyms list. A non-exchangeable phrase list feature has all the phrases in - * the list serve as separate features to the underlying training algorithm. - * So, if you your phrase list feature contains 5 phrases, they will be mapped - * to 5 separate features. You can think of the non-exchangeable phrase list - * feature as an additional bag of words that you are willing to add to LUIS - * existing vocabulary features. Think of a non-exchangeable as set of - * different words. Default value is true. Default value: true . - */ +*/ export interface PhraselistUpdateObject { + /** + * List of comma-separated phrases that represent the Phraselist. + */ phrases?: string; + /** + * The Phraselist name. + */ name?: string; + /** + * Indicates if the Phraselist is enabled. + */ isActive?: boolean; + /** + * An exchangeable phrase list feature are serves as single feature to the LUIS underlying + * training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon + * contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A + * non-exchangeable phrase list feature has all the phrases in the list serve as separate + * features to the underlying training algorithm. So, if you your phrase list feature contains 5 + * phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable + * phrase list feature as an additional bag of words that you are willing to add to LUIS existing + * vocabulary features. Think of a non-exchangeable as set of different words. Default value is + * true. + */ isExchangeable?: boolean; } -/** - * @class - * Initializes a new instance of the PrebuiltDomainObject class. - * @constructor - * @member {string} [domainName] - * @member {string} [modelName] - */ export interface PrebuiltDomainObject { domainName?: string; modelName?: string; } -/** - * @class - * Initializes a new instance of the HierarchicalModel class. - * @constructor - * @member {string} [name] - * @member {array} [children] - * @member {object} [inherits] - * @member {string} [inherits.domainName] - * @member {string} [inherits.modelName] - * @member {array} [roles] - */ export interface HierarchicalModel { name?: string; children?: string[]; @@ -572,33 +561,22 @@ export interface HierarchicalModel { } /** - * @class - * Initializes a new instance of the ApplicationPublishObject class. - * @constructor * Object model for publishing a specific application version. - * - * @member {string} [versionId] The version ID to publish. - * @member {boolean} [isStaging] Indicates if the staging slot should be used, - * instead of the Production one. Default value: false . - * @member {string} [region] The target region that the application is - * published to. - */ +*/ export interface ApplicationPublishObject { + /** + * The version ID to publish. + */ versionId?: string; + /** + * Indicates if the staging slot should be used, instead of the Production one. + */ isStaging?: boolean; - region?: string; } /** - * @class - * Initializes a new instance of the PatternAny class. - * @constructor * Pattern.Any Entity Extractor. - * - * @member {string} [name] - * @member {array} [explicitList] - * @member {array} [roles] - */ +*/ export interface PatternAny { name?: string; explicitList?: string[]; @@ -606,15 +584,8 @@ export interface PatternAny { } /** - * @class - * Initializes a new instance of the RegexEntity class. - * @constructor * Regular Expression Entity Extractor. - * - * @member {string} [name] - * @member {string} [regexPattern] - * @member {array} [roles] - */ +*/ export interface RegexEntity { name?: string; regexPattern?: string; @@ -622,622 +593,663 @@ export interface RegexEntity { } /** - * @class - * Initializes a new instance of the PrebuiltEntity class. - * @constructor * Prebuilt Entity Extractor. - * - * @member {string} [name] - * @member {array} [roles] - */ +*/ export interface PrebuiltEntity { name?: string; roles?: string[]; } /** - * @class - * Initializes a new instance of the PatternRule class. - * @constructor * Pattern - * - * @member {string} [pattern] The pattern text. - * @member {string} [intent] The intent's name where the pattern belongs to. - */ +*/ export interface PatternRule { + /** + * The pattern text. + */ pattern?: string; + /** + * The intent's name where the pattern belongs to. + */ intent?: string; } /** - * @class - * Initializes a new instance of the LuisApp class. - * @constructor * Exported Model - An exported LUIS Application. - * - * @member {string} [name] The name of the application. - * @member {string} [versionId] The version ID of the application that was - * exported. - * @member {string} [desc] The description of the application. - * @member {string} [culture] The culture of the application. E.g.: en-us. - * @member {array} [intents] List of intents. - * @member {array} [entities] List of entities. - * @member {array} [closedLists] List of closed lists. - * @member {array} [composites] List of composite entities. - * @member {array} [patternAnyEntities] List of Pattern.Any entities. - * @member {array} [regexEntities] List of regular expression entities. - * @member {array} [prebuiltEntities] List of prebuilt entities. - * @member {array} [regexFeatures] List of pattern features. - * @member {array} [modelFeatures] List of model features. - * @member {array} [patterns] List of patterns. - * @member {array} [utterances] List of sample utterances. - */ +*/ export interface LuisApp { + /** + * The name of the application. + */ name?: string; + /** + * The version ID of the application that was exported. + */ versionId?: string; + /** + * The description of the application. + */ desc?: string; + /** + * The culture of the application. E.g.: en-us. + */ culture?: string; + /** + * List of intents. + */ intents?: HierarchicalModel[]; + /** + * List of entities. + */ entities?: HierarchicalModel[]; + /** + * List of closed lists. + */ closedLists?: ClosedList[]; + /** + * List of composite entities. + */ composites?: HierarchicalModel[]; + /** + * List of Pattern.Any entities. + */ patternAnyEntities?: PatternAny[]; + /** + * List of regular expression entities. + */ regexEntities?: RegexEntity[]; + /** + * List of prebuilt entities. + */ prebuiltEntities?: PrebuiltEntity[]; + /** + * List of pattern features. + */ regexFeatures?: JSONRegexFeature[]; + /** + * List of model features. + */ modelFeatures?: JSONModelFeature[]; + /** + * List of patterns. + */ patterns?: PatternRule[]; + /** + * List of sample utterances. + */ utterances?: JSONUtterance[]; /** - * @property Describes unknown properties. The value of an unknown property - * can be of "any" type. - */ - [property: string]: any; + * Describes unknown properties. The value of an unknown property can be of "any" type. + */ + [additionalPropertyName: string]: any; } /** - * @class - * Initializes a new instance of the EntityLabel class. - * @constructor - * Defines the entity type and position of the extracted entity within the - * example. - * - * @member {string} entityName The entity type. - * @member {number} startTokenIndex The index within the utterance where the - * extracted entity starts. - * @member {number} endTokenIndex The index within the utterance where the - * extracted entity ends. - */ + * Defines the entity type and position of the extracted entity within the example. +*/ export interface EntityLabel { + /** + * The entity type. + */ entityName: string; + /** + * The index within the utterance where the extracted entity starts. + */ startTokenIndex: number; + /** + * The index within the utterance where the extracted entity ends. + */ endTokenIndex: number; } /** - * @class - * Initializes a new instance of the IntentPrediction class. - * @constructor * A suggested intent. - * - * @member {string} [name] The intent's name - * @member {number} [score] The intent's score, based on the prediction model. - */ +*/ export interface IntentPrediction { + /** + * The intent's name + */ name?: string; + /** + * The intent's score, based on the prediction model. + */ score?: number; } /** - * @class - * Initializes a new instance of the EntityPrediction class. - * @constructor * A suggested entity. - * - * @member {string} entityName The entity's name - * @member {number} startTokenIndex The index within the utterance where the - * extracted entity starts. - * @member {number} endTokenIndex The index within the utterance where the - * extracted entity ends. - * @member {string} phrase The actual token(s) that comprise the entity. - */ +*/ export interface EntityPrediction { + /** + * The entity's name + */ entityName: string; + /** + * The index within the utterance where the extracted entity starts. + */ startTokenIndex: number; + /** + * The index within the utterance where the extracted entity ends. + */ endTokenIndex: number; + /** + * The actual token(s) that comprise the entity. + */ phrase: string; } /** - * @class - * Initializes a new instance of the LabeledUtterance class. - * @constructor * A prediction and label pair of an example. - * - * @member {number} [id] ID of Labeled Utterance. - * @member {string} [text] The utterance. E.g.: what's the weather like in - * seattle? - * @member {array} [tokenizedText] The utterance tokenized. - * @member {string} [intentLabel] The intent matching the example. - * @member {array} [entityLabels] The entities matching the example. - * @member {array} [intentPredictions] List of suggested intents. - * @member {array} [entityPredictions] List of suggested entities. - */ +*/ export interface LabeledUtterance { + /** + * ID of Labeled Utterance. + */ id?: number; + /** + * The utterance. E.g.: what's the weather like in seattle? + */ text?: string; + /** + * The utterance tokenized. + */ tokenizedText?: string[]; + /** + * The intent matching the example. + */ intentLabel?: string; + /** + * The entities matching the example. + */ entityLabels?: EntityLabel[]; + /** + * List of suggested intents. + */ intentPredictions?: IntentPrediction[]; + /** + * List of suggested entities. + */ entityPredictions?: EntityPrediction[]; } /** - * @class - * Initializes a new instance of the IntentsSuggestionExample class. - * @constructor * Predicted/suggested intent. - * - * @member {string} [text] The utterance. E.g.: what's the weather like in - * seattle? - * @member {array} [tokenizedText] The utterance tokenized. - * @member {array} [intentPredictions] Predicted/suggested intents. - * @member {array} [entityPredictions] Predicted/suggested entities. - */ +*/ export interface IntentsSuggestionExample { + /** + * The utterance. E.g.: what's the weather like in seattle? + */ text?: string; + /** + * The utterance tokenized. + */ tokenizedText?: string[]; + /** + * Predicted/suggested intents. + */ intentPredictions?: IntentPrediction[]; + /** + * Predicted/suggested entities. + */ entityPredictions?: EntityPrediction[]; } /** - * @class - * Initializes a new instance of the EntitiesSuggestionExample class. - * @constructor * Predicted/suggested entity. - * - * @member {string} [text] The utterance. E.g.: what's the weather like in - * seattle? - * @member {array} [tokenizedText] The utterance tokenized. - * @member {array} [intentPredictions] Predicted/suggested intents. - * @member {array} [entityPredictions] Predicted/suggested entities. - */ +*/ export interface EntitiesSuggestionExample { + /** + * The utterance. E.g.: what's the weather like in seattle? + */ text?: string; + /** + * The utterance tokenized. + */ tokenizedText?: string[]; + /** + * Predicted/suggested intents. + */ intentPredictions?: IntentPrediction[]; + /** + * Predicted/suggested entities. + */ entityPredictions?: EntityPrediction[]; } /** - * @class - * Initializes a new instance of the PersonalAssistantsResponse class. - * @constructor - * Response containing user's endpoint keys and the endpoint URLs of the - * prebuilt Cortana applications. - * - * @member {array} [endpointKeys] - * @member {object} [endpointUrls] - */ + * Response containing user's endpoint keys and the endpoint URLs of the prebuilt Cortana + * applications. +*/ export interface PersonalAssistantsResponse { endpointKeys?: string[]; endpointUrls?: { [propertyName: string]: string }; } /** - * @class - * Initializes a new instance of the ModelInfo class. - * @constructor * Base type used in entity types. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - */ +*/ export interface ModelInfo { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; } /** - * @class - * Initializes a new instance of the EntityRole class. - * @constructor * Entity extractor role - * - * @member {uuid} [id] The entity role ID. - * @member {string} [name] The entity role name. - */ +*/ export interface EntityRole { + /** + * The entity role ID. + */ id?: string; + /** + * The entity role name. + */ name?: string; } /** - * @class - * Initializes a new instance of the ChildEntity class. - * @constructor * The base child entity type. - * - * @member {uuid} id The ID (GUID) belonging to a child entity. - * @member {string} [name] The name of a child entity. - */ +*/ export interface ChildEntity { + /** + * The ID (GUID) belonging to a child entity. + */ id: string; + /** + * The name of a child entity. + */ name?: string; } /** - * @class - * Initializes a new instance of the ExplicitListItem class. - * @constructor * Explicit list item - * - * @member {number} [id] The explicit list item ID. - * @member {string} [explicitListItem] The explicit list item value. - */ +*/ export interface ExplicitListItem { + /** + * The explicit list item ID. + */ id?: number; + /** + * The explicit list item value. + */ explicitListItem?: string; } /** - * @class - * Initializes a new instance of the ModelInfoResponse class. - * @constructor * An application model info. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [children] List of child entities. - * @member {array} [subLists] List of sub-lists. - * @member {string} [customPrebuiltDomainName] The domain name. - * @member {string} [customPrebuiltModelName] The intent name or entity name. - * @member {string} [regexPattern] The Regex entity pattern. - * @member {array} [explicitList] - */ +*/ export interface ModelInfoResponse { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; roles?: EntityRole[]; + /** + * List of child entities. + */ children?: ChildEntity[]; + /** + * List of sub-lists. + */ subLists?: SubClosedListResponse[]; + /** + * The domain name. + */ customPrebuiltDomainName?: string; + /** + * The intent name or entity name. + */ customPrebuiltModelName?: string; + /** + * The Regex entity pattern. + */ regexPattern?: string; explicitList?: ExplicitListItem[]; } /** - * @class - * Initializes a new instance of the EntityModelInfo class. - * @constructor * An Entity Extractor model info. - * - * @member {array} [roles] - */ +*/ export interface EntityModelInfo extends ModelInfo { roles?: EntityRole[]; } /** - * @class - * Initializes a new instance of the HierarchicalEntityExtractor class. - * @constructor * Hierarchical Entity Extractor. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [children] List of child entities. - */ +*/ export interface HierarchicalEntityExtractor { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; roles?: EntityRole[]; + /** + * List of child entities. + */ children?: ChildEntity[]; } /** - * @class - * Initializes a new instance of the CompositeEntityExtractor class. - * @constructor * A Composite Entity Extractor. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [children] List of child entities. - */ +*/ export interface CompositeEntityExtractor { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; roles?: EntityRole[]; + /** + * List of child entities. + */ children?: ChildEntity[]; } /** - * @class - * Initializes a new instance of the ClosedListEntityExtractor class. - * @constructor * Closed List Entity Extractor. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [subLists] List of sub-lists. - */ +*/ export interface ClosedListEntityExtractor { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; roles?: EntityRole[]; + /** + * List of sub-lists. + */ subLists?: SubClosedListResponse[]; } /** - * @class - * Initializes a new instance of the PrebuiltEntityExtractor class. - * @constructor * Prebuilt Entity Extractor. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - */ +*/ export interface PrebuiltEntityExtractor { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; roles?: EntityRole[]; } /** - * @class - * Initializes a new instance of the HierarchicalChildEntity class. - * @constructor * A Hierarchical Child Entity. - * - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} [readableType] Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - */ +*/ export interface HierarchicalChildEntity extends ChildEntity { + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType?: string; } /** - * @class - * Initializes a new instance of the CustomPrebuiltModel class. - * @constructor * A Custom Prebuilt model. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {string} [customPrebuiltDomainName] The domain name. - * @member {string} [customPrebuiltModelName] The intent name or entity name. - * @member {array} [roles] - */ +*/ export interface CustomPrebuiltModel { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; + /** + * The domain name. + */ customPrebuiltDomainName?: string; + /** + * The intent name or entity name. + */ customPrebuiltModelName?: string; roles?: EntityRole[]; } /** - * @class - * Initializes a new instance of the IntentClassifier class. - * @constructor * Intent Classifier. - * - * @member {string} [customPrebuiltDomainName] The domain name. - * @member {string} [customPrebuiltModelName] The intent name or entity name. - */ +*/ export interface IntentClassifier extends ModelInfo { + /** + * The domain name. + */ customPrebuiltDomainName?: string; + /** + * The intent name or entity name. + */ customPrebuiltModelName?: string; } /** - * @class - * Initializes a new instance of the EntityExtractor class. - * @constructor * Entity Extractor. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {string} [customPrebuiltDomainName] The domain name. - * @member {string} [customPrebuiltModelName] The intent name or entity name. - */ +*/ export interface EntityExtractor { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; roles?: EntityRole[]; + /** + * The domain name. + */ customPrebuiltDomainName?: string; + /** + * The intent name or entity name. + */ customPrebuiltModelName?: string; } /** - * @class - * Initializes a new instance of the FeatureInfoObject class. - * @constructor * The base class Features-related response objects inherit from. - * - * @member {number} [id] A six-digit ID used for Features. - * @member {string} [name] The name of the Feature. - * @member {boolean} [isActive] Indicates if the feature is enabled. - */ +*/ export interface FeatureInfoObject { + /** + * A six-digit ID used for Features. + */ id?: number; + /** + * The name of the Feature. + */ name?: string; + /** + * Indicates if the feature is enabled. + */ isActive?: boolean; } /** - * @class - * Initializes a new instance of the PhraseListFeatureInfo class. - * @constructor * Phraselist Feature. - * - * @member {string} [phrases] A list of comma-separated values. - * @member {boolean} [isExchangeable] An exchangeable phrase list feature are - * serves as single feature to the LUIS underlying training algorithm. It is - * used as a lexicon lookup feature where its value is 1 if the lexicon - * contains a given word or 0 if it doesn’t. Think of an exchangeable as a - * synonyms list. A non-exchangeable phrase list feature has all the phrases in - * the list serve as separate features to the underlying training algorithm. - * So, if you your phrase list feature contains 5 phrases, they will be mapped - * to 5 separate features. You can think of the non-exchangeable phrase list - * feature as an additional bag of words that you are willing to add to LUIS - * existing vocabulary features. Think of a non-exchangeable as set of - * different words. Default value is true. - */ +*/ export interface PhraseListFeatureInfo extends FeatureInfoObject { + /** + * A list of comma-separated values. + */ phrases?: string; + /** + * An exchangeable phrase list feature are serves as single feature to the LUIS underlying + * training algorithm. It is used as a lexicon lookup feature where its value is 1 if the lexicon + * contains a given word or 0 if it doesn’t. Think of an exchangeable as a synonyms list. A + * non-exchangeable phrase list feature has all the phrases in the list serve as separate + * features to the underlying training algorithm. So, if you your phrase list feature contains 5 + * phrases, they will be mapped to 5 separate features. You can think of the non-exchangeable + * phrase list feature as an additional bag of words that you are willing to add to LUIS existing + * vocabulary features. Think of a non-exchangeable as set of different words. Default value is + * true. + */ isExchangeable?: boolean; } /** - * @class - * Initializes a new instance of the PatternFeatureInfo class. - * @constructor * Pattern feature. - * - * @member {string} [pattern] The Regular Expression to match. - */ +*/ export interface PatternFeatureInfo extends FeatureInfoObject { + /** + * The Regular Expression to match. + */ pattern?: string; } /** - * @class - * Initializes a new instance of the FeaturesResponseObject class. - * @constructor * Model Features, including Patterns and Phraselists. - * - * @member {array} [phraselistFeatures] - * @member {array} [patternFeatures] - */ +*/ export interface FeaturesResponseObject { phraselistFeatures?: PhraseListFeatureInfo[]; patternFeatures?: PatternFeatureInfo[]; } /** - * @class - * Initializes a new instance of the LabelExampleResponse class. - * @constructor * Response when adding a labeled example. - * - * @member {string} [utteranceText] The sample's utterance. - * @member {number} [exampleId] The newly created sample ID. - */ +*/ export interface LabelExampleResponse { + /** + * The sample's utterance. + */ utteranceText?: string; + /** + * The newly created sample ID. + */ exampleId?: number; } /** - * @class - * Initializes a new instance of the OperationStatus class. - * @constructor * Response of an Operation status. - * - * @member {string} [code] Status Code. Possible values include: 'Failed', - * 'FAILED', 'Success' - * @member {string} [message] Status details. - */ +*/ export interface OperationStatus { + /** + * Status Code. Possible values include: 'Failed', 'FAILED', 'Success' + */ code?: string; + /** + * Status details. + */ message?: string; } /** - * @class - * Initializes a new instance of the BatchLabelExample class. - * @constructor * Response when adding a batch of labeled examples. - * - * @member {object} [value] - * @member {string} [value.utteranceText] The sample's utterance. - * @member {number} [value.exampleId] The newly created sample ID. - * @member {boolean} [hasError] - * @member {object} [error] - * @member {string} [error.code] Status Code. Possible values include: - * 'Failed', 'FAILED', 'Success' - * @member {string} [error.message] Status details. - */ +*/ export interface BatchLabelExample { value?: LabelExampleResponse; hasError?: boolean; @@ -1245,273 +1257,261 @@ export interface BatchLabelExample { } /** - * @class - * Initializes a new instance of the ApplicationInfoResponse class. - * @constructor * Response containing the Application Info. - * - * @member {uuid} [id] The ID (GUID) of the application. - * @member {string} [name] The name of the application. - * @member {string} [description] The description of the application. - * @member {string} [culture] The culture of the application. E.g.: en-us. - * @member {string} [usageScenario] Defines the scenario for the new - * application. Optional. E.g.: IoT. - * @member {string} [domain] The domain for the new application. Optional. - * E.g.: Comics. - * @member {number} [versionsCount] Amount of model versions within the - * application. - * @member {string} [createdDateTime] The version's creation timestamp. - * @member {object} [endpoints] The Runtime endpoint URL for this model - * version. - * @member {number} [endpointHitsCount] Number of calls made to this endpoint. - * @member {string} [activeVersion] The version ID currently marked as active. - */ +*/ export interface ApplicationInfoResponse { + /** + * The ID (GUID) of the application. + */ id?: string; + /** + * The name of the application. + */ name?: string; + /** + * The description of the application. + */ description?: string; + /** + * The culture of the application. E.g.: en-us. + */ culture?: string; + /** + * Defines the scenario for the new application. Optional. E.g.: IoT. + */ usageScenario?: string; + /** + * The domain for the new application. Optional. E.g.: Comics. + */ domain?: string; + /** + * Amount of model versions within the application. + */ versionsCount?: number; + /** + * The version's creation timestamp. + */ createdDateTime?: string; + /** + * The Runtime endpoint URL for this model version. + */ endpoints?: any; + /** + * Number of calls made to this endpoint. + */ endpointHitsCount?: number; + /** + * The version ID currently marked as active. + */ activeVersion?: string; } /** - * @class - * Initializes a new instance of the EndpointInfo class. - * @constructor * The base class "ProductionOrStagingEndpointInfo" inherits from. - * - * @member {string} [versionId] The version ID to publish. - * @member {boolean} [isStaging] Indicates if the staging slot should be used, - * instead of the Production one. - * @member {string} [endpointUrl] The Runtime endpoint URL for this model - * version. - * @member {string} [region] The target region that the application is - * published to. - * @member {string} [assignedEndpointKey] The endpoint key. - * @member {string} [endpointRegion] The endpoint's region. - * @member {string} [publishedDateTime] Timestamp when was last published. - */ +*/ export interface EndpointInfo { + /** + * The version ID to publish. + */ versionId?: string; + /** + * Indicates if the staging slot should be used, instead of the Production one. + */ isStaging?: boolean; + /** + * The Runtime endpoint URL for this model version. + */ endpointUrl?: string; + /** + * The target region that the application is published to. + */ region?: string; + /** + * The endpoint key. + */ assignedEndpointKey?: string; + /** + * The endpoint's region. + */ endpointRegion?: string; + /** + * Regions where publishing failed. + */ + failedRegions?: string; + /** + * Timestamp when was last published. + */ publishedDateTime?: string; } -/** - * @class - * Initializes a new instance of the ProductionOrStagingEndpointInfo class. - * @constructor - */ export interface ProductionOrStagingEndpointInfo extends EndpointInfo { } /** - * @class - * Initializes a new instance of the AvailableCulture class. - * @constructor * Available culture for using in a new application. - * - * @member {string} [name] The language name. - * @member {string} [code] The ISO value for the language. - */ +*/ export interface AvailableCulture { + /** + * The language name. + */ name?: string; + /** + * The ISO value for the language. + */ code?: string; } /** - * @class - * Initializes a new instance of the ApplicationSettings class. - * @constructor * The application settings. - * - * @member {uuid} id The application ID. - * @member {boolean} isPublic Setting your application as public allows other - * people to use your application's endpoint using their own keys. - */ +*/ export interface ApplicationSettings { + /** + * The application ID. + */ id: string; + /** + * Setting your application as public allows other people to use your application's endpoint + * using their own keys. + */ isPublic: boolean; } /** - * @class - * Initializes a new instance of the PublishSettings class. - * @constructor * The application publish settings. - * - * @member {uuid} id The application ID. - * @member {boolean} isSentimentAnalysisEnabled Setting sentiment analysis as - * true returns the Sentiment of the input utterance along with the resopnse - * @member {boolean} isSpeechEnabled Setting speech as public enables speech - * priming in your app - * @member {boolean} isSpellCheckerEnabled Setting spell checker as public - * enables spell checking the input utterance. - */ +*/ export interface PublishSettings { + /** + * The application ID. + */ id: string; + /** + * Setting sentiment analysis as true returns the Sentiment of the input utterance along with the + * response + */ isSentimentAnalysisEnabled: boolean; + /** + * Setting speech as public enables speech priming in your app + */ isSpeechEnabled: boolean; + /** + * Setting spell checker as public enables spell checking the input utterance. + */ isSpellCheckerEnabled: boolean; } /** - * @class - * Initializes a new instance of the AvailablePrebuiltEntityModel class. - * @constructor * Available Prebuilt entity model for using in an application. - * - * @member {string} [name] The entity name. - * @member {string} [description] The entity description and usage information. - * @member {string} [examples] Usage examples. - */ +*/ export interface AvailablePrebuiltEntityModel { + /** + * The entity name. + */ name?: string; + /** + * The entity description and usage information. + */ description?: string; + /** + * Usage examples. + */ examples?: string; } /** - * @class - * Initializes a new instance of the EnqueueTrainingResponse class. - * @constructor * Response model when requesting to train the model. - * - * @member {number} [statusId] The train request status ID. - * @member {string} [status] Possible values include: 'Queued', 'InProgress', - * 'UpToDate', 'Fail', 'Success' - */ +*/ export interface EnqueueTrainingResponse { + /** + * The train request status ID. + */ statusId?: number; + /** + * Possible values include: 'Queued', 'InProgress', 'UpToDate', 'Fail', 'Success' + */ status?: string; } /** - * @class - * Initializes a new instance of the ModelTrainingDetails class. - * @constructor * Model Training Details. - * - * @member {number} [statusId] The train request status ID. - * @member {string} [status] Possible values include: 'Queued', 'InProgress', - * 'UpToDate', 'Fail', 'Success' - * @member {number} [exampleCount] The count of examples used to train the - * model. - * @member {date} [trainingDateTime] When the model was trained. - * @member {string} [failureReason] Reason for the training failure. - */ +*/ export interface ModelTrainingDetails { + /** + * The train request status ID. + */ statusId?: number; + /** + * Possible values include: 'Queued', 'InProgress', 'UpToDate', 'Fail', 'Success' + */ status?: string; + /** + * The count of examples used to train the model. + */ exampleCount?: number; + /** + * When the model was trained. + */ trainingDateTime?: Date; + /** + * Reason for the training failure. + */ failureReason?: string; } /** - * @class - * Initializes a new instance of the ModelTrainingInfo class. - * @constructor * Model Training Info. - * - * @member {uuid} [modelId] The ID (GUID) of the model. - * @member {object} [details] - * @member {number} [details.statusId] The train request status ID. - * @member {string} [details.status] Possible values include: 'Queued', - * 'InProgress', 'UpToDate', 'Fail', 'Success' - * @member {number} [details.exampleCount] The count of examples used to train - * the model. - * @member {date} [details.trainingDateTime] When the model was trained. - * @member {string} [details.failureReason] Reason for the training failure. - */ +*/ export interface ModelTrainingInfo { + /** + * The ID (GUID) of the model. + */ modelId?: string; details?: ModelTrainingDetails; } /** - * @class - * Initializes a new instance of the UserAccessList class. - * @constructor * List of user permissions. - * - * @member {string} [owner] The email address of owner of the application. - * @member {array} [emails] - */ +*/ export interface UserAccessList { + /** + * The email address of owner of the application. + */ owner?: string; emails?: string[]; } -/** - * @class - * Initializes a new instance of the UserCollaborator class. - * @constructor - * @member {string} [email] The email address of the user. - */ export interface UserCollaborator { + /** + * The email address of the user. + */ email?: string; } -/** - * @class - * Initializes a new instance of the CollaboratorsArray class. - * @constructor - * @member {array} [emails] The email address of the users. - */ export interface CollaboratorsArray { + /** + * The email address of the users. + */ emails?: string[]; } /** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor * Error response when invoking an operation on the API. - * - * @member {string} [errorType] - */ +*/ export interface ErrorResponse { errorType?: string; /** - * @property Describes unknown properties. The value of an unknown property - * can be of "any" type. - */ - [property: string]: any; + * Describes unknown properties. The value of an unknown property can be of "any" type. + */ + [additionalPropertyName: string]: any; } /** - * @class - * Initializes a new instance of the OperationError class. - * @constructor * Operation error details when invoking an operation on the API. - * - * @member {string} [code] - * @member {string} [message] - */ +*/ export interface OperationError { code?: string; message?: string; } -/** - * @class - * Initializes a new instance of the PrebuiltDomainItem class. - * @constructor - * @member {string} [name] - * @member {string} [description] - * @member {string} [examples] - */ export interface PrebuiltDomainItem { name?: string; description?: string; @@ -1519,18 +1519,8 @@ export interface PrebuiltDomainItem { } /** - * @class - * Initializes a new instance of the PrebuiltDomain class. - * @constructor * Prebuilt Domain. - * - * @member {string} [name] - * @member {string} [culture] - * @member {string} [description] - * @member {string} [examples] - * @member {array} [intents] - * @member {array} [entities] - */ +*/ export interface PrebuiltDomain { name?: string; culture?: string; @@ -1541,247 +1531,262 @@ export interface PrebuiltDomain { } /** - * @class - * Initializes a new instance of the EntityRoleCreateObject class. - * @constructor * Object model for creating an entity role. - * - * @member {string} [name] The entity role name. - */ +*/ export interface EntityRoleCreateObject { + /** + * The entity role name. + */ name?: string; } /** - * @class - * Initializes a new instance of the RegexModelCreateObject class. - * @constructor * Model object for creating a regex entity model. - * - * @member {string} [regexPattern] The regex entity pattern. - * @member {string} [name] The model name. - */ +*/ export interface RegexModelCreateObject { + /** + * The regex entity pattern. + */ regexPattern?: string; + /** + * The model name. + */ name?: string; } /** - * @class - * Initializes a new instance of the PatternAnyModelCreateObject class. - * @constructor * Model object for creating a Pattern.Any entity model. - * - * @member {string} [name] The model name. - * @member {array} [explicitList] The Pattern.Any explicit list. - */ +*/ export interface PatternAnyModelCreateObject { + /** + * The model name. + */ name?: string; + /** + * The Pattern.Any explicit list. + */ explicitList?: string[]; } /** - * @class - * Initializes a new instance of the ExplicitListItemCreateObject class. - * @constructor * Object model for creating an explicit list item. - * - * @member {string} [explicitListItem] The explicit list item. - */ +*/ export interface ExplicitListItemCreateObject { + /** + * The explicit list item. + */ explicitListItem?: string; } /** - * @class - * Initializes a new instance of the RegexModelUpdateObject class. - * @constructor * Model object for updating a regex entity model. - * - * @member {string} [regexPattern] The regex entity pattern. - * @member {string} [name] The model name. - */ +*/ export interface RegexModelUpdateObject { + /** + * The regex entity pattern. + */ regexPattern?: string; + /** + * The model name. + */ name?: string; } /** - * @class - * Initializes a new instance of the PatternAnyModelUpdateObject class. - * @constructor * Model object for updating a Pattern.Any entity model. - * - * @member {string} [name] The model name. - * @member {array} [explicitList] The Pattern.Any explicit list. - */ +*/ export interface PatternAnyModelUpdateObject { + /** + * The model name. + */ name?: string; + /** + * The Pattern.Any explicit list. + */ explicitList?: string[]; } /** - * @class - * Initializes a new instance of the EntityRoleUpdateObject class. - * @constructor * Object model for updating an entity role. - * - * @member {string} [name] The entity role name. - */ +*/ export interface EntityRoleUpdateObject { + /** + * The entity role name. + */ name?: string; } /** - * @class - * Initializes a new instance of the ExplicitListItemUpdateObject class. - * @constructor * Model object for updating an explicit list item. - * - * @member {string} [explicitListItem] The explicit list item. - */ +*/ export interface ExplicitListItemUpdateObject { + /** + * The explicit list item. + */ explicitListItem?: string; } /** - * @class - * Initializes a new instance of the PatternRuleCreateObject class. - * @constructor * Object model for creating a pattern - * - * @member {string} [pattern] The pattern text. - * @member {string} [intent] The intent's name which the pattern belongs to. - */ +*/ export interface PatternRuleCreateObject { + /** + * The pattern text. + */ pattern?: string; + /** + * The intent's name which the pattern belongs to. + */ intent?: string; } /** - * @class - * Initializes a new instance of the PatternRuleUpdateObject class. - * @constructor * Object model for updating a pattern. - * - * @member {uuid} [id] The pattern ID. - * @member {string} [pattern] The pattern text. - * @member {string} [intent] The intent's name which the pattern belongs to. - */ +*/ export interface PatternRuleUpdateObject { + /** + * The pattern ID. + */ id?: string; + /** + * The pattern text. + */ pattern?: string; + /** + * The intent's name which the pattern belongs to. + */ intent?: string; } /** - * @class - * Initializes a new instance of the RegexEntityExtractor class. - * @constructor * Regex Entity Extractor. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {string} [regexPattern] The Regex entity pattern. - */ +*/ export interface RegexEntityExtractor { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; roles?: EntityRole[]; + /** + * The Regex entity pattern. + */ regexPattern?: string; } /** - * @class - * Initializes a new instance of the PatternAnyEntityExtractor class. - * @constructor * Pattern.Any Entity Extractor. - * - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [explicitList] - */ +*/ export interface PatternAnyEntityExtractor { + /** + * The ID of the Entity Model. + */ id: string; + /** + * Name of the Entity Model. + */ name?: string; + /** + * The type ID of the Entity Model. + */ typeId?: number; + /** + * Possible values include: 'Entity Extractor', 'Hierarchical Entity Extractor', 'Hierarchical + * Child Entity Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', 'Regex + * Entity Extractor' + */ readableType: string; roles?: EntityRole[]; explicitList?: ExplicitListItem[]; } /** - * @class - * Initializes a new instance of the PatternRuleInfo class. - * @constructor * Pattern rule - * - * @member {uuid} [id] The pattern ID. - * @member {string} [pattern] The pattern text. - * @member {string} [intent] The intent's name where the pattern belongs to. - */ +*/ export interface PatternRuleInfo { + /** + * The pattern ID. + */ id?: string; + /** + * The pattern text. + */ pattern?: string; + /** + * The intent's name where the pattern belongs to. + */ intent?: string; } /** - * @class - * Initializes a new instance of the LabelTextObject class. - * @constructor * An object containing the example's text. - * - * @member {number} [id] The ID of the Label. - * @member {string} [text] The text of the label. - */ +*/ export interface LabelTextObject { + /** + * The ID of the Label. + */ id?: number; + /** + * The text of the label. + */ text?: string; } /** - * @class - * Initializes a new instance of the HierarchicalChildModelUpdateObject class. - * @constructor - * @member {string} [name] - */ -export interface HierarchicalChildModelUpdateObject { + * Object model of an application version setting. +*/ +export interface AppVersionSettingObject { + /** + * The application version setting name. + */ name?: string; + /** + * The application version setting value. + */ + value?: string; } /** - * @class - * Initializes a new instance of the HierarchicalChildModelCreateObject class. - * @constructor - * @member {string} [name] - */ + * Defines the azure account information object. +*/ +export interface AzureAccountInfoObject { + /** + * The id for the azure subscription. + */ + azureSubscriptionId: string; + /** + * The azure resource group name. + */ + resourceGroup: string; + /** + * The azure account name. + */ + accountName: string; +} + +export interface HierarchicalChildModelUpdateObject { + name?: string; +} + export interface HierarchicalChildModelCreateObject { name?: string; } -/** - * @class - * Initializes a new instance of the CompositeChildModelCreateObject class. - * @constructor - * @member {string} [name] - */ export interface CompositeChildModelCreateObject { name?: string; } diff --git a/lib/services/luis/authoring/lib/models/index.js b/lib/services/luis/authoring/lib/models/index.js index ea15399868..0054ec81d6 100644 --- a/lib/services/luis/authoring/lib/models/index.js +++ b/lib/services/luis/authoring/lib/models/index.js @@ -112,6 +112,8 @@ exports.RegexEntityExtractor = require('./regexEntityExtractor'); exports.PatternAnyEntityExtractor = require('./patternAnyEntityExtractor'); exports.PatternRuleInfo = require('./patternRuleInfo'); exports.LabelTextObject = require('./labelTextObject'); +exports.AppVersionSettingObject = require('./appVersionSettingObject'); +exports.AzureAccountInfoObject = require('./azureAccountInfoObject'); exports.HierarchicalChildModelUpdateObject = require('./hierarchicalChildModelUpdateObject'); exports.HierarchicalChildModelCreateObject = require('./hierarchicalChildModelCreateObject'); exports.CompositeChildModelCreateObject = require('./compositeChildModelCreateObject'); diff --git a/lib/services/luis/authoring/lib/models/intentClassifier.js b/lib/services/luis/authoring/lib/models/intentClassifier.js index 2e80d54c27..6c7b2363ed 100644 --- a/lib/services/luis/authoring/lib/models/intentClassifier.js +++ b/lib/services/luis/authoring/lib/models/intentClassifier.js @@ -20,8 +20,9 @@ const models = require('./index'); class IntentClassifier extends models['ModelInfo'] { /** * Create a IntentClassifier. - * @member {string} [customPrebuiltDomainName] The domain name. - * @member {string} [customPrebuiltModelName] The intent name or entity name. + * @property {string} [customPrebuiltDomainName] The domain name. + * @property {string} [customPrebuiltModelName] The intent name or entity + * name. */ constructor() { super(); diff --git a/lib/services/luis/authoring/lib/models/intentPrediction.js b/lib/services/luis/authoring/lib/models/intentPrediction.js index f78c55b92c..b61e2ea0b9 100644 --- a/lib/services/luis/authoring/lib/models/intentPrediction.js +++ b/lib/services/luis/authoring/lib/models/intentPrediction.js @@ -17,8 +17,8 @@ class IntentPrediction { /** * Create a IntentPrediction. - * @member {string} [name] The intent's name - * @member {number} [score] The intent's score, based on the prediction + * @property {string} [name] The intent's name + * @property {number} [score] The intent's score, based on the prediction * model. */ constructor() { diff --git a/lib/services/luis/authoring/lib/models/intentsSuggestionExample.js b/lib/services/luis/authoring/lib/models/intentsSuggestionExample.js index f3e9680d86..f656540e27 100644 --- a/lib/services/luis/authoring/lib/models/intentsSuggestionExample.js +++ b/lib/services/luis/authoring/lib/models/intentsSuggestionExample.js @@ -17,11 +17,11 @@ class IntentsSuggestionExample { /** * Create a IntentsSuggestionExample. - * @member {string} [text] The utterance. E.g.: what's the weather like in + * @property {string} [text] The utterance. E.g.: what's the weather like in * seattle? - * @member {array} [tokenizedText] The utterance tokenized. - * @member {array} [intentPredictions] Predicted/suggested intents. - * @member {array} [entityPredictions] Predicted/suggested entities. + * @property {array} [tokenizedText] The utterance tokenized. + * @property {array} [intentPredictions] Predicted/suggested intents. + * @property {array} [entityPredictions] Predicted/suggested entities. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/jSONEntity.js b/lib/services/luis/authoring/lib/models/jSONEntity.js index 58685602f1..5ddede4377 100644 --- a/lib/services/luis/authoring/lib/models/jSONEntity.js +++ b/lib/services/luis/authoring/lib/models/jSONEntity.js @@ -17,11 +17,11 @@ class JSONEntity { /** * Create a JSONEntity. - * @member {number} startPos The index within the utterance where the + * @property {number} startPos The index within the utterance where the * extracted entity starts. - * @member {number} endPos The index within the utterance where the extracted - * entity ends. - * @member {string} entity The entity name. + * @property {number} endPos The index within the utterance where the + * extracted entity ends. + * @property {string} entity The entity name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/jSONModelFeature.js b/lib/services/luis/authoring/lib/models/jSONModelFeature.js index 6d239a7977..c31e65aecd 100644 --- a/lib/services/luis/authoring/lib/models/jSONModelFeature.js +++ b/lib/services/luis/authoring/lib/models/jSONModelFeature.js @@ -17,13 +17,13 @@ class JSONModelFeature { /** * Create a JSONModelFeature. - * @member {boolean} [activated] Indicates if the feature is enabled. - * @member {string} [name] The Phraselist name. - * @member {string} [words] List of comma-separated phrases that represent + * @property {boolean} [activated] Indicates if the feature is enabled. + * @property {string} [name] The Phraselist name. + * @property {string} [words] List of comma-separated phrases that represent * the Phraselist. - * @member {boolean} [mode] An exchangeable phrase list feature are serves as - * single feature to the LUIS underlying training algorithm. It is used as a - * lexicon lookup feature where its value is 1 if the lexicon contains a + * @property {boolean} [mode] An exchangeable phrase list feature are serves + * as single feature to the LUIS underlying training algorithm. It is used as + * a lexicon lookup feature where its value is 1 if the lexicon contains a * given word or 0 if it doesn’t. Think of an exchangeable as a synonyms * list. A non-exchangeable phrase list feature has all the phrases in the * list serve as separate features to the underlying training algorithm. So, diff --git a/lib/services/luis/authoring/lib/models/jSONRegexFeature.js b/lib/services/luis/authoring/lib/models/jSONRegexFeature.js index abe470edbd..f067aa2a8f 100644 --- a/lib/services/luis/authoring/lib/models/jSONRegexFeature.js +++ b/lib/services/luis/authoring/lib/models/jSONRegexFeature.js @@ -17,9 +17,10 @@ class JSONRegexFeature { /** * Create a JSONRegexFeature. - * @member {string} [pattern] The Regular Expression to match. - * @member {boolean} [activated] Indicates if the Pattern feature is enabled. - * @member {string} [name] Name of the feature. + * @property {string} [pattern] The Regular Expression to match. + * @property {boolean} [activated] Indicates if the Pattern feature is + * enabled. + * @property {string} [name] Name of the feature. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/jSONUtterance.js b/lib/services/luis/authoring/lib/models/jSONUtterance.js index e9cbc3c64f..bad61af840 100644 --- a/lib/services/luis/authoring/lib/models/jSONUtterance.js +++ b/lib/services/luis/authoring/lib/models/jSONUtterance.js @@ -17,9 +17,9 @@ class JSONUtterance { /** * Create a JSONUtterance. - * @member {string} [text] The utterance. - * @member {string} [intent] The matched intent. - * @member {array} [entities] The matched entities. + * @property {string} [text] The utterance. + * @property {string} [intent] The matched intent. + * @property {array} [entities] The matched entities. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/labelExampleResponse.js b/lib/services/luis/authoring/lib/models/labelExampleResponse.js index bdb0ef81ef..794ba14459 100644 --- a/lib/services/luis/authoring/lib/models/labelExampleResponse.js +++ b/lib/services/luis/authoring/lib/models/labelExampleResponse.js @@ -17,8 +17,8 @@ class LabelExampleResponse { /** * Create a LabelExampleResponse. - * @member {string} [utteranceText] The sample's utterance. - * @member {number} [exampleId] The newly created sample ID. + * @property {string} [utteranceText] The sample's utterance. + * @property {number} [exampleId] The newly created sample ID. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/labelTextObject.js b/lib/services/luis/authoring/lib/models/labelTextObject.js index 2aa5876cf5..ae26343945 100644 --- a/lib/services/luis/authoring/lib/models/labelTextObject.js +++ b/lib/services/luis/authoring/lib/models/labelTextObject.js @@ -17,8 +17,8 @@ class LabelTextObject { /** * Create a LabelTextObject. - * @member {number} [id] The ID of the Label. - * @member {string} [text] The text of the label. + * @property {number} [id] The ID of the Label. + * @property {string} [text] The text of the label. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/labeledUtterance.js b/lib/services/luis/authoring/lib/models/labeledUtterance.js index ecee78611a..e1c2b8ef7c 100644 --- a/lib/services/luis/authoring/lib/models/labeledUtterance.js +++ b/lib/services/luis/authoring/lib/models/labeledUtterance.js @@ -17,14 +17,14 @@ class LabeledUtterance { /** * Create a LabeledUtterance. - * @member {number} [id] ID of Labeled Utterance. - * @member {string} [text] The utterance. E.g.: what's the weather like in + * @property {number} [id] ID of Labeled Utterance. + * @property {string} [text] The utterance. E.g.: what's the weather like in * seattle? - * @member {array} [tokenizedText] The utterance tokenized. - * @member {string} [intentLabel] The intent matching the example. - * @member {array} [entityLabels] The entities matching the example. - * @member {array} [intentPredictions] List of suggested intents. - * @member {array} [entityPredictions] List of suggested entities. + * @property {array} [tokenizedText] The utterance tokenized. + * @property {string} [intentLabel] The intent matching the example. + * @property {array} [entityLabels] The entities matching the example. + * @property {array} [intentPredictions] List of suggested intents. + * @property {array} [entityPredictions] List of suggested entities. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/luisApp.js b/lib/services/luis/authoring/lib/models/luisApp.js index 1491b7a1cd..516a7e6823 100644 --- a/lib/services/luis/authoring/lib/models/luisApp.js +++ b/lib/services/luis/authoring/lib/models/luisApp.js @@ -17,22 +17,22 @@ class LuisApp { /** * Create a LuisApp. - * @member {string} [name] The name of the application. - * @member {string} [versionId] The version ID of the application that was + * @property {string} [name] The name of the application. + * @property {string} [versionId] The version ID of the application that was * exported. - * @member {string} [desc] The description of the application. - * @member {string} [culture] The culture of the application. E.g.: en-us. - * @member {array} [intents] List of intents. - * @member {array} [entities] List of entities. - * @member {array} [closedLists] List of closed lists. - * @member {array} [composites] List of composite entities. - * @member {array} [patternAnyEntities] List of Pattern.Any entities. - * @member {array} [regexEntities] List of regular expression entities. - * @member {array} [prebuiltEntities] List of prebuilt entities. - * @member {array} [regexFeatures] List of pattern features. - * @member {array} [modelFeatures] List of model features. - * @member {array} [patterns] List of patterns. - * @member {array} [utterances] List of sample utterances. + * @property {string} [desc] The description of the application. + * @property {string} [culture] The culture of the application. E.g.: en-us. + * @property {array} [intents] List of intents. + * @property {array} [entities] List of entities. + * @property {array} [closedLists] List of closed lists. + * @property {array} [composites] List of composite entities. + * @property {array} [patternAnyEntities] List of Pattern.Any entities. + * @property {array} [regexEntities] List of regular expression entities. + * @property {array} [prebuiltEntities] List of prebuilt entities. + * @property {array} [regexFeatures] List of pattern features. + * @property {array} [modelFeatures] List of model features. + * @property {array} [patterns] List of patterns. + * @property {array} [utterances] List of sample utterances. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/modelCreateObject.js b/lib/services/luis/authoring/lib/models/modelCreateObject.js index 8e22df1cbb..bf7240e091 100644 --- a/lib/services/luis/authoring/lib/models/modelCreateObject.js +++ b/lib/services/luis/authoring/lib/models/modelCreateObject.js @@ -17,7 +17,7 @@ class ModelCreateObject { /** * Create a ModelCreateObject. - * @member {string} [name] Name of the new entity extractor. + * @property {string} [name] Name of the new entity extractor. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/modelInfo.js b/lib/services/luis/authoring/lib/models/modelInfo.js index 205acabacd..f6795bf7de 100644 --- a/lib/services/luis/authoring/lib/models/modelInfo.js +++ b/lib/services/luis/authoring/lib/models/modelInfo.js @@ -17,14 +17,14 @@ class ModelInfo { /** * Create a ModelInfo. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/modelInfoResponse.js b/lib/services/luis/authoring/lib/models/modelInfoResponse.js index 24d22adbf7..b7ef2b50ed 100644 --- a/lib/services/luis/authoring/lib/models/modelInfoResponse.js +++ b/lib/services/luis/authoring/lib/models/modelInfoResponse.js @@ -17,21 +17,22 @@ class ModelInfoResponse { /** * Create a ModelInfoResponse. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [children] List of child entities. - * @member {array} [subLists] List of sub-lists. - * @member {string} [customPrebuiltDomainName] The domain name. - * @member {string} [customPrebuiltModelName] The intent name or entity name. - * @member {string} [regexPattern] The Regex entity pattern. - * @member {array} [explicitList] + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' + * @property {array} [roles] + * @property {array} [children] List of child entities. + * @property {array} [subLists] List of sub-lists. + * @property {string} [customPrebuiltDomainName] The domain name. + * @property {string} [customPrebuiltModelName] The intent name or entity + * name. + * @property {string} [regexPattern] The Regex entity pattern. + * @property {array} [explicitList] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/modelTrainingDetails.js b/lib/services/luis/authoring/lib/models/modelTrainingDetails.js index b27180ecc7..41df61379f 100644 --- a/lib/services/luis/authoring/lib/models/modelTrainingDetails.js +++ b/lib/services/luis/authoring/lib/models/modelTrainingDetails.js @@ -17,13 +17,13 @@ class ModelTrainingDetails { /** * Create a ModelTrainingDetails. - * @member {number} [statusId] The train request status ID. - * @member {string} [status] Possible values include: 'Queued', 'InProgress', - * 'UpToDate', 'Fail', 'Success' - * @member {number} [exampleCount] The count of examples used to train the + * @property {number} [statusId] The train request status ID. + * @property {string} [status] Possible values include: 'Queued', + * 'InProgress', 'UpToDate', 'Fail', 'Success' + * @property {number} [exampleCount] The count of examples used to train the * model. - * @member {date} [trainingDateTime] When the model was trained. - * @member {string} [failureReason] Reason for the training failure. + * @property {date} [trainingDateTime] When the model was trained. + * @property {string} [failureReason] Reason for the training failure. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/modelTrainingInfo.js b/lib/services/luis/authoring/lib/models/modelTrainingInfo.js index d79eff19c9..7acd10bd42 100644 --- a/lib/services/luis/authoring/lib/models/modelTrainingInfo.js +++ b/lib/services/luis/authoring/lib/models/modelTrainingInfo.js @@ -17,15 +17,16 @@ class ModelTrainingInfo { /** * Create a ModelTrainingInfo. - * @member {uuid} [modelId] The ID (GUID) of the model. - * @member {object} [details] - * @member {number} [details.statusId] The train request status ID. - * @member {string} [details.status] Possible values include: 'Queued', + * @property {uuid} [modelId] The ID (GUID) of the model. + * @property {object} [details] + * @property {number} [details.statusId] The train request status ID. + * @property {string} [details.status] Possible values include: 'Queued', * 'InProgress', 'UpToDate', 'Fail', 'Success' - * @member {number} [details.exampleCount] The count of examples used to + * @property {number} [details.exampleCount] The count of examples used to * train the model. - * @member {date} [details.trainingDateTime] When the model was trained. - * @member {string} [details.failureReason] Reason for the training failure. + * @property {date} [details.trainingDateTime] When the model was trained. + * @property {string} [details.failureReason] Reason for the training + * failure. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/modelUpdateObject.js b/lib/services/luis/authoring/lib/models/modelUpdateObject.js index b896f8aa60..793eebb71a 100644 --- a/lib/services/luis/authoring/lib/models/modelUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/modelUpdateObject.js @@ -17,7 +17,7 @@ class ModelUpdateObject { /** * Create a ModelUpdateObject. - * @member {string} [name] The entity's new name. + * @property {string} [name] The entity's new name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/operationError.js b/lib/services/luis/authoring/lib/models/operationError.js index c82ed4ba84..1a4fc1c7b4 100644 --- a/lib/services/luis/authoring/lib/models/operationError.js +++ b/lib/services/luis/authoring/lib/models/operationError.js @@ -17,8 +17,8 @@ class OperationError { /** * Create a OperationError. - * @member {string} [code] - * @member {string} [message] + * @property {string} [code] + * @property {string} [message] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/operationStatus.js b/lib/services/luis/authoring/lib/models/operationStatus.js index 19cab05248..1675f0cac8 100644 --- a/lib/services/luis/authoring/lib/models/operationStatus.js +++ b/lib/services/luis/authoring/lib/models/operationStatus.js @@ -17,9 +17,9 @@ class OperationStatus { /** * Create a OperationStatus. - * @member {string} [code] Status Code. Possible values include: 'Failed', + * @property {string} [code] Status Code. Possible values include: 'Failed', * 'FAILED', 'Success' - * @member {string} [message] Status details. + * @property {string} [message] Status details. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternAny.js b/lib/services/luis/authoring/lib/models/patternAny.js index 06e7cb92f8..ba85c23c71 100644 --- a/lib/services/luis/authoring/lib/models/patternAny.js +++ b/lib/services/luis/authoring/lib/models/patternAny.js @@ -17,9 +17,9 @@ class PatternAny { /** * Create a PatternAny. - * @member {string} [name] - * @member {array} [explicitList] - * @member {array} [roles] + * @property {string} [name] + * @property {array} [explicitList] + * @property {array} [roles] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternAnyEntityExtractor.js b/lib/services/luis/authoring/lib/models/patternAnyEntityExtractor.js index f75003e387..b68fb922e6 100644 --- a/lib/services/luis/authoring/lib/models/patternAnyEntityExtractor.js +++ b/lib/services/luis/authoring/lib/models/patternAnyEntityExtractor.js @@ -17,16 +17,16 @@ class PatternAnyEntityExtractor { /** * Create a PatternAnyEntityExtractor. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {array} [explicitList] + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' + * @property {array} [roles] + * @property {array} [explicitList] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternAnyModelCreateObject.js b/lib/services/luis/authoring/lib/models/patternAnyModelCreateObject.js index d2259bf7f4..f612b8098f 100644 --- a/lib/services/luis/authoring/lib/models/patternAnyModelCreateObject.js +++ b/lib/services/luis/authoring/lib/models/patternAnyModelCreateObject.js @@ -17,8 +17,8 @@ class PatternAnyModelCreateObject { /** * Create a PatternAnyModelCreateObject. - * @member {string} [name] The model name. - * @member {array} [explicitList] The Pattern.Any explicit list. + * @property {string} [name] The model name. + * @property {array} [explicitList] The Pattern.Any explicit list. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternAnyModelUpdateObject.js b/lib/services/luis/authoring/lib/models/patternAnyModelUpdateObject.js index d23605cf9c..ef7df01c33 100644 --- a/lib/services/luis/authoring/lib/models/patternAnyModelUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/patternAnyModelUpdateObject.js @@ -17,8 +17,8 @@ class PatternAnyModelUpdateObject { /** * Create a PatternAnyModelUpdateObject. - * @member {string} [name] The model name. - * @member {array} [explicitList] The Pattern.Any explicit list. + * @property {string} [name] The model name. + * @property {array} [explicitList] The Pattern.Any explicit list. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternCreateObject.js b/lib/services/luis/authoring/lib/models/patternCreateObject.js index 468c0f8dea..3342e39714 100644 --- a/lib/services/luis/authoring/lib/models/patternCreateObject.js +++ b/lib/services/luis/authoring/lib/models/patternCreateObject.js @@ -17,8 +17,8 @@ class PatternCreateObject { /** * Create a PatternCreateObject. - * @member {string} [pattern] The Regular Expression to match. - * @member {string} [name] Name of the feature. + * @property {string} [pattern] The Regular Expression to match. + * @property {string} [name] Name of the feature. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternFeatureInfo.js b/lib/services/luis/authoring/lib/models/patternFeatureInfo.js index 44f1be43db..aa6c16ce2e 100644 --- a/lib/services/luis/authoring/lib/models/patternFeatureInfo.js +++ b/lib/services/luis/authoring/lib/models/patternFeatureInfo.js @@ -20,7 +20,7 @@ const models = require('./index'); class PatternFeatureInfo extends models['FeatureInfoObject'] { /** * Create a PatternFeatureInfo. - * @member {string} [pattern] The Regular Expression to match. + * @property {string} [pattern] The Regular Expression to match. */ constructor() { super(); diff --git a/lib/services/luis/authoring/lib/models/patternRule.js b/lib/services/luis/authoring/lib/models/patternRule.js index 946d688701..dda634d619 100644 --- a/lib/services/luis/authoring/lib/models/patternRule.js +++ b/lib/services/luis/authoring/lib/models/patternRule.js @@ -17,8 +17,9 @@ class PatternRule { /** * Create a PatternRule. - * @member {string} [pattern] The pattern text. - * @member {string} [intent] The intent's name where the pattern belongs to. + * @property {string} [pattern] The pattern text. + * @property {string} [intent] The intent's name where the pattern belongs + * to. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternRuleCreateObject.js b/lib/services/luis/authoring/lib/models/patternRuleCreateObject.js index 072e06eafc..9ca966eba0 100644 --- a/lib/services/luis/authoring/lib/models/patternRuleCreateObject.js +++ b/lib/services/luis/authoring/lib/models/patternRuleCreateObject.js @@ -17,8 +17,9 @@ class PatternRuleCreateObject { /** * Create a PatternRuleCreateObject. - * @member {string} [pattern] The pattern text. - * @member {string} [intent] The intent's name which the pattern belongs to. + * @property {string} [pattern] The pattern text. + * @property {string} [intent] The intent's name which the pattern belongs + * to. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternRuleInfo.js b/lib/services/luis/authoring/lib/models/patternRuleInfo.js index 0d6b89b77e..7dab87f157 100644 --- a/lib/services/luis/authoring/lib/models/patternRuleInfo.js +++ b/lib/services/luis/authoring/lib/models/patternRuleInfo.js @@ -17,9 +17,10 @@ class PatternRuleInfo { /** * Create a PatternRuleInfo. - * @member {uuid} [id] The pattern ID. - * @member {string} [pattern] The pattern text. - * @member {string} [intent] The intent's name where the pattern belongs to. + * @property {uuid} [id] The pattern ID. + * @property {string} [pattern] The pattern text. + * @property {string} [intent] The intent's name where the pattern belongs + * to. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternRuleUpdateObject.js b/lib/services/luis/authoring/lib/models/patternRuleUpdateObject.js index 74d7dad67c..95dfe31fbb 100644 --- a/lib/services/luis/authoring/lib/models/patternRuleUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/patternRuleUpdateObject.js @@ -17,9 +17,10 @@ class PatternRuleUpdateObject { /** * Create a PatternRuleUpdateObject. - * @member {uuid} [id] The pattern ID. - * @member {string} [pattern] The pattern text. - * @member {string} [intent] The intent's name which the pattern belongs to. + * @property {uuid} [id] The pattern ID. + * @property {string} [pattern] The pattern text. + * @property {string} [intent] The intent's name which the pattern belongs + * to. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/patternUpdateObject.js b/lib/services/luis/authoring/lib/models/patternUpdateObject.js index 2eff910ceb..a4f9977e8e 100644 --- a/lib/services/luis/authoring/lib/models/patternUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/patternUpdateObject.js @@ -17,10 +17,10 @@ class PatternUpdateObject { /** * Create a PatternUpdateObject. - * @member {string} [pattern] The Regular Expression to match. - * @member {string} [name] Name of the feature. - * @member {boolean} [isActive] Indicates if the Pattern feature is enabled. - * Default value: true . + * @property {string} [pattern] The Regular Expression to match. + * @property {string} [name] Name of the feature. + * @property {boolean} [isActive] Indicates if the Pattern feature is + * enabled. Default value: true . */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/personalAssistantsResponse.js b/lib/services/luis/authoring/lib/models/personalAssistantsResponse.js index 2cf83e45c6..6b43a07c2c 100644 --- a/lib/services/luis/authoring/lib/models/personalAssistantsResponse.js +++ b/lib/services/luis/authoring/lib/models/personalAssistantsResponse.js @@ -18,8 +18,8 @@ class PersonalAssistantsResponse { /** * Create a PersonalAssistantsResponse. - * @member {array} [endpointKeys] - * @member {object} [endpointUrls] + * @property {array} [endpointKeys] + * @property {object} [endpointUrls] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/phraseListFeatureInfo.js b/lib/services/luis/authoring/lib/models/phraseListFeatureInfo.js index 1307a3d38f..2639d955d4 100644 --- a/lib/services/luis/authoring/lib/models/phraseListFeatureInfo.js +++ b/lib/services/luis/authoring/lib/models/phraseListFeatureInfo.js @@ -20,10 +20,10 @@ const models = require('./index'); class PhraseListFeatureInfo extends models['FeatureInfoObject'] { /** * Create a PhraseListFeatureInfo. - * @member {string} [phrases] A list of comma-separated values. - * @member {boolean} [isExchangeable] An exchangeable phrase list feature are - * serves as single feature to the LUIS underlying training algorithm. It is - * used as a lexicon lookup feature where its value is 1 if the lexicon + * @property {string} [phrases] A list of comma-separated values. + * @property {boolean} [isExchangeable] An exchangeable phrase list feature + * are serves as single feature to the LUIS underlying training algorithm. It + * is used as a lexicon lookup feature where its value is 1 if the lexicon * contains a given word or 0 if it doesn’t. Think of an exchangeable as a * synonyms list. A non-exchangeable phrase list feature has all the phrases * in the list serve as separate features to the underlying training diff --git a/lib/services/luis/authoring/lib/models/phraselistCreateObject.js b/lib/services/luis/authoring/lib/models/phraselistCreateObject.js index becafb82fb..a23dc25223 100644 --- a/lib/services/luis/authoring/lib/models/phraselistCreateObject.js +++ b/lib/services/luis/authoring/lib/models/phraselistCreateObject.js @@ -17,12 +17,12 @@ class PhraselistCreateObject { /** * Create a PhraselistCreateObject. - * @member {string} [phrases] List of comma-separated phrases that represent - * the Phraselist. - * @member {string} [name] The Phraselist name. - * @member {boolean} [isExchangeable] An exchangeable phrase list feature are - * serves as single feature to the LUIS underlying training algorithm. It is - * used as a lexicon lookup feature where its value is 1 if the lexicon + * @property {string} [phrases] List of comma-separated phrases that + * represent the Phraselist. + * @property {string} [name] The Phraselist name. + * @property {boolean} [isExchangeable] An exchangeable phrase list feature + * are serves as single feature to the LUIS underlying training algorithm. It + * is used as a lexicon lookup feature where its value is 1 if the lexicon * contains a given word or 0 if it doesn’t. Think of an exchangeable as a * synonyms list. A non-exchangeable phrase list feature has all the phrases * in the list serve as separate features to the underlying training diff --git a/lib/services/luis/authoring/lib/models/phraselistUpdateObject.js b/lib/services/luis/authoring/lib/models/phraselistUpdateObject.js index 17f63efdc4..4bdc22f73d 100644 --- a/lib/services/luis/authoring/lib/models/phraselistUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/phraselistUpdateObject.js @@ -17,14 +17,14 @@ class PhraselistUpdateObject { /** * Create a PhraselistUpdateObject. - * @member {string} [phrases] List of comma-separated phrases that represent - * the Phraselist. - * @member {string} [name] The Phraselist name. - * @member {boolean} [isActive] Indicates if the Phraselist is enabled. + * @property {string} [phrases] List of comma-separated phrases that + * represent the Phraselist. + * @property {string} [name] The Phraselist name. + * @property {boolean} [isActive] Indicates if the Phraselist is enabled. * Default value: true . - * @member {boolean} [isExchangeable] An exchangeable phrase list feature are - * serves as single feature to the LUIS underlying training algorithm. It is - * used as a lexicon lookup feature where its value is 1 if the lexicon + * @property {boolean} [isExchangeable] An exchangeable phrase list feature + * are serves as single feature to the LUIS underlying training algorithm. It + * is used as a lexicon lookup feature where its value is 1 if the lexicon * contains a given word or 0 if it doesn’t. Think of an exchangeable as a * synonyms list. A non-exchangeable phrase list feature has all the phrases * in the list serve as separate features to the underlying training diff --git a/lib/services/luis/authoring/lib/models/prebuiltDomain.js b/lib/services/luis/authoring/lib/models/prebuiltDomain.js index b4d15c6f4d..a7db96b20d 100644 --- a/lib/services/luis/authoring/lib/models/prebuiltDomain.js +++ b/lib/services/luis/authoring/lib/models/prebuiltDomain.js @@ -17,12 +17,12 @@ class PrebuiltDomain { /** * Create a PrebuiltDomain. - * @member {string} [name] - * @member {string} [culture] - * @member {string} [description] - * @member {string} [examples] - * @member {array} [intents] - * @member {array} [entities] + * @property {string} [name] + * @property {string} [culture] + * @property {string} [description] + * @property {string} [examples] + * @property {array} [intents] + * @property {array} [entities] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/prebuiltDomainCreateBaseObject.js b/lib/services/luis/authoring/lib/models/prebuiltDomainCreateBaseObject.js index d235f429c3..9f222d60bd 100644 --- a/lib/services/luis/authoring/lib/models/prebuiltDomainCreateBaseObject.js +++ b/lib/services/luis/authoring/lib/models/prebuiltDomainCreateBaseObject.js @@ -18,7 +18,7 @@ class PrebuiltDomainCreateBaseObject { /** * Create a PrebuiltDomainCreateBaseObject. - * @member {string} [domainName] The domain name. + * @property {string} [domainName] The domain name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/prebuiltDomainCreateObject.js b/lib/services/luis/authoring/lib/models/prebuiltDomainCreateObject.js index b9c44ec35f..24546862b5 100644 --- a/lib/services/luis/authoring/lib/models/prebuiltDomainCreateObject.js +++ b/lib/services/luis/authoring/lib/models/prebuiltDomainCreateObject.js @@ -18,8 +18,8 @@ class PrebuiltDomainCreateObject { /** * Create a PrebuiltDomainCreateObject. - * @member {string} [domainName] The domain name. - * @member {string} [culture] The culture of the new domain. + * @property {string} [domainName] The domain name. + * @property {string} [culture] The culture of the new domain. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/prebuiltDomainItem.js b/lib/services/luis/authoring/lib/models/prebuiltDomainItem.js index 315dfb9d12..2da420193a 100644 --- a/lib/services/luis/authoring/lib/models/prebuiltDomainItem.js +++ b/lib/services/luis/authoring/lib/models/prebuiltDomainItem.js @@ -16,9 +16,9 @@ class PrebuiltDomainItem { /** * Create a PrebuiltDomainItem. - * @member {string} [name] - * @member {string} [description] - * @member {string} [examples] + * @property {string} [name] + * @property {string} [description] + * @property {string} [examples] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/prebuiltDomainModelCreateObject.js b/lib/services/luis/authoring/lib/models/prebuiltDomainModelCreateObject.js index 0ed6597e5e..4b6cdaa35f 100644 --- a/lib/services/luis/authoring/lib/models/prebuiltDomainModelCreateObject.js +++ b/lib/services/luis/authoring/lib/models/prebuiltDomainModelCreateObject.js @@ -18,8 +18,8 @@ class PrebuiltDomainModelCreateObject { /** * Create a PrebuiltDomainModelCreateObject. - * @member {string} [domainName] The domain name. - * @member {string} [modelName] The intent name or entity name. + * @property {string} [domainName] The domain name. + * @property {string} [modelName] The intent name or entity name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/prebuiltDomainObject.js b/lib/services/luis/authoring/lib/models/prebuiltDomainObject.js index d6ee273af3..2d3da7f055 100644 --- a/lib/services/luis/authoring/lib/models/prebuiltDomainObject.js +++ b/lib/services/luis/authoring/lib/models/prebuiltDomainObject.js @@ -16,8 +16,8 @@ class PrebuiltDomainObject { /** * Create a PrebuiltDomainObject. - * @member {string} [domainName] - * @member {string} [modelName] + * @property {string} [domainName] + * @property {string} [modelName] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/prebuiltEntity.js b/lib/services/luis/authoring/lib/models/prebuiltEntity.js index f9d8b6e636..c18cb90b8b 100644 --- a/lib/services/luis/authoring/lib/models/prebuiltEntity.js +++ b/lib/services/luis/authoring/lib/models/prebuiltEntity.js @@ -17,8 +17,8 @@ class PrebuiltEntity { /** * Create a PrebuiltEntity. - * @member {string} [name] - * @member {array} [roles] + * @property {string} [name] + * @property {array} [roles] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/prebuiltEntityExtractor.js b/lib/services/luis/authoring/lib/models/prebuiltEntityExtractor.js index e5173d0ce9..0f70acd213 100644 --- a/lib/services/luis/authoring/lib/models/prebuiltEntityExtractor.js +++ b/lib/services/luis/authoring/lib/models/prebuiltEntityExtractor.js @@ -17,15 +17,15 @@ class PrebuiltEntityExtractor { /** * Create a PrebuiltEntityExtractor. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' + * @property {array} [roles] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/productionOrStagingEndpointInfo.js b/lib/services/luis/authoring/lib/models/productionOrStagingEndpointInfo.js index dbabb69efc..ec3740b9a0 100644 --- a/lib/services/luis/authoring/lib/models/productionOrStagingEndpointInfo.js +++ b/lib/services/luis/authoring/lib/models/productionOrStagingEndpointInfo.js @@ -80,6 +80,13 @@ class ProductionOrStagingEndpointInfo extends models['EndpointInfo'] { name: 'String' } }, + failedRegions: { + required: false, + serializedName: 'failedRegions', + type: { + name: 'String' + } + }, publishedDateTime: { required: false, serializedName: 'publishedDateTime', diff --git a/lib/services/luis/authoring/lib/models/publishSettingUpdateObject.js b/lib/services/luis/authoring/lib/models/publishSettingUpdateObject.js index 07c7309dee..6afaa8f01e 100644 --- a/lib/services/luis/authoring/lib/models/publishSettingUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/publishSettingUpdateObject.js @@ -17,11 +17,11 @@ class PublishSettingUpdateObject { /** * Create a PublishSettingUpdateObject. - * @member {boolean} [sentimentAnalysis] Setting sentiment analysis as true - * returns the Sentiment of the input utterance along with the resopnse - * @member {boolean} [speech] Setting speech as public enables speech priming - * in your app - * @member {boolean} [spellChecker] Setting spell checker as public enables + * @property {boolean} [sentimentAnalysis] Setting sentiment analysis as true + * returns the Sentiment of the input utterance along with the response + * @property {boolean} [speech] Setting speech as public enables speech + * priming in your app + * @property {boolean} [spellChecker] Setting spell checker as public enables * spell checking the input utterance. */ constructor() { diff --git a/lib/services/luis/authoring/lib/models/publishSettings.js b/lib/services/luis/authoring/lib/models/publishSettings.js index cb88c51f23..2af4911173 100644 --- a/lib/services/luis/authoring/lib/models/publishSettings.js +++ b/lib/services/luis/authoring/lib/models/publishSettings.js @@ -17,12 +17,13 @@ class PublishSettings { /** * Create a PublishSettings. - * @member {uuid} id The application ID. - * @member {boolean} isSentimentAnalysisEnabled Setting sentiment analysis as - * true returns the Sentiment of the input utterance along with the resopnse - * @member {boolean} isSpeechEnabled Setting speech as public enables speech - * priming in your app - * @member {boolean} isSpellCheckerEnabled Setting spell checker as public + * @property {uuid} id The application ID. + * @property {boolean} isSentimentAnalysisEnabled Setting sentiment analysis + * as true returns the Sentiment of the input utterance along with the + * response + * @property {boolean} isSpeechEnabled Setting speech as public enables + * speech priming in your app + * @property {boolean} isSpellCheckerEnabled Setting spell checker as public * enables spell checking the input utterance. */ constructor() { diff --git a/lib/services/luis/authoring/lib/models/regexEntity.js b/lib/services/luis/authoring/lib/models/regexEntity.js index ba69c78ed4..172f55c60a 100644 --- a/lib/services/luis/authoring/lib/models/regexEntity.js +++ b/lib/services/luis/authoring/lib/models/regexEntity.js @@ -17,9 +17,9 @@ class RegexEntity { /** * Create a RegexEntity. - * @member {string} [name] - * @member {string} [regexPattern] - * @member {array} [roles] + * @property {string} [name] + * @property {string} [regexPattern] + * @property {array} [roles] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/regexEntityExtractor.js b/lib/services/luis/authoring/lib/models/regexEntityExtractor.js index 2947fc44d6..37ce6084f6 100644 --- a/lib/services/luis/authoring/lib/models/regexEntityExtractor.js +++ b/lib/services/luis/authoring/lib/models/regexEntityExtractor.js @@ -17,16 +17,16 @@ class RegexEntityExtractor { /** * Create a RegexEntityExtractor. - * @member {uuid} id The ID of the Entity Model. - * @member {string} [name] Name of the Entity Model. - * @member {number} [typeId] The type ID of the Entity Model. - * @member {string} readableType Possible values include: 'Entity Extractor', - * 'Hierarchical Entity Extractor', 'Hierarchical Child Entity Extractor', - * 'Composite Entity Extractor', 'Closed List Entity Extractor', 'Prebuilt - * Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity Extractor', - * 'Regex Entity Extractor' - * @member {array} [roles] - * @member {string} [regexPattern] The Regex entity pattern. + * @property {uuid} id The ID of the Entity Model. + * @property {string} [name] Name of the Entity Model. + * @property {number} [typeId] The type ID of the Entity Model. + * @property {string} readableType Possible values include: 'Entity + * Extractor', 'Hierarchical Entity Extractor', 'Hierarchical Child Entity + * Extractor', 'Composite Entity Extractor', 'Closed List Entity Extractor', + * 'Prebuilt Entity Extractor', 'Intent Classifier', 'Pattern.Any Entity + * Extractor', 'Regex Entity Extractor' + * @property {array} [roles] + * @property {string} [regexPattern] The Regex entity pattern. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/regexModelCreateObject.js b/lib/services/luis/authoring/lib/models/regexModelCreateObject.js index e544993b0e..25e8f7372e 100644 --- a/lib/services/luis/authoring/lib/models/regexModelCreateObject.js +++ b/lib/services/luis/authoring/lib/models/regexModelCreateObject.js @@ -17,8 +17,8 @@ class RegexModelCreateObject { /** * Create a RegexModelCreateObject. - * @member {string} [regexPattern] The regex entity pattern. - * @member {string} [name] The model name. + * @property {string} [regexPattern] The regex entity pattern. + * @property {string} [name] The model name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/regexModelUpdateObject.js b/lib/services/luis/authoring/lib/models/regexModelUpdateObject.js index 4845710a65..3629fc2270 100644 --- a/lib/services/luis/authoring/lib/models/regexModelUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/regexModelUpdateObject.js @@ -17,8 +17,8 @@ class RegexModelUpdateObject { /** * Create a RegexModelUpdateObject. - * @member {string} [regexPattern] The regex entity pattern. - * @member {string} [name] The model name. + * @property {string} [regexPattern] The regex entity pattern. + * @property {string} [name] The model name. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/subClosedList.js b/lib/services/luis/authoring/lib/models/subClosedList.js index 6d67aece9c..b669eb6c16 100644 --- a/lib/services/luis/authoring/lib/models/subClosedList.js +++ b/lib/services/luis/authoring/lib/models/subClosedList.js @@ -17,9 +17,9 @@ class SubClosedList { /** * Create a SubClosedList. - * @member {string} [canonicalForm] The standard form that the list + * @property {string} [canonicalForm] The standard form that the list * represents. - * @member {array} [list] List of synonym words. + * @property {array} [list] List of synonym words. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/subClosedListResponse.js b/lib/services/luis/authoring/lib/models/subClosedListResponse.js index 1fc10510e4..2aa18cd7af 100644 --- a/lib/services/luis/authoring/lib/models/subClosedListResponse.js +++ b/lib/services/luis/authoring/lib/models/subClosedListResponse.js @@ -20,7 +20,7 @@ const models = require('./index'); class SubClosedListResponse extends models['SubClosedList'] { /** * Create a SubClosedListResponse. - * @member {number} [id] The sublist ID + * @property {number} [id] The sublist ID */ constructor() { super(); diff --git a/lib/services/luis/authoring/lib/models/taskUpdateObject.js b/lib/services/luis/authoring/lib/models/taskUpdateObject.js index 34df7787bb..0e027e8218 100644 --- a/lib/services/luis/authoring/lib/models/taskUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/taskUpdateObject.js @@ -17,7 +17,7 @@ class TaskUpdateObject { /** * Create a TaskUpdateObject. - * @member {string} [version] The new version for the cloned model. + * @property {string} [version] The new version for the cloned model. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/userAccessList.js b/lib/services/luis/authoring/lib/models/userAccessList.js index 28ff0f506b..3b0aef9ba7 100644 --- a/lib/services/luis/authoring/lib/models/userAccessList.js +++ b/lib/services/luis/authoring/lib/models/userAccessList.js @@ -17,8 +17,8 @@ class UserAccessList { /** * Create a UserAccessList. - * @member {string} [owner] The email address of owner of the application. - * @member {array} [emails] + * @property {string} [owner] The email address of owner of the application. + * @property {array} [emails] */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/userCollaborator.js b/lib/services/luis/authoring/lib/models/userCollaborator.js index c544e99113..65896d695e 100644 --- a/lib/services/luis/authoring/lib/models/userCollaborator.js +++ b/lib/services/luis/authoring/lib/models/userCollaborator.js @@ -16,7 +16,7 @@ class UserCollaborator { /** * Create a UserCollaborator. - * @member {string} [email] The email address of the user. + * @property {string} [email] The email address of the user. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/versionInfo.js b/lib/services/luis/authoring/lib/models/versionInfo.js index 09770a3354..5214a4a4e8 100644 --- a/lib/services/luis/authoring/lib/models/versionInfo.js +++ b/lib/services/luis/authoring/lib/models/versionInfo.js @@ -17,21 +17,22 @@ class VersionInfo { /** * Create a VersionInfo. - * @member {string} version The version ID. E.g.: "0.1" - * @member {date} [createdDateTime] The version's creation timestamp. - * @member {date} [lastModifiedDateTime] Timestamp of the last update. - * @member {date} [lastTrainedDateTime] Timestamp of the last time the model - * was trained. - * @member {date} [lastPublishedDateTime] Timestamp when was last published. - * @member {string} [endpointUrl] The Runtime endpoint URL for this model + * @property {string} version The version ID. E.g.: "0.1" + * @property {date} [createdDateTime] The version's creation timestamp. + * @property {date} [lastModifiedDateTime] Timestamp of the last update. + * @property {date} [lastTrainedDateTime] Timestamp of the last time the + * model was trained. + * @property {date} [lastPublishedDateTime] Timestamp when was last + * published. + * @property {string} [endpointUrl] The Runtime endpoint URL for this model * version. - * @member {object} [assignedEndpointKey] The endpoint key. - * @member {object} [externalApiKeys] External keys. - * @member {number} [intentsCount] Number of intents in this model. - * @member {number} [entitiesCount] Number of entities in this model. - * @member {number} [endpointHitsCount] Number of calls made to this + * @property {object} [assignedEndpointKey] The endpoint key. + * @property {object} [externalApiKeys] External keys. + * @property {number} [intentsCount] Number of intents in this model. + * @property {number} [entitiesCount] Number of entities in this model. + * @property {number} [endpointHitsCount] Number of calls made to this * endpoint. - * @member {string} trainingStatus The current training status. Possible + * @property {string} trainingStatus The current training status. Possible * values include: 'NeedsTraining', 'InProgress', 'Trained' */ constructor() { diff --git a/lib/services/luis/authoring/lib/models/wordListBaseUpdateObject.js b/lib/services/luis/authoring/lib/models/wordListBaseUpdateObject.js index 5aa1519417..bf938ec266 100644 --- a/lib/services/luis/authoring/lib/models/wordListBaseUpdateObject.js +++ b/lib/services/luis/authoring/lib/models/wordListBaseUpdateObject.js @@ -17,9 +17,9 @@ class WordListBaseUpdateObject { /** * Create a WordListBaseUpdateObject. - * @member {string} [canonicalForm] The standard form that the list + * @property {string} [canonicalForm] The standard form that the list * represents. - * @member {array} [list] List of synonym words. + * @property {array} [list] List of synonym words. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/models/wordListObject.js b/lib/services/luis/authoring/lib/models/wordListObject.js index 7526d090e6..48e20b233b 100644 --- a/lib/services/luis/authoring/lib/models/wordListObject.js +++ b/lib/services/luis/authoring/lib/models/wordListObject.js @@ -17,9 +17,9 @@ class WordListObject { /** * Create a WordListObject. - * @member {string} [canonicalForm] The standard form that the list + * @property {string} [canonicalForm] The standard form that the list * represents. - * @member {array} [list] List of synonym words. + * @property {array} [list] List of synonym words. */ constructor() { } diff --git a/lib/services/luis/authoring/lib/operations/apps.js b/lib/services/luis/authoring/lib/operations/apps.js index dd2ab9e476..94bf56443a 100644 --- a/lib/services/luis/authoring/lib/operations/apps.js +++ b/lib/services/luis/authoring/lib/operations/apps.js @@ -349,7 +349,7 @@ function _list(options, callback) { /** * Imports an application to LUIS, the application's structure should be - * included in in the request body. + * included in the request body. * * @param {object} luisApp A LUIS application structure. * @@ -1422,6 +1422,9 @@ function _update(appId, applicationUpdateObject, options, callback) { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.force] A flag to indicate whether to force an + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1448,6 +1451,7 @@ function _deleteMethod(appId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let force = (options && options.force !== undefined) ? options.force : false; // Validate try { if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { @@ -1456,6 +1460,9 @@ function _deleteMethod(appId, options, callback) { if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); } + if (force !== null && force !== undefined && typeof force !== 'boolean') { + throw new Error('force must be of type boolean.'); + } } catch (error) { return callback(error); } @@ -1465,6 +1472,13 @@ function _deleteMethod(appId, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'apps/{appId}'; requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + let queryParameters = []; + if (force !== null && force !== undefined) { + queryParameters.push('force=' + encodeURIComponent(force.toString())); + } + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -1552,9 +1566,6 @@ function _deleteMethod(appId, options, callback) { * @param {boolean} [applicationPublishObject.isStaging] Indicates if the * staging slot should be used, instead of the Production one. * - * @param {string} [applicationPublishObject.region] The target region that the - * application is published to. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -1640,7 +1651,7 @@ function _publish(appId, applicationPublishObject, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201) { + if (statusCode !== 201 && statusCode !== 207) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -1686,6 +1697,23 @@ function _publish(appId, applicationPublishObject, options, callback) { return callback(deserializationError); } } + // Deserialize Response + if (statusCode === 207) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ProductionOrStagingEndpointInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } return callback(null, result, httpRequest, response); }); @@ -2094,7 +2122,7 @@ function _getPublishSettings(appId, options, callback) { * * @param {boolean} [publishSettingUpdateObject.sentimentAnalysis] Setting * sentiment analysis as true returns the Sentiment of the input utterance - * along with the resopnse + * along with the response * * @param {boolean} [publishSettingUpdateObject.speech] Setting speech as * public enables speech priming in your app @@ -2785,6 +2813,236 @@ function _listAvailableCustomPrebuiltDomainsForCulture(culture, options, callbac }); } +/** + * @summary package - Gets published LUIS application package in binary stream + * GZip format + * + * Packages published LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {uuid} slotName The publishing slot name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _packagePublishedApplicationAsGzip(appId, slotName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (slotName === null || slotName === undefined || typeof slotName.valueOf() !== 'string' || !msRest.isValidUuid(slotName)) { + throw new Error('slotName cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'package/{appId}/slot/{slotName}/gzip'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + requestUrl = requestUrl.replace('{slotName}', encodeURIComponent(slotName.toString())); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + + // Create Result + let result = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary package - Gets trained LUIS application package in binary stream + * GZip format + * + * Packages trained LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _packageTrainedApplicationAsGzip(appId, versionId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (versionId === null || versionId === undefined || typeof versionId.valueOf() !== 'string') { + throw new Error('versionId cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'package/{appId}/versions/{versionId}/gzip'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + requestUrl = requestUrl.replace('{versionId}', encodeURIComponent(versionId)); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + + // Create Result + let result = response; + return callback(null, result, httpRequest, response); + }); +} + /** Class representing a Apps. */ class Apps { /** @@ -2813,6 +3071,8 @@ class Apps { this._listAvailableCustomPrebuiltDomains = _listAvailableCustomPrebuiltDomains; this._addCustomPrebuiltDomain = _addCustomPrebuiltDomain; this._listAvailableCustomPrebuiltDomainsForCulture = _listAvailableCustomPrebuiltDomainsForCulture; + this._packagePublishedApplicationAsGzip = _packagePublishedApplicationAsGzip; + this._packageTrainedApplicationAsGzip = _packageTrainedApplicationAsGzip; } /** @@ -3033,7 +3293,7 @@ class Apps { /** * Imports an application to LUIS, the application's structure should be - * included in in the request body. + * included in the request body. * * @param {object} luisApp A LUIS application structure. * @@ -3099,7 +3359,7 @@ class Apps { /** * Imports an application to LUIS, the application's structure should be - * included in in the request body. + * included in the request body. * * @param {object} luisApp A LUIS application structure. * @@ -3763,6 +4023,9 @@ class Apps { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.force] A flag to indicate whether to force an + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3793,6 +4056,9 @@ class Apps { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.force] A flag to indicate whether to force an + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3852,9 +4118,6 @@ class Apps { * @param {boolean} [applicationPublishObject.isStaging] Indicates if the * staging slot should be used, instead of the Production one. * - * @param {string} [applicationPublishObject.region] The target region that the - * application is published to. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -3894,9 +4157,6 @@ class Apps { * @param {boolean} [applicationPublishObject.isStaging] Indicates if the * staging slot should be used, instead of the Production one. * - * @param {string} [applicationPublishObject.region] The target region that the - * application is published to. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -4215,7 +4475,7 @@ class Apps { * * @param {boolean} [publishSettingUpdateObject.sentimentAnalysis] Setting * sentiment analysis as true returns the Sentiment of the input utterance - * along with the resopnse + * along with the response * * @param {boolean} [publishSettingUpdateObject.speech] Setting speech as * public enables speech priming in your app @@ -4258,7 +4518,7 @@ class Apps { * * @param {boolean} [publishSettingUpdateObject.sentimentAnalysis] Setting * sentiment analysis as true returns the Sentiment of the input utterance - * along with the resopnse + * along with the response * * @param {boolean} [publishSettingUpdateObject.speech] Setting speech as * public enables speech priming in your app @@ -4645,6 +4905,188 @@ class Apps { } } + /** + * @summary package - Gets published LUIS application package in binary stream + * GZip format + * + * Packages published LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {uuid} slotName The publishing slot name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + packagePublishedApplicationAsGzipWithHttpOperationResponse(appId, slotName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._packagePublishedApplicationAsGzip(appId, slotName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary package - Gets published LUIS application package in binary stream + * GZip format + * + * Packages published LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {uuid} slotName The publishing slot name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + packagePublishedApplicationAsGzip(appId, slotName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._packagePublishedApplicationAsGzip(appId, slotName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._packagePublishedApplicationAsGzip(appId, slotName, options, optionalCallback); + } + } + + /** + * @summary package - Gets trained LUIS application package in binary stream + * GZip format + * + * Packages trained LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + packageTrainedApplicationAsGzipWithHttpOperationResponse(appId, versionId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._packageTrainedApplicationAsGzip(appId, versionId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary package - Gets trained LUIS application package in binary stream + * GZip format + * + * Packages trained LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + packageTrainedApplicationAsGzip(appId, versionId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._packageTrainedApplicationAsGzip(appId, versionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._packageTrainedApplicationAsGzip(appId, versionId, options, optionalCallback); + } + } + } module.exports = Apps; diff --git a/lib/services/luis/authoring/lib/operations/azureAccounts.js b/lib/services/luis/authoring/lib/operations/azureAccounts.js new file mode 100644 index 0000000000..c4c85f6166 --- /dev/null +++ b/lib/services/luis/authoring/lib/operations/azureAccounts.js @@ -0,0 +1,995 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary apps - Assign a LUIS azure account to an application + * + * Assigns an azure account to the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _assignToApp(appId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let azureAccountInfoObject = (options && options.azureAccountInfoObject !== undefined) ? options.azureAccountInfoObject : undefined; + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'apps/{appId}/azureaccounts'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (azureAccountInfoObject !== null && azureAccountInfoObject !== undefined) { + let requestModelMapper = new client.models['AzureAccountInfoObject']().mapper(); + requestModel = client.serialize(requestModelMapper, azureAccountInfoObject, 'azureAccountInfoObject'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(azureAccountInfoObject, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 201) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatus']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary apps - Get LUIS azure accounts assigned to the application + * + * Gets the LUIS azure accounts assigned to the application for the user using + * his ARM token. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getAssigned(appId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'apps/{appId}/azureaccounts'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureAccountInfoObjectElementType', + type: { + name: 'Composite', + className: 'AzureAccountInfoObject' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary apps - Removes an assigned LUIS azure account from an application + * + * Removes assigned azure account from the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _removeFromApp(appId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let azureAccountInfoObject = (options && options.azureAccountInfoObject !== undefined) ? options.azureAccountInfoObject : undefined; + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'apps/{appId}/azureaccounts'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (azureAccountInfoObject !== null && azureAccountInfoObject !== undefined) { + let requestModelMapper = new client.models['AzureAccountInfoObject']().mapper(); + requestModel = client.serialize(requestModelMapper, azureAccountInfoObject, 'azureAccountInfoObject'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(azureAccountInfoObject, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatus']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary user - Get LUIS azure accounts + * + * Gets the LUIS azure accounts for the user using his ARM token. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getUserLUISAccounts(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'azureaccounts'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AzureAccountInfoObjectElementType', + type: { + name: 'Composite', + className: 'AzureAccountInfoObject' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a AzureAccounts. */ +class AzureAccounts { + /** + * Create a AzureAccounts. + * @param {LUISAuthoringClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._assignToApp = _assignToApp; + this._getAssigned = _getAssigned; + this._removeFromApp = _removeFromApp; + this._getUserLUISAccounts = _getUserLUISAccounts; + } + + /** + * @summary apps - Assign a LUIS azure account to an application + * + * Assigns an azure account to the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + assignToAppWithHttpOperationResponse(appId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._assignToApp(appId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary apps - Assign a LUIS azure account to an application + * + * Assigns an azure account to the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + assignToApp(appId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._assignToApp(appId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._assignToApp(appId, options, optionalCallback); + } + } + + /** + * @summary apps - Get LUIS azure accounts assigned to the application + * + * Gets the LUIS azure accounts assigned to the application for the user using + * his ARM token. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAssignedWithHttpOperationResponse(appId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAssigned(appId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary apps - Get LUIS azure accounts assigned to the application + * + * Gets the LUIS azure accounts assigned to the application for the user using + * his ARM token. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Array} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAssigned(appId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAssigned(appId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAssigned(appId, options, optionalCallback); + } + } + + /** + * @summary apps - Removes an assigned LUIS azure account from an application + * + * Removes assigned azure account from the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + removeFromAppWithHttpOperationResponse(appId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._removeFromApp(appId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary apps - Removes an assigned LUIS azure account from an application + * + * Removes assigned azure account from the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + removeFromApp(appId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._removeFromApp(appId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._removeFromApp(appId, options, optionalCallback); + } + } + + /** + * @summary user - Get LUIS azure accounts + * + * Gets the LUIS azure accounts for the user using his ARM token. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getUserLUISAccountsWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getUserLUISAccounts(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary user - Get LUIS azure accounts + * + * Gets the LUIS azure accounts for the user using his ARM token. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Array} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getUserLUISAccounts(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getUserLUISAccounts(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getUserLUISAccounts(options, optionalCallback); + } + } + +} + +module.exports = AzureAccounts; diff --git a/lib/services/luis/authoring/lib/operations/dispatch.js b/lib/services/luis/authoring/lib/operations/dispatch.js new file mode 100644 index 0000000000..43996bb536 --- /dev/null +++ b/lib/services/luis/authoring/lib/operations/dispatch.js @@ -0,0 +1,964 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * @summary Updates connected services + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {array} connectedServices A JSON array of service connections. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _batchUpdateConnectedServices(appId, versionId, connectedServices, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (versionId === null || versionId === undefined || typeof versionId.valueOf() !== 'string') { + throw new Error('versionId cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'apps/{appId}/versions/{versionId}/connectedServices'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + requestUrl = requestUrl.replace('{versionId}', encodeURIComponent(versionId)); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectedServices !== null && connectedServices !== undefined) { + let requestModelMapper = { + required: true, + serializedName: 'connectedServices', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DispatchConnectedServiceObjectElementType', + type: { + name: 'Composite', + className: 'DispatchConnectedServiceObject' + } + } + } + }; + requestModel = client.serialize(requestModelMapper, connectedServices, 'connectedServices'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectedServices, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 400 && statusCode !== 401 && statusCode !== 403 && statusCode !== 429) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatus']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 400) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 401) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + // Deserialize Response + if (statusCode === 403) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError3 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError3.request = msRest.stripRequest(httpRequest); + deserializationError3.response = msRest.stripResponse(response); + return callback(deserializationError3); + } + } + // Deserialize Response + if (statusCode === 429) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError4 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError4.request = msRest.stripRequest(httpRequest); + deserializationError4.response = msRest.stripResponse(response); + return callback(deserializationError4); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Adds connected services + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {array} connectedServices A JSON array of service connections. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _batchAddConnectedServices(appId, versionId, connectedServices, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (versionId === null || versionId === undefined || typeof versionId.valueOf() !== 'string') { + throw new Error('versionId cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'apps/{appId}/versions/{versionId}/connectedServices'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + requestUrl = requestUrl.replace('{versionId}', encodeURIComponent(versionId)); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectedServices !== null && connectedServices !== undefined) { + let requestModelMapper = { + required: true, + serializedName: 'connectedServices', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DispatchConnectedServiceObjectElementType', + type: { + name: 'Composite', + className: 'DispatchConnectedServiceObject' + } + } + } + }; + requestModel = client.serialize(requestModelMapper, connectedServices, 'connectedServices'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectedServices, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 400 && statusCode !== 401 && statusCode !== 403 && statusCode !== 429) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatus']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 400) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 401) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + // Deserialize Response + if (statusCode === 403) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError3 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError3.request = msRest.stripRequest(httpRequest); + deserializationError3.response = msRest.stripResponse(response); + return callback(deserializationError3); + } + } + // Deserialize Response + if (statusCode === 429) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError4 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError4.request = msRest.stripRequest(httpRequest); + deserializationError4.response = msRest.stripResponse(response); + return callback(deserializationError4); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Deletes the services connected to the specified intents + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {array} intentNames The intent names. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteConnectedServices(appId, versionId, intentNames, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (versionId === null || versionId === undefined || typeof versionId.valueOf() !== 'string') { + throw new Error('versionId cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'apps/{appId}/versions/{versionId}/connectedServices'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + requestUrl = requestUrl.replace('{versionId}', encodeURIComponent(versionId)); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (intentNames !== null && intentNames !== undefined) { + let requestModelMapper = { + required: true, + serializedName: 'intentNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DispatchConnectedServiceDeleteObjectElementType', + type: { + name: 'Composite', + className: 'DispatchConnectedServiceDeleteObject' + } + } + } + }; + requestModel = client.serialize(requestModelMapper, intentNames, 'intentNames'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(intentNames, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 400 && statusCode !== 401 && statusCode !== 403 && statusCode !== 429) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatus']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 400) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 401) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + // Deserialize Response + if (statusCode === 403) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError3 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError3.request = msRest.stripRequest(httpRequest); + deserializationError3.response = msRest.stripResponse(response); + return callback(deserializationError3); + } + } + // Deserialize Response + if (statusCode === 429) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError4 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError4.request = msRest.stripRequest(httpRequest); + deserializationError4.response = msRest.stripResponse(response); + return callback(deserializationError4); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Dispatch. */ +class Dispatch { + /** + * Create a Dispatch. + * @param {LUISAuthoringClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._batchUpdateConnectedServices = _batchUpdateConnectedServices; + this._batchAddConnectedServices = _batchAddConnectedServices; + this._deleteConnectedServices = _deleteConnectedServices; + } + + /** + * @summary Updates connected services + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {array} connectedServices A JSON array of service connections. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + batchUpdateConnectedServicesWithHttpOperationResponse(appId, versionId, connectedServices, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._batchUpdateConnectedServices(appId, versionId, connectedServices, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates connected services + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {array} connectedServices A JSON array of service connections. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + batchUpdateConnectedServices(appId, versionId, connectedServices, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._batchUpdateConnectedServices(appId, versionId, connectedServices, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._batchUpdateConnectedServices(appId, versionId, connectedServices, options, optionalCallback); + } + } + + /** + * @summary Adds connected services + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {array} connectedServices A JSON array of service connections. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + batchAddConnectedServicesWithHttpOperationResponse(appId, versionId, connectedServices, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._batchAddConnectedServices(appId, versionId, connectedServices, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds connected services + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {array} connectedServices A JSON array of service connections. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + batchAddConnectedServices(appId, versionId, connectedServices, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._batchAddConnectedServices(appId, versionId, connectedServices, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._batchAddConnectedServices(appId, versionId, connectedServices, options, optionalCallback); + } + } + + /** + * @summary Deletes the services connected to the specified intents + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {array} intentNames The intent names. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteConnectedServicesWithHttpOperationResponse(appId, versionId, intentNames, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteConnectedServices(appId, versionId, intentNames, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes the services connected to the specified intents + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {array} intentNames The intent names. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteConnectedServices(appId, versionId, intentNames, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteConnectedServices(appId, versionId, intentNames, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteConnectedServices(appId, versionId, intentNames, options, optionalCallback); + } + } + +} + +module.exports = Dispatch; diff --git a/lib/services/luis/authoring/lib/operations/examples.js b/lib/services/luis/authoring/lib/operations/examples.js index a2775d143d..43e6ed39c1 100644 --- a/lib/services/luis/authoring/lib/operations/examples.js +++ b/lib/services/luis/authoring/lib/operations/examples.js @@ -25,10 +25,10 @@ const WebResource = msRest.WebResource; * * @param {string} [exampleLabelObject.text] The sample's utterance. * - * @param {array} [exampleLabelObject.entityLabels] The idenfied entities + * @param {array} [exampleLabelObject.entityLabels] The identified entities * within the utterance. * - * @param {string} [exampleLabelObject.intentName] The idenfitied intent + * @param {string} [exampleLabelObject.intentName] The identified intent * representing the utterance. * * @param {object} [options] Optional Parameters. @@ -716,10 +716,10 @@ class Examples { * * @param {string} [exampleLabelObject.text] The sample's utterance. * - * @param {array} [exampleLabelObject.entityLabels] The idenfied entities + * @param {array} [exampleLabelObject.entityLabels] The identified entities * within the utterance. * - * @param {string} [exampleLabelObject.intentName] The idenfitied intent + * @param {string} [exampleLabelObject.intentName] The identified intent * representing the utterance. * * @param {object} [options] Optional Parameters. @@ -759,10 +759,10 @@ class Examples { * * @param {string} [exampleLabelObject.text] The sample's utterance. * - * @param {array} [exampleLabelObject.entityLabels] The idenfied entities + * @param {array} [exampleLabelObject.entityLabels] The identified entities * within the utterance. * - * @param {string} [exampleLabelObject.intentName] The idenfitied intent + * @param {string} [exampleLabelObject.intentName] The identified intent * representing the utterance. * * @param {object} [options] Optional Parameters. diff --git a/lib/services/luis/authoring/lib/operations/index.d.ts b/lib/services/luis/authoring/lib/operations/index.d.ts index 41061b4451..73414afd2f 100644 --- a/lib/services/luis/authoring/lib/operations/index.d.ts +++ b/lib/services/luis/authoring/lib/operations/index.d.ts @@ -524,10 +524,10 @@ export interface Examples { * * @param {string} [exampleLabelObject.text] The sample's utterance. * - * @param {array} [exampleLabelObject.entityLabels] The idenfied entities + * @param {array} [exampleLabelObject.entityLabels] The identified entities * within the utterance. * - * @param {string} [exampleLabelObject.intentName] The idenfitied intent + * @param {string} [exampleLabelObject.intentName] The identified intent * representing the utterance. * * @param {object} [options] Optional Parameters. @@ -555,10 +555,10 @@ export interface Examples { * * @param {string} [exampleLabelObject.text] The sample's utterance. * - * @param {array} [exampleLabelObject.entityLabels] The idenfied entities + * @param {array} [exampleLabelObject.entityLabels] The identified entities * within the utterance. * - * @param {string} [exampleLabelObject.intentName] The idenfitied intent + * @param {string} [exampleLabelObject.intentName] The identified intent * representing the utterance. * * @param {object} [options] Optional Parameters. @@ -8264,7 +8264,7 @@ export interface Apps { /** * Imports an application to LUIS, the application's structure should be - * included in in the request body. + * included in the request body. * * @param {object} luisApp A LUIS application structure. * @@ -8318,7 +8318,7 @@ export interface Apps { /** * Imports an application to LUIS, the application's structure should be - * included in in the request body. + * included in the request body. * * @param {object} luisApp A LUIS application structure. * @@ -8778,6 +8778,9 @@ export interface Apps { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.force] A flag to indicate whether to force an + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8787,7 +8790,7 @@ export interface Apps { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(appId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(appId: string, options?: { force? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * Deletes an application. @@ -8796,6 +8799,9 @@ export interface Apps { * * @param {object} [options] Optional Parameters. * + * @param {boolean} [options.force] A flag to indicate whether to force an + * operation. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8821,9 +8827,9 @@ export interface Apps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(appId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(appId: string, options?: { force? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; deleteMethod(appId: string, callback: ServiceCallback): void; - deleteMethod(appId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(appId: string, options: { force? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -8840,9 +8846,6 @@ export interface Apps { * @param {boolean} [applicationPublishObject.isStaging] Indicates if the * staging slot should be used, instead of the Production one. * - * @param {string} [applicationPublishObject.region] The target region that the - * application is published to. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8870,9 +8873,6 @@ export interface Apps { * @param {boolean} [applicationPublishObject.isStaging] Indicates if the * staging slot should be used, instead of the Production one. * - * @param {string} [applicationPublishObject.region] The target region that the - * application is published to. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9095,7 +9095,7 @@ export interface Apps { * * @param {boolean} [publishSettingUpdateObject.sentimentAnalysis] Setting * sentiment analysis as true returns the Sentiment of the input utterance - * along with the resopnse + * along with the response * * @param {boolean} [publishSettingUpdateObject.speech] Setting speech as * public enables speech priming in your app @@ -9126,7 +9126,7 @@ export interface Apps { * * @param {boolean} [publishSettingUpdateObject.sentimentAnalysis] Setting * sentiment analysis as true returns the Sentiment of the input utterance - * along with the resopnse + * along with the response * * @param {boolean} [publishSettingUpdateObject.speech] Setting speech as * public enables speech priming in your app @@ -9388,6 +9388,134 @@ export interface Apps { listAvailableCustomPrebuiltDomainsForCulture(culture: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; listAvailableCustomPrebuiltDomainsForCulture(culture: string, callback: ServiceCallback): void; listAvailableCustomPrebuiltDomainsForCulture(culture: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary package - Gets published LUIS application package in binary stream + * GZip format + * + * Packages published LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {uuid} slotName The publishing slot name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + packagePublishedApplicationAsGzipWithHttpOperationResponse(appId: string, slotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary package - Gets published LUIS application package in binary stream + * GZip format + * + * Packages published LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {uuid} slotName The publishing slot name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Object} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + packagePublishedApplicationAsGzip(appId: string, slotName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + packagePublishedApplicationAsGzip(appId: string, slotName: string, callback: ServiceCallback): void; + packagePublishedApplicationAsGzip(appId: string, slotName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary package - Gets trained LUIS application package in binary stream + * GZip format + * + * Packages trained LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + packageTrainedApplicationAsGzipWithHttpOperationResponse(appId: string, versionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary package - Gets trained LUIS application package in binary stream + * GZip format + * + * Packages trained LUIS application as GZip. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Object} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + packageTrainedApplicationAsGzip(appId: string, versionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + packageTrainedApplicationAsGzip(appId: string, versionId: string, callback: ServiceCallback): void; + packageTrainedApplicationAsGzip(appId: string, versionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } /** @@ -10942,3 +11070,436 @@ export interface Pattern { getIntentPatterns(appId: string, versionId: string, intentId: string, callback: ServiceCallback): void; getIntentPatterns(appId: string, versionId: string, intentId: string, options: { skip? : number, take? : number, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } + +/** + * @class + * Settings + * __NOTE__: An instance of this class is automatically created for an + * instance of the LUISAuthoringClient. + */ +export interface Settings { + + + /** + * Gets the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(appId: string, versionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Gets the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Array} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(appId: string, versionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(appId: string, versionId: string, callback: ServiceCallback): void; + list(appId: string, versionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * Updates the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} listOfAppVersionSettingObject A list of the updated + * application version settings. + * + * @param {string} [listOfAppVersionSettingObject.name] The application version + * setting name. + * + * @param {string} [listOfAppVersionSettingObject.value] The application + * version setting value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateWithHttpOperationResponse(appId: string, versionId: string, listOfAppVersionSettingObject: models.AppVersionSettingObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * Updates the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} listOfAppVersionSettingObject A list of the updated + * application version settings. + * + * @param {string} [listOfAppVersionSettingObject.name] The application version + * setting name. + * + * @param {string} [listOfAppVersionSettingObject.value] The application + * version setting value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationStatus} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(appId: string, versionId: string, listOfAppVersionSettingObject: models.AppVersionSettingObject, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(appId: string, versionId: string, listOfAppVersionSettingObject: models.AppVersionSettingObject, callback: ServiceCallback): void; + update(appId: string, versionId: string, listOfAppVersionSettingObject: models.AppVersionSettingObject, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * AzureAccounts + * __NOTE__: An instance of this class is automatically created for an + * instance of the LUISAuthoringClient. + */ +export interface AzureAccounts { + + + /** + * @summary apps - Assign a LUIS azure account to an application + * + * Assigns an azure account to the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + assignToAppWithHttpOperationResponse(appId: string, options?: { azureAccountInfoObject? : models.AzureAccountInfoObject, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary apps - Assign a LUIS azure account to an application + * + * Assigns an azure account to the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationStatus} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + assignToApp(appId: string, options?: { azureAccountInfoObject? : models.AzureAccountInfoObject, customHeaders? : { [headerName: string]: string; } }): Promise; + assignToApp(appId: string, callback: ServiceCallback): void; + assignToApp(appId: string, options: { azureAccountInfoObject? : models.AzureAccountInfoObject, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary apps - Get LUIS azure accounts assigned to the application + * + * Gets the LUIS azure accounts assigned to the application for the user using + * his ARM token. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAssignedWithHttpOperationResponse(appId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary apps - Get LUIS azure accounts assigned to the application + * + * Gets the LUIS azure accounts assigned to the application for the user using + * his ARM token. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Array} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAssigned(appId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAssigned(appId: string, callback: ServiceCallback): void; + getAssigned(appId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary apps - Removes an assigned LUIS azure account from an application + * + * Removes assigned azure account from the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + removeFromAppWithHttpOperationResponse(appId: string, options?: { azureAccountInfoObject? : models.AzureAccountInfoObject, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary apps - Removes an assigned LUIS azure account from an application + * + * Removes assigned azure account from the application. + * + * @param {uuid} appId The application ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.azureAccountInfoObject] The azure account + * information object. + * + * @param {string} options.azureAccountInfoObject.azureSubscriptionId The id + * for the azure subscription. + * + * @param {string} options.azureAccountInfoObject.resourceGroup The azure + * resource group name. + * + * @param {string} options.azureAccountInfoObject.accountName The azure account + * name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {OperationStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {OperationStatus} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + removeFromApp(appId: string, options?: { azureAccountInfoObject? : models.AzureAccountInfoObject, customHeaders? : { [headerName: string]: string; } }): Promise; + removeFromApp(appId: string, callback: ServiceCallback): void; + removeFromApp(appId: string, options: { azureAccountInfoObject? : models.AzureAccountInfoObject, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary user - Get LUIS azure accounts + * + * Gets the LUIS azure accounts for the user using his ARM token. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getUserLUISAccountsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary user - Get LUIS azure accounts + * + * Gets the LUIS azure accounts for the user using his ARM token. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Array} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getUserLUISAccounts(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getUserLUISAccounts(callback: ServiceCallback): void; + getUserLUISAccounts(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} diff --git a/lib/services/luis/authoring/lib/operations/index.js b/lib/services/luis/authoring/lib/operations/index.js index ef0073f054..f19b125d25 100644 --- a/lib/services/luis/authoring/lib/operations/index.js +++ b/lib/services/luis/authoring/lib/operations/index.js @@ -22,3 +22,5 @@ exports.Versions = require('./versions'); exports.Train = require('./train'); exports.Permissions = require('./permissions'); exports.Pattern = require('./pattern'); +exports.Settings = require('./settings'); +exports.AzureAccounts = require('./azureAccounts'); diff --git a/lib/services/luis/authoring/lib/operations/settings.js b/lib/services/luis/authoring/lib/operations/settings.js new file mode 100644 index 0000000000..2eef1a6c4a --- /dev/null +++ b/lib/services/luis/authoring/lib/operations/settings.js @@ -0,0 +1,516 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const WebResource = msRest.WebResource; + +/** + * Gets the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(appId, versionId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (versionId === null || versionId === undefined || typeof versionId.valueOf() !== 'string') { + throw new Error('versionId cannot be null or undefined and it must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'apps/{appId}/versions/{versionId}/settings'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + requestUrl = requestUrl.replace('{versionId}', encodeURIComponent(versionId)); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AppVersionSettingObjectElementType', + type: { + name: 'Composite', + className: 'AppVersionSettingObject' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * Updates the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} listOfAppVersionSettingObject A list of the updated + * application version settings. + * + * @param {string} [listOfAppVersionSettingObject.name] The application version + * setting name. + * + * @param {string} [listOfAppVersionSettingObject.value] The application + * version setting value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(appId, versionId, listOfAppVersionSettingObject, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.client.endpoint === null || this.client.endpoint === undefined || typeof this.client.endpoint.valueOf() !== 'string') { + throw new Error('this.client.endpoint cannot be null or undefined and it must be of type string.'); + } + if (appId === null || appId === undefined || typeof appId.valueOf() !== 'string' || !msRest.isValidUuid(appId)) { + throw new Error('appId cannot be null or undefined and it must be of type string and must be a valid uuid.'); + } + if (versionId === null || versionId === undefined || typeof versionId.valueOf() !== 'string') { + throw new Error('versionId cannot be null or undefined and it must be of type string.'); + } + if (listOfAppVersionSettingObject === null || listOfAppVersionSettingObject === undefined) { + throw new Error('listOfAppVersionSettingObject cannot be null or undefined.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'apps/{appId}/versions/{versionId}/settings'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); + requestUrl = requestUrl.replace('{appId}', encodeURIComponent(appId.toString())); + requestUrl = requestUrl.replace('{versionId}', encodeURIComponent(versionId)); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (listOfAppVersionSettingObject !== null && listOfAppVersionSettingObject !== undefined) { + let requestModelMapper = new client.models['AppVersionSettingObject']().mapper(); + requestModel = client.serialize(requestModelMapper, listOfAppVersionSettingObject, 'listOfAppVersionSettingObject'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(listOfAppVersionSettingObject, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['ErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['OperationStatus']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Settings. */ +class Settings { + /** + * Create a Settings. + * @param {LUISAuthoringClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._update = _update; + } + + /** + * Gets the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(appId, versionId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(appId, versionId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Gets the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Array} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(appId, versionId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(appId, versionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(appId, versionId, options, optionalCallback); + } + } + + /** + * Updates the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} listOfAppVersionSettingObject A list of the updated + * application version settings. + * + * @param {string} [listOfAppVersionSettingObject.name] The application version + * setting name. + * + * @param {string} [listOfAppVersionSettingObject.value] The application + * version setting value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(appId, versionId, listOfAppVersionSettingObject, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(appId, versionId, listOfAppVersionSettingObject, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * Updates the application version settings. + * + * @param {uuid} appId The application ID. + * + * @param {string} versionId The version ID. + * + * @param {object} listOfAppVersionSettingObject A list of the updated + * application version settings. + * + * @param {string} [listOfAppVersionSettingObject.name] The application version + * setting name. + * + * @param {string} [listOfAppVersionSettingObject.value] The application + * version setting value. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {OperationStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link OperationStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(appId, versionId, listOfAppVersionSettingObject, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(appId, versionId, listOfAppVersionSettingObject, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(appId, versionId, listOfAppVersionSettingObject, options, optionalCallback); + } + } + +} + +module.exports = Settings; diff --git a/lib/services/luis/authoring/package.json b/lib/services/luis/authoring/package.json index ab44dad38d..f6d456d0d8 100644 --- a/lib/services/luis/authoring/package.json +++ b/lib/services/luis/authoring/package.json @@ -21,4 +21,4 @@ "bugs": { "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}