{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/talend/json-schema/talend-subscription-schema.json",
  "title": "Subscription",
  "description": "Contains information related to token consumption, engines statuses and seat usages",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/talend-account-subscription-api-openapi.yml#/components/schemas/Subscription",
  "type": "object",
  "required": [
    "applications",
    "endDate",
    "enginesStatus",
    "licenseType",
    "seats",
    "startDate",
    "supportLevel",
    "tokensStatus"
  ],
  "properties": {
    "startDate": {
      "type": "string",
      "description": "Subscription start date"
    },
    "endDate": {
      "type": "string",
      "description": "Subscription end date"
    },
    "licenseType": {
      "type": "string",
      "description": "License type"
    },
    "applications": {
      "type": "array",
      "description": "Available applications",
      "items": {
        "type": "string",
        "description": "List of applications"
      }
    },
    "supportLevel": {
      "type": "string",
      "description": "Level of support"
    },
    "tokensStatus": {
      "$ref": "#/$defs/TokensStatus"
    },
    "enginesStatus": {
      "type": "array",
      "description": "Give number of engines used by type",
      "items": {
        "$ref": "#/$defs/EngineStatus"
      }
    },
    "seats": {
      "type": "array",
      "description": "Seats information by application",
      "items": {
        "$ref": "#/$defs/Seat"
      }
    }
  },
  "$defs": {
    "EngineStatus": {
      "type": "object",
      "required": [
        "consumed",
        "type"
      ],
      "description": "Information about engine status",
      "properties": {
        "type": {
          "type": "string",
          "description": "Engine type",
          "enum": [
            "RE-GEN1",
            "RE-GEN2",
            "CLOUD",
            "DYNAMIC-ENGINE-ENVIRONMENT"
          ]
        },
        "consumed": {
          "type": "integer",
          "format": "int32",
          "description": "Number of engines used by type"
        }
      }
    },
    "Seat": {
      "type": "object",
      "required": [
        "application",
        "currentUsers",
        "maxUsers"
      ],
      "description": "Seat information",
      "properties": {
        "application": {
          "type": "string",
          "description": "Name of application"
        },
        "maxUsers": {
          "type": "integer",
          "format": "int32",
          "description": "Maximum of users allowed to use the application"
        },
        "currentUsers": {
          "type": "integer",
          "format": "int32",
          "description": "Count of users currently using the application"
        }
      }
    },
    "TokensStatus": {
      "type": "object",
      "required": [
        "consumed",
        "total"
      ],
      "description": "Information about tokens",
      "properties": {
        "total": {
          "type": "integer",
          "format": "int32",
          "description": "Number of token allowed for the account"
        },
        "consumed": {
          "type": "integer",
          "format": "int32",
          "description": "Number of token currently consumed by the account"
        }
      }
    }
  }
}