{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-redshift/json-schema/amazon-redshift-batch-execute-statement-input-schema.json",
  "title": "BatchExecuteStatementInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-redshift-statement-execution-api-openapi.yml#/components/schemas/BatchExecuteStatementInput",
  "type": "object",
  "properties": {
    "Sqls": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "One or more SQL statements to run. The SQL statements run serially in the order of the array. Subsequent SQL statements don't start until the previous statement in the array completes. By default, the SQL statements are run as a single transaction. If any SQL statement fails, all work is rolled back. To change this behavior, see the ExecutionMode parameter."
    },
    "ClusterIdentifier": {
      "type": "string",
      "description": "The cluster identifier. This parameter is required when connecting to a cluster and authenticating using either Secrets Manager or temporary credentials."
    },
    "SecretArn": {
      "type": "string",
      "description": "The name or ARN of the secret that enables access to the database. This parameter is required when authenticating using Secrets Manager."
    },
    "DbUser": {
      "type": "string",
      "description": "The database user name. This parameter is required when connecting to a cluster as a database user and authenticating using temporary credentials."
    },
    "Database": {
      "type": "string",
      "description": "The name of the database. This parameter is required when authenticating using either Secrets Manager or temporary credentials."
    },
    "WithEvent": {
      "type": "boolean",
      "description": "A value that indicates whether to send an event to the Amazon EventBridge event bus after the SQL statements run."
    },
    "StatementName": {
      "type": "string",
      "description": "The name of the SQL statements. You can name the SQL statements when you create them to identify the query."
    },
    "Parameters": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SqlParameter"
      },
      "description": "The parameters for the SQL statements. The parameters are available to all SQL statements in the batch. Each statement can reference any subset of the provided parameters. Each provided parameter must be referenced by at least one SQL statement in the batch."
    },
    "WorkgroupName": {
      "type": "string",
      "description": "The serverless workgroup name or Amazon Resource Name (ARN). This parameter is required when connecting to a serverless workgroup and authenticating using either Secrets Manager or temporary credentials."
    },
    "ClientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier that you provide to ensure the idempotency of the request."
    },
    "ResultFormat": {
      "type": "string",
      "description": "The data format of the result of the SQL statement. If no format is specified, the default is JSON."
    },
    "SessionKeepAliveSeconds": {
      "type": "integer",
      "description": "The number of seconds to keep the session alive after the query finishes. The maximum time a session can keep alive is 24 hours. After 24 hours, the session is forced closed and the query is terminated."
    },
    "SessionId": {
      "type": "string",
      "description": "The session identifier of the query."
    },
    "ExecutionMode": {
      "type": "string",
      "description": "Determines how the SQL statements in the batch are run. If set to TRANSACTION (the default), all SQL statements are run as a single transaction and they are committed or rolled back together. If set to AUTO_COMMIT, each SQL statement is committed individually, and a failure of one statement does not affect the others."
    },
    "WaitTimeSeconds": {
      "type": "integer",
      "description": "The number of seconds to wait for all SQL statements in the batch to complete execution before returning the response. If the SQL statements do not complete within the specified time, the response returns the current status. The maximum value is 30 seconds."
    }
  },
  "required": [
    "Sqls"
  ],
  "$defs": {
    "SqlParameter": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the parameter."
        },
        "value": {
          "type": "string",
          "description": "The value of the parameter. Amazon Redshift implicitly converts to the proper data type. For more information, see Data types in the Amazon Redshift Database Developer Guide."
        }
      },
      "required": [
        "name",
        "value"
      ]
    }
  }
}