{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/deputy/json-schema/deputy-access-management-list-employee-role-history-response-schema.json",
  "title": "Response to list the history of an employee role",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/deputy-access-management-employee-role-history-api-openapi.yml#/components/schemas/AccessManagementListEmployeeRoleHistoryResponse",
  "type": "object",
  "properties": {
    "success": {
      "type": "boolean"
    },
    "changes": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/modelEmployeeRoleHistory"
      }
    }
  },
  "$defs": {
    "EmployeeRoleHistoryEmployeeRoleHistoryValue": {
      "type": "object",
      "properties": {
        "title": {
          "type": "string",
          "title": "The title of the value.  Only populated for multi-valued fields (i.e. alsoReportsTo and privileges)"
        },
        "oldValue": {
          "type": "string",
          "title": "The old value of the field"
        },
        "newValue": {
          "type": "string",
          "title": "The new value of the field"
        }
      }
    },
    "EmployeeRoleHistoryFIELD_NAME": {
      "type": "string",
      "enum": [
        "FIELD_NAME_UNSPECIFIED",
        "NAME",
        "REQUIRE_2FA",
        "REPORTS_TO",
        "ALSO_REPORTS_TO",
        "PRIVILEGES"
      ],
      "default": "FIELD_NAME_UNSPECIFIED",
      "title": "The field that was changed"
    },
    "modelEmployeeRoleHistory": {
      "type": "object",
      "properties": {
        "changedAt": {
          "type": "string",
          "format": "date-time",
          "title": "The time that the change was made"
        },
        "changedBy": {
          "$ref": "#/$defs/tenantauthv2modelEmployee",
          "title": "The employee that made the change"
        },
        "fieldName": {
          "$ref": "#/$defs/EmployeeRoleHistoryFIELD_NAME",
          "title": "The field that was changed"
        },
        "values": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/EmployeeRoleHistoryEmployeeRoleHistoryValue"
          },
          "title": "The values that were changed"
        }
      }
    },
    "tenantauthv2modelEmployee": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "title": "Employee ID"
        },
        "displayName": {
          "type": "string",
          "title": "Employee display name"
        },
        "primaryLocation": {
          "$ref": "#/$defs/tenantauthv2modelEmployeeLocation",
          "title": "Primary Location"
        }
      },
      "title": "Employee with basic information"
    },
    "tenantauthv2modelEmployeeLocation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "int64",
          "title": "Location ID"
        },
        "name": {
          "type": "string",
          "title": "Location name"
        }
      },
      "title": "Primary location information"
    }
  }
}