import { BaseResourceAPI, CDFHttpClient, CursorAndAsyncIterator, MetadataMap } from '@cognite/sdk-core'; import { CogniteEvent, EventChange, EventFilterRequest, EventSearchRequest, ExternalEvent, IdEither, IgnoreUnknownIds } from '../../types'; import { EventsAggregateAPI } from './eventsAggregateApi'; export declare class EventsAPI extends BaseResourceAPI { private aggregateAPI; constructor(...args: [string, CDFHttpClient, MetadataMap]); /** * @hidden */ protected getDateProps(): [string[], string[]]; /** * [Create events](https://doc.cognitedata.com/api/v1/#operation/createEvents) * * ```js * const events = [ * { description: 'Workorder pump abc', startTime: new Date('22 jan 2019') }, * { description: 'Broken rule', externalId: 'rule123', startTime: 1557346524667000 }, * ]; * const createdEvents = await client.events.create(events); * ``` */ create: (items: ExternalEvent[]) => Promise; /** * [List events](https://doc.cognitedata.com/api/v1/#operation/advancedListEvents) * * * ```js * const events = await client.events.list({ filter: { startTime: { min: new Date('1 jan 2018') }, endTime: { max: new Date('1 jan 2019') } } }); * ``` */ list: (scope?: EventFilterRequest) => CursorAndAsyncIterator; /** * [Retrieve events](https://doc.cognitedata.com/api/v1/#operation/byIdsEvents) * * * ```js * const events = await client.events.retrieve([{id: 123}, {externalId: 'abc'}]); * ``` */ retrieve: (ids: IdEither[], params?: EventRetrieveParams) => Promise; /** * [Update events](https://doc.cognitedata.com/api/v1/#operation/updateEvents) * * ```js * const events = await client.events.update([{id: 123, update: {description: {set: 'New description'}}}]); * ``` */ update: (changes: EventChange[]) => Promise; /** * [Search for events](https://doc.cognitedata.com/api/v1/#operation/searchEvents) * * ```js * const events = await client.events.search({ * filter: { * assetIds: [1, 2] * }, * search: { * description: 'Pump' * } * }); * ``` */ search: (query: EventSearchRequest) => Promise; /** * [Delete events](https://doc.cognitedata.com/api/v1/#operation/deleteEvents) * * ```js * await client.events.delete([{id: 123}, {externalId: 'abc'}]); * ``` */ delete: (ids: IdEither[]) => Promise<{}>; /** * The aggregation API allows you to compute aggregated results on events like getting the count of all events * in a project or checking what are all the different types and subtypes of events in your project, * along with the count of events in each of those aggregations. * By specifying an additional filter, you can also aggregate only among events matching the specified filter. */ get aggregate(): EventsAggregateAPI; private convertSortObjectToArray; } export type EventRetrieveParams = IgnoreUnknownIds;