{
  "openapi": "3.0.4",
  "info": {
    "title": "SVideo API",
    "version": "1.0"
  },
  "paths": {
    "/api/identity/external-auth/authenticate-by-watcher-user": {
      "post": {
        "tags": [
          "Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/AuthRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/identity/external-auth/forgot-password": {
      "post": {
        "tags": [
          "Api"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/organization": {
      "get": {
        "tags": [
          "Api"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/inventory/public-folder/tree": {
      "get": {
        "tags": [
          "Api"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderTreeResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/inventory/public-camera": {
      "get": {
        "tags": [
          "Api"
        ],
        "parameters": [
          {
            "name": "FolderId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "OrganizationId",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "Search",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "IsFavourite",
            "in": "query",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "Cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "MaxResultCount",
            "in": "query",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderCameraResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/inventory/public-camera/{name}": {
      "get": {
        "tags": [
          "Api"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "accessToken",
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FolderCameraResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not Found"
          }
        }
      }
    },
    "/api/inventory/public-camera/{name}/mark-camera-as-favourite": {
      "post": {
        "tags": [
          "Api"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetFavouriteCameraRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/SetFavouriteCameraRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/SetFavouriteCameraRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/api/inventory/public-camera/{name}/ptz": {
      "post": {
        "tags": [
          "Api"
        ],
        "parameters": [
          {
            "name": "accessToken",
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecutePtzCommandRequest"
              }
            },
            "text/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecutePtzCommandRequest"
              }
            },
            "application/*+json": {
              "schema": {
                "$ref": "#/components/schemas/ExecutePtzCommandRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AuthRequest": {
        "required": [
          "password",
          "userName"
        ],
        "type": "object",
        "properties": {
          "userName": {
            "type": "string",
            "nullable": true
          },
          "password": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "AuthResponse": {
        "required": [
          "accessToken",
          "refreshToken"
        ],
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string",
            "nullable": true
          },
          "refreshToken": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ExecutePtzCommandRequest": {
        "type": "object",
        "properties": {
          "up": {
            "type": "integer",
            "format": "int32"
          },
          "down": {
            "type": "integer",
            "format": "int32"
          },
          "left": {
            "type": "integer",
            "format": "int32"
          },
          "right": {
            "type": "integer",
            "format": "int32"
          },
          "in": {
            "type": "integer",
            "format": "int32"
          },
          "out": {
            "type": "integer",
            "format": "int32"
          }
        },
        "additionalProperties": false
      },
      "FolderCameraResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StreamModel"
            },
            "nullable": true
          },
          "totalCount": {
            "type": "integer",
            "format": "int32"
          },
          "cursor": {
            "type": "string",
            "nullable": true
          },
          "totalDisabled": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "totalOffline": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "totalAlive": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          }
        },
        "additionalProperties": false
      },
      "FolderGuardJsonModel": {
        "type": "object",
        "properties": {
          "blocked": {
            "type": "boolean"
          },
          "message": {
            "type": "string",
            "nullable": true
          },
          "inherited": {
            "type": "boolean"
          },
          "source_folder_id": {
            "type": "integer",
            "format": "int32"
          },
          "bypassed": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "FolderModel": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "integer",
            "format": "int32"
          },
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "streamsCount": {
            "type": "integer",
            "format": "int32"
          },
          "totalDisabled": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "totalOffline": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "totalAlive": {
            "type": "integer",
            "format": "int32",
            "readOnly": true
          },
          "offlineCount": {
            "type": "integer",
            "format": "int32"
          },
          "disabledCount": {
            "type": "integer",
            "format": "int32"
          },
          "aliveCount": {
            "type": "integer",
            "format": "int32"
          },
          "path": {
            "type": "string",
            "nullable": true
          },
          "mapDiagramFileUrl": {
            "type": "string",
            "nullable": true
          },
          "guard": {
            "$ref": "#/components/schemas/FolderGuardJsonModel"
          },
          "childs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FolderModel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "FolderTreeResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FolderModel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "ForgotPasswordRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "OrganizationModel": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "OrganizationResponse": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationModel"
            },
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "SetFavouriteCameraRequest": {
        "type": "object",
        "properties": {
          "isFavourite": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "StreamFolderModel": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "title": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "totalDisabled": {
            "type": "integer",
            "format": "int32"
          },
          "totalOffline": {
            "type": "integer",
            "format": "int32"
          },
          "totalAlive": {
            "type": "integer",
            "format": "int32"
          },
          "offlineCount": {
            "type": "integer",
            "format": "int32"
          },
          "disabledCount": {
            "type": "integer",
            "format": "int32"
          },
          "aliveCount": {
            "type": "integer",
            "format": "int32"
          },
          "path": {
            "type": "string",
            "nullable": true
          },
          "mapDiagramFileUrl": {
            "type": "string",
            "nullable": true
          }
        },
        "additionalProperties": false
      },
      "StreamModel": {
        "required": [
          "folderId",
          "id",
          "name",
          "status",
          "streamerHostname",
          "streamToken"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "nullable": true
          },
          "code": {
            "type": "string",
            "nullable": true
          },
          "name": {
            "type": "string",
            "nullable": true
          },
          "folderId": {
            "type": "integer",
            "format": "int32"
          },
          "folder": {
            "$ref": "#/components/schemas/StreamFolderModel"
          },
          "notes": {
            "type": "string",
            "nullable": true
          },
          "streamerHostname": {
            "type": "string",
            "nullable": true
          },
          "status": {
            "type": "string",
            "nullable": true
          },
          "streamToken": {
            "type": "string",
            "nullable": true
          },
          "isFavourite": {
            "type": "boolean"
          },
          "watcherHostname": {
            "type": "string",
            "nullable": true
          },
          "guard": {
            "$ref": "#/components/schemas/FolderGuardJsonModel"
          }
        },
        "additionalProperties": false
      }
    }
  }
}