{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/victorops/json-schema/victorops-rotation-shift-resource-schema.json",
  "title": "RotationShiftResource",
  "description": "Detailed information about a shift within a rotation group",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/victorops-openapi.yml#/components/schemas/RotationShiftResource",
  "type": "object",
  "properties": {
    "org_slug": {
      "type": "string"
    },
    "team_slug": {
      "type": "string"
    },
    "rot_id": {
      "type": "integer",
      "description": "The shift/rotation ID"
    },
    "group_id": {
      "type": "integer",
      "description": "The parent rotation group ID"
    },
    "label": {
      "type": "string",
      "description": "The name of the shift"
    },
    "timezone": {
      "type": "string",
      "description": "The timezone of the shift"
    },
    "start": {
      "type": "integer",
      "format": "int64",
      "description": "The start time of the shift in epoch milliseconds"
    },
    "duration": {
      "type": "integer",
      "description": "The duration of the shift in days"
    },
    "shifttype": {
      "type": "string",
      "description": "The type of shift: std, fts, cstm, or pho",
      "enum": [
        "std",
        "fts",
        "cstm",
        "pho"
      ]
    },
    "mask": {
      "$ref": "#/$defs/RotationMask"
    },
    "mask2": {
      "$ref": "#/$defs/RotationMask"
    },
    "mask3": {
      "$ref": "#/$defs/RotationMask"
    },
    "periods": {
      "type": "array",
      "description": "On-call periods for this shift",
      "items": {
        "$ref": "#/$defs/RotationShiftPeriod"
      }
    },
    "oncall": {
      "type": "string",
      "description": "The username of the currently on-call user"
    },
    "current": {
      "$ref": "#/$defs/RotationShiftPeriod"
    },
    "next": {
      "$ref": "#/$defs/RotationShiftPeriod"
    },
    "usernames": {
      "type": "array",
      "description": "Usernames of the members in this shift",
      "items": {
        "type": "string"
      }
    },
    "shiftMembers": {
      "type": "array",
      "description": "The members of this shift",
      "items": {
        "$ref": "#/$defs/ShiftMember"
      }
    }
  },
  "$defs": {
    "MaskTimeRange": {
      "type": "object",
      "properties": {
        "start": {
          "type": "object",
          "properties": {
            "hour": {
              "type": "number"
            },
            "minute": {
              "type": "number"
            }
          }
        },
        "end": {
          "type": "object",
          "properties": {
            "hour": {
              "type": "number"
            },
            "minute": {
              "type": "number"
            }
          }
        }
      }
    },
    "RotationMask": {
      "description": "A definition of the time range and days of the week that the rotation has on-call periods",
      "type": "object",
      "properties": {
        "day": {
          "type": "object",
          "properties": {
            "su": {
              "type": "boolean"
            },
            "m": {
              "type": "boolean"
            },
            "t": {
              "type": "boolean"
            },
            "w": {
              "type": "boolean"
            },
            "th": {
              "type": "boolean"
            },
            "f": {
              "type": "boolean"
            },
            "sa": {
              "type": "boolean"
            }
          }
        },
        "time": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/MaskTimeRange"
          }
        }
      }
    },
    "RotationShiftPeriod": {
      "type": "object",
      "description": "An on-call period within a shift",
      "properties": {
        "start": {
          "type": "integer",
          "format": "int64",
          "description": "Start time of the period in epoch milliseconds"
        },
        "end": {
          "type": "integer",
          "format": "int64",
          "description": "End time of the period in epoch milliseconds"
        },
        "username": {
          "type": "string",
          "description": "The username of the on-call user for this period"
        },
        "isRoll": {
          "type": "boolean",
          "description": "Whether this period represents a roll/handoff"
        },
        "memberSlug": {
          "type": "string",
          "description": "The slug identifier of the member"
        }
      }
    },
    "ShiftMember": {
      "type": "object",
      "properties": {
        "slug": {
          "type": "string"
        },
        "username": {
          "type": "string"
        }
      }
    }
  }
}