webhooks.js 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Webhooks = void 0;
  4. const base_collection_1 = require("./base_collection");
  5. const webhook_1 = require("../models/webhook");
  6. class Webhooks extends base_collection_1.BaseCollection {
  7. static rootElementName = "webhooks";
  8. static rootElementNameSingular = "webhook";
  9. static prefixURI = "projects/{!:project_id}/webhooks/{:id}";
  10. static elementClass = webhook_1.Webhook;
  11. list(request_params) {
  12. return this.doList(request_params);
  13. }
  14. create(webhook_params, request_params) {
  15. return this.doCreate(webhook_params, request_params, this.populateObjectFromJsonRoot);
  16. }
  17. get(webhook_id, request_params) {
  18. return this.doGet(webhook_id, request_params);
  19. }
  20. update(webhook_id, webhook_params, request_params) {
  21. return this.doUpdate(webhook_id, webhook_params, request_params);
  22. }
  23. delete(webhook_id, request_params) {
  24. return this.doDelete(webhook_id, request_params);
  25. }
  26. regenerate_secret(webhook_id, request_params) {
  27. const params = {
  28. ...request_params,
  29. ...{ id: webhook_id },
  30. };
  31. return this.createPromise("PATCH", params, this.returnBareJSON, this.handleReject, null, "projects/{!:project_id}/webhooks/{:id}/secret/regenerate");
  32. }
  33. }
  34. exports.Webhooks = Webhooks;
  35. //# sourceMappingURL=webhooks.js.map