CameraApi. iOS
Api to get cameras information.
Get main tree
Get all cameras user has.
If request was successful you'll the list of VMSCameraTree objects. If any error would occur you would get an VMSApiError object.
getCamerasTree(search: String?, completion: ([VMSCameraTree]?, VMSApiError?))
Camera search
Get the list of cameras according to search.
If request was successful you'll the list of founded VMSCamera objects. If any error would occur you would get an VMSApiError object.
getSearchCameras(search: String, completion: ([VMSCamera]?, VMSApiError?))
cancelSearchCamerasRequest() - cancel request in case you need it
Get camera
Get specific camera information by camera's id.
If request was successful you'll get VMSCamera object. If any error would occur you would get an VMSApiError object.
getCamera(with cameraId: Int, completion: (VMSCamera?, VMSApiError?))
cancelCameraInfoRequest(with cameraId: Int) - cancel request in case you need it
Rename camera
Rename camera by it's id and with it's new name.
If request was successful you'll get updated VMSCamera object. If any error would occur you would get an VMSApiError object.
renameCamera(with id: Int, name: String, completion: (VMSCamera?, VMSApiError?))
Send report
Send report if something is wrong with the camera. See StaticsApi to get the list of possible issues.
If request was successful you'll get nil. If any error would occur you would get an VMSApiError object.
sendReport(info: VMSReportRequest, completion: (VMSApiError?))
VMSReportRequest
Object with needed info to send report.
init(issueId: Int, cameraId: Int)
issueId - id of reported issue. See StaticsApi for more information
cameraId - id of camera with issue
Get camera preview
Get camera preview of specific date. You will receive .mp4 file of camera one frame.
If request was successful you'll get url to download frame. If any error would occur you would get an VMSApiError object.
getCameraPreview(with cameraId: Int, date: String?, completion: (String?, VMSApiError?) -> Void) -> DataRequest?
cancelPreviewCameraRequest(with cameraId: Int) - cancel request in case you need it