{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/userclouds/json-schema/userclouds-userstore-accessor-schema.json",
  "title": "UserstoreAccessor",
  "x-generated": "2026-10-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/userstore.yaml#/components/schemas/UserstoreAccessor",
  "properties": {
    "access_policy": {
      "$ref": "#/$defs/UserstoreResourceID"
    },
    "are_column_access_policies_overridden": {
      "description": "Whether to column access policies are overridden for this accessor.",
      "type": "boolean"
    },
    "columns": {
      "items": {
        "$ref": "#/$defs/UserstoreColumnOutputConfig"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "data_life_cycle_state": {
      "$ref": "#/$defs/UserstoreDataLifeCycleState"
    },
    "description": {
      "type": "string"
    },
    "id": {
      "$ref": "#/$defs/UuidUUID"
    },
    "is_audit_logged": {
      "description": "Whether this accessor is audit logged each time it is executed.",
      "type": "boolean"
    },
    "is_autogenerated": {
      "description": "Whether this accessor is autogenerated.",
      "type": "boolean"
    },
    "is_system": {
      "description": "Whether this accessor is a system accessor. System accessors cannot be deleted or modified. This property cannot be changed.",
      "type": "boolean"
    },
    "name": {
      "type": "string"
    },
    "purposes": {
      "items": {
        "$ref": "#/$defs/UserstoreResourceID"
      },
      "type": [
        "array",
        "null"
      ]
    },
    "selector_config": {
      "$ref": "#/$defs/UserstoreUserSelectorConfig"
    },
    "token_access_policy": {
      "$ref": "#/$defs/UserstoreResourceID"
    },
    "use_search_index": {
      "description": "If true, the accessor will use a search index to look up the users that match the selector. This can only be true if the selector refers to a single column with a concrete data type of string and uses the LIKE or ILIKE operator, and the column has the SearchIndexed flag set.",
      "type": "boolean"
    },
    "version": {
      "type": "integer"
    }
  },
  "required": [
    "name",
    "selector_config",
    "purposes",
    "columns",
    "access_policy"
  ],
  "type": "object",
  "$defs": {
    "UserstoreColumnOutputConfig": {
      "properties": {
        "column": {
          "$ref": "#/$defs/UserstoreResourceID"
        },
        "token_access_policy": {
          "$ref": "#/$defs/UserstoreResourceID"
        },
        "transformer": {
          "$ref": "#/$defs/UserstoreResourceID"
        }
      },
      "type": "object"
    },
    "UserstoreDataLifeCycleState": {
      "enum": [
        "",
        "live",
        "postdelete",
        "predelete",
        "softdeleted"
      ],
      "type": "string"
    },
    "UserstoreResourceID": {
      "properties": {
        "id": {
          "$ref": "#/$defs/UuidUUID"
        },
        "name": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "UserstoreUserSelectorConfig": {
      "properties": {
        "where_clause": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "UuidUUID": {
      "format": "uuid",
      "type": "string"
    }
  }
}