{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-opensearch/json-schema/amazon-opensearch-attach-data-source-request-schema.json",
  "title": "AttachDataSourceRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-opensearch-operations-api-openapi.yml#/components/schemas/AttachDataSourceRequest",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "The unique identifier or name of the OpenSearch application to attach the data source to. This is the same identifier used with UpdateApplication, GetApplication, and DeleteApplication."
    },
    "dataSourceArn": {
      "type": "string"
    },
    "workspaceId": {
      "type": "string",
      "description": "The identifier of an existing workspace to update with the new data source. Mutually exclusive with workspaceConfiguration."
    },
    "workspaceConfiguration": {
      "$ref": "#/$defs/WorkspaceConfigurationInput"
    },
    "clientToken": {
      "type": "string",
      "description": "A unique, case-sensitive identifier to ensure idempotency of the request. If you retry a request with the same client token and the same parameters, the retry succeeds without performing any further actions."
    }
  },
  "required": [
    "id",
    "dataSourceArn"
  ],
  "$defs": {
    "WorkspaceConfigurationInput": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The name of the workspace to create. Must be between 1 and 40 characters and can contain alphanumeric characters, parentheses, brackets, hyphens, underscores, and spaces."
        },
        "workspaceType": {
          "type": "string",
          "description": "The type of workspace to create, which determines the use-case features enabled for the workspace. Valid values are OBSERVABILITY, SECURITY_ANALYTICS, and SEARCH."
        }
      },
      "required": [
        "name",
        "workspaceType"
      ]
    }
  }
}