diff --git a/lib/services/entitySearch/LICENSE.txt b/lib/services/entitySearch/LICENSE.txt index a70e8cf660..5431ba98b9 100644 --- a/lib/services/entitySearch/LICENSE.txt +++ b/lib/services/entitySearch/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/entitySearch/lib/entitySearchAPIClient.d.ts b/lib/services/entitySearch/lib/entitySearchAPIClient.d.ts index b751f36fa1..4994463de1 100644 --- a/lib/services/entitySearch/lib/entitySearchAPIClient.d.ts +++ b/lib/services/entitySearch/lib/entitySearchAPIClient.d.ts @@ -12,6 +12,16 @@ import { ServiceClient, ServiceClientOptions, ServiceClientCredentials } from 'm import * as models from "./models"; import * as operations from "./operations"; +/** + * EntitySearchAPIClientOptions for EntitySearchAPIClient. + */ +declare interface EntitySearchAPIClientOptions extends ServiceClientOptions { + /** + * @property {string} [endpoint] - Supported Cognitive Services endpoints (protocol and hostname, for example: "https://westus.api.cognitive.microsoft.com", "https://api.cognitive.microsoft.com"). + */ + endpoint?: string; +} + export default class EntitySearchAPIClient extends ServiceClient { /** * @class @@ -20,8 +30,6 @@ export default class EntitySearchAPIClient extends ServiceClient { * * @param {credentials} credentials - Subscription credentials which uniquely identify client subscription. * - * @param {string} [baseUri] - The base URI of the service. - * * @param {object} [options] - The parameter options * * @param {Array} [options.filters] - Filters to be added to the request pipeline @@ -31,11 +39,15 @@ export default class EntitySearchAPIClient extends ServiceClient { * * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy * + * @param {string} [options.endpoint] - Supported Cognitive Services endpoints (protocol and hostname, for example: "https://westus.api.cognitive.microsoft.com", "https://api.cognitive.microsoft.com"). + * */ - constructor(credentials: ServiceClientCredentials, baseUri?: string, options?: ServiceClientOptions); + constructor(credentials: ServiceClientCredentials, options?: EntitySearchAPIClientOptions); credentials: ServiceClientCredentials; + endpoint: string; + // Operation groups entitiesOperations: operations.EntitiesOperations; } diff --git a/lib/services/entitySearch/lib/entitySearchAPIClient.js b/lib/services/entitySearch/lib/entitySearchAPIClient.js index 0647127672..2082ab5775 100644 --- a/lib/services/entitySearch/lib/entitySearchAPIClient.js +++ b/lib/services/entitySearch/lib/entitySearchAPIClient.js @@ -26,14 +26,14 @@ class EntitySearchAPIClient extends ServiceClient { /** * Create a EntitySearchAPIClient. * @param {credentials} credentials - Subscription credentials which uniquely identify client subscription. - * @param {string} [baseUri] - The base URI of the service. * @param {object} [options] - The parameter options * @param {Array} [options.filters] - Filters to be added to the request pipeline * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy + * @param {string} [options.endpoint] - Supported Cognitive Services endpoints (protocol and hostname, for example: "https://westus.api.cognitive.microsoft.com", "https://api.cognitive.microsoft.com"). */ - constructor(credentials, baseUri, options) { + constructor(credentials, options) { if (credentials === null || credentials === undefined) { throw new Error('\'credentials\' cannot be null.'); } @@ -42,14 +42,15 @@ class EntitySearchAPIClient extends ServiceClient { super(credentials, options); - this.baseUri = baseUri; - if (!this.baseUri) { - this.baseUri = 'https://api.cognitive.microsoft.com/bing/v7.0'; - } + this.endpoint = 'https://api.cognitive.microsoft.com'; + this.baseUri = '{Endpoint}/bing/v7.0'; this.credentials = credentials; let packageInfo = this.getPackageJsonInfo(__dirname); this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.endpoint !== null && options.endpoint !== undefined) { + this.endpoint = options.endpoint; + } this.entitiesOperations = new operations.EntitiesOperations(this); this.models = models; msRest.addSerializationMixin(this); diff --git a/lib/services/entitySearch/lib/models/airport.js b/lib/services/entitySearch/lib/models/airport.js index 434275f55b..a4ccbf6efd 100644 --- a/lib/services/entitySearch/lib/models/airport.js +++ b/lib/services/entitySearch/lib/models/airport.js @@ -19,8 +19,8 @@ const models = require('./index'); class Airport extends models['CivicStructure'] { /** * Create a Airport. - * @member {string} [iataCode] - * @member {string} [icaoCode] + * @property {string} [iataCode] + * @property {string} [icaoCode] */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/contractualRulesAttribution.js b/lib/services/entitySearch/lib/models/contractualRulesAttribution.js index 2bfa083d1d..d2a92b57b3 100644 --- a/lib/services/entitySearch/lib/models/contractualRulesAttribution.js +++ b/lib/services/entitySearch/lib/models/contractualRulesAttribution.js @@ -19,7 +19,7 @@ const models = require('./index'); class ContractualRulesAttribution extends models['ContractualRulesContractualRule'] { /** * Create a ContractualRulesAttribution. - * @member {boolean} [mustBeCloseToContent] A Boolean value that determines + * @property {boolean} [mustBeCloseToContent] A Boolean value that determines * whether the contents of the rule must be placed in close proximity to the * field that the rule applies to. If true, the contents must be placed in * close proximity. If false, or this field does not exist, the contents may diff --git a/lib/services/entitySearch/lib/models/contractualRulesContractualRule.js b/lib/services/entitySearch/lib/models/contractualRulesContractualRule.js index f382803833..5a3b7529c6 100644 --- a/lib/services/entitySearch/lib/models/contractualRulesContractualRule.js +++ b/lib/services/entitySearch/lib/models/contractualRulesContractualRule.js @@ -16,9 +16,9 @@ class ContractualRulesContractualRule { /** * Create a ContractualRulesContractualRule. - * @member {string} [targetPropertyName] The name of the field that the rule - * applies to. - * @member {string} _type Polymorphic Discriminator + * @property {string} [targetPropertyName] The name of the field that the + * rule applies to. + * @property {string} _type Polymorphic Discriminator */ constructor() { } diff --git a/lib/services/entitySearch/lib/models/contractualRulesLicenseAttribution.js b/lib/services/entitySearch/lib/models/contractualRulesLicenseAttribution.js index b06eb3bf0a..f9a61169ed 100644 --- a/lib/services/entitySearch/lib/models/contractualRulesLicenseAttribution.js +++ b/lib/services/entitySearch/lib/models/contractualRulesLicenseAttribution.js @@ -20,9 +20,9 @@ const models = require('./index'); class ContractualRulesLicenseAttribution extends models['ContractualRulesAttribution'] { /** * Create a ContractualRulesLicenseAttribution. - * @member {object} [license] The license under which the content may be + * @property {object} [license] The license under which the content may be * used. - * @member {string} [licenseNotice] The license to display next to the + * @property {string} [licenseNotice] The license to display next to the * targeted field. */ constructor() { diff --git a/lib/services/entitySearch/lib/models/contractualRulesLinkAttribution.js b/lib/services/entitySearch/lib/models/contractualRulesLinkAttribution.js index 7fa2af515e..bfbac0384b 100644 --- a/lib/services/entitySearch/lib/models/contractualRulesLinkAttribution.js +++ b/lib/services/entitySearch/lib/models/contractualRulesLinkAttribution.js @@ -20,10 +20,10 @@ const models = require('./index'); class ContractualRulesLinkAttribution extends models['ContractualRulesAttribution'] { /** * Create a ContractualRulesLinkAttribution. - * @member {string} text The attribution text. - * @member {string} url The URL to the provider's website. Use text and URL + * @property {string} text The attribution text. + * @property {string} url The URL to the provider's website. Use text and URL * to create the hyperlink. - * @member {boolean} [optionalForListDisplay] Indicates whether this + * @property {boolean} [optionalForListDisplay] Indicates whether this * provider's attribution is optional. */ constructor() { diff --git a/lib/services/entitySearch/lib/models/contractualRulesMediaAttribution.js b/lib/services/entitySearch/lib/models/contractualRulesMediaAttribution.js index d38051203e..59dca5082a 100644 --- a/lib/services/entitySearch/lib/models/contractualRulesMediaAttribution.js +++ b/lib/services/entitySearch/lib/models/contractualRulesMediaAttribution.js @@ -20,9 +20,9 @@ const models = require('./index'); class ContractualRulesMediaAttribution extends models['ContractualRulesAttribution'] { /** * Create a ContractualRulesMediaAttribution. - * @member {string} [url] The URL that you use to create of hyperlink of the - * media content. For example, if the target is an image, you would use the - * URL to make the image clickable. + * @property {string} [url] The URL that you use to create of hyperlink of + * the media content. For example, if the target is an image, you would use + * the URL to make the image clickable. */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/contractualRulesTextAttribution.js b/lib/services/entitySearch/lib/models/contractualRulesTextAttribution.js index 951d755349..214877aa8d 100644 --- a/lib/services/entitySearch/lib/models/contractualRulesTextAttribution.js +++ b/lib/services/entitySearch/lib/models/contractualRulesTextAttribution.js @@ -20,12 +20,12 @@ const models = require('./index'); class ContractualRulesTextAttribution extends models['ContractualRulesAttribution'] { /** * Create a ContractualRulesTextAttribution. - * @member {string} text The attribution text. Text attribution applies to + * @property {string} text The attribution text. Text attribution applies to * the entity as a whole and should be displayed immediately following the * entity presentation. If there are multiple text or link attribution rules * that do not specify a target, you should concatenate them and display them * using a "Data from:" label. - * @member {boolean} [optionalForListDisplay] Indicates whether this + * @property {boolean} [optionalForListDisplay] Indicates whether this * provider's attribution is optional. */ constructor() { diff --git a/lib/services/entitySearch/lib/models/creativeWork.js b/lib/services/entitySearch/lib/models/creativeWork.js index 8baab03de7..1c0749c4e2 100644 --- a/lib/services/entitySearch/lib/models/creativeWork.js +++ b/lib/services/entitySearch/lib/models/creativeWork.js @@ -19,9 +19,9 @@ const models = require('./index'); class CreativeWork extends models['Thing'] { /** * Create a CreativeWork. - * @member {string} [thumbnailUrl] The URL to a thumbnail of the item. - * @member {array} [provider] The source of the creative work. - * @member {string} [text] + * @property {string} [thumbnailUrl] The URL to a thumbnail of the item. + * @property {array} [provider] The source of the creative work. + * @property {string} [text] */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/entities.js b/lib/services/entitySearch/lib/models/entities.js index eecd0043bb..81e9c87bcb 100644 --- a/lib/services/entitySearch/lib/models/entities.js +++ b/lib/services/entitySearch/lib/models/entities.js @@ -20,8 +20,8 @@ const models = require('./index'); class Entities extends models['SearchResultsAnswer'] { /** * Create a Entities. - * @member {string} [queryScenario] The supported query scenario. This field - * is set to DominantEntity or DisambiguationItem. The field is set to + * @property {string} [queryScenario] The supported query scenario. This + * field is set to DominantEntity or DisambiguationItem. The field is set to * DominantEntity if Bing determines that only a single entity satisfies the * request. For example, a book, movie, person, or attraction. If multiple * entities could satisfy the request, the field is set to @@ -31,7 +31,7 @@ class Entities extends models['SearchResultsAnswer'] { * entity's type would likely be DominantEntity. Possible values include: * 'DominantEntity', 'DominantEntityWithDisambiguation', 'Disambiguation', * 'List', 'ListWithPivot'. Default value: 'DominantEntity' . - * @member {array} value A list of entities. + * @property {array} value A list of entities. */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/entitiesEntityPresentationInfo.js b/lib/services/entitySearch/lib/models/entitiesEntityPresentationInfo.js index de6ba61119..e4a03abf33 100644 --- a/lib/services/entitySearch/lib/models/entitiesEntityPresentationInfo.js +++ b/lib/services/entitySearch/lib/models/entitiesEntityPresentationInfo.js @@ -17,14 +17,14 @@ class EntitiesEntityPresentationInfo { /** * Create a EntitiesEntityPresentationInfo. - * @member {string} entityScenario The supported scenario. Possible values + * @property {string} entityScenario The supported scenario. Possible values * include: 'DominantEntity', 'DisambiguationItem', 'ListItem'. Default * value: 'DominantEntity' . - * @member {array} [entityTypeHints] A list of hints that indicate the + * @property {array} [entityTypeHints] A list of hints that indicate the * entity's type. The list could contain a single hint such as Movie or a * list of hints such as Place, LocalBusiness, Restaurant. Each successive * hint in the array narrows the entity's type. - * @member {string} [entityTypeDisplayHint] A display version of the entity + * @property {string} [entityTypeDisplayHint] A display version of the entity * hint. For example, if entityTypeHints is Artist, this field may be set to * American Singer. */ @@ -61,7 +61,7 @@ class EntitiesEntityPresentationInfo { name: 'Sequence', element: { required: false, - serializedName: 'StringElementType', + serializedName: 'EntityTypeElementType', type: { name: 'String' } diff --git a/lib/services/entitySearch/lib/models/errorModel.js b/lib/services/entitySearch/lib/models/errorModel.js index 29a10321dd..d827e4885e 100644 --- a/lib/services/entitySearch/lib/models/errorModel.js +++ b/lib/services/entitySearch/lib/models/errorModel.js @@ -17,22 +17,22 @@ class ErrorModel { /** * Create a ErrorModel. - * @member {string} code The error code that identifies the category of + * @property {string} code The error code that identifies the category of * error. Possible values include: 'None', 'ServerError', 'InvalidRequest', * 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. * Default value: 'None' . - * @member {string} [subCode] The error code that further helps to identify + * @property {string} [subCode] The error code that further helps to identify * the error. Possible values include: 'UnexpectedError', 'ResourceError', * 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', * 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', * 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' - * @member {string} message A description of the error. - * @member {string} [moreDetails] A description that provides additional + * @property {string} message A description of the error. + * @property {string} [moreDetails] A description that provides additional * information about the error. - * @member {string} [parameter] The parameter in the request that caused the - * error. - * @member {string} [value] The parameter's value in the request that was not - * valid. + * @property {string} [parameter] The parameter in the request that caused + * the error. + * @property {string} [value] The parameter's value in the request that was + * not valid. */ constructor() { } diff --git a/lib/services/entitySearch/lib/models/errorResponse.js b/lib/services/entitySearch/lib/models/errorResponse.js index 2dd0874c95..cea5452827 100644 --- a/lib/services/entitySearch/lib/models/errorResponse.js +++ b/lib/services/entitySearch/lib/models/errorResponse.js @@ -20,8 +20,8 @@ const models = require('./index'); class ErrorResponse extends models['Response'] { /** * Create a ErrorResponse. - * @member {array} errors A list of errors that describe the reasons why the - * request failed. + * @property {array} errors A list of errors that describe the reasons why + * the request failed. */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/hotel.js b/lib/services/entitySearch/lib/models/hotel.js index 17235ec10e..d9e3e9bcba 100644 --- a/lib/services/entitySearch/lib/models/hotel.js +++ b/lib/services/entitySearch/lib/models/hotel.js @@ -19,8 +19,8 @@ const models = require('./index'); class Hotel extends models['LodgingBusiness'] { /** * Create a Hotel. - * @member {string} [hotelClass] - * @member {array} [amenities] + * @property {string} [hotelClass] + * @property {array} [amenities] */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/identifiable.js b/lib/services/entitySearch/lib/models/identifiable.js index 6cc9e3d679..51ceb85de4 100644 --- a/lib/services/entitySearch/lib/models/identifiable.js +++ b/lib/services/entitySearch/lib/models/identifiable.js @@ -20,7 +20,7 @@ const models = require('./index'); class Identifiable extends models['ResponseBase'] { /** * Create a Identifiable. - * @member {string} [id] A String identifier. + * @property {string} [id] A String identifier. */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/imageObject.js b/lib/services/entitySearch/lib/models/imageObject.js index 4116d70049..f2367c9a7d 100644 --- a/lib/services/entitySearch/lib/models/imageObject.js +++ b/lib/services/entitySearch/lib/models/imageObject.js @@ -20,7 +20,7 @@ const models = require('./index'); class ImageObject extends models['MediaObject'] { /** * Create a ImageObject. - * @member {object} [thumbnail] The URL to a thumbnail of the image + * @property {object} [thumbnail] The URL to a thumbnail of the image */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/index.d.ts b/lib/services/entitySearch/lib/models/index.d.ts index 75e4afd2d1..d77e246c31 100644 --- a/lib/services/entitySearch/lib/models/index.d.ts +++ b/lib/services/entitySearch/lib/models/index.d.ts @@ -1,675 +1,467 @@ /* * 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 QueryContext class. - * @constructor * Defines the query context that Bing used for the request. - * - * @member {string} originalQuery The query string as specified in the request. - * @member {string} [alteredQuery] The query string used by Bing to perform the - * query. Bing uses the altered query string if the original query string - * contained spelling mistakes. For example, if the query string is "saling - * downwind", the altered query string will be "sailing downwind". This field - * is included only if the original query string contains a spelling mistake. - * @member {string} [alterationOverrideQuery] The query string to use to force - * Bing to use the original string. For example, if the query string is "saling - * downwind", the override query string will be "+saling downwind". Remember to - * encode the query string which results in "%2Bsaling+downwind". This field is - * included only if the original query string contains a spelling mistake. - * @member {boolean} [adultIntent] A Boolean value that indicates whether the - * specified query has adult intent. The value is true if the query has adult - * intent; otherwise, false. - * @member {boolean} [askUserForLocation] A Boolean value that indicates - * whether Bing requires the user's location to provide accurate results. If - * you specified the user's location by using the X-MSEdge-ClientIP and - * X-Search-Location headers, you can ignore this field. For location aware - * queries, such as "today's weather" or "restaurants near me" that need the - * user's location to provide accurate results, this field is set to true. For - * location aware queries that include the location (for example, "Seattle - * weather"), this field is set to false. This field is also set to false for - * queries that are not location aware, such as "best sellers". */ export interface QueryContext { + /** + * The query string as specified in the request. + */ originalQuery: string; + /** + * The query string used by Bing to perform the query. Bing uses the altered query string if the + * original query string contained spelling mistakes. For example, if the query string is "saling + * downwind", the altered query string will be "sailing downwind". This field is included only if + * the original query string contains a spelling mistake. + */ readonly alteredQuery?: string; + /** + * The query string to use to force Bing to use the original string. For example, if the query + * string is "saling downwind", the override query string will be "+saling downwind". Remember to + * encode the query string which results in "%2Bsaling+downwind". This field is included only if + * the original query string contains a spelling mistake. + */ readonly alterationOverrideQuery?: string; + /** + * A Boolean value that indicates whether the specified query has adult intent. The value is true + * if the query has adult intent; otherwise, false. + */ readonly adultIntent?: boolean; + /** + * A Boolean value that indicates whether Bing requires the user's location to provide accurate + * results. If you specified the user's location by using the X-MSEdge-ClientIP and + * X-Search-Location headers, you can ignore this field. For location aware queries, such as + * "today's weather" or "restaurants near me" that need the user's location to provide accurate + * results, this field is set to true. For location aware queries that include the location (for + * example, "Seattle weather"), this field is set to false. This field is also set to false for + * queries that are not location aware, such as "best sellers". + */ readonly askUserForLocation?: boolean; } -/** - * @class - * Initializes a new instance of the ResponseBase class. - * @constructor - * @member {string} _type Polymorphic Discriminator - */ export interface ResponseBase { + /** + * Polymorphic Discriminator + */ _type: string; } /** - * @class - * Initializes a new instance of the Identifiable class. - * @constructor * Defines the identity of a resource. - * - * @member {string} [id] A String identifier. - */ +*/ export interface Identifiable extends ResponseBase { + /** + * A String identifier. + */ readonly id?: string; } /** - * @class - * Initializes a new instance of the Response class. - * @constructor - * Defines a response. All schemas that could be returned at the root of a - * response should inherit from this - * - * @member {array} [contractualRules] A list of rules that you must adhere to - * if you display the item. - * @member {string} [webSearchUrl] The URL To Bing's search result for this - * item. - */ + * Defines a response. All schemas that could be returned at the root of a response should inherit + * from this +*/ export interface Response extends Identifiable { + /** + * A list of rules that you must adhere to if you display the item. + */ readonly contractualRules?: ContractualRulesContractualRule[]; + /** + * The URL To Bing's search result for this item. + */ readonly webSearchUrl?: string; } -/** - * @class - * Initializes a new instance of the Thing class. - * @constructor - * @member {string} [name] The name of the thing represented by this object. - * @member {string} [url] The URL to get more information about the thing - * represented by this object. - * @member {object} [image] - * @member {object} [image.thumbnail] The URL to a thumbnail of the image - * @member {string} [description] A short description of the item. - * @member {object} [entityPresentationInfo] Additional information about the - * entity such as hints that you can use to determine the entity's type. To - * determine the entity's type, use the entityScenario and entityTypeHint - * fields. - * @member {string} [entityPresentationInfo.entityScenario] The supported - * scenario. Possible values include: 'DominantEntity', 'DisambiguationItem', - * 'ListItem' - * @member {array} [entityPresentationInfo.entityTypeHints] A list of hints - * that indicate the entity's type. The list could contain a single hint such - * as Movie or a list of hints such as Place, LocalBusiness, Restaurant. Each - * successive hint in the array narrows the entity's type. - * @member {string} [entityPresentationInfo.entityTypeDisplayHint] A display - * version of the entity hint. For example, if entityTypeHints is Artist, this - * field may be set to American Singer. - * @member {string} [bingId] An ID that uniquely identifies this item. - */ export interface Thing extends Response { + /** + * The name of the thing represented by this object. + */ readonly name?: string; + /** + * The URL to get more information about the thing represented by this object. + */ readonly url?: string; readonly image?: ImageObject; + /** + * A short description of the item. + */ readonly description?: string; + /** + * Additional information about the entity such as hints that you can use to determine the + * entity's type. To determine the entity's type, use the entityScenario and entityTypeHint + * fields. + */ readonly entityPresentationInfo?: EntitiesEntityPresentationInfo; + /** + * An ID that uniquely identifies this item. + */ readonly bingId?: string; } -/** - * @class - * Initializes a new instance of the CreativeWork class. - * @constructor - * @member {string} [thumbnailUrl] The URL to a thumbnail of the item. - * @member {array} [provider] The source of the creative work. - * @member {string} [text] - */ export interface CreativeWork extends Thing { + /** + * The URL to a thumbnail of the item. + */ readonly thumbnailUrl?: string; + /** + * The source of the creative work. + */ readonly provider?: Thing[]; readonly text?: string; } -/** - * @class - * Initializes a new instance of the MediaObject class. - * @constructor - * @member {string} [contentUrl] Original URL to retrieve the source (file) for - * the media object (e.g the source URL for the image). - * @member {string} [hostPageUrl] URL of the page that hosts the media object. - * @member {number} [width] The width of the source media object, in pixels. - * @member {number} [height] The height of the source media object, in pixels. - */ export interface MediaObject extends CreativeWork { + /** + * Original URL to retrieve the source (file) for the media object (e.g the source URL for the + * image). + */ readonly contentUrl?: string; + /** + * URL of the page that hosts the media object. + */ readonly hostPageUrl?: string; + /** + * The width of the source media object, in pixels. + */ readonly width?: number; + /** + * The height of the source media object, in pixels. + */ readonly height?: number; } /** - * @class - * Initializes a new instance of the ImageObject class. - * @constructor * Defines an image - * - * @member {object} [thumbnail] The URL to a thumbnail of the image - */ +*/ export interface ImageObject extends MediaObject { + /** + * The URL to a thumbnail of the image + */ readonly thumbnail?: ImageObject; } /** - * @class - * Initializes a new instance of the EntitiesEntityPresentationInfo class. - * @constructor * Defines additional information about an entity such as type hints. - * - * @member {string} entityScenario The supported scenario. Possible values - * include: 'DominantEntity', 'DisambiguationItem', 'ListItem'. Default value: - * 'DominantEntity' . - * @member {array} [entityTypeHints] A list of hints that indicate the entity's - * type. The list could contain a single hint such as Movie or a list of hints - * such as Place, LocalBusiness, Restaurant. Each successive hint in the array - * narrows the entity's type. - * @member {string} [entityTypeDisplayHint] A display version of the entity - * hint. For example, if entityTypeHints is Artist, this field may be set to - * American Singer. - */ +*/ export interface EntitiesEntityPresentationInfo { + /** + * The supported scenario. Possible values include: 'DominantEntity', 'DisambiguationItem', + * 'ListItem' + */ entityScenario: string; + /** + * A list of hints that indicate the entity's type. The list could contain a single hint such as + * Movie or a list of hints such as Place, LocalBusiness, Restaurant. Each successive hint in the + * array narrows the entity's type. + */ readonly entityTypeHints?: string[]; + /** + * A display version of the entity hint. For example, if entityTypeHints is Artist, this field + * may be set to American Singer. + */ readonly entityTypeDisplayHint?: string; } -/** - * @class - * Initializes a new instance of the Answer class. - * @constructor - */ export interface Answer extends Response { } -/** - * @class - * Initializes a new instance of the SearchResultsAnswer class. - * @constructor - * @member {object} [queryContext] - * @member {string} [queryContext.originalQuery] The query string as specified - * in the request. - * @member {string} [queryContext.alteredQuery] The query string used by Bing - * to perform the query. Bing uses the altered query string if the original - * query string contained spelling mistakes. For example, if the query string - * is "saling downwind", the altered query string will be "sailing downwind". - * This field is included only if the original query string contains a spelling - * mistake. - * @member {string} [queryContext.alterationOverrideQuery] The query string to - * use to force Bing to use the original string. For example, if the query - * string is "saling downwind", the override query string will be "+saling - * downwind". Remember to encode the query string which results in - * "%2Bsaling+downwind". This field is included only if the original query - * string contains a spelling mistake. - * @member {boolean} [queryContext.adultIntent] A Boolean value that indicates - * whether the specified query has adult intent. The value is true if the query - * has adult intent; otherwise, false. - * @member {boolean} [queryContext.askUserForLocation] A Boolean value that - * indicates whether Bing requires the user's location to provide accurate - * results. If you specified the user's location by using the X-MSEdge-ClientIP - * and X-Search-Location headers, you can ignore this field. For location aware - * queries, such as "today's weather" or "restaurants near me" that need the - * user's location to provide accurate results, this field is set to true. For - * location aware queries that include the location (for example, "Seattle - * weather"), this field is set to false. This field is also set to false for - * queries that are not location aware, such as "best sellers". - */ export interface SearchResultsAnswer extends Answer { readonly queryContext?: QueryContext; } /** - * @class - * Initializes a new instance of the Entities class. - * @constructor * Defines an entity answer. - * - * @member {string} [queryScenario] The supported query scenario. This field is - * set to DominantEntity or DisambiguationItem. The field is set to - * DominantEntity if Bing determines that only a single entity satisfies the - * request. For example, a book, movie, person, or attraction. If multiple - * entities could satisfy the request, the field is set to DisambiguationItem. - * For example, if the request uses the generic title of a movie franchise, the - * entity's type would likely be DisambiguationItem. But, if the request - * specifies a specific title from the franchise, the entity's type would - * likely be DominantEntity. Possible values include: 'DominantEntity', - * 'DominantEntityWithDisambiguation', 'Disambiguation', 'List', - * 'ListWithPivot'. Default value: 'DominantEntity' . - * @member {array} value A list of entities. - */ +*/ export interface Entities extends SearchResultsAnswer { + /** + * The supported query scenario. This field is set to DominantEntity or DisambiguationItem. The + * field is set to DominantEntity if Bing determines that only a single entity satisfies the + * request. For example, a book, movie, person, or attraction. If multiple entities could satisfy + * the request, the field is set to DisambiguationItem. For example, if the request uses the + * generic title of a movie franchise, the entity's type would likely be DisambiguationItem. But, + * if the request specifies a specific title from the franchise, the entity's type would likely + * be DominantEntity. Possible values include: 'DominantEntity', + * 'DominantEntityWithDisambiguation', 'Disambiguation', 'List', 'ListWithPivot' + */ readonly queryScenario?: string; + /** + * A list of entities. + */ value: Thing[]; } /** - * @class - * Initializes a new instance of the Places class. - * @constructor * Defines a local entity answer. - * - * @member {array} value A list of local entities, such as restaurants or - * hotels. - */ +*/ export interface Places extends SearchResultsAnswer { + /** + * A list of local entities, such as restaurants or hotels. + */ value: Thing[]; } /** - * @class - * Initializes a new instance of the SearchResponse class. - * @constructor - * Defines the top-level object that the response includes when the request - * succeeds. - * - * @member {object} [queryContext] An object that contains the query string - * that Bing used for the request. This object contains the query string as - * entered by the user. It may also contain an altered query string that Bing - * used for the query if the query string contained a spelling mistake. - * @member {string} [queryContext.originalQuery] The query string as specified - * in the request. - * @member {string} [queryContext.alteredQuery] The query string used by Bing - * to perform the query. Bing uses the altered query string if the original - * query string contained spelling mistakes. For example, if the query string - * is "saling downwind", the altered query string will be "sailing downwind". - * This field is included only if the original query string contains a spelling - * mistake. - * @member {string} [queryContext.alterationOverrideQuery] The query string to - * use to force Bing to use the original string. For example, if the query - * string is "saling downwind", the override query string will be "+saling - * downwind". Remember to encode the query string which results in - * "%2Bsaling+downwind". This field is included only if the original query - * string contains a spelling mistake. - * @member {boolean} [queryContext.adultIntent] A Boolean value that indicates - * whether the specified query has adult intent. The value is true if the query - * has adult intent; otherwise, false. - * @member {boolean} [queryContext.askUserForLocation] A Boolean value that - * indicates whether Bing requires the user's location to provide accurate - * results. If you specified the user's location by using the X-MSEdge-ClientIP - * and X-Search-Location headers, you can ignore this field. For location aware - * queries, such as "today's weather" or "restaurants near me" that need the - * user's location to provide accurate results, this field is set to true. For - * location aware queries that include the location (for example, "Seattle - * weather"), this field is set to false. This field is also set to false for - * queries that are not location aware, such as "best sellers". - * @member {object} [entities] A list of entities that are relevant to the - * search query. - * @member {string} [entities.queryScenario] The supported query scenario. This - * field is set to DominantEntity or DisambiguationItem. The field is set to - * DominantEntity if Bing determines that only a single entity satisfies the - * request. For example, a book, movie, person, or attraction. If multiple - * entities could satisfy the request, the field is set to DisambiguationItem. - * For example, if the request uses the generic title of a movie franchise, the - * entity's type would likely be DisambiguationItem. But, if the request - * specifies a specific title from the franchise, the entity's type would - * likely be DominantEntity. Possible values include: 'DominantEntity', - * 'DominantEntityWithDisambiguation', 'Disambiguation', 'List', - * 'ListWithPivot' - * @member {array} [entities.value] A list of entities. - * @member {object} [places] A list of local entities such as restaurants or - * hotels that are relevant to the query. - * @member {array} [places.value] A list of local entities, such as restaurants - * or hotels. - */ + * Defines the top-level object that the response includes when the request succeeds. +*/ export interface SearchResponse extends Response { + /** + * An object that contains the query string that Bing used for the request. This object contains + * the query string as entered by the user. It may also contain an altered query string that Bing + * used for the query if the query string contained a spelling mistake. + */ readonly queryContext?: QueryContext; + /** + * A list of entities that are relevant to the search query. + */ readonly entities?: Entities; + /** + * A list of local entities such as restaurants or hotels that are relevant to the query. + */ readonly places?: Places; } -/** - * @class - * Initializes a new instance of the ContractualRulesContractualRule class. - * @constructor - * @member {string} [targetPropertyName] The name of the field that the rule - * applies to. - * @member {string} _type Polymorphic Discriminator - */ export interface ContractualRulesContractualRule { + /** + * The name of the field that the rule applies to. + */ readonly targetPropertyName?: string; + /** + * Polymorphic Discriminator + */ _type: string; } /** - * @class - * Initializes a new instance of the ErrorModel class. - * @constructor * Defines the error that occurred. - * - * @member {string} code The error code that identifies the category of error. - * Possible values include: 'None', 'ServerError', 'InvalidRequest', - * 'RateLimitExceeded', 'InvalidAuthorization', 'InsufficientAuthorization'. - * Default value: 'None' . - * @member {string} [subCode] The error code that further helps to identify the - * error. Possible values include: 'UnexpectedError', 'ResourceError', - * 'NotImplemented', 'ParameterMissing', 'ParameterInvalidValue', - * 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', - * 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' - * @member {string} message A description of the error. - * @member {string} [moreDetails] A description that provides additional - * information about the error. - * @member {string} [parameter] The parameter in the request that caused the - * error. - * @member {string} [value] The parameter's value in the request that was not - * valid. - */ +*/ export interface ErrorModel { + /** + * The error code that identifies the category of error. Possible values include: 'None', + * 'ServerError', 'InvalidRequest', 'RateLimitExceeded', 'InvalidAuthorization', + * 'InsufficientAuthorization' + */ code: string; + /** + * The error code that further helps to identify the error. Possible values include: + * 'UnexpectedError', 'ResourceError', 'NotImplemented', 'ParameterMissing', + * 'ParameterInvalidValue', 'HttpNotAllowed', 'Blocked', 'AuthorizationMissing', + * 'AuthorizationRedundancy', 'AuthorizationDisabled', 'AuthorizationExpired' + */ readonly subCode?: string; + /** + * A description of the error. + */ message: string; + /** + * A description that provides additional information about the error. + */ readonly moreDetails?: string; + /** + * The parameter in the request that caused the error. + */ readonly parameter?: string; + /** + * The parameter's value in the request that was not valid. + */ readonly value?: string; } /** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor * The top-level response that represents a failed request. - * - * @member {array} errors A list of errors that describe the reasons why the - * request failed. - */ +*/ export interface ErrorResponse extends Response { + /** + * A list of errors that describe the reasons why the request failed. + */ errors: ErrorModel[]; } -/** - * @class - * Initializes a new instance of the Intangible class. - * @constructor - */ export interface Intangible extends Thing { } -/** - * @class - * Initializes a new instance of the StructuredValue class. - * @constructor - */ export interface StructuredValue extends Intangible { } /** - * @class - * Initializes a new instance of the PostalAddress class. - * @constructor * Defines a postal address. - * - * @member {string} [streetAddress] - * @member {string} [addressLocality] The city where the street address is - * located. For example, Seattle. - * @member {string} [addressSubregion] - * @member {string} [addressRegion] The state or province code where the street - * address is located. This could be the two-letter code. For example, WA, or - * the full name , Washington. - * @member {string} [postalCode] The zip code or postal code where the street - * address is located. For example, 98052. - * @member {string} [postOfficeBoxNumber] - * @member {string} [addressCountry] The country/region where the street - * address is located. This could be the two-letter ISO code. For example, US, - * or the full name, United States. - * @member {string} [countryIso] The two letter ISO code of this countr. For - * example, US. - * @member {string} [neighborhood] The neighborhood where the street address is - * located. For example, Westlake. - * @member {string} [addressRegionAbbreviation] Region Abbreviation. For - * example, WA. - * @member {string} [text] The complete address. For example, 2100 Westlake Ave - * N, Bellevue, WA 98052. - */ +*/ export interface PostalAddress extends StructuredValue { readonly streetAddress?: string; + /** + * The city where the street address is located. For example, Seattle. + */ readonly addressLocality?: string; readonly addressSubregion?: string; + /** + * The state or province code where the street address is located. This could be the two-letter + * code. For example, WA, or the full name , Washington. + */ readonly addressRegion?: string; + /** + * The zip code or postal code where the street address is located. For example, 98052. + */ readonly postalCode?: string; readonly postOfficeBoxNumber?: string; + /** + * The country/region where the street address is located. This could be the two-letter ISO code. + * For example, US, or the full name, United States. + */ readonly addressCountry?: string; + /** + * The two letter ISO code of this country. For example, US. + */ readonly countryIso?: string; + /** + * The neighborhood where the street address is located. For example, Westlake. + */ readonly neighborhood?: string; + /** + * Region Abbreviation. For example, WA. + */ readonly addressRegionAbbreviation?: string; + /** + * The complete address. For example, 2100 Westlake Ave N, Bellevue, WA 98052. + */ readonly text?: string; } /** - * @class - * Initializes a new instance of the Place class. - * @constructor * Defines information about a local entity, such as a restaurant or hotel. - * - * @member {object} [address] The postal address of where the entity is located - * @member {string} [address.streetAddress] - * @member {string} [address.addressLocality] The city where the street address - * is located. For example, Seattle. - * @member {string} [address.addressSubregion] - * @member {string} [address.addressRegion] The state or province code where - * the street address is located. This could be the two-letter code. For - * example, WA, or the full name , Washington. - * @member {string} [address.postalCode] The zip code or postal code where the - * street address is located. For example, 98052. - * @member {string} [address.postOfficeBoxNumber] - * @member {string} [address.addressCountry] The country/region where the - * street address is located. This could be the two-letter ISO code. For - * example, US, or the full name, United States. - * @member {string} [address.countryIso] The two letter ISO code of this - * countr. For example, US. - * @member {string} [address.neighborhood] The neighborhood where the street - * address is located. For example, Westlake. - * @member {string} [address.addressRegionAbbreviation] Region Abbreviation. - * For example, WA. - * @member {string} [address.text] The complete address. For example, 2100 - * Westlake Ave N, Bellevue, WA 98052. - * @member {string} [telephone] The entity's telephone number - */ +*/ export interface Place extends Thing { + /** + * The postal address of where the entity is located + */ readonly address?: PostalAddress; + /** + * The entity's telephone number + */ readonly telephone?: string; } /** - * @class - * Initializes a new instance of the Organization class. - * @constructor * Defines an organization. - * - */ +*/ export interface Organization extends Thing { } -/** - * @class - * Initializes a new instance of the LocalBusiness class. - * @constructor - * @member {string} [priceRange] $$. - * @member {array} [panoramas] - * @member {boolean} [isPermanentlyClosed] - * @member {string} [tagLine] - */ export interface LocalBusiness extends Place { + /** + * $$. + */ readonly priceRange?: string; readonly panoramas?: ImageObject[]; readonly isPermanentlyClosed?: boolean; readonly tagLine?: string; } -/** - * @class - * Initializes a new instance of the EntertainmentBusiness class. - * @constructor - */ export interface EntertainmentBusiness extends LocalBusiness { } -/** - * @class - * Initializes a new instance of the MovieTheater class. - * @constructor - * @member {number} [screenCount] - */ export interface MovieTheater extends EntertainmentBusiness { readonly screenCount?: number; } -/** - * @class - * Initializes a new instance of the ContractualRulesAttribution class. - * @constructor - * @member {boolean} [mustBeCloseToContent] A Boolean value that determines - * whether the contents of the rule must be placed in close proximity to the - * field that the rule applies to. If true, the contents must be placed in - * close proximity. If false, or this field does not exist, the contents may be - * placed at the caller's discretion. - */ export interface ContractualRulesAttribution extends ContractualRulesContractualRule { + /** + * A Boolean value that determines whether the contents of the rule must be placed in close + * proximity to the field that the rule applies to. If true, the contents must be placed in close + * proximity. If false, or this field does not exist, the contents may be placed at the caller's + * discretion. + */ readonly mustBeCloseToContent?: boolean; } -/** - * @class - * Initializes a new instance of the CivicStructure class. - * @constructor - */ export interface CivicStructure extends Place { } -/** - * @class - * Initializes a new instance of the TouristAttraction class. - * @constructor - */ export interface TouristAttraction extends Place { } -/** - * @class - * Initializes a new instance of the Airport class. - * @constructor - * @member {string} [iataCode] - * @member {string} [icaoCode] - */ export interface Airport extends CivicStructure { readonly iataCode?: string; readonly icaoCode?: string; } /** - * @class - * Initializes a new instance of the License class. - * @constructor * Defines the license under which the text or photo may be used. - * - */ +*/ export interface License extends CreativeWork { } /** - * @class - * Initializes a new instance of the ContractualRulesLicenseAttribution class. - * @constructor * Defines a contractual rule for license attribution. - * - * @member {object} [license] The license under which the content may be used. - * @member {string} [licenseNotice] The license to display next to the targeted - * field. - */ +*/ export interface ContractualRulesLicenseAttribution extends ContractualRulesAttribution { + /** + * The license under which the content may be used. + */ readonly license?: License; + /** + * The license to display next to the targeted field. + */ readonly licenseNotice?: string; } /** - * @class - * Initializes a new instance of the ContractualRulesLinkAttribution class. - * @constructor * Defines a contractual rule for link attribution. - * - * @member {string} text The attribution text. - * @member {string} url The URL to the provider's website. Use text and URL to - * create the hyperlink. - * @member {boolean} [optionalForListDisplay] Indicates whether this provider's - * attribution is optional. - */ +*/ export interface ContractualRulesLinkAttribution extends ContractualRulesAttribution { + /** + * The attribution text. + */ text: string; + /** + * The URL to the provider's website. Use text and URL to create the hyperlink. + */ url: string; + /** + * Indicates whether this provider's attribution is optional. + */ readonly optionalForListDisplay?: boolean; } /** - * @class - * Initializes a new instance of the ContractualRulesMediaAttribution class. - * @constructor * Defines a contractual rule for media attribution. - * - * @member {string} [url] The URL that you use to create of hyperlink of the - * media content. For example, if the target is an image, you would use the URL - * to make the image clickable. - */ +*/ export interface ContractualRulesMediaAttribution extends ContractualRulesAttribution { + /** + * The URL that you use to create of hyperlink of the media content. For example, if the target + * is an image, you would use the URL to make the image clickable. + */ readonly url?: string; } /** - * @class - * Initializes a new instance of the ContractualRulesTextAttribution class. - * @constructor * Defines a contractual rule for text attribution. - * - * @member {string} text The attribution text. Text attribution applies to the - * entity as a whole and should be displayed immediately following the entity - * presentation. If there are multiple text or link attribution rules that do - * not specify a target, you should concatenate them and display them using a - * "Data from:" label. - * @member {boolean} [optionalForListDisplay] Indicates whether this provider's - * attribution is optional. - */ +*/ export interface ContractualRulesTextAttribution extends ContractualRulesAttribution { + /** + * The attribution text. Text attribution applies to the entity as a whole and should be + * displayed immediately following the entity presentation. If there are multiple text or link + * attribution rules that do not specify a target, you should concatenate them and display them + * using a "Data from:" label. + */ text: string; + /** + * Indicates whether this provider's attribution is optional. + */ readonly optionalForListDisplay?: boolean; } -/** - * @class - * Initializes a new instance of the FoodEstablishment class. - * @constructor - */ export interface FoodEstablishment extends LocalBusiness { } -/** - * @class - * Initializes a new instance of the LodgingBusiness class. - * @constructor - */ export interface LodgingBusiness extends LocalBusiness { } -/** - * @class - * Initializes a new instance of the Restaurant class. - * @constructor - * @member {boolean} [acceptsReservations] - * @member {string} [reservationUrl] - * @member {array} [servesCuisine] - * @member {string} [menuUrl] - */ export interface Restaurant extends FoodEstablishment { readonly acceptsReservations?: boolean; readonly reservationUrl?: string; @@ -677,13 +469,6 @@ export interface Restaurant extends FoodEstablishment { readonly menuUrl?: string; } -/** - * @class - * Initializes a new instance of the Hotel class. - * @constructor - * @member {string} [hotelClass] - * @member {array} [amenities] - */ export interface Hotel extends LodgingBusiness { readonly hotelClass?: string; readonly amenities?: string[]; diff --git a/lib/services/entitySearch/lib/models/localBusiness.js b/lib/services/entitySearch/lib/models/localBusiness.js index e6c21dba1b..3d9b48c5d4 100644 --- a/lib/services/entitySearch/lib/models/localBusiness.js +++ b/lib/services/entitySearch/lib/models/localBusiness.js @@ -19,10 +19,10 @@ const models = require('./index'); class LocalBusiness extends models['Place'] { /** * Create a LocalBusiness. - * @member {string} [priceRange] $$. - * @member {array} [panoramas] - * @member {boolean} [isPermanentlyClosed] - * @member {string} [tagLine] + * @property {string} [priceRange] $$. + * @property {array} [panoramas] + * @property {boolean} [isPermanentlyClosed] + * @property {string} [tagLine] */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/mediaObject.js b/lib/services/entitySearch/lib/models/mediaObject.js index c3197f38bc..4207094f95 100644 --- a/lib/services/entitySearch/lib/models/mediaObject.js +++ b/lib/services/entitySearch/lib/models/mediaObject.js @@ -19,12 +19,13 @@ const models = require('./index'); class MediaObject extends models['CreativeWork'] { /** * Create a MediaObject. - * @member {string} [contentUrl] Original URL to retrieve the source (file) + * @property {string} [contentUrl] Original URL to retrieve the source (file) * for the media object (e.g the source URL for the image). - * @member {string} [hostPageUrl] URL of the page that hosts the media + * @property {string} [hostPageUrl] URL of the page that hosts the media * object. - * @member {number} [width] The width of the source media object, in pixels. - * @member {number} [height] The height of the source media object, in + * @property {number} [width] The width of the source media object, in + * pixels. + * @property {number} [height] The height of the source media object, in * pixels. */ constructor() { diff --git a/lib/services/entitySearch/lib/models/movieTheater.js b/lib/services/entitySearch/lib/models/movieTheater.js index e87a7b2458..3a0e9838d4 100644 --- a/lib/services/entitySearch/lib/models/movieTheater.js +++ b/lib/services/entitySearch/lib/models/movieTheater.js @@ -19,7 +19,7 @@ const models = require('./index'); class MovieTheater extends models['EntertainmentBusiness'] { /** * Create a MovieTheater. - * @member {number} [screenCount] + * @property {number} [screenCount] */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/place.js b/lib/services/entitySearch/lib/models/place.js index f0764f74fc..800b969ec1 100644 --- a/lib/services/entitySearch/lib/models/place.js +++ b/lib/services/entitySearch/lib/models/place.js @@ -20,30 +20,30 @@ const models = require('./index'); class Place extends models['Thing'] { /** * Create a Place. - * @member {object} [address] The postal address of where the entity is + * @property {object} [address] The postal address of where the entity is * located - * @member {string} [address.streetAddress] - * @member {string} [address.addressLocality] The city where the street + * @property {string} [address.streetAddress] + * @property {string} [address.addressLocality] The city where the street * address is located. For example, Seattle. - * @member {string} [address.addressSubregion] - * @member {string} [address.addressRegion] The state or province code where - * the street address is located. This could be the two-letter code. For - * example, WA, or the full name , Washington. - * @member {string} [address.postalCode] The zip code or postal code where + * @property {string} [address.addressSubregion] + * @property {string} [address.addressRegion] The state or province code + * where the street address is located. This could be the two-letter code. + * For example, WA, or the full name , Washington. + * @property {string} [address.postalCode] The zip code or postal code where * the street address is located. For example, 98052. - * @member {string} [address.postOfficeBoxNumber] - * @member {string} [address.addressCountry] The country/region where the + * @property {string} [address.postOfficeBoxNumber] + * @property {string} [address.addressCountry] The country/region where the * street address is located. This could be the two-letter ISO code. For * example, US, or the full name, United States. - * @member {string} [address.countryIso] The two letter ISO code of this - * countr. For example, US. - * @member {string} [address.neighborhood] The neighborhood where the street - * address is located. For example, Westlake. - * @member {string} [address.addressRegionAbbreviation] Region Abbreviation. - * For example, WA. - * @member {string} [address.text] The complete address. For example, 2100 + * @property {string} [address.countryIso] The two letter ISO code of this + * country. For example, US. + * @property {string} [address.neighborhood] The neighborhood where the + * street address is located. For example, Westlake. + * @property {string} [address.addressRegionAbbreviation] Region + * Abbreviation. For example, WA. + * @property {string} [address.text] The complete address. For example, 2100 * Westlake Ave N, Bellevue, WA 98052. - * @member {string} [telephone] The entity's telephone number + * @property {string} [telephone] The entity's telephone number */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/places.js b/lib/services/entitySearch/lib/models/places.js index 183d961056..0dd672a45b 100644 --- a/lib/services/entitySearch/lib/models/places.js +++ b/lib/services/entitySearch/lib/models/places.js @@ -20,7 +20,7 @@ const models = require('./index'); class Places extends models['SearchResultsAnswer'] { /** * Create a Places. - * @member {array} value A list of local entities, such as restaurants or + * @property {array} value A list of local entities, such as restaurants or * hotels. */ constructor() { diff --git a/lib/services/entitySearch/lib/models/postalAddress.js b/lib/services/entitySearch/lib/models/postalAddress.js index 5f8992679b..02c501ee1b 100644 --- a/lib/services/entitySearch/lib/models/postalAddress.js +++ b/lib/services/entitySearch/lib/models/postalAddress.js @@ -20,26 +20,26 @@ const models = require('./index'); class PostalAddress extends models['StructuredValue'] { /** * Create a PostalAddress. - * @member {string} [streetAddress] - * @member {string} [addressLocality] The city where the street address is + * @property {string} [streetAddress] + * @property {string} [addressLocality] The city where the street address is * located. For example, Seattle. - * @member {string} [addressSubregion] - * @member {string} [addressRegion] The state or province code where the + * @property {string} [addressSubregion] + * @property {string} [addressRegion] The state or province code where the * street address is located. This could be the two-letter code. For example, * WA, or the full name , Washington. - * @member {string} [postalCode] The zip code or postal code where the street - * address is located. For example, 98052. - * @member {string} [postOfficeBoxNumber] - * @member {string} [addressCountry] The country/region where the street + * @property {string} [postalCode] The zip code or postal code where the + * street address is located. For example, 98052. + * @property {string} [postOfficeBoxNumber] + * @property {string} [addressCountry] The country/region where the street * address is located. This could be the two-letter ISO code. For example, * US, or the full name, United States. - * @member {string} [countryIso] The two letter ISO code of this countr. For - * example, US. - * @member {string} [neighborhood] The neighborhood where the street address - * is located. For example, Westlake. - * @member {string} [addressRegionAbbreviation] Region Abbreviation. For + * @property {string} [countryIso] The two letter ISO code of this country. + * For example, US. + * @property {string} [neighborhood] The neighborhood where the street + * address is located. For example, Westlake. + * @property {string} [addressRegionAbbreviation] Region Abbreviation. For * example, WA. - * @member {string} [text] The complete address. For example, 2100 Westlake + * @property {string} [text] The complete address. For example, 2100 Westlake * Ave N, Bellevue, WA 98052. */ constructor() { diff --git a/lib/services/entitySearch/lib/models/queryContext.js b/lib/services/entitySearch/lib/models/queryContext.js index fd7a4ba07c..9cae9ff2d8 100644 --- a/lib/services/entitySearch/lib/models/queryContext.js +++ b/lib/services/entitySearch/lib/models/queryContext.js @@ -17,23 +17,23 @@ class QueryContext { /** * Create a QueryContext. - * @member {string} originalQuery The query string as specified in the + * @property {string} originalQuery The query string as specified in the * request. - * @member {string} [alteredQuery] The query string used by Bing to perform + * @property {string} [alteredQuery] The query string used by Bing to perform * the query. Bing uses the altered query string if the original query string * contained spelling mistakes. For example, if the query string is "saling * downwind", the altered query string will be "sailing downwind". This field * is included only if the original query string contains a spelling mistake. - * @member {string} [alterationOverrideQuery] The query string to use to + * @property {string} [alterationOverrideQuery] The query string to use to * force Bing to use the original string. For example, if the query string is * "saling downwind", the override query string will be "+saling downwind". * Remember to encode the query string which results in "%2Bsaling+downwind". * This field is included only if the original query string contains a * spelling mistake. - * @member {boolean} [adultIntent] A Boolean value that indicates whether the - * specified query has adult intent. The value is true if the query has adult - * intent; otherwise, false. - * @member {boolean} [askUserForLocation] A Boolean value that indicates + * @property {boolean} [adultIntent] A Boolean value that indicates whether + * the specified query has adult intent. The value is true if the query has + * adult intent; otherwise, false. + * @property {boolean} [askUserForLocation] A Boolean value that indicates * whether Bing requires the user's location to provide accurate results. If * you specified the user's location by using the X-MSEdge-ClientIP and * X-Search-Location headers, you can ignore this field. For location aware diff --git a/lib/services/entitySearch/lib/models/response.js b/lib/services/entitySearch/lib/models/response.js index 0fdcd1ba02..78ea913eda 100644 --- a/lib/services/entitySearch/lib/models/response.js +++ b/lib/services/entitySearch/lib/models/response.js @@ -21,9 +21,9 @@ const models = require('./index'); class Response extends models['Identifiable'] { /** * Create a Response. - * @member {array} [contractualRules] A list of rules that you must adhere to - * if you display the item. - * @member {string} [webSearchUrl] The URL To Bing's search result for this + * @property {array} [contractualRules] A list of rules that you must adhere + * to if you display the item. + * @property {string} [webSearchUrl] The URL To Bing's search result for this * item. */ constructor() { diff --git a/lib/services/entitySearch/lib/models/responseBase.js b/lib/services/entitySearch/lib/models/responseBase.js index ffe3d9ee1b..557d5ec790 100644 --- a/lib/services/entitySearch/lib/models/responseBase.js +++ b/lib/services/entitySearch/lib/models/responseBase.js @@ -16,7 +16,7 @@ class ResponseBase { /** * Create a ResponseBase. - * @member {string} _type Polymorphic Discriminator + * @property {string} _type Polymorphic Discriminator */ constructor() { } diff --git a/lib/services/entitySearch/lib/models/restaurant.js b/lib/services/entitySearch/lib/models/restaurant.js index 045f204d56..6dac1dafd9 100644 --- a/lib/services/entitySearch/lib/models/restaurant.js +++ b/lib/services/entitySearch/lib/models/restaurant.js @@ -19,10 +19,10 @@ const models = require('./index'); class Restaurant extends models['FoodEstablishment'] { /** * Create a Restaurant. - * @member {boolean} [acceptsReservations] - * @member {string} [reservationUrl] - * @member {array} [servesCuisine] - * @member {string} [menuUrl] + * @property {boolean} [acceptsReservations] + * @property {string} [reservationUrl] + * @property {array} [servesCuisine] + * @property {string} [menuUrl] */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/models/searchResponse.js b/lib/services/entitySearch/lib/models/searchResponse.js index 93e57b5272..74fbc3bca6 100644 --- a/lib/services/entitySearch/lib/models/searchResponse.js +++ b/lib/services/entitySearch/lib/models/searchResponse.js @@ -21,28 +21,28 @@ const models = require('./index'); class SearchResponse extends models['Response'] { /** * Create a SearchResponse. - * @member {object} [queryContext] An object that contains the query string + * @property {object} [queryContext] An object that contains the query string * that Bing used for the request. This object contains the query string as * entered by the user. It may also contain an altered query string that Bing * used for the query if the query string contained a spelling mistake. - * @member {string} [queryContext.originalQuery] The query string as + * @property {string} [queryContext.originalQuery] The query string as * specified in the request. - * @member {string} [queryContext.alteredQuery] The query string used by Bing - * to perform the query. Bing uses the altered query string if the original - * query string contained spelling mistakes. For example, if the query string - * is "saling downwind", the altered query string will be "sailing downwind". - * This field is included only if the original query string contains a - * spelling mistake. - * @member {string} [queryContext.alterationOverrideQuery] The query string + * @property {string} [queryContext.alteredQuery] The query string used by + * Bing to perform the query. Bing uses the altered query string if the + * original query string contained spelling mistakes. For example, if the + * query string is "saling downwind", the altered query string will be + * "sailing downwind". This field is included only if the original query + * string contains a spelling mistake. + * @property {string} [queryContext.alterationOverrideQuery] The query string * to use to force Bing to use the original string. For example, if the query * string is "saling downwind", the override query string will be "+saling * downwind". Remember to encode the query string which results in * "%2Bsaling+downwind". This field is included only if the original query * string contains a spelling mistake. - * @member {boolean} [queryContext.adultIntent] A Boolean value that + * @property {boolean} [queryContext.adultIntent] A Boolean value that * indicates whether the specified query has adult intent. The value is true * if the query has adult intent; otherwise, false. - * @member {boolean} [queryContext.askUserForLocation] A Boolean value that + * @property {boolean} [queryContext.askUserForLocation] A Boolean value that * indicates whether Bing requires the user's location to provide accurate * results. If you specified the user's location by using the * X-MSEdge-ClientIP and X-Search-Location headers, you can ignore this @@ -52,9 +52,9 @@ class SearchResponse extends models['Response'] { * include the location (for example, "Seattle weather"), this field is set * to false. This field is also set to false for queries that are not * location aware, such as "best sellers". - * @member {object} [entities] A list of entities that are relevant to the + * @property {object} [entities] A list of entities that are relevant to the * search query. - * @member {string} [entities.queryScenario] The supported query scenario. + * @property {string} [entities.queryScenario] The supported query scenario. * This field is set to DominantEntity or DisambiguationItem. The field is * set to DominantEntity if Bing determines that only a single entity * satisfies the request. For example, a book, movie, person, or attraction. @@ -65,10 +65,10 @@ class SearchResponse extends models['Response'] { * entity's type would likely be DominantEntity. Possible values include: * 'DominantEntity', 'DominantEntityWithDisambiguation', 'Disambiguation', * 'List', 'ListWithPivot' - * @member {array} [entities.value] A list of entities. - * @member {object} [places] A list of local entities such as restaurants or - * hotels that are relevant to the query. - * @member {array} [places.value] A list of local entities, such as + * @property {array} [entities.value] A list of entities. + * @property {object} [places] A list of local entities such as restaurants + * or hotels that are relevant to the query. + * @property {array} [places.value] A list of local entities, such as * restaurants or hotels. */ constructor() { diff --git a/lib/services/entitySearch/lib/models/searchResultsAnswer.js b/lib/services/entitySearch/lib/models/searchResultsAnswer.js index 5badad4964..62c91e2aec 100644 --- a/lib/services/entitySearch/lib/models/searchResultsAnswer.js +++ b/lib/services/entitySearch/lib/models/searchResultsAnswer.js @@ -19,25 +19,25 @@ const models = require('./index'); class SearchResultsAnswer extends models['Answer'] { /** * Create a SearchResultsAnswer. - * @member {object} [queryContext] - * @member {string} [queryContext.originalQuery] The query string as + * @property {object} [queryContext] + * @property {string} [queryContext.originalQuery] The query string as * specified in the request. - * @member {string} [queryContext.alteredQuery] The query string used by Bing - * to perform the query. Bing uses the altered query string if the original - * query string contained spelling mistakes. For example, if the query string - * is "saling downwind", the altered query string will be "sailing downwind". - * This field is included only if the original query string contains a - * spelling mistake. - * @member {string} [queryContext.alterationOverrideQuery] The query string + * @property {string} [queryContext.alteredQuery] The query string used by + * Bing to perform the query. Bing uses the altered query string if the + * original query string contained spelling mistakes. For example, if the + * query string is "saling downwind", the altered query string will be + * "sailing downwind". This field is included only if the original query + * string contains a spelling mistake. + * @property {string} [queryContext.alterationOverrideQuery] The query string * to use to force Bing to use the original string. For example, if the query * string is "saling downwind", the override query string will be "+saling * downwind". Remember to encode the query string which results in * "%2Bsaling+downwind". This field is included only if the original query * string contains a spelling mistake. - * @member {boolean} [queryContext.adultIntent] A Boolean value that + * @property {boolean} [queryContext.adultIntent] A Boolean value that * indicates whether the specified query has adult intent. The value is true * if the query has adult intent; otherwise, false. - * @member {boolean} [queryContext.askUserForLocation] A Boolean value that + * @property {boolean} [queryContext.askUserForLocation] A Boolean value that * indicates whether Bing requires the user's location to provide accurate * results. If you specified the user's location by using the * X-MSEdge-ClientIP and X-Search-Location headers, you can ignore this diff --git a/lib/services/entitySearch/lib/models/thing.js b/lib/services/entitySearch/lib/models/thing.js index 406e4c1b5e..44a9a0833a 100644 --- a/lib/services/entitySearch/lib/models/thing.js +++ b/lib/services/entitySearch/lib/models/thing.js @@ -19,27 +19,28 @@ const models = require('./index'); class Thing extends models['Response'] { /** * Create a Thing. - * @member {string} [name] The name of the thing represented by this object. - * @member {string} [url] The URL to get more information about the thing + * @property {string} [name] The name of the thing represented by this + * object. + * @property {string} [url] The URL to get more information about the thing * represented by this object. - * @member {object} [image] - * @member {object} [image.thumbnail] The URL to a thumbnail of the image - * @member {string} [description] A short description of the item. - * @member {object} [entityPresentationInfo] Additional information about the - * entity such as hints that you can use to determine the entity's type. To - * determine the entity's type, use the entityScenario and entityTypeHint + * @property {object} [image] + * @property {object} [image.thumbnail] The URL to a thumbnail of the image + * @property {string} [description] A short description of the item. + * @property {object} [entityPresentationInfo] Additional information about + * the entity such as hints that you can use to determine the entity's type. + * To determine the entity's type, use the entityScenario and entityTypeHint * fields. - * @member {string} [entityPresentationInfo.entityScenario] The supported + * @property {string} [entityPresentationInfo.entityScenario] The supported * scenario. Possible values include: 'DominantEntity', 'DisambiguationItem', * 'ListItem' - * @member {array} [entityPresentationInfo.entityTypeHints] A list of hints + * @property {array} [entityPresentationInfo.entityTypeHints] A list of hints * that indicate the entity's type. The list could contain a single hint such * as Movie or a list of hints such as Place, LocalBusiness, Restaurant. Each * successive hint in the array narrows the entity's type. - * @member {string} [entityPresentationInfo.entityTypeDisplayHint] A display - * version of the entity hint. For example, if entityTypeHints is Artist, - * this field may be set to American Singer. - * @member {string} [bingId] An ID that uniquely identifies this item. + * @property {string} [entityPresentationInfo.entityTypeDisplayHint] A + * display version of the entity hint. For example, if entityTypeHints is + * Artist, this field may be set to American Singer. + * @property {string} [bingId] An ID that uniquely identifies this item. */ constructor() { super(); diff --git a/lib/services/entitySearch/lib/operations/entitiesOperations.js b/lib/services/entitySearch/lib/operations/entitiesOperations.js index 7d00bf3a4a..f222fe3bc9 100644 --- a/lib/services/entitySearch/lib/operations/entitiesOperations.js +++ b/lib/services/entitySearch/lib/operations/entitiesOperations.js @@ -225,6 +225,9 @@ function _search(query, options, callback) { let xBingApisSDK = 'true'; // 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 (acceptLanguage !== null && acceptLanguage !== undefined && typeof acceptLanguage.valueOf() !== 'string') { throw new Error('acceptLanguage must be of type string.'); } @@ -279,6 +282,7 @@ function _search(query, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'entities'; + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (countryCode !== null && countryCode !== undefined) { queryParameters.push('cc=' + encodeURIComponent(countryCode)); diff --git a/lib/services/entitySearch/package.json b/lib/services/entitySearch/package.json index da081bf2e1..ef2e9cfc9a 100644 --- a/lib/services/entitySearch/package.json +++ b/lib/services/entitySearch/package.json @@ -4,7 +4,7 @@ "description": "EntitySearchAPIClient Library with typescript type definitions for node", "version": "1.2.0", "dependencies": { - "ms-rest": "^2.3.2" + "ms-rest": "^2.3.3" }, "keywords": [ "node", @@ -13,12 +13,12 @@ "license": "MIT", "main": "./lib/entitySearchAPIClient.js", "types": "./lib/entitySearchAPIClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/entitySearch", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git" }, "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" + "url": "https://github.com/azure/azure-sdk-for-node/issues" } -} \ No newline at end of file +}