UNPKG

1.26 kBJavaScriptView Raw
1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License. See License.txt in the project root for license information.
3import { __extends } from "tslib";
4import { ApiKeyCredentials } from "@azure/ms-rest-js";
5/**
6 * Creates a new CognitiveServicesCredentials object.
7 *
8 * @constructor
9 * @param {string} subscriptionKey The CognitiveServices subscription key
10 */
11var CognitiveServicesCredentials = /** @class */ (function (_super) {
12 __extends(CognitiveServicesCredentials, _super);
13 function CognitiveServicesCredentials(subscriptionKey) {
14 var _this = this;
15 if (!subscriptionKey || (subscriptionKey && typeof subscriptionKey.valueOf() !== "string")) {
16 throw new Error("subscriptionKey cannot be null or undefined and must be of type string.");
17 }
18 var options = {
19 inHeader: {
20 "Ocp-Apim-Subscription-Key": subscriptionKey,
21 "X-BingApis-SDK-Client": "node-SDK"
22 }
23 };
24 _this = _super.call(this, options) || this;
25 return _this;
26 }
27 return CognitiveServicesCredentials;
28}(ApiKeyCredentials));
29export { CognitiveServicesCredentials };
30//# sourceMappingURL=cognitiveServicesCredentials.js.map
\No newline at end of file