UNPKG

1.07 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 "./apiKeyCredentials";
5var TopicCredentials = /** @class */ (function (_super) {
6 __extends(TopicCredentials, _super);
7 /**
8 * Creates a new EventGrid TopicCredentials object.
9 *
10 * @constructor
11 * @param {string} topicKey The EventGrid topic key
12 */
13 function TopicCredentials(topicKey) {
14 var _this = this;
15 if (!topicKey || (topicKey && typeof topicKey !== "string")) {
16 throw new Error("topicKey cannot be null or undefined and must be of type string.");
17 }
18 var options = {
19 inHeader: {
20 "aeg-sas-key": topicKey,
21 },
22 };
23 _this = _super.call(this, options) || this;
24 return _this;
25 }
26 return TopicCredentials;
27}(ApiKeyCredentials));
28export { TopicCredentials };
29//# sourceMappingURL=topicCredentials.js.map
\No newline at end of file