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