5
5
PaginationOptions ,
6
6
PatchRequest ,
7
7
ProjectRole ,
8
+ ProjectRoles ,
8
9
ResponseList ,
9
10
ResponseObject ,
10
11
} from '../core' ;
@@ -54,7 +55,7 @@ export class Teams extends CrowdinApi {
54
55
* @param options optional pagination parameters for the request
55
56
* @see https://support.crowdin.com/enterprise/api/#operation/api.teams.getMany
56
57
*/
57
- listTeams ( options ?: PaginationOptions ) : Promise < ResponseList < TeamsModel . Team > > ;
58
+ listTeams ( options ?: TeamsModel . ListTeamsOptions ) : Promise < ResponseList < TeamsModel . Team > > ;
58
59
/**
59
60
* @param limit maximum number of items to retrieve (default 25)
60
61
* @param offset starting offset in the collection (default 0)
@@ -63,14 +64,19 @@ export class Teams extends CrowdinApi {
63
64
*/
64
65
listTeams ( limit ?: number , offset ?: number ) : Promise < ResponseList < TeamsModel . Team > > ;
65
66
listTeams (
66
- options ?: number | ( { orderBy ?: string } & PaginationOptions ) ,
67
+ options ?: number | ( { orderBy ?: string } & TeamsModel . ListTeamsOptions ) ,
67
68
deprecatedOffset ?: number ,
68
69
) : Promise < ResponseList < TeamsModel . Team > > {
69
70
if ( isOptionalNumber ( options , '0' in arguments ) ) {
70
71
options = { limit : options , offset : deprecatedOffset } ;
71
72
}
72
73
let url = `${ this . url } /teams` ;
73
74
url = this . addQueryParam ( url , 'orderBy' , options . orderBy ) ;
75
+ url = this . addQueryParam ( url , 'search' , options ?. search ) ;
76
+ url = this . addQueryParam ( url , 'projectIds' , options ?. projectIds ) ;
77
+ url = this . addQueryParam ( url , 'projectRoles' , options ?. projectRoles ?. toString ( ) ) ;
78
+ url = this . addQueryParam ( url , 'languageIds' , options ?. languageIds ) ;
79
+ url = this . addQueryParam ( url , 'groupIds' , options ?. groupIds ) ;
74
80
return this . getList ( url , options . limit , options . offset ) ;
75
81
}
76
82
@@ -192,6 +198,15 @@ export namespace TeamsModel {
192
198
permissions ?: Permissions ;
193
199
}
194
200
201
+ export interface ListTeamsOptions extends PaginationOptions {
202
+ search ?: string ;
203
+ projectIds ?: string ;
204
+ projectRoles ?: ProjectRoles [ ] ;
205
+ languageIds ?: string ;
206
+ groupIds ?: string ;
207
+ orderBy ?: string ;
208
+ }
209
+
195
210
export interface ProjectTeamResources {
196
211
skipped : ProjectTeamResource ;
197
212
added : ProjectTeamResource ;
0 commit comments