{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "#/components/schemas/OperatingModeResponse",
  "title": "OperatingModeResponse",
  "type": "object",
  "required": [
    "operatingModeId",
    "name",
    "type",
    "level"
  ],
  "properties": {
    "operatingModeId": {
      "type": "string",
      "example": "Y2lzY29zcGFyazovL3VzL09QRVJBVElOR19NT0RFLzAyZjZlMmI4LTFjZDktNWI3ZS1jOTVjLTczYzZkYzk1MTZjMg==",
      "description": "Unique identifier for the operating mode."
    },
    "name": {
      "type": "string",
      "example": "Business Hours Mode",
      "description": "Display name of the operating mode."
    },
    "type": {
      "type": "string",
      "enum": [
        "NONE",
        "SAME_HOURS_DAILY",
        "DIFFERENT_HOURS_DAILY",
        "HOLIDAY"
      ],
      "example": "SAME_HOURS_DAILY",
      "description": " * `NONE` - No schedule defined.\n * `SAME_HOURS_DAILY` - Same hours apply for weekdays (Monday-Friday) and weekends (Saturday-Sunday).\n * `DIFFERENT_HOURS_DAILY` - Different hours for each day of the week.\n * `HOLIDAY` - Holiday-based schedule.\n"
    },
    "level": {
      "type": "string",
      "enum": [
        "LOCATION",
        "ORGANIZATION"
      ],
      "example": "LOCATION",
      "description": " * `LOCATION` - Operating mode is defined at the location level.\n * `ORGANIZATION` - Operating mode is defined at the organization level.\n"
    },
    "locationName": {
      "type": "string",
      "example": "San Jose",
      "description": "Location name"
    },
    "sameHoursDaily": {
      "type": "object",
      "description": "Schedule configuration when same hours apply for weekdays and weekends",
      "example": {
        "mondayToFriday": {
          "enabled": true,
          "allDayEnabled": false,
          "startTime": "09:00",
          "endTime": "17:00"
        },
        "saturdayToSunday": {
          "enabled": false,
          "allDayEnabled": false
        }
      },
      "properties": {
        "mondayToFriday": {
          "type": "object",
          "required": [
            "enabled",
            "allDayEnabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Whether schedule is enabled for Monday to Friday"
            },
            "allDayEnabled": {
              "type": "boolean",
              "description": "Whether all day is enabled"
            },
            "startTime": {
              "type": "string",
              "example": "09:00",
              "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
            },
            "endTime": {
              "type": "string",
              "example": "17:00",
              "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
            }
          }
        },
        "saturdayToSunday": {
          "type": "object",
          "required": [
            "enabled",
            "allDayEnabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Whether schedule is enabled for Saturday to Sunday"
            },
            "allDayEnabled": {
              "type": "boolean",
              "description": "Whether all day is enabled"
            },
            "startTime": {
              "type": "string",
              "example": "10:00",
              "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
            },
            "endTime": {
              "type": "string",
              "example": "14:00",
              "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
            }
          }
        }
      }
    },
    "differentHoursDaily": {
      "type": "object",
      "description": "Schedule configuration when different hours apply for each day",
      "example": {
        "monday": {
          "enabled": true,
          "allDayEnabled": false,
          "startTime": "09:00",
          "endTime": "17:00"
        },
        "tuesday": {
          "enabled": true,
          "allDayEnabled": false,
          "startTime": "09:00",
          "endTime": "17:00"
        }
      },
      "properties": {
        "sunday": {
          "type": "object",
          "required": [
            "enabled",
            "allDayEnabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Whether schedule is enabled for Sunday."
            },
            "allDayEnabled": {
              "type": "boolean",
              "description": "Whether all day is enabled."
            },
            "startTime": {
              "type": "string",
              "example": "09:00",
              "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
            },
            "endTime": {
              "type": "string",
              "example": "17:00",
              "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
            }
          }
        },
        "monday": {
          "type": "object",
          "required": [
            "enabled",
            "allDayEnabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Whether schedule is enabled for Monday."
            },
            "allDayEnabled": {
              "type": "boolean",
              "description": "Whether all day is enabled."
            },
            "startTime": {
              "type": "string",
              "example": "09:00",
              "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
            },
            "endTime": {
              "type": "string",
              "example": "17:00",
              "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
            }
          }
        },
        "tuesday": {
          "type": "object",
          "required": [
            "enabled",
            "allDayEnabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Whether schedule is enabled for Tuesday."
            },
            "allDayEnabled": {
              "type": "boolean",
              "description": "Whether all day is enabled."
            },
            "startTime": {
              "type": "string",
              "example": "09:00",
              "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
            },
            "endTime": {
              "type": "string",
              "example": "17:00",
              "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
            }
          }
        },
        "wednesday": {
          "type": "object",
          "required": [
            "enabled",
            "allDayEnabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Whether schedule is enabled for Wednesday."
            },
            "allDayEnabled": {
              "type": "boolean",
              "description": "Whether all day is enabled."
            },
            "startTime": {
              "type": "string",
              "example": "09:00",
              "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
            },
            "endTime": {
              "type": "string",
              "example": "17:00",
              "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
            }
          }
        },
        "thursday": {
          "type": "object",
          "required": [
            "enabled",
            "allDayEnabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Whether schedule is enabled for Thursday."
            },
            "allDayEnabled": {
              "type": "boolean",
              "description": "Whether all day is enabled."
            },
            "startTime": {
              "type": "string",
              "example": "09:00",
              "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
            },
            "endTime": {
              "type": "string",
              "example": "17:00",
              "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
            }
          }
        },
        "friday": {
          "type": "object",
          "required": [
            "enabled",
            "allDayEnabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Whether schedule is enabled for Friday."
            },
            "allDayEnabled": {
              "type": "boolean",
              "description": "Whether all day is enabled."
            },
            "startTime": {
              "type": "string",
              "example": "09:00",
              "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
            },
            "endTime": {
              "type": "string",
              "example": "17:00",
              "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
            }
          }
        },
        "saturday": {
          "type": "object",
          "required": [
            "enabled",
            "allDayEnabled"
          ],
          "properties": {
            "enabled": {
              "type": "boolean",
              "description": "Whether schedule is enabled for Saturday."
            },
            "allDayEnabled": {
              "type": "boolean",
              "description": "Whether all day is enabled."
            },
            "startTime": {
              "type": "string",
              "example": "09:00",
              "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
            },
            "endTime": {
              "type": "string",
              "example": "17:00",
              "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
            }
          }
        }
      }
    },
    "holidays": {
      "type": "array",
      "description": "Array of holiday schedule events",
      "example": [
        {
          "id": "holiday-1",
          "name": "New Year's Day",
          "allDayEnabled": true,
          "startDate": "2024-01-01",
          "endDate": "2024-01-01"
        }
      ],
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Unique identifier for the holiday schedule event."
          },
          "name": {
            "type": "string",
            "example": "New Year's Day",
            "description": "Holiday event name"
          },
          "allDayEnabled": {
            "type": "boolean",
            "description": "Whether holiday is all day"
          },
          "startDate": {
            "type": "string",
            "example": "2024-01-01",
            "description": "Start date in YYYY-MM-DD format."
          },
          "endDate": {
            "type": "string",
            "example": "2024-01-01",
            "description": "End date in YYYY-MM-DD format."
          },
          "startTime": {
            "type": "string",
            "example": "00:00",
            "description": "Start time in HH:mm format. This field is not present when allDayEnabled is true."
          },
          "endTime": {
            "type": "string",
            "example": "23:59",
            "description": "End time in HH:mm format. This field is not present when allDayEnabled is true."
          },
          "recurrence": {
            "type": "object",
            "description": "Recurrence pattern for the holiday. This field is only present for recurring holidays.",
            "properties": {
              "recurYearlyByDay": {
                "type": "object",
                "description": "Recur yearly by day of week in month",
                "properties": {
                  "day": {
                    "type": "string",
                    "enum": [
                      "SUNDAY",
                      "MONDAY",
                      "TUESDAY",
                      "WEDNESDAY",
                      "THURSDAY",
                      "FRIDAY",
                      "SATURDAY"
                    ],
                    "description": " * `SUNDAY` - Sunday.\n * `MONDAY` - Monday.\n * `TUESDAY` - Tuesday.\n * `WEDNESDAY` - Wednesday.\n * `THURSDAY` - Thursday.\n * `FRIDAY` - Friday.\n * `SATURDAY` - Saturday.\n"
                  },
                  "week": {
                    "type": "string",
                    "enum": [
                      "FIRST",
                      "SECOND",
                      "THIRD",
                      "FOURTH",
                      "LAST"
                    ],
                    "description": " * `FIRST` - First week of the month.\n * `SECOND` - Second week of the month.\n * `THIRD` - Third week of the month.\n * `FOURTH` - Fourth week of the month.\n * `LAST` - Last week of the month.\n"
                  },
                  "month": {
                    "type": "string",
                    "enum": [
                      "JANUARY",
                      "FEBRUARY",
                      "MARCH",
                      "APRIL",
                      "MAY",
                      "JUNE",
                      "JULY",
                      "AUGUST",
                      "SEPTEMBER",
                      "OCTOBER",
                      "NOVEMBER",
                      "DECEMBER"
                    ],
                    "description": " * `JANUARY` - January.\n * `FEBRUARY` - February.\n * `MARCH` - March.\n * `APRIL` - April.\n * `MAY` - May.\n * `JUNE` - June.\n * `JULY` - July.\n * `AUGUST` - August.\n * `SEPTEMBER` - September.\n * `OCTOBER` - October.\n * `NOVEMBER` - November.\n * `DECEMBER` - December.\n"
                  }
                }
              },
              "recurYearlyByDate": {
                "type": "object",
                "description": "Recur yearly by specific date",
                "properties": {
                  "dayOfMonth": {
                    "type": "integer",
                    "minimum": 1,
                    "maximum": 31,
                    "description": "Day of the month (1-31)"
                  },
                  "month": {
                    "type": "string",
                    "enum": [
                      "JANUARY",
                      "FEBRUARY",
                      "MARCH",
                      "APRIL",
                      "MAY",
                      "JUNE",
                      "JULY",
                      "AUGUST",
                      "SEPTEMBER",
                      "OCTOBER",
                      "NOVEMBER",
                      "DECEMBER"
                    ],
                    "description": " * `JANUARY` - January.\n * `FEBRUARY` - February.\n * `MARCH` - March.\n * `APRIL` - April.\n * `MAY` - May.\n * `JUNE` - June.\n * `JULY` - July.\n * `AUGUST` - August.\n * `SEPTEMBER` - September.\n * `OCTOBER` - October.\n * `NOVEMBER` - November.\n * `DECEMBER` - December.\n"
                  }
                }
              }
            }
          }
        }
      }
    },
    "forwardTo": {
      "type": "object",
      "description": "Call forwarding configuration for this operating mode",
      "example": {
        "enabled": true,
        "destination": "+14085551234",
        "sendToVoicemailEnabled": false
      },
      "properties": {
        "enabled": {
          "type": "boolean",
          "description": "Whether call forwarding is enabled"
        },
        "destination": {
          "type": "string",
          "example": "+14085551234",
          "description": "Forwarding destination phone number"
        },
        "sendToVoicemailEnabled": {
          "type": "boolean",
          "description": "Whether to send to voicemail"
        }
      }
    }
  },
  "example": {
    "operatingModeId": "Y2lzY29zcGFyazovL3VzL09QRVJBVElOR19NT0RFLzAyZjZlMmI4LTFjZDktNWI3ZS1jOTVjLTczYzZkYzk1MTZjMg==",
    "name": "Business Hours Mode",
    "type": "SAME_HOURS_DAILY",
    "level": "LOCATION",
    "locationName": "San Jose",
    "sameHoursDaily": {
      "mondayToFriday": {
        "enabled": true,
        "allDayEnabled": false,
        "startTime": "09:00",
        "endTime": "17:00"
      },
      "saturdayToSunday": {
        "enabled": false,
        "allDayEnabled": false,
        "startTime": "10:00",
        "endTime": "14:00"
      }
    },
    "forwardTo": {
      "enabled": true,
      "destination": "+14085551234",
      "sendToVoicemailEnabled": false
    }
  }
}