{
    "title": "calendars",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "javaType": "com.sos.joc.model.calendar.Calendars",
    "type": "object",
    "required": [
        "deliveryDate",
        "calendars"
    ],
    "properties": {
        "deliveryDate": {
            "description": "Date time. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
            "type": "string",
            "format": "date-time"
        },
        "calendars": {
            "type": "array",
            "items": {
                "javaType": "com.sos.joc.model.calendar.Calendar",
                "type": "object",
                "properties": {
                    "id": {
                        "type": "number",
                        "format": "utc-millisec",
                        "minimum": 0
                    },
                    "path": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    },
                    "name": {
                        "type": "string",
                        "pattern": "^[^/\\<>?:\"|*]*$",
                        "maxLength": 255
                    },
                    "basedOn": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    },
                    "documentation": {
                        "description": "absolute path based on live folder of a JobScheduler object.",
                        "type": "string",
                        "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                        "maxLength": 255
                    },
                    "type": {
                        "javaType": "com.sos.joc.model.calendar.CalendarType",
                        "type": "string",
                        "enum": [
                            "WORKING_DAYS",
                            "NON_WORKING_DAYS",
                            "JOB",
                            "ORDER",
                            "SCHEDULE"
                        ],
                        "default": "WORKING_DAYS"
                    },
                    "category": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "title": {
                        "type": "string",
                        "pattern": "^[^<>]*$",
                        "maxLength": 255
                    },
                    "from": {
                        "description": "ISO date YYYY-MM-DD",
                        "type": "string",
                        "format": "date"
                    },
                    "to": {
                        "description": "ISO date YYYY-MM-DD",
                        "type": "string",
                        "format": "date"
                    },
                    "periods": {
                        "type": "array",
                        "items": {
                            "javaType": "com.sos.joc.model.calendar.Period",
                            "type": "object",
                            "properties": {
                                "singleStart": {
                                    "type": "string",
                                    "pattern": "^[0-9:]*$"
                                },
                                "begin": {
                                    "type": "string",
                                    "pattern": "^[0-9:]*$"
                                },
                                "end": {
                                    "type": "string",
                                    "pattern": "^[0-9:]*$"
                                },
                                "repeat": {
                                    "type": "string",
                                    "pattern": "^[0-9:]*$"
                                },
                                "absoluteRepeat": {
                                    "type": "string",
                                    "pattern": "^[0-9:]*$"
                                },
                                "whenHoliday": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                }
                            }
                        }
                    },
                    "includes": {
                        "javaType": "com.sos.joc.model.calendar.Frequencies",
                        "type": "object",
                        "properties": {
                            "dates": {
                                "type": "array",
                                "items": {
                                    "description": "ISO date YYYY-MM-DD",
                                    "type": "string",
                                    "format": "date"
                                }
                            },
                            "weekdays": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.WeekDays",
                                    "type": "object",
                                    "required": [
                                        "days"
                                    ],
                                    "properties": {
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "days": {
                                            "type": "array",
                                            "items": {
                                                "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 7
                                            }
                                        }
                                    }
                                }
                            },
                            "monthdays": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.MonthDays",
                                    "type": "object",
                                    "properties": {
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "days": {
                                            "type": "array",
                                            "items": {
                                                "description": "digit from 1-31",
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 31
                                            }
                                        },
                                        "weeklyDays": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.WeeklyDay",
                                                "type": "object",
                                                "properties": {
                                                    "day": {
                                                        "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 7
                                                    },
                                                    "weekOfMonth": {
                                                        "type": "integer",
                                                        "minimum": 1,
                                                        "maximum": 5
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            "ultimos": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.MonthDays",
                                    "type": "object",
                                    "properties": {
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "days": {
                                            "type": "array",
                                            "items": {
                                                "description": "digit from 1-31",
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 31
                                            }
                                        },
                                        "weeklyDays": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.WeeklyDay",
                                                "type": "object",
                                                "properties": {
                                                    "day": {
                                                        "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 7
                                                    },
                                                    "weekOfMonth": {
                                                        "type": "integer",
                                                        "minimum": 1,
                                                        "maximum": 5
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            "months": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.Months",
                                    "type": "object",
                                    "required": [
                                        "months"
                                    ],
                                    "properties": {
                                        "months": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 12
                                            }
                                        },
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "weekdays": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.WeekDays",
                                                "type": "object",
                                                "required": [
                                                    "days"
                                                ],
                                                "properties": {
                                                    "from": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "to": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "days": {
                                                        "type": "array",
                                                        "items": {
                                                            "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 7
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "monthdays": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.MonthDays",
                                                "type": "object",
                                                "properties": {
                                                    "from": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "to": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "days": {
                                                        "type": "array",
                                                        "items": {
                                                            "description": "digit from 1-31",
                                                            "type": "integer",
                                                            "minimum": 1,
                                                            "maximum": 31
                                                        }
                                                    },
                                                    "weeklyDays": {
                                                        "type": "array",
                                                        "items": {
                                                            "javaType": "com.sos.joc.model.calendar.WeeklyDay",
                                                            "type": "object",
                                                            "properties": {
                                                                "day": {
                                                                    "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "maximum": 7
                                                                },
                                                                "weekOfMonth": {
                                                                    "type": "integer",
                                                                    "minimum": 1,
                                                                    "maximum": 5
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "ultimos": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.MonthDays",
                                                "type": "object",
                                                "properties": {
                                                    "from": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "to": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "days": {
                                                        "type": "array",
                                                        "items": {
                                                            "description": "digit from 1-31",
                                                            "type": "integer",
                                                            "minimum": 1,
                                                            "maximum": 31
                                                        }
                                                    },
                                                    "weeklyDays": {
                                                        "type": "array",
                                                        "items": {
                                                            "javaType": "com.sos.joc.model.calendar.WeeklyDay",
                                                            "type": "object",
                                                            "properties": {
                                                                "day": {
                                                                    "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "maximum": 7
                                                                },
                                                                "weekOfMonth": {
                                                                    "type": "integer",
                                                                    "minimum": 1,
                                                                    "maximum": 5
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            "holidays": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.Holidays",
                                    "type": "object",
                                    "properties": {
                                        "nationalCalendar": {
                                            "type": "string",
                                            "pattern": "^[^<>]*$",
                                            "maxLength": 255
                                        },
                                        "dates": {
                                            "type": "array",
                                            "items": {
                                                "description": "ISO date YYYY-MM-DD",
                                                "type": "string",
                                                "format": "date"
                                            }
                                        }
                                    }
                                }
                            },
                            "repetitions": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.Repetition",
                                    "type": "object",
                                    "required": [
                                        "repetition"
                                    ],
                                    "properties": {
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "repetition": {
                                            "javaType": "com.sos.joc.model.calendar.RepetitionText",
                                            "type": "string",
                                            "enum": [
                                                "DAILY",
                                                "WEEKLY",
                                                "MONTHLY",
                                                "YEARLY"
                                            ]
                                        },
                                        "step": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "default": 1
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "excludes": {
                        "javaType": "com.sos.joc.model.calendar.Frequencies",
                        "type": "object",
                        "properties": {
                            "dates": {
                                "type": "array",
                                "items": {
                                    "description": "ISO date YYYY-MM-DD",
                                    "type": "string",
                                    "format": "date"
                                }
                            },
                            "weekdays": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.WeekDays",
                                    "type": "object",
                                    "required": [
                                        "days"
                                    ],
                                    "properties": {
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "days": {
                                            "type": "array",
                                            "items": {
                                                "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 7
                                            }
                                        }
                                    }
                                }
                            },
                            "monthdays": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.MonthDays",
                                    "type": "object",
                                    "properties": {
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "days": {
                                            "type": "array",
                                            "items": {
                                                "description": "digit from 1-31",
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 31
                                            }
                                        },
                                        "weeklyDays": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.WeeklyDay",
                                                "type": "object",
                                                "properties": {
                                                    "day": {
                                                        "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 7
                                                    },
                                                    "weekOfMonth": {
                                                        "type": "integer",
                                                        "minimum": 1,
                                                        "maximum": 5
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            "ultimos": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.MonthDays",
                                    "type": "object",
                                    "properties": {
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "days": {
                                            "type": "array",
                                            "items": {
                                                "description": "digit from 1-31",
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 31
                                            }
                                        },
                                        "weeklyDays": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.WeeklyDay",
                                                "type": "object",
                                                "properties": {
                                                    "day": {
                                                        "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                        "type": "integer",
                                                        "minimum": 0,
                                                        "maximum": 7
                                                    },
                                                    "weekOfMonth": {
                                                        "type": "integer",
                                                        "minimum": 1,
                                                        "maximum": 5
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            "months": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.Months",
                                    "type": "object",
                                    "required": [
                                        "months"
                                    ],
                                    "properties": {
                                        "months": {
                                            "type": "array",
                                            "items": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 12
                                            }
                                        },
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "weekdays": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.WeekDays",
                                                "type": "object",
                                                "required": [
                                                    "days"
                                                ],
                                                "properties": {
                                                    "from": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "to": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "days": {
                                                        "type": "array",
                                                        "items": {
                                                            "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                            "type": "integer",
                                                            "minimum": 0,
                                                            "maximum": 7
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "monthdays": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.MonthDays",
                                                "type": "object",
                                                "properties": {
                                                    "from": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "to": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "days": {
                                                        "type": "array",
                                                        "items": {
                                                            "description": "digit from 1-31",
                                                            "type": "integer",
                                                            "minimum": 1,
                                                            "maximum": 31
                                                        }
                                                    },
                                                    "weeklyDays": {
                                                        "type": "array",
                                                        "items": {
                                                            "javaType": "com.sos.joc.model.calendar.WeeklyDay",
                                                            "type": "object",
                                                            "properties": {
                                                                "day": {
                                                                    "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "maximum": 7
                                                                },
                                                                "weekOfMonth": {
                                                                    "type": "integer",
                                                                    "minimum": 1,
                                                                    "maximum": 5
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        },
                                        "ultimos": {
                                            "type": "array",
                                            "items": {
                                                "javaType": "com.sos.joc.model.calendar.MonthDays",
                                                "type": "object",
                                                "properties": {
                                                    "from": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "to": {
                                                        "description": "ISO date YYYY-MM-DD",
                                                        "type": "string",
                                                        "format": "date"
                                                    },
                                                    "days": {
                                                        "type": "array",
                                                        "items": {
                                                            "description": "digit from 1-31",
                                                            "type": "integer",
                                                            "minimum": 1,
                                                            "maximum": 31
                                                        }
                                                    },
                                                    "weeklyDays": {
                                                        "type": "array",
                                                        "items": {
                                                            "javaType": "com.sos.joc.model.calendar.WeeklyDay",
                                                            "type": "object",
                                                            "properties": {
                                                                "day": {
                                                                    "description": "digit from 0-6, 0=Sunday, 1=Monday, ..., 6=Saturday, 7=Sunday (again)",
                                                                    "type": "integer",
                                                                    "minimum": 0,
                                                                    "maximum": 7
                                                                },
                                                                "weekOfMonth": {
                                                                    "type": "integer",
                                                                    "minimum": 1,
                                                                    "maximum": 5
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            },
                            "holidays": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.Holidays",
                                    "type": "object",
                                    "properties": {
                                        "nationalCalendar": {
                                            "type": "string",
                                            "pattern": "^[^<>]*$",
                                            "maxLength": 255
                                        },
                                        "dates": {
                                            "type": "array",
                                            "items": {
                                                "description": "ISO date YYYY-MM-DD",
                                                "type": "string",
                                                "format": "date"
                                            }
                                        }
                                    }
                                }
                            },
                            "repetitions": {
                                "type": "array",
                                "items": {
                                    "javaType": "com.sos.joc.model.calendar.Repetition",
                                    "type": "object",
                                    "required": [
                                        "repetition"
                                    ],
                                    "properties": {
                                        "from": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "to": {
                                            "description": "ISO date YYYY-MM-DD",
                                            "type": "string",
                                            "format": "date"
                                        },
                                        "repetition": {
                                            "javaType": "com.sos.joc.model.calendar.RepetitionText",
                                            "type": "string",
                                            "enum": [
                                                "DAILY",
                                                "WEEKLY",
                                                "MONTHLY",
                                                "YEARLY"
                                            ]
                                        },
                                        "step": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "default": 1
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "usedBy": {
                        "javaType": "com.sos.joc.model.calendar.UsedBy",
                        "type": "object",
                        "properties": {
                            "deliveryDate": {
                                "description": "Date time. Value is UTC timestamp in ISO 8601 YYYY-MM-DDThh:mm:ss.sZ",
                                "type": "string",
                                "format": "date-time"
                            },
                            "jobs": {
                                "type": "array",
                                "items": {
                                    "description": "absolute path based on live folder of a JobScheduler object.",
                                    "type": "string",
                                    "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                    "maxLength": 255
                                }
                            },
                            "orders": {
                                "type": "array",
                                "items": {
                                    "description": "absolute path based on live folder of a JobScheduler object.",
                                    "type": "string",
                                    "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                    "maxLength": 255
                                }
                            },
                            "jobstreams": {
                                "type": "array",
                                "items": {
                                    "type": "string",
                                    "pattern": "^[^<>]*$",
                                    "maxLength": 255
                                }
                            },
                            "schedules": {
                                "type": "array",
                                "items": {
                                    "description": "absolute path based on live folder of a JobScheduler object.",
                                    "type": "string",
                                    "pattern": "^(/|(/[^/\\<>?:\"|*]+)+)$",
                                    "maxLength": 255
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}