import { BaseAPI } from '../common/BaseApi'; import { UnlApiConfig } from '../models'; import { PaginationResponse } from '../models/PaginationResponse'; import { PaginationParams } from '../models/PaginationParams'; import { Record } from './models/Record'; /** * RecordsApi class contains all the methods related to records. * @class RecordsApi * @extends {BaseAPI} */ export default class RecordsApi extends BaseAPI { constructor(configuration: UnlApiConfig); /** * Create a new record. * * @param {string} projectId Id of the project the created record will belong to. * @param {GeoJSON.Feature} feature Created record feature. * @return {Promise} A promise that, in case of success, returns the created record object. * @memberof RecordsApi */ create(projectId: string, feature: GeoJSON.Feature): Promise; /** * Create a new record and make it the child of another record. * * @param {string} projectId Id of the project the created record will belong to. * @param {GeoJSON.Feature} recordId Id of the parent record. * @param {GeoJSON.Feature} feature Created record feature. * @return {Promise} A promise that, in case of success, returns the created record object. * @memberof RecordsApi */ createChild(projectId: string, recordId: string, feature: GeoJSON.Feature): Promise; /** * Get all records that belong to a project. * * @param {string} projectId Id of the project to get all the records from. * @param {PaginationParams} paginationParams Pagination information to decide the limit, the bboxCsv (bounding box) and the lastId of the records list. * @return {Promise>} A promise that, in case of success, returns the records wrapped around a PaginationResponse object. * @memberof RecordsApi */ getAll(projectId: string, paginationParams?: PaginationParams): Promise>; /** * Get a record object by id. * * @param {string} projectId Id of the project to get the record from. * @param {string} recordId Id of the record to be fetched. * @return {Promise} A promise that, in case of success, returns the requested record object. * @memberof RecordsApi */ getById(projectId: string, recordId: string): Promise; /** * Get the children of a record object. * * @param {string} projectId Id of the project the parent record is belonging to. * @param {GeoJSON.Feature} recordId Id of the parent record. * @param {PaginationParams} paginationParams Pagination information to decide the limit and the lastId of the children list. * @return {Promise>} A promise that, in case of success, returns the child records wrapped around a PaginationResponse object. * @memberof RecordsApi */ getChildren(projectId: string, recordId: string, paginationParams?: PaginationParams): Promise>; /** * Update a record by id. * * @param {string} projectId Id of the project to update the record from. * @param {string} recordId Id of the record to be updated. * @param {GeoJSON.Feature} feature Updated record feature. * @return {Promise} A promise that, in case of success, returns the updated record object. * @memberof RecordsApi */ update(projectId: string, recordId: string, feature: GeoJSON.Feature): Promise; /** * Delete a record by id. * * @param {string} projectId Id of the project to delete the record from. * @param {string} recordId Id of the record to be deleted. * @return {Promise} A promise that, in case of success, returns the deleted record object. * @memberof RecordsApi */ delete(projectId: string, recordId: string): Promise; }