{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/open-government-portugal/json-schema/open-government-portugal-transfer-schema.json",
  "title": "Transfer",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/open-government-portugal-transfer-api-openapi.yml#/components/schemas/Transfer",
  "properties": {
    "comment": {
      "description": "A comment about the transfer request",
      "readOnly": true,
      "type": "string"
    },
    "created": {
      "description": "The transfer request date",
      "format": "date-time",
      "readOnly": true,
      "type": "string"
    },
    "id": {
      "description": "The transfer unique identifier",
      "readOnly": true,
      "type": "string"
    },
    "owner": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        }
      ],
      "description": "The user or organization currently owning the transfered object",
      "readOnly": true
    },
    "recipient": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        }
      ],
      "description": "The user or organization receiving the transfered object",
      "readOnly": true
    },
    "reponse_comment": {
      "description": "A comment about the transfer response",
      "readOnly": true,
      "type": "string"
    },
    "responded": {
      "description": "The transfer response date",
      "format": "date-time",
      "readOnly": true,
      "type": "string"
    },
    "status": {
      "description": "The current transfer request status",
      "enum": [
        "pending",
        "accepted",
        "refused"
      ],
      "type": "string"
    },
    "subject": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        }
      ],
      "description": "The transfered object",
      "readOnly": true
    },
    "user": {
      "allOf": [
        {
          "$ref": "#/$defs/UserReference"
        }
      ],
      "description": "The user who requested the transfer",
      "readOnly": true
    }
  },
  "type": "object",
  "$defs": {
    "BaseReference": {
      "properties": {
        "class": {
          "description": "The object class",
          "type": "string"
        },
        "id": {
          "description": "The object unique identifier",
          "type": "string"
        }
      },
      "required": [
        "class",
        "id"
      ],
      "type": "object"
    },
    "UserReference": {
      "allOf": [
        {
          "$ref": "#/$defs/BaseReference"
        },
        {
          "properties": {
            "avatar": {
              "description": "The user avatar URL",
              "type": "string"
            },
            "avatar_thumbnail": {
              "description": "The user avatar thumbnail URL. This is the square (500x500) and cropped version.",
              "type": "string"
            },
            "first_name": {
              "description": "The user first name",
              "readOnly": true,
              "type": "string"
            },
            "last_name": {
              "description": "The user larst name",
              "readOnly": true,
              "type": "string"
            },
            "page": {
              "description": "The user web page URL",
              "readOnly": true,
              "type": "string"
            },
            "slug": {
              "description": "The user permalink string",
              "readOnly": true,
              "type": "string"
            },
            "uri": {
              "description": "The API URI for this user",
              "readOnly": true,
              "type": "string"
            }
          },
          "type": "object"
        }
      ]
    }
  }
}