{
  "$id": "https://raw.githubusercontent.com/finos-labs/architecture-as-code/main/calm/draft/2024-04/meta/interface.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "defs": {
    "host-port-interface": {
      "$ref": "#/defs/interface-type",
      "properties": {
        "host": {
          "type": "string"
        },
        "port": {
          "type": "integer"
        }
      },
      "required": [
        "host",
        "port"
      ],
      "type": "object"
    },
    "hostname-interface": {
      "$ref": "#/defs/interface-type",
      "properties": {
        "hostname": {
          "type": "string"
        }
      },
      "required": [
        "hostname"
      ],
      "type": "object"
    },
    "interface-type": {
      "properties": {
        "unique-id": {
          "type": "string"
        }
      },
      "required": [
        "unique-id"
      ],
      "type": "object"
    },
    "node-interface": {
      "properties": {
        "interfaces": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "node": {
          "type": "string"
        }
      },
      "required": [
        "node"
      ],
      "type": "object"
    },
    "oauth2-audience-interface": {
      "$ref": "#/defs/interface-type",
      "properties": {
        "audiences": {
          "items": {
            "type": "string"
          },
          "minItems": 1,
          "type": "array"
        }
      },
      "required": [
        "audiences"
      ],
      "type": "object"
    },
    "path-interface": {
      "$ref": "#/defs/interface-type",
      "properties": {
        "path": {
          "type": "string"
        }
      },
      "required": [
        "path"
      ],
      "type": "object"
    },
    "rate-limit-interface": {
      "$ref": "#/defs/interface-type",
      "properties": {
        "calls": {
          "type": "number"
        },
        "key": {
          "$ref": "#/defs/rate-limit-key"
        },
        "time": {
          "type": "number"
        },
        "time-unit": {
          "$ref": "#/defs/rate-limit-time-unit"
        }
      },
      "required": [
        "key",
        "time",
        "time-unit",
        "calls"
      ],
      "type": "object"
    },
    "rate-limit-key": {
      "properties": {
        "key-type": {
          "$ref": "#/defs/rate-limit-key-type"
        },
        "static-value": {
          "type": "string"
        }
      },
      "required": [
        "key-type"
      ],
      "type": "object"
    },
    "rate-limit-key-type": {
      "enum": [
        "User",
        "IP",
        "Global",
        "Header",
        "OAuth2Client"
      ]
    },
    "rate-limit-time-unit": {
      "enum": [
        "Seconds",
        "Minutes",
        "Hours"
      ]
    },
    "url-interface": {
      "$ref": "#/defs/interface-type",
      "properties": {
        "url": {
          "type": "string"
        }
      },
      "required": [
        "url"
      ],
      "type": "object"
    }
  },
  "title": "Common Architecture Language Model Interfaces"
}