{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/customdomain-ai/json-schema/customdomain-ai-connect-target-view-schema.json",
  "title": "ConnectTargetView",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/customdomain-ai-applications-api-openapi.yml#/components/schemas/ConnectTargetView",
  "type": "object",
  "required": [
    "application_id",
    "mode",
    "edge"
  ],
  "properties": {
    "application_id": {
      "type": "string"
    },
    "mode": {
      "type": "string",
      "enum": [
        "edge",
        "custom"
      ]
    },
    "connect_target": {
      "oneOf": [
        {
          "$ref": "#/$defs/ConnectTarget"
        },
        {
          "type": "null"
        }
      ]
    },
    "edge": {
      "type": "object",
      "properties": {
        "cname_target": {
          "type": "string"
        },
        "apex_ipv4": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "warnings": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Advisory notes on a target just saved (PUT only): that `cname_target` does not resolve yet, or that with no `apex_ipv4` root domains at providers with no ALIAS-style record cannot connect."
    },
    "existing_domains": {
      "type": "object",
      "required": [
        "moved",
        "kept"
      ],
      "description": "What a PUT did to the application's existing domains (PUT only). Domains still waiting for DNS that were already on the new routing count as kept.",
      "properties": {
        "moved": {
          "type": "integer",
          "description": "Domains still waiting for DNS that took the new routing."
        },
        "kept": {
          "type": "integer",
          "description": "Every other domain, left pointing where it does: connected domains, domains whose records were supplied or written, and domains still waiting for DNS that were already on the new routing."
        }
      }
    }
  },
  "$defs": {
    "ConnectTarget": {
      "type": "object",
      "required": [
        "cname_target"
      ],
      "properties": {
        "cname_target": {
          "type": "string"
        },
        "apex_ipv4": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}