import { BaseCollection } from "./base_collection" ; import { Comment } from "../models/comment" ; import { StandartParams } from "../interfaces/standart_params" ; import { PaginatedResult } from "../models/paginated_result" ; export class Comments extends BaseCollection { protected static rootElementName : string = "comments" ; protected static rootElementNameSingular : string = "comment" ; protected static prefixURI : string = "projects/{!:project_id}/keys/{!:key_id}/comments/{:id}" ; protected static elementClass : object = Comment ; create ( raw_body , params ) { const body = { comments : this . objToArray ( raw_body ) } ; return this . createPromise ( "POST" , params , this . populateArrayFromJson , this . handleReject , body ) ; } list_project_comments ( params ) { return this . createPromise ( "GET" , { project_id : params [ "project_id" ] } , this . populateArrayFromJson , this . handleReject , null , "projects/{!:project_id}/comments" ) ; } }