branches.js 1.4 KB

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