{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/oracle/main/json-schema/oracle-approval-template-schema.json",
  "title": "ApprovalTemplate",
  "description": "Group/User OCIDs of those who can approve/deny/revoke operator's request to access associated resources.",
  "x-generated": "2026-10-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/oracle-approvaltemplate-api-openapi.yml#/components/schemas/ApprovalTemplate",
  "properties": {
    "approverLevels": {
      "$ref": "#/$defs/ApproverLevels"
    },
    "autoApprovalState": {
      "description": "The auto approval state of the lockbox.",
      "enum": [
        "ENABLED",
        "DISABLED"
      ],
      "type": "string",
      "x-obmcs-top-level-enum": "#/definitions/LockboxAutoApprovalState"
    },
    "compartmentId": {
      "description": "The unique identifier (OCID) of the customer compartment where the approval template is located.",
      "type": "string"
    },
    "definedTags": {
      "additionalProperties": {
        "additionalProperties": {
          "description": "The value of the tag. Only string type is supported.\n",
          "type": "object"
        },
        "description": "Key-value pair representing predefined tags' keys and values scoped to a namespace.\nExample: `{\"bar-key\": \"value\"}`\n",
        "type": "object"
      },
      "description": "Defined tags for this resource. Each key is predefined and scoped to a namespace.\nExample: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`\n",
      "type": "object"
    },
    "displayName": {
      "description": "The approval template display name.",
      "type": "string"
    },
    "freeformTags": {
      "additionalProperties": {
        "type": "string"
      },
      "description": "Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.\nExample: `{\"bar-key\": \"value\"}`\n",
      "type": "object"
    },
    "id": {
      "description": "The unique identifier (OCID) of the approval template, which can't be changed after creation.",
      "type": "string"
    },
    "lifecycleState": {
      "description": "The current state of the approval template.",
      "enum": [
        "ACTIVE",
        "CREATING",
        "UPDATING",
        "DELETING",
        "DELETED",
        "FAILED"
      ],
      "type": "string"
    },
    "systemTags": {
      "additionalProperties": {
        "additionalProperties": {
          "description": "The value of the tag. Only string type is supported.\n",
          "type": "object"
        },
        "description": "Key-value pair representing system tags' keys and values scoped to a namespace.\nExample: `{\"bar-key\": \"value\"}`\n",
        "type": "object"
      },
      "description": "Usage of system tag keys. These predefined keys are scoped to namespaces.\nExample: `{\"orcl-cloud\": {\"free-tier-retained\": \"true\"}}`\n",
      "type": "object"
    },
    "timeCreated": {
      "description": "The time the the approval template was created. An RFC3339 formatted datetime string",
      "format": "date-time",
      "type": "string"
    },
    "timeUpdated": {
      "description": "The time the approval template was updated. An RFC3339 formatted datetime string",
      "format": "date-time",
      "type": "string"
    }
  },
  "required": [
    "id",
    "displayName",
    "compartmentId",
    "timeCreated"
  ],
  "type": "object",
  "$defs": {
    "ApproverInfo": {
      "description": "The approver data for this approver level.",
      "properties": {
        "approverId": {
          "description": "The group or user ocid of the approver for this approver level.",
          "type": "string"
        },
        "approverType": {
          "description": "The approver type of this approver level.",
          "enum": [
            "GROUP",
            "USER"
          ],
          "type": "string",
          "x-obmcs-top-level-enum": "#/definitions/ApproverType"
        },
        "domainId": {
          "description": "The identity domain ocid of the approver.",
          "type": "string"
        }
      },
      "required": [
        "approverType",
        "approverId"
      ],
      "type": "object"
    },
    "ApproverLevels": {
      "description": "The approver levels.",
      "properties": {
        "level1": {
          "$ref": "#/$defs/ApproverInfo"
        },
        "level2": {
          "$ref": "#/$defs/ApproverInfo"
        },
        "level3": {
          "$ref": "#/$defs/ApproverInfo"
        }
      },
      "required": [
        "level1"
      ],
      "type": "object"
    }
  }
}