{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/canonical/main/json-schema/canonical-patched-device-certificate-schema.json",
  "title": "PatchedDeviceCertificate",
  "description": "Device Certificate Serializer class.",
  "x-generated": "2026-10-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/canonical-devices-api-openapi.yml#/components/schemas/PatchedDeviceCertificate",
  "type": "object",
  "properties": {
    "csr": {
      "type": "string",
      "title": "Device Certificate Signing Request"
    },
    "certificate": {
      "type": "string",
      "title": "Signed Device Certificate"
    },
    "ca": {
      "type": "string",
      "title": "Device Certificate Authority"
    },
    "chain": {
      "type": "string",
      "title": "Device Certificate Chain"
    },
    "status": {
      "oneOf": [
        {
          "$ref": "#/$defs/StatusEnum"
        },
        {
          "$ref": "#/$defs/BlankEnum"
        }
      ]
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "title": "Device Certificate request created"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "readOnly": true,
      "title": "Device Certificate last updated"
    }
  },
  "$defs": {
    "BlankEnum": {
      "enum": [
        ""
      ]
    },
    "StatusEnum": {
      "enum": [
        "pending",
        "signed",
        "denied"
      ],
      "type": "string",
      "description": "* `pending` - Pending\n* `signed` - Signed\n* `denied` - Denied"
    }
  }
}