import { CrowdinApi , PatchRequest , ResponseList , ResponseObject } from '../core' ; import { SourceStringsModel } from '../sourceStrings' ; export class Labels extends CrowdinApi { param projectId param limit param offset listLabels ( projectId , limit ? , offset ? ) { const url = `${ this . url }/projects/${ projectId }/labels` ; return this . getList ( url , limit , offset ) ; } param projectId param request addLabel ( projectId , request ) { const url = `${ this . url }/projects/${ projectId }/labels` ; return this . post ( url , request , this . defaultConfig ( ) ) ; } param projectId param labelId getLabel ( projectId , labelId ) { const url = `${ this . url }/projects/${ projectId }/labels/${ labelId }` ; return this . get ( url , this . defaultConfig ( ) ) ; } param projectId param labelId deleteLabel ( projectId , labelId ) { const url = `${ this . url }/projects/${ projectId }/labels/${ labelId }` ; return this . delete ( url , this . defaultConfig ( ) ) ; } param projectId param labelId param request editLabel ( projectId , labelId , request ) { const url = `${ this . url }/projects/${ projectId }/labels/${ labelId }` ; return this . patch ( url , request , this . defaultConfig ( ) ) ; } param projectId param labelId param request assignLabelToString ( projectId , labelId , request ) { const url = `${ this . url }/projects/${ projectId }/labels/${ labelId }/strings` ; return this . post ( url , request , this . defaultConfig ( ) ) ; } param projectId param labelId param stringIds unassignLabelFromString ( projectId , labelId , stringIds ) { let url = `${ this . url }/projects/${ projectId }/labels/${ labelId }/strings` ; url = this . addQueryParam ( url , 'stringIds' , stringIds ) ; return this . delete ( url , this . defaultConfig ( ) ) ; } } export namespace LabelsModel { export interface Label { id : number ; title : string ; } export interface AddLabelRequest { title : string ; } export interface AssignLabelToStringRequet { stringIds : number [ ] ; } }