{
  "swagger": "2.0",
  "info": {
    "title": "evey/v1/admin_session.proto",
    "version": "version not set"
  },
  "tags": [
    {
      "name": "AdminSessionService"
    }
  ],
  "consumes": [
    "application/json"
  ],
  "produces": [
    "application/json"
  ],
  "paths": {
    "/api/v1/admin/audit-log": {
      "get": {
        "operationId": "AdminSessionService_GetAuditLog",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1GetAuditLogResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "action",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "resourceType",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "type": "string",
            "format": "date-time"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "type": "integer",
            "format": "int32"
          },
          {
            "name": "profileId",
            "in": "query",
            "required": false,
            "type": "string"
          }
        ],
        "tags": [
          "AdminSessionService"
        ]
      }
    },
    "/api/v1/admin/cast-receivers/{profileId}/command": {
      "post": {
        "summary": "SendCastReceiverCommand reaches a Chromecast that is still beating but has\nno play session left to address. Keyed by PROFILE because that is all the\nonline-devices panel knows, and what the receiver's own stream token\ncarries. Same vocabulary as SendSessionCommand.",
        "operationId": "AdminSessionService_SendCastReceiverCommand",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SendCastReceiverCommandResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "profileId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AdminSessionServiceSendCastReceiverCommandBody"
            }
          }
        ],
        "tags": [
          "AdminSessionService"
        ]
      }
    },
    "/api/v1/admin/sessions/active": {
      "get": {
        "operationId": "AdminSessionService_ListActiveSessions",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1ListActiveSessionsResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "tags": [
          "AdminSessionService"
        ]
      }
    },
    "/api/v1/admin/sessions/{sessionId}": {
      "delete": {
        "operationId": "AdminSessionService_KillSession",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1KillSessionResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "type": "string"
          }
        ],
        "tags": [
          "AdminSessionService"
        ]
      }
    },
    "/api/v1/admin/sessions/{sessionId}/command": {
      "post": {
        "operationId": "AdminSessionService_SendSessionCommand",
        "responses": {
          "200": {
            "description": "A successful response.",
            "schema": {
              "$ref": "#/definitions/v1SendSessionCommandResponse"
            }
          },
          "default": {
            "description": "An unexpected error response.",
            "schema": {
              "$ref": "#/definitions/rpcStatus"
            }
          }
        },
        "parameters": [
          {
            "name": "sessionId",
            "in": "path",
            "required": true,
            "type": "string"
          },
          {
            "name": "body",
            "in": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/AdminSessionServiceSendSessionCommandBody"
            }
          }
        ],
        "tags": [
          "AdminSessionService"
        ]
      }
    }
  },
  "definitions": {
    "AdminSessionServiceSendCastReceiverCommandBody": {
      "type": "object",
      "properties": {
        "command": {
          "type": "string",
          "title": "\"pause\" | \"play\" | \"stop\" | \"message:\u003ctext\u003e\""
        }
      }
    },
    "AdminSessionServiceSendSessionCommandBody": {
      "type": "object",
      "properties": {
        "command": {
          "type": "string",
          "title": "\"pause\", \"play\""
        }
      }
    },
    "protobufAny": {
      "type": "object",
      "properties": {
        "@type": {
          "type": "string"
        }
      },
      "additionalProperties": {}
    },
    "rpcStatus": {
      "type": "object",
      "properties": {
        "code": {
          "type": "integer",
          "format": "int32"
        },
        "message": {
          "type": "string"
        },
        "details": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/protobufAny"
          }
        }
      }
    },
    "v1ActiveSession": {
      "type": "object",
      "properties": {
        "sessionId": {
          "type": "string"
        },
        "profileName": {
          "type": "string"
        },
        "mediaTitle": {
          "type": "string"
        },
        "mediaType": {
          "type": "string"
        },
        "mediaItemId": {
          "type": "string"
        },
        "progress": {
          "type": "number",
          "format": "double"
        },
        "durationMs": {
          "type": "string",
          "format": "int64"
        },
        "positionMs": {
          "type": "string",
          "format": "int64"
        },
        "startedAt": {
          "type": "string",
          "format": "date-time"
        },
        "deviceName": {
          "type": "string"
        },
        "deviceType": {
          "type": "string"
        },
        "clientIp": {
          "type": "string"
        },
        "playMethod": {
          "type": "string"
        },
        "videoCodec": {
          "type": "string"
        },
        "audioCodec": {
          "type": "string"
        },
        "resolution": {
          "type": "string"
        },
        "bandwidthBps": {
          "type": "string",
          "format": "int64"
        },
        "transcodeInfo": {
          "type": "string"
        },
        "profileId": {
          "type": "string"
        },
        "seriesTitle": {
          "type": "string"
        },
        "seasonNumber": {
          "type": "integer",
          "format": "int32"
        },
        "episodeNumber": {
          "type": "integer",
          "format": "int32"
        },
        "isPaused": {
          "type": "boolean"
        },
        "videoDecision": {
          "type": "string",
          "description": "Per-track serving decision (\"copy\"|\"transcode\"). The panel derives the\nserving engine from these (copy rung -\u003e mkvgo on-demand, transcode -\u003e ffmpeg)\nand renders per-track badges. video_codec/audio_codec/resolution above carry\nthe served codecs (source-\u003etarget form when transcoding)."
        },
        "audioDecision": {
          "type": "string"
        },
        "castDeviceName": {
          "type": "string",
          "description": "Non-empty when the client relays playback to a cast device (web sender -\u003e\nChromecast): the media actually plays THERE, not on device_name. The\npanel shows it as the real playback target."
        },
        "coverArtUrl": {
          "type": "string",
          "description": "Album cover URL for music sessions (media_type \"track\"); empty for video,\nwhich the panel renders from a trickplay thumbnail instead."
        },
        "userId": {
          "type": "string",
          "description": "Owning account. profile_name alone (\"Papa\") does not say whose household\nit belongs to once two accounts use the same profile names."
        },
        "username": {
          "type": "string"
        },
        "videoEngine": {
          "type": "string",
          "description": "What the server ACTUALLY serves, recorded when the master playlist is\nrendered (the decisions above are the client's start-time declaration,\naudio_decision then follows the wasm beacons). video_engine: \"mkvgo\"\n(on-demand copy) | \"ffmpeg\". video_backend, transcode only: \"software\" |\n\"qsv\" | \"vaapi\" | \"nvenc\". audio_engine: \"mkvgo\" | \"ffmpeg\" | \"client\"\n(ac3go wasm decode on the player). Empty on sessions started before this."
        },
        "videoBackend": {
          "type": "string"
        },
        "audioEngine": {
          "type": "string"
        }
      }
    },
    "v1AuditLogEntry": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string"
        },
        "userId": {
          "type": "string"
        },
        "username": {
          "type": "string"
        },
        "action": {
          "type": "string"
        },
        "resourceType": {
          "type": "string"
        },
        "resourceId": {
          "type": "string"
        },
        "details": {
          "type": "string"
        },
        "ipAddress": {
          "type": "string"
        },
        "createdAt": {
          "type": "string",
          "format": "date-time"
        },
        "resourceName": {
          "type": "string"
        },
        "userAgent": {
          "type": "string"
        },
        "deviceName": {
          "type": "string"
        },
        "profileId": {
          "type": "string",
          "description": "Which PROFILE of that account acted. Persisted with the entry (a profile\ncan be renamed or deleted later); profile_name is resolved by JOIN and is\nempty once the profile is gone."
        },
        "profileName": {
          "type": "string"
        }
      }
    },
    "v1GetAuditLogResponse": {
      "type": "object",
      "properties": {
        "entries": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1AuditLogEntry"
          }
        },
        "total": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "v1KillSessionResponse": {
      "type": "object"
    },
    "v1ListActiveSessionsResponse": {
      "type": "object",
      "properties": {
        "sessions": {
          "type": "array",
          "items": {
            "type": "object",
            "$ref": "#/definitions/v1ActiveSession"
          }
        }
      }
    },
    "v1SendCastReceiverCommandResponse": {
      "type": "object"
    },
    "v1SendSessionCommandResponse": {
      "type": "object"
    }
  }
}
