Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions lib/services/cognitiveServicesCustomImageSearch/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +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.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* 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.
*/

import { ServiceClient, ServiceClientOptions, ServiceClientCredentials } from 'ms-rest';
import * as models from "./models";
import * as operations from "./operations";

export default class CustomImageSearchAPIClient extends ServiceClient {
/**
* @class
* Initializes a new instance of the CustomImageSearchAPIClient class.
* @constructor
*
* @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
*
*/
constructor(credentials: ServiceClientCredentials, baseUri?: string, options?: ServiceClientOptions);

credentials: ServiceClientCredentials;

// Operation groups
customInstance: operations.CustomInstance;
}

export { CustomImageSearchAPIClient, models as CustomImageSearchAPIModels };
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* 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.
*/

/* jshint latedef:false */
/* jshint forin:false */
/* jshint noempty:false */

'use strict';

const msRest = require('ms-rest');
const ServiceClient = msRest.ServiceClient;

const models = require('./models');
const operations = require('./operations');


/** Class representing a CustomImageSearchAPIClient. */
class CustomImageSearchAPIClient extends ServiceClient {
/**
* Create a CustomImageSearchAPIClient.
* @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
*/
constructor(credentials, baseUri, options) {
if (credentials === null || credentials === undefined) {
throw new Error('\'credentials\' cannot be null.');
}

if (!options) options = {};

super(credentials, options);

this.baseUri = baseUri;
if (!this.baseUri) {
this.baseUri = 'https://api.cognitive.microsoft.com/bingcustomsearch/v7.0';
}
this.credentials = credentials;

let packageInfo = this.getPackageJsonInfo(__dirname);
this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`);
this.customInstance = new operations.CustomInstance(this);
this.models = models;
msRest.addSerializationMixin(this);
}

}

module.exports = CustomImageSearchAPIClient;
module.exports['default'] = CustomImageSearchAPIClient;
module.exports.CustomImageSearchAPIClient = CustomImageSearchAPIClient;
module.exports.CustomImageSearchAPIModels = models;
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/*
* 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');

/**
* Defines an answer.
*
* @extends models['Response']
*/
class Answer extends models['Response'] {
/**
* Create a Answer.
*/
constructor() {
super();
}

/**
* Defines the metadata of Answer
*
* @returns {object} metadata of Answer
*
*/
mapper() {
return {
required: false,
serializedName: 'Answer',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: '_type',
clientName: '_type'
},
uberParent: 'ResponseBase',
className: 'Answer',
modelProperties: {
_type: {
required: true,
serializedName: '_type',
isPolymorphicDiscriminator: true,
type: {
name: 'String'
}
},
id: {
required: false,
readOnly: true,
serializedName: 'id',
type: {
name: 'String'
}
},
readLink: {
required: false,
readOnly: true,
serializedName: 'readLink',
type: {
name: 'String'
}
},
webSearchUrl: {
required: false,
readOnly: true,
serializedName: 'webSearchUrl',
type: {
name: 'String'
}
}
}
}
};
}
}

module.exports = Answer;
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/*
* 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');

/**
* The most generic kind of creative work, including books, movies,
* photographs, software programs, etc.
*
* @extends models['Thing']
*/
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] Text content of this creative work
*/
constructor() {
super();
}

/**
* Defines the metadata of CreativeWork
*
* @returns {object} metadata of CreativeWork
*
*/
mapper() {
return {
required: false,
serializedName: 'CreativeWork',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: '_type',
clientName: '_type'
},
uberParent: 'ResponseBase',
className: 'CreativeWork',
modelProperties: {
_type: {
required: true,
serializedName: '_type',
isPolymorphicDiscriminator: true,
type: {
name: 'String'
}
},
id: {
required: false,
readOnly: true,
serializedName: 'id',
type: {
name: 'String'
}
},
readLink: {
required: false,
readOnly: true,
serializedName: 'readLink',
type: {
name: 'String'
}
},
webSearchUrl: {
required: false,
readOnly: true,
serializedName: 'webSearchUrl',
type: {
name: 'String'
}
},
name: {
required: false,
readOnly: true,
serializedName: 'name',
type: {
name: 'String'
}
},
url: {
required: false,
readOnly: true,
serializedName: 'url',
type: {
name: 'String'
}
},
image: {
required: false,
readOnly: true,
serializedName: 'image',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: '_type',
clientName: '_type'
},
uberParent: 'ResponseBase',
className: 'ImageObject'
}
},
description: {
required: false,
readOnly: true,
serializedName: 'description',
type: {
name: 'String'
}
},
alternateName: {
required: false,
readOnly: true,
serializedName: 'alternateName',
type: {
name: 'String'
}
},
bingId: {
required: false,
readOnly: true,
serializedName: 'bingId',
type: {
name: 'String'
}
},
thumbnailUrl: {
required: false,
readOnly: true,
serializedName: 'thumbnailUrl',
type: {
name: 'String'
}
},
provider: {
required: false,
readOnly: true,
serializedName: 'provider',
type: {
name: 'Sequence',
element: {
required: false,
serializedName: 'ThingElementType',
type: {
name: 'Composite',
polymorphicDiscriminator: {
serializedName: '_type',
clientName: '_type'
},
uberParent: 'ResponseBase',
className: 'Thing'
}
}
}
},
text: {
required: false,
readOnly: true,
serializedName: 'text',
type: {
name: 'String'
}
}
}
}
};
}
}

module.exports = CreativeWork;
Loading