Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

[AutoPR cognitiveservices/data-plane/TextAnalytics] Update CognitiveServices/Text-Analytics Swagger with new /entities endpoint #2818

Merged
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
42 changes: 21 additions & 21 deletions lib/services/textAnalytics/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -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.
79 changes: 79 additions & 0 deletions lib/services/textAnalytics/lib/models/entitiesBatchResult.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/*
* 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 models = require('./index');

/**
* Class representing a EntitiesBatchResult.
*/
class EntitiesBatchResult {
/**
* Create a EntitiesBatchResult.
* @member {array} [documents]
* @member {array} [errors]
*/
constructor() {
}

/**
* Defines the metadata of EntitiesBatchResult
*
* @returns {object} metadata of EntitiesBatchResult
*
*/
mapper() {
return {
required: false,
serializedName: 'EntitiesBatchResult',
type: {
name: 'Composite',
className: 'EntitiesBatchResult',
modelProperties: {
documents: {
required: false,
readOnly: true,
serializedName: 'documents',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'EntitiesBatchResultItemElementType',
type: {
name: 'Composite',
className: 'EntitiesBatchResultItem'
}
}
}
},
errors: {
required: false,
readOnly: true,
serializedName: 'errors',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'ErrorRecordElementType',
type: {
name: 'Composite',
className: 'ErrorRecord'
}
}
}
}
}
}
};
}
}

module.exports = EntitiesBatchResult;
71 changes: 71 additions & 0 deletions lib/services/textAnalytics/lib/models/entitiesBatchResultItem.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
* 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 models = require('./index');

/**
* Class representing a EntitiesBatchResultItem.
*/
class EntitiesBatchResultItem {
/**
* Create a EntitiesBatchResultItem.
* @member {string} [id] Unique document identifier.
* @member {array} [entities] Recognized entities in the document.
*/
constructor() {
}

/**
* Defines the metadata of EntitiesBatchResultItem
*
* @returns {object} metadata of EntitiesBatchResultItem
*
*/
mapper() {
return {
required: false,
serializedName: 'EntitiesBatchResultItem',
type: {
name: 'Composite',
className: 'EntitiesBatchResultItem',
modelProperties: {
id: {
required: false,
readOnly: true,
serializedName: 'id',
type: {
name: 'String'
}
},
entities: {
required: false,
readOnly: true,
serializedName: 'entities',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'EntityRecordElementType',
type: {
name: 'Composite',
className: 'EntityRecord'
}
}
}
}
}
}
};
}
}

module.exports = EntitiesBatchResultItem;
109 changes: 109 additions & 0 deletions lib/services/textAnalytics/lib/models/entityRecord.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/*
* 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 models = require('./index');

/**
* Class representing a EntityRecord.
*/
class EntityRecord {
/**
* Create a EntityRecord.
* @member {string} [name] Entity formal name.
* @member {array} [matches] List of instances this entity appears in the
* text.
* @member {string} [wikipediaLanguage] Wikipedia language for which the
* WikipediaId and WikipediaUrl refers to.
* @member {string} [wikipediaId] Wikipedia unique identifier of the
* recognized entity.
* @member {string} [wikipediaUrl] URL for the entity's English Wikipedia
* page.
* @member {string} [bingId] Bing unique identifier of the recognized entity.
* Use in conjunction with the Bing Entity Search API to fetch additional
* relevant information.
*/
constructor() {
}

/**
* Defines the metadata of EntityRecord
*
* @returns {object} metadata of EntityRecord
*
*/
mapper() {
return {
required: false,
serializedName: 'EntityRecord',
type: {
name: 'Composite',
className: 'EntityRecord',
modelProperties: {
name: {
required: false,
serializedName: 'name',
type: {
name: 'String'
}
},
matches: {
required: false,
readOnly: true,
serializedName: 'matches',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'MatchRecordElementType',
type: {
name: 'Composite',
className: 'MatchRecord'
}
}
}
},
wikipediaLanguage: {
required: false,
serializedName: 'wikipediaLanguage',
type: {
name: 'String'
}
},
wikipediaId: {
required: false,
serializedName: 'wikipediaId',
type: {
name: 'String'
}
},
wikipediaUrl: {
required: false,
readOnly: true,
serializedName: 'wikipediaUrl',
type: {
name: 'String'
}
},
bingId: {
required: false,
serializedName: 'bingId',
type: {
name: 'String'
}
}
}
}
};
}
}

module.exports = EntityRecord;
64 changes: 64 additions & 0 deletions lib/services/textAnalytics/lib/models/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,3 +196,67 @@ export interface SentimentBatchResult {
readonly documents?: SentimentBatchResultItem[];
readonly errors?: ErrorRecord[];
}

/**
* @class
* Initializes a new instance of the MatchRecord class.
* @constructor
* @member {string} [text] Entity text as appears in the request.
* @member {number} [offset] Start position (in Unicode characters) for the
* entity match text.
* @member {number} [length] Length (in Unicode characters) for the entity
* match text.
*/
export interface MatchRecord {
text?: string;
offset?: number;
length?: number;
}

/**
* @class
* Initializes a new instance of the EntityRecord class.
* @constructor
* @member {string} [name] Entity formal name.
* @member {array} [matches] List of instances this entity appears in the text.
* @member {string} [wikipediaLanguage] Wikipedia language for which the
* WikipediaId and WikipediaUrl refers to.
* @member {string} [wikipediaId] Wikipedia unique identifier of the recognized
* entity.
* @member {string} [wikipediaUrl] URL for the entity's English Wikipedia page.
* @member {string} [bingId] Bing unique identifier of the recognized entity.
* Use in conjunction with the Bing Entity Search API to fetch additional
* relevant information.
*/
export interface EntityRecord {
name?: string;
readonly matches?: MatchRecord[];
wikipediaLanguage?: string;
wikipediaId?: string;
readonly wikipediaUrl?: string;
bingId?: string;
}

/**
* @class
* Initializes a new instance of the EntitiesBatchResultItem class.
* @constructor
* @member {string} [id] Unique document identifier.
* @member {array} [entities] Recognized entities in the document.
*/
export interface EntitiesBatchResultItem {
readonly id?: string;
readonly entities?: EntityRecord[];
}

/**
* @class
* Initializes a new instance of the EntitiesBatchResult class.
* @constructor
* @member {array} [documents]
* @member {array} [errors]
*/
export interface EntitiesBatchResult {
readonly documents?: EntitiesBatchResultItem[];
readonly errors?: ErrorRecord[];
}
4 changes: 4 additions & 0 deletions lib/services/textAnalytics/lib/models/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ exports.LanguageBatchResultItem = require('./languageBatchResultItem');
exports.LanguageBatchResult = require('./languageBatchResult');
exports.SentimentBatchResultItem = require('./sentimentBatchResultItem');
exports.SentimentBatchResult = require('./sentimentBatchResult');
exports.MatchRecord = require('./matchRecord');
exports.EntityRecord = require('./entityRecord');
exports.EntitiesBatchResultItem = require('./entitiesBatchResultItem');
exports.EntitiesBatchResult = require('./entitiesBatchResult');
Loading