comments.js 1.2 KB

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Comments = void 0;
  4. const base_collection_1 = require("./base_collection");
  5. const comment_1 = require("../models/comment");
  6. class Comments extends base_collection_1.BaseCollection {
  7. static rootElementName = "comments";
  8. static rootElementNameSingular = "comment";
  9. static prefixURI = "projects/{!:project_id}/keys/{!:key_id}/comments/{:id}";
  10. static elementClass = comment_1.Comment;
  11. list(request_params) {
  12. return this.doList(request_params);
  13. }
  14. create(comment_params, request_params) {
  15. const body = { comments: this.objToArray(comment_params) };
  16. return this.doCreate(body, request_params, this.populateArrayFromJson);
  17. }
  18. get(comment_id, request_params) {
  19. return this.doGet(comment_id, request_params);
  20. }
  21. delete(comment_id, request_params) {
  22. return this.doDelete(comment_id, request_params);
  23. }
  24. list_project_comments(params) {
  25. return this.createPromise("GET", params, this.populateArrayFromJson, this.handleReject, null, "projects/{!:project_id}/comments");
  26. }
  27. }
  28. exports.Comments = Comments;
  29. //# sourceMappingURL=comments.js.map