/* * 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 * as msRest from "@azure/ms-rest-js"; import * as Models from "./models"; const packageName = "@azure/cognitiveservices-translatortext"; const packageVersion = "1.0.1"; export class TranslatorTextClientContext extends msRest.ServiceClient { endpoint: string; apiVersion?: string; credentials: msRest.ServiceClientCredentials; /** * Initializes a new instance of the TranslatorTextClientContext class. * @param endpoint Supported Cognitive Services endpoints * @param credentials Subscription credentials which uniquely identify client subscription. * @param [options] The parameter options */ constructor(credentials: msRest.ServiceClientCredentials, endpoint: string, options?: Models.TranslatorTextClientOptions) { if (endpoint == undefined) { throw new Error("'endpoint' cannot be null."); } if (credentials == undefined) { throw new Error("'credentials' cannot be null."); } if (!options) { options = {}; } if (!options.userAgent) { const defaultUserAgent = msRest.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } super(credentials, options); this.apiVersion = '3.0'; this.baseUri = "{Endpoint}"; this.requestContentType = "application/json; charset=utf-8"; this.endpoint = endpoint; this.credentials = credentials; if (options.apiVersion !== null && options.apiVersion !== undefined) { this.apiVersion = options.apiVersion; } } }