{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-lightsail/json-schema/amazon-lightsail-enable-add-on-request-schema.json",
  "title": "EnableAddOnRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-lightsail-account-api-openapi.yml#/components/schemas/EnableAddOnRequest",
  "type": "object",
  "properties": {
    "resourceName": {
      "allOf": [
        {
          "$ref": "#/$defs/ResourceName"
        }
      ],
      "description": "The name of the source resource for which to enable or modify the add-on."
    },
    "addOnRequest": {
      "allOf": [
        {
          "$ref": "#/$defs/AddOnRequest"
        }
      ],
      "description": "An array of strings representing the add-on to enable or modify."
    }
  },
  "required": [
    "resourceName",
    "addOnRequest"
  ],
  "$defs": {
    "AddOnRequest": {
      "type": "object",
      "properties": {
        "addOnType": {
          "allOf": [
            {
              "$ref": "#/$defs/AddOnType"
            }
          ],
          "description": "The add-on type."
        },
        "autoSnapshotAddOnRequest": {
          "allOf": [
            {
              "$ref": "#/$defs/AutoSnapshotAddOnRequest"
            }
          ],
          "description": "An object that represents additional parameters when enabling or modifying the automatic snapshot add-on."
        },
        "stopInstanceOnIdleRequest": {
          "allOf": [
            {
              "$ref": "#/$defs/StopInstanceOnIdleRequest"
            }
          ],
          "description": "An object that represents additional parameters when enabling or modifying the StopInstanceOnIdle add-on. This object only applies to Lightsail for Research resources."
        }
      },
      "required": [
        "addOnType"
      ],
      "description": "Describes a request to enable, modify, or disable an add-on for an Amazon Lightsail resource. An additional cost may be associated with enabling add-ons. For more information, see the Lightsail pricing page ."
    },
    "AddOnType": {
      "type": "string",
      "enum": [
        "AutoSnapshot",
        "StopInstanceOnIdle"
      ]
    },
    "AutoSnapshotAddOnRequest": {
      "type": "object",
      "properties": {
        "snapshotTimeOfDay": {
          "allOf": [
            {
              "$ref": "#/$defs/TimeOfDay"
            }
          ],
          "description": "The daily time when an automatic snapshot will be created. Constraints: Must be in HH:00 format, and in an hourly increment. Specified in Coordinated Universal Time (UTC). The snapshot will be automatically created between the time specified and up to 45 minutes after."
        }
      },
      "description": "Describes a request to enable or modify the automatic snapshot add-on for an Amazon Lightsail instance or disk. When you modify the automatic snapshot time for a resource, it is typically effective immediately except under the following conditions: If an automatic snapshot has been created for the current day, and you change the snapshot time to a later time of day, then the new snapshot time will be effective the following day. This ensures that two snapshots are not created for the current day. If an automatic snapshot has not yet been created for the current day, and you change the snapshot time to an earlier time of day, then the new snapshot time will be effective the following day and a snapshot is automatically created at the previously set time for the current day. This ensures that a snapshot is created for the current day. If an automatic snapshot has not yet been created for the current day, and you change the snapshot time to a time that is within 30 minutes from your current time, then the new snapshot time will be effective the following day and a snapshot is automatically created at the previously set time for the current day. This ensures that a snapshot is created for the current day, because 30 minutes is required between your current time and the new snapshot time that you specify. If an automatic snapshot is scheduled to be created within 30 minutes from your current time and you change the snapshot time, then the new snapshot time will be effective the following day and a snapshot is automatically created at the previously set time for the current day. This ensures that a snapshot is created for the current day, because 30 minutes is required between your current time and the new snapshot time that you specify."
    },
    "ResourceName": {
      "type": "string",
      "pattern": "^\\w[\\w\\-]*\\w$"
    },
    "StopInstanceOnIdleRequest": {
      "type": "object",
      "properties": {
        "threshold": {
          "allOf": [
            {
              "$ref": "#/$defs/string"
            }
          ],
          "description": "The value to compare with the duration."
        },
        "duration": {
          "allOf": [
            {
              "$ref": "#/$defs/string"
            }
          ],
          "description": "The amount of idle time in minutes after which your virtual computer will automatically stop."
        }
      },
      "description": "Describes a request to create or edit the StopInstanceOnIdle add-on. This add-on only applies to Lightsail for Research resources."
    },
    "TimeOfDay": {
      "type": "string",
      "pattern": "^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$"
    },
    "string": {
      "type": "string"
    }
  }
}