{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "/schemas/3.1.0-rc.4/core/deployment.json",
  "title": "Deployment",
  "description": "A signal deployment to a specific deployment target with activation status and key",
  "discriminator": {
    "propertyName": "type"
  },
  "oneOf": [
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "platform",
          "description": "Discriminator indicating this is a platform-based deployment"
        },
        "platform": {
          "type": "string",
          "description": "Platform identifier for DSPs"
        },
        "account": {
          "type": "string",
          "description": "Account identifier if applicable"
        },
        "is_live": {
          "type": "boolean",
          "description": "Whether signal is currently active on this deployment"
        },
        "activation_key": {
          "$ref": "/schemas/3.1.0-rc.4/core/activation-key.json",
          "description": "The key to use for targeting. Only present if is_live=true AND requester has access to this deployment."
        },
        "estimated_activation_duration_minutes": {
          "type": "number",
          "description": "Estimated time to activate if not live, or to complete activation if in progress",
          "minimum": 0
        },
        "deployed_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when activation completed (if is_live=true)"
        }
      },
      "required": [
        "type",
        "platform",
        "is_live"
      ],
      "additionalProperties": true
    },
    {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "const": "agent",
          "description": "Discriminator indicating this is an agent URL-based deployment"
        },
        "agent_url": {
          "type": "string",
          "format": "uri",
          "description": "URL identifying the deployment agent"
        },
        "account": {
          "type": "string",
          "description": "Account identifier if applicable"
        },
        "is_live": {
          "type": "boolean",
          "description": "Whether signal is currently active on this deployment"
        },
        "activation_key": {
          "$ref": "/schemas/3.1.0-rc.4/core/activation-key.json",
          "description": "The key to use for targeting. Only present if is_live=true AND requester has access to this deployment."
        },
        "estimated_activation_duration_minutes": {
          "type": "number",
          "description": "Estimated time to activate if not live, or to complete activation if in progress",
          "minimum": 0
        },
        "deployed_at": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp when activation completed (if is_live=true)"
        }
      },
      "required": [
        "type",
        "agent_url",
        "is_live"
      ],
      "additionalProperties": true
    }
  ]
}
