{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/telenor-sverige/json-schema/telenor-sverige-partner-absence-response-schema.json",
  "title": "PartnerAbsenceResponse",
  "description": "A wrapper around an Absence json object",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/telenor-sverige-partner-user-api-api-openapi.yml#/components/schemas/PartnerAbsenceResponse",
  "type": "object",
  "properties": {
    "absence": {
      "$ref": "#/$defs/Absence"
    }
  },
  "$defs": {
    "Absence": {
      "type": "object",
      "required": [
        "absenceReasonId",
        "id",
        "lastChanged",
        "userId"
      ],
      "properties": {
        "userId": {
          "type": "integer",
          "format": "int64",
          "description": "The agents user id "
        },
        "id": {
          "type": "integer",
          "format": "int64",
          "description": "The ID of the absence\n\nNote that the Absence.id is conditionally mandatory for updateAbsence. If Absence.id is not set, absenceId will be used instead. \n\nFor createAbsence, the Absence.id is not required. "
        },
        "start": {
          "type": "string",
          "format": "date-time",
          "description": "Start time of the absence"
        },
        "end": {
          "type": "string",
          "format": "date-time",
          "description": "End time of the absence (can be NULL for infinite absences)\n\nSetting a timestamp earlier than present is not permitted, and will return an error. "
        },
        "absenceReasonId": {
          "type": "integer",
          "format": "int32",
          "description": "The id of the absence reason"
        },
        "action": {
          "description": "Holds the redirect action which is to be taken when this absence is active",
          "$ref": "#/$defs/AbsenceAction"
        },
        "priority": {
          "type": "integer",
          "format": "int32",
          "description": "The priority of this absence given by the user (0=low, 1=default, 2= high)"
        },
        "source": {
          "type": "string",
          "description": "The device/system/application this absence was created by (Optional)"
        },
        "lastChanged": {
          "type": "string",
          "format": "date-time",
          "description": "Shows when this absence was last modified"
        },
        "description": {
          "type": "string",
          "description": "A textual description of this absence (Optional)"
        },
        "location": {
          "type": "string",
          "description": "The location of the absence (Optional)"
        }
      }
    },
    "AbsenceAction": {
      "type": "object",
      "required": [
        "callForwardingType"
      ],
      "properties": {
        "callForwardingType": {
          "type": "string",
          "description": "Specifies the forwarding type, when used via the Telenor Sweden Partner API only these are valid: Indicative, Announced and AlertMeFirst.",
          "enum": [
            "Indicative",
            "Number",
            "Announced",
            "Vms",
            "Switchboard",
            "Colleague",
            "AlertMeFirst",
            "Busy"
          ]
        },
        "callForwardingNumber": {
          "type": "string",
          "description": "For Announced and AlertMeFirst abcenses this number is the number that will be used when caller gets option to be connected to operator after hearing absence cause."
        }
      }
    }
  }
}