export default {
  "metadata": { "section": "Poll" },
  "definitions": {
    "PollNode": {
      "metadata": {
        "tsRicosNode": true,
        "examples": ["poll"],
        "features": ["POLL"],
        "description": "Provides a question with several options, where the options' cumulative total may be shown."
      },
      "properties": {
        "type": {
          "enum": ["POLL"],
          "metadata": {
            "description": "Node type. \n Must be `POLL`."
          }
        },
        "pollData": {
          "ref": "PollData",
          "metadata": {
            "description": "Poll details."
          }
        }
      },
      "optionalProperties": {
        "id": {
          "type": "string",
          "metadata": {
            "format": "NODE_ID",
            "description": "[Node ID](#node-ids)."
          }
        },
        "nodes": {
          "metadata": { "internal": true, "tsRicosNodesChildren": true },
          "elements": { "ref": "Never" }
        }
      }
    },
    "PollData": {
      "optionalProperties": {
        "containerData": {
          "ref": "PluginContainerData",
          "metadata": {
            "description": "Poll container styling."
          }
        },
        "poll": {
          "ref": "PollData_Poll",
          "metadata": {
            "description": "Poll data."
          }
        },
        "layout": {
          "ref": "PollData_Layout",
          "metadata": {
            "description": "Poll layout settings."
          }
        },
        "design": {
          "ref": "PollData_Design",
          "metadata": {
            "description": "Poll design."
          }
        }
      }
    },
    "PollData_Poll": {
      "optionalProperties": {
        "id": {
          "type": "string",
          "metadata": {
            "format": "NODE_ID",
            "description": "[Node ID](#node-ids)."
          }
        },
        "title": {
          "type": "string",
          "metadata": {
            "description": "Poll title."
          }
        },
        "creatorId": {
          "type": "string",
          "metadata": {
            "description": "Poll creator ID."
          }
        },
        "image": {
          "ref": "Media",
          "metadata": {
            "description": "Main poll image."
          }
        },
        "options": {
          "elements": {
            "ref": "PollData_Poll_Option"
          },
          "metadata": {
            "description": "Poll details."
          }
        },
        "settings": {
          "ref": "PollData_Poll_Settings",
          "metadata": {
            "description": "Poll display settings."
          }
        }
      }
    },
    "PollData_Poll_Option": {
      "optionalProperties": {
        "id": {
          "type": "string",
          "metadata": {
            "description": "Poll option ID."
          }
        },
        "title": {
          "type": "string",
          "metadata": {
            "description": "Poll option title"
          }
        },
        "image": {
          "ref": "Media",
          "metadata": {
            "description": "Image displayed with the option."
          }
        }
      }
    },
    "PollData_Poll_Settings": {
      "optionalProperties": {
        "permissions": {
          "ref": "PollData_Poll_Settings_Permissions",
          "metadata": {
            "description": "Voting permission settings."
          }
        },
        "showVoters": {
          "type": "boolean",
          "metadata": {
            "description": "Whether to display the voters in the vote results. \n Default: `true`."
          }
        },
        "showVotesCount": {
          "type": "boolean",
          "metadata": {
            "description": "Whether to display the vote count. \n Default: `true`."
          }
        }
      }
    },
    "PollData_Poll_Settings_Permissions": {
      "optionalProperties": {
        "view": {
          "metadata": {
            "emitEnum": "PollData_Poll_Settings_Permissions_ViewRole",
            "description": "Who can view the poll results."
          },
          "enum": ["CREATOR", "VOTERS", "EVERYONE"]
        },
        "vote": {
          "metadata": {
            "description": "Who can vote.",
            "emitEnum": "PollData_Poll_Settings_Permissions_VoteRole"
          },
          "enum": ["SITE_MEMBERS", "ALL"]
        },
        "allowMultipleVotes": {
          "type": "boolean",
          "metadata": {
            "description": "Whether a user can vote multiple times. \n Default: `false`"
          }
        }
      }
    },
    "PollData_Layout": {
      "optionalProperties": {
        "poll": {
          "ref": "PollData_Layout_PollLayout",
          "metadata": {
            "description": "Poll layout settings."
          }
        },
        "options": {
          "ref": "PollData_Layout_OptionLayout",
          "metadata": {
            "description": "Poll options layout settings."
          }
        }
      }
    },
    "PollData_Layout_PollLayout": {
      "optionalProperties": {
        "type": {
          "enum": ["LIST", "GRID"],
          "metadata": {
            "emitEnum": "PollData_Layout_PollLayout_Type",
            "description": "Voting options layout."
          }
        },
        "direction": {
          "enum": ["LTR", "RTL"],
          "metadata": {
            "emitEnum": "PollData_Layout_PollLayout_Direction",
            "description": "Direction of the text in the poll. Supported values: <br> - `LTR`: Left to right. <br> - `RTL`: Right to left."
          }
        },
        "enableImage": {
          "type": "boolean",
          "metadata": {
            "description": "Whether to display the main poll image. \n Default: `false`"
          }
        }
      }
    },
    "PollData_Layout_OptionLayout": {
      "optionalProperties": {
        "enableImage": {
          "type": "boolean",
          "metadata": {
            "description": "Whether to display option images. \n Defaults: `false`."
          }
        }
      }
    },
    "PollData_Design": {
      "optionalProperties": {
        "poll": {
          "ref": "PollData_Design_PollDesign",
          "metadata": {
            "description": "Poll styling."
          }
        },
        "options": {
          "ref": "PollData_Design_OptionDesign",
          "metadata": {
            "description": "Voting options styling."
          }
        }
      }
    },
    "PollData_Design_PollDesign": {
      "optionalProperties": {
        "background": {
          "ref": "PollData_Design_PollDesign_Background",
          "metadata": {
            "description": "Poll background styling."
          }
        },
        "borderRadius": {
          "type": "int32",
          "metadata": {
            "description": "Border radius in pixels."
          }
        }
      }
    },
    "PollData_Design_PollDesign_Background": {
      "discriminator": "type",
      "metadata": {
        "refUnion": [
          "PollData_Background_ColorVariant",
          "PollData_Background_ImageVariant",
          "PollData_Background_GradientVariant"
        ],
        "emitEnum": "PollData_Design_PollDesign_Background_Type"
      }
    },
    "PollData_Background_ColorVariant": {
      "properties": {
        "type": {
          "enum": ["COLOR"]
        }
      },
      "optionalProperties": {
        "color": {
          "type": "string",
          "metadata": {
            "format": "COLOR_VALUE",
            "description": "Background color as a hexademical value."
          }
        }
      }
    },
    "PollData_Background_ImageVariant": {
      "properties": {
        "type": {
          "enum": ["IMAGE"]
        }
      },
      "optionalProperties": {
        "image": {
          "ref": "Media",
          "metadata": {
            "description": "Image to use for the background."
          }
        }
      }
    },
    "PollData_Background_GradientVariant": {
      "properties": {
        "type": {
          "enum": ["GRADIENT"]
        }
      },
      "optionalProperties": {
        "gradient": {
          "ref": "PollData_Design_PollDesign_Background_Gradient",
          "metadata": {
            "description": "Gradient background details."
          }
        }
      }
    },
    "PollData_Design_PollDesign_Background_Gradient": {
      "optionalProperties": {
        "angle": {
          "type": "int32",
          "metadata": {
            "description": "Gradient angle in degrees."
          }
        },
        "startColor": {
          "type": "string",
          "metadata": {
            "format": "COLOR_VALUE",
            "description": "Start color as a hexadecimal value."
          }
        },
        "lastColor": {
          "type": "string",
          "metadata": {
            "format": "COLOR_VALUE",
            "description": "End color as a hexadecimal value."
          }
        }
      }
    },
    "PollData_Design_OptionDesign": {
      "optionalProperties": {
        "borderRadius": {
          "type": "int32",
          "metadata": {
            "description": "Border radius in pixels."
          }
        }
      }
    }
  }
}