{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/talend/json-schema/talend-paginated-resources-crawler-model-schema.json",
  "title": "PaginatedResources_CrawlerModel",
  "description": "This object represents a whole crawler but in a paginated context.",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/talend-crawler-api-openapi.yml#/components/schemas/PaginatedResources_CrawlerModel",
  "type": "object",
  "required": [
    "limit",
    "offset",
    "total"
  ],
  "properties": {
    "data": {
      "type": "array",
      "description": "Contains the list of the crawlers",
      "items": {
        "$ref": "#/$defs/CrawlerModel"
      }
    },
    "offset": {
      "type": "integer",
      "format": "int32",
      "description": "Pagination offset"
    },
    "limit": {
      "type": "integer",
      "format": "int32",
      "description": "Pagination limit"
    },
    "total": {
      "type": "integer",
      "format": "int32",
      "description": "Total number of crawlers"
    }
  },
  "$defs": {
    "CrawlerComplete": {
      "type": "object",
      "required": [
        "connectionId",
        "createdAt",
        "createdBy",
        "id",
        "name",
        "status"
      ],
      "description": "This object represents a crawler in the complete version.",
      "properties": {
        "id": {
          "type": "string",
          "description": "The technical talend ID of the crawler"
        },
        "connectionId": {
          "type": "string",
          "description": "The technical talend ID of the connection"
        },
        "name": {
          "type": "string",
          "description": "Name of the crawler"
        },
        "description": {
          "type": "string",
          "description": "Description of the crawler"
        },
        "sharings": {
          "type": "array",
          "description": "Sharing policies",
          "items": {
            "$ref": "#/$defs/Sharing"
          }
        },
        "status": {
          "$ref": "#/$defs/Status"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time",
          "description": "The date when the crawler has been created"
        },
        "createdBy": {
          "type": "string",
          "description": "Technical ID of the talend user."
        },
        "crawledDatasets": {
          "type": "array",
          "description": "Names of the tables and views that we want to retrieve with the crawler.",
          "items": {
            "type": "string"
          }
        },
        "updateAt": {
          "type": "string",
          "format": "date-time",
          "description": "The date when the crawler has been updated"
        },
        "updatedBy": {
          "type": "string",
          "description": "Technical ID of the talend user."
        },
        "deletedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The date when the crawler has been deleted"
        },
        "deletedBy": {
          "type": "string",
          "description": "Technical ID of the talend user."
        }
      }
    },
    "CrawlerLight": {
      "type": "object",
      "required": [
        "connectionId",
        "id",
        "name",
        "runStatus"
      ],
      "description": "This object represents a crawler in the light version (only contain the status).",
      "properties": {
        "id": {
          "type": "string",
          "description": "The technical talend ID of the crawler"
        },
        "name": {
          "type": "string",
          "description": "The name of the crawler"
        },
        "connectionId": {
          "type": "string",
          "description": "The technical talend ID of the connection"
        },
        "runStatus": {
          "$ref": "#/$defs/RunStatus"
        },
        "deletedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The date when the crawler has been deleted"
        }
      }
    },
    "CrawlerModel": {
      "description": "This object represents a whole crawler. It has two formats : either complete or light.",
      "oneOf": [
        {
          "$ref": "#/$defs/CrawlerComplete"
        },
        {
          "$ref": "#/$defs/CrawlerLight"
        }
      ]
    },
    "RunStatus": {
      "type": "string",
      "description": "This object contains the different run status of the crawler."
    },
    "Sharing": {
      "type": "object",
      "required": [
        "level",
        "scimId",
        "scimType"
      ],
      "description": "This object indicate the sharing informations.",
      "properties": {
        "scimType": {
          "type": "string",
          "description": "indicate USER or GROUP",
          "enum": [
            "USER",
            "GROUP"
          ]
        },
        "scimId": {
          "type": "string",
          "description": "the scim id of the USER or GROUP"
        },
        "level": {
          "type": "string",
          "description": "the level of the sharing",
          "enum": [
            "READER",
            "WRITER",
            "OWNER"
          ]
        }
      }
    },
    "Status": {
      "type": "object",
      "required": [
        "nbDatasetsCreated",
        "nbDatasetsFailed",
        "nbDatasetsFinished",
        "nbDatasetsToCrawl",
        "nbSamplesFailed",
        "runStatus"
      ],
      "description": "This object contains informations about the crawler status",
      "properties": {
        "runStatus": {
          "$ref": "#/$defs/RunStatus"
        },
        "runStartedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The date when the run has started"
        },
        "runBy": {
          "type": "string",
          "description": "Technical ID of the talend user."
        },
        "runFinishedAt": {
          "type": "string",
          "format": "date-time",
          "description": "The date when the run has finished"
        },
        "failure": {
          "type": "string"
        },
        "nbDatasetsToCrawl": {
          "type": "integer",
          "format": "int32",
          "description": "Number of datasets to retrieve"
        },
        "nbDatasetsFinished": {
          "type": "integer",
          "format": "int32",
          "description": "Number of datasets already retrieved"
        },
        "nbDatasetsCreated": {
          "type": "integer",
          "format": "int32",
          "description": "Number of datasets tha has been created"
        },
        "nbDatasetsFailed": {
          "type": "integer",
          "format": "int32",
          "description": "Number of datasets that has not been created"
        },
        "nbSamplesFailed": {
          "type": "integer",
          "format": "int32",
          "description": "Number of samples that has not been created"
        }
      }
    }
  }
}