{
  "$schema": "https://json-schema.org/draft/2019-09/schema",
  "$id": "file:///NewtabPromoMessage.schema.json",
  "title": "PBNewtabPromoMessage",
  "description": "Message shown on the private browsing newtab page.",
  "allOf": [{ "$ref": "file:///FxMSCommon.schema.json#/$defs/Message" }],
  "type": "object",
  "properties": {
    "content": {
      "type": "object",
      "properties": {
        "hideDefault": {
          "type": "boolean",
          "description": "Should we hide the default promo after the experiment promo is dismissed."
        },
        "promoEnabled": {
          "type": "boolean",
          "description": "Should we show the promo section."
        },
        "promoType": {
          "type": "string",
          "description": "Promo type used to determine if promo should show to a given user",
          "enum": ["FOCUS", "VPN", "PIN", "COOKIE_BANNERS", "OTHER"]
        },
        "promoSectionStyle": {
          "type": "string",
          "description": "Sets the position of the promo section. Possible values are: top, below-search, bottom. Default bottom.",
          "enum": ["top", "below-search", "bottom"]
        },
        "promoTitle": {
          "type": "string",
          "description": "The text content of the promo section."
        },
        "promoTitleEnabled": {
          "type": "boolean",
          "description": "Should we show text content in the promo section."
        },
        "promoLinkText": {
          "type": "string",
          "description": "The text of the link in the promo box."
        },
        "promoHeader": {
          "type": "string",
          "description": "The title of the promo section."
        },
        "promoButton": {
          "type": "object",
          "properties": {
            "action": {
              "type": "object",
              "properties": {
                "type": {
                  "type": "string",
                  "description": "Action dispatched by the button."
                },
                "data": {
                  "type": "object"
                }
              },
              "required": ["type"],
              "additionalProperties": true
            }
          },
          "required": ["action"]
        },
        "promoLinkType": {
          "type": "string",
          "description": "Type of promo link type. Possible values: link, button. Default is link.",
          "enum": ["link", "button"]
        },
        "promoImageLarge": {
          "type": "string",
          "description": "URL for image used on the left side of the promo box, larger, showcases some feature. Default off.",
          "format": "uri"
        },
        "promoImageSmall": {
          "type": "string",
          "description": "URL for image used on the right side of the promo box, smaller, usually a logo. Default off.",
          "format": "uri"
        }
      },
      "additionalProperties": true,
      "allOf": [
        {
          "if": {
            "properties": {
              "promoEnabled": { "const": true }
            },
            "required": ["promoEnabled"]
          },
          "then": {
            "required": ["promoButton"]
          }
        }
      ]
    },
    "template": {
      "type": "string",
      "const": "pb_newtab"
    }
  },
  "additionalProperties": true,
  "required": ["targeting"]
}
