branches.d.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { BaseCollection } from "./base_collection";
  2. import { Branch } from "../models/branch";
  3. import { PaginatedResult } from "../interfaces/paginated_result";
  4. import { ProjectWithPagination } from "../interfaces/project_with_pagination";
  5. import { ProjectOnly } from "../interfaces/project_only";
  6. type BranchParams = {
  7. name?: string;
  8. };
  9. type MergeBranchParams = {
  10. force_conflict_resolve_using?: string;
  11. target_branch_id?: number | string;
  12. };
  13. type BranchDeleted = {
  14. project_id: string;
  15. branch_deleted: boolean;
  16. };
  17. type BranchMerged = {
  18. project_id: string;
  19. branch_merged: boolean;
  20. branch: Branch;
  21. target_branch: Branch;
  22. };
  23. export declare class Branches extends BaseCollection {
  24. protected static rootElementName: string;
  25. protected static rootElementNameSingular: string;
  26. protected static prefixURI: string;
  27. protected static elementClass: typeof Branch;
  28. list(request_params: ProjectWithPagination): Promise<PaginatedResult<Branch>>;
  29. create(branch_params: BranchParams, request_params: ProjectOnly): Promise<Branch>;
  30. get(branch_id: string | number, request_params: ProjectOnly): Promise<Branch>;
  31. update(branch_id: string | number, branch_params: BranchParams, request_params: ProjectOnly): Promise<Branch>;
  32. delete(branch_id: string | number, request_params: ProjectOnly): Promise<BranchDeleted>;
  33. merge(branch_id: string | number, request_params: ProjectOnly, body?: MergeBranchParams): Promise<BranchMerged>;
  34. }
  35. export {};