{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/google-cloud-datastream/json-schema/google-cloud-datastream-stream-object-schema.json",
  "title": "StreamObject",
  "description": "A specific stream object (e.g a specific DB table).",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/google-cloud-datastream-projects-api-openapi.yml#/components/schemas/StreamObject",
  "properties": {
    "name": {
      "readOnly": true,
      "type": "string",
      "description": "Output only. Identifier. The object resource's name."
    },
    "customizationRules": {
      "type": "array",
      "readOnly": true,
      "items": {
        "$ref": "#/$defs/CustomizationRule"
      },
      "description": "Output only. The customization rules for the object. These rules are derived from the parent Stream's `rule_sets` and represent the intended configuration for the object."
    },
    "sourceObject": {
      "$ref": "#/$defs/SourceObjectIdentifier",
      "description": "The object identifier in the data source."
    },
    "createTime": {
      "readOnly": true,
      "description": "Output only. The creation time of the object.",
      "format": "google-datetime",
      "type": "string"
    },
    "updateTime": {
      "description": "Output only. The last update time of the object.",
      "readOnly": true,
      "format": "google-datetime",
      "type": "string"
    },
    "displayName": {
      "type": "string",
      "description": "Required. Display name."
    },
    "errors": {
      "type": "array",
      "readOnly": true,
      "items": {
        "$ref": "#/$defs/Error"
      },
      "description": "Output only. Active errors on the object."
    },
    "backfillJob": {
      "$ref": "#/$defs/BackfillJob",
      "description": "The latest backfill job that was initiated for the stream object."
    }
  },
  "type": "object",
  "$defs": {
    "BackfillJob": {
      "description": "Represents a backfill job on a specific stream object.",
      "type": "object",
      "properties": {
        "lastStartTime": {
          "type": "string",
          "format": "google-datetime",
          "readOnly": true,
          "description": "Output only. Backfill job's start time."
        },
        "state": {
          "enum": [
            "STATE_UNSPECIFIED",
            "NOT_STARTED",
            "PENDING",
            "ACTIVE",
            "STOPPED",
            "FAILED",
            "COMPLETED",
            "UNSUPPORTED"
          ],
          "readOnly": true,
          "description": "Output only. Backfill job state.",
          "type": "string"
        },
        "trigger": {
          "enum": [
            "TRIGGER_UNSPECIFIED",
            "AUTOMATIC",
            "MANUAL"
          ],
          "type": "string",
          "description": "Backfill job's triggering reason."
        },
        "errors": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Error"
          },
          "description": "Output only. Errors which caused the backfill job to fail.",
          "readOnly": true
        },
        "lastEndTime": {
          "format": "google-datetime",
          "description": "Output only. Backfill job's end time.",
          "readOnly": true,
          "type": "string"
        },
        "eventFilter": {
          "$ref": "#/$defs/EventFilter",
          "description": "Output only. The filter for performing a partial backfill."
        }
      }
    },
    "BigQueryClustering": {
      "description": "BigQuery clustering configuration.",
      "properties": {
        "columns": {
          "type": "array",
          "description": "Required. Column names to set as clustering columns.",
          "items": {
            "type": "string"
          }
        }
      },
      "type": "object"
    },
    "BigQueryPartitioning": {
      "description": "BigQuery partitioning configuration.",
      "properties": {
        "ingestionTimePartition": {
          "$ref": "#/$defs/IngestionTimePartition",
          "description": "Ingestion time partitioning."
        },
        "timeUnitPartition": {
          "$ref": "#/$defs/TimeUnitPartition",
          "description": "Time unit column partitioning."
        },
        "integerRangePartition": {
          "$ref": "#/$defs/IntegerRangePartition",
          "description": "Integer range partitioning."
        },
        "requirePartitionFilter": {
          "type": "boolean",
          "description": "Optional. If true, queries over the table require a partition filter."
        }
      },
      "type": "object"
    },
    "CustomizationRule": {
      "description": "A customization rule to apply to a set of objects.",
      "properties": {
        "bigqueryPartitioning": {
          "$ref": "#/$defs/BigQueryPartitioning",
          "description": "BigQuery partitioning rule."
        },
        "bigqueryClustering": {
          "$ref": "#/$defs/BigQueryClustering",
          "description": "BigQuery clustering rule."
        }
      },
      "type": "object"
    },
    "Error": {
      "type": "object",
      "description": "Represent a user-facing Error.",
      "properties": {
        "message": {
          "description": "A message containing more information about the error that occurred.",
          "type": "string"
        },
        "errorTime": {
          "description": "The time when the error occurred.",
          "type": "string",
          "format": "google-datetime"
        },
        "details": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object",
          "description": "Additional information about the error."
        },
        "errorUuid": {
          "type": "string",
          "description": "A unique identifier for this specific error, allowing it to be traced throughout the system in logs and API responses."
        },
        "reason": {
          "type": "string",
          "description": "A title that explains the reason for the error."
        }
      }
    },
    "EventFilter": {
      "type": "object",
      "description": "Represents a filter for included data on a stream object.",
      "properties": {
        "sqlWhereClause": {
          "description": "An SQL-query Where clause selecting which data should be included, not including the \"WHERE\" keyword. e.g., `t.key1 = 'value1' AND t.key2 = 'value2'`",
          "type": "string"
        }
      }
    },
    "IngestionTimePartition": {
      "type": "object",
      "description": "Ingestion time partitioning. see https://cloud.google.com/bigquery/docs/partitioned-tables#ingestion_time",
      "properties": {
        "partitioningTimeGranularity": {
          "enum": [
            "PARTITIONING_TIME_GRANULARITY_UNSPECIFIED",
            "PARTITIONING_TIME_GRANULARITY_HOUR",
            "PARTITIONING_TIME_GRANULARITY_DAY",
            "PARTITIONING_TIME_GRANULARITY_MONTH",
            "PARTITIONING_TIME_GRANULARITY_YEAR"
          ],
          "description": "Optional. Partition granularity",
          "type": "string"
        }
      }
    },
    "IntegerRangePartition": {
      "type": "object",
      "properties": {
        "start": {
          "type": "string",
          "description": "Required. The starting value for range partitioning (inclusive).",
          "format": "int64"
        },
        "column": {
          "type": "string",
          "description": "Required. The partitioning column."
        },
        "end": {
          "format": "int64",
          "type": "string",
          "description": "Required. The ending value for range partitioning (exclusive)."
        },
        "interval": {
          "description": "Required. The interval of each range within the partition.",
          "type": "string",
          "format": "int64"
        }
      },
      "description": "Integer range partitioning. see https://cloud.google.com/bigquery/docs/partitioned-tables#integer_range"
    },
    "MongodbObjectIdentifier": {
      "description": "MongoDB data source object identifier.",
      "properties": {
        "collection": {
          "description": "Required. The collection name.",
          "type": "string"
        },
        "database": {
          "description": "Required. The database name.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "MysqlObjectIdentifier": {
      "properties": {
        "database": {
          "description": "Required. The database name.",
          "type": "string"
        },
        "table": {
          "type": "string",
          "description": "Required. The table name."
        }
      },
      "type": "object",
      "description": "Mysql data source object identifier."
    },
    "OracleObjectIdentifier": {
      "description": "Oracle data source object identifier.",
      "properties": {
        "table": {
          "type": "string",
          "description": "Required. The table name."
        },
        "schema": {
          "type": "string",
          "description": "Required. The schema name."
        }
      },
      "type": "object"
    },
    "PostgresqlObjectIdentifier": {
      "description": "PostgreSQL data source object identifier.",
      "type": "object",
      "properties": {
        "schema": {
          "description": "Required. The schema name.",
          "type": "string"
        },
        "table": {
          "type": "string",
          "description": "Required. The table name."
        }
      }
    },
    "SalesforceObjectIdentifier": {
      "description": "Salesforce data source object identifier.",
      "properties": {
        "objectName": {
          "type": "string",
          "description": "Required. The object name."
        }
      },
      "type": "object"
    },
    "SourceObjectIdentifier": {
      "description": "Represents an identifier of an object in the data source.",
      "type": "object",
      "properties": {
        "mongodbIdentifier": {
          "$ref": "#/$defs/MongodbObjectIdentifier",
          "description": "MongoDB data source object identifier."
        },
        "oracleIdentifier": {
          "$ref": "#/$defs/OracleObjectIdentifier",
          "description": "Oracle data source object identifier."
        },
        "spannerIdentifier": {
          "$ref": "#/$defs/SpannerObjectIdentifier",
          "description": "Spanner data source object identifier."
        },
        "salesforceIdentifier": {
          "$ref": "#/$defs/SalesforceObjectIdentifier",
          "description": "Salesforce data source object identifier."
        },
        "postgresqlIdentifier": {
          "$ref": "#/$defs/PostgresqlObjectIdentifier",
          "description": "PostgreSQL data source object identifier."
        },
        "sqlServerIdentifier": {
          "$ref": "#/$defs/SqlServerObjectIdentifier",
          "description": "SQLServer data source object identifier."
        },
        "mysqlIdentifier": {
          "$ref": "#/$defs/MysqlObjectIdentifier",
          "description": "Mysql data source object identifier."
        }
      }
    },
    "SpannerObjectIdentifier": {
      "properties": {
        "schema": {
          "description": "Optional. The schema name.",
          "type": "string"
        },
        "table": {
          "type": "string",
          "description": "Required. The table name."
        }
      },
      "description": "Spanner data source object identifier.",
      "type": "object"
    },
    "SqlServerObjectIdentifier": {
      "type": "object",
      "description": "SQLServer data source object identifier.",
      "properties": {
        "schema": {
          "description": "Required. The schema name.",
          "type": "string"
        },
        "table": {
          "type": "string",
          "description": "Required. The table name."
        }
      }
    },
    "TimeUnitPartition": {
      "description": "Time unit column partitioning. see https://cloud.google.com/bigquery/docs/partitioned-tables#date_timestamp_partitioned_tables",
      "type": "object",
      "properties": {
        "partitioningTimeGranularity": {
          "description": "Optional. Partition granularity.",
          "type": "string",
          "enum": [
            "PARTITIONING_TIME_GRANULARITY_UNSPECIFIED",
            "PARTITIONING_TIME_GRANULARITY_HOUR",
            "PARTITIONING_TIME_GRANULARITY_DAY",
            "PARTITIONING_TIME_GRANULARITY_MONTH",
            "PARTITIONING_TIME_GRANULARITY_YEAR"
          ]
        },
        "column": {
          "description": "Required. The partitioning column.",
          "type": "string"
        }
      }
    }
  }
}