{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/grepr/json-schema/grepr-items-collection-read-s3-data-warehouse-schema.json",
  "title": "ItemsCollectionReadS3DataWarehouse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/grepr-external-s3-data-warehouse-integration-api-openapi.yml#/components/schemas/ItemsCollectionReadS3DataWarehouse",
  "properties": {
    "items": {
      "default": [],
      "items": {
        "$ref": "#/$defs/ReadS3DataWarehouse"
      },
      "type": "array"
    }
  },
  "type": "object",
  "$defs": {
    "ReadS3DataWarehouse": {
      "properties": {
        "createdAt": {
          "description": "Timestamp when the integration was created.",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "id": {
          "description": "The integration id",
          "type": "string"
        },
        "jobIds": {
          "description": "List of job IDs associated with the integration.",
          "items": {
            "description": "List of job IDs associated with the integration.",
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        },
        "name": {
          "description": "Name of the integration.",
          "pattern": "[a-zA-Z0-9 _-]{1,128}",
          "type": "string"
        },
        "organizationId": {
          "description": "Organization ID of the integration.",
          "type": "string"
        },
        "payload": {
          "$ref": "#/$defs/S3DataWarehouse"
        },
        "teamIds": {
          "description": "The team IDs that this integration is associated with.",
          "items": {
            "description": "The team IDs that this integration is associated with.",
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        },
        "type": {
          "description": "The type of the integration. This is used to determine the payload type.",
          "enum": [
            "s3-data-warehouse"
          ],
          "type": "string"
        },
        "updatedAt": {
          "description": "Timestamp when the integration was last updated.",
          "format": "date-time",
          "readOnly": true,
          "type": "string"
        },
        "version": {
          "description": "Version of the integration. Should be increased by one for every new update in order for the write to succeed. Otherwise, a '409 Conflict' will be returned.",
          "format": "int32",
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "createdAt",
        "id",
        "jobIds",
        "name",
        "organizationId",
        "payload",
        "type",
        "updatedAt",
        "version"
      ],
      "type": "object"
    },
    "S3DataWarehouse": {
      "description": "The payload containing integration data.",
      "properties": {
        "assumeRoleArn": {
          "description": "The ARN of the role Grepr assumes to access the S3 bucket. Leave it empty to use your organization's role, the only one Grepr's hosted sites accept; the bucket's resource policy must let that role in. It can't be changed after the integration is created.",
          "pattern": "^(arn:aws:iam::[0-9]{12}:role/.*)?$",
          "type": "string"
        },
        "bucketName": {
          "description": "The name of the S3 bucket to use for the data warehouse",
          "pattern": "^[a-z0-9][a-z0-9\\-]{1,61}[a-z0-9]$",
          "type": "string"
        },
        "prefix": {
          "default": "",
          "description": "The prefix (folder) within the S3 bucket where data warehouse files will be stored",
          "type": "string"
        },
        "region": {
          "default": "us-east-1",
          "description": "The region of the S3 bucket",
          "type": "string"
        }
      },
      "required": [
        "bucketName"
      ],
      "type": "object",
      "x-type": {
        "type": "s3-data-warehouse"
      }
    }
  }
}