topicCredentials.js 1.1 KB

1234567891011121314151617181920212223242526272829
  1. // Copyright (c) Microsoft Corporation. All rights reserved.
  2. // Licensed under the MIT License. See License.txt in the project root for license information.
  3. import * as tslib_1 from "tslib";
  4. import { ApiKeyCredentials } from "./apiKeyCredentials";
  5. var TopicCredentials = /** @class */ (function (_super) {
  6. tslib_1.__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));
  28. export { TopicCredentials };
  29. //# sourceMappingURL=topicCredentials.js.map