{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/viridi-parente/main/json-schema/viridi-parente-rpc-schema.json",
  "title": "Rpc",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/viridi-parente-rpc-v-2-controller-api-openapi.yml#/components/schemas/Rpc",
  "properties": {
    "id": {
      "$ref": "#/$defs/RpcId",
      "description": "JSON object with the rpc Id. Referencing non-existing rpc Id will cause error."
    },
    "createdTime": {
      "type": "integer",
      "format": "int64",
      "description": "Timestamp of the rpc creation, in milliseconds",
      "readOnly": true
    },
    "tenantId": {
      "$ref": "#/$defs/TenantId",
      "description": "JSON object with Tenant Id.",
      "readOnly": true
    },
    "deviceId": {
      "$ref": "#/$defs/DeviceId",
      "description": "JSON object with Device Id.",
      "readOnly": true
    },
    "expirationTime": {
      "type": "integer",
      "format": "int64",
      "description": "Expiration time of the request.",
      "readOnly": true
    },
    "request": {
      "$ref": "#/$defs/JsonNode",
      "description": "The request body that will be used to send message to device.",
      "readOnly": true
    },
    "response": {
      "$ref": "#/$defs/JsonNode",
      "description": "The response from the device.",
      "readOnly": true
    },
    "status": {
      "type": "string",
      "description": "The current status of the RPC call.",
      "enum": [
        "QUEUED",
        "SENT",
        "DELIVERED",
        "SUCCESSFUL",
        "TIMEOUT",
        "EXPIRED",
        "FAILED",
        "DELETED"
      ],
      "readOnly": true
    },
    "additionalInfo": {
      "$ref": "#/$defs/JsonNode",
      "description": "Additional info used in the rule engine to process the updates to the RPC state.",
      "readOnly": true
    }
  },
  "$defs": {
    "DeviceId": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the entity, time-based UUID v1"
        },
        "entityType": {
          "type": "string",
          "description": "string",
          "enum": [
            "DEVICE"
          ]
        }
      },
      "required": [
        "entityType",
        "id"
      ]
    },
    "JsonNode": {
      "description": "A value representing the any type (object or primitive)"
    },
    "RpcId": {
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "description": "ID of the entity, time-based UUID v1"
        },
        "entityType": {
          "type": "string",
          "description": "string",
          "enum": [
            "RPC"
          ]
        }
      },
      "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"
      ]
    }
  }
}