{
    "$schema": "http://json-schema.org/draft-04/schema#",
    "title": "Storage Configuration",
    "description": "Configuration for storage. The storage is used to store the images when save function is called.",
    "type": "object",
    "anyOf": [
        {
            "properties": {
                "type": {
                    "const": "Samba",
                    "description": "The storage is a Samba storage."
                },
                "parameters": {
                    "type": "object",
                    "description": "Parameters for the storage. The parameters are different for each storage type.",
                    "properties": {
                        "ip": {
                            "type": "string",
                            "minLength": 1,
                            "description": "The IP address of the Samba server."
                        },
                        "remotePath": {
                            "type": "string",
                            "minLength": 1
                        },
                        "domain": {
                            "type": "string",
                            "minLength": 1
                        },
                        "username": {
                            "type": "string",
                            "minLength": 1
                        },
                        "password": {
                            "type": "string",
                            "minLength": 1
                        }
                    },
                    "required": [
                        "ip",
                        "remotePath",
                        "domain",
                        "username",
                        "password"
                    ]
                }
            }
        },
        {
            "properties": {
                "type": {
                    "const": "Null",
                    "description": "The storage is disabled."
                }
            }
        },
        {
            "properties": {
                "type": {
                    "const": "Internal"
                },
                "parameters": {
                    "type": "object",
                    "properties": {
                        "rootPath": {
                            "type": "string",
                            "minLength": 1,
                            "description": "The root path of the internal storage. If relative path is used, it is relative to the application's data directory."
                        }
                    }
                }
            }
        },
        {
            "properties": {
                "type": {
                    "const": "External"
                }
            }
        }
    ],
    "required": [
        "type"
    ]
}