{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/carbon-arc/json-schema/carbon-arc-grant-bucket-access-request-schema.json",
  "title": "GrantBucketAccessRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/carbon-arc-bucket-access-api-openapi.yml#/components/schemas/GrantBucketAccessRequest",
  "properties": {
    "principal_arn": {
      "type": "string",
      "maxLength": 2048,
      "minLength": 1,
      "pattern": "^(arn:aws:iam::\\d{12}:[\\w+=,.@\\-/]+|\\d{12})$",
      "title": "Principal Arn",
      "description": "IAM principal ARN to grant access to (e.g. 'arn:aws:iam::123456789012:user/alice'), or a 12-digit AWS account id which is converted to '<id>:root'."
    },
    "client_name": {
      "type": "string",
      "maxLength": 128,
      "minLength": 1,
      "pattern": "^[a-zA-Z0-9_-]+$",
      "title": "Client Name",
      "description": "Client name; must exist in admin_config.clients."
    },
    "lag": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Lag",
      "description": "Lag of the dataset SKU to grant access to. Omit (or null) for the no-lag variant — bulk_bucket_details stores no-lag rows with lag=null."
    },
    "cut": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cut",
      "description": "Cut of the dataset SKU to grant access to. Omit (or null) for the no-cut variant — bulk_bucket_details stores no-cut rows with cut=null."
    }
  },
  "type": "object",
  "required": [
    "principal_arn",
    "client_name"
  ]
}