CameraEventsApi. iOS
Api to get work with events inside player.
Get all events
Get all camera events in specific period of time ad specific event types.
See StaticsApi
to get all possible event types.
If no types specified server will return events of all possible types.
If any error would occur you would get an VMSApiError
object.
getCameraEvents(with cameraId: Int, from: Date, to: Date, types: [String]?, completion: ([VMSEvent]?, VMSApiError?))
Get the nearest event
Get the nearest event next or previous from your current date in camera archive.
See statisticsApi to get all possible event types.
If no types specified server will return events of all possible types.
If any error would occur you would get an VMSApiError
object.
func getNearestEvent(with cameraId: Int, from date: Date, types: [String]?, direction: VMSRewindDirection, completion: @escaping (VMSEvent?, VMSApiError?) -> Void)
public enum VMSRewindDirection: String {
case next
case previous
}
Create event
If any error would occur you would get an VMSApiError
object.
func createEvent(cameraId: Int, eventName: String, from: Date, completion: @escaping (VMSApiError?) -> Void)
Update event
If any error would occur you would get an VMSApiError
object.
func updateEvent(with id: Int, cameraId: Int, eventName: String, from: Date, completion: @escaping (VMSApiError?) -> Void)
Delete event
If any error would occur you would get an VMSApiError
object.
func deleteEvent(with id: Int, cameraId: Int, completion: @escaping (VMSApiError?) -> Void)