@@ -19,6 +19,41 @@ import { TeamsModel } from '../teams';
1919 * Use API to get the list of organization users and to check the information on a specific user.
2020 */
2121export class Users extends CrowdinApi {
22+ /**
23+ * @param groupId group identifier
24+ * @param options optional parameters for the request
25+ * @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/Users/operation/api.groups.managers.getMany
26+ */
27+ listGroupManagers (
28+ groupId : number ,
29+ options ?: UsersModel . ListGroupManagersOptions ,
30+ ) : Promise < ResponseList < UsersModel . GroupManager > > {
31+ let url = `${ this . url } /groups/${ groupId } /managers` ;
32+ url = this . addQueryParam ( url , 'teamIds' , options ?. teamIds ?. toString ( ) ) ;
33+ url = this . addQueryParam ( url , 'orderBy' , options ?. orderBy ) ;
34+ return this . getList ( url , options ?. limit , options ?. offset ) ;
35+ }
36+
37+ /**
38+ * @param groupId group identifier
39+ * @param request request body
40+ * @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/Users/operation/api.groups.managers.patch
41+ */
42+ updateGroupManagers ( groupId : number , request : PatchRequest [ ] ) : Promise < ResponseList < UsersModel . GroupManager > > {
43+ const url = `${ this . url } /groups/${ groupId } /managers` ;
44+ return this . patch ( url , request , this . defaultConfig ( ) ) ;
45+ }
46+
47+ /**
48+ * @param groupId group identifier
49+ * @param userId user identifier
50+ * @see https://support.crowdin.com/developer/enterprise/api/v2/#tag/Users/operation/api.groups.managers.get
51+ */
52+ getGroupManager ( groupId : number , userId : number ) : Promise < ResponseObject < UsersModel . GroupManager > > {
53+ const url = `${ this . url } /groups/${ groupId } /managers/${ userId } ` ;
54+ return this . get ( url , this . defaultConfig ( ) ) ;
55+ }
56+
2257 /**
2358 * @param projectId project identifier
2459 * @param options optional parameters for the request
@@ -270,6 +305,11 @@ export class Users extends CrowdinApi {
270305}
271306
272307export namespace UsersModel {
308+ export interface ListGroupManagersOptions extends PaginationOptions {
309+ teamIds ?: number [ ] ;
310+ orderBy ?: string ;
311+ }
312+
273313 export interface ListProjectMembersOptions extends PaginationOptions {
274314 search ?: string ;
275315 role ?: Role ;
@@ -324,6 +364,12 @@ export namespace UsersModel {
324364
325365 export type OrganizationRoles = 'admin' | 'manager' | 'vendor' | 'client' ;
326366
367+ export interface GroupManager {
368+ id : number ;
369+ user : User ;
370+ teams : TeamsModel . Team [ ] ;
371+ }
372+
327373 export interface ProjectMember {
328374 id : number ;
329375 username : string ;
0 commit comments