Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR cognitiveservices/data-plane/LUIS/Authoring/cognitiveservices/data-plane/LUIS/Runtime] Luis swagger fixes #1623

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions packages/@azure/cognitiveservices-luis-authoring/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ npm install @azure/cognitiveservices-luis-authoring

### How to use

#### nodejs - Authentication, client creation and listPhraseLists features as an example written in TypeScript.
#### nodejs - Authentication, client creation and listApplicationVersionPatternFeatures features as an example written in TypeScript.

##### Install @azure/ms-rest-nodeauth

Expand All @@ -33,11 +33,13 @@ const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"];

msRestNodeAuth.interactiveLogin().then((creds) => {
const client = new LUISAuthoringClient(creds, subscriptionId);
const azureRegion = "westus";
const azureCloud = "com";
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) => {
client.features.listApplicationVersionPatternFeatures(azureRegion, azureCloud, appId, versionId, skip, take).then((result) => {
console.log("The result is:");
console.log(result);
});
Expand All @@ -46,7 +48,7 @@ msRestNodeAuth.interactiveLogin().then((creds) => {
});
```

#### browser - Authentication, client creation and listPhraseLists features as an example written in JavaScript.
#### browser - Authentication, client creation and listApplicationVersionPatternFeatures features as an example written in JavaScript.

##### Install @azure/ms-rest-browserauth

Expand Down Expand Up @@ -79,11 +81,13 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
authManager.login();
}
const client = new Azure.CognitiveservicesLuisAuthoring.LUISAuthoringClient(res.creds, subscriptionId);
const azureRegion = "westus";
const azureCloud = "com";
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) => {
client.features.listApplicationVersionPatternFeatures(azureRegion, azureCloud, appId, versionId, skip, take).then((result) => {
console.log("The result is:");
console.log(result);
}).catch((err) => {
Expand All @@ -100,6 +104,3 @@ See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to
## Related projects

- [Microsoft Azure SDK for Javascript](https://github.com/Azure/azure-sdk-for-js)


![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fpackages%2F%40azure%2Fcognitiveservices-luis-authoring%2FREADME.png)
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,11 @@ class LUISAuthoringClient extends LUISAuthoringClientContext {

/**
* Initializes a new instance of the LUISAuthoringClient class.
* @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
* https://westus.api.cognitive.microsoft.com).
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param [options] The parameter options
*/
constructor(endpoint: string, credentials: msRest.ServiceClientCredentials, options?: msRest.ServiceClientOptions) {
super(endpoint, credentials, options);
constructor(credentials: msRest.ServiceClientCredentials, options?: msRest.ServiceClientOptions) {
super(credentials, options);
this.features = new operations.Features(this);
this.examples = new operations.Examples(this);
this.model = new operations.Model(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,31 @@ const packageName = "@azure/cognitiveservices-luis-authoring";
const packageVersion = "2.1.0";

export class LUISAuthoringClientContext extends msRest.ServiceClient {
endpoint: string;
credentials: msRest.ServiceClientCredentials;

/**
* Initializes a new instance of the LUISAuthoringClientContext class.
* @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example:
* https://westus.api.cognitive.microsoft.com).
* @param credentials Subscription credentials which uniquely identify client subscription.
* @param [options] The parameter options
*/
constructor(endpoint: string, credentials: msRest.ServiceClientCredentials, options?: msRest.ServiceClientOptions) {
if (endpoint === null || endpoint === undefined) {
throw new Error('\'endpoint\' cannot be null.');
}
constructor(credentials: msRest.ServiceClientCredentials, options?: msRest.ServiceClientOptions) {
if (credentials === null || credentials === undefined) {
throw new Error('\'credentials\' cannot be null.');
}

if (!options) {
options = {};
}

if (!options.userAgent) {
if(!options.userAgent) {
const defaultUserAgent = msRest.getDefaultUserAgentValue();
options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
}

super(credentials, options);

this.baseUri = "{Endpoint}";
this.baseUri = "http://{AzureRegion}.api.cognitive.microsoft.{AzureCloud}";
this.requestContentType = "application/json; charset=utf-8";
this.endpoint = endpoint;
this.credentials = credentials;

}
}
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
/*
* 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.
*/

export {
ApplicationCreateObject,
ApplicationInfoResponse,
ApplicationPublishObject,
ApplicationSettings,
ApplicationSettingUpdateObject,
ApplicationUpdateObject,
AvailableCulture,
ClosedList,
EndpointInfo,
ErrorResponse,
HierarchicalModel,
JSONEntity,
JSONModelFeature,
JSONRegexFeature,
JSONUtterance,
ApplicationInfoResponse,
LuisApp,
OperationStatus,
HierarchicalModel,
PrebuiltDomainObject,
ClosedList,
SubClosedList,
PatternAny,
RegexEntity,
PrebuiltEntity,
JSONRegexFeature,
JSONModelFeature,
PatternRule,
JSONUtterance,
JSONEntity,
PersonalAssistantsResponse,
PrebuiltDomain,
PrebuiltDomainCreateObject,
PrebuiltDomainItem,
PrebuiltDomainObject,
PrebuiltEntity,
AvailableCulture,
ApplicationUpdateObject,
OperationStatus,
ApplicationPublishObject,
ProductionOrStagingEndpointInfo,
EndpointInfo,
ApplicationSettings,
ApplicationSettingUpdateObject,
PublishSettings,
PublishSettingUpdateObject,
RegexEntity,
SubClosedList,
PrebuiltDomain,
PrebuiltDomainItem,
PrebuiltDomainCreateObject,
SubClosedListResponse
} from "../models/mappers";

Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
/*
* 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.
*/

export {
AzureAccountInfoObject,
ErrorResponse,
OperationStatus
OperationStatus,
ErrorResponse
} from "../models/mappers";

Original file line number Diff line number Diff line change
@@ -1,20 +1,23 @@
/*
* 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.
*/

export {
BatchLabelExample,
EntityLabel,
ExampleLabelObject,
EntityLabelObject,
EntityPrediction,
LabelExampleResponse,
ErrorResponse,
ExampleLabelObject,
IntentPrediction,
BatchLabelExample,
OperationStatus,
LabeledUtterance,
LabelExampleResponse,
OperationStatus
EntityLabel,
IntentPrediction,
EntityPrediction
} from "../models/mappers";

Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
/*
* 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.
*/

export {
ErrorResponse,
FeatureInfoObject,
FeaturesResponseObject,
OperationStatus,
PatternFeatureInfo,
FeatureInfoObject,
ErrorResponse,
PhraselistCreateObject,
PhraseListFeatureInfo,
PhraselistUpdateObject
FeaturesResponseObject,
PhraselistUpdateObject,
OperationStatus
} from "../models/mappers";

Loading