diff --git a/lib/services/contentModerator/lib/contentModeratorClient.d.ts b/lib/services/contentModerator/lib/contentModeratorClient.d.ts new file mode 100644 index 0000000000..a2702f5154 --- /dev/null +++ b/lib/services/contentModerator/lib/contentModeratorClient.d.ts @@ -0,0 +1,51 @@ +/* + * 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 ContentModeratorClient extends ServiceClient { + /** + * @class + * Initializes a new instance of the ContentModeratorClient class. + * @constructor + * + * @param {credentials} credentials - Subscription credentials which uniquely identify client subscription. + * + * @param {string} endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). + * + * @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, endpoint: string, options?: ServiceClientOptions); + + credentials: ServiceClientCredentials; + + endpoint: string; + + // Operation groups + imageModeration: operations.ImageModeration; + textModeration: operations.TextModeration; + listManagementImageLists: operations.ListManagementImageLists; + listManagementTermLists: operations.ListManagementTermLists; + listManagementImage: operations.ListManagementImage; + listManagementTerm: operations.ListManagementTerm; + reviews: operations.Reviews; +} + +export { ContentModeratorClient, models as ContentModeratorModels }; diff --git a/lib/services/contentModerator/lib/contentModeratorClient.js b/lib/services/contentModerator/lib/contentModeratorClient.js new file mode 100644 index 0000000000..3d2e8c3b9f --- /dev/null +++ b/lib/services/contentModerator/lib/contentModeratorClient.js @@ -0,0 +1,70 @@ +/* + * 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 ContentModeratorClient. */ +class ContentModeratorClient extends ServiceClient { + /** + * Create a ContentModeratorClient. + * @param {credentials} credentials - Subscription credentials which uniquely identify client subscription. + * @param {string} endpoint - Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com). + * @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, endpoint, options) { + if (credentials === null || credentials === undefined) { + throw new Error('\'credentials\' cannot be null.'); + } + if (endpoint === null || endpoint === undefined) { + throw new Error('\'endpoint\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.baseUri = '{Endpoint}'; + this.credentials = credentials; + this.endpoint = endpoint; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + this.imageModeration = new operations.ImageModeration(this); + this.textModeration = new operations.TextModeration(this); + this.listManagementImageLists = new operations.ListManagementImageLists(this); + this.listManagementTermLists = new operations.ListManagementTermLists(this); + this.listManagementImage = new operations.ListManagementImage(this); + this.listManagementTerm = new operations.ListManagementTerm(this); + this.reviews = new operations.Reviews(this); + this.models = models; + msRest.addSerializationMixin(this); + } + +} + +module.exports = ContentModeratorClient; +module.exports['default'] = ContentModeratorClient; +module.exports.ContentModeratorClient = ContentModeratorClient; +module.exports.ContentModeratorModels = models; diff --git a/lib/services/contentModerator/lib/models/imageList.js b/lib/services/contentModerator/lib/models/imageList.js index bfdc489b1d..1f29213497 100644 --- a/lib/services/contentModerator/lib/models/imageList.js +++ b/lib/services/contentModerator/lib/models/imageList.js @@ -71,6 +71,18 @@ class ImageList { serializedName: 'Metadata', type: { name: 'Composite', + additionalProperties: { + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, className: 'ImageListMetadata' } } diff --git a/lib/services/contentModerator/lib/models/imageListMetadata.js b/lib/services/contentModerator/lib/models/imageListMetadata.js index 2d9d1f05b3..f52592b27d 100644 --- a/lib/services/contentModerator/lib/models/imageListMetadata.js +++ b/lib/services/contentModerator/lib/models/imageListMetadata.js @@ -35,6 +35,18 @@ class ImageListMetadata { serializedName: 'ImageList_Metadata', type: { name: 'Composite', + additionalProperties: { + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, className: 'ImageListMetadata', modelProperties: { keyOne: { diff --git a/lib/services/contentModerator/lib/models/index.d.ts b/lib/services/contentModerator/lib/models/index.d.ts index 9de671bced..26efc75054 100644 --- a/lib/services/contentModerator/lib/models/index.d.ts +++ b/lib/services/contentModerator/lib/models/index.d.ts @@ -525,6 +525,12 @@ export interface DetectedLanguage { export interface ImageListMetadata { keyOne?: string; keyTwo?: string; + /** + * @property Describes unknown properties. The value of an unknown property + * MUST be of type "string". Due to valid TS constraints we have modeled this + * as a union of `string | any`. + */ + [property: string]: string | any; } /** @@ -561,6 +567,12 @@ export interface ImageList { export interface TermListMetadata { keyOne?: string; keyTwo?: string; + /** + * @property Describes unknown properties. The value of an unknown property + * MUST be of type "string". Due to valid TS constraints we have modeled this + * as a union of `string | any`. + */ + [property: string]: string | any; } /** diff --git a/lib/services/contentModerator/lib/models/termList.js b/lib/services/contentModerator/lib/models/termList.js index 11e8045e6d..5a8cab8bfb 100644 --- a/lib/services/contentModerator/lib/models/termList.js +++ b/lib/services/contentModerator/lib/models/termList.js @@ -71,6 +71,18 @@ class TermList { serializedName: 'Metadata', type: { name: 'Composite', + additionalProperties: { + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, className: 'TermListMetadata' } } diff --git a/lib/services/contentModerator/lib/models/termListMetadata.js b/lib/services/contentModerator/lib/models/termListMetadata.js index 43a309209c..e71e8d817f 100644 --- a/lib/services/contentModerator/lib/models/termListMetadata.js +++ b/lib/services/contentModerator/lib/models/termListMetadata.js @@ -35,6 +35,18 @@ class TermListMetadata { serializedName: 'TermList_Metadata', type: { name: 'Composite', + additionalProperties: { + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, className: 'TermListMetadata', modelProperties: { keyOne: { diff --git a/lib/services/contentModerator/lib/operations/imageModeration.js b/lib/services/contentModerator/lib/operations/imageModeration.js index 3bd395aba4..2ca76bae92 100644 --- a/lib/services/contentModerator/lib/operations/imageModeration.js +++ b/lib/services/contentModerator/lib/operations/imageModeration.js @@ -50,8 +50,8 @@ function _findFaces(options, callback) { let cacheImage = (options && options.cacheImage !== undefined) ? options.cacheImage : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (cacheImage !== null && cacheImage !== undefined && typeof cacheImage !== 'boolean') { throw new Error('cacheImage must be of type boolean.'); @@ -63,7 +63,7 @@ function _findFaces(options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/FindFaces'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (cacheImage !== null && cacheImage !== undefined) { queryParameters.push('CacheImage=' + encodeURIComponent(cacheImage.toString())); @@ -192,8 +192,8 @@ function _oCRMethod(language, options, callback) { let enhanced = (options && options.enhanced !== undefined) ? options.enhanced : false; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (language === null || language === undefined || typeof language.valueOf() !== 'string') { throw new Error('language cannot be null or undefined and it must be of type string.'); @@ -211,7 +211,7 @@ function _oCRMethod(language, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/OCR'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; queryParameters.push('language=' + encodeURIComponent(language)); if (cacheImage !== null && cacheImage !== undefined) { @@ -333,8 +333,8 @@ function _evaluateMethod(options, callback) { let cacheImage = (options && options.cacheImage !== undefined) ? options.cacheImage : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (cacheImage !== null && cacheImage !== undefined && typeof cacheImage !== 'boolean') { throw new Error('cacheImage must be of type boolean.'); @@ -346,7 +346,7 @@ function _evaluateMethod(options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/Evaluate'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (cacheImage !== null && cacheImage !== undefined) { queryParameters.push('CacheImage=' + encodeURIComponent(cacheImage.toString())); @@ -475,8 +475,8 @@ function _matchMethod(options, callback) { let cacheImage = (options && options.cacheImage !== undefined) ? options.cacheImage : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId !== null && listId !== undefined && typeof listId.valueOf() !== 'string') { throw new Error('listId must be of type string.'); @@ -491,7 +491,7 @@ function _matchMethod(options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/Match'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (listId !== null && listId !== undefined) { queryParameters.push('listId=' + encodeURIComponent(listId)); @@ -614,8 +614,8 @@ function _findFacesFileInput(imageStream, options, callback) { let cacheImage = (options && options.cacheImage !== undefined) ? options.cacheImage : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (cacheImage !== null && cacheImage !== undefined && typeof cacheImage !== 'boolean') { throw new Error('cacheImage must be of type boolean.'); @@ -630,7 +630,7 @@ function _findFacesFileInput(imageStream, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/FindFaces'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (cacheImage !== null && cacheImage !== undefined) { queryParameters.push('CacheImage=' + encodeURIComponent(cacheImage.toString())); @@ -758,8 +758,8 @@ function _findFacesUrlInput(contentType, imageUrl, options, callback) { let cacheImage = (options && options.cacheImage !== undefined) ? options.cacheImage : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (cacheImage !== null && cacheImage !== undefined && typeof cacheImage !== 'boolean') { throw new Error('cacheImage must be of type boolean.'); @@ -777,7 +777,7 @@ function _findFacesUrlInput(contentType, imageUrl, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/FindFaces'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (cacheImage !== null && cacheImage !== undefined) { queryParameters.push('CacheImage=' + encodeURIComponent(cacheImage.toString())); @@ -931,8 +931,8 @@ function _oCRUrlInput(language, contentType, imageUrl, options, callback) { let enhanced = (options && options.enhanced !== undefined) ? options.enhanced : false; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (language === null || language === undefined || typeof language.valueOf() !== 'string') { throw new Error('language cannot be null or undefined and it must be of type string.'); @@ -956,7 +956,7 @@ function _oCRUrlInput(language, contentType, imageUrl, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/OCR'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; queryParameters.push('language=' + encodeURIComponent(language)); if (cacheImage !== null && cacheImage !== undefined) { @@ -1108,8 +1108,8 @@ function _oCRFileInput(language, imageStream, options, callback) { let enhanced = (options && options.enhanced !== undefined) ? options.enhanced : false; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (language === null || language === undefined || typeof language.valueOf() !== 'string') { throw new Error('language cannot be null or undefined and it must be of type string.'); @@ -1130,7 +1130,7 @@ function _oCRFileInput(language, imageStream, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/OCR'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; queryParameters.push('language=' + encodeURIComponent(language)); if (cacheImage !== null && cacheImage !== undefined) { @@ -1256,8 +1256,8 @@ function _evaluateFileInput(imageStream, options, callback) { let cacheImage = (options && options.cacheImage !== undefined) ? options.cacheImage : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (cacheImage !== null && cacheImage !== undefined && typeof cacheImage !== 'boolean') { throw new Error('cacheImage must be of type boolean.'); @@ -1272,7 +1272,7 @@ function _evaluateFileInput(imageStream, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/Evaluate'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (cacheImage !== null && cacheImage !== undefined) { queryParameters.push('CacheImage=' + encodeURIComponent(cacheImage.toString())); @@ -1400,8 +1400,8 @@ function _evaluateUrlInput(contentType, imageUrl, options, callback) { let cacheImage = (options && options.cacheImage !== undefined) ? options.cacheImage : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (cacheImage !== null && cacheImage !== undefined && typeof cacheImage !== 'boolean') { throw new Error('cacheImage must be of type boolean.'); @@ -1419,7 +1419,7 @@ function _evaluateUrlInput(contentType, imageUrl, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/Evaluate'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (cacheImage !== null && cacheImage !== undefined) { queryParameters.push('CacheImage=' + encodeURIComponent(cacheImage.toString())); @@ -1573,8 +1573,8 @@ function _matchUrlInput(contentType, imageUrl, options, callback) { let cacheImage = (options && options.cacheImage !== undefined) ? options.cacheImage : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId !== null && listId !== undefined && typeof listId.valueOf() !== 'string') { throw new Error('listId must be of type string.'); @@ -1595,7 +1595,7 @@ function _matchUrlInput(contentType, imageUrl, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/Match'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (listId !== null && listId !== undefined) { queryParameters.push('listId=' + encodeURIComponent(listId)); @@ -1746,8 +1746,8 @@ function _matchFileInput(imageStream, options, callback) { let cacheImage = (options && options.cacheImage !== undefined) ? options.cacheImage : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId !== null && listId !== undefined && typeof listId.valueOf() !== 'string') { throw new Error('listId must be of type string.'); @@ -1765,7 +1765,7 @@ function _matchFileInput(imageStream, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessImage/Match'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (listId !== null && listId !== undefined) { queryParameters.push('listId=' + encodeURIComponent(listId)); @@ -1855,7 +1855,7 @@ function _matchFileInput(imageStream, options, callback) { class ImageModeration { /** * Create a ImageModeration. - * @param {ContentModeratorAPIClient} client Reference to the service client. + * @param {ContentModeratorClient} client Reference to the service client. */ constructor(client) { this.client = client; diff --git a/lib/services/contentModerator/lib/operations/index.d.ts b/lib/services/contentModerator/lib/operations/index.d.ts index 2fbb11143f..b4d67acfdb 100644 --- a/lib/services/contentModerator/lib/operations/index.d.ts +++ b/lib/services/contentModerator/lib/operations/index.d.ts @@ -17,7 +17,7 @@ import * as models from '../models'; * @class * ImageModeration * __NOTE__: An instance of this class is automatically created for an - * instance of the ContentModeratorAPIClient. + * instance of the ContentModeratorClient. */ export interface ImageModeration { @@ -910,7 +910,7 @@ export interface ImageModeration { * @class * TextModeration * __NOTE__: An instance of this class is automatically created for an - * instance of the ContentModeratorAPIClient. + * instance of the ContentModeratorClient. */ export interface TextModeration { @@ -1073,7 +1073,7 @@ export interface TextModeration { * @class * ListManagementImageLists * __NOTE__: An instance of this class is automatically created for an - * instance of the ContentModeratorAPIClient. + * instance of the ContentModeratorClient. */ export interface ListManagementImageLists { @@ -1466,7 +1466,7 @@ export interface ListManagementImageLists { * @class * ListManagementTermLists * __NOTE__: An instance of this class is automatically created for an - * instance of the ContentModeratorAPIClient. + * instance of the ContentModeratorClient. */ export interface ListManagementTermLists { @@ -1865,7 +1865,7 @@ export interface ListManagementTermLists { * @class * ListManagementImage * __NOTE__: An instance of this class is automatically created for an - * instance of the ContentModeratorAPIClient. + * instance of the ContentModeratorClient. */ export interface ListManagementImage { @@ -2250,7 +2250,7 @@ export interface ListManagementImage { * @class * ListManagementTerm * __NOTE__: An instance of this class is automatically created for an - * instance of the ContentModeratorAPIClient. + * instance of the ContentModeratorClient. */ export interface ListManagementTerm { @@ -2508,7 +2508,7 @@ export interface ListManagementTerm { * @class * Reviews * __NOTE__: An instance of this class is automatically created for an - * instance of the ContentModeratorAPIClient. + * instance of the ContentModeratorClient. */ export interface Reviews { diff --git a/lib/services/contentModerator/lib/operations/listManagementImage.js b/lib/services/contentModerator/lib/operations/listManagementImage.js index e6abd32123..61c421abef 100644 --- a/lib/services/contentModerator/lib/operations/listManagementImage.js +++ b/lib/services/contentModerator/lib/operations/listManagementImage.js @@ -54,8 +54,8 @@ function _addImage(listId, options, callback) { let label = (options && options.label !== undefined) ? options.label : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -73,7 +73,7 @@ function _addImage(listId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}/images'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); let queryParameters = []; if (tag !== null && tag !== undefined) { @@ -192,8 +192,8 @@ function _deleteAllImages(listId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -205,7 +205,7 @@ function _deleteAllImages(listId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}/images'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); // Create HTTP transport objects @@ -321,8 +321,8 @@ function _getAllImageIds(listId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -334,7 +334,7 @@ function _getAllImageIds(listId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}/images'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); // Create HTTP transport objects @@ -445,8 +445,8 @@ function _deleteImage(listId, imageId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -461,7 +461,7 @@ function _deleteImage(listId, imageId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}/images/{ImageId}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); requestUrl = requestUrl.replace('{ImageId}', encodeURIComponent(imageId)); @@ -592,8 +592,8 @@ function _addImageUrlInput(listId, contentType, imageUrl, options, callback) { let label = (options && options.label !== undefined) ? options.label : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -617,7 +617,7 @@ function _addImageUrlInput(listId, contentType, imageUrl, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}/images'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); let queryParameters = []; if (tag !== null && tag !== undefined) { @@ -762,8 +762,8 @@ function _addImageFileInput(listId, imageStream, options, callback) { let label = (options && options.label !== undefined) ? options.label : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -784,7 +784,7 @@ function _addImageFileInput(listId, imageStream, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}/images'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); let queryParameters = []; if (tag !== null && tag !== undefined) { @@ -875,7 +875,7 @@ function _addImageFileInput(listId, imageStream, options, callback) { class ListManagementImage { /** * Create a ListManagementImage. - * @param {ContentModeratorAPIClient} client Reference to the service client. + * @param {ContentModeratorClient} client Reference to the service client. */ constructor(client) { this.client = client; diff --git a/lib/services/contentModerator/lib/operations/listManagementImageLists.js b/lib/services/contentModerator/lib/operations/listManagementImageLists.js index 161b59f4d9..8fbdb8d536 100644 --- a/lib/services/contentModerator/lib/operations/listManagementImageLists.js +++ b/lib/services/contentModerator/lib/operations/listManagementImageLists.js @@ -48,8 +48,8 @@ function _getDetails(listId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -61,7 +61,7 @@ function _getDetails(listId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); // Create HTTP transport objects @@ -170,8 +170,8 @@ function _deleteMethod(listId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -183,7 +183,7 @@ function _deleteMethod(listId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); // Create HTTP transport objects @@ -315,8 +315,8 @@ function _update(listId, contentType, body, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -334,7 +334,7 @@ function _update(listId, contentType, body, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); // Create HTTP transport objects @@ -475,8 +475,8 @@ function _create(contentType, body, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (contentType === null || contentType === undefined || typeof contentType.valueOf() !== 'string') { throw new Error('contentType cannot be null or undefined and it must be of type string.'); @@ -491,7 +491,7 @@ function _create(contentType, body, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); // Create HTTP transport objects let httpRequest = new WebResource(); @@ -614,8 +614,8 @@ function _getAllImageLists(options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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.'); } } catch (error) { return callback(error); @@ -624,7 +624,7 @@ function _getAllImageLists(options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); // Create HTTP transport objects let httpRequest = new WebResource(); @@ -747,8 +747,8 @@ function _refreshIndexMethod(listId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -760,7 +760,7 @@ function _refreshIndexMethod(listId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/imagelists/{listId}/RefreshIndex'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); // Create HTTP transport objects @@ -839,7 +839,7 @@ function _refreshIndexMethod(listId, options, callback) { class ListManagementImageLists { /** * Create a ListManagementImageLists. - * @param {ContentModeratorAPIClient} client Reference to the service client. + * @param {ContentModeratorClient} client Reference to the service client. */ constructor(client) { this.client = client; diff --git a/lib/services/contentModerator/lib/operations/listManagementTerm.js b/lib/services/contentModerator/lib/operations/listManagementTerm.js index 37323ba8b3..7d8327bf07 100644 --- a/lib/services/contentModerator/lib/operations/listManagementTerm.js +++ b/lib/services/contentModerator/lib/operations/listManagementTerm.js @@ -51,8 +51,8 @@ function _addTerm(listId, term, language, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -70,7 +70,7 @@ function _addTerm(listId, term, language, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists/{listId}/terms/{term}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); requestUrl = requestUrl.replace('{term}', encodeURIComponent(term)); let queryParameters = []; @@ -195,8 +195,8 @@ function _deleteTerm(listId, term, language, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -214,7 +214,7 @@ function _deleteTerm(listId, term, language, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists/{listId}/terms/{term}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); requestUrl = requestUrl.replace('{term}', encodeURIComponent(term)); let queryParameters = []; @@ -344,8 +344,8 @@ function _getAllTerms(listId, language, options, callback) { let limit = (options && options.limit !== undefined) ? options.limit : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -366,7 +366,7 @@ function _getAllTerms(listId, language, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists/{listId}/terms'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); let queryParameters = []; queryParameters.push('language=' + encodeURIComponent(language)); @@ -488,8 +488,8 @@ function _deleteAllTerms(listId, language, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -504,7 +504,7 @@ function _deleteAllTerms(listId, language, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists/{listId}/terms'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); let queryParameters = []; queryParameters.push('language=' + encodeURIComponent(language)); @@ -594,7 +594,7 @@ function _deleteAllTerms(listId, language, options, callback) { class ListManagementTerm { /** * Create a ListManagementTerm. - * @param {ContentModeratorAPIClient} client Reference to the service client. + * @param {ContentModeratorClient} client Reference to the service client. */ constructor(client) { this.client = client; diff --git a/lib/services/contentModerator/lib/operations/listManagementTermLists.js b/lib/services/contentModerator/lib/operations/listManagementTermLists.js index 1d1d767311..35d7fd1d1b 100644 --- a/lib/services/contentModerator/lib/operations/listManagementTermLists.js +++ b/lib/services/contentModerator/lib/operations/listManagementTermLists.js @@ -49,8 +49,8 @@ function _getDetails(listId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -62,7 +62,7 @@ function _getDetails(listId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists/{listId}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); // Create HTTP transport objects @@ -171,8 +171,8 @@ function _deleteMethod(listId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -184,7 +184,7 @@ function _deleteMethod(listId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists/{listId}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); // Create HTTP transport objects @@ -316,8 +316,8 @@ function _update(listId, contentType, body, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -335,7 +335,7 @@ function _update(listId, contentType, body, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists/{listId}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); // Create HTTP transport objects @@ -476,8 +476,8 @@ function _create(contentType, body, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (contentType === null || contentType === undefined || typeof contentType.valueOf() !== 'string') { throw new Error('contentType cannot be null or undefined and it must be of type string.'); @@ -492,7 +492,7 @@ function _create(contentType, body, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); // Create HTTP transport objects let httpRequest = new WebResource(); @@ -615,8 +615,8 @@ function _getAllTermLists(options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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.'); } } catch (error) { return callback(error); @@ -625,7 +625,7 @@ function _getAllTermLists(options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); // Create HTTP transport objects let httpRequest = new WebResource(); @@ -750,8 +750,8 @@ function _refreshIndexMethod(listId, language, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (listId === null || listId === undefined || typeof listId.valueOf() !== 'string') { throw new Error('listId cannot be null or undefined and it must be of type string.'); @@ -766,7 +766,7 @@ function _refreshIndexMethod(listId, language, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/lists/v1.0/termlists/{listId}/RefreshIndex'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{listId}', encodeURIComponent(listId)); let queryParameters = []; queryParameters.push('language=' + encodeURIComponent(language)); @@ -850,7 +850,7 @@ function _refreshIndexMethod(listId, language, options, callback) { class ListManagementTermLists { /** * Create a ListManagementTermLists. - * @param {ContentModeratorAPIClient} client Reference to the service client. + * @param {ContentModeratorClient} client Reference to the service client. */ constructor(client) { this.client = client; diff --git a/lib/services/contentModerator/lib/operations/reviews.js b/lib/services/contentModerator/lib/operations/reviews.js index 91ad4995d8..a2540b52e4 100644 --- a/lib/services/contentModerator/lib/operations/reviews.js +++ b/lib/services/contentModerator/lib/operations/reviews.js @@ -50,8 +50,8 @@ function _getReview(teamName, reviewId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (teamName === null || teamName === undefined || typeof teamName.valueOf() !== 'string') { throw new Error('teamName cannot be null or undefined and it must be of type string.'); @@ -66,7 +66,7 @@ function _getReview(teamName, reviewId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); requestUrl = requestUrl.replace('{reviewId}', encodeURIComponent(reviewId)); @@ -179,8 +179,8 @@ function _getJobDetails(teamName, jobId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (teamName === null || teamName === undefined || typeof teamName.valueOf() !== 'string') { throw new Error('teamName cannot be null or undefined and it must be of type string.'); @@ -195,7 +195,7 @@ function _getJobDetails(teamName, jobId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/jobs/{JobId}'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); requestUrl = requestUrl.replace('{JobId}', encodeURIComponent(jobId)); @@ -338,8 +338,8 @@ function _createReviews(urlContentType, teamName, createReviewBody, options, cal let subTeam = (options && options.subTeam !== undefined) ? options.subTeam : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (urlContentType === null || urlContentType === undefined || typeof urlContentType.valueOf() !== 'string') { throw new Error('urlContentType cannot be null or undefined and it must be of type string.'); @@ -357,7 +357,7 @@ function _createReviews(urlContentType, teamName, createReviewBody, options, cal // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); let queryParameters = []; if (subTeam !== null && subTeam !== undefined) { @@ -585,8 +585,8 @@ function _createJob(teamName, contentType, contentId, workflowName, jobContentTy let callBackEndpoint = (options && options.callBackEndpoint !== undefined) ? options.callBackEndpoint : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (teamName === null || teamName === undefined || typeof teamName.valueOf() !== 'string') { throw new Error('teamName cannot be null or undefined and it must be of type string.'); @@ -616,7 +616,7 @@ function _createJob(teamName, contentType, contentId, workflowName, jobContentTy // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/jobs'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); let queryParameters = []; queryParameters.push('ContentType=' + encodeURIComponent(contentType)); @@ -783,8 +783,8 @@ function _addVideoFrame(teamName, reviewId, options, callback) { let timescale = (options && options.timescale !== undefined) ? options.timescale : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (teamName === null || teamName === undefined || typeof teamName.valueOf() !== 'string') { throw new Error('teamName cannot be null or undefined and it must be of type string.'); @@ -802,7 +802,7 @@ function _addVideoFrame(teamName, reviewId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/frames'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); requestUrl = requestUrl.replace('{reviewId}', encodeURIComponent(reviewId)); let queryParameters = []; @@ -940,8 +940,8 @@ function _getVideoFrames(teamName, reviewId, options, callback) { let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (teamName === null || teamName === undefined || typeof teamName.valueOf() !== 'string') { throw new Error('teamName cannot be null or undefined and it must be of type string.'); @@ -965,7 +965,7 @@ function _getVideoFrames(teamName, reviewId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/frames'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); requestUrl = requestUrl.replace('{reviewId}', encodeURIComponent(reviewId)); let queryParameters = []; @@ -1090,8 +1090,8 @@ function _publishVideoReview(teamName, reviewId, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (teamName === null || teamName === undefined || typeof teamName.valueOf() !== 'string') { throw new Error('teamName cannot be null or undefined and it must be of type string.'); @@ -1106,7 +1106,7 @@ function _publishVideoReview(teamName, reviewId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/publish'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); requestUrl = requestUrl.replace('{reviewId}', encodeURIComponent(reviewId)); @@ -1209,8 +1209,8 @@ function _addVideoTranscriptModerationResult(contentType, teamName, reviewId, tr } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (contentType === null || contentType === undefined || typeof contentType.valueOf() !== 'string') { throw new Error('contentType cannot be null or undefined and it must be of type string.'); @@ -1228,7 +1228,7 @@ function _addVideoTranscriptModerationResult(contentType, teamName, reviewId, tr // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/transcriptmoderationresult'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); requestUrl = requestUrl.replace('{reviewId}', encodeURIComponent(reviewId)); @@ -1358,8 +1358,8 @@ function _addVideoTranscript(teamName, reviewId, vTTfile, options, callback) { let contentType = 'text/plain'; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (teamName === null || teamName === undefined || typeof teamName.valueOf() !== 'string') { throw new Error('teamName cannot be null or undefined and it must be of type string.'); @@ -1377,7 +1377,7 @@ function _addVideoTranscript(teamName, reviewId, vTTfile, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/transcript'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); requestUrl = requestUrl.replace('{reviewId}', encodeURIComponent(reviewId)); @@ -1508,8 +1508,8 @@ function _createVideoReviews(contentType, teamName, createVideoReviewsBody, opti let subTeam = (options && options.subTeam !== undefined) ? options.subTeam : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (contentType === null || contentType === undefined || typeof contentType.valueOf() !== 'string') { throw new Error('contentType cannot be null or undefined and it must be of type string.'); @@ -1527,7 +1527,7 @@ function _createVideoReviews(contentType, teamName, createVideoReviewsBody, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); let queryParameters = []; if (subTeam !== null && subTeam !== undefined) { @@ -1700,8 +1700,8 @@ function _addVideoFrameUrl(contentType, teamName, reviewId, videoFrameBody, opti let timescale = (options && options.timescale !== undefined) ? options.timescale : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (contentType === null || contentType === undefined || typeof contentType.valueOf() !== 'string') { throw new Error('contentType cannot be null or undefined and it must be of type string.'); @@ -1722,7 +1722,7 @@ function _addVideoFrameUrl(contentType, teamName, reviewId, videoFrameBody, opti // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/frames'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); requestUrl = requestUrl.replace('{reviewId}', encodeURIComponent(reviewId)); let queryParameters = []; @@ -1868,8 +1868,8 @@ function _addVideoFrameStream(contentType, teamName, reviewId, frameImageZip, fr let timescale = (options && options.timescale !== undefined) ? options.timescale : undefined; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (contentType === null || contentType === undefined || typeof contentType.valueOf() !== 'string') { throw new Error('contentType cannot be null or undefined and it must be of type string.'); @@ -1896,7 +1896,7 @@ function _addVideoFrameStream(contentType, teamName, reviewId, frameImageZip, fr // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/review/v1.0/teams/{teamName}/reviews/{reviewId}/frames'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); requestUrl = requestUrl.replace('{teamName}', encodeURIComponent(teamName)); requestUrl = requestUrl.replace('{reviewId}', encodeURIComponent(reviewId)); let queryParameters = []; @@ -1977,7 +1977,7 @@ function _addVideoFrameStream(contentType, teamName, reviewId, frameImageZip, fr class Reviews { /** * Create a Reviews. - * @param {ContentModeratorAPIClient} client Reference to the service client. + * @param {ContentModeratorClient} client Reference to the service client. */ constructor(client) { this.client = client; diff --git a/lib/services/contentModerator/lib/operations/textModeration.js b/lib/services/contentModerator/lib/operations/textModeration.js index 7c1f831658..27bc24dc50 100644 --- a/lib/services/contentModerator/lib/operations/textModeration.js +++ b/lib/services/contentModerator/lib/operations/textModeration.js @@ -69,8 +69,8 @@ function _screenText(textContentType, textContent, options, callback) { let classify = (options && options.classify !== undefined) ? options.classify : false; // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (language !== null && language !== undefined && typeof language.valueOf() !== 'string') { throw new Error('language must be of type string.'); @@ -100,7 +100,7 @@ function _screenText(textContentType, textContent, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessText/Screen/'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); let queryParameters = []; if (language !== null && language !== undefined) { queryParameters.push('language=' + encodeURIComponent(language)); @@ -239,8 +239,8 @@ function _detectLanguage(textContentType, textContent, options, callback) { } // Validate try { - if (this.client.baseUrl === null || this.client.baseUrl === undefined || typeof this.client.baseUrl.valueOf() !== 'string') { - throw new Error('this.client.baseUrl cannot be null or undefined and it must be of type string.'); + 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 (textContentType === null || textContentType === undefined || typeof textContentType.valueOf() !== 'string') { throw new Error('textContentType cannot be null or undefined and it must be of type string.'); @@ -255,7 +255,7 @@ function _detectLanguage(textContentType, textContent, options, callback) { // Construct URL let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'contentmoderator/moderate/v1.0/ProcessText/DetectLanguage'; - requestUrl = requestUrl.replace('{baseUrl}', this.client.baseUrl); + requestUrl = requestUrl.replace('{Endpoint}', this.client.endpoint); // Create HTTP transport objects let httpRequest = new WebResource(); @@ -338,7 +338,7 @@ function _detectLanguage(textContentType, textContent, options, callback) { class TextModeration { /** * Create a TextModeration. - * @param {ContentModeratorAPIClient} client Reference to the service client. + * @param {ContentModeratorClient} client Reference to the service client. */ constructor(client) { this.client = client; diff --git a/lib/services/contentModerator/package.json b/lib/services/contentModerator/package.json index dc0072b0fa..2094919470 100644 --- a/lib/services/contentModerator/package.json +++ b/lib/services/contentModerator/package.json @@ -1,21 +1,24 @@ { "name": "azure-cognitiveservices-contentmoderator", "author": "Microsoft Corporation", - "description": "ContentModeratorAPIClient Library with typescript type definitions for node", - "version": "1.0.0-preview", + "description": "ContentModeratorClient Library with typescript type definitions for node", + "version": "3.0.0", "dependencies": { - "ms-rest": "^2.3.2" + "ms-rest": "^2.3.3" }, - "keywords": [ "node", "azure" ], + "keywords": [ + "node", + "azure" + ], "license": "MIT", - "main": "./lib/contentModeratorAPIClient.js", - "types": "./lib/contentModeratorAPIClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "main": "./lib/contentModeratorClient.js", + "types": "./lib/contentModeratorClient.d.ts", + "homepage": "https://github.com/azure/azure-sdk-for-node", "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" } }