{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wavehouse-cloud/json-schema/wavehouse-cloud-grant-patch-input-schema.json",
  "title": "GrantPatchInput",
  "description": "A JSON merge patch (RFC 7396, `application/merge-patch+json` or `application/json`): send only the fields to change. A field you leave out keeps its value; an object merges field by field; null removes an optional field (on a write-only secret, null clears it). Read-only fields are not accepted.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wavehouse-cloud-openapi.json#/components/schemas/GrantPatchInput",
  "additionalProperties": false,
  "properties": {
    "insert": {
      "additionalProperties": false,
      "description": "what the role may write to the table; absent grants no writes",
      "properties": {
        "allow_columns": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "check": {
          "additionalProperties": {
            "additionalProperties": false,
            "properties": {
              "_eq": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "_gt": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "_in": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "_lt": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "_neq": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "description": "what every inserted record must satisfy, by column",
          "type": [
            "object",
            "null"
          ]
        },
        "deny_columns": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": [
        "object",
        "null"
      ]
    },
    "select": {
      "additionalProperties": false,
      "description": "what the role may read from the table; absent grants no reads",
      "properties": {
        "allow_columns": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "allowed_aggregations": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "denied_aggregations": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "deny_columns": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "filter": {
          "additionalProperties": {
            "additionalProperties": false,
            "properties": {
              "_eq": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "_gt": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "_in": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "_lt": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "_neq": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "type": [
              "object",
              "null"
            ]
          },
          "description": "row filter, by column",
          "type": [
            "object",
            "null"
          ]
        },
        "max_execution_time": {
          "description": "milliseconds",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "max_memory_usage": {
          "description": "bytes",
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "max_rows": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        },
        "max_rows_to_read": {
          "format": "int64",
          "type": [
            "integer",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "type": "object"
}