import { BaseFilterOptions, BaseSortableFilterOptions, FilterOptions, PaginatedListIterator } from '../cardinal-sdk-ts.mjs'; import { Device } from '../model/Device.mjs'; import { StoredDocumentIdentifier } from '../model/StoredDocumentIdentifier.mjs'; import { EntitySubscription } from '../subscription/EntitySubscription.mjs'; import { EntitySubscriptionConfiguration } from '../subscription/EntitySubscriptionConfiguration.mjs'; import { SubscriptionEventType } from '../subscription/SubscriptionEventType.mjs'; import { DeviceInGroupApi } from './DeviceInGroupApi.mjs'; export interface DeviceApi { inGroup: DeviceInGroupApi; getDevice(deviceId: string): Promise; getDevices(deviceIds: Array): Promise>; createDevice(device: Device): Promise; createDevices(devices: Array): Promise>; modifyDevice(device: Device): Promise; modifyDevices(devices: Array): Promise>; /** * * Deletes a device. If you don't have write access to the device the method will fail. * @param entityId id of the device. * @param rev the latest known rev of the device to delete * @return the id and revision of the deleted device. * @throws RevisionConflictException if the provided revision doesn't match the latest known revision */ deleteDeviceById(entityId: string, rev: string): Promise; /** * * Deletes many devices. Ids that do not correspond to an entity, or that correspond to an entity for which * you don't have write access will be ignored. * @param entityIds ids and revisions of the devices to delete. * @return the id and revision of the deleted devices. If some entities could not be deleted (for example * because you had no write access to them) they will not be included in this list. */ deleteDevicesByIds(entityIds: Array): Promise>; deleteDevice(device: Device): Promise; deleteDevices(devices: Array): Promise>; /** * * Restores a device that was marked as deleted. * @param id the id of the entity * @param rev the latest revision of the entity. * @return the restored entity. * @throws RevisionConflictException if the provided revision doesn't match the latest known revision */ undeleteDeviceById(id: string, rev: string): Promise; undeleteDevicesByIds(entityIds: Array): Promise>; undeleteDevice(device: Device): Promise; undeleteDevices(devices: Array): Promise>; /** * * Permanently deletes a device. * @param id id of the device to purge * @param rev latest revision of the device * @throws RevisionConflictException if the provided revision doesn't match the latest known revision */ purgeDeviceById(id: string, rev: string): Promise; purgeDevicesByIds(entityIds: Array): Promise>; purgeDevice(device: Device): Promise; purgeDevices(devices: Array): Promise>; filterDevicesBy(filter: BaseFilterOptions): Promise>; filterDevicesBySorted(filter: BaseSortableFilterOptions): Promise>; matchDevicesBy(filter: BaseFilterOptions): Promise>; matchDevicesBySorted(filter: BaseSortableFilterOptions): Promise>; /** * * Subscribe to receive real-time notifications when an entity is updated. * @param events the type of events that will be notified to the subscription * @param filter the subscription will receive notifications only for entities matching this filter, you should * make the filter as restrictive as possible. * @param subscriptionConfig customize the configuration for the subscription * @return a subscription that receives notifications for the configured events. */ subscribeToEvents(events: Array, filter: FilterOptions, options?: { subscriptionConfig?: EntitySubscriptionConfiguration | undefined; }): Promise>; }