user_groups.d.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import { BaseCollection } from "./base_collection";
  2. import { UserGroup } from "../models/user_group";
  3. import { Keyable } from "../interfaces/keyable";
  4. import { TeamWithPagination } from "../interfaces/team_with_pagination";
  5. import { PaginatedResult } from "../interfaces/paginated_result";
  6. import { TeamOnly } from "../interfaces/team_only";
  7. type GroupLanguages = {
  8. reference: string[];
  9. contributable: string[];
  10. };
  11. type AdminRights = "upload" | "activity" | "download" | "settings" | "create_branches" | "statistics" | "keys" | "screenshots" | "glossary" | "contributors" | "languages" | "tasks";
  12. type UserGroupParams = {
  13. name: string;
  14. is_reviewer: boolean;
  15. is_admin: boolean;
  16. admin_rights?: AdminRights[];
  17. languages?: GroupLanguages;
  18. };
  19. type UserGroupDeleted = {
  20. team_id: string;
  21. group_deleted: boolean;
  22. };
  23. export declare class UserGroups extends BaseCollection {
  24. protected static rootElementName: string;
  25. protected static prefixURI: string;
  26. protected static elementClass: typeof UserGroup;
  27. list(request_params: TeamWithPagination): Promise<PaginatedResult<UserGroup>>;
  28. create(user_group_params: UserGroupParams, request_params: TeamOnly): Promise<UserGroup>;
  29. get(user_group_id: string | number, request_params: TeamOnly): Promise<UserGroup>;
  30. update(user_group_id: string | number, user_group_params: UserGroupParams, request_params: TeamOnly): Promise<UserGroup>;
  31. delete(user_group_id: string | number, request_params: TeamOnly): Promise<UserGroupDeleted>;
  32. add_members_to_group(team_id: string | number, group_id: string | number, user_ids: string[] | number[]): Promise<UserGroup>;
  33. remove_members_from_group(team_id: string | number, group_id: string | number, user_ids: string[] | number[]): Promise<UserGroup>;
  34. add_projects_to_group(team_id: string | number, group_id: string | number, project_ids: string[] | number[]): Promise<UserGroup>;
  35. remove_projects_from_group(team_id: string | number, group_id: string | number, project_ids: string[] | number[]): Promise<UserGroup>;
  36. protected populateGroupFromJsonRoot(json: Keyable, headers: Keyable): this;
  37. }
  38. export {};