{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/acculynx/json-schema/acculynx-lead-sources-collection-schema.json",
  "title": "leadSourcesCollection",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/acculynx-company-api-openapi.yml#/components/schemas/leadSourcesCollection",
  "allOf": [
    {
      "$ref": "#/$defs/baseCollection"
    },
    {
      "type": "object",
      "properties": {
        "items": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/leadSource"
          }
        }
      }
    }
  ],
  "$defs": {
    "baseCollection": {
      "type": "object",
      "properties": {
        "count": {
          "type": "integer",
          "description": "The total number of items matching the current query."
        },
        "pageSize": {
          "type": "integer",
          "description": "The requested or default page size."
        },
        "pageStartIndex": {
          "type": "integer",
          "description": "The requested or default index of the first element to return."
        }
      }
    },
    "leadSource": {
      "allOf": [
        {
          "$ref": "#/$defs/leadSourceLink"
        },
        {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "children": {
              "type": [
                "array",
                "null"
              ],
              "items": {
                "$ref": "#/$defs/leadSourceChild"
              }
            }
          }
        }
      ]
    },
    "leadSourceChild": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "name": {
          "type": "string"
        },
        "parentId": {
          "type": "string",
          "format": "uuid"
        },
        "_link": {
          "type": "string",
          "description": "The URI of the LeadSource."
        }
      }
    },
    "leadSourceLink": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid"
        },
        "_link": {
          "type": "string",
          "description": "The URI of the LeadSource."
        }
      }
    }
  }
}