{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/viridi-parente/main/json-schema/viridi-parente-tb-resource-schema.json",
  "title": "TbResource",
  "description": "A JSON value representing the Resource.",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/viridi-parente-tb-resource-controller-api-openapi.yml#/components/schemas/TbResource",
  "properties": {
    "id": {
      "$ref": "#/$defs/TbResourceId",
      "description": "JSON object with the Resource Id. Specify this field to update the Resource. Referencing non-existing Resource Id will cause error. Omit this field to create new Resource."
    },
    "createdTime": {
      "type": "integer",
      "format": "int64",
      "description": "Timestamp of the resource creation, in milliseconds",
      "readOnly": true
    },
    "tenantId": {
      "$ref": "#/$defs/TenantId",
      "description": "JSON object with Tenant Id. Tenant Id of the resource can't be changed.",
      "readOnly": true
    },
    "title": {
      "type": "string",
      "description": "Resource title."
    },
    "resourceType": {
      "type": "string",
      "description": "Resource type.",
      "enum": [
        "LWM2M_MODEL",
        "JKS",
        "PKCS_12",
        "JS_MODULE",
        "IMAGE"
      ],
      "readOnly": true
    },
    "resourceKey": {
      "type": "string",
      "description": "Resource key.",
      "readOnly": true
    },
    "publicResourceKey": {
      "type": "string"
    },
    "etag": {
      "type": "string",
      "description": "Resource etag.",
      "readOnly": true
    },
    "fileName": {
      "type": "string",
      "description": "Resource file name.",
      "readOnly": true
    },
    "descriptor": {
      "$ref": "#/$defs/JsonNode"
    },
    "data": {
      "type": "string",
      "description": "Resource data."
    },
    "preview": {
      "type": "string"
    },
    "name": {
      "type": "string",
      "readOnly": true
    },
    "public": {
      "type": "boolean"
    },
    "link": {
      "type": "string",
      "readOnly": true
    },
    "publicLink": {
      "type": "string",
      "readOnly": true
    }
  },
  "$defs": {
    "JsonNode": {
      "description": "A value representing the any type (object or primitive)"
    },
    "TbResourceId": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the entity, time-based UUID v1"
        },
        "entityType": {
          "type": "string",
          "description": "string",
          "enum": [
            "TB_RESOURCE"
          ]
        }
      },
      "required": [
        "entityType",
        "id"
      ]
    },
    "TenantId": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the entity, time-based UUID v1"
        },
        "entityType": {
          "type": "string",
          "description": "string",
          "enum": [
            "TENANT"
          ]
        }
      },
      "required": [
        "entityType",
        "id"
      ]
    }
  }
}