{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "title": "Program Messaging",
  "description": "Defines the configurable share messages provided by this program.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "shareLinkOpenGraph",
    "messageLinkOpenGraph",
    "messages"
  ],
  "properties": {
    "shareLinkOpenGraph": {
      "$ref": "#/definitions/openGraph"
    },
    "messageLinkOpenGraph": {
      "$ref": "#/definitions/openGraph"
    },
    "messages": {
      "type": "array",
      "title": "Share Messages",
      "items": [
        {
          "$ref": "#/definitions/twitter"
        },
        {
          "$ref": "#/definitions/email"
        },
        {
          "$ref": "#/definitions/linkedin"
        },
        {
          "$ref": "#/definitions/sms"
        },
        {
          "$ref": "#/definitions/whatsapp"
        },
        {
          "$ref": "#/definitions/linemessenger"
        },
        {
          "$ref": "#/definitions/pinterest"
        }
      ],
      "additionalItems": false,
      "minItems": 7,
      "maxItems": 7
    }
  },
  "definitions": {
    "openGraph": {
      "type": "object",
      "title": "Share Link Open Graph",
      "properties": {
        "source": {
          "type": "string",
          "enum": [
            "HOSTED",
            "LANDING_PAGE"
          ],
          "enumNames": [
            "Hosted",
            "Landing Page"
          ],
          "default": "LANDING_PAGE"
        }
      },
      "dependencies": {
        "source": {
          "oneOf": [
            {
              "properties": {
                "source": {
                  "enum": [
                    "HOSTED"
                  ]
                },
                "title": {
                  "type": "string",
                  "title": "Title",
                  "minLength": 4
                },
                "description": {
                  "type": "string",
                  "title": "Description",
                  "minLength": 4
                },
                "image": {
                  "type": "string",
                  "title": "Image"
                }
              },
              "additionalProperties": false,
              "required": [
                "source",
                "title",
                "description"
              ]
            },
            {
              "properties": {
                "source": {
                  "enum": [
                    "LANDING_PAGE"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "source"
              ]
            }
          ]
        }
      }
    },
    "twitter": {
      "type": "object",
      "properties": {
        "shareMedium": {
          "type": "string",
          "default": "TWITTER",
          "enum": [
            "TWITTER"
          ]
        },
        "config": {
          "type": "object",
          "title": "X",
          "properties": {
            "twitterShareBody": {
              "type": "string",
              "title": "X Share Body",
              "minLength": 4
            }
          },
          "additionalProperties": false,
          "required": [
            "twitterShareBody"
          ]
        }
      },
      "additionalProperties": false
    },
    "email": {
      "type": "object",
      "properties": {
        "shareMedium": {
          "type": "string",
          "default": "EMAIL",
          "enum": [
            "EMAIL"
          ]
        },
        "config": {
          "type": "object",
          "title": "Email",
          "properties": {
            "emailShareSubject": {
              "type": "string",
              "title": "Email Share Subject",
              "minLength": 4
            },
            "emailShareBody": {
              "type": "string",
              "title": "Email Share Body",
              "minLength": 4
            }
          },
          "additionalProperties": false,
          "required": [
            "emailShareSubject",
            "emailShareBody"
          ]
        }
      },
      "additionalProperties": false
    },
    "linkedin": {
      "type": "object",
      "properties": {
        "shareMedium": {
          "type": "string",
          "default": "LINKEDIN",
          "enum": [
            "LINKEDIN"
          ]
        },
        "config": {
          "type": "object",
          "title": "LinkedIn",
          "properties": {
            "linkedinShareSubject": {
              "type": "string",
              "title": "LinkedIn Share Subject",
              "minLength": 4
            },
            "linkedinShareBody": {
              "type": "string",
              "title": "LinkedIn Share Body",
              "minLength": 4
            },
            "linkedinShareImageURL": {
              "type": "string",
              "title": "LinkedIn URL Image"
            }
          },
          "additionalProperties": false,
          "required": [
            "linkedinShareSubject",
            "linkedinShareBody"
          ]
        }
      },
      "additionalProperties": false
    },
    "sms": {
      "type": "object",
      "properties": {
        "shareMedium": {
          "type": "string",
          "default": "SMS",
          "enum": [
            "SMS"
          ]
        },
        "config": {
          "type": "object",
          "title": "SMS",
          "properties": {
            "smsShareBody": {
              "type": "string",
              "title": "SMS Share Body",
              "minLength": 4
            }
          },
          "additionalProperties": false,
          "required": [
            "smsShareBody"
          ]
        }
      },
      "additionalProperties": false
    },
    "whatsapp": {
      "type": "object",
      "properties": {
        "shareMedium": {
          "type": "string",
          "default": "WHATSAPP",
          "enum": [
            "WHATSAPP"
          ]
        },
        "config": {
          "type": "object",
          "title": "WhatsApp",
          "properties": {
            "whatsAppShareBody": {
              "type": "string",
              "title": "WhatsApp Share Body",
              "minLength": 4
            }
          },
          "additionalProperties": false,
          "required": [
            "whatsAppShareBody"
          ]
        }
      },
      "additionalProperties": false
    },
    "linemessenger": {
      "type": "object",
      "properties": {
        "shareMedium": {
          "type": "string",
          "default": "LINEMESSENGER",
          "enum": [
            "LINEMESSENGER"
          ]
        },
        "config": {
          "type": "object",
          "title": "Line Messenger",
          "properties": {
            "lineMessengerShareBody": {
              "type": "string",
              "title": "Line Messenger Share Body",
              "minLength": 4
            }
          },
          "additionalProperties": false,
          "required": [
            "lineMessengerShareBody"
          ]
        }
      },
      "additionalProperties": false
    },
    "pinterest": {
      "type": "object",
      "properties": {
        "shareMedium": {
          "type": "string",
          "default": "PINTEREST",
          "enum": [
            "PINTEREST"
          ]
        },
        "config": {
          "type": "object",
          "title": "Pinterest",
          "properties": {
            "pinterestImageURL": {
              "type": "string",
              "title": "Pinterest Image URL"
            },
            "pinterestShareBody": {
              "type": "string",
              "title": "Pinterest Share Body",
              "minLength": 4
            }
          },
          "additionalProperties": false
        }
      },
      "additionalProperties": false
    }
  }
}