{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "title": "Studio Calendar",
    "name": "AdminCalendar",
    "description": "Studio Calendar configuration options",
    "type": "object",
    "definitions": {
        "pages": {
            "type": "object",
            "properties": {
                "style": {
                    "$ref": "#/definitions/style"
                },
                "layout": {
                    "$ref": "#/definitions/layout"
                }
            }
        },
        "style": {
            "type": "string"
        },
        "layout": {
            "type": "array",
            "items": {
                "type": "array",
                "items": {
                    "type": "object",
                    "properties": {
                        "type": {
                            "type": "string"
                        },
                        "width": {
                            "type": "number"
                        },
                        "index": {
                            "type": "number"
                        },
                        "panel_params": {
                            "type": "object"
                        }
                    }
                }
            }
        },
        "roles": {
            "type": "array",
            "items": {
                "type": "string"
            }
        }
    },
    "properties": {
        "AdminCalendar": {
            "type": "object",
            "properties": {
                "pages": {
                    "type": "object",
                    "description": "a page ...",
                    "properties": {
                        "main": {
                            "$ref": "#/definitions/pages"
                        },
                        "staff": {
                            "$ref": "#/definitions/pages"
                        },
                        "resources": {
                            "$ref": "#/definitions/pages"
                        },
                        "personal": {
                            "$ref": "#/definitions/pages"
                        },
                        "location": {
                            "$ref": "#/definitions/pages"
                        },
                        "agenda": {
                            "$ref": "#/definitions/pages"
                        },
                        "roles": {
                            "$ref": "#/definitions/roles"
                        }
                    },
                    "required": [
                        "roles"
                    ]
                },
                "view": {
                    "type": "object",
                    "description": "Customise options relating specifically to how the calendar is displayed in studio",
                    "properties": {
                        "calendarOrientation": {
                            "type": "string",
                            "description": "Default orientation of the calendar",
                            "pattern": "^horizontal|vertical$"
                        },
                        "defaultView": {
                            "type": "string",
                            "pattern": "^calendar|list$"
                        },
                        "defaultCalendarView": {
                            "type": "string",
                            "description": "Calendar view to load by default",
                            "pattern": "^timelineDay|agendaWeek|month$"
                        },
                        "defaultListView": {
                            "type": "string",
                            "description": "List view to load by default",
                            "pattern": "^listDay|listWeek|listMonth$"
                        },
                        "showViewBookingButton": {
                            "type": "boolean"
                        },
                        "timelineDayTitleFormat": {
                            "type": "string"
                        },
                        "dayTitleFormat": {
                            "type": "string"
                        },
                        "weekTitleFormat": {
                            "type": "string"
                        },
                        "monthTitleFormat": {
                            "type": "string"
                        },
                        "bookingsLabelAssembler": {
                            "type": "string"
                        },
                        "blockLabelAssembler": {
                            "type": "string"
                        },
                        "externalLabelAssembler": {
                            "type": "string"
                        },
                        "nextAvailableLimit": {
                            "type": "integer"
                        },
                        "slotLabelFormat": {
                            "type": "string"
                        },
                        "scrollTime": {
                            "type": "string"
                        },
                        "minTime": {
                            "type": "string"
                        },
                        "maxTime": {
                            "type": "string"
                        },
                        "useExternalBookingsApi": {
                            "type": "boolean"
                        },
                        "allowTimezoneSelect": {
                            "type": "boolean"
                        },
                        "useGroupPicker": {
                            "type": "boolean",
                            "description": "Use a group picker rather than showing all groups at once"
                        },
                        "limitUserGroup": {
                            "type": "string",
                            "description": "How to limit the dispaly if the user belongs to a group",
                            "enum": ["all", "group", "group+"]
                        }
                    }
                },
                "data": {
                    "type": "object",
                    "description": "api config options",
                    "properties": {
                        "maximumSlots": {
                            "type": "integer"
                        },
                        "includeBookingDetails": {
                            "type": "boolean"
                        }
                    }
                },
                "accessibility": {
                    "type": "object",
                    "description": "accessibility config options",
                    "properties": {
                        "listItemStartDateFormat": {
                            "type": "string"
                        },
                        "listItemEndDateFormat": {
                            "type": "string"
                        }
                    }
                },
                "calendarDatepicker": {
                    "type": "object",
                    "description": "calendar datepicker config options",
                    "properties": {
                        "format": {
                            "type": "string"
                        }
                    }
                },
                "buttons": {
                    "type": "object",
                    "description": "Configurable buttons for the calendar",
                    "properties": {
                        "headerRight": {
                            "type": "array",
                            "description": "Buttons to display in the right header area of the calendar"
                        }
                    }
                }
            }
        }
    }
}
