{
    "$schema": "http://json-schema.org/draft-06/schema#",
    "title": "Config",
    "type": "object",
    "additionalProperties": false,
    "properties": {
        "defaults": {
            "$ref": "#/definitions/Defaults"
        },
        "commands": {
            "$ref": "#/definitions/Commands"
        },
        "views": {
            "$ref": "#/definitions/Views"
        }
    },
    "definitions": {
        "Commands": {
            "title": "ConfigCommands",
            "type": "object",
            "additionalProperties": {
                "$ref": "#/definitions/Command"
            }
        },
        "Command": {
            "title": "ConfigCommand",
            "type": "object",
            "allOf": [
                {
                    "$ref": "#/definitions/Defaults"
                },
                {
                    "properties": {
                        "comment": {
                            "$ref": "#/definitions/Comment"
                        },
                        "interaction": {
                            "$ref": "#/definitions/Interaction"
                        }
                    },
                    "required": [
                    ]
                }
            ],
            "required": [
                "response"
            ]
        },
        "Views": {
            "title": "ConfigViews",
            "type": "object",
            "additionalProperties": {
                "$ref": "#/definitions/View"
            }
        },
        "Attachment": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
                "callback_id": {
                    "type": "string"
                },
                "private_metadata": {
                    "type": "string"
                }
            }
        },
        "Block": {
            "title": "ConfigViewBlock",
            "type": "object",
            "additionalProperties": true,
            "properties": {
                "callback_id": {
                    "type": "string"
                },
                "private_metadata": {
                    "type": "string"
                },
                "element": {
                  "$ref": "#/definitions/BlockElement"
                }
            }
        },
        "BlockElement": {
          "title": "ConfigViewBlockElement",
          "type": "object",
          "additionalProperties": true,
          "properties": {
            "type": {
              "type": "string"
            },
            "action_id": {
              "type": "string"
            },
            "value": {
              "type": "string"
            }
          }
        },
        "View": {
            "title": "ConfigView",
            "type": "object",
            "additionalProperties": true,
            "properties": {
                "type": {
                    "type": "string"
                },
                "attachments": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Attachment"
                    }
                },
                "blocks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/Block"
                    }
                }
            }
        },
        "Interaction": {
            "title": "ConfigInteraction",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "response": {
                    "$ref": "#/definitions/InteractionResponse"
                },
                "view": {
                    "type": "string"
                }
            }
        },
        "InteractionResponse": {
            "title": "ConfigInteractionResponse",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "type": {
                    "type": "string",
                    "enum": ["in_channel", "ephemeral"]
                },
                "text": {
                    "type": "string"
                }
            },
            "required": [
                "text"
            ]
        },
        "Comment": {
            "title": "ConfigComment",
            "type": "object",
            "additionalProperties": false,
            "properties": {
                "text": {
                    "type": "string"
                },
                "ephemeral": {
                    "type": "boolean"
                }
            },
            "required": [
                "text"
            ]
        },
        "Defaults": {
            "title": "ConfigCommandDefaults",
            "type": "object",
            "properties": {
                "comment": {
                    "$ref": "#/definitions/Comment"
                },
                "reactionOnReceived": {
                    "type": "string"
                },
                "reactionOnRelayed": {
                    "type": "string"
                },
                "reactionOnError": {
                    "type": "string"
                }
            }
        }
    }
}
