{
  "openapi": "3.0.0",
  "servers": [
    {
      "url": "https://vis.tmp.veeting.net/vi-api/v1"
    }
  ],
  "info": {
    "version": "0.0.1",
    "title": "veeting-vi-service (streamer)",
    "description": "Case-management API for the VI system. Authenticate with the X-API-Key header."
  },
  "tags": [
    {
      "name": "App",
      "description": "Bootstrap configuration for the UI (public)"
    },
    {
      "name": "Interrogations",
      "description": "Hand an interrogation over to a room, and withdraw one nobody confirmed"
    },
    {
      "name": "Rooms",
      "description": "Discover available interrogation rooms and their availability"
    }
  ],
  "paths": {
    "/app/config": {
      "get": {
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "responseCode": {
                      "type": "number",
                      "format": "int32"
                    },
                    "responseMessage": {
                      "type": "string",
                      "nullable": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/AppConfig"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "App"
        ]
      }
    },
    "/interrogations": {
      "post": {
        "requestBody": {
          "description": "",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartInterrogation"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "responseCode": {
                      "type": "number",
                      "format": "int32"
                    },
                    "responseMessage": {
                      "type": "string",
                      "nullable": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/StartInterrogationResult"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Interrogations"
        ]
      }
    },
    "/interrogations/{id}": {
      "delete": {
        "security": [
          {
            "jwtTokenAuth": [],
            "apiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "responseCode": {
                      "type": "number",
                      "format": "int32"
                    },
                    "responseMessage": {
                      "type": "string",
                      "nullable": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/CancelInterrogationResult"
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Interrogations"
        ]
      }
    },
    "/rooms": {
      "get": {
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "responseCode": {
                      "type": "number",
                      "format": "int32"
                    },
                    "responseMessage": {
                      "type": "string",
                      "nullable": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/InterrogationRoomListItem"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "tags": [
          "Rooms"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "jwtTokenAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key"
      }
    },
    "schemas": {
      "AppConfig": {
        "properties": {
          "type": {
            "enum": [
              "streamer",
              "recorder"
            ],
            "type": "string"
          },
          "roomKey": {
            "type": "string"
          },
          "roomName": {
            "type": "string"
          },
          "roomType": {
            "enum": [
              "hybrid",
              "children"
            ],
            "type": "string"
          },
          "defaultLanguage": {
            "type": "string"
          },
          "viServiceApiUrl": {
            "type": "string"
          },
          "viServiceWssUrl": {
            "type": "string"
          },
          "apiServerApiUrl": {
            "type": "string"
          },
          "apiServerWssUrl": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "type",
          "viServiceApiUrl",
          "viServiceWssUrl",
          "apiServerApiUrl",
          "apiServerWssUrl"
        ]
      },
      "CancelInterrogation": {
        "type": "object",
        "additionalProperties": true
      },
      "CancelInterrogationResult": {
        "properties": {
          "interrogationId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "ready",
              "live",
              "ended",
              "recordingAvailable",
              "uploaded",
              "cancelled",
              "expired"
            ],
            "type": "string"
          },
          "delivered": {
            "type": "boolean"
          }
        },
        "type": "object",
        "required": [
          "interrogationId",
          "status",
          "delivered"
        ]
      },
      "InterrogationRoomListItem": {
        "properties": {
          "roomKey": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "building": {
            "type": "string"
          },
          "type": {
            "enum": [
              "hybrid",
              "children"
            ],
            "type": "string"
          },
          "status": {
            "enum": [
              "free",
              "busy",
              "offline",
              "maintenance"
            ],
            "type": "string"
          },
          "lastHeartbeatAt": {
            "oneOf": [
              {
                "format": "date",
                "type": "string"
              },
              {
                "format": "date-time",
                "type": "string"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "roomKey",
          "name",
          "building",
          "type",
          "status"
        ]
      },
      "StartInterrogation": {
        "properties": {
          "roomKey": {
            "type": "string"
          },
          "case": {
            "type": "object"
          }
        },
        "type": "object",
        "required": [
          "roomKey"
        ]
      },
      "StartInterrogationResult": {
        "properties": {
          "interrogationId": {
            "type": "string"
          },
          "status": {
            "enum": [
              "pending",
              "ready",
              "live",
              "ended",
              "recordingAvailable",
              "uploaded",
              "cancelled",
              "expired"
            ],
            "type": "string"
          },
          "launchUrl": {
            "type": "string"
          }
        },
        "type": "object",
        "required": [
          "interrogationId",
          "status",
          "launchUrl"
        ]
      },
      "Void": {
        "properties": {}
      }
    }
  }
}
