Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
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/imageSearch/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.
18 changes: 15 additions & 3 deletions lib/services/imageSearch/lib/imageSearchAPIClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,16 @@ import { ServiceClient, ServiceClientOptions, ServiceClientCredentials } from 'm
import * as models from "./models";
import * as operations from "./operations";

/**
* ImageSearchAPIClientOptions for ImageSearchAPIClient.
*/
declare interface ImageSearchAPIClientOptions 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 ImageSearchAPIClient extends ServiceClient {
/**
* @class
Expand All @@ -20,8 +30,6 @@ export default class ImageSearchAPIClient 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
Expand All @@ -31,11 +39,15 @@ export default class ImageSearchAPIClient 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?: ImageSearchAPIClientOptions);

credentials: ServiceClientCredentials;

endpoint: string;

// Operation groups
imagesOperations: operations.ImagesOperations;
}
Expand Down
13 changes: 7 additions & 6 deletions lib/services/imageSearch/lib/imageSearchAPIClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ class ImageSearchAPIClient extends ServiceClient {
/**
* Create a ImageSearchAPIClient.
* @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.');
}
Expand All @@ -42,14 +42,15 @@ class ImageSearchAPIClient 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.imagesOperations = new operations.ImagesOperations(this);
this.models = models;
msRest.addSerializationMixin(this);
Expand Down
2 changes: 1 addition & 1 deletion lib/services/imageSearch/lib/models/aggregateOffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const models = require('./index');
class AggregateOffer extends models['Offer'] {
/**
* Create a AggregateOffer.
* @member {array} [offers] A list of offers from merchants that have
* @property {array} [offers] A list of offers from merchants that have
* offerings related to the image.
*/
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion lib/services/imageSearch/lib/models/aggregateRating.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const models = require('./index');
class AggregateRating extends models['Rating'] {
/**
* Create a AggregateRating.
* @member {number} [reviewCount] The number of times the recipe has been
* @property {number} [reviewCount] The number of times the recipe has been
* rated or reviewed.
*/
constructor() {
Expand Down
8 changes: 4 additions & 4 deletions lib/services/imageSearch/lib/models/creativeWork.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ 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} [datePublished] The date on which the CreativeWork was
* @property {string} [thumbnailUrl] The URL to a thumbnail of the item.
* @property {array} [provider] The source of the creative work.
* @property {string} [datePublished] The date on which the CreativeWork was
* published.
* @member {string} [text] Text content of this creative work
* @property {string} [text] Text content of this creative work
*/
constructor() {
super();
Expand Down
16 changes: 8 additions & 8 deletions lib/services/imageSearch/lib/models/errorModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
}
Expand Down
4 changes: 2 additions & 2 deletions lib/services/imageSearch/lib/models/errorResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion lib/services/imageSearch/lib/models/identifiable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 5 additions & 5 deletions lib/services/imageSearch/lib/models/imageGallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ const models = require('./index');
class ImageGallery extends models['CollectionPage'] {
/**
* Create a ImageGallery.
* @member {string} [source] The publisher or social network where the images
* were found. You must attribute the publisher as the source where the
* collection was found.
* @member {number} [imagesCount] The number of related images found in the
* @property {string} [source] The publisher or social network where the
* images were found. You must attribute the publisher as the source where
* the collection was found.
* @property {number} [imagesCount] The number of related images found in the
* collection.
* @member {number} [followersCount] The number of users on the social
* @property {number} [followersCount] The number of users on the social
* network that follow the creator.
*/
constructor() {
Expand Down
Loading