snapshots.js 1.1 KB

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.Snapshots = void 0;
  4. const base_collection_1 = require("./base_collection");
  5. const snapshot_1 = require("../models/snapshot");
  6. class Snapshots extends base_collection_1.BaseCollection {
  7. static rootElementName = "snapshots";
  8. static rootElementNameSingular = "snapshot";
  9. static prefixURI = "projects/{!:project_id}/snapshots/{:id}";
  10. static elementClass = snapshot_1.Snapshot;
  11. list(request_params) {
  12. return this.doList(request_params);
  13. }
  14. create(snapshot_params, request_params) {
  15. return this.doCreate(snapshot_params, request_params, this.populateObjectFromJsonRoot);
  16. }
  17. restore(snapshot_id, request_params) {
  18. const params = {
  19. ...request_params,
  20. ...{ id: snapshot_id },
  21. };
  22. return this.createPromise("POST", params, this.returnBareJSON, this.handleReject, {});
  23. }
  24. delete(snapshot_id, request_params) {
  25. return this.doDelete(snapshot_id, request_params);
  26. }
  27. }
  28. exports.Snapshots = Snapshots;
  29. //# sourceMappingURL=snapshots.js.map