{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-incident-manager/json-schema/amazon-incident-manager-create-rotation-request-schema.json",
  "title": "CreateRotationRequest",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-incident-manager-rotation-api-openapi.yml#/components/schemas/CreateRotationRequest",
  "type": "object",
  "properties": {
    "Name": {
      "type": "string",
      "description": "The name of the rotation."
    },
    "ContactIds": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The Amazon Resource Names (ARNs) of the contacts to add to the rotation. Only the PERSONAL contact type is supported. The contact types ESCALATION and ONCALL_SCHEDULE are not supported for this operation. The order that you list the contacts in is their shift order in the rotation schedule. To change the order of the contact's shifts, use the UpdateRotation operation."
    },
    "StartTime": {
      "type": "string",
      "format": "date-time",
      "description": "The date and time that the rotation goes into effect."
    },
    "TimeZoneId": {
      "type": "string",
      "description": "The time zone to base the rotation’s activity on in Internet Assigned Numbers Authority (IANA) format. For example: \"America/Los_Angeles\", \"UTC\", or \"Asia/Seoul\". For more information, see the Time Zone Database on the IANA website. Designators for time zones that don’t support Daylight Savings Time rules, such as Pacific Standard Time (PST), are not supported."
    },
    "Recurrence": {
      "$ref": "#/$defs/RecurrenceSettings"
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "Optional metadata to assign to the rotation. Tags enable you to categorize a resource in different ways, such as by purpose, owner, or environment. For more information, see Tagging Incident Manager resources in the Incident Manager User Guide."
    },
    "IdempotencyToken": {
      "type": "string",
      "description": "A token that ensures that the operation is called only once with the specified details."
    }
  },
  "required": [
    "Name",
    "ContactIds",
    "TimeZoneId",
    "Recurrence"
  ],
  "$defs": {
    "CoverageTime": {
      "type": "object",
      "properties": {
        "Start": {
          "$ref": "#/$defs/HandOffTime"
        },
        "End": {
          "$ref": "#/$defs/HandOffTime"
        }
      }
    },
    "HandOffTime": {
      "type": "object",
      "properties": {
        "HourOfDay": {
          "type": "integer",
          "description": "The hour when an on-call rotation shift begins or ends."
        },
        "MinuteOfHour": {
          "type": "integer",
          "description": "The minute when an on-call rotation shift begins or ends."
        }
      },
      "required": [
        "HourOfDay",
        "MinuteOfHour"
      ]
    },
    "MonthlySetting": {
      "type": "object",
      "properties": {
        "DayOfMonth": {
          "type": "integer",
          "description": "The day of the month when monthly recurring on-call rotations begin."
        },
        "HandOffTime": {
          "$ref": "#/$defs/HandOffTime"
        }
      },
      "required": [
        "DayOfMonth",
        "HandOffTime"
      ]
    },
    "RecurrenceSettings": {
      "type": "object",
      "properties": {
        "MonthlySettings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MonthlySetting"
          },
          "description": "Information about on-call rotations that recur monthly."
        },
        "WeeklySettings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/WeeklySetting"
          },
          "description": "Information about on-call rotations that recur weekly."
        },
        "DailySettings": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/HandOffTime"
          },
          "description": "Information about on-call rotations that recur daily."
        },
        "NumberOfOnCalls": {
          "type": "integer",
          "description": "The number of contacts, or shift team members designated to be on call concurrently during a shift. For example, in an on-call schedule that contains ten contacts, a value of 2 designates that two of them are on call at any given time."
        },
        "ShiftCoverages": {
          "type": "object",
          "additionalProperties": {
            "type": "array",
            "items": {
              "$ref": "#/$defs/CoverageTime"
            }
          },
          "description": "Information about the days of the week that the on-call rotation coverage includes."
        },
        "RecurrenceMultiplier": {
          "type": "integer",
          "description": "The number of days, weeks, or months a single rotation lasts."
        }
      },
      "required": [
        "NumberOfOnCalls",
        "RecurrenceMultiplier"
      ]
    },
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "Name of the object key."
        },
        "Value": {
          "type": "string",
          "description": "Value of the tag."
        }
      }
    },
    "WeeklySetting": {
      "type": "object",
      "properties": {
        "DayOfWeek": {
          "type": "string",
          "enum": [
            "MON",
            "TUE",
            "WED",
            "THU",
            "FRI",
            "SAT",
            "SUN"
          ],
          "description": "The day of the week when weekly recurring on-call shift rotations begins."
        },
        "HandOffTime": {
          "$ref": "#/$defs/HandOffTime"
        }
      },
      "required": [
        "DayOfWeek",
        "HandOffTime"
      ]
    }
  }
}