{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "id": "#/",
    "type": "object",
    "description": "schema definitions for ONVIF profile S",
    "onvif": {
        "ptz": {
            "AbsoluteMoveArg": {
                "$ref": "#/onvif/ptz/moveArgs"
            },
            "AbsoluteMoveResult": {
                "type": "object"
            },
            "RelativeMoveArg": {
                "$ref": "#/onvif/ptz/moveArgs"
            },
            "RelativeMoveResult": {
                "type": "object"
            },
            "ContinuousMoveArg": {
                "type": "object",
                "properties": {
                    "x": {
                        "type": "number",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "y": {
                        "type": "number",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "zoom": {
                        "type": "number",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "timeout": {
                        "type": "number"
                    }
                },
                "required": [
                    "x",
                    "y"
                ]
            },
            "ContinuousMoveResult": {
                "type": "object"
            },
            "GetPresetsArg": {
                "type": "object"
            },
            "GetPresetsResult": {
                "type": "object"
            },
            "GetNodesArg": {
                "type": "object"
            },
            "GetNodesResult": {
                "type": "object"
            },
            "GotoPresetArg": {
                "type": "object",
                "properties": {
                    "preset": {
                        "type": "string"
                    },
                    "speed": {
                        "$ref": "#/onvif/ptz/speed"
                    }
                },
                "required": [
                    "preset"
                ]
            },
            "GotoPresetResult": {
                "type": "object"
            },
            "StopArg": {
                "type": "object",
                "properties": {
                    "panTilt": {
                        "type": "boolean"
                    },
                    "zoom": {
                        "type": "boolean"
                    }
                }
            },
            "StopResult": {
                "type": "object"
            },
            "PTZStatusArg": {
                "type": "object"
            },
            "PTZStatusResult": {
                "type": "object",
                "properties": {
                    "position": {
                        "type": "object",
                        "properties": {
                            "x": {
                                "type": "number"
                            },
                            "y": {
                                "type": "number"
                            },
                            "zoom": {
                                "type": "number"
                            }
                        }
                    },
                    "moveStatus": {
                        "type": "object",
                        "properties": {
                            "PanTilt": {
                                "type": "string",
                                "enum": [
                                    "IDLE",
                                    "MOVING",
                                    "UNKNOWN"
                                ]
                            },
                            "Zoom": {
                                "type": "string",
                                "enum": [
                                    "IDLE",
                                    "MOVING",
                                    "UNKNOWN"
                                ]
                            }
                        }
                    },
                    "error": {
                        "type": "string"
                    },
                    "utcTime": {
                        "type": [
                            "string",
                            "number"
                        ]
                    }
                }
            },
            "speed": {
                "type": "object",
                "properties": {
                    "x": {
                        "type": "number",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "y": {
                        "type": "number",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "zoom": {
                        "type": "number",
                        "maximum": 1,
                        "minimum": 0
                    }
                },
                "required": [
                    "x",
                    "y"
                ]
            },
            "moveArgs": {
                "type": "object",
                "properties": {
                    "x": {
                        "type": "number",
                        "maximum": 1,
                        "minimum": -1
                    },
                    "y": {
                        "type": "number",
                        "maximum": 1,
                        "minimum": -1
                    },
                    "zoom": {
                        "type": "number",
                        "maximum": 1,
                        "minimum": 0
                    },
                    "speed": {
                        "$ref": "#/onvif/ptz/speed"
                    }
                },
                "required": [
                    "x",
                    "y"
                ]
            },
            "SpaceSelector": {
                "oneOf": [
                    {
                        "type": "string",
                        "pattern": "^http://www.onvif.org/ver10/tptz/PanTiltSpaces/PositionGenericSpace$"
                    },
                    {
                        "type": "string",
                        "pattern": "^http://www.onvif.org/ver10/tptz/PanTiltSpaces/VelocityGenericSpace$"
                    },
                    {
                        "type": "string",
                        "pattern": "^http://www.onvif.org/ver10/tptz/PanTiltSpaces/TranslationGenericSpace$"
                    },
                    {
                        "type": "string",
                        "pattern": "^http://www.onvif.org/ver10/tptz/PanTiltSpaces/GenericSpeedSpace$"
                    }
                ]
            }
        },
        "media": {
            "getStreamUriArg": {
                "type": "object",
                "properties": {
                    "streamType": {
                        "type": "string",
                        "enum": [
                            "RTP-Unicast",
                            "RTP-Multicast",
                            "MPEG"
                        ],
                        "default": "MPEG"
                    },
                    "transport": {
                        "type": "string",
                        "enum": [
                            "UDP",
                            "TCP",
                            "RTSP",
                            "HTTP",
                            "WebSocket"
                        ],
                        "default": "WebSocket"
                    }
                },
                "required": [
                    "streamType",
                    "transport"
                ]
            },
            "getStreamUriResult": {
                "type": "object",
                "properties": {
                    "streamUri": {
                        "type": "string"
                    }
                }
            },
            "getSnapshotUriArg": {
                "type": "object"
            },
            "getSnapshotUriResult": {
                "type": "object",
                "properties": {
                    "snapshotUri": {
                        "type": "string"
                    }
                }
            }
        }
    },
    "properties": {
        "onvif.ptz.AbsoluteMoveArg": {
            "$ref": "#/onvif/ptz/AbsoluteMoveArg"
        },
        "onvif.ptz.RelativeMoveArg": {
            "$ref": "#/onvif/ptz/RelativeMoveArg"
        },
        "onvif.ptz.ContinuousMoveArg": {
            "$ref": "#/onvif/ptz/ContinuousMoveArg"
        },
        "onvif.ptz.GotoPresetArg": {
            "$ref": "#/onvif/ptz/GotoPresetArg"
        },
        "onvif.ptz.StopArg": {
            "$ref": "#/onvif/ptz/StopArg"
        },
        "onvif.ptz.PTZStatusResult": {
            "$ref": "#/onvif/ptz/PTZStatusResult"
        },
        "onvif.ptz.speed": {
            "$ref": "#/onvif/ptz/speed"
        },
        "onvif.ptz.moveArgs": {
            "$ref": "#/onvif/ptz/moveArgs"
        },
        "onvif.ptz.SpaceSelector": {
            "$ref": "#/onvif/ptz/SpaceSelector"
        },
        "onvif.media.getStreamUriArg": {
            "$ref": "#/onvif/media/getStreamUriArg"
        },
        "onvif.media.getStreamUriResult": {
            "$ref": "#/onvif/media/getStreamUriResult"
        },
        "onvif.media.getSnapshotUriResult": {
            "$ref": "#/onvif/media/getSnapshotUriResult"
        }
    },
    "required": [
        "onvif.ptz.AbsoluteMoveArg",
        "onvif.ptz.RelativeMoveArg",
        "onvif.ptz.ContinuousMoveArg",
        "onvif.ptz.GotoPresetArg",
        "onvif.ptz.StopArg",
        "onvif.ptz.PTZStatusResult",
        "onvif.ptz.speed",
        "onvif.ptz.moveArgs",
        "onvif.ptz.SpaceSelector",
        "onvif.media.getStreamUriArg",
        "onvif.media.getStreamUriResult",
        "onvif.media.getSnapshotUriResult"
    ]
}