{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-opensearch/json-schema/amazon-opensearch-update-direct-query-data-source-request-schema.json",
  "title": "UpdateDirectQueryDataSourceRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-opensearch-opensearch-api-openapi.yml#/components/schemas/UpdateDirectQueryDataSourceRequest",
  "type": "object",
  "properties": {
    "DataSourceName": {
      "type": "string",
      "description": "A unique, user-defined label to identify the data source within your OpenSearch Service environment."
    },
    "DataSourceType": {
      "$ref": "#/$defs/DirectQueryDataSourceType"
    },
    "Description": {
      "type": "string",
      "description": "An optional text field for providing additional context and details about the data source."
    },
    "OpenSearchArns": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "An optional list of Amazon Resource Names (ARNs) for the OpenSearch collections that are associated with the direct query data source. This field is required for CloudWatchLogs and SecurityLake datasource types."
    },
    "DataSourceAccessPolicy": {
      "type": "string",
      "description": "An optional IAM access policy document that defines the updated permissions for accessing the direct query data source. The policy document must be in valid JSON format and follow IAM policy syntax. If not specified, the existing access policy if present remains unchanged."
    }
  },
  "required": [
    "DataSourceName",
    "DataSourceType"
  ],
  "$defs": {
    "CloudWatchDirectQueryDataSource": {
      "type": "object",
      "properties": {
        "RoleArn": {
          "type": "string",
          "description": "The unique identifier of the IAM role that grants OpenSearch Service permission to access the specified data source."
        }
      },
      "required": [
        "RoleArn"
      ]
    },
    "DirectQueryDataSourceType": {
      "type": "object",
      "properties": {
        "CloudWatchLog": {
          "$ref": "#/$defs/CloudWatchDirectQueryDataSource"
        },
        "SecurityLake": {
          "$ref": "#/$defs/SecurityLakeDirectQueryDataSource"
        },
        "Prometheus": {
          "$ref": "#/$defs/PrometheusDirectQueryDataSource"
        }
      },
      "description": "Exactly one member is set."
    },
    "PrometheusDirectQueryDataSource": {
      "type": "object",
      "properties": {
        "RoleArn": {
          "type": "string",
          "description": "The unique identifier of the IAM role that grants OpenSearch Service permission to access the specified data source."
        },
        "WorkspaceArn": {
          "type": "string",
          "description": "The unique identifier of the Amazon Managed Prometheus Workspace that is associated with the specified data source."
        }
      },
      "required": [
        "RoleArn",
        "WorkspaceArn"
      ]
    },
    "SecurityLakeDirectQueryDataSource": {
      "type": "object",
      "properties": {
        "RoleArn": {
          "type": "string",
          "description": "The unique identifier of the IAM role that grants OpenSearch Service permission to access the specified data source."
        }
      },
      "required": [
        "RoleArn"
      ]
    }
  }
}