B `@sGdddeZdS)cseZdZfddZedddZedddZeddd Zedd d Zed d dZ eedddZ eedddZ Z S)Camerascstt|||_dS)N)superr__init___session)selfsession) __class__p/private/var/folders/7j/8686xlfs15q3tgljmghtvg0r0000gn/T/pip-target-isidps9b/lib/python/meraki_v0/api/cameras.pyrszCameras.__init__)serialcCs&dgdd}d|d}|j||S)z **Returns quality and retention settings for the given camera** https://developer.cisco.com/meraki/api/#!get-device-camera-quality-and-retention-settings - serial (string) r*getDeviceCameraQualityAndRetentionSettings)tags operationz /devices/z#/camera/qualityAndRetentionSettings)rget)rr metadataresourcerrr r s  z2Cameras.getDeviceCameraQualityAndRetentionSettingsc s|td|krBdddg}|d|ksBtd|dd|d|krzdd d d g}|d|ksztd |dd|d |krddg}|d |kstd|d d|dgdd}d|d}ddddddd gfdd|D}|j|||S)a **Update quality and retention settings for the given camera** https://developer.cisco.com/meraki/api/#!update-device-camera-quality-and-retention-settings - serial (string) - profileId (string): The ID of a quality and retention profile to assign to the camera. The profile's settings will override all of the per-camera quality and retention settings. If the value of this parameter is null, any existing profile will be unassigned from the camera. - motionBasedRetentionEnabled (boolean): Boolean indicating if motion-based retention is enabled(true) or disabled(false) on the camera - audioRecordingEnabled (boolean): Boolean indicating if audio recording is enabled(true) or disabled(false) on the camera - restrictedBandwidthModeEnabled (boolean): Boolean indicating if restricted bandwidth is enabled(true) or disabled(false) on the camera - quality (string): Quality of the camera. Can be one of 'Standard', 'High' or 'Enhanced'. Not all qualities are supported by every camera model. - resolution (string): Resolution of the camera. Can be one of '1280x720', '1920x1080', '1080x1080' or '2058x2058'. Not all resolutions are supported by every camera model. - motionDetectorVersion (integer): The version of the motion detector that will be used by the camera. Only applies to Gen 2 cameras. Defaults to v2. ZqualityZStandardZHighZEnhancedz"quality" cannot be "z", & must be set to one of: resolutionZ1280x720Z 1920x1080Z 1080x1080Z 2058x2058z"resolution" cannot be "ZmotionDetectorVersionz#"motionDetectorVersion" cannot be "r-updateDeviceCameraQualityAndRetentionSettings)r r z /devices/z#/camera/qualityAndRetentionSettingsZ profileIdZmotionBasedRetentionEnabledZaudioRecordingEnabledZrestrictedBandwidthModeEnabledcs&i|]\}}|kr||qSr)strip).0kv) body_paramsrr 8szICameras.updateDeviceCameraQualityAndRetentionSettings..)updatelocalsAssertionErroritemsrput)rr kwargsoptionsrrpayloadr)rr rs   $ $$ z5Cameras.updateDeviceCameraQualityAndRetentionSettingscCs&dgdd}d|d}|j||S)z **Returns video settings for the given camera** https://developer.cisco.com/meraki/api/#!get-device-camera-video-settings - serial (string) rgetDeviceCameraVideoSettings)r r z /devices/z/camera/video/settings)rr)rr rrrrr r#<s  z$Cameras.getDeviceCameraVideoSettingsc sP|tdgdd}d|d}dgfdd|D}|j|||S) a **Update video settings for the given camera** https://developer.cisco.com/meraki/api/#!update-device-camera-video-settings - serial (string) - externalRtspEnabled (boolean): Boolean indicating if external rtsp stream is exposed rupdateDeviceCameraVideoSettings)r r z /devices/z/camera/video/settingsZexternalRtspEnabledcs&i|]\}}|kr||qSr)r)rrr)rrr r^sz;Cameras.updateDeviceCameraVideoSettings..)rrrrr)rr r rrr"r)rr r$Ls  z'Cameras.updateDeviceCameraVideoSettings) networkIdcCs&dgdd}d|d}|j||S)z **Returns a list of all camera recording schedules.** https://developer.cisco.com/meraki/api/#!get-network-camera-schedules - networkId (string) rgetNetworkCameraSchedules)r r z /networks/z/camera/schedules)rr)rr%rrrrr r&bs  z!Cameras.getNetworkCameraSchedules)r%r c sX|tdgdd}d|d|d}ddgfd d |D}|j|||S) at **Generate a snapshot of what the camera sees at the specified time and return a link to that image.** https://developer.cisco.com/meraki/api/#!generate-network-camera-snapshot - networkId (string) - serial (string) - timestamp (string): [optional] The snapshot will be taken from this time on the camera. The timestamp is expected to be in ISO 8601 format. If no timestamp is specified, we will assume current time. - fullframe (boolean): [optional] If set to "true" the snapshot will be taken at full sensor resolution. This will error if used with timestamp. rgenerateNetworkCameraSnapshot)r r z /networks/z /cameras/z /snapshot timestampZ fullframecs&i|]\}}|kr||qSr)r)rrr)rrr rsz9Cameras.generateNetworkCameraSnapshot..)rrrrpost)rr%r r rrr"r)rr r'rs z%Cameras.generateNetworkCameraSnapshotc sV|tdgdd}d|d|d}dgfdd |D}|j|||S) a **Returns video link to the specified camera. If a timestamp is supplied, it links to that timestamp.** https://developer.cisco.com/meraki/api/#!get-network-camera-video-link - networkId (string) - serial (string) - timestamp (string): [optional] The video link will start at this timestamp. The timestamp is in UNIX Epoch time (milliseconds). If no timestamp is specified, we will assume current time. rgetNetworkCameraVideoLink)r r z /networks/z /cameras/z /videoLinkr(cs&i|]\}}|kr||qSr)r)rrr) query_paramsrr rsz5Cameras.getNetworkCameraVideoLink..)rrrrr)rr%r r rrparamsr)r+r r*s z!Cameras.getNetworkCameraVideoLink) __name__ __module__ __qualname__rstrr rr#r$r&r'r* __classcell__rr)rr rs &rN)objectrrrrr