{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-cloudwatch/json-schema/amazon-cloudwatch-update-scheduled-query-request-schema.json",
  "title": "UpdateScheduledQueryRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-cloudwatch-scheduled-query-api-openapi.yml#/components/schemas/UpdateScheduledQueryRequest",
  "type": "object",
  "properties": {
    "identifier": {
      "type": "string",
      "description": "The ARN or name of the scheduled query to update."
    },
    "description": {
      "type": "string",
      "description": "An updated description for the scheduled query."
    },
    "queryLanguage": {
      "type": "string",
      "enum": [
        "CWLI",
        "SQL",
        "PPL"
      ],
      "description": "The updated query language for the scheduled query."
    },
    "queryString": {
      "type": "string",
      "description": "The updated query string to execute."
    },
    "logGroupIdentifiers": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The updated array of log group names or ARNs to query."
    },
    "scheduleExpression": {
      "type": "string",
      "description": "The updated cron expression that defines when the scheduled query runs."
    },
    "timezone": {
      "type": "string",
      "description": "The updated timezone for evaluating the schedule expression."
    },
    "startTimeOffset": {
      "type": "integer",
      "description": "The updated time offset in seconds that defines the lookback period for the query."
    },
    "endTimeOffset": {
      "type": "integer",
      "description": "The updated time offset in seconds that defines the end of the lookback period for the query."
    },
    "destinationConfiguration": {
      "$ref": "#/$defs/DestinationConfiguration"
    },
    "scheduleStartTime": {
      "type": "integer",
      "description": "The updated start time for the scheduled query in Unix epoch format."
    },
    "scheduleEndTime": {
      "type": "integer",
      "description": "The updated end time for the scheduled query in Unix epoch format."
    },
    "executionRoleArn": {
      "type": "string",
      "description": "The updated ARN of the IAM role that grants permissions to execute the query and deliver results."
    },
    "state": {
      "type": "string",
      "enum": [
        "ENABLED",
        "DISABLED"
      ],
      "description": "The updated state of the scheduled query."
    }
  },
  "required": [
    "identifier",
    "queryLanguage",
    "queryString",
    "scheduleExpression",
    "executionRoleArn"
  ],
  "$defs": {
    "DestinationConfiguration": {
      "type": "object",
      "properties": {
        "s3Configuration": {
          "$ref": "#/$defs/S3Configuration"
        },
        "lookupTableConfiguration": {
          "$ref": "#/$defs/LookupTableConfiguration"
        }
      }
    },
    "LookupTableConfiguration": {
      "type": "object",
      "properties": {
        "tableName": {
          "type": "string",
          "description": "The name of the lookup table to create or update with query results. The name can contain only alphanumeric characters and underscores."
        },
        "roleArn": {
          "type": "string",
          "description": "The ARN of the IAM role that grants permissions to create or update the lookup table with query results."
        },
        "description": {
          "type": "string",
          "description": "A description of the lookup table."
        },
        "kmsKeyId": {
          "type": "string",
          "description": "The ARN of the KMS key to use to encrypt the lookup table data. If you don't specify a key, the data is encrypted with an Amazon Web Services-owned key."
        },
        "tags": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Key-value pairs to associate with the lookup table for resource management and cost allocation. The service applies tags only during initial table creation."
        }
      },
      "required": [
        "tableName",
        "roleArn"
      ]
    },
    "S3Configuration": {
      "type": "object",
      "properties": {
        "destinationIdentifier": {
          "type": "string",
          "description": "The Amazon S3 URI where query results are delivered. Must be a valid S3 URI format."
        },
        "roleArn": {
          "type": "string",
          "description": "The ARN of the IAM role that grants permissions to write query results to the specified Amazon S3 destination."
        },
        "ownerAccountId": {
          "type": "string",
          "description": "The Amazon Web Services accountId for the bucket owning account."
        },
        "kmsKeyId": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of the KMS encryption key. Must belong to the same Amazon Web Services Region as the destination Amazon S3 bucket."
        }
      },
      "required": [
        "destinationIdentifier",
        "roleArn"
      ]
    }
  }
}