object TimelineEventTemplateTokenOption
{
  "type": "object",
  "required": [
    "label",
    "value"
  ],
  "properties": {
    "label": {
      "type": "string"
    },
    "value": {
      "type": "string"
    }
  }
}
object TimelineEventTemplateTokenUpdateRequest
{
  "type": "object",
  "example": {
    "label": "petType edit",
    "options": [
      {
        "label": "Dog",
        "value": "dog"
      },
      {
        "label": "Cat",
        "value": "cat"
      },
      {
        "label": "Bird",
        "value": "bird"
      }
    ]
  },
  "required": [
    "label"
  ],
  "properties": {
    "label": {
      "type": "string",
      "example": "petType edit",
      "description": "Used for list segmentation and reporting."
    },
    "options": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/TimelineEventTemplateTokenOption"
      },
      "example": [
        {
          "label": "Dog",
          "value": "dog"
        },
        {
          "label": "Cat",
          "value": "cat"
        },
        {
          "label": "Bird",
          "value": "bird"
        }
      ],
      "description": "If type is `enumeration`, we should have a list of options to choose from."
    },
    "objectPropertyName": {
      "type": "string",
      "description": "The name of the CRM object property. This will populate the CRM object property associated with the event. With enough of these, you can fully build CRM objects via the Timeline API."
    }
  },
  "description": "State of the token definition for update requests."
}
object TimelineEventTemplateUpdateRequest
{
  "type": "object",
  "example": {
    "id": "1001298X",
    "name": "PetSpot Registration",
    "tokens": [
      {
        "name": "petName",
        "type": "string",
        "label": "Pet Name",
        "objectPropertyName": "firstname"
      },
      {
        "name": "petAge",
        "type": "number",
        "label": "Pet Age"
      },
      {
        "name": "petColor",
        "type": "enumeration",
        "label": "Pet Color",
        "options": [
          {
            "label": "White",
            "value": "white"
          },
          {
            "label": "Black",
            "value": "black"
          },
          {
            "label": "Brown",
            "value": "brown"
          },
          {
            "label": "Yellow",
            "value": "yellow"
          },
          {
            "label": "Other",
            "value": "other"
          }
        ]
      }
    ],
    "detailTemplate": "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n  **{{question}}**: {{answer}}\n{{/each}}\n\nEDIT",
    "headerTemplate": "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})"
  },
  "required": [
    "id",
    "name",
    "tokens"
  ],
  "properties": {
    "id": {
      "type": "string",
      "example": "1001298",
      "description": "The template ID."
    },
    "name": {
      "type": "string",
      "example": "PetSpot Registration",
      "description": "The template name."
    },
    "tokens": {
      "type": "array",
      "items": {
        "$ref": "#/components/schemas/TimelineEventTemplateToken"
      },
      "example": [
        {
          "name": "petName",
          "type": "string",
          "label": "Pet Name",
          "objectPropertyName": "firstname"
        },
        {
          "name": "petAge",
          "type": "number",
          "label": "Pet Age"
        },
        {
          "name": "petColor",
          "type": "enumeration",
          "label": "Pet Color",
          "options": [
            {
              "label": "White",
              "value": "white"
            },
            {
              "label": "Black",
              "value": "black"
            },
            {
              "label": "Brown",
              "value": "brown"
            },
            {
              "label": "Yellow",
              "value": "yellow"
            },
            {
              "label": "Other",
              "value": "other"
            }
          ]
        }
      ],
      "description": "A collection of tokens that can be used as custom properties on the event and to create fully fledged CRM objects."
    },
    "detailTemplate": {
      "type": "string",
      "example": "Registration occurred at {{#formatDate timestamp}}{{/formatDate}}\n\n#### Questions\n{{#each extraData.questions}}\n  **{{question}}**: {{answer}}\n{{/each}}\n\nEDIT",
      "description": "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline when you expand the details."
    },
    "headerTemplate": {
      "type": "string",
      "example": "Registered for [{{petName}}](https://my.petspot.com/pets/{{petName}})",
      "description": "This uses Markdown syntax with Handlebars and event-specific data to render HTML on a timeline as a header."
    }
  },
  "description": "State of the template definition being updated."
}
object ValueWithTimestamp
{
  "type": "object",
  "required": [
    "sourceType",
    "timestamp",
    "value"
  ],
  "properties": {
    "value": {
      "type": "string"
    },
    "sourceId": {
      "type": "string"
    },
    "timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "sourceType": {
      "type": "string"
    },
    "sourceLabel": {
      "type": "string"
    },
    "updatedByUserId": {
      "type": "integer",
      "format": "int32"
    }
  }
}