diff --git a/Sense/.gitignore b/Sense/.gitignore new file mode 100644 index 0000000..c69da9b --- /dev/null +++ b/Sense/.gitignore @@ -0,0 +1,4 @@ +/bin/ +/data/ +*.db-shm +*.db-wal diff --git a/Sense/.gitkeep b/Sense/.gitkeep deleted file mode 100644 index 8b13789..0000000 --- a/Sense/.gitkeep +++ /dev/null @@ -1 +0,0 @@ - diff --git a/Sense/README.md b/Sense/README.md new file mode 100644 index 0000000..0da49be --- /dev/null +++ b/Sense/README.md @@ -0,0 +1,42 @@ +# Sense M1 骨架 + +本目录是 YoVision Sense 的无实机接入骨架。数据库保存期望态,ONVIF 和 MediaMTX 通过端口隔离;当前只能用确定性 fake、MediaMTX 假 HTTP 服务及可选合成 RTSP 源验证,不能据此宣称任何真实摄像头兼容性。 + +## 常用命令 + +```powershell +cd Sense +go mod download +go generate ./internal/mtx +go test ./... +go vet ./... +go build -o bin/sense-api.exe ./cmd/sense-api +go run ./cmd/sense-api +``` + +Unix 将构建产物改为 `bin/sense-api`。服务默认监听 `127.0.0.1:8080`,SQLite 默认写入 `Sense/data/sense.db`,MediaMTX 控制 API 默认是 `http://127.0.0.1:9997`。当前只有 `/healthz` 与 `/readyz`,设备管理公共 API 尚未冻结。 + +常用环境变量: + +| 变量 | 默认值 | 说明 | +| --- | --- | --- | +| `SENSE_HTTP_ADDR` | `127.0.0.1:8080` | HTTP 监听地址 | +| `SENSE_ALLOW_NON_LOOPBACK` | `false` | 显式允许监听非回环地址;只应在可信网络及外部认证/防火墙就绪后开启 | +| `SENSE_DB_DSN` | `file:data/sense.db` | SQLite DSN;凭据不得放入该值 | +| `SENSE_MEDIAMTX_URL` | `http://127.0.0.1:9997` | MediaMTX 控制 API;不得包含 userinfo | +| `SENSE_RECONCILE_INTERVAL` | `5s` | 对账周期 | +| `SENSE_PROBE_INTERVAL` | `10s` | path 探活周期 | + +MediaMTX `v1.19.3` 应作为独立二进制启动并只在可信网络开放 API。获取与 SHA-256 校验值见 `docs/03-tech-stack.md`。生成客户端使用固定版本工具和 vendored 官方 OpenAPI;`internal/mtx/generated/client.gen.go` 不可手改。 + +Windows 本地准备 MediaMTX(从仓库根目录执行): + +```powershell +$asset = "mediamtx_v1.19.3_windows_amd64.zip" +Invoke-WebRequest "https://github.com/bluenviron/mediamtx/releases/download/v1.19.3/$asset" -OutFile "$env:TEMP\$asset" +if ((Get-FileHash "$env:TEMP\$asset" -Algorithm SHA256).Hash.ToLowerInvariant() -ne "5d82148d1032a6a190d9909a2997d9989457aaadf49af87dd02cd4512d31bebe") { throw "MediaMTX checksum mismatch" } +Expand-Archive "$env:TEMP\$asset" -DestinationPath "$env:TEMP\yovision-mediamtx-v1.19.3" -Force +& "$env:TEMP\yovision-mediamtx-v1.19.3\mediamtx.exe" "Sense\deploy\mediamtx.yml" +``` + +Linux amd64 使用同版 `mediamtx_v1.19.3_linux_amd64.tar.gz`,SHA-256 为 `a7ba21268fccda3ebc43fdad76b87fddb85ce77e725b5cb637bca724b5394fbe`。不要把下载的二进制或摄像头凭据提交到仓库。 diff --git a/Sense/api/vendor/mediamtx-v1.19.3.openapi.yaml b/Sense/api/vendor/mediamtx-v1.19.3.openapi.yaml new file mode 100644 index 0000000..90cb47d --- /dev/null +++ b/Sense/api/vendor/mediamtx-v1.19.3.openapi.yaml @@ -0,0 +1,3766 @@ +openapi: 3.0.0 + +info: + version: 1.0.0 + title: MediaMTX API + description: API of MediaMTX, a server and proxy that supports various protocols. + license: + name: MIT + url: https://opensource.org/licenses/MIT + +servers: + - url: http://localhost:9997 + +security: [] + +components: + schemas: + HLSVariant: + type: string + enum: [mpegts, fmp4, lowLatency] + + LogDestination: + type: string + enum: [stdout, file, syslog] + + LogLevel: + type: string + enum: [error, warn, info, debug] + + RTSPAuthMethod: + type: string + enum: [basic, digest] + + RTSPTransport: + type: string + enum: [udp, multicast, tcp, automatic] + + PathTrackCodecProps: + oneOf: + - $ref: "#/components/schemas/PathTrackCodecPropsAV1" + - $ref: "#/components/schemas/PathTrackCodecPropsVP9" + - $ref: "#/components/schemas/PathTrackCodecPropsH265" + - $ref: "#/components/schemas/PathTrackCodecPropsH264" + - $ref: "#/components/schemas/PathTrackCodecPropsOpus" + - $ref: "#/components/schemas/PathTrackCodecPropsMPEG4Audio" + - $ref: "#/components/schemas/PathTrackCodecPropsAC3" + - $ref: "#/components/schemas/PathTrackCodecPropsG711" + - $ref: "#/components/schemas/PathTrackCodecPropsLPCM" + + ErrorStatus: + type: string + enum: + - error + + AlwaysAvailableTrackCodec: + type: string + enum: + - AV1 + - VP9 + - H265 + - H264 + - MPEG4Audio + - Opus + - G711 + - LPCM + + AuthAction: + type: string + enum: + - publish + - read + - playback + - api + - metrics + - pprof + + AuthMethod: + type: string + enum: + - internal + - http + - jwt + + Encryption: + type: string + enum: + - "no" + - optional + - strict + + MoQSessionState: + type: string + enum: + - idle + - read + - publish + + MoQVersion: + type: string + enum: + - moqt-18 + - moqt-19 + + OKStatus: + type: string + enum: + - ok + + PathReaderType: + type: string + enum: + - hlsSession + - rtmpConn + - rtmpsConn + - rtspConn + - rtspSession + - rtspsConn + - rtspsSession + - srtConn + - webRTCSession + - moqSession + - hidden + + PathSourceType: + type: string + enum: + - hlsSource + - redirect + - rpiCameraSource + - rtmpConn + - rtmpsConn + - rtmpSource + - rtspSession + - rtspSource + - rtspsSession + - srtConn + - srtSource + - mpegtsSource + - rtpSource + - webRTCSession + - webRTCSource + - moqSession + + PathTrackCodec: + type: string + enum: + - AV1 + - VP9 + - VP8 + - H265 + - H264 + - MPEG-4 Video + - MPEG-1/2 Video + - M-JPEG + - Opus + - FLAC + - Vorbis + - MPEG-4 Audio + - MPEG-4 Audio LATM + - MPEG-1/2 Audio + - AC3 + - Speex + - G726 + - G722 + - G711 + - LPCM + - MPEG-TS + - KLV + - Generic + + RTMPConnState: + type: string + enum: + - idle + - read + - publish + + RTSPRangeType: + type: string + enum: + - "" + - clock + - npt + - smpte + + RTSPSessionState: + type: string + enum: + - idle + - read + - publish + + RecordFormat: + type: string + enum: + - fmp4 + - mpegts + + SRTConnState: + type: string + enum: + - idle + - read + - publish + + WebRTCSessionState: + type: string + enum: + - read + - publish + + AlwaysAvailableTrack: + type: object + properties: + channelCount: + type: integer + format: int64 + codec: + $ref: "#/components/schemas/AlwaysAvailableTrackCodec" + muLaw: + type: boolean + sampleRate: + type: integer + format: int64 + + AuthInternalUser: + type: object + properties: + ips: + type: array + items: + type: string + pass: + type: string + permissions: + type: array + items: + $ref: "#/components/schemas/AuthInternalUserPermission" + user: + type: string + + AuthInternalUserPermission: + type: object + properties: + action: + $ref: "#/components/schemas/AuthAction" + path: + type: string + + Error: + type: object + properties: + error: + type: string + status: + $ref: "#/components/schemas/ErrorStatus" + + GlobalConf: + type: object + properties: + api: + type: boolean + description: Control API + apiAddress: + type: string + apiAllowOrigin: + type: string + nullable: true + deprecated: true + apiAllowOrigins: + type: array + items: + type: string + apiEncryption: + type: boolean + apiServerCert: + type: string + apiServerKey: + type: string + apiTrustedProxies: + type: array + items: + type: string + authHTTPAddress: + type: string + authHTTPExclude: + type: array + items: + $ref: "#/components/schemas/AuthInternalUserPermission" + authHTTPFingerprint: + type: string + authInternalUsers: + type: array + items: + $ref: "#/components/schemas/AuthInternalUser" + authJWTAudience: + type: string + authJWTClaimKey: + type: string + authJWTExclude: + type: array + items: + $ref: "#/components/schemas/AuthInternalUserPermission" + authJWTInHTTPQuery: + type: boolean + nullable: true + deprecated: true + authJWTIssuer: + type: string + authJWTJWKS: + type: string + authJWTJWKSFingerprint: + type: string + authMethod: + $ref: "#/components/schemas/AuthMethod" + description: Authentication + authMethods: + type: array + nullable: true + deprecated: true + items: + $ref: "#/components/schemas/RTSPAuthMethod" + dumpPackets: + type: boolean + encryption: + type: string + allOf: + - $ref: "#/components/schemas/Encryption" + nullable: true + deprecated: true + externalAuthenticationURL: + type: string + nullable: true + deprecated: true + hls: + type: boolean + description: HLS server + hlsAddress: + type: string + hlsAllowOrigin: + type: string + nullable: true + deprecated: true + hlsAllowOrigins: + type: array + items: + type: string + hlsAlwaysRemux: + type: boolean + hlsCDNSecret: + type: string + hlsDirectory: + type: string + hlsDisable: + type: boolean + nullable: true + deprecated: true + hlsEncryption: + type: boolean + hlsMuxerCloseAfter: + type: string + hlsPartDuration: + type: string + hlsSegmentCount: + type: integer + format: int64 + hlsSegmentDuration: + type: string + hlsSegmentMaxSize: + type: string + hlsServerCert: + type: string + hlsServerKey: + type: string + hlsTrustedProxies: + type: array + items: + type: string + hlsVariant: + $ref: "#/components/schemas/HLSVariant" + logDestinations: + type: array + items: + $ref: "#/components/schemas/LogDestination" + logFile: + type: string + logLevel: + $ref: "#/components/schemas/LogLevel" + description: General + logStructured: + type: boolean + metrics: + type: boolean + description: Metrics + metricsAddress: + type: string + metricsAllowOrigin: + type: string + nullable: true + deprecated: true + metricsAllowOrigins: + type: array + items: + type: string + metricsEncryption: + type: boolean + metricsServerCert: + type: string + metricsServerKey: + type: string + metricsTrustedProxies: + type: array + items: + type: string + moq: + type: boolean + description: MoQ server + moqAllowOrigins: + type: array + items: + type: string + moqHTTP2Address: + type: string + moqHTTP3Address: + type: string + moqHTTPS2Address: + type: string + nullable: true + deprecated: true + moqHTTPS3Address: + type: string + nullable: true + deprecated: true + moqServerCert: + type: string + moqServerKey: + type: string + moqTrustedProxies: + type: array + items: + type: string + multicastIPRange: + type: string + multicastRTCPPort: + type: integer + format: int64 + multicastRTPPort: + type: integer + format: int64 + multicastSRTCPPort: + type: integer + format: int64 + multicastSRTPPort: + type: integer + format: int64 + playback: + type: boolean + description: Playback + playbackAddress: + type: string + playbackAllowOrigin: + type: string + nullable: true + deprecated: true + playbackAllowOrigins: + type: array + items: + type: string + playbackEncryption: + type: boolean + playbackServerCert: + type: string + playbackServerKey: + type: string + playbackTrustedProxies: + type: array + items: + type: string + pprof: + type: boolean + description: PPROF + pprofAddress: + type: string + pprofAllowOrigin: + type: string + nullable: true + deprecated: true + pprofAllowOrigins: + type: array + items: + type: string + pprofEncryption: + type: boolean + pprofServerCert: + type: string + pprofServerKey: + type: string + pprofTrustedProxies: + type: array + items: + type: string + protocols: + type: array + nullable: true + deprecated: true + items: + type: string + enum: + - udp + - multicast + - tcp + readBufferCount: + type: integer + format: int64 + nullable: true + deprecated: true + readTimeout: + type: string + record: + type: boolean + description: Record (deprecated) + nullable: true + deprecated: true + recordDeleteAfter: + type: string + nullable: true + deprecated: true + recordFormat: + type: string + allOf: + - $ref: "#/components/schemas/RecordFormat" + nullable: true + deprecated: true + recordPartDuration: + type: string + nullable: true + deprecated: true + recordPath: + type: string + nullable: true + deprecated: true + recordSegmentDuration: + type: string + nullable: true + deprecated: true + rtcpAddress: + type: string + rtmp: + type: boolean + description: RTMP server + rtmpAddress: + type: string + rtmpDisable: + type: boolean + nullable: true + deprecated: true + rtmpEncryption: + $ref: "#/components/schemas/Encryption" + rtmpServerCert: + type: string + rtmpServerKey: + type: string + rtmpTrustedProxies: + type: array + items: + type: string + rtmpsAddress: + type: string + rtpAddress: + type: string + rtsp: + type: boolean + description: RTSP server + rtspAddress: + type: string + rtspAuthMethods: + type: array + items: + $ref: "#/components/schemas/RTSPAuthMethod" + rtspDisable: + type: boolean + nullable: true + deprecated: true + rtspEncryption: + $ref: "#/components/schemas/Encryption" + rtspServerCert: + type: string + rtspServerKey: + type: string + rtspTransports: + type: array + items: + type: string + enum: + - udp + - multicast + - tcp + rtspTrustedProxies: + type: array + items: + type: string + rtspUDPReadBufferSize: + type: integer + format: uint64 + nullable: true + deprecated: true + rtspsAddress: + type: string + runOnConnect: + type: string + runOnConnectRestart: + type: boolean + runOnDisconnect: + type: string + srt: + type: boolean + description: SRT server + srtAddress: + type: string + srtcpAddress: + type: string + srtpAddress: + type: string + sysLogPrefix: + type: string + udpMaxPayloadSize: + type: integer + format: int64 + udpReadBufferSize: + type: integer + format: uint64 + webrtc: + type: boolean + description: WebRTC server + webrtcAdditionalHosts: + type: array + items: + type: string + webrtcAddress: + type: string + webrtcAllowOrigin: + type: string + nullable: true + deprecated: true + webrtcAllowOrigins: + type: array + items: + type: string + webrtcDisable: + type: boolean + nullable: true + deprecated: true + webrtcEncryption: + type: boolean + webrtcHandshakeTimeout: + type: string + webrtcICEHostNAT1To1IPs: + type: array + nullable: true + deprecated: true + items: + type: string + webrtcICEServers: + type: array + nullable: true + deprecated: true + items: + type: string + webrtcICEServers2: + type: array + items: + $ref: "#/components/schemas/WebRTCICEServer" + webrtcICETCPMuxAddress: + type: string + nullable: true + deprecated: true + webrtcICEUDPMuxAddress: + type: string + nullable: true + deprecated: true + webrtcIPsFromInterfaces: + type: boolean + webrtcIPsFromInterfacesList: + type: array + items: + type: string + webrtcLocalTCPAddress: + type: string + webrtcLocalUDPAddress: + type: string + webrtcSTUNGatherTimeout: + type: string + webrtcServerCert: + type: string + webrtcServerKey: + type: string + webrtcTrackGatherTimeout: + type: string + webrtcTrustedProxies: + type: array + items: + type: string + writeQueueSize: + type: integer + format: int64 + writeTimeout: + type: string + + HLSMuxer: + type: object + properties: + bytesSent: + type: integer + format: uint64 + description: deprecated + deprecated: true + created: + type: string + lastRequest: + type: string + outboundBytes: + type: integer + format: uint64 + outboundFramesDiscarded: + type: integer + format: uint64 + path: + type: string + + HLSMuxerList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/HLSMuxer" + pageCount: + type: integer + format: int64 + + HLSSession: + type: object + properties: + created: + type: string + id: + type: string + format: uuid + isCDN: + type: boolean + outboundBytes: + type: integer + format: uint64 + path: + type: string + query: + type: string + remoteAddr: + type: string + user: + type: string + userAgent: + type: string + + HLSSessionList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/HLSSession" + pageCount: + type: integer + format: int64 + + Info: + type: object + properties: + started: + type: string + version: + type: string + + MoQSession: + type: object + properties: + created: + type: string + id: + type: string + format: uuid + inboundBytes: + type: integer + format: uint64 + outboundBytes: + type: integer + format: uint64 + path: + type: string + query: + type: string + remoteAddr: + type: string + state: + $ref: "#/components/schemas/MoQSessionState" + userAgent: + type: string + version: + $ref: "#/components/schemas/MoQVersion" + + MoQSessionList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/MoQSession" + pageCount: + type: integer + format: int64 + + OK: + type: object + properties: + status: + $ref: "#/components/schemas/OKStatus" + + Path: + type: object + properties: + available: + type: boolean + availableTime: + type: string + nullable: true + bytesReceived: + type: integer + format: uint64 + description: deprecated + deprecated: true + bytesSent: + type: integer + format: uint64 + deprecated: true + confName: + type: string + inboundBytes: + type: integer + format: uint64 + inboundFramesInError: + type: integer + format: uint64 + name: + type: string + online: + type: boolean + onlineTime: + type: string + nullable: true + outboundBytes: + type: integer + format: uint64 + readers: + type: array + items: + $ref: "#/components/schemas/PathReader" + ready: + type: boolean + deprecated: true + readyTime: + type: string + nullable: true + deprecated: true + source: + type: object + allOf: + - $ref: "#/components/schemas/PathSource" + nullable: true + tracks: + type: array + deprecated: true + items: + $ref: "#/components/schemas/PathTrackCodec" + tracks2: + type: array + items: + $ref: "#/components/schemas/PathTrack" + + PathConf: + type: object + properties: + alwaysAvailable: + type: boolean + description: Always available + alwaysAvailableFile: + type: string + alwaysAvailableTracks: + type: array + items: + $ref: "#/components/schemas/AlwaysAvailableTrack" + disablePublisherOverride: + type: boolean + nullable: true + deprecated: true + fallback: + type: string + nullable: true + deprecated: true + maxReaders: + type: integer + format: int64 + mpegtsUDPReadBufferSize: + type: integer + format: uint64 + description: MPEG-TS source + nullable: true + deprecated: true + name: + type: string + description: filled by Validate() + overridePublisher: + type: boolean + description: Publisher source + playback: + type: boolean + nullable: true + deprecated: true + publishIPs: + type: array + nullable: true + deprecated: true + items: + type: string + publishPass: + type: string + nullable: true + deprecated: true + publishUser: + type: string + description: Authentication (deprecated) + nullable: true + deprecated: true + readIPs: + type: array + nullable: true + deprecated: true + items: + type: string + readPass: + type: string + nullable: true + deprecated: true + readUser: + type: string + nullable: true + deprecated: true + record: + type: boolean + description: Record + recordDeleteAfter: + type: string + recordFormat: + $ref: "#/components/schemas/RecordFormat" + recordMaxPartSize: + type: string + recordPartDuration: + type: string + recordPath: + type: string + recordSegmentDuration: + type: string + rpiCameraAWB: + type: string + rpiCameraAWBGains: + type: array + items: + type: number + format: double + rpiCameraAfMode: + type: string + rpiCameraAfRange: + type: string + rpiCameraAfSpeed: + type: string + rpiCameraAfWindow: + type: string + rpiCameraBitrate: + type: integer + format: uint64 + rpiCameraBrightness: + type: number + format: double + rpiCameraCamID: + type: integer + format: uint64 + description: Raspberry Pi Camera source + rpiCameraCodec: + type: string + rpiCameraContrast: + type: number + format: double + rpiCameraDenoise: + type: string + rpiCameraEV: + type: number + format: double + rpiCameraExposure: + type: string + rpiCameraFPS: + type: number + format: double + rpiCameraFlickerPeriod: + type: integer + format: uint64 + rpiCameraGain: + type: number + format: double + rpiCameraH264Level: + type: string + rpiCameraH264Profile: + type: string + rpiCameraHDR: + type: boolean + rpiCameraHFlip: + type: boolean + rpiCameraHardwareH264Level: + type: string + nullable: true + deprecated: true + rpiCameraHardwareH264Profile: + type: string + nullable: true + deprecated: true + rpiCameraHeight: + type: integer + format: uint64 + rpiCameraIDRPeriod: + type: integer + format: uint64 + rpiCameraJPEGQuality: + type: integer + format: uint64 + nullable: true + deprecated: true + rpiCameraLensPosition: + type: number + format: double + rpiCameraLevel: + type: string + nullable: true + deprecated: true + rpiCameraMJPEGQuality: + type: integer + format: uint64 + rpiCameraMetering: + type: string + rpiCameraMode: + type: string + rpiCameraProfile: + type: string + nullable: true + deprecated: true + rpiCameraROI: + type: string + rpiCameraSaturation: + type: number + format: double + rpiCameraSecondary: + type: boolean + rpiCameraSharpness: + type: number + format: double + rpiCameraShutter: + type: integer + format: uint64 + rpiCameraSoftwareH264Level: + type: string + nullable: true + deprecated: true + rpiCameraSoftwareH264Profile: + type: string + nullable: true + deprecated: true + rpiCameraTextOverlay: + type: string + rpiCameraTextOverlayEnable: + type: boolean + rpiCameraTuningFile: + type: string + rpiCameraVFlip: + type: boolean + rpiCameraWidth: + type: integer + format: uint64 + rtpSDP: + type: string + description: RTP source + rtpUDPReadBufferSize: + type: integer + format: uint64 + nullable: true + deprecated: true + rtspAnyPort: + type: boolean + rtspDemuxMpegts: + type: boolean + rtspRangeStart: + type: string + rtspRangeType: + $ref: "#/components/schemas/RTSPRangeType" + rtspScale: + type: string + rtspTransport: + $ref: "#/components/schemas/RTSPTransport" + description: RTSP source + rtspUDPReadBufferSize: + type: integer + format: uint64 + nullable: true + deprecated: true + rtspUDPSourcePortRange: + type: array + items: + type: integer + format: uint64 + runOnAvailable: + type: string + runOnAvailableRestart: + type: boolean + runOnDemand: + type: string + runOnDemandCloseAfter: + type: string + runOnDemandRestart: + type: boolean + runOnDemandStartTimeout: + type: string + runOnInit: + type: string + description: Hooks + runOnInitRestart: + type: boolean + runOnNotReady: + type: string + nullable: true + deprecated: true + runOnOffline: + type: string + runOnOnline: + type: string + runOnOnlineRestart: + type: boolean + runOnRead: + type: string + runOnReadRestart: + type: boolean + runOnReady: + type: string + nullable: true + deprecated: true + runOnReadyRestart: + type: boolean + nullable: true + deprecated: true + runOnRecordSegmentComplete: + type: string + runOnRecordSegmentCreate: + type: string + runOnUnDemand: + type: string + runOnUnavailable: + type: string + runOnUnread: + type: string + source: + type: string + description: General + sourceAnyPortEnable: + type: boolean + nullable: true + deprecated: true + sourceFingerprint: + type: string + sourceOnDemand: + type: boolean + sourceOnDemandCloseAfter: + type: string + sourceOnDemandStartTimeout: + type: string + sourceProtocol: + type: string + allOf: + - $ref: "#/components/schemas/RTSPTransport" + nullable: true + deprecated: true + sourceRedirect: + type: string + description: Redirect source + srtPublishPassphrase: + type: string + srtReadPassphrase: + type: string + useAbsoluteTimestamp: + type: boolean + whepBearerToken: + type: string + description: WHEP source + whepHandshakeTimeout: + type: string + whepSTUNGatherTimeout: + type: string + whepTrackGatherTimeout: + type: string + + PathConfList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/PathConf" + pageCount: + type: integer + format: int64 + + PathList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/Path" + pageCount: + type: integer + format: int64 + + PathReader: + type: object + properties: + id: + type: string + type: + $ref: "#/components/schemas/PathReaderType" + + PathSource: + type: object + properties: + id: + type: string + type: + $ref: "#/components/schemas/PathSourceType" + + PathTrack: + type: object + properties: + codec: + $ref: "#/components/schemas/PathTrackCodec" + codecProps: + type: object + allOf: + - $ref: "#/components/schemas/PathTrackCodecProps" + nullable: true + + PathTrackCodecPropsAC3: + type: object + properties: + channelCount: + type: integer + format: int64 + sampleRate: + type: integer + format: int64 + + PathTrackCodecPropsAV1: + type: object + properties: + height: + type: integer + format: int64 + level: + type: integer + format: int64 + profile: + type: integer + format: int64 + tier: + type: integer + format: int64 + width: + type: integer + format: int64 + + PathTrackCodecPropsG711: + type: object + properties: + channelCount: + type: integer + format: int64 + muLaw: + type: boolean + sampleRate: + type: integer + format: int64 + + PathTrackCodecPropsH264: + type: object + properties: + height: + type: integer + format: int64 + level: + type: string + profile: + type: string + width: + type: integer + format: int64 + + PathTrackCodecPropsH265: + type: object + properties: + height: + type: integer + format: int64 + level: + type: string + profile: + type: string + width: + type: integer + format: int64 + + PathTrackCodecPropsLPCM: + type: object + properties: + bitDepth: + type: integer + format: int64 + channelCount: + type: integer + format: int64 + sampleRate: + type: integer + format: int64 + + PathTrackCodecPropsMPEG4Audio: + type: object + properties: + channelCount: + type: integer + format: int64 + sampleRate: + type: integer + format: int64 + + PathTrackCodecPropsOpus: + type: object + properties: + channelCount: + type: integer + format: int64 + + PathTrackCodecPropsVP9: + type: object + properties: + profile: + type: integer + format: int64 + + Recording: + type: object + properties: + name: + type: string + segments: + type: array + items: + $ref: "#/components/schemas/RecordingSegment" + + RecordingList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/Recording" + pageCount: + type: integer + format: int64 + + RecordingSegment: + type: object + properties: + start: + type: string + + RTMPConn: + type: object + properties: + bytesReceived: + type: integer + format: uint64 + description: deprecated + deprecated: true + bytesSent: + type: integer + format: uint64 + deprecated: true + created: + type: string + id: + type: string + format: uuid + inboundBytes: + type: integer + format: uint64 + outboundBytes: + type: integer + format: uint64 + outboundFramesDiscarded: + type: integer + format: uint64 + path: + type: string + query: + type: string + remoteAddr: + type: string + state: + $ref: "#/components/schemas/RTMPConnState" + user: + type: string + userAgent: + type: string + + RTMPConnList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/RTMPConn" + pageCount: + type: integer + format: int64 + + RTSPConn: + type: object + properties: + bytesReceived: + type: integer + format: uint64 + deprecated: true + bytesSent: + type: integer + format: uint64 + deprecated: true + created: + type: string + id: + type: string + format: uuid + inboundBytes: + type: integer + format: uint64 + outboundBytes: + type: integer + format: uint64 + remoteAddr: + type: string + session: + type: string + format: uuid + nullable: true + tunnel: + type: string + + RTSPConnList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/RTSPConn" + pageCount: + type: integer + format: int64 + + RTSPSession: + type: object + properties: + bytesReceived: + type: integer + format: uint64 + description: deprecated + deprecated: true + bytesSent: + type: integer + format: uint64 + deprecated: true + conns: + type: array + items: + type: string + format: uuid + created: + type: string + id: + type: string + format: uuid + inboundBytes: + type: integer + format: uint64 + inboundRTCPPackets: + type: integer + format: uint64 + inboundRTCPPacketsInError: + type: integer + format: uint64 + inboundRTPPackets: + type: integer + format: uint64 + inboundRTPPacketsInError: + type: integer + format: uint64 + inboundRTPPacketsJitter: + type: number + format: double + inboundRTPPacketsLost: + type: integer + format: uint64 + outboundBytes: + type: integer + format: uint64 + outboundRTCPPackets: + type: integer + format: uint64 + outboundRTPPackets: + type: integer + format: uint64 + outboundRTPPacketsDiscarded: + type: integer + format: uint64 + outboundRTPPacketsReportedLost: + type: integer + format: uint64 + path: + type: string + profile: + type: string + nullable: true + query: + type: string + remoteAddr: + type: string + rtcpPacketsInError: + type: integer + format: uint64 + deprecated: true + rtcpPacketsReceived: + type: integer + format: uint64 + deprecated: true + rtcpPacketsSent: + type: integer + format: uint64 + deprecated: true + rtpPacketsInError: + type: integer + format: uint64 + deprecated: true + rtpPacketsJitter: + type: number + format: double + deprecated: true + rtpPacketsLost: + type: integer + format: uint64 + deprecated: true + rtpPacketsReceived: + type: integer + format: uint64 + deprecated: true + rtpPacketsSent: + type: integer + format: uint64 + deprecated: true + state: + $ref: "#/components/schemas/RTSPSessionState" + transport: + type: string + nullable: true + user: + type: string + userAgent: + type: string + + RTSPSessionList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/RTSPSession" + pageCount: + type: integer + format: int64 + + SRTConn: + type: object + properties: + byteMSS: + type: integer + format: uint64 + description: Maximum Segment Size (MSS), in bytes + bytesAvailReceiveBuf: + type: integer + format: uint64 + description: The available space in the receiver's buffer, in bytes + bytesAvailSendBuf: + type: integer + format: uint64 + description: The available space in the sender's buffer, in bytes + bytesReceiveBuf: + type: integer + format: uint64 + description: Instantaneous (current) value of packetsRcvBuf, expressed in bytes, including payload and all headers (IP, TCP, SRT) + bytesReceived: + type: integer + format: uint64 + description: Same as packetsReceived, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + bytesReceivedBelated: + type: integer + format: uint64 + description: Same as PacketsReceivedBelated, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + bytesReceivedDrop: + type: integer + format: uint64 + description: Same as packetsReceivedDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + bytesReceivedLoss: + type: integer + format: uint64 + description: Same as packetsReceivedLoss, but expressed in bytes, including payload and all the headers (IP, TCP, SRT), bytes for the presently missing (either reordered or lost) packets' payloads are estimated based on the average packet size + bytesReceivedRetrans: + type: integer + format: uint64 + description: Same as packetsReceivedRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + bytesReceivedUndecrypt: + type: integer + format: uint64 + description: Same as packetsReceivedUndecrypt, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + bytesReceivedUnique: + type: integer + format: uint64 + description: Same as packetsReceivedUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + bytesRetrans: + type: integer + format: uint64 + description: Same as packetsRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + bytesSendBuf: + type: integer + format: uint64 + description: Instantaneous (current) value of packetsSndBuf, but expressed in bytes, including payload and all headers (IP, TCP, SRT) + bytesSendDrop: + type: integer + format: uint64 + description: Same as packetsSendDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + bytesSent: + type: integer + format: uint64 + description: Same as packetsSent, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + bytesSentUnique: + type: integer + format: uint64 + description: Same as packetsSentUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + created: + type: string + id: + type: string + format: uuid + mbpsLinkCapacity: + type: number + format: double + description: Estimated capacity of the network link, in Mbps + mbpsMaxBW: + type: number + format: double + description: Transmission bandwidth limit, in Mbps + mbpsReceiveRate: + type: number + format: double + description: Current receiving bandwidth, in Mbps + mbpsSendRate: + type: number + format: double + description: Current transmission bandwidth, in Mbps + msRTT: + type: number + format: double + description: Smoothed round-trip time (SRTT), an exponentially-weighted moving average (EWMA) of an endpoint's RTT samples, in milliseconds + msReceiveBuf: + type: integer + format: uint64 + description: The timespan (msec) of acknowledged packets in the receiver's buffer + msReceiveTsbPdDelay: + type: integer + format: uint64 + description: Timestamp-based Packet Delivery Delay value set on the socket via SRTO_RCVLATENCY or SRTO_LATENCY + msSendBuf: + type: integer + format: uint64 + description: The timespan (msec) of packets in the sender's buffer (unacknowledged packets) + msSendTsbPdDelay: + type: integer + format: uint64 + description: Timestamp-based Packet Delivery Delay value of the peer + outboundFramesDiscarded: + type: integer + format: uint64 + packetsFlightSize: + type: integer + format: uint64 + description: The number of packets in flight + packetsFlowWindow: + type: integer + format: uint64 + description: The maximum number of packets that can be "in flight" + packetsReceiveBuf: + type: integer + format: uint64 + description: The number of acknowledged packets in receiver's buffer + packetsReceived: + type: integer + format: uint64 + description: The total number of received DATA packets, including retransmitted packets + packetsReceivedACK: + type: integer + format: uint64 + description: The total number of received ACK (Acknowledgement) control packets + packetsReceivedAvgBelatedTime: + type: integer + format: uint64 + description: Accumulated difference between the current time and the time-to-play of a packet that is received late + packetsReceivedBelated: + type: integer + format: uint64 + packetsReceivedDrop: + type: integer + format: uint64 + description: The total number of dropped by the SRT receiver and, as a result, not delivered to the upstream application DATA packets + packetsReceivedKM: + type: integer + format: uint64 + description: The total number of received KM (Key Material) control packets + packetsReceivedLoss: + type: integer + format: uint64 + description: The total number of SRT DATA packets detected as presently missing (either reordered or lost) at the receiver side + packetsReceivedLossRate: + type: number + format: double + description: Percentage of retransmitted data vs. received data + packetsReceivedNAK: + type: integer + format: uint64 + description: The total number of received NAK (Negative Acknowledgement) control packets + packetsReceivedRetrans: + type: integer + format: uint64 + description: The total number of retransmitted packets registered at the receiver side + packetsReceivedUndecrypt: + type: integer + format: uint64 + description: The total number of packets that failed to be decrypted at the receiver side + packetsReceivedUnique: + type: integer + format: uint64 + description: The total number of unique original, retransmitted or recovered by the packet filter DATA packets received in time, decrypted without errors and, as a result, scheduled for delivery to the upstream application by the SRT receiver. + packetsReorderTolerance: + type: integer + format: uint64 + description: Instant value of the packet reorder tolerance + packetsRetrans: + type: integer + format: uint64 + description: The total number of retransmitted packets sent by the SRT sender + packetsSendBuf: + type: integer + format: uint64 + description: The number of packets in the sender's buffer that are already scheduled for sending or even possibly sent, but not yet acknowledged + packetsSendDrop: + type: integer + format: uint64 + description: The total number of dropped by the SRT sender DATA packets that have no chance to be delivered in time + packetsSendLoss: + type: integer + format: uint64 + description: The total number of data packets considered or reported as lost at the sender side. Does not correspond to the packets detected as lost at the receiver side. + packetsSendLossRate: + type: number + format: double + description: Percentage of resent data vs. sent data + packetsSent: + type: integer + format: uint64 + description: The total number of sent DATA packets, including retransmitted packets + packetsSentACK: + type: integer + format: uint64 + description: The total number of sent ACK (Acknowledgement) control packets + packetsSentKM: + type: integer + format: uint64 + description: The total number of sent KM (Key Material) control packets + packetsSentNAK: + type: integer + format: uint64 + description: The total number of sent NAK (Negative Acknowledgement) control packets + packetsSentUnique: + type: integer + format: uint64 + description: The total number of unique DATA packets sent by the SRT sender + path: + type: string + query: + type: string + remoteAddr: + type: string + state: + $ref: "#/components/schemas/SRTConnState" + usPacketsSendPeriod: + type: number + format: double + description: Current minimum time interval between which consecutive packets are sent, in microseconds + usSndDuration: + type: integer + format: uint64 + description: The total accumulated time in microseconds, during which the SRT sender has some data to transmit, including packets that have been sent, but not yet acknowledged + user: + type: string + + SRTConnList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/SRTConn" + pageCount: + type: integer + format: int64 + + WebRTCICEServer: + type: object + properties: + clientOnly: + type: boolean + password: + type: string + url: + type: string + username: + type: string + + WebRTCSession: + type: object + properties: + bytesReceived: + type: integer + format: uint64 + description: deprecated + deprecated: true + bytesSent: + type: integer + format: uint64 + deprecated: true + created: + type: string + id: + type: string + format: uuid + inboundBytes: + type: integer + format: uint64 + inboundRTCPPackets: + type: integer + format: uint64 + inboundRTPPackets: + type: integer + format: uint64 + inboundRTPPacketsJitter: + type: number + format: double + inboundRTPPacketsLost: + type: integer + format: uint64 + localCandidate: + type: string + outboundBytes: + type: integer + format: uint64 + outboundFramesDiscarded: + type: integer + format: uint64 + outboundRTCPPackets: + type: integer + format: uint64 + outboundRTPPackets: + type: integer + format: uint64 + path: + type: string + peerConnectionEstablished: + type: boolean + query: + type: string + remoteAddr: + type: string + remoteCandidate: + type: string + rtcpPacketsReceived: + type: integer + format: uint64 + deprecated: true + rtcpPacketsSent: + type: integer + format: uint64 + deprecated: true + rtpPacketsJitter: + type: number + format: double + deprecated: true + rtpPacketsLost: + type: integer + format: uint64 + deprecated: true + rtpPacketsReceived: + type: integer + format: uint64 + deprecated: true + rtpPacketsSent: + type: integer + format: uint64 + deprecated: true + state: + $ref: "#/components/schemas/WebRTCSessionState" + user: + type: string + userAgent: + type: string + + WebRTCSessionList: + type: object + properties: + itemCount: + type: integer + format: int64 + items: + type: array + items: + $ref: "#/components/schemas/WebRTCSession" + pageCount: + type: integer + format: int64 + +paths: + /v3/info: + get: + operationId: info + tags: [General] + summary: returns informations about the instance. + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/Info" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/auth/jwks/refresh: + post: + operationId: authJwksRefresh + tags: [Authentication] + summary: Manually refreshes the JWT JWKS. + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/global/get: + get: + operationId: configGlobalGet + tags: [Configuration] + summary: returns the global configuration. + description: "" + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/GlobalConf" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/global/patch: + patch: + operationId: configGlobalSet + tags: [Configuration] + summary: patches the global configuration. + description: all fields are optional. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/GlobalConf" + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/pathdefaults/get: + get: + operationId: configPathDefaultsGet + tags: [Configuration] + summary: returns the default path configuration. + description: "" + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/PathConf" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/pathdefaults/patch: + patch: + operationId: configPathDefaultsPatch + tags: [Configuration] + summary: patches the default path configuration. + description: all fields are optional. + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PathConf" + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/paths/list: + get: + operationId: configPathsList + tags: [Configuration] + summary: returns all path configurations. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/PathConfList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/paths/get/{name}: + get: + operationId: configPathsGet + tags: [Configuration] + summary: returns a path configuration. + description: "" + parameters: + - name: name + in: path + required: true + description: the name of the path. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/PathConf" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: path not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/paths/add/{name}: + post: + operationId: configPathsAdd + tags: [Configuration] + summary: adds a path configuration. + description: all fields are optional. + parameters: + - name: name + in: path + required: true + description: the name of the path. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PathConf" + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/paths/patch/{name}: + patch: + operationId: configPathsPatch + tags: [Configuration] + summary: patches a path configuration. + description: all fields are optional. + parameters: + - name: name + in: path + required: true + description: the name of the path. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PathConf" + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: path not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/paths/replace/{name}: + post: + operationId: configPathsReplace + tags: [Configuration] + summary: replaces all values of a path configuration. + description: all fields are optional. + parameters: + - name: name + in: path + required: true + description: the name of the path. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: "#/components/schemas/PathConf" + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: path not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/config/paths/delete/{name}: + delete: + operationId: configPathsDelete + tags: [Configuration] + summary: removes a path configuration. + description: "" + parameters: + - name: name + in: path + required: true + description: the name of the path. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: path not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/hlsmuxers/list: + get: + operationId: hlsMuxersList + tags: [HLS] + summary: returns all HLS muxers. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/HLSMuxerList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/hlsmuxers/get/{name}: + get: + operationId: hlsMuxersGet + tags: [HLS] + summary: returns a HLS muxer. + description: "" + parameters: + - name: name + in: path + required: true + description: name of the muxer. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/HLSMuxer" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: muxer not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/hlssessions/list: + get: + operationId: hlssessionsList + tags: [HLS] + summary: returns all HLS sessions. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/HLSSessionList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/hlssessions/get/{id}: + get: + operationId: hlssessionsGet + tags: [HLS] + summary: returns a HLS session. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the session. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/HLSSession" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/hlssessions/kick/{id}: + post: + operationId: hlssessionsKick + tags: [HLS] + summary: kicks out a HLS session from the server. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the session. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/paths/list: + get: + operationId: pathsList + tags: [Paths] + summary: returns all paths. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/PathList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/paths/get/{name}: + get: + operationId: pathsGet + tags: [Paths] + summary: returns a path. + description: "" + parameters: + - name: name + in: path + required: true + description: name of the path. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/Path" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: path not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspconns/list: + get: + operationId: rtspConnsList + tags: [RTSP] + summary: returns all RTSP connections. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTSPConnList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspconns/get/{id}: + get: + operationId: rtspConnsGet + tags: [RTSP] + summary: returns a RTSP connection. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTSPConn" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: connection not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspsessions/list: + get: + operationId: rtspSessionsList + tags: [RTSP] + summary: returns all RTSP sessions. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTSPSessionList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspsessions/get/{id}: + get: + operationId: rtspSessionsGet + tags: [RTSP] + summary: returns a RTSP session. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTSPSession" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspsessions/kick/{id}: + post: + operationId: rtspSessionsKick + tags: [RTSP] + summary: kicks out a RTSP session from the server. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the session. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspsconns/list: + get: + operationId: rtspsConnsList + tags: [RTSP] + summary: returns all RTSPS connections. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTSPConnList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspsconns/get/{id}: + get: + operationId: rtspsConnsGet + tags: [RTSP] + summary: returns a RTSPS connection. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTSPConn" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: connection not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspssessions/list: + get: + operationId: rtspsSessionsList + tags: [RTSP] + summary: returns all RTSPS sessions. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTSPSessionList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspssessions/get/{id}: + get: + operationId: rtspsSessionsGet + tags: [RTSP] + summary: returns a RTSPS session. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTSPSession" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtspssessions/kick/{id}: + post: + operationId: rtspsSessionsKick + tags: [RTSP] + summary: kicks out a RTSPS session from the server. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the session. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtmpconns/list: + get: + operationId: rtmpConnsList + tags: [RTMP] + summary: returns all RTMP connections. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTMPConnList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtmpconns/get/{id}: + get: + operationId: rtmpConnectionsGet + tags: [RTMP] + summary: returns a RTMP connection. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTMPConn" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: connection not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtmpconns/kick/{id}: + post: + operationId: rtmpConnsKick + tags: [RTMP] + summary: kicks out a RTMP connection from the server. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: connection not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtmpsconns/list: + get: + operationId: rtmpsConnsList + tags: [RTMP] + summary: returns all RTMPS connections. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTMPConnList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtmpsconns/get/{id}: + get: + operationId: rtmpsConnectionsGet + tags: [RTMP] + summary: returns a RTMPS connection. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RTMPConn" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: connection not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/rtmpsconns/kick/{id}: + post: + operationId: rtmpsConnsKick + tags: [RTMP] + summary: kicks out a RTMPS connection from the server. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: connection not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/srtconns/list: + get: + operationId: srtConnsList + tags: [SRT] + summary: returns all SRT connections. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/SRTConnList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/srtconns/get/{id}: + get: + operationId: srtConnsGet + tags: [SRT] + summary: returns a SRT connection. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/SRTConn" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: connection not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/srtconns/kick/{id}: + post: + operationId: srtConnsKick + tags: [SRT] + summary: kicks out a SRT connection from the server. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the connection. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: connection not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/webrtcsessions/list: + get: + operationId: webrtcSessionsList + tags: [WebRTC] + summary: returns all WebRTC sessions. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/WebRTCSessionList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/webrtcsessions/get/{id}: + get: + operationId: webrtcSessionsGet + tags: [WebRTC] + summary: returns a WebRTC session. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the session. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/WebRTCSession" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/webrtcsessions/kick/{id}: + post: + operationId: webrtcSessionsKick + tags: [WebRTC] + summary: kicks out a WebRTC session from the server. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the session. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/moqsessions/list: + get: + operationId: moqSessionsList + tags: [Media-over-QUIC] + summary: returns all MoQ sessions. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/MoQSessionList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/moqsessions/get/{id}: + get: + operationId: moqSessionsGet + tags: [Media-over-QUIC] + summary: returns a MoQ session. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the session. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/MoQSession" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/moqsessions/kick/{id}: + post: + operationId: moqSessionsKick + tags: [Media-over-QUIC] + summary: kicks out a MoQ session from the server. + description: "" + parameters: + - name: id + in: path + required: true + description: ID of the session. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: session not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/recordings/list: + get: + operationId: recordingsList + tags: [Recordings] + summary: returns all recordings, splitted by path. + description: "" + parameters: + - name: page + in: query + description: page number. + schema: + type: integer + default: 0 + - name: itemsPerPage + in: query + description: items per page. + schema: + type: integer + default: 100 + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/RecordingList" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/recordings/get/{name}: + get: + operationId: recordingsGet + tags: [Recordings] + summary: returns recordings of a path. + description: "" + parameters: + - name: name + in: path + required: true + description: name of the path. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/Recording" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: path not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + + /v3/recordings/deletesegment: + delete: + operationId: recordingsDeleteSegment + tags: [Recordings] + summary: deletes a recording segment. + description: "" + parameters: + - name: path + in: query + required: true + description: path. + schema: + type: string + - name: start + in: query + required: true + description: starting date of the segment. + schema: + type: string + responses: + "200": + description: the request was successful. + content: + application/json: + schema: + $ref: "#/components/schemas/OK" + "400": + description: invalid request. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "404": + description: connection not found. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + "500": + description: server error. + content: + application/json: + schema: + $ref: "#/components/schemas/Error" diff --git a/Sense/cmd/sense-api/main.go b/Sense/cmd/sense-api/main.go new file mode 100644 index 0000000..2fa69ea --- /dev/null +++ b/Sense/cmd/sense-api/main.go @@ -0,0 +1,113 @@ +package main + +import ( + "context" + "errors" + "fmt" + "log/slog" + "net/http" + "os" + "os/signal" + "sync" + "syscall" + "time" + + "yovision/sense/internal/config" + "yovision/sense/internal/mtx" + "yovision/sense/internal/onvif" + "yovision/sense/internal/probe" + "yovision/sense/internal/reconcile" + "yovision/sense/internal/store" +) + +var version = "dev" + +func main() { + logger := slog.New(slog.NewJSONHandler(os.Stdout, nil)) + if err := run(logger); err != nil { + logger.Error("Sense stopped", "error", err) + os.Exit(1) + } +} + +func run(logger *slog.Logger) error { + cfg, err := config.Load() + if err != nil { + return fmt.Errorf("load configuration: %w", err) + } + ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM) + defer stop() + + repository, err := store.OpenSQLite(ctx, cfg.DatabaseDSN) + if err != nil { + return err + } + defer repository.Close() + mediaClient, err := mtx.NewClient(cfg.MediaMTXURL, nil) + if err != nil { + return err + } + + // T-003 deliberately has no real camera adapter. T-006 replaces this port + // only after the device whitelist and five-camera evidence are available. + reconciler := reconcile.New(repository, onvif.UnavailableAdapter{}, mediaClient) + checker := probe.New(repository, mediaClient) + report := func(err error) { + // Domain and MediaMTX errors intentionally omit stream URIs and credentials. + logger.Warn("background convergence error", "error", err) + } + var background sync.WaitGroup + background.Add(2) + go func() { + defer background.Done() + reconciler.Run(ctx, cfg.ReconcileInterval, report) + }() + go func() { + defer background.Done() + checker.Run(ctx, cfg.ProbeInterval, report) + }() + + mux := http.NewServeMux() + mux.HandleFunc("GET /healthz", func(writer http.ResponseWriter, _ *http.Request) { + writer.Header().Set("Content-Type", "application/json") + writer.WriteHeader(http.StatusOK) + _, _ = writer.Write([]byte(`{"status":"ok"}`)) + }) + mux.HandleFunc("GET /readyz", func(writer http.ResponseWriter, _ *http.Request) { + writer.Header().Set("Content-Type", "application/json") + writer.WriteHeader(http.StatusOK) + _, _ = writer.Write([]byte(`{"status":"ready"}`)) + }) + + server := &http.Server{ + Addr: cfg.HTTPAddress, Handler: mux, + ReadHeaderTimeout: 5 * time.Second, + ReadTimeout: 15 * time.Second, + WriteTimeout: 15 * time.Second, + IdleTimeout: 60 * time.Second, + } + serverErrors := make(chan error, 1) + go func() { + logger.Info("Sense listening", "address", cfg.HTTPAddress, "version", version) + serverErrors <- server.ListenAndServe() + }() + + select { + case <-ctx.Done(): + case serverErr := <-serverErrors: + if !errors.Is(serverErr, http.ErrServerClosed) { + stop() + background.Wait() + return fmt.Errorf("serve HTTP: %w", serverErr) + } + } + stop() + shutdownContext, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + shutdownErr := server.Shutdown(shutdownContext) + background.Wait() + if shutdownErr != nil { + return fmt.Errorf("shutdown HTTP server: %w", shutdownErr) + } + return nil +} diff --git a/Sense/deploy/mediamtx.yml b/Sense/deploy/mediamtx.yml new file mode 100644 index 0000000..cccb09a --- /dev/null +++ b/Sense/deploy/mediamtx.yml @@ -0,0 +1,9 @@ +# MediaMTX v1.19.3 minimal control-plane configuration for local T-003 work. +# Keep the API on loopback. Production authentication/network policy is a +# later deployment concern and must be in place before any non-loopback bind. +logLevel: info +api: true +apiAddress: 127.0.0.1:9997 +metrics: true +metricsAddress: 127.0.0.1:9998 +paths: {} diff --git a/Sense/go.mod b/Sense/go.mod new file mode 100644 index 0000000..9af5bda --- /dev/null +++ b/Sense/go.mod @@ -0,0 +1,42 @@ +module yovision/sense + +go 1.26.0 + +toolchain go1.26.5 + +require ( + github.com/oapi-codegen/runtime v1.6.0 + modernc.org/sqlite v1.54.0 +) + +require ( + github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect + github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 // indirect + github.com/dustin/go-humanize v1.0.1 // indirect + github.com/getkin/kin-openapi v0.142.0 // indirect + github.com/go-openapi/jsonpointer v0.23.1 // indirect + github.com/go-openapi/swag/jsonname v0.26.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/mattn/go-isatty v0.0.20 // indirect + github.com/ncruces/go-strftime v1.0.0 // indirect + github.com/oapi-codegen/oapi-codegen/v2 v2.8.0 // indirect + github.com/oasdiff/yaml v0.1.1 // indirect + github.com/oasdiff/yaml3 v0.0.14 // indirect + github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect + github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect + github.com/speakeasy-api/jsonpath v0.6.3 // indirect + github.com/speakeasy-api/openapi v1.24.0 // indirect + github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect + go.yaml.in/yaml/v3 v3.0.4 // indirect + golang.org/x/mod v0.38.0 // indirect + golang.org/x/sync v0.22.0 // indirect + golang.org/x/sys v0.47.0 // indirect + golang.org/x/text v0.40.0 // indirect + golang.org/x/tools v0.48.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect + modernc.org/libc v1.74.1 // indirect + modernc.org/mathutil v1.7.1 // indirect + modernc.org/memory v1.11.0 // indirect +) + +tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen diff --git a/Sense/go.sum b/Sense/go.sum new file mode 100644 index 0000000..cf11ee6 --- /dev/null +++ b/Sense/go.sum @@ -0,0 +1,225 @@ +github.com/RaveNoX/go-jsoncommentstrip v1.0.0/go.mod h1:78ihd09MekBnJnxpICcwzCMzGrKSKYe4AqU6PDYYpjk= +github.com/apapsch/go-jsonmerge/v2 v2.0.0 h1:axGnT1gRIfimI7gJifB699GoE/oq+F2MU7Dml6nw9rQ= +github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= +github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM= +github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dlclark/regexp2 v1.11.4 h1:rPYF9/LECdNymJufQKmri9gV604RvvABwgOA8un7yAo= +github.com/dlclark/regexp2 v1.11.4/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= +github.com/dprotaso/go-yit v0.0.0-20191028211022-135eb7262960/go.mod h1:9HQzr9D/0PGwMEbC3d5AB7oi67+h4TsQqItC1GVYG58= +github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936 h1:PRxIJD8XjimM5aTknUK9w6DHLDox2r2M3DI4i2pnd3w= +github.com/dprotaso/go-yit v0.0.0-20220510233725-9ba8df137936/go.mod h1:ttYvX5qlB+mlV1okblJqcSMtR4c52UKxDiX9GRBS8+Q= +github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= +github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/getkin/kin-openapi v0.142.0 h1:izj0vBdFprMhitfzaX8sTqztsEQyvwhssBoB6n8NO7w= +github.com/getkin/kin-openapi v0.142.0/go.mod h1:3BH9M9XDe/y9M5DSvEocVYAYq1w0qrhJHjC/vZi0AaY= +github.com/go-openapi/jsonpointer v0.23.1 h1:1HBACs7XIwR2RcmItfdSFlALhGbe6S92p0ry4d1GWg4= +github.com/go-openapi/jsonpointer v0.23.1/go.mod h1:iWRmZTrGn7XwYhtPt/fvdSFj1OfNBngqRT2UG3BxSqY= +github.com/go-openapi/swag/jsonname v0.26.0 h1:gV1NFX9M8avo0YSpmWogqfQISigCmpaiNci8cGECU5w= +github.com/go-openapi/swag/jsonname v0.26.0/go.mod h1:urBBR8bZNoDYGr653ynhIx+gTeIz0ARZxHkAPktJK2M= +github.com/go-openapi/testify/v2 v2.4.2 h1:tiByHpvE9uHrrKjOszax7ZvKB7QOgizBWGBLuq0ePx4= +github.com/go-openapi/testify/v2 v2.4.2/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17kjQEVQ1XRhq2/JR1M3sGqeJoxs= +github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPciBPrBUjwbNvtwB6RQlve+hkpll6QSNmOE= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= +github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= +github.com/ncruces/go-strftime v1.0.0 h1:HMFp8mLCTPp341M/ZnA4qaf7ZlsbTc+miZjCLOFAw7w= +github.com/ncruces/go-strftime v1.0.0/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs= +github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY= +github.com/oapi-codegen/oapi-codegen/v2 v2.8.0 h1:s4hxMxuqtR8jPzXkBTtFwY/SBuj3gEAYikmbBSdtLMM= +github.com/oapi-codegen/oapi-codegen/v2 v2.8.0/go.mod h1:yae2TI9IYB5vxQ35gFrpXh9L5H1eJv4MAUK1jumGMTo= +github.com/oapi-codegen/runtime v1.6.0 h1:7Xx+GlueD6nRuyKoCPzL434Jfi3BetbiJOrzCHp/VPU= +github.com/oapi-codegen/runtime v1.6.0/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU= +github.com/oasdiff/yaml v0.1.1 h1:6nHx+pn9gBRM6YpBlFZFQGCCd1nuvqOBtTD3KKTgGxY= +github.com/oasdiff/yaml v0.1.1/go.mod h1:EYJNoyktvWMJ0Hmhx+6qTaqMOsalUaRGT8Sj1hNcegU= +github.com/oasdiff/yaml3 v0.0.14 h1:aLJee3hxBK2H5wdXd9iPcIXb93Nty1Ge0pT171eHtkw= +github.com/oasdiff/yaml3 v0.0.14/go.mod h1:csto2xfDjYccdUn/yw/bPjj/cYTdp6HtFA0J4TWG+gg= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.10.2/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.16.4 h1:29JGrr5oVBm5ulCWet69zQkzWipVXIol6ygQUe/EzNc= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo/v2 v2.1.3/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.19.0 h1:4ieX6qQjPP/BfC3mpsAtIGGlxTWPeA3Inl/7DtXw1tw= +github.com/onsi/gomega v1.19.0/go.mod h1:LY+I3pBVzYsTBU1AnDwOSxaYi9WoWiqgwooUqq9yPro= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= +github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE= +github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo= +github.com/rogpeppe/go-internal v1.14.1 h1:UQB4HGPB6osV0SQTLymcB4TgvyWu6ZyliaW0tI/otEQ= +github.com/rogpeppe/go-internal v1.14.1/go.mod h1:MaRKkUm5W0goXpeCfT7UZI6fk/L7L7so1lCWt35ZSgc= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 h1:KRzFb2m7YtdldCEkzs6KqmJw4nqEVZGK7IN2kJkjTuQ= +github.com/santhosh-tekuri/jsonschema/v6 v6.0.2/go.mod h1:JXeL+ps8p7/KNMjDQk3TCwPpBy0wYklyWTfbkIzdIFU= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/speakeasy-api/jsonpath v0.6.3 h1:c+QPwzAOdrWvzycuc9HFsIZcxKIaWcNpC+xhOW9rJxU= +github.com/speakeasy-api/jsonpath v0.6.3/go.mod h1:2cXloNuQ+RSXi5HTRaeBh7JEmjRXTiaKpFTdZiL7URI= +github.com/speakeasy-api/openapi v1.24.0 h1:opoD27rupX7zBVPq1HkIGLeMOzNNA7JalhYP8q34i04= +github.com/speakeasy-api/openapi v1.24.0/go.mod h1:g3+dIMe0AYgbbGvnlQZqesmjAVWSm9BmsjLevnefQrg= +github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= +github.com/vmware-labs/yaml-jsonpath v0.3.2 h1:/5QKeCBGdsInyDCyVNLbXyilb61MXGi9NP674f9Hobk= +github.com/vmware-labs/yaml-jsonpath v0.3.2/go.mod h1:U6whw1z03QyqgWdgXxvVnQ90zN1BWz5V+51Ewf8k+rQ= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= +go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.38.0 h1:MECBjubtXD7yj4HrhIUcywNaGeNVUdfVnxmPajOk4yk= +golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.57.0 h1:K5+3DljvIuDG9/Jv9rvyMywYNFCQ9RSUY6OOTTkT+tE= +golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.22.0 h1:SZjpbeLmrCk4xhRSZFNZW5gFUeCeFgjekvI/+gfScek= +golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs= +golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/text v0.40.0 h1:Ub2Z6/xjgF1WrYQz2nuITOEegKFtiIy+rieRJ5lHZKs= +golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.48.0 h1:3+hClM1aLL5mjMKm5ovokw9epgRXPuu2tILgismM6RE= +golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20191026110619-0b21df46bc1d/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +modernc.org/cc/v4 v4.29.0 h1:CXgwL8cvxmyzBQZzbSl/6xFtMCryb6u8IOqDci39cgc= +modernc.org/cc/v4 v4.29.0/go.mod h1:OnovgIhbbMXMu1aISnJ0wvVD1KnW+cAUJkIrAWh+kVI= +modernc.org/ccgo/v4 v4.34.6 h1:sBgfIwyN0TQ9C5hwIeuqyeAKyMWnbvj2fvpF4L11uzU= +modernc.org/ccgo/v4 v4.34.6/go.mod h1:SZ8YcN9NG7XVsQYdm6jYBvi8PQP1qi+kqB6OhjqI3Fk= +modernc.org/fileutil v1.4.0 h1:j6ZzNTftVS054gi281TyLjHPp6CPHr2KCxEXjEbD6SM= +modernc.org/fileutil v1.4.0/go.mod h1:EqdKFDxiByqxLk8ozOxObDSfcVOv/54xDs/DUHdvCUU= +modernc.org/gc/v2 v2.6.5 h1:nyqdV8q46KvTpZlsw66kWqwXRHdjIlJOhG6kxiV/9xI= +modernc.org/gc/v2 v2.6.5/go.mod h1:YgIahr1ypgfe7chRuJi2gD7DBQiKSLMPgBQe9oIiito= +modernc.org/gc/v3 v3.1.4 h1:2g65LGVSmFQrXeITAw97x7hCRvZFcyE1uDP+7Vng7JI= +modernc.org/gc/v3 v3.1.4/go.mod h1:HFK/6AGESC7Ex+EZJhJ2Gni6cTaYpSMmU/cT9RmlfYY= +modernc.org/goabi0 v0.2.0 h1:HvEowk7LxcPd0eq6mVOAEMai46V+i7Jrj13t4AzuNks= +modernc.org/goabi0 v0.2.0/go.mod h1:CEFRnnJhKvWT1c1JTI3Avm+tgOWbkOu5oPA8eH8LnMI= +modernc.org/libc v1.74.1 h1:bdR4VTKFMC4966QSNZ05XLGI/VwzVa2kTUX51Dm0riQ= +modernc.org/libc v1.74.1/go.mod h1:uH4t5bOx3G3g9Xcmj10YKlTcVISlRDwv8VoQJG9n8Os= +modernc.org/mathutil v1.7.1 h1:GCZVGXdaN8gTqB1Mf/usp1Y/hSqgI2vAGGP4jZMCxOU= +modernc.org/mathutil v1.7.1/go.mod h1:4p5IwJITfppl0G4sUEDtCr4DthTaT47/N3aT6MhfgJg= +modernc.org/memory v1.11.0 h1:o4QC8aMQzmcwCK3t3Ux/ZHmwFPzE6hf2Y5LbkRs+hbI= +modernc.org/memory v1.11.0/go.mod h1:/JP4VbVC+K5sU2wZi9bHoq2MAkCnrt2r98UGeSK7Mjw= +modernc.org/opt v0.2.0 h1:tGyef5ApycA7FSEOMraay9SaTk5zmbx7Tu+cJs4QKZg= +modernc.org/opt v0.2.0/go.mod h1:03fq9lsNfvkYSfxrfUhZCWPk1lm4cq4N+Bh//bEtgns= +modernc.org/sortutil v1.2.1 h1:+xyoGf15mM3NMlPDnFqrteY07klSFxLElE2PVuWIJ7w= +modernc.org/sortutil v1.2.1/go.mod h1:7ZI3a3REbai7gzCLcotuw9AC4VZVpYMjDzETGsSMqJE= +modernc.org/sqlite v1.54.0 h1:JCxR4qwkJvOaqAoYcgDoO25Nc+ROg6EJ2LfBVzdrgog= +modernc.org/sqlite v1.54.0/go.mod h1:4ntCLuNmnH8+GNqjka1wNg7KJd5/Hi5FYp8K+XQ7GZw= +modernc.org/strutil v1.2.1 h1:UneZBkQA+DX2Rp35KcM69cSsNES9ly8mQWD71HKlOA0= +modernc.org/strutil v1.2.1/go.mod h1:EHkiggD70koQxjVdSBM3JKM7k6L0FbGE5eymy9i3B9A= +modernc.org/token v1.1.0 h1:Xl7Ap9dKaEs5kLoOQeQmPWevfnk/DM5qcLcYlA8ys6Y= +modernc.org/token v1.1.0/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM= diff --git a/Sense/internal/config/config.go b/Sense/internal/config/config.go new file mode 100644 index 0000000..1512177 --- /dev/null +++ b/Sense/internal/config/config.go @@ -0,0 +1,113 @@ +// Package config loads and validates the Sense process configuration. +package config + +import ( + "fmt" + "net" + "net/url" + "os" + "strconv" + "time" +) + +const ( + defaultHTTPAddress = "127.0.0.1:8080" + defaultDatabaseDSN = "file:data/sense.db" + defaultMediaMTXURL = "http://127.0.0.1:9997" + defaultReconcilePeriod = 5 * time.Second + defaultProbePeriod = 10 * time.Second +) + +type Config struct { + HTTPAddress string + AllowNonLoopback bool + DatabaseDSN string + MediaMTXURL string + ReconcileInterval time.Duration + ProbeInterval time.Duration +} + +func Load() (Config, error) { + allow, err := boolEnv("SENSE_ALLOW_NON_LOOPBACK", false) + if err != nil { + return Config{}, err + } + reconcilePeriod, err := durationEnv("SENSE_RECONCILE_INTERVAL", defaultReconcilePeriod) + if err != nil { + return Config{}, err + } + probePeriod, err := durationEnv("SENSE_PROBE_INTERVAL", defaultProbePeriod) + if err != nil { + return Config{}, err + } + + cfg := Config{ + HTTPAddress: stringEnv("SENSE_HTTP_ADDR", defaultHTTPAddress), + AllowNonLoopback: allow, + DatabaseDSN: stringEnv("SENSE_DB_DSN", defaultDatabaseDSN), + MediaMTXURL: stringEnv("SENSE_MEDIAMTX_URL", defaultMediaMTXURL), + ReconcileInterval: reconcilePeriod, + ProbeInterval: probePeriod, + } + if err := cfg.Validate(); err != nil { + return Config{}, err + } + return cfg, nil +} + +func (c Config) Validate() error { + host, _, err := net.SplitHostPort(c.HTTPAddress) + if err != nil { + return fmt.Errorf("invalid SENSE_HTTP_ADDR: %w", err) + } + ip := net.ParseIP(host) + isLoopback := host == "localhost" || (ip != nil && ip.IsLoopback()) + if !isLoopback && !c.AllowNonLoopback { + return fmt.Errorf("non-loopback HTTP bind requires SENSE_ALLOW_NON_LOOPBACK=true") + } + if c.DatabaseDSN == "" { + return fmt.Errorf("SENSE_DB_DSN must not be empty") + } + mediaURL, err := url.Parse(c.MediaMTXURL) + if err != nil || mediaURL.Scheme == "" || mediaURL.Host == "" { + return fmt.Errorf("invalid SENSE_MEDIAMTX_URL") + } + if mediaURL.User != nil { + return fmt.Errorf("SENSE_MEDIAMTX_URL must not contain credentials") + } + if c.ReconcileInterval <= 0 || c.ProbeInterval <= 0 { + return fmt.Errorf("loop intervals must be positive") + } + return nil +} + +func stringEnv(name, fallback string) string { + if value, ok := os.LookupEnv(name); ok { + return value + } + return fallback +} + +func boolEnv(name string, fallback bool) (bool, error) { + value, ok := os.LookupEnv(name) + if !ok { + return fallback, nil + } + parsed, err := strconv.ParseBool(value) + if err != nil { + return false, fmt.Errorf("invalid %s: %w", name, err) + } + return parsed, nil +} + +func durationEnv(name string, fallback time.Duration) (time.Duration, error) { + value, ok := os.LookupEnv(name) + if !ok { + return fallback, nil + } + parsed, err := time.ParseDuration(value) + if err != nil { + return 0, fmt.Errorf("invalid %s: %w", name, err) + } + return parsed, nil +} diff --git a/Sense/internal/config/config_test.go b/Sense/internal/config/config_test.go new file mode 100644 index 0000000..480b850 --- /dev/null +++ b/Sense/internal/config/config_test.go @@ -0,0 +1,35 @@ +package config + +import "testing" + +func TestValidateRejectsNonLoopbackByDefault(t *testing.T) { + t.Parallel() + cfg := Config{ + HTTPAddress: "0.0.0.0:8080", + DatabaseDSN: "file:test.db", + MediaMTXURL: "http://127.0.0.1:9997", + ReconcileInterval: 1, + ProbeInterval: 1, + } + if err := cfg.Validate(); err == nil { + t.Fatal("expected non-loopback bind to be rejected") + } + cfg.AllowNonLoopback = true + if err := cfg.Validate(); err != nil { + t.Fatalf("explicit non-loopback opt-in failed: %v", err) + } +} + +func TestValidateRejectsCredentialsInMediaMTXURL(t *testing.T) { + t.Parallel() + cfg := Config{ + HTTPAddress: "127.0.0.1:8080", + DatabaseDSN: "file:test.db", + MediaMTXURL: "http://" + "user" + ":" + "redacted" + "@127.0.0.1:9997", + ReconcileInterval: 1, + ProbeInterval: 1, + } + if err := cfg.Validate(); err == nil { + t.Fatal("expected credentials in MediaMTX URL to be rejected") + } +} diff --git a/Sense/internal/device/model.go b/Sense/internal/device/model.go new file mode 100644 index 0000000..d371f21 --- /dev/null +++ b/Sense/internal/device/model.go @@ -0,0 +1,179 @@ +// Package device contains the Sense device-ledger domain model. +package device + +import ( + "errors" + "fmt" + "net/url" + "slices" + "strings" + "time" +) + +const ( + DefaultVideoChannels = 16 + MaximumVideoChannels = 128 +) + +type Modality string + +const ( + ModalityVideo Modality = "video" + ModalityRadar Modality = "radar" + ModalityContact Modality = "contact" + ModalityButton Modality = "button" + ModalityWearable Modality = "wearable" + ModalityOther Modality = "other" +) + +type Capability string + +const ( + CapabilityVideoCapture Capability = "video_capture" + CapabilityAudioCapture Capability = "audio_capture" + CapabilitySpatialRule Capability = "spatial_rule" + CapabilityTelemetry Capability = "telemetry" +) + +type DesiredState string + +const ( + DesiredDisabled DesiredState = "disabled" + DesiredEnabled DesiredState = "enabled" +) + +type ActualState string + +const ( + ActualPending ActualState = "pending" + ActualOnline ActualState = "online" + ActualOffline ActualState = "offline" + ActualFailed ActualState = "failed" +) + +type Site struct { + TenantID string + ID string + Name string + MaxVideoChannels int +} + +func (s *Site) ApplyDefaults() { + if s.MaxVideoChannels == 0 { + s.MaxVideoChannels = DefaultVideoChannels + } +} + +func (s Site) Validate() error { + if strings.TrimSpace(s.TenantID) == "" || strings.TrimSpace(s.ID) == "" { + return errors.New("tenant ID and site ID are required") + } + if s.MaxVideoChannels < 1 || s.MaxVideoChannels > MaximumVideoChannels { + return fmt.Errorf("max video channels must be between 1 and %d", MaximumVideoChannels) + } + return nil +} + +type Device struct { + ID string + TenantID string + SiteID string + SerialNumber string + Name string + Modality Modality + Capabilities []Capability + DesiredState DesiredState + ActualState ActualState + EndpointRef string + CredentialRef string + PathName string + Generation int64 + CreatedAt time.Time + UpdatedAt time.Time +} + +func (d Device) Validate() error { + if strings.TrimSpace(d.ID) == "" || strings.TrimSpace(d.TenantID) == "" || strings.TrimSpace(d.SiteID) == "" { + return errors.New("device ID, tenant ID and site ID are required") + } + if strings.TrimSpace(d.SerialNumber) == "" || strings.TrimSpace(d.Name) == "" { + return errors.New("serial number and device name are required") + } + if !validModality(d.Modality) { + return fmt.Errorf("unsupported modality %q", d.Modality) + } + if d.DesiredState != DesiredEnabled && d.DesiredState != DesiredDisabled { + return fmt.Errorf("unsupported desired state %q", d.DesiredState) + } + if d.ActualState != ActualPending && d.ActualState != ActualOnline && d.ActualState != ActualOffline && d.ActualState != ActualFailed { + return fmt.Errorf("unsupported actual state %q", d.ActualState) + } + if d.DesiredState == DesiredEnabled && d.HasCapability(CapabilityVideoCapture) { + if strings.TrimSpace(d.EndpointRef) == "" || strings.TrimSpace(d.PathName) == "" { + return errors.New("enabled video devices require endpoint ref and path name") + } + } + if d.EndpointRef != "" { + endpoint, err := url.Parse(d.EndpointRef) + if err != nil || endpoint.Scheme == "" { + return errors.New("endpoint ref must be an absolute URI") + } + if endpoint.User != nil { + return errors.New("endpoint ref must not contain credentials") + } + } + if d.PathName != "" && !validPathName(d.PathName) { + return errors.New("path name must contain safe ASCII segments") + } + seen := make(map[Capability]struct{}, len(d.Capabilities)) + for _, capability := range d.Capabilities { + if !validCapability(capability) { + return fmt.Errorf("unsupported capability %q", capability) + } + if _, ok := seen[capability]; ok { + return fmt.Errorf("duplicate capability %q", capability) + } + seen[capability] = struct{}{} + } + return nil +} + +func (d Device) HasCapability(capability Capability) bool { + return slices.Contains(d.Capabilities, capability) +} + +func (d Device) ConsumesVideoChannel() bool { + return d.DesiredState == DesiredEnabled && d.HasCapability(CapabilityVideoCapture) +} + +func validModality(value Modality) bool { + return slices.Contains([]Modality{ModalityVideo, ModalityRadar, ModalityContact, ModalityButton, ModalityWearable, ModalityOther}, value) +} + +func validCapability(value Capability) bool { + return slices.Contains([]Capability{CapabilityVideoCapture, CapabilityAudioCapture, CapabilitySpatialRule, CapabilityTelemetry}, value) +} + +func validPathName(value string) bool { + if strings.HasPrefix(value, "/") || strings.HasSuffix(value, "/") || strings.Contains(value, "//") || strings.Contains(value, "..") { + return false + } + for _, character := range value { + if (character >= 'a' && character <= 'z') || (character >= 'A' && character <= 'Z') || + (character >= '0' && character <= '9') || strings.ContainsRune("-_/.", character) { + continue + } + return false + } + return value != "" +} + +type QuotaExceededError struct { + TenantID string + SiteID string + Limit int +} + +func (e *QuotaExceededError) Error() string { + return fmt.Sprintf("video channel quota exceeded for site %s/%s (limit %d)", e.TenantID, e.SiteID, e.Limit) +} diff --git a/Sense/internal/device/model_test.go b/Sense/internal/device/model_test.go new file mode 100644 index 0000000..47df754 --- /dev/null +++ b/Sense/internal/device/model_test.go @@ -0,0 +1,30 @@ +package device + +import "testing" + +func TestDeviceRejectsCredentialsInEndpointReference(t *testing.T) { + t.Parallel() + value := validVideoDevice() + value.EndpointRef = "http://" + "user" + ":" + "redacted" + "@camera.invalid/onvif" + if err := value.Validate(); err == nil { + t.Fatal("expected endpoint credentials to be rejected") + } +} + +func TestDeviceRejectsUnsafeMediaPath(t *testing.T) { + t.Parallel() + value := validVideoDevice() + value.PathName = "tenant/../another-camera" + if err := value.Validate(); err == nil { + t.Fatal("expected unsafe path name to be rejected") + } +} + +func validVideoDevice() Device { + return Device{ + ID: "camera", TenantID: "tenant", SiteID: "site", SerialNumber: "serial", Name: "Camera", + Modality: ModalityVideo, Capabilities: []Capability{CapabilityVideoCapture}, + DesiredState: DesiredEnabled, ActualState: ActualPending, + EndpointRef: "onvif://camera", PathName: "sense/tenant/site/camera", + } +} diff --git a/Sense/internal/mtx/client.go b/Sense/internal/mtx/client.go new file mode 100644 index 0000000..4505168 --- /dev/null +++ b/Sense/internal/mtx/client.go @@ -0,0 +1,143 @@ +package mtx + +import ( + "context" + "errors" + "fmt" + "net/http" + "strings" + + mediamtxapi "yovision/sense/internal/mtx/generated" +) + +var ErrPathNotFound = errors.New("MediaMTX path not found") + +type APIError struct { + Operation string + StatusCode int +} + +func (e *APIError) Error() string { + return fmt.Sprintf("MediaMTX %s failed with HTTP status %d", e.Operation, e.StatusCode) +} + +type PathConfig struct { + Name string + Source string +} + +type pathAPI interface { + ConfigPathsAddWithResponse(context.Context, string, mediamtxapi.ConfigPathsAddJSONRequestBody, ...mediamtxapi.RequestEditorFn) (*mediamtxapi.ConfigPathsAddResponse, error) + ConfigPathsGetWithResponse(context.Context, string, ...mediamtxapi.RequestEditorFn) (*mediamtxapi.ConfigPathsGetResponse, error) + ConfigPathsPatchWithResponse(context.Context, string, mediamtxapi.ConfigPathsPatchJSONRequestBody, ...mediamtxapi.RequestEditorFn) (*mediamtxapi.ConfigPathsPatchResponse, error) + ConfigPathsDeleteWithResponse(context.Context, string, ...mediamtxapi.RequestEditorFn) (*mediamtxapi.ConfigPathsDeleteResponse, error) + PathsGetWithResponse(context.Context, string, ...mediamtxapi.RequestEditorFn) (*mediamtxapi.PathsGetResponse, error) +} + +type Client struct { + api pathAPI +} + +func NewClient(baseURL string, httpClient *http.Client) (*Client, error) { + options := make([]mediamtxapi.ClientOption, 0, 1) + if httpClient != nil { + options = append(options, mediamtxapi.WithHTTPClient(httpClient)) + } + generated, err := mediamtxapi.NewClientWithResponses(strings.TrimRight(baseURL, "/"), options...) + if err != nil { + return nil, fmt.Errorf("create MediaMTX client: %w", err) + } + return &Client{api: generated}, nil +} + +func newClientWithAPI(api pathAPI) *Client { + return &Client{api: api} +} + +func (c *Client) CreatePath(ctx context.Context, name, source string) error { + response, err := c.api.ConfigPathsAddWithResponse(ctx, name, mediamtxapi.PathConf{Source: &source}) + if err != nil { + return fmt.Errorf("MediaMTX create path transport: %w", err) + } + if response.StatusCode() != http.StatusOK { + return &APIError{Operation: "create path", StatusCode: response.StatusCode()} + } + return nil +} + +func (c *Client) GetPath(ctx context.Context, name string) (PathConfig, error) { + response, err := c.api.ConfigPathsGetWithResponse(ctx, name) + if err != nil { + return PathConfig{}, fmt.Errorf("MediaMTX read path transport: %w", err) + } + if response.StatusCode() == http.StatusNotFound { + return PathConfig{}, ErrPathNotFound + } + if response.StatusCode() != http.StatusOK || response.JSON200 == nil { + return PathConfig{}, &APIError{Operation: "read path", StatusCode: response.StatusCode()} + } + result := PathConfig{Name: name} + if response.JSON200.Name != nil { + result.Name = *response.JSON200.Name + } + if response.JSON200.Source != nil { + result.Source = *response.JSON200.Source + } + return result, nil +} + +func (c *Client) DeletePath(ctx context.Context, name string) error { + response, err := c.api.ConfigPathsDeleteWithResponse(ctx, name) + if err != nil { + return fmt.Errorf("MediaMTX delete path transport: %w", err) + } + if response.StatusCode() == http.StatusNotFound { + return ErrPathNotFound + } + if response.StatusCode() != http.StatusOK { + return &APIError{Operation: "delete path", StatusCode: response.StatusCode()} + } + return nil +} + +// EnsurePath converges one desired path. It never enumerates or deletes orphans. +func (c *Client) EnsurePath(ctx context.Context, name, source string) (bool, error) { + current, err := c.GetPath(ctx, name) + if errors.Is(err, ErrPathNotFound) { + if err := c.CreatePath(ctx, name, source); err != nil { + return false, err + } + return true, nil + } + if err != nil { + return false, err + } + if current.Source == source { + return false, nil + } + response, err := c.api.ConfigPathsPatchWithResponse(ctx, name, mediamtxapi.PathConf{Source: &source}) + if err != nil { + return false, fmt.Errorf("MediaMTX patch path transport: %w", err) + } + if response.StatusCode() != http.StatusOK { + return false, &APIError{Operation: "patch path", StatusCode: response.StatusCode()} + } + return true, nil +} + +func (c *Client) PathReady(ctx context.Context, name string) (bool, error) { + response, err := c.api.PathsGetWithResponse(ctx, name) + if err != nil { + return false, fmt.Errorf("MediaMTX probe path transport: %w", err) + } + if response.StatusCode() == http.StatusNotFound { + return false, ErrPathNotFound + } + if response.StatusCode() != http.StatusOK || response.JSON200 == nil { + return false, &APIError{Operation: "probe path", StatusCode: response.StatusCode()} + } + if response.JSON200.Online == nil || response.JSON200.Available == nil { + return false, &APIError{Operation: "probe path response", StatusCode: response.StatusCode()} + } + return *response.JSON200.Online && *response.JSON200.Available, nil +} diff --git a/Sense/internal/mtx/client_test.go b/Sense/internal/mtx/client_test.go new file mode 100644 index 0000000..23faeec --- /dev/null +++ b/Sense/internal/mtx/client_test.go @@ -0,0 +1,150 @@ +package mtx + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "net/http/httptest" + "strings" + "sync" + "testing" +) + +type fakeMediaMTX struct { + mu sync.Mutex + paths map[string]string + mutations int +} + +func (f *fakeMediaMTX) ServeHTTP(writer http.ResponseWriter, request *http.Request) { + f.mu.Lock() + defer f.mu.Unlock() + writer.Header().Set("Content-Type", "application/json") + prefixes := map[string]string{ + "/v3/config/paths/get/": "get", + "/v3/config/paths/add/": "add", + "/v3/config/paths/patch/": "patch", + "/v3/config/paths/delete/": "delete", + "/v3/paths/get/": "runtime", + } + for prefix, operation := range prefixes { + if !strings.HasPrefix(request.URL.Path, prefix) { + continue + } + name := strings.TrimPrefix(request.URL.Path, prefix) + source, exists := f.paths[name] + switch operation { + case "get": + if !exists { + http.Error(writer, `{"error":"not found"}`, http.StatusNotFound) + return + } + _ = json.NewEncoder(writer).Encode(map[string]any{"name": name, "source": source}) + case "add", "patch": + var body struct { + Source string `json:"source"` + } + if err := json.NewDecoder(request.Body).Decode(&body); err != nil { + http.Error(writer, `{}`, http.StatusBadRequest) + return + } + f.paths[name] = body.Source + f.mutations++ + _, _ = writer.Write([]byte(`{}`)) + case "delete": + if !exists { + http.Error(writer, `{"error":"not found"}`, http.StatusNotFound) + return + } + delete(f.paths, name) + f.mutations++ + _, _ = writer.Write([]byte(`{}`)) + case "runtime": + if !exists { + http.Error(writer, `{"error":"not found"}`, http.StatusNotFound) + return + } + _, _ = writer.Write([]byte(`{"online":true,"available":true}`)) + } + return + } + http.NotFound(writer, request) +} + +func TestGeneratedClientCreateReadDeleteMapping(t *testing.T) { + t.Parallel() + fake := &fakeMediaMTX{paths: make(map[string]string)} + server := httptest.NewServer(fake) + defer server.Close() + client, err := NewClient(server.URL, server.Client()) + if err != nil { + t.Fatal(err) + } + ctx := context.Background() + if err := client.CreatePath(ctx, "camera-1", "rtsp://media.invalid/camera-1"); err != nil { + t.Fatal(err) + } + path, err := client.GetPath(ctx, "camera-1") + if err != nil { + t.Fatal(err) + } + if path.Source != "rtsp://media.invalid/camera-1" { + t.Fatalf("unexpected source mapping: %+v", path) + } + if err := client.DeletePath(ctx, "camera-1"); err != nil { + t.Fatal(err) + } + if _, err := client.GetPath(ctx, "camera-1"); err != ErrPathNotFound { + t.Fatalf("expected not found after delete, got %v", err) + } +} + +func TestEnsurePathIsIdempotentAndCanPatch(t *testing.T) { + t.Parallel() + fake := &fakeMediaMTX{paths: make(map[string]string)} + server := httptest.NewServer(fake) + defer server.Close() + client, err := NewClient(server.URL, server.Client()) + if err != nil { + t.Fatal(err) + } + ctx := context.Background() + changed, err := client.EnsurePath(ctx, "camera-2", "rtsp://media.invalid/first") + if err != nil || !changed { + t.Fatalf("first ensure: changed=%v err=%v", changed, err) + } + changed, err = client.EnsurePath(ctx, "camera-2", "rtsp://media.invalid/first") + if err != nil || changed { + t.Fatalf("second ensure must be idempotent: changed=%v err=%v", changed, err) + } + changed, err = client.EnsurePath(ctx, "camera-2", "rtsp://media.invalid/second") + if err != nil || !changed { + t.Fatalf("changed source must patch: changed=%v err=%v", changed, err) + } + if fake.mutations != 2 { + t.Fatalf("expected create + patch, got %d mutations", fake.mutations) + } + ready, err := client.PathReady(ctx, "camera-2") + if err != nil || !ready { + t.Fatalf("runtime probe: ready=%v err=%v", ready, err) + } +} + +func TestAPIErrorDoesNotLeakSource(t *testing.T) { + t.Parallel() + server := httptest.NewServer(http.HandlerFunc(func(writer http.ResponseWriter, _ *http.Request) { + writer.WriteHeader(http.StatusInternalServerError) + _, _ = fmt.Fprint(writer, `{"error":"upstream included a secret"}`) + })) + defer server.Close() + client, err := NewClient(server.URL, server.Client()) + if err != nil { + t.Fatal(err) + } + secretSource := "rtsp://" + "user" + ":" + "redacted" + "@camera.invalid/live" + err = client.CreatePath(context.Background(), "camera", secretSource) + if err == nil || strings.Contains(err.Error(), secretSource) || strings.Contains(err.Error(), "secret") { + t.Fatalf("error must be redacted, got %v", err) + } +} diff --git a/Sense/internal/mtx/generate.go b/Sense/internal/mtx/generate.go new file mode 100644 index 0000000..1f59092 --- /dev/null +++ b/Sense/internal/mtx/generate.go @@ -0,0 +1,5 @@ +// Package mtx wraps the generated MediaMTX control API client. +package mtx + +// The input is the official API document vendored from the frozen MediaMTX tag. +//go:generate go tool oapi-codegen -config oapi-codegen.yaml ../../api/vendor/mediamtx-v1.19.3.openapi.yaml diff --git a/Sense/internal/mtx/generated/client.gen.go b/Sense/internal/mtx/generated/client.gen.go new file mode 100644 index 0000000..24ecbe8 --- /dev/null +++ b/Sense/internal/mtx/generated/client.gen.go @@ -0,0 +1,11278 @@ +// Package mediamtxapi provides primitives to interact with the openapi HTTP API. +// +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT. +package mediamtxapi + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "io" + "net/http" + "net/url" + "strings" + + "github.com/oapi-codegen/runtime" + openapi_types "github.com/oapi-codegen/runtime/types" +) + +// Defines values for AlwaysAvailableTrackCodec. +const ( + AlwaysAvailableTrackCodecAV1 AlwaysAvailableTrackCodec = "AV1" + AlwaysAvailableTrackCodecG711 AlwaysAvailableTrackCodec = "G711" + AlwaysAvailableTrackCodecH264 AlwaysAvailableTrackCodec = "H264" + AlwaysAvailableTrackCodecH265 AlwaysAvailableTrackCodec = "H265" + AlwaysAvailableTrackCodecLPCM AlwaysAvailableTrackCodec = "LPCM" + AlwaysAvailableTrackCodecMPEG4Audio AlwaysAvailableTrackCodec = "MPEG4Audio" + AlwaysAvailableTrackCodecOpus AlwaysAvailableTrackCodec = "Opus" + AlwaysAvailableTrackCodecVP9 AlwaysAvailableTrackCodec = "VP9" +) + +// Valid indicates whether the value is a known member of the AlwaysAvailableTrackCodec enum. +func (e AlwaysAvailableTrackCodec) Valid() bool { + switch e { + case AlwaysAvailableTrackCodecAV1: + return true + case AlwaysAvailableTrackCodecG711: + return true + case AlwaysAvailableTrackCodecH264: + return true + case AlwaysAvailableTrackCodecH265: + return true + case AlwaysAvailableTrackCodecLPCM: + return true + case AlwaysAvailableTrackCodecMPEG4Audio: + return true + case AlwaysAvailableTrackCodecOpus: + return true + case AlwaysAvailableTrackCodecVP9: + return true + default: + return false + } +} + +// Defines values for AuthAction. +const ( + AuthActionApi AuthAction = "api" + AuthActionMetrics AuthAction = "metrics" + AuthActionPlayback AuthAction = "playback" + AuthActionPprof AuthAction = "pprof" + AuthActionPublish AuthAction = "publish" + AuthActionRead AuthAction = "read" +) + +// Valid indicates whether the value is a known member of the AuthAction enum. +func (e AuthAction) Valid() bool { + switch e { + case AuthActionApi: + return true + case AuthActionMetrics: + return true + case AuthActionPlayback: + return true + case AuthActionPprof: + return true + case AuthActionPublish: + return true + case AuthActionRead: + return true + default: + return false + } +} + +// Defines values for AuthMethod. +const ( + Http AuthMethod = "http" + Internal AuthMethod = "internal" + Jwt AuthMethod = "jwt" +) + +// Valid indicates whether the value is a known member of the AuthMethod enum. +func (e AuthMethod) Valid() bool { + switch e { + case Http: + return true + case Internal: + return true + case Jwt: + return true + default: + return false + } +} + +// Defines values for Encryption. +const ( + No Encryption = "no" + Optional Encryption = "optional" + Strict Encryption = "strict" +) + +// Valid indicates whether the value is a known member of the Encryption enum. +func (e Encryption) Valid() bool { + switch e { + case No: + return true + case Optional: + return true + case Strict: + return true + default: + return false + } +} + +// Defines values for ErrorStatus. +const ( + ErrorStatusError ErrorStatus = "error" +) + +// Valid indicates whether the value is a known member of the ErrorStatus enum. +func (e ErrorStatus) Valid() bool { + switch e { + case ErrorStatusError: + return true + default: + return false + } +} + +// Defines values for GlobalConfProtocols. +const ( + GlobalConfProtocolsMulticast GlobalConfProtocols = "multicast" + GlobalConfProtocolsTcp GlobalConfProtocols = "tcp" + GlobalConfProtocolsUdp GlobalConfProtocols = "udp" +) + +// Valid indicates whether the value is a known member of the GlobalConfProtocols enum. +func (e GlobalConfProtocols) Valid() bool { + switch e { + case GlobalConfProtocolsMulticast: + return true + case GlobalConfProtocolsTcp: + return true + case GlobalConfProtocolsUdp: + return true + default: + return false + } +} + +// Defines values for GlobalConfRtspTransports. +const ( + GlobalConfRtspTransportsMulticast GlobalConfRtspTransports = "multicast" + GlobalConfRtspTransportsTcp GlobalConfRtspTransports = "tcp" + GlobalConfRtspTransportsUdp GlobalConfRtspTransports = "udp" +) + +// Valid indicates whether the value is a known member of the GlobalConfRtspTransports enum. +func (e GlobalConfRtspTransports) Valid() bool { + switch e { + case GlobalConfRtspTransportsMulticast: + return true + case GlobalConfRtspTransportsTcp: + return true + case GlobalConfRtspTransportsUdp: + return true + default: + return false + } +} + +// Defines values for HLSVariant. +const ( + HLSVariantFmp4 HLSVariant = "fmp4" + HLSVariantLowLatency HLSVariant = "lowLatency" + HLSVariantMpegts HLSVariant = "mpegts" +) + +// Valid indicates whether the value is a known member of the HLSVariant enum. +func (e HLSVariant) Valid() bool { + switch e { + case HLSVariantFmp4: + return true + case HLSVariantLowLatency: + return true + case HLSVariantMpegts: + return true + default: + return false + } +} + +// Defines values for LogDestination. +const ( + File LogDestination = "file" + Stdout LogDestination = "stdout" + Syslog LogDestination = "syslog" +) + +// Valid indicates whether the value is a known member of the LogDestination enum. +func (e LogDestination) Valid() bool { + switch e { + case File: + return true + case Stdout: + return true + case Syslog: + return true + default: + return false + } +} + +// Defines values for LogLevel. +const ( + LogLevelDebug LogLevel = "debug" + LogLevelError LogLevel = "error" + LogLevelInfo LogLevel = "info" + LogLevelWarn LogLevel = "warn" +) + +// Valid indicates whether the value is a known member of the LogLevel enum. +func (e LogLevel) Valid() bool { + switch e { + case LogLevelDebug: + return true + case LogLevelError: + return true + case LogLevelInfo: + return true + case LogLevelWarn: + return true + default: + return false + } +} + +// Defines values for MoQSessionState. +const ( + MoQSessionStateIdle MoQSessionState = "idle" + MoQSessionStatePublish MoQSessionState = "publish" + MoQSessionStateRead MoQSessionState = "read" +) + +// Valid indicates whether the value is a known member of the MoQSessionState enum. +func (e MoQSessionState) Valid() bool { + switch e { + case MoQSessionStateIdle: + return true + case MoQSessionStatePublish: + return true + case MoQSessionStateRead: + return true + default: + return false + } +} + +// Defines values for MoQVersion. +const ( + Moqt18 MoQVersion = "moqt-18" + Moqt19 MoQVersion = "moqt-19" +) + +// Valid indicates whether the value is a known member of the MoQVersion enum. +func (e MoQVersion) Valid() bool { + switch e { + case Moqt18: + return true + case Moqt19: + return true + default: + return false + } +} + +// Defines values for OKStatus. +const ( + Ok OKStatus = "ok" +) + +// Valid indicates whether the value is a known member of the OKStatus enum. +func (e OKStatus) Valid() bool { + switch e { + case Ok: + return true + default: + return false + } +} + +// Defines values for PathReaderType. +const ( + PathReaderTypeHidden PathReaderType = "hidden" + PathReaderTypeHlsSession PathReaderType = "hlsSession" + PathReaderTypeMoqSession PathReaderType = "moqSession" + PathReaderTypeRtmpConn PathReaderType = "rtmpConn" + PathReaderTypeRtmpsConn PathReaderType = "rtmpsConn" + PathReaderTypeRtspConn PathReaderType = "rtspConn" + PathReaderTypeRtspSession PathReaderType = "rtspSession" + PathReaderTypeRtspsConn PathReaderType = "rtspsConn" + PathReaderTypeRtspsSession PathReaderType = "rtspsSession" + PathReaderTypeSrtConn PathReaderType = "srtConn" + PathReaderTypeWebRTCSession PathReaderType = "webRTCSession" +) + +// Valid indicates whether the value is a known member of the PathReaderType enum. +func (e PathReaderType) Valid() bool { + switch e { + case PathReaderTypeHidden: + return true + case PathReaderTypeHlsSession: + return true + case PathReaderTypeMoqSession: + return true + case PathReaderTypeRtmpConn: + return true + case PathReaderTypeRtmpsConn: + return true + case PathReaderTypeRtspConn: + return true + case PathReaderTypeRtspSession: + return true + case PathReaderTypeRtspsConn: + return true + case PathReaderTypeRtspsSession: + return true + case PathReaderTypeSrtConn: + return true + case PathReaderTypeWebRTCSession: + return true + default: + return false + } +} + +// Defines values for PathSourceType. +const ( + PathSourceTypeHlsSource PathSourceType = "hlsSource" + PathSourceTypeMoqSession PathSourceType = "moqSession" + PathSourceTypeMpegtsSource PathSourceType = "mpegtsSource" + PathSourceTypeRedirect PathSourceType = "redirect" + PathSourceTypeRpiCameraSource PathSourceType = "rpiCameraSource" + PathSourceTypeRtmpConn PathSourceType = "rtmpConn" + PathSourceTypeRtmpSource PathSourceType = "rtmpSource" + PathSourceTypeRtmpsConn PathSourceType = "rtmpsConn" + PathSourceTypeRtpSource PathSourceType = "rtpSource" + PathSourceTypeRtspSession PathSourceType = "rtspSession" + PathSourceTypeRtspSource PathSourceType = "rtspSource" + PathSourceTypeRtspsSession PathSourceType = "rtspsSession" + PathSourceTypeSrtConn PathSourceType = "srtConn" + PathSourceTypeSrtSource PathSourceType = "srtSource" + PathSourceTypeWebRTCSession PathSourceType = "webRTCSession" + PathSourceTypeWebRTCSource PathSourceType = "webRTCSource" +) + +// Valid indicates whether the value is a known member of the PathSourceType enum. +func (e PathSourceType) Valid() bool { + switch e { + case PathSourceTypeHlsSource: + return true + case PathSourceTypeMoqSession: + return true + case PathSourceTypeMpegtsSource: + return true + case PathSourceTypeRedirect: + return true + case PathSourceTypeRpiCameraSource: + return true + case PathSourceTypeRtmpConn: + return true + case PathSourceTypeRtmpSource: + return true + case PathSourceTypeRtmpsConn: + return true + case PathSourceTypeRtpSource: + return true + case PathSourceTypeRtspSession: + return true + case PathSourceTypeRtspSource: + return true + case PathSourceTypeRtspsSession: + return true + case PathSourceTypeSrtConn: + return true + case PathSourceTypeSrtSource: + return true + case PathSourceTypeWebRTCSession: + return true + case PathSourceTypeWebRTCSource: + return true + default: + return false + } +} + +// Defines values for PathTrackCodec. +const ( + PathTrackCodecAC3 PathTrackCodec = "AC3" + PathTrackCodecAV1 PathTrackCodec = "AV1" + PathTrackCodecFLAC PathTrackCodec = "FLAC" + PathTrackCodecG711 PathTrackCodec = "G711" + PathTrackCodecG722 PathTrackCodec = "G722" + PathTrackCodecG726 PathTrackCodec = "G726" + PathTrackCodecGeneric PathTrackCodec = "Generic" + PathTrackCodecH264 PathTrackCodec = "H264" + PathTrackCodecH265 PathTrackCodec = "H265" + PathTrackCodecKLV PathTrackCodec = "KLV" + PathTrackCodecLPCM PathTrackCodec = "LPCM" + PathTrackCodecMJPEG PathTrackCodec = "M-JPEG" + PathTrackCodecMPEG12Audio PathTrackCodec = "MPEG-1/2 Audio" + PathTrackCodecMPEG12Video PathTrackCodec = "MPEG-1/2 Video" + PathTrackCodecMPEG4Audio PathTrackCodec = "MPEG-4 Audio" + PathTrackCodecMPEG4AudioLATM PathTrackCodec = "MPEG-4 Audio LATM" + PathTrackCodecMPEG4Video PathTrackCodec = "MPEG-4 Video" + PathTrackCodecMPEGTS PathTrackCodec = "MPEG-TS" + PathTrackCodecOpus PathTrackCodec = "Opus" + PathTrackCodecSpeex PathTrackCodec = "Speex" + PathTrackCodecVP8 PathTrackCodec = "VP8" + PathTrackCodecVP9 PathTrackCodec = "VP9" + PathTrackCodecVorbis PathTrackCodec = "Vorbis" +) + +// Valid indicates whether the value is a known member of the PathTrackCodec enum. +func (e PathTrackCodec) Valid() bool { + switch e { + case PathTrackCodecAC3: + return true + case PathTrackCodecAV1: + return true + case PathTrackCodecFLAC: + return true + case PathTrackCodecG711: + return true + case PathTrackCodecG722: + return true + case PathTrackCodecG726: + return true + case PathTrackCodecGeneric: + return true + case PathTrackCodecH264: + return true + case PathTrackCodecH265: + return true + case PathTrackCodecKLV: + return true + case PathTrackCodecLPCM: + return true + case PathTrackCodecMJPEG: + return true + case PathTrackCodecMPEG12Audio: + return true + case PathTrackCodecMPEG12Video: + return true + case PathTrackCodecMPEG4Audio: + return true + case PathTrackCodecMPEG4AudioLATM: + return true + case PathTrackCodecMPEG4Video: + return true + case PathTrackCodecMPEGTS: + return true + case PathTrackCodecOpus: + return true + case PathTrackCodecSpeex: + return true + case PathTrackCodecVP8: + return true + case PathTrackCodecVP9: + return true + case PathTrackCodecVorbis: + return true + default: + return false + } +} + +// Defines values for RTMPConnState. +const ( + RTMPConnStateIdle RTMPConnState = "idle" + RTMPConnStatePublish RTMPConnState = "publish" + RTMPConnStateRead RTMPConnState = "read" +) + +// Valid indicates whether the value is a known member of the RTMPConnState enum. +func (e RTMPConnState) Valid() bool { + switch e { + case RTMPConnStateIdle: + return true + case RTMPConnStatePublish: + return true + case RTMPConnStateRead: + return true + default: + return false + } +} + +// Defines values for RTSPAuthMethod. +const ( + Basic RTSPAuthMethod = "basic" + Digest RTSPAuthMethod = "digest" +) + +// Valid indicates whether the value is a known member of the RTSPAuthMethod enum. +func (e RTSPAuthMethod) Valid() bool { + switch e { + case Basic: + return true + case Digest: + return true + default: + return false + } +} + +// Defines values for RTSPRangeType. +const ( + Clock RTSPRangeType = "clock" + Empty RTSPRangeType = "" + Npt RTSPRangeType = "npt" + Smpte RTSPRangeType = "smpte" +) + +// Valid indicates whether the value is a known member of the RTSPRangeType enum. +func (e RTSPRangeType) Valid() bool { + switch e { + case Clock: + return true + case Empty: + return true + case Npt: + return true + case Smpte: + return true + default: + return false + } +} + +// Defines values for RTSPSessionState. +const ( + RTSPSessionStateIdle RTSPSessionState = "idle" + RTSPSessionStatePublish RTSPSessionState = "publish" + RTSPSessionStateRead RTSPSessionState = "read" +) + +// Valid indicates whether the value is a known member of the RTSPSessionState enum. +func (e RTSPSessionState) Valid() bool { + switch e { + case RTSPSessionStateIdle: + return true + case RTSPSessionStatePublish: + return true + case RTSPSessionStateRead: + return true + default: + return false + } +} + +// Defines values for RTSPTransport. +const ( + RTSPTransportAutomatic RTSPTransport = "automatic" + RTSPTransportMulticast RTSPTransport = "multicast" + RTSPTransportTcp RTSPTransport = "tcp" + RTSPTransportUdp RTSPTransport = "udp" +) + +// Valid indicates whether the value is a known member of the RTSPTransport enum. +func (e RTSPTransport) Valid() bool { + switch e { + case RTSPTransportAutomatic: + return true + case RTSPTransportMulticast: + return true + case RTSPTransportTcp: + return true + case RTSPTransportUdp: + return true + default: + return false + } +} + +// Defines values for RecordFormat. +const ( + RecordFormatFmp4 RecordFormat = "fmp4" + RecordFormatMpegts RecordFormat = "mpegts" +) + +// Valid indicates whether the value is a known member of the RecordFormat enum. +func (e RecordFormat) Valid() bool { + switch e { + case RecordFormatFmp4: + return true + case RecordFormatMpegts: + return true + default: + return false + } +} + +// Defines values for SRTConnState. +const ( + SRTConnStateIdle SRTConnState = "idle" + SRTConnStatePublish SRTConnState = "publish" + SRTConnStateRead SRTConnState = "read" +) + +// Valid indicates whether the value is a known member of the SRTConnState enum. +func (e SRTConnState) Valid() bool { + switch e { + case SRTConnStateIdle: + return true + case SRTConnStatePublish: + return true + case SRTConnStateRead: + return true + default: + return false + } +} + +// Defines values for WebRTCSessionState. +const ( + WebRTCSessionStatePublish WebRTCSessionState = "publish" + WebRTCSessionStateRead WebRTCSessionState = "read" +) + +// Valid indicates whether the value is a known member of the WebRTCSessionState enum. +func (e WebRTCSessionState) Valid() bool { + switch e { + case WebRTCSessionStatePublish: + return true + case WebRTCSessionStateRead: + return true + default: + return false + } +} + +// AlwaysAvailableTrack defines model for AlwaysAvailableTrack. +type AlwaysAvailableTrack struct { + ChannelCount *int64 `json:"channelCount,omitempty"` + Codec *AlwaysAvailableTrackCodec `json:"codec,omitempty"` + MuLaw *bool `json:"muLaw,omitempty"` + SampleRate *int64 `json:"sampleRate,omitempty"` +} + +// AlwaysAvailableTrackCodec defines model for AlwaysAvailableTrackCodec. +type AlwaysAvailableTrackCodec string + +// AuthAction defines model for AuthAction. +type AuthAction string + +// AuthInternalUser defines model for AuthInternalUser. +type AuthInternalUser struct { + Ips *[]string `json:"ips,omitempty"` + Pass *string `json:"pass,omitempty"` + Permissions *[]AuthInternalUserPermission `json:"permissions,omitempty"` + User *string `json:"user,omitempty"` +} + +// AuthInternalUserPermission defines model for AuthInternalUserPermission. +type AuthInternalUserPermission struct { + Action *AuthAction `json:"action,omitempty"` + Path *string `json:"path,omitempty"` +} + +// AuthMethod defines model for AuthMethod. +type AuthMethod string + +// Encryption defines model for Encryption. +type Encryption string + +// Error defines model for Error. +type Error struct { + Error *string `json:"error,omitempty"` + Status *ErrorStatus `json:"status,omitempty"` +} + +// ErrorStatus defines model for ErrorStatus. +type ErrorStatus string + +// GlobalConf defines model for GlobalConf. +type GlobalConf struct { + // Api Control API + Api *bool `json:"api,omitempty"` + ApiAddress *string `json:"apiAddress,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + ApiAllowOrigin *string `json:"apiAllowOrigin,omitempty"` + ApiAllowOrigins *[]string `json:"apiAllowOrigins,omitempty"` + ApiEncryption *bool `json:"apiEncryption,omitempty"` + ApiServerCert *string `json:"apiServerCert,omitempty"` + ApiServerKey *string `json:"apiServerKey,omitempty"` + ApiTrustedProxies *[]string `json:"apiTrustedProxies,omitempty"` + AuthHTTPAddress *string `json:"authHTTPAddress,omitempty"` + AuthHTTPExclude *[]AuthInternalUserPermission `json:"authHTTPExclude,omitempty"` + AuthHTTPFingerprint *string `json:"authHTTPFingerprint,omitempty"` + AuthInternalUsers *[]AuthInternalUser `json:"authInternalUsers,omitempty"` + AuthJWTAudience *string `json:"authJWTAudience,omitempty"` + AuthJWTClaimKey *string `json:"authJWTClaimKey,omitempty"` + AuthJWTExclude *[]AuthInternalUserPermission `json:"authJWTExclude,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + AuthJWTInHTTPQuery *bool `json:"authJWTInHTTPQuery,omitempty"` + AuthJWTIssuer *string `json:"authJWTIssuer,omitempty"` + AuthJWTJWKS *string `json:"authJWTJWKS,omitempty"` + AuthJWTJWKSFingerprint *string `json:"authJWTJWKSFingerprint,omitempty"` + AuthMethod *AuthMethod `json:"authMethod,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + AuthMethods *[]RTSPAuthMethod `json:"authMethods,omitempty"` + DumpPackets *bool `json:"dumpPackets,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + Encryption *Encryption `json:"encryption,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + ExternalAuthenticationURL *string `json:"externalAuthenticationURL,omitempty"` + + // Hls HLS server + Hls *bool `json:"hls,omitempty"` + HlsAddress *string `json:"hlsAddress,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + HlsAllowOrigin *string `json:"hlsAllowOrigin,omitempty"` + HlsAllowOrigins *[]string `json:"hlsAllowOrigins,omitempty"` + HlsAlwaysRemux *bool `json:"hlsAlwaysRemux,omitempty"` + HlsCDNSecret *string `json:"hlsCDNSecret,omitempty"` + HlsDirectory *string `json:"hlsDirectory,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + HlsDisable *bool `json:"hlsDisable,omitempty"` + HlsEncryption *bool `json:"hlsEncryption,omitempty"` + HlsMuxerCloseAfter *string `json:"hlsMuxerCloseAfter,omitempty"` + HlsPartDuration *string `json:"hlsPartDuration,omitempty"` + HlsSegmentCount *int64 `json:"hlsSegmentCount,omitempty"` + HlsSegmentDuration *string `json:"hlsSegmentDuration,omitempty"` + HlsSegmentMaxSize *string `json:"hlsSegmentMaxSize,omitempty"` + HlsServerCert *string `json:"hlsServerCert,omitempty"` + HlsServerKey *string `json:"hlsServerKey,omitempty"` + HlsTrustedProxies *[]string `json:"hlsTrustedProxies,omitempty"` + HlsVariant *HLSVariant `json:"hlsVariant,omitempty"` + LogDestinations *[]LogDestination `json:"logDestinations,omitempty"` + LogFile *string `json:"logFile,omitempty"` + LogLevel *LogLevel `json:"logLevel,omitempty"` + LogStructured *bool `json:"logStructured,omitempty"` + + // Metrics Metrics + Metrics *bool `json:"metrics,omitempty"` + MetricsAddress *string `json:"metricsAddress,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + MetricsAllowOrigin *string `json:"metricsAllowOrigin,omitempty"` + MetricsAllowOrigins *[]string `json:"metricsAllowOrigins,omitempty"` + MetricsEncryption *bool `json:"metricsEncryption,omitempty"` + MetricsServerCert *string `json:"metricsServerCert,omitempty"` + MetricsServerKey *string `json:"metricsServerKey,omitempty"` + MetricsTrustedProxies *[]string `json:"metricsTrustedProxies,omitempty"` + + // Moq MoQ server + Moq *bool `json:"moq,omitempty"` + MoqAllowOrigins *[]string `json:"moqAllowOrigins,omitempty"` + MoqHTTP2Address *string `json:"moqHTTP2Address,omitempty"` + MoqHTTP3Address *string `json:"moqHTTP3Address,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + MoqHTTPS2Address *string `json:"moqHTTPS2Address,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + MoqHTTPS3Address *string `json:"moqHTTPS3Address,omitempty"` + MoqServerCert *string `json:"moqServerCert,omitempty"` + MoqServerKey *string `json:"moqServerKey,omitempty"` + MoqTrustedProxies *[]string `json:"moqTrustedProxies,omitempty"` + MulticastIPRange *string `json:"multicastIPRange,omitempty"` + MulticastRTCPPort *int64 `json:"multicastRTCPPort,omitempty"` + MulticastRTPPort *int64 `json:"multicastRTPPort,omitempty"` + MulticastSRTCPPort *int64 `json:"multicastSRTCPPort,omitempty"` + MulticastSRTPPort *int64 `json:"multicastSRTPPort,omitempty"` + + // Playback Playback + Playback *bool `json:"playback,omitempty"` + PlaybackAddress *string `json:"playbackAddress,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + PlaybackAllowOrigin *string `json:"playbackAllowOrigin,omitempty"` + PlaybackAllowOrigins *[]string `json:"playbackAllowOrigins,omitempty"` + PlaybackEncryption *bool `json:"playbackEncryption,omitempty"` + PlaybackServerCert *string `json:"playbackServerCert,omitempty"` + PlaybackServerKey *string `json:"playbackServerKey,omitempty"` + PlaybackTrustedProxies *[]string `json:"playbackTrustedProxies,omitempty"` + + // Pprof PPROF + Pprof *bool `json:"pprof,omitempty"` + PprofAddress *string `json:"pprofAddress,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + PprofAllowOrigin *string `json:"pprofAllowOrigin,omitempty"` + PprofAllowOrigins *[]string `json:"pprofAllowOrigins,omitempty"` + PprofEncryption *bool `json:"pprofEncryption,omitempty"` + PprofServerCert *string `json:"pprofServerCert,omitempty"` + PprofServerKey *string `json:"pprofServerKey,omitempty"` + PprofTrustedProxies *[]string `json:"pprofTrustedProxies,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + Protocols *[]GlobalConfProtocols `json:"protocols,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + ReadBufferCount *int64 `json:"readBufferCount,omitempty"` + ReadTimeout *string `json:"readTimeout,omitempty"` + + // Record Record (deprecated) + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + Record *bool `json:"record,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RecordDeleteAfter *string `json:"recordDeleteAfter,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RecordFormat *RecordFormat `json:"recordFormat,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RecordPartDuration *string `json:"recordPartDuration,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RecordPath *string `json:"recordPath,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RecordSegmentDuration *string `json:"recordSegmentDuration,omitempty"` + RtcpAddress *string `json:"rtcpAddress,omitempty"` + + // Rtmp RTMP server + Rtmp *bool `json:"rtmp,omitempty"` + RtmpAddress *string `json:"rtmpAddress,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtmpDisable *bool `json:"rtmpDisable,omitempty"` + RtmpEncryption *Encryption `json:"rtmpEncryption,omitempty"` + RtmpServerCert *string `json:"rtmpServerCert,omitempty"` + RtmpServerKey *string `json:"rtmpServerKey,omitempty"` + RtmpTrustedProxies *[]string `json:"rtmpTrustedProxies,omitempty"` + RtmpsAddress *string `json:"rtmpsAddress,omitempty"` + RtpAddress *string `json:"rtpAddress,omitempty"` + + // Rtsp RTSP server + Rtsp *bool `json:"rtsp,omitempty"` + RtspAddress *string `json:"rtspAddress,omitempty"` + RtspAuthMethods *[]RTSPAuthMethod `json:"rtspAuthMethods,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtspDisable *bool `json:"rtspDisable,omitempty"` + RtspEncryption *Encryption `json:"rtspEncryption,omitempty"` + RtspServerCert *string `json:"rtspServerCert,omitempty"` + RtspServerKey *string `json:"rtspServerKey,omitempty"` + RtspTransports *[]GlobalConfRtspTransports `json:"rtspTransports,omitempty"` + RtspTrustedProxies *[]string `json:"rtspTrustedProxies,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtspUDPReadBufferSize *uint64 `json:"rtspUDPReadBufferSize,omitempty"` + RtspsAddress *string `json:"rtspsAddress,omitempty"` + RunOnConnect *string `json:"runOnConnect,omitempty"` + RunOnConnectRestart *bool `json:"runOnConnectRestart,omitempty"` + RunOnDisconnect *string `json:"runOnDisconnect,omitempty"` + + // Srt SRT server + Srt *bool `json:"srt,omitempty"` + SrtAddress *string `json:"srtAddress,omitempty"` + SrtcpAddress *string `json:"srtcpAddress,omitempty"` + SrtpAddress *string `json:"srtpAddress,omitempty"` + SysLogPrefix *string `json:"sysLogPrefix,omitempty"` + UdpMaxPayloadSize *int64 `json:"udpMaxPayloadSize,omitempty"` + UdpReadBufferSize *uint64 `json:"udpReadBufferSize,omitempty"` + + // Webrtc WebRTC server + Webrtc *bool `json:"webrtc,omitempty"` + WebrtcAdditionalHosts *[]string `json:"webrtcAdditionalHosts,omitempty"` + WebrtcAddress *string `json:"webrtcAddress,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + WebrtcAllowOrigin *string `json:"webrtcAllowOrigin,omitempty"` + WebrtcAllowOrigins *[]string `json:"webrtcAllowOrigins,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + WebrtcDisable *bool `json:"webrtcDisable,omitempty"` + WebrtcEncryption *bool `json:"webrtcEncryption,omitempty"` + WebrtcHandshakeTimeout *string `json:"webrtcHandshakeTimeout,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + WebrtcICEHostNAT1To1IPs *[]string `json:"webrtcICEHostNAT1To1IPs,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + WebrtcICEServers *[]string `json:"webrtcICEServers,omitempty"` + WebrtcICEServers2 *[]WebRTCICEServer `json:"webrtcICEServers2,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + WebrtcICETCPMuxAddress *string `json:"webrtcICETCPMuxAddress,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + WebrtcICEUDPMuxAddress *string `json:"webrtcICEUDPMuxAddress,omitempty"` + WebrtcIPsFromInterfaces *bool `json:"webrtcIPsFromInterfaces,omitempty"` + WebrtcIPsFromInterfacesList *[]string `json:"webrtcIPsFromInterfacesList,omitempty"` + WebrtcLocalTCPAddress *string `json:"webrtcLocalTCPAddress,omitempty"` + WebrtcLocalUDPAddress *string `json:"webrtcLocalUDPAddress,omitempty"` + WebrtcSTUNGatherTimeout *string `json:"webrtcSTUNGatherTimeout,omitempty"` + WebrtcServerCert *string `json:"webrtcServerCert,omitempty"` + WebrtcServerKey *string `json:"webrtcServerKey,omitempty"` + WebrtcTrackGatherTimeout *string `json:"webrtcTrackGatherTimeout,omitempty"` + WebrtcTrustedProxies *[]string `json:"webrtcTrustedProxies,omitempty"` + WriteQueueSize *int64 `json:"writeQueueSize,omitempty"` + WriteTimeout *string `json:"writeTimeout,omitempty"` +} + +// GlobalConfProtocols defines model for GlobalConf.Protocols. +type GlobalConfProtocols string + +// GlobalConfRtspTransports defines model for GlobalConf.RtspTransports. +type GlobalConfRtspTransports string + +// HLSMuxer defines model for HLSMuxer. +type HLSMuxer struct { + // BytesSent deprecated + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesSent *uint64 `json:"bytesSent,omitempty"` + Created *string `json:"created,omitempty"` + LastRequest *string `json:"lastRequest,omitempty"` + OutboundBytes *uint64 `json:"outboundBytes,omitempty"` + OutboundFramesDiscarded *uint64 `json:"outboundFramesDiscarded,omitempty"` + Path *string `json:"path,omitempty"` +} + +// HLSMuxerList defines model for HLSMuxerList. +type HLSMuxerList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]HLSMuxer `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// HLSSession defines model for HLSSession. +type HLSSession struct { + Created *string `json:"created,omitempty"` + Id *openapi_types.UUID `json:"id,omitempty"` + IsCDN *bool `json:"isCDN,omitempty"` + OutboundBytes *uint64 `json:"outboundBytes,omitempty"` + Path *string `json:"path,omitempty"` + Query *string `json:"query,omitempty"` + RemoteAddr *string `json:"remoteAddr,omitempty"` + User *string `json:"user,omitempty"` + UserAgent *string `json:"userAgent,omitempty"` +} + +// HLSSessionList defines model for HLSSessionList. +type HLSSessionList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]HLSSession `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// HLSVariant defines model for HLSVariant. +type HLSVariant string + +// Info defines model for Info. +type Info struct { + Started *string `json:"started,omitempty"` + Version *string `json:"version,omitempty"` +} + +// LogDestination defines model for LogDestination. +type LogDestination string + +// LogLevel defines model for LogLevel. +type LogLevel string + +// MoQSession defines model for MoQSession. +type MoQSession struct { + Created *string `json:"created,omitempty"` + Id *openapi_types.UUID `json:"id,omitempty"` + InboundBytes *uint64 `json:"inboundBytes,omitempty"` + OutboundBytes *uint64 `json:"outboundBytes,omitempty"` + Path *string `json:"path,omitempty"` + Query *string `json:"query,omitempty"` + RemoteAddr *string `json:"remoteAddr,omitempty"` + State *MoQSessionState `json:"state,omitempty"` + UserAgent *string `json:"userAgent,omitempty"` + Version *MoQVersion `json:"version,omitempty"` +} + +// MoQSessionList defines model for MoQSessionList. +type MoQSessionList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]MoQSession `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// MoQSessionState defines model for MoQSessionState. +type MoQSessionState string + +// MoQVersion defines model for MoQVersion. +type MoQVersion string + +// OK defines model for OK. +type OK struct { + Status *OKStatus `json:"status,omitempty"` +} + +// OKStatus defines model for OKStatus. +type OKStatus string + +// Path defines model for Path. +type Path struct { + Available *bool `json:"available,omitempty"` + AvailableTime *string `json:"availableTime,omitempty"` + + // BytesReceived deprecated + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesReceived *uint64 `json:"bytesReceived,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesSent *uint64 `json:"bytesSent,omitempty"` + ConfName *string `json:"confName,omitempty"` + InboundBytes *uint64 `json:"inboundBytes,omitempty"` + InboundFramesInError *uint64 `json:"inboundFramesInError,omitempty"` + Name *string `json:"name,omitempty"` + Online *bool `json:"online,omitempty"` + OnlineTime *string `json:"onlineTime,omitempty"` + OutboundBytes *uint64 `json:"outboundBytes,omitempty"` + Readers *[]PathReader `json:"readers,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + Ready *bool `json:"ready,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + ReadyTime *string `json:"readyTime,omitempty"` + Source *PathSource `json:"source,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + Tracks *[]PathTrackCodec `json:"tracks,omitempty"` + Tracks2 *[]PathTrack `json:"tracks2,omitempty"` +} + +// PathConf defines model for PathConf. +type PathConf struct { + // AlwaysAvailable Always available + AlwaysAvailable *bool `json:"alwaysAvailable,omitempty"` + AlwaysAvailableFile *string `json:"alwaysAvailableFile,omitempty"` + AlwaysAvailableTracks *[]AlwaysAvailableTrack `json:"alwaysAvailableTracks,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + DisablePublisherOverride *bool `json:"disablePublisherOverride,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + Fallback *string `json:"fallback,omitempty"` + MaxReaders *int64 `json:"maxReaders,omitempty"` + + // MpegtsUDPReadBufferSize MPEG-TS source + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + MpegtsUDPReadBufferSize *uint64 `json:"mpegtsUDPReadBufferSize,omitempty"` + + // Name filled by Validate() + Name *string `json:"name,omitempty"` + + // OverridePublisher Publisher source + OverridePublisher *bool `json:"overridePublisher,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + Playback *bool `json:"playback,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + PublishIPs *[]string `json:"publishIPs,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + PublishPass *string `json:"publishPass,omitempty"` + + // PublishUser Authentication (deprecated) + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + PublishUser *string `json:"publishUser,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + ReadIPs *[]string `json:"readIPs,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + ReadPass *string `json:"readPass,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + ReadUser *string `json:"readUser,omitempty"` + + // Record Record + Record *bool `json:"record,omitempty"` + RecordDeleteAfter *string `json:"recordDeleteAfter,omitempty"` + RecordFormat *RecordFormat `json:"recordFormat,omitempty"` + RecordMaxPartSize *string `json:"recordMaxPartSize,omitempty"` + RecordPartDuration *string `json:"recordPartDuration,omitempty"` + RecordPath *string `json:"recordPath,omitempty"` + RecordSegmentDuration *string `json:"recordSegmentDuration,omitempty"` + RpiCameraAWB *string `json:"rpiCameraAWB,omitempty"` + RpiCameraAWBGains *[]float64 `json:"rpiCameraAWBGains,omitempty"` + RpiCameraAfMode *string `json:"rpiCameraAfMode,omitempty"` + RpiCameraAfRange *string `json:"rpiCameraAfRange,omitempty"` + RpiCameraAfSpeed *string `json:"rpiCameraAfSpeed,omitempty"` + RpiCameraAfWindow *string `json:"rpiCameraAfWindow,omitempty"` + RpiCameraBitrate *uint64 `json:"rpiCameraBitrate,omitempty"` + RpiCameraBrightness *float64 `json:"rpiCameraBrightness,omitempty"` + + // RpiCameraCamID Raspberry Pi Camera source + RpiCameraCamID *uint64 `json:"rpiCameraCamID,omitempty"` + RpiCameraCodec *string `json:"rpiCameraCodec,omitempty"` + RpiCameraContrast *float64 `json:"rpiCameraContrast,omitempty"` + RpiCameraDenoise *string `json:"rpiCameraDenoise,omitempty"` + RpiCameraEV *float64 `json:"rpiCameraEV,omitempty"` + RpiCameraExposure *string `json:"rpiCameraExposure,omitempty"` + RpiCameraFPS *float64 `json:"rpiCameraFPS,omitempty"` + RpiCameraFlickerPeriod *uint64 `json:"rpiCameraFlickerPeriod,omitempty"` + RpiCameraGain *float64 `json:"rpiCameraGain,omitempty"` + RpiCameraH264Level *string `json:"rpiCameraH264Level,omitempty"` + RpiCameraH264Profile *string `json:"rpiCameraH264Profile,omitempty"` + RpiCameraHDR *bool `json:"rpiCameraHDR,omitempty"` + RpiCameraHFlip *bool `json:"rpiCameraHFlip,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RpiCameraHardwareH264Level *string `json:"rpiCameraHardwareH264Level,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RpiCameraHardwareH264Profile *string `json:"rpiCameraHardwareH264Profile,omitempty"` + RpiCameraHeight *uint64 `json:"rpiCameraHeight,omitempty"` + RpiCameraIDRPeriod *uint64 `json:"rpiCameraIDRPeriod,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RpiCameraJPEGQuality *uint64 `json:"rpiCameraJPEGQuality,omitempty"` + RpiCameraLensPosition *float64 `json:"rpiCameraLensPosition,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RpiCameraLevel *string `json:"rpiCameraLevel,omitempty"` + RpiCameraMJPEGQuality *uint64 `json:"rpiCameraMJPEGQuality,omitempty"` + RpiCameraMetering *string `json:"rpiCameraMetering,omitempty"` + RpiCameraMode *string `json:"rpiCameraMode,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RpiCameraProfile *string `json:"rpiCameraProfile,omitempty"` + RpiCameraROI *string `json:"rpiCameraROI,omitempty"` + RpiCameraSaturation *float64 `json:"rpiCameraSaturation,omitempty"` + RpiCameraSecondary *bool `json:"rpiCameraSecondary,omitempty"` + RpiCameraSharpness *float64 `json:"rpiCameraSharpness,omitempty"` + RpiCameraShutter *uint64 `json:"rpiCameraShutter,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RpiCameraSoftwareH264Level *string `json:"rpiCameraSoftwareH264Level,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RpiCameraSoftwareH264Profile *string `json:"rpiCameraSoftwareH264Profile,omitempty"` + RpiCameraTextOverlay *string `json:"rpiCameraTextOverlay,omitempty"` + RpiCameraTextOverlayEnable *bool `json:"rpiCameraTextOverlayEnable,omitempty"` + RpiCameraTuningFile *string `json:"rpiCameraTuningFile,omitempty"` + RpiCameraVFlip *bool `json:"rpiCameraVFlip,omitempty"` + RpiCameraWidth *uint64 `json:"rpiCameraWidth,omitempty"` + + // RtpSDP RTP source + RtpSDP *string `json:"rtpSDP,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpUDPReadBufferSize *uint64 `json:"rtpUDPReadBufferSize,omitempty"` + RtspAnyPort *bool `json:"rtspAnyPort,omitempty"` + RtspDemuxMpegts *bool `json:"rtspDemuxMpegts,omitempty"` + RtspRangeStart *string `json:"rtspRangeStart,omitempty"` + RtspRangeType *RTSPRangeType `json:"rtspRangeType,omitempty"` + RtspScale *string `json:"rtspScale,omitempty"` + RtspTransport *RTSPTransport `json:"rtspTransport,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtspUDPReadBufferSize *uint64 `json:"rtspUDPReadBufferSize,omitempty"` + RtspUDPSourcePortRange *[]uint64 `json:"rtspUDPSourcePortRange,omitempty"` + RunOnAvailable *string `json:"runOnAvailable,omitempty"` + RunOnAvailableRestart *bool `json:"runOnAvailableRestart,omitempty"` + RunOnDemand *string `json:"runOnDemand,omitempty"` + RunOnDemandCloseAfter *string `json:"runOnDemandCloseAfter,omitempty"` + RunOnDemandRestart *bool `json:"runOnDemandRestart,omitempty"` + RunOnDemandStartTimeout *string `json:"runOnDemandStartTimeout,omitempty"` + + // RunOnInit Hooks + RunOnInit *string `json:"runOnInit,omitempty"` + RunOnInitRestart *bool `json:"runOnInitRestart,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RunOnNotReady *string `json:"runOnNotReady,omitempty"` + RunOnOffline *string `json:"runOnOffline,omitempty"` + RunOnOnline *string `json:"runOnOnline,omitempty"` + RunOnOnlineRestart *bool `json:"runOnOnlineRestart,omitempty"` + RunOnRead *string `json:"runOnRead,omitempty"` + RunOnReadRestart *bool `json:"runOnReadRestart,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RunOnReady *string `json:"runOnReady,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RunOnReadyRestart *bool `json:"runOnReadyRestart,omitempty"` + RunOnRecordSegmentComplete *string `json:"runOnRecordSegmentComplete,omitempty"` + RunOnRecordSegmentCreate *string `json:"runOnRecordSegmentCreate,omitempty"` + RunOnUnDemand *string `json:"runOnUnDemand,omitempty"` + RunOnUnavailable *string `json:"runOnUnavailable,omitempty"` + RunOnUnread *string `json:"runOnUnread,omitempty"` + + // Source General + Source *string `json:"source,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + SourceAnyPortEnable *bool `json:"sourceAnyPortEnable,omitempty"` + SourceFingerprint *string `json:"sourceFingerprint,omitempty"` + SourceOnDemand *bool `json:"sourceOnDemand,omitempty"` + SourceOnDemandCloseAfter *string `json:"sourceOnDemandCloseAfter,omitempty"` + SourceOnDemandStartTimeout *string `json:"sourceOnDemandStartTimeout,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + SourceProtocol *RTSPTransport `json:"sourceProtocol,omitempty"` + + // SourceRedirect Redirect source + SourceRedirect *string `json:"sourceRedirect,omitempty"` + SrtPublishPassphrase *string `json:"srtPublishPassphrase,omitempty"` + SrtReadPassphrase *string `json:"srtReadPassphrase,omitempty"` + UseAbsoluteTimestamp *bool `json:"useAbsoluteTimestamp,omitempty"` + + // WhepBearerToken WHEP source + WhepBearerToken *string `json:"whepBearerToken,omitempty"` + WhepHandshakeTimeout *string `json:"whepHandshakeTimeout,omitempty"` + WhepSTUNGatherTimeout *string `json:"whepSTUNGatherTimeout,omitempty"` + WhepTrackGatherTimeout *string `json:"whepTrackGatherTimeout,omitempty"` +} + +// PathConfList defines model for PathConfList. +type PathConfList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]PathConf `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// PathList defines model for PathList. +type PathList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]Path `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// PathReader defines model for PathReader. +type PathReader struct { + Id *string `json:"id,omitempty"` + Type *PathReaderType `json:"type,omitempty"` +} + +// PathReaderType defines model for PathReaderType. +type PathReaderType string + +// PathSource defines model for PathSource. +type PathSource struct { + Id *string `json:"id,omitempty"` + Type *PathSourceType `json:"type,omitempty"` +} + +// PathSourceType defines model for PathSourceType. +type PathSourceType string + +// PathTrack defines model for PathTrack. +type PathTrack struct { + Codec *PathTrackCodec `json:"codec,omitempty"` + CodecProps *PathTrackCodecProps `json:"codecProps,omitempty"` +} + +// PathTrackCodec defines model for PathTrackCodec. +type PathTrackCodec string + +// PathTrackCodecProps defines model for PathTrackCodecProps. +type PathTrackCodecProps struct { + union json.RawMessage +} + +// PathTrackCodecPropsAC3 defines model for PathTrackCodecPropsAC3. +type PathTrackCodecPropsAC3 struct { + ChannelCount *int64 `json:"channelCount,omitempty"` + SampleRate *int64 `json:"sampleRate,omitempty"` +} + +// PathTrackCodecPropsAV1 defines model for PathTrackCodecPropsAV1. +type PathTrackCodecPropsAV1 struct { + Height *int64 `json:"height,omitempty"` + Level *int64 `json:"level,omitempty"` + Profile *int64 `json:"profile,omitempty"` + Tier *int64 `json:"tier,omitempty"` + Width *int64 `json:"width,omitempty"` +} + +// PathTrackCodecPropsG711 defines model for PathTrackCodecPropsG711. +type PathTrackCodecPropsG711 struct { + ChannelCount *int64 `json:"channelCount,omitempty"` + MuLaw *bool `json:"muLaw,omitempty"` + SampleRate *int64 `json:"sampleRate,omitempty"` +} + +// PathTrackCodecPropsH264 defines model for PathTrackCodecPropsH264. +type PathTrackCodecPropsH264 struct { + Height *int64 `json:"height,omitempty"` + Level *string `json:"level,omitempty"` + Profile *string `json:"profile,omitempty"` + Width *int64 `json:"width,omitempty"` +} + +// PathTrackCodecPropsH265 defines model for PathTrackCodecPropsH265. +type PathTrackCodecPropsH265 struct { + Height *int64 `json:"height,omitempty"` + Level *string `json:"level,omitempty"` + Profile *string `json:"profile,omitempty"` + Width *int64 `json:"width,omitempty"` +} + +// PathTrackCodecPropsLPCM defines model for PathTrackCodecPropsLPCM. +type PathTrackCodecPropsLPCM struct { + BitDepth *int64 `json:"bitDepth,omitempty"` + ChannelCount *int64 `json:"channelCount,omitempty"` + SampleRate *int64 `json:"sampleRate,omitempty"` +} + +// PathTrackCodecPropsMPEG4Audio defines model for PathTrackCodecPropsMPEG4Audio. +type PathTrackCodecPropsMPEG4Audio struct { + ChannelCount *int64 `json:"channelCount,omitempty"` + SampleRate *int64 `json:"sampleRate,omitempty"` +} + +// PathTrackCodecPropsOpus defines model for PathTrackCodecPropsOpus. +type PathTrackCodecPropsOpus struct { + ChannelCount *int64 `json:"channelCount,omitempty"` +} + +// PathTrackCodecPropsVP9 defines model for PathTrackCodecPropsVP9. +type PathTrackCodecPropsVP9 struct { + Profile *int64 `json:"profile,omitempty"` +} + +// RTMPConn defines model for RTMPConn. +type RTMPConn struct { + // BytesReceived deprecated + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesReceived *uint64 `json:"bytesReceived,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesSent *uint64 `json:"bytesSent,omitempty"` + Created *string `json:"created,omitempty"` + Id *openapi_types.UUID `json:"id,omitempty"` + InboundBytes *uint64 `json:"inboundBytes,omitempty"` + OutboundBytes *uint64 `json:"outboundBytes,omitempty"` + OutboundFramesDiscarded *uint64 `json:"outboundFramesDiscarded,omitempty"` + Path *string `json:"path,omitempty"` + Query *string `json:"query,omitempty"` + RemoteAddr *string `json:"remoteAddr,omitempty"` + State *RTMPConnState `json:"state,omitempty"` + User *string `json:"user,omitempty"` + UserAgent *string `json:"userAgent,omitempty"` +} + +// RTMPConnList defines model for RTMPConnList. +type RTMPConnList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]RTMPConn `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// RTMPConnState defines model for RTMPConnState. +type RTMPConnState string + +// RTSPAuthMethod defines model for RTSPAuthMethod. +type RTSPAuthMethod string + +// RTSPConn defines model for RTSPConn. +type RTSPConn struct { + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesReceived *uint64 `json:"bytesReceived,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesSent *uint64 `json:"bytesSent,omitempty"` + Created *string `json:"created,omitempty"` + Id *openapi_types.UUID `json:"id,omitempty"` + InboundBytes *uint64 `json:"inboundBytes,omitempty"` + OutboundBytes *uint64 `json:"outboundBytes,omitempty"` + RemoteAddr *string `json:"remoteAddr,omitempty"` + Session *openapi_types.UUID `json:"session,omitempty"` + Tunnel *string `json:"tunnel,omitempty"` +} + +// RTSPConnList defines model for RTSPConnList. +type RTSPConnList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]RTSPConn `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// RTSPRangeType defines model for RTSPRangeType. +type RTSPRangeType string + +// RTSPSession defines model for RTSPSession. +type RTSPSession struct { + // BytesReceived deprecated + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesReceived *uint64 `json:"bytesReceived,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesSent *uint64 `json:"bytesSent,omitempty"` + Conns *[]openapi_types.UUID `json:"conns,omitempty"` + Created *string `json:"created,omitempty"` + Id *openapi_types.UUID `json:"id,omitempty"` + InboundBytes *uint64 `json:"inboundBytes,omitempty"` + InboundRTCPPackets *uint64 `json:"inboundRTCPPackets,omitempty"` + InboundRTCPPacketsInError *uint64 `json:"inboundRTCPPacketsInError,omitempty"` + InboundRTPPackets *uint64 `json:"inboundRTPPackets,omitempty"` + InboundRTPPacketsInError *uint64 `json:"inboundRTPPacketsInError,omitempty"` + InboundRTPPacketsJitter *float64 `json:"inboundRTPPacketsJitter,omitempty"` + InboundRTPPacketsLost *uint64 `json:"inboundRTPPacketsLost,omitempty"` + OutboundBytes *uint64 `json:"outboundBytes,omitempty"` + OutboundRTCPPackets *uint64 `json:"outboundRTCPPackets,omitempty"` + OutboundRTPPackets *uint64 `json:"outboundRTPPackets,omitempty"` + OutboundRTPPacketsDiscarded *uint64 `json:"outboundRTPPacketsDiscarded,omitempty"` + OutboundRTPPacketsReportedLost *uint64 `json:"outboundRTPPacketsReportedLost,omitempty"` + Path *string `json:"path,omitempty"` + Profile *string `json:"profile,omitempty"` + Query *string `json:"query,omitempty"` + RemoteAddr *string `json:"remoteAddr,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtcpPacketsInError *uint64 `json:"rtcpPacketsInError,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtcpPacketsReceived *uint64 `json:"rtcpPacketsReceived,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtcpPacketsSent *uint64 `json:"rtcpPacketsSent,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpPacketsInError *uint64 `json:"rtpPacketsInError,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpPacketsJitter *float64 `json:"rtpPacketsJitter,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpPacketsLost *uint64 `json:"rtpPacketsLost,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpPacketsReceived *uint64 `json:"rtpPacketsReceived,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpPacketsSent *uint64 `json:"rtpPacketsSent,omitempty"` + State *RTSPSessionState `json:"state,omitempty"` + Transport *string `json:"transport,omitempty"` + User *string `json:"user,omitempty"` + UserAgent *string `json:"userAgent,omitempty"` +} + +// RTSPSessionList defines model for RTSPSessionList. +type RTSPSessionList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]RTSPSession `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// RTSPSessionState defines model for RTSPSessionState. +type RTSPSessionState string + +// RTSPTransport defines model for RTSPTransport. +type RTSPTransport string + +// RecordFormat defines model for RecordFormat. +type RecordFormat string + +// Recording defines model for Recording. +type Recording struct { + Name *string `json:"name,omitempty"` + Segments *[]RecordingSegment `json:"segments,omitempty"` +} + +// RecordingList defines model for RecordingList. +type RecordingList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]Recording `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// RecordingSegment defines model for RecordingSegment. +type RecordingSegment struct { + Start *string `json:"start,omitempty"` +} + +// SRTConn defines model for SRTConn. +type SRTConn struct { + // ByteMSS Maximum Segment Size (MSS), in bytes + ByteMSS *uint64 `json:"byteMSS,omitempty"` + + // BytesAvailReceiveBuf The available space in the receiver's buffer, in bytes + BytesAvailReceiveBuf *uint64 `json:"bytesAvailReceiveBuf,omitempty"` + + // BytesAvailSendBuf The available space in the sender's buffer, in bytes + BytesAvailSendBuf *uint64 `json:"bytesAvailSendBuf,omitempty"` + + // BytesReceiveBuf Instantaneous (current) value of packetsRcvBuf, expressed in bytes, including payload and all headers (IP, TCP, SRT) + BytesReceiveBuf *uint64 `json:"bytesReceiveBuf,omitempty"` + + // BytesReceived Same as packetsReceived, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesReceived *uint64 `json:"bytesReceived,omitempty"` + + // BytesReceivedBelated Same as PacketsReceivedBelated, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesReceivedBelated *uint64 `json:"bytesReceivedBelated,omitempty"` + + // BytesReceivedDrop Same as packetsReceivedDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesReceivedDrop *uint64 `json:"bytesReceivedDrop,omitempty"` + + // BytesReceivedLoss Same as packetsReceivedLoss, but expressed in bytes, including payload and all the headers (IP, TCP, SRT), bytes for the presently missing (either reordered or lost) packets' payloads are estimated based on the average packet size + BytesReceivedLoss *uint64 `json:"bytesReceivedLoss,omitempty"` + + // BytesReceivedRetrans Same as packetsReceivedRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesReceivedRetrans *uint64 `json:"bytesReceivedRetrans,omitempty"` + + // BytesReceivedUndecrypt Same as packetsReceivedUndecrypt, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesReceivedUndecrypt *uint64 `json:"bytesReceivedUndecrypt,omitempty"` + + // BytesReceivedUnique Same as packetsReceivedUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesReceivedUnique *uint64 `json:"bytesReceivedUnique,omitempty"` + + // BytesRetrans Same as packetsRetrans, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesRetrans *uint64 `json:"bytesRetrans,omitempty"` + + // BytesSendBuf Instantaneous (current) value of packetsSndBuf, but expressed in bytes, including payload and all headers (IP, TCP, SRT) + BytesSendBuf *uint64 `json:"bytesSendBuf,omitempty"` + + // BytesSendDrop Same as packetsSendDrop, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesSendDrop *uint64 `json:"bytesSendDrop,omitempty"` + + // BytesSent Same as packetsSent, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesSent *uint64 `json:"bytesSent,omitempty"` + + // BytesSentUnique Same as packetsSentUnique, but expressed in bytes, including payload and all the headers (IP, TCP, SRT) + BytesSentUnique *uint64 `json:"bytesSentUnique,omitempty"` + Created *string `json:"created,omitempty"` + Id *openapi_types.UUID `json:"id,omitempty"` + + // MbpsLinkCapacity Estimated capacity of the network link, in Mbps + MbpsLinkCapacity *float64 `json:"mbpsLinkCapacity,omitempty"` + + // MbpsMaxBW Transmission bandwidth limit, in Mbps + MbpsMaxBW *float64 `json:"mbpsMaxBW,omitempty"` + + // MbpsReceiveRate Current receiving bandwidth, in Mbps + MbpsReceiveRate *float64 `json:"mbpsReceiveRate,omitempty"` + + // MbpsSendRate Current transmission bandwidth, in Mbps + MbpsSendRate *float64 `json:"mbpsSendRate,omitempty"` + + // MsRTT Smoothed round-trip time (SRTT), an exponentially-weighted moving average (EWMA) of an endpoint's RTT samples, in milliseconds + MsRTT *float64 `json:"msRTT,omitempty"` + + // MsReceiveBuf The timespan (msec) of acknowledged packets in the receiver's buffer + MsReceiveBuf *uint64 `json:"msReceiveBuf,omitempty"` + + // MsReceiveTsbPdDelay Timestamp-based Packet Delivery Delay value set on the socket via SRTO_RCVLATENCY or SRTO_LATENCY + MsReceiveTsbPdDelay *uint64 `json:"msReceiveTsbPdDelay,omitempty"` + + // MsSendBuf The timespan (msec) of packets in the sender's buffer (unacknowledged packets) + MsSendBuf *uint64 `json:"msSendBuf,omitempty"` + + // MsSendTsbPdDelay Timestamp-based Packet Delivery Delay value of the peer + MsSendTsbPdDelay *uint64 `json:"msSendTsbPdDelay,omitempty"` + OutboundFramesDiscarded *uint64 `json:"outboundFramesDiscarded,omitempty"` + + // PacketsFlightSize The number of packets in flight + PacketsFlightSize *uint64 `json:"packetsFlightSize,omitempty"` + + // PacketsFlowWindow The maximum number of packets that can be "in flight" + PacketsFlowWindow *uint64 `json:"packetsFlowWindow,omitempty"` + + // PacketsReceiveBuf The number of acknowledged packets in receiver's buffer + PacketsReceiveBuf *uint64 `json:"packetsReceiveBuf,omitempty"` + + // PacketsReceived The total number of received DATA packets, including retransmitted packets + PacketsReceived *uint64 `json:"packetsReceived,omitempty"` + + // PacketsReceivedACK The total number of received ACK (Acknowledgement) control packets + PacketsReceivedACK *uint64 `json:"packetsReceivedACK,omitempty"` + + // PacketsReceivedAvgBelatedTime Accumulated difference between the current time and the time-to-play of a packet that is received late + PacketsReceivedAvgBelatedTime *uint64 `json:"packetsReceivedAvgBelatedTime,omitempty"` + PacketsReceivedBelated *uint64 `json:"packetsReceivedBelated,omitempty"` + + // PacketsReceivedDrop The total number of dropped by the SRT receiver and, as a result, not delivered to the upstream application DATA packets + PacketsReceivedDrop *uint64 `json:"packetsReceivedDrop,omitempty"` + + // PacketsReceivedKM The total number of received KM (Key Material) control packets + PacketsReceivedKM *uint64 `json:"packetsReceivedKM,omitempty"` + + // PacketsReceivedLoss The total number of SRT DATA packets detected as presently missing (either reordered or lost) at the receiver side + PacketsReceivedLoss *uint64 `json:"packetsReceivedLoss,omitempty"` + + // PacketsReceivedLossRate Percentage of retransmitted data vs. received data + PacketsReceivedLossRate *float64 `json:"packetsReceivedLossRate,omitempty"` + + // PacketsReceivedNAK The total number of received NAK (Negative Acknowledgement) control packets + PacketsReceivedNAK *uint64 `json:"packetsReceivedNAK,omitempty"` + + // PacketsReceivedRetrans The total number of retransmitted packets registered at the receiver side + PacketsReceivedRetrans *uint64 `json:"packetsReceivedRetrans,omitempty"` + + // PacketsReceivedUndecrypt The total number of packets that failed to be decrypted at the receiver side + PacketsReceivedUndecrypt *uint64 `json:"packetsReceivedUndecrypt,omitempty"` + + // PacketsReceivedUnique The total number of unique original, retransmitted or recovered by the packet filter DATA packets received in time, decrypted without errors and, as a result, scheduled for delivery to the upstream application by the SRT receiver. + PacketsReceivedUnique *uint64 `json:"packetsReceivedUnique,omitempty"` + + // PacketsReorderTolerance Instant value of the packet reorder tolerance + PacketsReorderTolerance *uint64 `json:"packetsReorderTolerance,omitempty"` + + // PacketsRetrans The total number of retransmitted packets sent by the SRT sender + PacketsRetrans *uint64 `json:"packetsRetrans,omitempty"` + + // PacketsSendBuf The number of packets in the sender's buffer that are already scheduled for sending or even possibly sent, but not yet acknowledged + PacketsSendBuf *uint64 `json:"packetsSendBuf,omitempty"` + + // PacketsSendDrop The total number of dropped by the SRT sender DATA packets that have no chance to be delivered in time + PacketsSendDrop *uint64 `json:"packetsSendDrop,omitempty"` + + // PacketsSendLoss The total number of data packets considered or reported as lost at the sender side. Does not correspond to the packets detected as lost at the receiver side. + PacketsSendLoss *uint64 `json:"packetsSendLoss,omitempty"` + + // PacketsSendLossRate Percentage of resent data vs. sent data + PacketsSendLossRate *float64 `json:"packetsSendLossRate,omitempty"` + + // PacketsSent The total number of sent DATA packets, including retransmitted packets + PacketsSent *uint64 `json:"packetsSent,omitempty"` + + // PacketsSentACK The total number of sent ACK (Acknowledgement) control packets + PacketsSentACK *uint64 `json:"packetsSentACK,omitempty"` + + // PacketsSentKM The total number of sent KM (Key Material) control packets + PacketsSentKM *uint64 `json:"packetsSentKM,omitempty"` + + // PacketsSentNAK The total number of sent NAK (Negative Acknowledgement) control packets + PacketsSentNAK *uint64 `json:"packetsSentNAK,omitempty"` + + // PacketsSentUnique The total number of unique DATA packets sent by the SRT sender + PacketsSentUnique *uint64 `json:"packetsSentUnique,omitempty"` + Path *string `json:"path,omitempty"` + Query *string `json:"query,omitempty"` + RemoteAddr *string `json:"remoteAddr,omitempty"` + State *SRTConnState `json:"state,omitempty"` + + // UsPacketsSendPeriod Current minimum time interval between which consecutive packets are sent, in microseconds + UsPacketsSendPeriod *float64 `json:"usPacketsSendPeriod,omitempty"` + + // UsSndDuration The total accumulated time in microseconds, during which the SRT sender has some data to transmit, including packets that have been sent, but not yet acknowledged + UsSndDuration *uint64 `json:"usSndDuration,omitempty"` + User *string `json:"user,omitempty"` +} + +// SRTConnList defines model for SRTConnList. +type SRTConnList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]SRTConn `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// SRTConnState defines model for SRTConnState. +type SRTConnState string + +// WebRTCICEServer defines model for WebRTCICEServer. +type WebRTCICEServer struct { + ClientOnly *bool `json:"clientOnly,omitempty"` + Password *string `json:"password,omitempty"` + Url *string `json:"url,omitempty"` + Username *string `json:"username,omitempty"` +} + +// WebRTCSession defines model for WebRTCSession. +type WebRTCSession struct { + // BytesReceived deprecated + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesReceived *uint64 `json:"bytesReceived,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + BytesSent *uint64 `json:"bytesSent,omitempty"` + Created *string `json:"created,omitempty"` + Id *openapi_types.UUID `json:"id,omitempty"` + InboundBytes *uint64 `json:"inboundBytes,omitempty"` + InboundRTCPPackets *uint64 `json:"inboundRTCPPackets,omitempty"` + InboundRTPPackets *uint64 `json:"inboundRTPPackets,omitempty"` + InboundRTPPacketsJitter *float64 `json:"inboundRTPPacketsJitter,omitempty"` + InboundRTPPacketsLost *uint64 `json:"inboundRTPPacketsLost,omitempty"` + LocalCandidate *string `json:"localCandidate,omitempty"` + OutboundBytes *uint64 `json:"outboundBytes,omitempty"` + OutboundFramesDiscarded *uint64 `json:"outboundFramesDiscarded,omitempty"` + OutboundRTCPPackets *uint64 `json:"outboundRTCPPackets,omitempty"` + OutboundRTPPackets *uint64 `json:"outboundRTPPackets,omitempty"` + Path *string `json:"path,omitempty"` + PeerConnectionEstablished *bool `json:"peerConnectionEstablished,omitempty"` + Query *string `json:"query,omitempty"` + RemoteAddr *string `json:"remoteAddr,omitempty"` + RemoteCandidate *string `json:"remoteCandidate,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtcpPacketsReceived *uint64 `json:"rtcpPacketsReceived,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtcpPacketsSent *uint64 `json:"rtcpPacketsSent,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpPacketsJitter *float64 `json:"rtpPacketsJitter,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpPacketsLost *uint64 `json:"rtpPacketsLost,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpPacketsReceived *uint64 `json:"rtpPacketsReceived,omitempty"` + // Deprecated: this property has been marked as deprecated upstream, but no `x-deprecated-reason` was set + RtpPacketsSent *uint64 `json:"rtpPacketsSent,omitempty"` + State *WebRTCSessionState `json:"state,omitempty"` + User *string `json:"user,omitempty"` + UserAgent *string `json:"userAgent,omitempty"` +} + +// WebRTCSessionList defines model for WebRTCSessionList. +type WebRTCSessionList struct { + ItemCount *int64 `json:"itemCount,omitempty"` + Items *[]WebRTCSession `json:"items,omitempty"` + PageCount *int64 `json:"pageCount,omitempty"` +} + +// WebRTCSessionState defines model for WebRTCSessionState. +type WebRTCSessionState string + +// ConfigPathsListParams defines parameters for ConfigPathsList. +type ConfigPathsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// HlsMuxersListParams defines parameters for HlsMuxersList. +type HlsMuxersListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// HlssessionsListParams defines parameters for HlssessionsList. +type HlssessionsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// MoqSessionsListParams defines parameters for MoqSessionsList. +type MoqSessionsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// PathsListParams defines parameters for PathsList. +type PathsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// RecordingsDeleteSegmentParams defines parameters for RecordingsDeleteSegment. +type RecordingsDeleteSegmentParams struct { + // Path path. + Path string `form:"path" json:"path"` + + // Start starting date of the segment. + Start string `form:"start" json:"start"` +} + +// RecordingsListParams defines parameters for RecordingsList. +type RecordingsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// RtmpConnsListParams defines parameters for RtmpConnsList. +type RtmpConnsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// RtmpsConnsListParams defines parameters for RtmpsConnsList. +type RtmpsConnsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// RtspConnsListParams defines parameters for RtspConnsList. +type RtspConnsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// RtspsConnsListParams defines parameters for RtspsConnsList. +type RtspsConnsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// RtspSessionsListParams defines parameters for RtspSessionsList. +type RtspSessionsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// RtspsSessionsListParams defines parameters for RtspsSessionsList. +type RtspsSessionsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// SrtConnsListParams defines parameters for SrtConnsList. +type SrtConnsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// WebrtcSessionsListParams defines parameters for WebrtcSessionsList. +type WebrtcSessionsListParams struct { + // Page page number. + Page *int `form:"page,omitempty" json:"page,omitempty"` + + // ItemsPerPage items per page. + ItemsPerPage *int `form:"itemsPerPage,omitempty" json:"itemsPerPage,omitempty"` +} + +// ConfigGlobalSetJSONRequestBody defines body for ConfigGlobalSet for application/json ContentType. +type ConfigGlobalSetJSONRequestBody = GlobalConf + +// ConfigPathDefaultsPatchJSONRequestBody defines body for ConfigPathDefaultsPatch for application/json ContentType. +type ConfigPathDefaultsPatchJSONRequestBody = PathConf + +// ConfigPathsAddJSONRequestBody defines body for ConfigPathsAdd for application/json ContentType. +type ConfigPathsAddJSONRequestBody = PathConf + +// ConfigPathsPatchJSONRequestBody defines body for ConfigPathsPatch for application/json ContentType. +type ConfigPathsPatchJSONRequestBody = PathConf + +// ConfigPathsReplaceJSONRequestBody defines body for ConfigPathsReplace for application/json ContentType. +type ConfigPathsReplaceJSONRequestBody = PathConf + +// AsPathTrackCodecPropsAV1 returns the union data inside the PathTrackCodecProps as a PathTrackCodecPropsAV1 +func (t PathTrackCodecProps) AsPathTrackCodecPropsAV1() (PathTrackCodecPropsAV1, error) { + var body PathTrackCodecPropsAV1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPathTrackCodecPropsAV1 overwrites any union data inside the PathTrackCodecProps as the provided PathTrackCodecPropsAV1 +func (t *PathTrackCodecProps) FromPathTrackCodecPropsAV1(v PathTrackCodecPropsAV1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePathTrackCodecPropsAV1 performs a merge with any union data inside the PathTrackCodecProps, using the provided PathTrackCodecPropsAV1 +func (t *PathTrackCodecProps) MergePathTrackCodecPropsAV1(v PathTrackCodecPropsAV1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPathTrackCodecPropsVP9 returns the union data inside the PathTrackCodecProps as a PathTrackCodecPropsVP9 +func (t PathTrackCodecProps) AsPathTrackCodecPropsVP9() (PathTrackCodecPropsVP9, error) { + var body PathTrackCodecPropsVP9 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPathTrackCodecPropsVP9 overwrites any union data inside the PathTrackCodecProps as the provided PathTrackCodecPropsVP9 +func (t *PathTrackCodecProps) FromPathTrackCodecPropsVP9(v PathTrackCodecPropsVP9) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePathTrackCodecPropsVP9 performs a merge with any union data inside the PathTrackCodecProps, using the provided PathTrackCodecPropsVP9 +func (t *PathTrackCodecProps) MergePathTrackCodecPropsVP9(v PathTrackCodecPropsVP9) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPathTrackCodecPropsH265 returns the union data inside the PathTrackCodecProps as a PathTrackCodecPropsH265 +func (t PathTrackCodecProps) AsPathTrackCodecPropsH265() (PathTrackCodecPropsH265, error) { + var body PathTrackCodecPropsH265 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPathTrackCodecPropsH265 overwrites any union data inside the PathTrackCodecProps as the provided PathTrackCodecPropsH265 +func (t *PathTrackCodecProps) FromPathTrackCodecPropsH265(v PathTrackCodecPropsH265) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePathTrackCodecPropsH265 performs a merge with any union data inside the PathTrackCodecProps, using the provided PathTrackCodecPropsH265 +func (t *PathTrackCodecProps) MergePathTrackCodecPropsH265(v PathTrackCodecPropsH265) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPathTrackCodecPropsH264 returns the union data inside the PathTrackCodecProps as a PathTrackCodecPropsH264 +func (t PathTrackCodecProps) AsPathTrackCodecPropsH264() (PathTrackCodecPropsH264, error) { + var body PathTrackCodecPropsH264 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPathTrackCodecPropsH264 overwrites any union data inside the PathTrackCodecProps as the provided PathTrackCodecPropsH264 +func (t *PathTrackCodecProps) FromPathTrackCodecPropsH264(v PathTrackCodecPropsH264) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePathTrackCodecPropsH264 performs a merge with any union data inside the PathTrackCodecProps, using the provided PathTrackCodecPropsH264 +func (t *PathTrackCodecProps) MergePathTrackCodecPropsH264(v PathTrackCodecPropsH264) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPathTrackCodecPropsOpus returns the union data inside the PathTrackCodecProps as a PathTrackCodecPropsOpus +func (t PathTrackCodecProps) AsPathTrackCodecPropsOpus() (PathTrackCodecPropsOpus, error) { + var body PathTrackCodecPropsOpus + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPathTrackCodecPropsOpus overwrites any union data inside the PathTrackCodecProps as the provided PathTrackCodecPropsOpus +func (t *PathTrackCodecProps) FromPathTrackCodecPropsOpus(v PathTrackCodecPropsOpus) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePathTrackCodecPropsOpus performs a merge with any union data inside the PathTrackCodecProps, using the provided PathTrackCodecPropsOpus +func (t *PathTrackCodecProps) MergePathTrackCodecPropsOpus(v PathTrackCodecPropsOpus) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPathTrackCodecPropsMPEG4Audio returns the union data inside the PathTrackCodecProps as a PathTrackCodecPropsMPEG4Audio +func (t PathTrackCodecProps) AsPathTrackCodecPropsMPEG4Audio() (PathTrackCodecPropsMPEG4Audio, error) { + var body PathTrackCodecPropsMPEG4Audio + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPathTrackCodecPropsMPEG4Audio overwrites any union data inside the PathTrackCodecProps as the provided PathTrackCodecPropsMPEG4Audio +func (t *PathTrackCodecProps) FromPathTrackCodecPropsMPEG4Audio(v PathTrackCodecPropsMPEG4Audio) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePathTrackCodecPropsMPEG4Audio performs a merge with any union data inside the PathTrackCodecProps, using the provided PathTrackCodecPropsMPEG4Audio +func (t *PathTrackCodecProps) MergePathTrackCodecPropsMPEG4Audio(v PathTrackCodecPropsMPEG4Audio) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPathTrackCodecPropsAC3 returns the union data inside the PathTrackCodecProps as a PathTrackCodecPropsAC3 +func (t PathTrackCodecProps) AsPathTrackCodecPropsAC3() (PathTrackCodecPropsAC3, error) { + var body PathTrackCodecPropsAC3 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPathTrackCodecPropsAC3 overwrites any union data inside the PathTrackCodecProps as the provided PathTrackCodecPropsAC3 +func (t *PathTrackCodecProps) FromPathTrackCodecPropsAC3(v PathTrackCodecPropsAC3) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePathTrackCodecPropsAC3 performs a merge with any union data inside the PathTrackCodecProps, using the provided PathTrackCodecPropsAC3 +func (t *PathTrackCodecProps) MergePathTrackCodecPropsAC3(v PathTrackCodecPropsAC3) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPathTrackCodecPropsG711 returns the union data inside the PathTrackCodecProps as a PathTrackCodecPropsG711 +func (t PathTrackCodecProps) AsPathTrackCodecPropsG711() (PathTrackCodecPropsG711, error) { + var body PathTrackCodecPropsG711 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPathTrackCodecPropsG711 overwrites any union data inside the PathTrackCodecProps as the provided PathTrackCodecPropsG711 +func (t *PathTrackCodecProps) FromPathTrackCodecPropsG711(v PathTrackCodecPropsG711) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePathTrackCodecPropsG711 performs a merge with any union data inside the PathTrackCodecProps, using the provided PathTrackCodecPropsG711 +func (t *PathTrackCodecProps) MergePathTrackCodecPropsG711(v PathTrackCodecPropsG711) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPathTrackCodecPropsLPCM returns the union data inside the PathTrackCodecProps as a PathTrackCodecPropsLPCM +func (t PathTrackCodecProps) AsPathTrackCodecPropsLPCM() (PathTrackCodecPropsLPCM, error) { + var body PathTrackCodecPropsLPCM + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPathTrackCodecPropsLPCM overwrites any union data inside the PathTrackCodecProps as the provided PathTrackCodecPropsLPCM +func (t *PathTrackCodecProps) FromPathTrackCodecPropsLPCM(v PathTrackCodecPropsLPCM) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePathTrackCodecPropsLPCM performs a merge with any union data inside the PathTrackCodecProps, using the provided PathTrackCodecPropsLPCM +func (t *PathTrackCodecProps) MergePathTrackCodecPropsLPCM(v PathTrackCodecPropsLPCM) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PathTrackCodecProps) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PathTrackCodecProps) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// RequestEditorFn is the function signature for the RequestEditor callback function +type RequestEditorFn func(ctx context.Context, req *http.Request) error + +// Doer performs HTTP requests. +// +// The standard http.Client implements this interface. +type HttpRequestDoer interface { + Do(req *http.Request) (*http.Response, error) +} + +// Client which conforms to the OpenAPI3 specification for this service. +type Client struct { + // The endpoint of the server conforming to this interface, with scheme, + // https://api.deepmap.com for example. This can contain a path relative + // to the server, such as https://api.deepmap.com/dev-test, and all the + // paths in the swagger spec will be appended to the server. + Server string + + // Doer for performing requests, typically a *http.Client with any + // customized settings, such as certificate chains. + Client HttpRequestDoer + + // A list of callbacks for modifying requests which are generated before sending over + // the network. + RequestEditors []RequestEditorFn +} + +// ClientOption allows setting custom parameters during construction +type ClientOption func(*Client) error + +// Creates a new Client, with reasonable defaults +func NewClient(server string, opts ...ClientOption) (*Client, error) { + // create a client with sane default values + client := Client{ + Server: server, + } + // mutate client and add all optional params + for _, o := range opts { + if err := o(&client); err != nil { + return nil, err + } + } + // ensure the server URL always has a trailing slash + if !strings.HasSuffix(client.Server, "/") { + client.Server += "/" + } + // create httpClient, if not already present + if client.Client == nil { + client.Client = &http.Client{} + } + return &client, nil +} + +// WithHTTPClient allows overriding the default Doer, which is +// automatically created using http.Client. This is useful for tests. +func WithHTTPClient(doer HttpRequestDoer) ClientOption { + return func(c *Client) error { + c.Client = doer + return nil + } +} + +// WithRequestEditorFn allows setting up a callback function, which will be +// called right before sending the request. This can be used to mutate the request. +func WithRequestEditorFn(fn RequestEditorFn) ClientOption { + return func(c *Client) error { + c.RequestEditors = append(c.RequestEditors, fn) + return nil + } +} + +// The interface specification for the client above. +type ClientInterface interface { + + // AuthJwksRefresh Manually refreshes the JWT JWKS. + // + // Corresponds with POST /v3/auth/jwks/refresh (the `AuthJwksRefresh` operationId). + AuthJwksRefresh(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigGlobalGet returns the global configuration. + // + // Corresponds with GET /v3/config/global/get (the `ConfigGlobalGet` operationId). + ConfigGlobalGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigGlobalSetWithBody patches the global configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v3/config/global/patch (the `ConfigGlobalSet` operationId). + ConfigGlobalSetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigGlobalSet patches the global configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v3/config/global/patch (the `ConfigGlobalSet` operationId). + ConfigGlobalSet(ctx context.Context, body ConfigGlobalSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathDefaultsGet returns the default path configuration. + // + // Corresponds with GET /v3/config/pathdefaults/get (the `ConfigPathDefaultsGet` operationId). + ConfigPathDefaultsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathDefaultsPatchWithBody patches the default path configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v3/config/pathdefaults/patch (the `ConfigPathDefaultsPatch` operationId). + ConfigPathDefaultsPatchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathDefaultsPatch patches the default path configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v3/config/pathdefaults/patch (the `ConfigPathDefaultsPatch` operationId). + ConfigPathDefaultsPatch(ctx context.Context, body ConfigPathDefaultsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathsAddWithBody adds a path configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v3/config/paths/add/{name} (the `ConfigPathsAdd` operationId). + ConfigPathsAddWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathsAdd adds a path configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v3/config/paths/add/{name} (the `ConfigPathsAdd` operationId). + ConfigPathsAdd(ctx context.Context, name string, body ConfigPathsAddJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathsDelete removes a path configuration. + // + // Corresponds with DELETE /v3/config/paths/delete/{name} (the `ConfigPathsDelete` operationId). + ConfigPathsDelete(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathsGet returns a path configuration. + // + // Corresponds with GET /v3/config/paths/get/{name} (the `ConfigPathsGet` operationId). + ConfigPathsGet(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathsList returns all path configurations. + // + // Corresponds with GET /v3/config/paths/list (the `ConfigPathsList` operationId). + ConfigPathsList(ctx context.Context, params *ConfigPathsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathsPatchWithBody patches a path configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type. + // + // Corresponds with PATCH /v3/config/paths/patch/{name} (the `ConfigPathsPatch` operationId). + ConfigPathsPatchWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathsPatch patches a path configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with PATCH /v3/config/paths/patch/{name} (the `ConfigPathsPatch` operationId). + ConfigPathsPatch(ctx context.Context, name string, body ConfigPathsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathsReplaceWithBody replaces all values of a path configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type. + // + // Corresponds with POST /v3/config/paths/replace/{name} (the `ConfigPathsReplace` operationId). + ConfigPathsReplaceWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) + + // ConfigPathsReplace replaces all values of a path configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type. + // + // Corresponds with POST /v3/config/paths/replace/{name} (the `ConfigPathsReplace` operationId). + ConfigPathsReplace(ctx context.Context, name string, body ConfigPathsReplaceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) + + // HlsMuxersGet returns a HLS muxer. + // + // Corresponds with GET /v3/hlsmuxers/get/{name} (the `HlsMuxersGet` operationId). + HlsMuxersGet(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // HlsMuxersList returns all HLS muxers. + // + // Corresponds with GET /v3/hlsmuxers/list (the `HlsMuxersList` operationId). + HlsMuxersList(ctx context.Context, params *HlsMuxersListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // HlssessionsGet returns a HLS session. + // + // Corresponds with GET /v3/hlssessions/get/{id} (the `HlssessionsGet` operationId). + HlssessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // HlssessionsKick kicks out a HLS session from the server. + // + // Corresponds with POST /v3/hlssessions/kick/{id} (the `HlssessionsKick` operationId). + HlssessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // HlssessionsList returns all HLS sessions. + // + // Corresponds with GET /v3/hlssessions/list (the `HlssessionsList` operationId). + HlssessionsList(ctx context.Context, params *HlssessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // Info returns informations about the instance. + // + // Corresponds with GET /v3/info (the `Info` operationId). + Info(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) + + // MoqSessionsGet returns a MoQ session. + // + // Corresponds with GET /v3/moqsessions/get/{id} (the `MoqSessionsGet` operationId). + MoqSessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // MoqSessionsKick kicks out a MoQ session from the server. + // + // Corresponds with POST /v3/moqsessions/kick/{id} (the `MoqSessionsKick` operationId). + MoqSessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // MoqSessionsList returns all MoQ sessions. + // + // Corresponds with GET /v3/moqsessions/list (the `MoqSessionsList` operationId). + MoqSessionsList(ctx context.Context, params *MoqSessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PathsGet returns a path. + // + // Corresponds with GET /v3/paths/get/{name} (the `PathsGet` operationId). + PathsGet(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // PathsList returns all paths. + // + // Corresponds with GET /v3/paths/list (the `PathsList` operationId). + PathsList(ctx context.Context, params *PathsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RecordingsDeleteSegment deletes a recording segment. + // + // Corresponds with DELETE /v3/recordings/deletesegment (the `RecordingsDeleteSegment` operationId). + RecordingsDeleteSegment(ctx context.Context, params *RecordingsDeleteSegmentParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RecordingsGet returns recordings of a path. + // + // Corresponds with GET /v3/recordings/get/{name} (the `RecordingsGet` operationId). + RecordingsGet(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RecordingsList returns all recordings, splitted by path. + // + // Corresponds with GET /v3/recordings/list (the `RecordingsList` operationId). + RecordingsList(ctx context.Context, params *RecordingsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtmpConnectionsGet returns a RTMP connection. + // + // Corresponds with GET /v3/rtmpconns/get/{id} (the `RtmpConnectionsGet` operationId). + RtmpConnectionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtmpConnsKick kicks out a RTMP connection from the server. + // + // Corresponds with POST /v3/rtmpconns/kick/{id} (the `RtmpConnsKick` operationId). + RtmpConnsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtmpConnsList returns all RTMP connections. + // + // Corresponds with GET /v3/rtmpconns/list (the `RtmpConnsList` operationId). + RtmpConnsList(ctx context.Context, params *RtmpConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtmpsConnectionsGet returns a RTMPS connection. + // + // Corresponds with GET /v3/rtmpsconns/get/{id} (the `RtmpsConnectionsGet` operationId). + RtmpsConnectionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtmpsConnsKick kicks out a RTMPS connection from the server. + // + // Corresponds with POST /v3/rtmpsconns/kick/{id} (the `RtmpsConnsKick` operationId). + RtmpsConnsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtmpsConnsList returns all RTMPS connections. + // + // Corresponds with GET /v3/rtmpsconns/list (the `RtmpsConnsList` operationId). + RtmpsConnsList(ctx context.Context, params *RtmpsConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspConnsGet returns a RTSP connection. + // + // Corresponds with GET /v3/rtspconns/get/{id} (the `RtspConnsGet` operationId). + RtspConnsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspConnsList returns all RTSP connections. + // + // Corresponds with GET /v3/rtspconns/list (the `RtspConnsList` operationId). + RtspConnsList(ctx context.Context, params *RtspConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspsConnsGet returns a RTSPS connection. + // + // Corresponds with GET /v3/rtspsconns/get/{id} (the `RtspsConnsGet` operationId). + RtspsConnsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspsConnsList returns all RTSPS connections. + // + // Corresponds with GET /v3/rtspsconns/list (the `RtspsConnsList` operationId). + RtspsConnsList(ctx context.Context, params *RtspsConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspSessionsGet returns a RTSP session. + // + // Corresponds with GET /v3/rtspsessions/get/{id} (the `RtspSessionsGet` operationId). + RtspSessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspSessionsKick kicks out a RTSP session from the server. + // + // Corresponds with POST /v3/rtspsessions/kick/{id} (the `RtspSessionsKick` operationId). + RtspSessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspSessionsList returns all RTSP sessions. + // + // Corresponds with GET /v3/rtspsessions/list (the `RtspSessionsList` operationId). + RtspSessionsList(ctx context.Context, params *RtspSessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspsSessionsGet returns a RTSPS session. + // + // Corresponds with GET /v3/rtspssessions/get/{id} (the `RtspsSessionsGet` operationId). + RtspsSessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspsSessionsKick kicks out a RTSPS session from the server. + // + // Corresponds with POST /v3/rtspssessions/kick/{id} (the `RtspsSessionsKick` operationId). + RtspsSessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // RtspsSessionsList returns all RTSPS sessions. + // + // Corresponds with GET /v3/rtspssessions/list (the `RtspsSessionsList` operationId). + RtspsSessionsList(ctx context.Context, params *RtspsSessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SrtConnsGet returns a SRT connection. + // + // Corresponds with GET /v3/srtconns/get/{id} (the `SrtConnsGet` operationId). + SrtConnsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SrtConnsKick kicks out a SRT connection from the server. + // + // Corresponds with POST /v3/srtconns/kick/{id} (the `SrtConnsKick` operationId). + SrtConnsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // SrtConnsList returns all SRT connections. + // + // Corresponds with GET /v3/srtconns/list (the `SrtConnsList` operationId). + SrtConnsList(ctx context.Context, params *SrtConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) + + // WebrtcSessionsGet returns a WebRTC session. + // + // Corresponds with GET /v3/webrtcsessions/get/{id} (the `WebrtcSessionsGet` operationId). + WebrtcSessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // WebrtcSessionsKick kicks out a WebRTC session from the server. + // + // Corresponds with POST /v3/webrtcsessions/kick/{id} (the `WebrtcSessionsKick` operationId). + WebrtcSessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) + + // WebrtcSessionsList returns all WebRTC sessions. + // + // Corresponds with GET /v3/webrtcsessions/list (the `WebrtcSessionsList` operationId). + WebrtcSessionsList(ctx context.Context, params *WebrtcSessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) +} + +// AuthJwksRefresh Manually refreshes the JWT JWKS. +// +// Corresponds with POST /v3/auth/jwks/refresh (the `AuthJwksRefresh` operationId). +func (c *Client) AuthJwksRefresh(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewAuthJwksRefreshRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigGlobalGet returns the global configuration. +// +// Corresponds with GET /v3/config/global/get (the `ConfigGlobalGet` operationId). +func (c *Client) ConfigGlobalGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigGlobalGetRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigGlobalSetWithBody patches the global configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v3/config/global/patch (the `ConfigGlobalSet` operationId). +func (c *Client) ConfigGlobalSetWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigGlobalSetRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigGlobalSet patches the global configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v3/config/global/patch (the `ConfigGlobalSet` operationId). +func (c *Client) ConfigGlobalSet(ctx context.Context, body ConfigGlobalSetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigGlobalSetRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathDefaultsGet returns the default path configuration. +// +// Corresponds with GET /v3/config/pathdefaults/get (the `ConfigPathDefaultsGet` operationId). +func (c *Client) ConfigPathDefaultsGet(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathDefaultsGetRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathDefaultsPatchWithBody patches the default path configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v3/config/pathdefaults/patch (the `ConfigPathDefaultsPatch` operationId). +func (c *Client) ConfigPathDefaultsPatchWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathDefaultsPatchRequestWithBody(c.Server, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathDefaultsPatch patches the default path configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v3/config/pathdefaults/patch (the `ConfigPathDefaultsPatch` operationId). +func (c *Client) ConfigPathDefaultsPatch(ctx context.Context, body ConfigPathDefaultsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathDefaultsPatchRequest(c.Server, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathsAddWithBody adds a path configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v3/config/paths/add/{name} (the `ConfigPathsAdd` operationId). +func (c *Client) ConfigPathsAddWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathsAddRequestWithBody(c.Server, name, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathsAdd adds a path configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v3/config/paths/add/{name} (the `ConfigPathsAdd` operationId). +func (c *Client) ConfigPathsAdd(ctx context.Context, name string, body ConfigPathsAddJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathsAddRequest(c.Server, name, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathsDelete removes a path configuration. +// +// Corresponds with DELETE /v3/config/paths/delete/{name} (the `ConfigPathsDelete` operationId). +func (c *Client) ConfigPathsDelete(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathsDeleteRequest(c.Server, name) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathsGet returns a path configuration. +// +// Corresponds with GET /v3/config/paths/get/{name} (the `ConfigPathsGet` operationId). +func (c *Client) ConfigPathsGet(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathsGetRequest(c.Server, name) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathsList returns all path configurations. +// +// Corresponds with GET /v3/config/paths/list (the `ConfigPathsList` operationId). +func (c *Client) ConfigPathsList(ctx context.Context, params *ConfigPathsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathsPatchWithBody patches a path configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type. +// +// Corresponds with PATCH /v3/config/paths/patch/{name} (the `ConfigPathsPatch` operationId). +func (c *Client) ConfigPathsPatchWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathsPatchRequestWithBody(c.Server, name, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathsPatch patches a path configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with PATCH /v3/config/paths/patch/{name} (the `ConfigPathsPatch` operationId). +func (c *Client) ConfigPathsPatch(ctx context.Context, name string, body ConfigPathsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathsPatchRequest(c.Server, name, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathsReplaceWithBody replaces all values of a path configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type. +// +// Corresponds with POST /v3/config/paths/replace/{name} (the `ConfigPathsReplace` operationId). +func (c *Client) ConfigPathsReplaceWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathsReplaceRequestWithBody(c.Server, name, contentType, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// ConfigPathsReplace replaces all values of a path configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type. +// +// Corresponds with POST /v3/config/paths/replace/{name} (the `ConfigPathsReplace` operationId). +func (c *Client) ConfigPathsReplace(ctx context.Context, name string, body ConfigPathsReplaceJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewConfigPathsReplaceRequest(c.Server, name, body) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// HlsMuxersGet returns a HLS muxer. +// +// Corresponds with GET /v3/hlsmuxers/get/{name} (the `HlsMuxersGet` operationId). +func (c *Client) HlsMuxersGet(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHlsMuxersGetRequest(c.Server, name) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// HlsMuxersList returns all HLS muxers. +// +// Corresponds with GET /v3/hlsmuxers/list (the `HlsMuxersList` operationId). +func (c *Client) HlsMuxersList(ctx context.Context, params *HlsMuxersListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHlsMuxersListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// HlssessionsGet returns a HLS session. +// +// Corresponds with GET /v3/hlssessions/get/{id} (the `HlssessionsGet` operationId). +func (c *Client) HlssessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHlssessionsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// HlssessionsKick kicks out a HLS session from the server. +// +// Corresponds with POST /v3/hlssessions/kick/{id} (the `HlssessionsKick` operationId). +func (c *Client) HlssessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHlssessionsKickRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// HlssessionsList returns all HLS sessions. +// +// Corresponds with GET /v3/hlssessions/list (the `HlssessionsList` operationId). +func (c *Client) HlssessionsList(ctx context.Context, params *HlssessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewHlssessionsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// Info returns informations about the instance. +// +// Corresponds with GET /v3/info (the `Info` operationId). +func (c *Client) Info(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewInfoRequest(c.Server) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// MoqSessionsGet returns a MoQ session. +// +// Corresponds with GET /v3/moqsessions/get/{id} (the `MoqSessionsGet` operationId). +func (c *Client) MoqSessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewMoqSessionsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// MoqSessionsKick kicks out a MoQ session from the server. +// +// Corresponds with POST /v3/moqsessions/kick/{id} (the `MoqSessionsKick` operationId). +func (c *Client) MoqSessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewMoqSessionsKickRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// MoqSessionsList returns all MoQ sessions. +// +// Corresponds with GET /v3/moqsessions/list (the `MoqSessionsList` operationId). +func (c *Client) MoqSessionsList(ctx context.Context, params *MoqSessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewMoqSessionsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PathsGet returns a path. +// +// Corresponds with GET /v3/paths/get/{name} (the `PathsGet` operationId). +func (c *Client) PathsGet(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPathsGetRequest(c.Server, name) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// PathsList returns all paths. +// +// Corresponds with GET /v3/paths/list (the `PathsList` operationId). +func (c *Client) PathsList(ctx context.Context, params *PathsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewPathsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RecordingsDeleteSegment deletes a recording segment. +// +// Corresponds with DELETE /v3/recordings/deletesegment (the `RecordingsDeleteSegment` operationId). +func (c *Client) RecordingsDeleteSegment(ctx context.Context, params *RecordingsDeleteSegmentParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRecordingsDeleteSegmentRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RecordingsGet returns recordings of a path. +// +// Corresponds with GET /v3/recordings/get/{name} (the `RecordingsGet` operationId). +func (c *Client) RecordingsGet(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRecordingsGetRequest(c.Server, name) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RecordingsList returns all recordings, splitted by path. +// +// Corresponds with GET /v3/recordings/list (the `RecordingsList` operationId). +func (c *Client) RecordingsList(ctx context.Context, params *RecordingsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRecordingsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtmpConnectionsGet returns a RTMP connection. +// +// Corresponds with GET /v3/rtmpconns/get/{id} (the `RtmpConnectionsGet` operationId). +func (c *Client) RtmpConnectionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtmpConnectionsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtmpConnsKick kicks out a RTMP connection from the server. +// +// Corresponds with POST /v3/rtmpconns/kick/{id} (the `RtmpConnsKick` operationId). +func (c *Client) RtmpConnsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtmpConnsKickRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtmpConnsList returns all RTMP connections. +// +// Corresponds with GET /v3/rtmpconns/list (the `RtmpConnsList` operationId). +func (c *Client) RtmpConnsList(ctx context.Context, params *RtmpConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtmpConnsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtmpsConnectionsGet returns a RTMPS connection. +// +// Corresponds with GET /v3/rtmpsconns/get/{id} (the `RtmpsConnectionsGet` operationId). +func (c *Client) RtmpsConnectionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtmpsConnectionsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtmpsConnsKick kicks out a RTMPS connection from the server. +// +// Corresponds with POST /v3/rtmpsconns/kick/{id} (the `RtmpsConnsKick` operationId). +func (c *Client) RtmpsConnsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtmpsConnsKickRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtmpsConnsList returns all RTMPS connections. +// +// Corresponds with GET /v3/rtmpsconns/list (the `RtmpsConnsList` operationId). +func (c *Client) RtmpsConnsList(ctx context.Context, params *RtmpsConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtmpsConnsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspConnsGet returns a RTSP connection. +// +// Corresponds with GET /v3/rtspconns/get/{id} (the `RtspConnsGet` operationId). +func (c *Client) RtspConnsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspConnsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspConnsList returns all RTSP connections. +// +// Corresponds with GET /v3/rtspconns/list (the `RtspConnsList` operationId). +func (c *Client) RtspConnsList(ctx context.Context, params *RtspConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspConnsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspsConnsGet returns a RTSPS connection. +// +// Corresponds with GET /v3/rtspsconns/get/{id} (the `RtspsConnsGet` operationId). +func (c *Client) RtspsConnsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspsConnsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspsConnsList returns all RTSPS connections. +// +// Corresponds with GET /v3/rtspsconns/list (the `RtspsConnsList` operationId). +func (c *Client) RtspsConnsList(ctx context.Context, params *RtspsConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspsConnsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspSessionsGet returns a RTSP session. +// +// Corresponds with GET /v3/rtspsessions/get/{id} (the `RtspSessionsGet` operationId). +func (c *Client) RtspSessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspSessionsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspSessionsKick kicks out a RTSP session from the server. +// +// Corresponds with POST /v3/rtspsessions/kick/{id} (the `RtspSessionsKick` operationId). +func (c *Client) RtspSessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspSessionsKickRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspSessionsList returns all RTSP sessions. +// +// Corresponds with GET /v3/rtspsessions/list (the `RtspSessionsList` operationId). +func (c *Client) RtspSessionsList(ctx context.Context, params *RtspSessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspSessionsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspsSessionsGet returns a RTSPS session. +// +// Corresponds with GET /v3/rtspssessions/get/{id} (the `RtspsSessionsGet` operationId). +func (c *Client) RtspsSessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspsSessionsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspsSessionsKick kicks out a RTSPS session from the server. +// +// Corresponds with POST /v3/rtspssessions/kick/{id} (the `RtspsSessionsKick` operationId). +func (c *Client) RtspsSessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspsSessionsKickRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// RtspsSessionsList returns all RTSPS sessions. +// +// Corresponds with GET /v3/rtspssessions/list (the `RtspsSessionsList` operationId). +func (c *Client) RtspsSessionsList(ctx context.Context, params *RtspsSessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewRtspsSessionsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// SrtConnsGet returns a SRT connection. +// +// Corresponds with GET /v3/srtconns/get/{id} (the `SrtConnsGet` operationId). +func (c *Client) SrtConnsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSrtConnsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// SrtConnsKick kicks out a SRT connection from the server. +// +// Corresponds with POST /v3/srtconns/kick/{id} (the `SrtConnsKick` operationId). +func (c *Client) SrtConnsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSrtConnsKickRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// SrtConnsList returns all SRT connections. +// +// Corresponds with GET /v3/srtconns/list (the `SrtConnsList` operationId). +func (c *Client) SrtConnsList(ctx context.Context, params *SrtConnsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewSrtConnsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// WebrtcSessionsGet returns a WebRTC session. +// +// Corresponds with GET /v3/webrtcsessions/get/{id} (the `WebrtcSessionsGet` operationId). +func (c *Client) WebrtcSessionsGet(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWebrtcSessionsGetRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// WebrtcSessionsKick kicks out a WebRTC session from the server. +// +// Corresponds with POST /v3/webrtcsessions/kick/{id} (the `WebrtcSessionsKick` operationId). +func (c *Client) WebrtcSessionsKick(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWebrtcSessionsKickRequest(c.Server, id) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// WebrtcSessionsList returns all WebRTC sessions. +// +// Corresponds with GET /v3/webrtcsessions/list (the `WebrtcSessionsList` operationId). +func (c *Client) WebrtcSessionsList(ctx context.Context, params *WebrtcSessionsListParams, reqEditors ...RequestEditorFn) (*http.Response, error) { + req, err := NewWebrtcSessionsListRequest(c.Server, params) + if err != nil { + return nil, err + } + req = req.WithContext(ctx) + if err := c.applyEditors(ctx, req, reqEditors); err != nil { + return nil, err + } + return c.Client.Do(req) +} + +// NewAuthJwksRefreshRequest constructs an http.Request for the AuthJwksRefresh method +func NewAuthJwksRefreshRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/auth/jwks/refresh") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewConfigGlobalGetRequest constructs an http.Request for the ConfigGlobalGet method +func NewConfigGlobalGetRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/global/get") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewConfigGlobalSetRequest calls the generic ConfigGlobalSet builder with application/json body +func NewConfigGlobalSetRequest(server string, body ConfigGlobalSetJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewConfigGlobalSetRequestWithBody(server, "application/json", bodyReader) +} + +// NewConfigGlobalSetRequestWithBody constructs an http.Request for the ConfigGlobalSet method, with any body, and a specified content type +func NewConfigGlobalSetRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/global/patch") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewConfigPathDefaultsGetRequest constructs an http.Request for the ConfigPathDefaultsGet method +func NewConfigPathDefaultsGetRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/pathdefaults/get") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewConfigPathDefaultsPatchRequest calls the generic ConfigPathDefaultsPatch builder with application/json body +func NewConfigPathDefaultsPatchRequest(server string, body ConfigPathDefaultsPatchJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewConfigPathDefaultsPatchRequestWithBody(server, "application/json", bodyReader) +} + +// NewConfigPathDefaultsPatchRequestWithBody constructs an http.Request for the ConfigPathDefaultsPatch method, with any body, and a specified content type +func NewConfigPathDefaultsPatchRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/pathdefaults/patch") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewConfigPathsAddRequest calls the generic ConfigPathsAdd builder with application/json body +func NewConfigPathsAddRequest(server string, name string, body ConfigPathsAddJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewConfigPathsAddRequestWithBody(server, name, "application/json", bodyReader) +} + +// NewConfigPathsAddRequestWithBody constructs an http.Request for the ConfigPathsAdd method, with any body, and a specified content type +func NewConfigPathsAddRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/paths/add/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewConfigPathsDeleteRequest constructs an http.Request for the ConfigPathsDelete method +func NewConfigPathsDeleteRequest(server string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/paths/delete/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewConfigPathsGetRequest constructs an http.Request for the ConfigPathsGet method +func NewConfigPathsGetRequest(server string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/paths/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewConfigPathsListRequest constructs an http.Request for the ConfigPathsList method +func NewConfigPathsListRequest(server string, params *ConfigPathsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/paths/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewConfigPathsPatchRequest calls the generic ConfigPathsPatch builder with application/json body +func NewConfigPathsPatchRequest(server string, name string, body ConfigPathsPatchJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewConfigPathsPatchRequestWithBody(server, name, "application/json", bodyReader) +} + +// NewConfigPathsPatchRequestWithBody constructs an http.Request for the ConfigPathsPatch method, with any body, and a specified content type +func NewConfigPathsPatchRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/paths/patch/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPatch, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewConfigPathsReplaceRequest calls the generic ConfigPathsReplace builder with application/json body +func NewConfigPathsReplaceRequest(server string, name string, body ConfigPathsReplaceJSONRequestBody) (*http.Request, error) { + var bodyReader io.Reader + buf, err := json.Marshal(body) + if err != nil { + return nil, err + } + bodyReader = bytes.NewReader(buf) + return NewConfigPathsReplaceRequestWithBody(server, name, "application/json", bodyReader) +} + +// NewConfigPathsReplaceRequestWithBody constructs an http.Request for the ConfigPathsReplace method, with any body, and a specified content type +func NewConfigPathsReplaceRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/config/paths/replace/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), body) + if err != nil { + return nil, err + } + + req.Header.Add("Content-Type", contentType) + + return req, nil +} + +// NewHlsMuxersGetRequest constructs an http.Request for the HlsMuxersGet method +func NewHlsMuxersGetRequest(server string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/hlsmuxers/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewHlsMuxersListRequest constructs an http.Request for the HlsMuxersList method +func NewHlsMuxersListRequest(server string, params *HlsMuxersListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/hlsmuxers/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewHlssessionsGetRequest constructs an http.Request for the HlssessionsGet method +func NewHlssessionsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/hlssessions/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewHlssessionsKickRequest constructs an http.Request for the HlssessionsKick method +func NewHlssessionsKickRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/hlssessions/kick/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewHlssessionsListRequest constructs an http.Request for the HlssessionsList method +func NewHlssessionsListRequest(server string, params *HlssessionsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/hlssessions/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewInfoRequest constructs an http.Request for the Info method +func NewInfoRequest(server string) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/info") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewMoqSessionsGetRequest constructs an http.Request for the MoqSessionsGet method +func NewMoqSessionsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/moqsessions/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewMoqSessionsKickRequest constructs an http.Request for the MoqSessionsKick method +func NewMoqSessionsKickRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/moqsessions/kick/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewMoqSessionsListRequest constructs an http.Request for the MoqSessionsList method +func NewMoqSessionsListRequest(server string, params *MoqSessionsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/moqsessions/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPathsGetRequest constructs an http.Request for the PathsGet method +func NewPathsGetRequest(server string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/paths/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewPathsListRequest constructs an http.Request for the PathsList method +func NewPathsListRequest(server string, params *PathsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/paths/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRecordingsDeleteSegmentRequest constructs an http.Request for the RecordingsDeleteSegment method +func NewRecordingsDeleteSegmentRequest(server string, params *RecordingsDeleteSegmentParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/recordings/deletesegment") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "path", params.Path, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "start", params.Start, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "string", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodDelete, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRecordingsGetRequest constructs an http.Request for the RecordingsGet method +func NewRecordingsGetRequest(server string, name string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "name", name, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/recordings/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRecordingsListRequest constructs an http.Request for the RecordingsList method +func NewRecordingsListRequest(server string, params *RecordingsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/recordings/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtmpConnectionsGetRequest constructs an http.Request for the RtmpConnectionsGet method +func NewRtmpConnectionsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtmpconns/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtmpConnsKickRequest constructs an http.Request for the RtmpConnsKick method +func NewRtmpConnsKickRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtmpconns/kick/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtmpConnsListRequest constructs an http.Request for the RtmpConnsList method +func NewRtmpConnsListRequest(server string, params *RtmpConnsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtmpconns/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtmpsConnectionsGetRequest constructs an http.Request for the RtmpsConnectionsGet method +func NewRtmpsConnectionsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtmpsconns/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtmpsConnsKickRequest constructs an http.Request for the RtmpsConnsKick method +func NewRtmpsConnsKickRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtmpsconns/kick/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtmpsConnsListRequest constructs an http.Request for the RtmpsConnsList method +func NewRtmpsConnsListRequest(server string, params *RtmpsConnsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtmpsconns/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspConnsGetRequest constructs an http.Request for the RtspConnsGet method +func NewRtspConnsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspconns/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspConnsListRequest constructs an http.Request for the RtspConnsList method +func NewRtspConnsListRequest(server string, params *RtspConnsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspconns/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspsConnsGetRequest constructs an http.Request for the RtspsConnsGet method +func NewRtspsConnsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspsconns/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspsConnsListRequest constructs an http.Request for the RtspsConnsList method +func NewRtspsConnsListRequest(server string, params *RtspsConnsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspsconns/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspSessionsGetRequest constructs an http.Request for the RtspSessionsGet method +func NewRtspSessionsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspsessions/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspSessionsKickRequest constructs an http.Request for the RtspSessionsKick method +func NewRtspSessionsKickRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspsessions/kick/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspSessionsListRequest constructs an http.Request for the RtspSessionsList method +func NewRtspSessionsListRequest(server string, params *RtspSessionsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspsessions/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspsSessionsGetRequest constructs an http.Request for the RtspsSessionsGet method +func NewRtspsSessionsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspssessions/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspsSessionsKickRequest constructs an http.Request for the RtspsSessionsKick method +func NewRtspsSessionsKickRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspssessions/kick/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewRtspsSessionsListRequest constructs an http.Request for the RtspsSessionsList method +func NewRtspsSessionsListRequest(server string, params *RtspsSessionsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/rtspssessions/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewSrtConnsGetRequest constructs an http.Request for the SrtConnsGet method +func NewSrtConnsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/srtconns/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewSrtConnsKickRequest constructs an http.Request for the SrtConnsKick method +func NewSrtConnsKickRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/srtconns/kick/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewSrtConnsListRequest constructs an http.Request for the SrtConnsList method +func NewSrtConnsListRequest(server string, params *SrtConnsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/srtconns/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewWebrtcSessionsGetRequest constructs an http.Request for the WebrtcSessionsGet method +func NewWebrtcSessionsGetRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/webrtcsessions/get/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewWebrtcSessionsKickRequest constructs an http.Request for the WebrtcSessionsKick method +func NewWebrtcSessionsKickRequest(server string, id string) (*http.Request, error) { + var err error + + var pathParam0 string + + pathParam0, err = runtime.StyleParamWithOptions("simple", false, "id", id, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationPath, Type: "string", Format: ""}) + if err != nil { + return nil, err + } + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/webrtcsessions/kick/%s", pathParam0) + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + req, err := http.NewRequest(http.MethodPost, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +// NewWebrtcSessionsListRequest constructs an http.Request for the WebrtcSessionsList method +func NewWebrtcSessionsListRequest(server string, params *WebrtcSessionsListParams) (*http.Request, error) { + var err error + + serverURL, err := url.Parse(server) + if err != nil { + return nil, err + } + + operationPath := fmt.Sprintf("/v3/webrtcsessions/list") + if operationPath[0] == '/' { + operationPath = "." + operationPath + } + + queryURL, err := serverURL.Parse(operationPath) + if err != nil { + return nil, err + } + + if params != nil { + // queryValues collects non-styled parameters (passthrough, JSON) + // that are safe to round-trip through url.Values.Encode(). + queryValues := queryURL.Query() + // rawQueryFragments collects pre-encoded query fragments from + // styled parameters, preserving literal commas as delimiters + // per the OpenAPI spec (e.g. "color=blue,black,brown"). + var rawQueryFragments []string + + if params.Page != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "page", *params.Page, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if params.ItemsPerPage != nil { + + if queryFrag, err := runtime.StyleParamWithOptions("form", true, "itemsPerPage", *params.ItemsPerPage, runtime.StyleParamOptions{ParamLocation: runtime.ParamLocationQuery, Type: "integer", Format: ""}); err != nil { + return nil, err + } else { + for _, qp := range strings.Split(queryFrag, "&") { + rawQueryFragments = append(rawQueryFragments, qp) + } + } + + } + + if encoded := queryValues.Encode(); encoded != "" { + rawQueryFragments = append(rawQueryFragments, encoded) + } + queryURL.RawQuery = strings.Join(rawQueryFragments, "&") + } + + req, err := http.NewRequest(http.MethodGet, queryURL.String(), nil) + if err != nil { + return nil, err + } + + return req, nil +} + +func (c *Client) applyEditors(ctx context.Context, req *http.Request, additionalEditors []RequestEditorFn) error { + for _, r := range c.RequestEditors { + if err := r(ctx, req); err != nil { + return err + } + } + for _, r := range additionalEditors { + if err := r(ctx, req); err != nil { + return err + } + } + return nil +} + +// ClientWithResponses builds on ClientInterface to offer response payloads +type ClientWithResponses struct { + ClientInterface +} + +// NewClientWithResponses creates a new ClientWithResponses, which wraps +// Client with return type handling +func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error) { + client, err := NewClient(server, opts...) + if err != nil { + return nil, err + } + return &ClientWithResponses{client}, nil +} + +// WithBaseURL overrides the baseURL. +func WithBaseURL(baseURL string) ClientOption { + return func(c *Client) error { + newBaseURL, err := url.Parse(baseURL) + if err != nil { + return err + } + c.Server = newBaseURL.String() + return nil + } +} + +// ClientWithResponsesInterface is the interface specification for the client with responses above. +type ClientWithResponsesInterface interface { + + // AuthJwksRefreshWithResponse Manually refreshes the JWT JWKS. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/auth/jwks/refresh (the `AuthJwksRefresh` operationId). + AuthJwksRefreshWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AuthJwksRefreshResponse, error) + + // ConfigGlobalGetWithResponse returns the global configuration. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/config/global/get (the `ConfigGlobalGet` operationId). + ConfigGlobalGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConfigGlobalGetResponse, error) + + // ConfigGlobalSetWithBodyWithResponse patches the global configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v3/config/global/patch (the `ConfigGlobalSet` operationId). + ConfigGlobalSetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigGlobalSetResponse, error) + + // ConfigGlobalSetWithResponse patches the global configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v3/config/global/patch (the `ConfigGlobalSet` operationId). + ConfigGlobalSetWithResponse(ctx context.Context, body ConfigGlobalSetJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigGlobalSetResponse, error) + + // ConfigPathDefaultsGetWithResponse returns the default path configuration. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/config/pathdefaults/get (the `ConfigPathDefaultsGet` operationId). + ConfigPathDefaultsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConfigPathDefaultsGetResponse, error) + + // ConfigPathDefaultsPatchWithBodyWithResponse patches the default path configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v3/config/pathdefaults/patch (the `ConfigPathDefaultsPatch` operationId). + ConfigPathDefaultsPatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigPathDefaultsPatchResponse, error) + + // ConfigPathDefaultsPatchWithResponse patches the default path configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v3/config/pathdefaults/patch (the `ConfigPathDefaultsPatch` operationId). + ConfigPathDefaultsPatchWithResponse(ctx context.Context, body ConfigPathDefaultsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigPathDefaultsPatchResponse, error) + + // ConfigPathsAddWithBodyWithResponse adds a path configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/config/paths/add/{name} (the `ConfigPathsAdd` operationId). + ConfigPathsAddWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigPathsAddResponse, error) + + // ConfigPathsAddWithResponse adds a path configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/config/paths/add/{name} (the `ConfigPathsAdd` operationId). + ConfigPathsAddWithResponse(ctx context.Context, name string, body ConfigPathsAddJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigPathsAddResponse, error) + + // ConfigPathsDeleteWithResponse removes a path configuration. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v3/config/paths/delete/{name} (the `ConfigPathsDelete` operationId). + ConfigPathsDeleteWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ConfigPathsDeleteResponse, error) + + // ConfigPathsGetWithResponse returns a path configuration. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/config/paths/get/{name} (the `ConfigPathsGet` operationId). + ConfigPathsGetWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ConfigPathsGetResponse, error) + + // ConfigPathsListWithResponse returns all path configurations. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/config/paths/list (the `ConfigPathsList` operationId). + ConfigPathsListWithResponse(ctx context.Context, params *ConfigPathsListParams, reqEditors ...RequestEditorFn) (*ConfigPathsListResponse, error) + + // ConfigPathsPatchWithBodyWithResponse patches a path configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v3/config/paths/patch/{name} (the `ConfigPathsPatch` operationId). + ConfigPathsPatchWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigPathsPatchResponse, error) + + // ConfigPathsPatchWithResponse patches a path configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with PATCH /v3/config/paths/patch/{name} (the `ConfigPathsPatch` operationId). + ConfigPathsPatchWithResponse(ctx context.Context, name string, body ConfigPathsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigPathsPatchResponse, error) + + // ConfigPathsReplaceWithBodyWithResponse replaces all values of a path configuration. + // + // all fields are optional. + // + // Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/config/paths/replace/{name} (the `ConfigPathsReplace` operationId). + ConfigPathsReplaceWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigPathsReplaceResponse, error) + + // ConfigPathsReplaceWithResponse replaces all values of a path configuration. + // + // all fields are optional. + // + // Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/config/paths/replace/{name} (the `ConfigPathsReplace` operationId). + ConfigPathsReplaceWithResponse(ctx context.Context, name string, body ConfigPathsReplaceJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigPathsReplaceResponse, error) + + // HlsMuxersGetWithResponse returns a HLS muxer. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/hlsmuxers/get/{name} (the `HlsMuxersGet` operationId). + HlsMuxersGetWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*HlsMuxersGetResponse, error) + + // HlsMuxersListWithResponse returns all HLS muxers. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/hlsmuxers/list (the `HlsMuxersList` operationId). + HlsMuxersListWithResponse(ctx context.Context, params *HlsMuxersListParams, reqEditors ...RequestEditorFn) (*HlsMuxersListResponse, error) + + // HlssessionsGetWithResponse returns a HLS session. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/hlssessions/get/{id} (the `HlssessionsGet` operationId). + HlssessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*HlssessionsGetResponse, error) + + // HlssessionsKickWithResponse kicks out a HLS session from the server. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/hlssessions/kick/{id} (the `HlssessionsKick` operationId). + HlssessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*HlssessionsKickResponse, error) + + // HlssessionsListWithResponse returns all HLS sessions. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/hlssessions/list (the `HlssessionsList` operationId). + HlssessionsListWithResponse(ctx context.Context, params *HlssessionsListParams, reqEditors ...RequestEditorFn) (*HlssessionsListResponse, error) + + // InfoWithResponse returns informations about the instance. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/info (the `Info` operationId). + InfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InfoResponse, error) + + // MoqSessionsGetWithResponse returns a MoQ session. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/moqsessions/get/{id} (the `MoqSessionsGet` operationId). + MoqSessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*MoqSessionsGetResponse, error) + + // MoqSessionsKickWithResponse kicks out a MoQ session from the server. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/moqsessions/kick/{id} (the `MoqSessionsKick` operationId). + MoqSessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*MoqSessionsKickResponse, error) + + // MoqSessionsListWithResponse returns all MoQ sessions. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/moqsessions/list (the `MoqSessionsList` operationId). + MoqSessionsListWithResponse(ctx context.Context, params *MoqSessionsListParams, reqEditors ...RequestEditorFn) (*MoqSessionsListResponse, error) + + // PathsGetWithResponse returns a path. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/paths/get/{name} (the `PathsGet` operationId). + PathsGetWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*PathsGetResponse, error) + + // PathsListWithResponse returns all paths. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/paths/list (the `PathsList` operationId). + PathsListWithResponse(ctx context.Context, params *PathsListParams, reqEditors ...RequestEditorFn) (*PathsListResponse, error) + + // RecordingsDeleteSegmentWithResponse deletes a recording segment. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with DELETE /v3/recordings/deletesegment (the `RecordingsDeleteSegment` operationId). + RecordingsDeleteSegmentWithResponse(ctx context.Context, params *RecordingsDeleteSegmentParams, reqEditors ...RequestEditorFn) (*RecordingsDeleteSegmentResponse, error) + + // RecordingsGetWithResponse returns recordings of a path. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/recordings/get/{name} (the `RecordingsGet` operationId). + RecordingsGetWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RecordingsGetResponse, error) + + // RecordingsListWithResponse returns all recordings, splitted by path. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/recordings/list (the `RecordingsList` operationId). + RecordingsListWithResponse(ctx context.Context, params *RecordingsListParams, reqEditors ...RequestEditorFn) (*RecordingsListResponse, error) + + // RtmpConnectionsGetWithResponse returns a RTMP connection. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtmpconns/get/{id} (the `RtmpConnectionsGet` operationId). + RtmpConnectionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtmpConnectionsGetResponse, error) + + // RtmpConnsKickWithResponse kicks out a RTMP connection from the server. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/rtmpconns/kick/{id} (the `RtmpConnsKick` operationId). + RtmpConnsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtmpConnsKickResponse, error) + + // RtmpConnsListWithResponse returns all RTMP connections. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtmpconns/list (the `RtmpConnsList` operationId). + RtmpConnsListWithResponse(ctx context.Context, params *RtmpConnsListParams, reqEditors ...RequestEditorFn) (*RtmpConnsListResponse, error) + + // RtmpsConnectionsGetWithResponse returns a RTMPS connection. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtmpsconns/get/{id} (the `RtmpsConnectionsGet` operationId). + RtmpsConnectionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtmpsConnectionsGetResponse, error) + + // RtmpsConnsKickWithResponse kicks out a RTMPS connection from the server. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/rtmpsconns/kick/{id} (the `RtmpsConnsKick` operationId). + RtmpsConnsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtmpsConnsKickResponse, error) + + // RtmpsConnsListWithResponse returns all RTMPS connections. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtmpsconns/list (the `RtmpsConnsList` operationId). + RtmpsConnsListWithResponse(ctx context.Context, params *RtmpsConnsListParams, reqEditors ...RequestEditorFn) (*RtmpsConnsListResponse, error) + + // RtspConnsGetWithResponse returns a RTSP connection. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtspconns/get/{id} (the `RtspConnsGet` operationId). + RtspConnsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspConnsGetResponse, error) + + // RtspConnsListWithResponse returns all RTSP connections. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtspconns/list (the `RtspConnsList` operationId). + RtspConnsListWithResponse(ctx context.Context, params *RtspConnsListParams, reqEditors ...RequestEditorFn) (*RtspConnsListResponse, error) + + // RtspsConnsGetWithResponse returns a RTSPS connection. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtspsconns/get/{id} (the `RtspsConnsGet` operationId). + RtspsConnsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspsConnsGetResponse, error) + + // RtspsConnsListWithResponse returns all RTSPS connections. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtspsconns/list (the `RtspsConnsList` operationId). + RtspsConnsListWithResponse(ctx context.Context, params *RtspsConnsListParams, reqEditors ...RequestEditorFn) (*RtspsConnsListResponse, error) + + // RtspSessionsGetWithResponse returns a RTSP session. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtspsessions/get/{id} (the `RtspSessionsGet` operationId). + RtspSessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspSessionsGetResponse, error) + + // RtspSessionsKickWithResponse kicks out a RTSP session from the server. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/rtspsessions/kick/{id} (the `RtspSessionsKick` operationId). + RtspSessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspSessionsKickResponse, error) + + // RtspSessionsListWithResponse returns all RTSP sessions. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtspsessions/list (the `RtspSessionsList` operationId). + RtspSessionsListWithResponse(ctx context.Context, params *RtspSessionsListParams, reqEditors ...RequestEditorFn) (*RtspSessionsListResponse, error) + + // RtspsSessionsGetWithResponse returns a RTSPS session. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtspssessions/get/{id} (the `RtspsSessionsGet` operationId). + RtspsSessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspsSessionsGetResponse, error) + + // RtspsSessionsKickWithResponse kicks out a RTSPS session from the server. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/rtspssessions/kick/{id} (the `RtspsSessionsKick` operationId). + RtspsSessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspsSessionsKickResponse, error) + + // RtspsSessionsListWithResponse returns all RTSPS sessions. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/rtspssessions/list (the `RtspsSessionsList` operationId). + RtspsSessionsListWithResponse(ctx context.Context, params *RtspsSessionsListParams, reqEditors ...RequestEditorFn) (*RtspsSessionsListResponse, error) + + // SrtConnsGetWithResponse returns a SRT connection. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/srtconns/get/{id} (the `SrtConnsGet` operationId). + SrtConnsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*SrtConnsGetResponse, error) + + // SrtConnsKickWithResponse kicks out a SRT connection from the server. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/srtconns/kick/{id} (the `SrtConnsKick` operationId). + SrtConnsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*SrtConnsKickResponse, error) + + // SrtConnsListWithResponse returns all SRT connections. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/srtconns/list (the `SrtConnsList` operationId). + SrtConnsListWithResponse(ctx context.Context, params *SrtConnsListParams, reqEditors ...RequestEditorFn) (*SrtConnsListResponse, error) + + // WebrtcSessionsGetWithResponse returns a WebRTC session. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/webrtcsessions/get/{id} (the `WebrtcSessionsGet` operationId). + WebrtcSessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*WebrtcSessionsGetResponse, error) + + // WebrtcSessionsKickWithResponse kicks out a WebRTC session from the server. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with POST /v3/webrtcsessions/kick/{id} (the `WebrtcSessionsKick` operationId). + WebrtcSessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*WebrtcSessionsKickResponse, error) + + // WebrtcSessionsListWithResponse returns all WebRTC sessions. + // + // Returns a wrapper object for the known response body format(s). + // + // Corresponds with GET /v3/webrtcsessions/list (the `WebrtcSessionsList` operationId). + WebrtcSessionsListWithResponse(ctx context.Context, params *WebrtcSessionsListParams, reqEditors ...RequestEditorFn) (*WebrtcSessionsListResponse, error) +} + +type AuthJwksRefreshResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r AuthJwksRefreshResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r AuthJwksRefreshResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r AuthJwksRefreshResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r AuthJwksRefreshResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r AuthJwksRefreshResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r AuthJwksRefreshResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigGlobalGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *GlobalConf + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigGlobalGetResponse) GetJSON200() *GlobalConf { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigGlobalGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigGlobalGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigGlobalGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigGlobalGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigGlobalGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigGlobalGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigGlobalSetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigGlobalSetResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigGlobalSetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigGlobalSetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigGlobalSetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigGlobalSetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigGlobalSetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigGlobalSetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigPathDefaultsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *PathConf + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigPathDefaultsGetResponse) GetJSON200() *PathConf { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigPathDefaultsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigPathDefaultsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigPathDefaultsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigPathDefaultsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigPathDefaultsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigPathDefaultsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigPathDefaultsPatchResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigPathDefaultsPatchResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigPathDefaultsPatchResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigPathDefaultsPatchResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigPathDefaultsPatchResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigPathDefaultsPatchResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigPathDefaultsPatchResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigPathDefaultsPatchResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigPathsAddResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigPathsAddResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigPathsAddResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigPathsAddResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigPathsAddResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigPathsAddResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigPathsAddResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigPathsAddResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigPathsDeleteResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigPathsDeleteResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigPathsDeleteResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r ConfigPathsDeleteResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigPathsDeleteResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigPathsDeleteResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigPathsDeleteResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigPathsDeleteResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigPathsDeleteResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigPathsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *PathConf + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigPathsGetResponse) GetJSON200() *PathConf { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigPathsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r ConfigPathsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigPathsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigPathsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigPathsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigPathsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigPathsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigPathsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *PathConfList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigPathsListResponse) GetJSON200() *PathConfList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigPathsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigPathsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigPathsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigPathsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigPathsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigPathsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigPathsPatchResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigPathsPatchResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigPathsPatchResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r ConfigPathsPatchResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigPathsPatchResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigPathsPatchResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigPathsPatchResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigPathsPatchResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigPathsPatchResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type ConfigPathsReplaceResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r ConfigPathsReplaceResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r ConfigPathsReplaceResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r ConfigPathsReplaceResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r ConfigPathsReplaceResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r ConfigPathsReplaceResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r ConfigPathsReplaceResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r ConfigPathsReplaceResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r ConfigPathsReplaceResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type HlsMuxersGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *HLSMuxer + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r HlsMuxersGetResponse) GetJSON200() *HLSMuxer { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r HlsMuxersGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r HlsMuxersGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r HlsMuxersGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r HlsMuxersGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r HlsMuxersGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r HlsMuxersGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r HlsMuxersGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type HlsMuxersListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *HLSMuxerList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r HlsMuxersListResponse) GetJSON200() *HLSMuxerList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r HlsMuxersListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r HlsMuxersListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r HlsMuxersListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r HlsMuxersListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r HlsMuxersListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r HlsMuxersListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type HlssessionsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *HLSSession + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r HlssessionsGetResponse) GetJSON200() *HLSSession { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r HlssessionsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r HlssessionsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r HlssessionsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r HlssessionsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r HlssessionsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r HlssessionsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r HlssessionsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type HlssessionsKickResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r HlssessionsKickResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r HlssessionsKickResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r HlssessionsKickResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r HlssessionsKickResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r HlssessionsKickResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r HlssessionsKickResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r HlssessionsKickResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r HlssessionsKickResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type HlssessionsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *HLSSessionList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r HlssessionsListResponse) GetJSON200() *HLSSessionList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r HlssessionsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r HlssessionsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r HlssessionsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r HlssessionsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r HlssessionsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r HlssessionsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type InfoResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *Info + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r InfoResponse) GetJSON200() *Info { + return r.JSON200 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r InfoResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r InfoResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r InfoResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r InfoResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r InfoResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type MoqSessionsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *MoQSession + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r MoqSessionsGetResponse) GetJSON200() *MoQSession { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r MoqSessionsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r MoqSessionsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r MoqSessionsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r MoqSessionsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r MoqSessionsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r MoqSessionsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r MoqSessionsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type MoqSessionsKickResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r MoqSessionsKickResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r MoqSessionsKickResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r MoqSessionsKickResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r MoqSessionsKickResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r MoqSessionsKickResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r MoqSessionsKickResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r MoqSessionsKickResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r MoqSessionsKickResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type MoqSessionsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *MoQSessionList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r MoqSessionsListResponse) GetJSON200() *MoQSessionList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r MoqSessionsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r MoqSessionsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r MoqSessionsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r MoqSessionsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r MoqSessionsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r MoqSessionsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PathsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *Path + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PathsGetResponse) GetJSON200() *Path { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r PathsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r PathsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r PathsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r PathsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PathsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PathsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PathsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type PathsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *PathList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r PathsListResponse) GetJSON200() *PathList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r PathsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r PathsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r PathsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r PathsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r PathsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r PathsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RecordingsDeleteSegmentResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RecordingsDeleteSegmentResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RecordingsDeleteSegmentResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RecordingsDeleteSegmentResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RecordingsDeleteSegmentResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RecordingsDeleteSegmentResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RecordingsDeleteSegmentResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RecordingsDeleteSegmentResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RecordingsDeleteSegmentResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RecordingsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *Recording + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RecordingsGetResponse) GetJSON200() *Recording { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RecordingsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RecordingsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RecordingsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RecordingsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RecordingsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RecordingsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RecordingsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RecordingsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RecordingList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RecordingsListResponse) GetJSON200() *RecordingList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RecordingsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RecordingsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RecordingsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RecordingsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RecordingsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RecordingsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtmpConnectionsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTMPConn + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtmpConnectionsGetResponse) GetJSON200() *RTMPConn { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtmpConnectionsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtmpConnectionsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtmpConnectionsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtmpConnectionsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtmpConnectionsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtmpConnectionsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtmpConnectionsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtmpConnsKickResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtmpConnsKickResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtmpConnsKickResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtmpConnsKickResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtmpConnsKickResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtmpConnsKickResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtmpConnsKickResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtmpConnsKickResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtmpConnsKickResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtmpConnsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTMPConnList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtmpConnsListResponse) GetJSON200() *RTMPConnList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtmpConnsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtmpConnsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtmpConnsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtmpConnsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtmpConnsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtmpConnsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtmpsConnectionsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTMPConn + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtmpsConnectionsGetResponse) GetJSON200() *RTMPConn { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtmpsConnectionsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtmpsConnectionsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtmpsConnectionsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtmpsConnectionsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtmpsConnectionsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtmpsConnectionsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtmpsConnectionsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtmpsConnsKickResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtmpsConnsKickResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtmpsConnsKickResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtmpsConnsKickResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtmpsConnsKickResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtmpsConnsKickResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtmpsConnsKickResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtmpsConnsKickResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtmpsConnsKickResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtmpsConnsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTMPConnList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtmpsConnsListResponse) GetJSON200() *RTMPConnList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtmpsConnsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtmpsConnsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtmpsConnsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtmpsConnsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtmpsConnsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtmpsConnsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspConnsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTSPConn + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspConnsGetResponse) GetJSON200() *RTSPConn { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspConnsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtspConnsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspConnsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspConnsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspConnsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspConnsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspConnsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspConnsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTSPConnList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspConnsListResponse) GetJSON200() *RTSPConnList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspConnsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspConnsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspConnsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspConnsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspConnsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspConnsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspsConnsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTSPConn + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspsConnsGetResponse) GetJSON200() *RTSPConn { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspsConnsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtspsConnsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspsConnsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspsConnsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspsConnsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspsConnsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspsConnsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspsConnsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTSPConnList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspsConnsListResponse) GetJSON200() *RTSPConnList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspsConnsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspsConnsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspsConnsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspsConnsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspsConnsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspsConnsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspSessionsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTSPSession + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspSessionsGetResponse) GetJSON200() *RTSPSession { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspSessionsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtspSessionsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspSessionsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspSessionsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspSessionsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspSessionsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspSessionsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspSessionsKickResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspSessionsKickResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspSessionsKickResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtspSessionsKickResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspSessionsKickResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspSessionsKickResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspSessionsKickResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspSessionsKickResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspSessionsKickResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspSessionsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTSPSessionList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspSessionsListResponse) GetJSON200() *RTSPSessionList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspSessionsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspSessionsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspSessionsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspSessionsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspSessionsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspSessionsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspsSessionsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTSPSession + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspsSessionsGetResponse) GetJSON200() *RTSPSession { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspsSessionsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtspsSessionsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspsSessionsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspsSessionsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspsSessionsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspsSessionsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspsSessionsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspsSessionsKickResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspsSessionsKickResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspsSessionsKickResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r RtspsSessionsKickResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspsSessionsKickResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspsSessionsKickResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspsSessionsKickResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspsSessionsKickResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspsSessionsKickResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type RtspsSessionsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *RTSPSessionList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r RtspsSessionsListResponse) GetJSON200() *RTSPSessionList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r RtspsSessionsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r RtspsSessionsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r RtspsSessionsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r RtspsSessionsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r RtspsSessionsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r RtspsSessionsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type SrtConnsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *SRTConn + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r SrtConnsGetResponse) GetJSON200() *SRTConn { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r SrtConnsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r SrtConnsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r SrtConnsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r SrtConnsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r SrtConnsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SrtConnsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r SrtConnsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type SrtConnsKickResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r SrtConnsKickResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r SrtConnsKickResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r SrtConnsKickResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r SrtConnsKickResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r SrtConnsKickResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r SrtConnsKickResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SrtConnsKickResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r SrtConnsKickResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type SrtConnsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *SRTConnList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r SrtConnsListResponse) GetJSON200() *SRTConnList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r SrtConnsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r SrtConnsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r SrtConnsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r SrtConnsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r SrtConnsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r SrtConnsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type WebrtcSessionsGetResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *WebRTCSession + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r WebrtcSessionsGetResponse) GetJSON200() *WebRTCSession { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r WebrtcSessionsGetResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r WebrtcSessionsGetResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r WebrtcSessionsGetResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r WebrtcSessionsGetResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r WebrtcSessionsGetResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r WebrtcSessionsGetResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r WebrtcSessionsGetResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type WebrtcSessionsKickResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *OK + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON404 the response for an HTTP 404 `application/json` response + JSON404 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r WebrtcSessionsKickResponse) GetJSON200() *OK { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r WebrtcSessionsKickResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON404 returns the response for an HTTP 404 `application/json` response +func (r WebrtcSessionsKickResponse) GetJSON404() *Error { + return r.JSON404 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r WebrtcSessionsKickResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r WebrtcSessionsKickResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r WebrtcSessionsKickResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r WebrtcSessionsKickResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r WebrtcSessionsKickResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +type WebrtcSessionsListResponse struct { + Body []byte + HTTPResponse *http.Response + // JSON200 the response for an HTTP 200 `application/json` response + JSON200 *WebRTCSessionList + // JSON400 the response for an HTTP 400 `application/json` response + JSON400 *Error + // JSON500 the response for an HTTP 500 `application/json` response + JSON500 *Error +} + +// GetJSON200 returns the response for an HTTP 200 `application/json` response +func (r WebrtcSessionsListResponse) GetJSON200() *WebRTCSessionList { + return r.JSON200 +} + +// GetJSON400 returns the response for an HTTP 400 `application/json` response +func (r WebrtcSessionsListResponse) GetJSON400() *Error { + return r.JSON400 +} + +// GetJSON500 returns the response for an HTTP 500 `application/json` response +func (r WebrtcSessionsListResponse) GetJSON500() *Error { + return r.JSON500 +} + +// GetBody returns the raw response body bytes +func (r WebrtcSessionsListResponse) GetBody() []byte { + return r.Body +} + +// Status returns HTTPResponse.Status +func (r WebrtcSessionsListResponse) Status() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Status + } + return http.StatusText(0) +} + +// StatusCode returns HTTPResponse.StatusCode +func (r WebrtcSessionsListResponse) StatusCode() int { + if r.HTTPResponse != nil { + return r.HTTPResponse.StatusCode + } + return 0 +} + +// ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers +func (r WebrtcSessionsListResponse) ContentType() string { + if r.HTTPResponse != nil { + return r.HTTPResponse.Header.Get("Content-Type") + } + return "" +} + +// AuthJwksRefreshWithResponse Manually refreshes the JWT JWKS. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/auth/jwks/refresh (the `AuthJwksRefresh` operationId). +func (c *ClientWithResponses) AuthJwksRefreshWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*AuthJwksRefreshResponse, error) { + rsp, err := c.AuthJwksRefresh(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseAuthJwksRefreshResponse(rsp) +} + +// ConfigGlobalGetWithResponse returns the global configuration. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/config/global/get (the `ConfigGlobalGet` operationId). +func (c *ClientWithResponses) ConfigGlobalGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConfigGlobalGetResponse, error) { + rsp, err := c.ConfigGlobalGet(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigGlobalGetResponse(rsp) +} + +// ConfigGlobalSetWithBodyWithResponse patches the global configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v3/config/global/patch (the `ConfigGlobalSet` operationId). +func (c *ClientWithResponses) ConfigGlobalSetWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigGlobalSetResponse, error) { + rsp, err := c.ConfigGlobalSetWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigGlobalSetResponse(rsp) +} + +// ConfigGlobalSetWithResponse patches the global configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v3/config/global/patch (the `ConfigGlobalSet` operationId). +func (c *ClientWithResponses) ConfigGlobalSetWithResponse(ctx context.Context, body ConfigGlobalSetJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigGlobalSetResponse, error) { + rsp, err := c.ConfigGlobalSet(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigGlobalSetResponse(rsp) +} + +// ConfigPathDefaultsGetWithResponse returns the default path configuration. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/config/pathdefaults/get (the `ConfigPathDefaultsGet` operationId). +func (c *ClientWithResponses) ConfigPathDefaultsGetWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ConfigPathDefaultsGetResponse, error) { + rsp, err := c.ConfigPathDefaultsGet(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathDefaultsGetResponse(rsp) +} + +// ConfigPathDefaultsPatchWithBodyWithResponse patches the default path configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v3/config/pathdefaults/patch (the `ConfigPathDefaultsPatch` operationId). +func (c *ClientWithResponses) ConfigPathDefaultsPatchWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigPathDefaultsPatchResponse, error) { + rsp, err := c.ConfigPathDefaultsPatchWithBody(ctx, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathDefaultsPatchResponse(rsp) +} + +// ConfigPathDefaultsPatchWithResponse patches the default path configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v3/config/pathdefaults/patch (the `ConfigPathDefaultsPatch` operationId). +func (c *ClientWithResponses) ConfigPathDefaultsPatchWithResponse(ctx context.Context, body ConfigPathDefaultsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigPathDefaultsPatchResponse, error) { + rsp, err := c.ConfigPathDefaultsPatch(ctx, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathDefaultsPatchResponse(rsp) +} + +// ConfigPathsAddWithBodyWithResponse adds a path configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/config/paths/add/{name} (the `ConfigPathsAdd` operationId). +func (c *ClientWithResponses) ConfigPathsAddWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigPathsAddResponse, error) { + rsp, err := c.ConfigPathsAddWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathsAddResponse(rsp) +} + +// ConfigPathsAddWithResponse adds a path configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/config/paths/add/{name} (the `ConfigPathsAdd` operationId). +func (c *ClientWithResponses) ConfigPathsAddWithResponse(ctx context.Context, name string, body ConfigPathsAddJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigPathsAddResponse, error) { + rsp, err := c.ConfigPathsAdd(ctx, name, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathsAddResponse(rsp) +} + +// ConfigPathsDeleteWithResponse removes a path configuration. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v3/config/paths/delete/{name} (the `ConfigPathsDelete` operationId). +func (c *ClientWithResponses) ConfigPathsDeleteWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ConfigPathsDeleteResponse, error) { + rsp, err := c.ConfigPathsDelete(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathsDeleteResponse(rsp) +} + +// ConfigPathsGetWithResponse returns a path configuration. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/config/paths/get/{name} (the `ConfigPathsGet` operationId). +func (c *ClientWithResponses) ConfigPathsGetWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*ConfigPathsGetResponse, error) { + rsp, err := c.ConfigPathsGet(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathsGetResponse(rsp) +} + +// ConfigPathsListWithResponse returns all path configurations. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/config/paths/list (the `ConfigPathsList` operationId). +func (c *ClientWithResponses) ConfigPathsListWithResponse(ctx context.Context, params *ConfigPathsListParams, reqEditors ...RequestEditorFn) (*ConfigPathsListResponse, error) { + rsp, err := c.ConfigPathsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathsListResponse(rsp) +} + +// ConfigPathsPatchWithBodyWithResponse patches a path configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v3/config/paths/patch/{name} (the `ConfigPathsPatch` operationId). +func (c *ClientWithResponses) ConfigPathsPatchWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigPathsPatchResponse, error) { + rsp, err := c.ConfigPathsPatchWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathsPatchResponse(rsp) +} + +// ConfigPathsPatchWithResponse patches a path configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with PATCH /v3/config/paths/patch/{name} (the `ConfigPathsPatch` operationId). +func (c *ClientWithResponses) ConfigPathsPatchWithResponse(ctx context.Context, name string, body ConfigPathsPatchJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigPathsPatchResponse, error) { + rsp, err := c.ConfigPathsPatch(ctx, name, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathsPatchResponse(rsp) +} + +// ConfigPathsReplaceWithBodyWithResponse replaces all values of a path configuration. +// +// all fields are optional. +// +// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/config/paths/replace/{name} (the `ConfigPathsReplace` operationId). +func (c *ClientWithResponses) ConfigPathsReplaceWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ConfigPathsReplaceResponse, error) { + rsp, err := c.ConfigPathsReplaceWithBody(ctx, name, contentType, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathsReplaceResponse(rsp) +} + +// ConfigPathsReplaceWithResponse replaces all values of a path configuration. +// +// all fields are optional. +// +// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/config/paths/replace/{name} (the `ConfigPathsReplace` operationId). +func (c *ClientWithResponses) ConfigPathsReplaceWithResponse(ctx context.Context, name string, body ConfigPathsReplaceJSONRequestBody, reqEditors ...RequestEditorFn) (*ConfigPathsReplaceResponse, error) { + rsp, err := c.ConfigPathsReplace(ctx, name, body, reqEditors...) + if err != nil { + return nil, err + } + return ParseConfigPathsReplaceResponse(rsp) +} + +// HlsMuxersGetWithResponse returns a HLS muxer. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/hlsmuxers/get/{name} (the `HlsMuxersGet` operationId). +func (c *ClientWithResponses) HlsMuxersGetWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*HlsMuxersGetResponse, error) { + rsp, err := c.HlsMuxersGet(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseHlsMuxersGetResponse(rsp) +} + +// HlsMuxersListWithResponse returns all HLS muxers. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/hlsmuxers/list (the `HlsMuxersList` operationId). +func (c *ClientWithResponses) HlsMuxersListWithResponse(ctx context.Context, params *HlsMuxersListParams, reqEditors ...RequestEditorFn) (*HlsMuxersListResponse, error) { + rsp, err := c.HlsMuxersList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseHlsMuxersListResponse(rsp) +} + +// HlssessionsGetWithResponse returns a HLS session. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/hlssessions/get/{id} (the `HlssessionsGet` operationId). +func (c *ClientWithResponses) HlssessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*HlssessionsGetResponse, error) { + rsp, err := c.HlssessionsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseHlssessionsGetResponse(rsp) +} + +// HlssessionsKickWithResponse kicks out a HLS session from the server. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/hlssessions/kick/{id} (the `HlssessionsKick` operationId). +func (c *ClientWithResponses) HlssessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*HlssessionsKickResponse, error) { + rsp, err := c.HlssessionsKick(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseHlssessionsKickResponse(rsp) +} + +// HlssessionsListWithResponse returns all HLS sessions. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/hlssessions/list (the `HlssessionsList` operationId). +func (c *ClientWithResponses) HlssessionsListWithResponse(ctx context.Context, params *HlssessionsListParams, reqEditors ...RequestEditorFn) (*HlssessionsListResponse, error) { + rsp, err := c.HlssessionsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseHlssessionsListResponse(rsp) +} + +// InfoWithResponse returns informations about the instance. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/info (the `Info` operationId). +func (c *ClientWithResponses) InfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InfoResponse, error) { + rsp, err := c.Info(ctx, reqEditors...) + if err != nil { + return nil, err + } + return ParseInfoResponse(rsp) +} + +// MoqSessionsGetWithResponse returns a MoQ session. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/moqsessions/get/{id} (the `MoqSessionsGet` operationId). +func (c *ClientWithResponses) MoqSessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*MoqSessionsGetResponse, error) { + rsp, err := c.MoqSessionsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseMoqSessionsGetResponse(rsp) +} + +// MoqSessionsKickWithResponse kicks out a MoQ session from the server. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/moqsessions/kick/{id} (the `MoqSessionsKick` operationId). +func (c *ClientWithResponses) MoqSessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*MoqSessionsKickResponse, error) { + rsp, err := c.MoqSessionsKick(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseMoqSessionsKickResponse(rsp) +} + +// MoqSessionsListWithResponse returns all MoQ sessions. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/moqsessions/list (the `MoqSessionsList` operationId). +func (c *ClientWithResponses) MoqSessionsListWithResponse(ctx context.Context, params *MoqSessionsListParams, reqEditors ...RequestEditorFn) (*MoqSessionsListResponse, error) { + rsp, err := c.MoqSessionsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseMoqSessionsListResponse(rsp) +} + +// PathsGetWithResponse returns a path. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/paths/get/{name} (the `PathsGet` operationId). +func (c *ClientWithResponses) PathsGetWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*PathsGetResponse, error) { + rsp, err := c.PathsGet(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParsePathsGetResponse(rsp) +} + +// PathsListWithResponse returns all paths. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/paths/list (the `PathsList` operationId). +func (c *ClientWithResponses) PathsListWithResponse(ctx context.Context, params *PathsListParams, reqEditors ...RequestEditorFn) (*PathsListResponse, error) { + rsp, err := c.PathsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParsePathsListResponse(rsp) +} + +// RecordingsDeleteSegmentWithResponse deletes a recording segment. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with DELETE /v3/recordings/deletesegment (the `RecordingsDeleteSegment` operationId). +func (c *ClientWithResponses) RecordingsDeleteSegmentWithResponse(ctx context.Context, params *RecordingsDeleteSegmentParams, reqEditors ...RequestEditorFn) (*RecordingsDeleteSegmentResponse, error) { + rsp, err := c.RecordingsDeleteSegment(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseRecordingsDeleteSegmentResponse(rsp) +} + +// RecordingsGetWithResponse returns recordings of a path. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/recordings/get/{name} (the `RecordingsGet` operationId). +func (c *ClientWithResponses) RecordingsGetWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RecordingsGetResponse, error) { + rsp, err := c.RecordingsGet(ctx, name, reqEditors...) + if err != nil { + return nil, err + } + return ParseRecordingsGetResponse(rsp) +} + +// RecordingsListWithResponse returns all recordings, splitted by path. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/recordings/list (the `RecordingsList` operationId). +func (c *ClientWithResponses) RecordingsListWithResponse(ctx context.Context, params *RecordingsListParams, reqEditors ...RequestEditorFn) (*RecordingsListResponse, error) { + rsp, err := c.RecordingsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseRecordingsListResponse(rsp) +} + +// RtmpConnectionsGetWithResponse returns a RTMP connection. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtmpconns/get/{id} (the `RtmpConnectionsGet` operationId). +func (c *ClientWithResponses) RtmpConnectionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtmpConnectionsGetResponse, error) { + rsp, err := c.RtmpConnectionsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtmpConnectionsGetResponse(rsp) +} + +// RtmpConnsKickWithResponse kicks out a RTMP connection from the server. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/rtmpconns/kick/{id} (the `RtmpConnsKick` operationId). +func (c *ClientWithResponses) RtmpConnsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtmpConnsKickResponse, error) { + rsp, err := c.RtmpConnsKick(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtmpConnsKickResponse(rsp) +} + +// RtmpConnsListWithResponse returns all RTMP connections. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtmpconns/list (the `RtmpConnsList` operationId). +func (c *ClientWithResponses) RtmpConnsListWithResponse(ctx context.Context, params *RtmpConnsListParams, reqEditors ...RequestEditorFn) (*RtmpConnsListResponse, error) { + rsp, err := c.RtmpConnsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtmpConnsListResponse(rsp) +} + +// RtmpsConnectionsGetWithResponse returns a RTMPS connection. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtmpsconns/get/{id} (the `RtmpsConnectionsGet` operationId). +func (c *ClientWithResponses) RtmpsConnectionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtmpsConnectionsGetResponse, error) { + rsp, err := c.RtmpsConnectionsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtmpsConnectionsGetResponse(rsp) +} + +// RtmpsConnsKickWithResponse kicks out a RTMPS connection from the server. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/rtmpsconns/kick/{id} (the `RtmpsConnsKick` operationId). +func (c *ClientWithResponses) RtmpsConnsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtmpsConnsKickResponse, error) { + rsp, err := c.RtmpsConnsKick(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtmpsConnsKickResponse(rsp) +} + +// RtmpsConnsListWithResponse returns all RTMPS connections. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtmpsconns/list (the `RtmpsConnsList` operationId). +func (c *ClientWithResponses) RtmpsConnsListWithResponse(ctx context.Context, params *RtmpsConnsListParams, reqEditors ...RequestEditorFn) (*RtmpsConnsListResponse, error) { + rsp, err := c.RtmpsConnsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtmpsConnsListResponse(rsp) +} + +// RtspConnsGetWithResponse returns a RTSP connection. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtspconns/get/{id} (the `RtspConnsGet` operationId). +func (c *ClientWithResponses) RtspConnsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspConnsGetResponse, error) { + rsp, err := c.RtspConnsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspConnsGetResponse(rsp) +} + +// RtspConnsListWithResponse returns all RTSP connections. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtspconns/list (the `RtspConnsList` operationId). +func (c *ClientWithResponses) RtspConnsListWithResponse(ctx context.Context, params *RtspConnsListParams, reqEditors ...RequestEditorFn) (*RtspConnsListResponse, error) { + rsp, err := c.RtspConnsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspConnsListResponse(rsp) +} + +// RtspsConnsGetWithResponse returns a RTSPS connection. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtspsconns/get/{id} (the `RtspsConnsGet` operationId). +func (c *ClientWithResponses) RtspsConnsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspsConnsGetResponse, error) { + rsp, err := c.RtspsConnsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspsConnsGetResponse(rsp) +} + +// RtspsConnsListWithResponse returns all RTSPS connections. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtspsconns/list (the `RtspsConnsList` operationId). +func (c *ClientWithResponses) RtspsConnsListWithResponse(ctx context.Context, params *RtspsConnsListParams, reqEditors ...RequestEditorFn) (*RtspsConnsListResponse, error) { + rsp, err := c.RtspsConnsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspsConnsListResponse(rsp) +} + +// RtspSessionsGetWithResponse returns a RTSP session. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtspsessions/get/{id} (the `RtspSessionsGet` operationId). +func (c *ClientWithResponses) RtspSessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspSessionsGetResponse, error) { + rsp, err := c.RtspSessionsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspSessionsGetResponse(rsp) +} + +// RtspSessionsKickWithResponse kicks out a RTSP session from the server. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/rtspsessions/kick/{id} (the `RtspSessionsKick` operationId). +func (c *ClientWithResponses) RtspSessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspSessionsKickResponse, error) { + rsp, err := c.RtspSessionsKick(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspSessionsKickResponse(rsp) +} + +// RtspSessionsListWithResponse returns all RTSP sessions. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtspsessions/list (the `RtspSessionsList` operationId). +func (c *ClientWithResponses) RtspSessionsListWithResponse(ctx context.Context, params *RtspSessionsListParams, reqEditors ...RequestEditorFn) (*RtspSessionsListResponse, error) { + rsp, err := c.RtspSessionsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspSessionsListResponse(rsp) +} + +// RtspsSessionsGetWithResponse returns a RTSPS session. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtspssessions/get/{id} (the `RtspsSessionsGet` operationId). +func (c *ClientWithResponses) RtspsSessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspsSessionsGetResponse, error) { + rsp, err := c.RtspsSessionsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspsSessionsGetResponse(rsp) +} + +// RtspsSessionsKickWithResponse kicks out a RTSPS session from the server. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/rtspssessions/kick/{id} (the `RtspsSessionsKick` operationId). +func (c *ClientWithResponses) RtspsSessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*RtspsSessionsKickResponse, error) { + rsp, err := c.RtspsSessionsKick(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspsSessionsKickResponse(rsp) +} + +// RtspsSessionsListWithResponse returns all RTSPS sessions. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/rtspssessions/list (the `RtspsSessionsList` operationId). +func (c *ClientWithResponses) RtspsSessionsListWithResponse(ctx context.Context, params *RtspsSessionsListParams, reqEditors ...RequestEditorFn) (*RtspsSessionsListResponse, error) { + rsp, err := c.RtspsSessionsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseRtspsSessionsListResponse(rsp) +} + +// SrtConnsGetWithResponse returns a SRT connection. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/srtconns/get/{id} (the `SrtConnsGet` operationId). +func (c *ClientWithResponses) SrtConnsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*SrtConnsGetResponse, error) { + rsp, err := c.SrtConnsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseSrtConnsGetResponse(rsp) +} + +// SrtConnsKickWithResponse kicks out a SRT connection from the server. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/srtconns/kick/{id} (the `SrtConnsKick` operationId). +func (c *ClientWithResponses) SrtConnsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*SrtConnsKickResponse, error) { + rsp, err := c.SrtConnsKick(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseSrtConnsKickResponse(rsp) +} + +// SrtConnsListWithResponse returns all SRT connections. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/srtconns/list (the `SrtConnsList` operationId). +func (c *ClientWithResponses) SrtConnsListWithResponse(ctx context.Context, params *SrtConnsListParams, reqEditors ...RequestEditorFn) (*SrtConnsListResponse, error) { + rsp, err := c.SrtConnsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseSrtConnsListResponse(rsp) +} + +// WebrtcSessionsGetWithResponse returns a WebRTC session. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/webrtcsessions/get/{id} (the `WebrtcSessionsGet` operationId). +func (c *ClientWithResponses) WebrtcSessionsGetWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*WebrtcSessionsGetResponse, error) { + rsp, err := c.WebrtcSessionsGet(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseWebrtcSessionsGetResponse(rsp) +} + +// WebrtcSessionsKickWithResponse kicks out a WebRTC session from the server. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with POST /v3/webrtcsessions/kick/{id} (the `WebrtcSessionsKick` operationId). +func (c *ClientWithResponses) WebrtcSessionsKickWithResponse(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*WebrtcSessionsKickResponse, error) { + rsp, err := c.WebrtcSessionsKick(ctx, id, reqEditors...) + if err != nil { + return nil, err + } + return ParseWebrtcSessionsKickResponse(rsp) +} + +// WebrtcSessionsListWithResponse returns all WebRTC sessions. +// +// Returns a wrapper object for the known response body format(s). +// +// Corresponds with GET /v3/webrtcsessions/list (the `WebrtcSessionsList` operationId). +func (c *ClientWithResponses) WebrtcSessionsListWithResponse(ctx context.Context, params *WebrtcSessionsListParams, reqEditors ...RequestEditorFn) (*WebrtcSessionsListResponse, error) { + rsp, err := c.WebrtcSessionsList(ctx, params, reqEditors...) + if err != nil { + return nil, err + } + return ParseWebrtcSessionsListResponse(rsp) +} + +// ParseAuthJwksRefreshResponse parses an HTTP response from a AuthJwksRefreshWithResponse call +func ParseAuthJwksRefreshResponse(rsp *http.Response) (*AuthJwksRefreshResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &AuthJwksRefreshResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigGlobalGetResponse parses an HTTP response from a ConfigGlobalGetWithResponse call +func ParseConfigGlobalGetResponse(rsp *http.Response) (*ConfigGlobalGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigGlobalGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest GlobalConf + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigGlobalSetResponse parses an HTTP response from a ConfigGlobalSetWithResponse call +func ParseConfigGlobalSetResponse(rsp *http.Response) (*ConfigGlobalSetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigGlobalSetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigPathDefaultsGetResponse parses an HTTP response from a ConfigPathDefaultsGetWithResponse call +func ParseConfigPathDefaultsGetResponse(rsp *http.Response) (*ConfigPathDefaultsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigPathDefaultsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PathConf + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigPathDefaultsPatchResponse parses an HTTP response from a ConfigPathDefaultsPatchWithResponse call +func ParseConfigPathDefaultsPatchResponse(rsp *http.Response) (*ConfigPathDefaultsPatchResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigPathDefaultsPatchResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigPathsAddResponse parses an HTTP response from a ConfigPathsAddWithResponse call +func ParseConfigPathsAddResponse(rsp *http.Response) (*ConfigPathsAddResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigPathsAddResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigPathsDeleteResponse parses an HTTP response from a ConfigPathsDeleteWithResponse call +func ParseConfigPathsDeleteResponse(rsp *http.Response) (*ConfigPathsDeleteResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigPathsDeleteResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigPathsGetResponse parses an HTTP response from a ConfigPathsGetWithResponse call +func ParseConfigPathsGetResponse(rsp *http.Response) (*ConfigPathsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigPathsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PathConf + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigPathsListResponse parses an HTTP response from a ConfigPathsListWithResponse call +func ParseConfigPathsListResponse(rsp *http.Response) (*ConfigPathsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigPathsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PathConfList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigPathsPatchResponse parses an HTTP response from a ConfigPathsPatchWithResponse call +func ParseConfigPathsPatchResponse(rsp *http.Response) (*ConfigPathsPatchResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigPathsPatchResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseConfigPathsReplaceResponse parses an HTTP response from a ConfigPathsReplaceWithResponse call +func ParseConfigPathsReplaceResponse(rsp *http.Response) (*ConfigPathsReplaceResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &ConfigPathsReplaceResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseHlsMuxersGetResponse parses an HTTP response from a HlsMuxersGetWithResponse call +func ParseHlsMuxersGetResponse(rsp *http.Response) (*HlsMuxersGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &HlsMuxersGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest HLSMuxer + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseHlsMuxersListResponse parses an HTTP response from a HlsMuxersListWithResponse call +func ParseHlsMuxersListResponse(rsp *http.Response) (*HlsMuxersListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &HlsMuxersListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest HLSMuxerList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseHlssessionsGetResponse parses an HTTP response from a HlssessionsGetWithResponse call +func ParseHlssessionsGetResponse(rsp *http.Response) (*HlssessionsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &HlssessionsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest HLSSession + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseHlssessionsKickResponse parses an HTTP response from a HlssessionsKickWithResponse call +func ParseHlssessionsKickResponse(rsp *http.Response) (*HlssessionsKickResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &HlssessionsKickResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseHlssessionsListResponse parses an HTTP response from a HlssessionsListWithResponse call +func ParseHlssessionsListResponse(rsp *http.Response) (*HlssessionsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &HlssessionsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest HLSSessionList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseInfoResponse parses an HTTP response from a InfoWithResponse call +func ParseInfoResponse(rsp *http.Response) (*InfoResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &InfoResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Info + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseMoqSessionsGetResponse parses an HTTP response from a MoqSessionsGetWithResponse call +func ParseMoqSessionsGetResponse(rsp *http.Response) (*MoqSessionsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &MoqSessionsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest MoQSession + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseMoqSessionsKickResponse parses an HTTP response from a MoqSessionsKickWithResponse call +func ParseMoqSessionsKickResponse(rsp *http.Response) (*MoqSessionsKickResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &MoqSessionsKickResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseMoqSessionsListResponse parses an HTTP response from a MoqSessionsListWithResponse call +func ParseMoqSessionsListResponse(rsp *http.Response) (*MoqSessionsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &MoqSessionsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest MoQSessionList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParsePathsGetResponse parses an HTTP response from a PathsGetWithResponse call +func ParsePathsGetResponse(rsp *http.Response) (*PathsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PathsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Path + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParsePathsListResponse parses an HTTP response from a PathsListWithResponse call +func ParsePathsListResponse(rsp *http.Response) (*PathsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &PathsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest PathList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRecordingsDeleteSegmentResponse parses an HTTP response from a RecordingsDeleteSegmentWithResponse call +func ParseRecordingsDeleteSegmentResponse(rsp *http.Response) (*RecordingsDeleteSegmentResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RecordingsDeleteSegmentResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRecordingsGetResponse parses an HTTP response from a RecordingsGetWithResponse call +func ParseRecordingsGetResponse(rsp *http.Response) (*RecordingsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RecordingsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest Recording + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRecordingsListResponse parses an HTTP response from a RecordingsListWithResponse call +func ParseRecordingsListResponse(rsp *http.Response) (*RecordingsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RecordingsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RecordingList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtmpConnectionsGetResponse parses an HTTP response from a RtmpConnectionsGetWithResponse call +func ParseRtmpConnectionsGetResponse(rsp *http.Response) (*RtmpConnectionsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtmpConnectionsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTMPConn + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtmpConnsKickResponse parses an HTTP response from a RtmpConnsKickWithResponse call +func ParseRtmpConnsKickResponse(rsp *http.Response) (*RtmpConnsKickResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtmpConnsKickResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtmpConnsListResponse parses an HTTP response from a RtmpConnsListWithResponse call +func ParseRtmpConnsListResponse(rsp *http.Response) (*RtmpConnsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtmpConnsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTMPConnList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtmpsConnectionsGetResponse parses an HTTP response from a RtmpsConnectionsGetWithResponse call +func ParseRtmpsConnectionsGetResponse(rsp *http.Response) (*RtmpsConnectionsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtmpsConnectionsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTMPConn + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtmpsConnsKickResponse parses an HTTP response from a RtmpsConnsKickWithResponse call +func ParseRtmpsConnsKickResponse(rsp *http.Response) (*RtmpsConnsKickResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtmpsConnsKickResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtmpsConnsListResponse parses an HTTP response from a RtmpsConnsListWithResponse call +func ParseRtmpsConnsListResponse(rsp *http.Response) (*RtmpsConnsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtmpsConnsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTMPConnList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspConnsGetResponse parses an HTTP response from a RtspConnsGetWithResponse call +func ParseRtspConnsGetResponse(rsp *http.Response) (*RtspConnsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspConnsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTSPConn + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspConnsListResponse parses an HTTP response from a RtspConnsListWithResponse call +func ParseRtspConnsListResponse(rsp *http.Response) (*RtspConnsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspConnsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTSPConnList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspsConnsGetResponse parses an HTTP response from a RtspsConnsGetWithResponse call +func ParseRtspsConnsGetResponse(rsp *http.Response) (*RtspsConnsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspsConnsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTSPConn + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspsConnsListResponse parses an HTTP response from a RtspsConnsListWithResponse call +func ParseRtspsConnsListResponse(rsp *http.Response) (*RtspsConnsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspsConnsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTSPConnList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspSessionsGetResponse parses an HTTP response from a RtspSessionsGetWithResponse call +func ParseRtspSessionsGetResponse(rsp *http.Response) (*RtspSessionsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspSessionsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTSPSession + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspSessionsKickResponse parses an HTTP response from a RtspSessionsKickWithResponse call +func ParseRtspSessionsKickResponse(rsp *http.Response) (*RtspSessionsKickResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspSessionsKickResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspSessionsListResponse parses an HTTP response from a RtspSessionsListWithResponse call +func ParseRtspSessionsListResponse(rsp *http.Response) (*RtspSessionsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspSessionsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTSPSessionList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspsSessionsGetResponse parses an HTTP response from a RtspsSessionsGetWithResponse call +func ParseRtspsSessionsGetResponse(rsp *http.Response) (*RtspsSessionsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspsSessionsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTSPSession + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspsSessionsKickResponse parses an HTTP response from a RtspsSessionsKickWithResponse call +func ParseRtspsSessionsKickResponse(rsp *http.Response) (*RtspsSessionsKickResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspsSessionsKickResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseRtspsSessionsListResponse parses an HTTP response from a RtspsSessionsListWithResponse call +func ParseRtspsSessionsListResponse(rsp *http.Response) (*RtspsSessionsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &RtspsSessionsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest RTSPSessionList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseSrtConnsGetResponse parses an HTTP response from a SrtConnsGetWithResponse call +func ParseSrtConnsGetResponse(rsp *http.Response) (*SrtConnsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &SrtConnsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SRTConn + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseSrtConnsKickResponse parses an HTTP response from a SrtConnsKickWithResponse call +func ParseSrtConnsKickResponse(rsp *http.Response) (*SrtConnsKickResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &SrtConnsKickResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseSrtConnsListResponse parses an HTTP response from a SrtConnsListWithResponse call +func ParseSrtConnsListResponse(rsp *http.Response) (*SrtConnsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &SrtConnsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest SRTConnList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseWebrtcSessionsGetResponse parses an HTTP response from a WebrtcSessionsGetWithResponse call +func ParseWebrtcSessionsGetResponse(rsp *http.Response) (*WebrtcSessionsGetResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &WebrtcSessionsGetResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest WebRTCSession + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseWebrtcSessionsKickResponse parses an HTTP response from a WebrtcSessionsKickWithResponse call +func ParseWebrtcSessionsKickResponse(rsp *http.Response) (*WebrtcSessionsKickResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &WebrtcSessionsKickResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest OK + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 404: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON404 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} + +// ParseWebrtcSessionsListResponse parses an HTTP response from a WebrtcSessionsListWithResponse call +func ParseWebrtcSessionsListResponse(rsp *http.Response) (*WebrtcSessionsListResponse, error) { + bodyBytes, err := io.ReadAll(rsp.Body) + defer func() { _ = rsp.Body.Close() }() + if err != nil { + return nil, err + } + + response := &WebrtcSessionsListResponse{ + Body: bodyBytes, + HTTPResponse: rsp, + } + + switch { + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 200: + var dest WebRTCSessionList + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON200 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 400: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON400 = &dest + + case strings.Contains(rsp.Header.Get("Content-Type"), "json") && rsp.StatusCode == 500: + var dest Error + if err := json.Unmarshal(bodyBytes, &dest); err != nil { + return nil, err + } + response.JSON500 = &dest + + } + + return response, nil +} diff --git a/Sense/internal/mtx/oapi-codegen.yaml b/Sense/internal/mtx/oapi-codegen.yaml new file mode 100644 index 0000000..6c5277c --- /dev/null +++ b/Sense/internal/mtx/oapi-codegen.yaml @@ -0,0 +1,7 @@ +package: mediamtxapi +output: generated/client.gen.go +generate: + models: true + client: true +output-options: + skip-prune: false diff --git a/Sense/internal/onvif/fake.go b/Sense/internal/onvif/fake.go new file mode 100644 index 0000000..e2aecfb --- /dev/null +++ b/Sense/internal/onvif/fake.go @@ -0,0 +1,126 @@ +package onvif + +import ( + "context" + "encoding/json" + "fmt" + "os" + "sync" + "time" +) + +type FakeScenario struct { + Result ProbeResult `json:"result"` + ProbeError ErrorCode `json:"probe_error,omitempty"` + ClockError ErrorCode `json:"clock_error,omitempty"` + DelayMillis int `json:"delay_millis,omitempty"` +} + +type fakeFixture struct { + Scenarios map[string]FakeScenario `json:"scenarios"` +} + +// Fake is deterministic and intended only for tests and offline development. +type Fake struct { + mu sync.Mutex + scenarios map[string]FakeScenario + probeCalls map[string]int + clockSyncCalls map[string]int +} + +func NewFake(scenarios map[string]FakeScenario) *Fake { + copyOfScenarios := make(map[string]FakeScenario, len(scenarios)) + for key, value := range scenarios { + copyOfScenarios[key] = value + } + return &Fake{ + scenarios: copyOfScenarios, probeCalls: make(map[string]int), clockSyncCalls: make(map[string]int), + } +} + +func LoadFakeFixture(path string) (*Fake, error) { + data, err := os.ReadFile(path) + if err != nil { + return nil, fmt.Errorf("read ONVIF fixture: %w", err) + } + var fixture fakeFixture + if err := json.Unmarshal(data, &fixture); err != nil { + return nil, fmt.Errorf("decode ONVIF fixture: %w", err) + } + return NewFake(fixture.Scenarios), nil +} + +func (f *Fake) Probe(ctx context.Context, target Target) (ProbeResult, error) { + scenario, ok := f.scenario(target.EndpointRef) + if !ok { + return ProbeResult{}, &Error{Code: ErrorUnavailable, Err: fmt.Errorf("fixture endpoint is not configured")} + } + if err := waitForFakeDelay(ctx, scenario.DelayMillis); err != nil { + return ProbeResult{}, &Error{Code: ErrorTimeout, Err: err} + } + f.mu.Lock() + f.probeCalls[target.EndpointRef]++ + f.mu.Unlock() + if scenario.ProbeError != "" { + return ProbeResult{}, &Error{Code: scenario.ProbeError, Err: fmt.Errorf("fixture probe failure")} + } + if scenario.Result.StreamURI == "" || len(scenario.Result.Profiles) == 0 { + return ProbeResult{}, &Error{Code: ErrorInvalidReply, Err: fmt.Errorf("fixture lacks profile or stream URI")} + } + return scenario.Result, nil +} + +func (f *Fake) SetSystemDateAndTime(ctx context.Context, target Target, _ time.Time) error { + scenario, ok := f.scenario(target.EndpointRef) + if !ok { + return &Error{Code: ErrorUnavailable, Err: fmt.Errorf("fixture endpoint is not configured")} + } + if err := waitForFakeDelay(ctx, scenario.DelayMillis); err != nil { + return &Error{Code: ErrorTimeout, Err: err} + } + f.mu.Lock() + f.clockSyncCalls[target.EndpointRef]++ + f.mu.Unlock() + if scenario.ClockError != "" { + return &Error{Code: scenario.ClockError, Err: fmt.Errorf("fixture clock failure")} + } + return nil +} + +func (f *Fake) ProbeCalls(endpointRef string) int { + f.mu.Lock() + defer f.mu.Unlock() + return f.probeCalls[endpointRef] +} + +func (f *Fake) ClockSyncCalls(endpointRef string) int { + f.mu.Lock() + defer f.mu.Unlock() + return f.clockSyncCalls[endpointRef] +} + +func (f *Fake) scenario(endpointRef string) (FakeScenario, bool) { + f.mu.Lock() + defer f.mu.Unlock() + scenario, ok := f.scenarios[endpointRef] + return scenario, ok +} + +func waitForFakeDelay(ctx context.Context, milliseconds int) error { + if milliseconds <= 0 { + select { + case <-ctx.Done(): + return ctx.Err() + default: + return nil + } + } + timer := time.NewTimer(time.Duration(milliseconds) * time.Millisecond) + defer timer.Stop() + select { + case <-ctx.Done(): + return ctx.Err() + case <-timer.C: + return nil + } +} diff --git a/Sense/internal/onvif/fake_test.go b/Sense/internal/onvif/fake_test.go new file mode 100644 index 0000000..9f10302 --- /dev/null +++ b/Sense/internal/onvif/fake_test.go @@ -0,0 +1,56 @@ +package onvif + +import ( + "context" + "path/filepath" + "testing" + "time" +) + +func TestFakeMapsProfilesStreamAndClockSync(t *testing.T) { + t.Parallel() + fake, err := LoadFakeFixture(filepath.Join("testdata", "scenarios.json")) + if err != nil { + t.Fatal(err) + } + target := Target{EndpointRef: "onvif://camera-ok", CredentialRef: "secret://camera-ok"} + result, err := fake.Probe(context.Background(), target) + if err != nil { + t.Fatal(err) + } + if len(result.Profiles) != 2 || result.StreamURI != "rtsp://media.invalid/camera-ok" { + t.Fatalf("unexpected fixture mapping: %+v", result) + } + if err := fake.SetSystemDateAndTime(context.Background(), target, time.Now()); err != nil { + t.Fatal(err) + } + if fake.ProbeCalls(target.EndpointRef) != 1 || fake.ClockSyncCalls(target.EndpointRef) != 1 { + t.Fatal("expected one probe and one clock-sync call") + } +} + +func TestFakeMapsAuthenticationFailure(t *testing.T) { + t.Parallel() + fake, err := LoadFakeFixture(filepath.Join("testdata", "scenarios.json")) + if err != nil { + t.Fatal(err) + } + _, err = fake.Probe(context.Background(), Target{EndpointRef: "onvif://camera-auth"}) + if CodeOf(err) != ErrorAuthentication { + t.Fatalf("expected authentication error, got %v", err) + } +} + +func TestFakeHonorsCancellationAsTimeout(t *testing.T) { + t.Parallel() + fake, err := LoadFakeFixture(filepath.Join("testdata", "scenarios.json")) + if err != nil { + t.Fatal(err) + } + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Millisecond) + defer cancel() + _, err = fake.Probe(ctx, Target{EndpointRef: "onvif://camera-slow"}) + if CodeOf(err) != ErrorTimeout { + t.Fatalf("expected timeout error, got %v", err) + } +} diff --git a/Sense/internal/onvif/port.go b/Sense/internal/onvif/port.go new file mode 100644 index 0000000..65b6081 --- /dev/null +++ b/Sense/internal/onvif/port.go @@ -0,0 +1,70 @@ +// Package onvif defines the ONVIF boundary used by Sense. +package onvif + +import ( + "context" + "errors" + "fmt" + "time" +) + +type Target struct { + // EndpointRef identifies a device endpoint but must not contain credentials. + EndpointRef string + // CredentialRef is an opaque secret-store reference, never a password. + CredentialRef string +} + +type Profile struct { + Token string `json:"token"` + Name string `json:"name"` + VideoEncoder bool `json:"video_encoder"` +} + +type ProbeResult struct { + Manufacturer string `json:"manufacturer"` + Model string `json:"model"` + FirmwareVersion string `json:"firmware_version"` + SerialNumber string `json:"serial_number"` + Profiles []Profile `json:"profiles"` + StreamURI string `json:"stream_uri"` +} + +type Adapter interface { + Probe(ctx context.Context, target Target) (ProbeResult, error) + SetSystemDateAndTime(ctx context.Context, target Target, value time.Time) error +} + +type ErrorCode string + +const ( + ErrorAuthentication ErrorCode = "authentication_failed" + ErrorTimeout ErrorCode = "timeout" + ErrorUnavailable ErrorCode = "unavailable" + ErrorInvalidReply ErrorCode = "invalid_response" +) + +type Error struct { + Code ErrorCode + Err error +} + +func (e *Error) Error() string { + if e.Err == nil { + return string(e.Code) + } + return fmt.Sprintf("%s: %v", e.Code, e.Err) +} + +func (e *Error) Unwrap() error { return e.Err } + +func CodeOf(err error) ErrorCode { + var onvifError *Error + if errors.As(err, &onvifError) { + return onvifError.Code + } + if errors.Is(err, context.DeadlineExceeded) { + return ErrorTimeout + } + return ErrorUnavailable +} diff --git a/Sense/internal/onvif/testdata/scenarios.json b/Sense/internal/onvif/testdata/scenarios.json new file mode 100644 index 0000000..cc06185 --- /dev/null +++ b/Sense/internal/onvif/testdata/scenarios.json @@ -0,0 +1,28 @@ +{ + "scenarios": { + "onvif://camera-ok": { + "result": { + "manufacturer": "YoVision Fixture", + "model": "Offline Camera", + "firmware_version": "0.0-fixture", + "serial_number": "REDACTED-001", + "profiles": [ + {"token": "main", "name": "Main stream", "video_encoder": true}, + {"token": "sub", "name": "Sub stream", "video_encoder": true} + ], + "stream_uri": "rtsp://media.invalid/camera-ok" + } + }, + "onvif://camera-auth": { + "probe_error": "authentication_failed", + "result": {} + }, + "onvif://camera-slow": { + "delay_millis": 100, + "result": { + "profiles": [{"token": "main", "name": "Main stream", "video_encoder": true}], + "stream_uri": "rtsp://media.invalid/camera-slow" + } + } + } +} diff --git a/Sense/internal/onvif/unavailable.go b/Sense/internal/onvif/unavailable.go new file mode 100644 index 0000000..2656ebb --- /dev/null +++ b/Sense/internal/onvif/unavailable.go @@ -0,0 +1,20 @@ +package onvif + +import ( + "context" + "fmt" + "time" +) + +// UnavailableAdapter keeps the process boundary explicit until T-006 supplies +// a real, whitelist-validated ONVIF adapter. It must not be mistaken for a +// compatibility implementation. +type UnavailableAdapter struct{} + +func (UnavailableAdapter) Probe(context.Context, Target) (ProbeResult, error) { + return ProbeResult{}, &Error{Code: ErrorUnavailable, Err: fmt.Errorf("real ONVIF adapter is not configured")} +} + +func (UnavailableAdapter) SetSystemDateAndTime(context.Context, Target, time.Time) error { + return &Error{Code: ErrorUnavailable, Err: fmt.Errorf("real ONVIF adapter is not configured")} +} diff --git a/Sense/internal/probe/probe.go b/Sense/internal/probe/probe.go new file mode 100644 index 0000000..b90d4c5 --- /dev/null +++ b/Sense/internal/probe/probe.go @@ -0,0 +1,79 @@ +// Package probe maps MediaMTX runtime path health into the Sense actual state. +package probe + +import ( + "context" + "errors" + "fmt" + "time" + + "yovision/sense/internal/device" +) + +const defaultBatchSize = 128 + +type Repository interface { + ListEnabledVideoDevices(ctx context.Context, limit int) ([]device.Device, error) + UpdateActualState(ctx context.Context, id string, state device.ActualState, now time.Time) error +} + +type RuntimePaths interface { + PathReady(ctx context.Context, name string) (bool, error) +} + +type Checker struct { + repository Repository + media RuntimePaths + now func() time.Time + batchSize int +} + +func New(repository Repository, media RuntimePaths) *Checker { + return &Checker{repository: repository, media: media, now: time.Now, batchSize: defaultBatchSize} +} + +func (c *Checker) RunOnce(ctx context.Context) error { + devices, err := c.repository.ListEnabledVideoDevices(ctx, c.batchSize) + if err != nil { + return fmt.Errorf("list probe candidates: %w", err) + } + var runErrors []error + for _, value := range devices { + if err := ctx.Err(); err != nil { + return err + } + ready, probeErr := c.media.PathReady(ctx, value.PathName) + if ctx.Err() != nil { + return ctx.Err() + } + state := device.ActualOffline + if probeErr == nil && ready { + state = device.ActualOnline + } + if updateErr := c.repository.UpdateActualState(ctx, value.ID, state, c.now().UTC()); updateErr != nil { + runErrors = append(runErrors, fmt.Errorf("update device %s health: %w", value.ID, updateErr)) + } + if probeErr != nil { + runErrors = append(runErrors, fmt.Errorf("probe device %s: %w", value.ID, probeErr)) + } + } + return errors.Join(runErrors...) +} + +func (c *Checker) Run(ctx context.Context, interval time.Duration, report func(error)) { + if err := c.RunOnce(ctx); err != nil && ctx.Err() == nil && report != nil { + report(err) + } + ticker := time.NewTicker(interval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if err := c.RunOnce(ctx); err != nil && ctx.Err() == nil && report != nil { + report(err) + } + } + } +} diff --git a/Sense/internal/probe/probe_test.go b/Sense/internal/probe/probe_test.go new file mode 100644 index 0000000..6be8b07 --- /dev/null +++ b/Sense/internal/probe/probe_test.go @@ -0,0 +1,53 @@ +package probe + +import ( + "context" + "errors" + "testing" + "time" + + "yovision/sense/internal/device" +) + +type fakeRepository struct { + devices []device.Device + states map[string]device.ActualState +} + +func (f *fakeRepository) ListEnabledVideoDevices(context.Context, int) ([]device.Device, error) { + return f.devices, nil +} + +func (f *fakeRepository) UpdateActualState(_ context.Context, id string, state device.ActualState, _ time.Time) error { + if f.states == nil { + f.states = make(map[string]device.ActualState) + } + f.states[id] = state + return nil +} + +type fakeRuntime struct { + ready map[string]bool + errors map[string]error +} + +func (f fakeRuntime) PathReady(_ context.Context, name string) (bool, error) { + return f.ready[name], f.errors[name] +} + +func TestCheckerMapsReadyAndUnavailablePaths(t *testing.T) { + t.Parallel() + repository := &fakeRepository{devices: []device.Device{ + {ID: "online", PathName: "online"}, {ID: "offline", PathName: "offline"}, + }} + checker := New(repository, fakeRuntime{ + ready: map[string]bool{"online": true}, errors: map[string]error{"offline": errors.New("unavailable")}, + }) + err := checker.RunOnce(context.Background()) + if err == nil { + t.Fatal("probe transport error must remain observable") + } + if repository.states["online"] != device.ActualOnline || repository.states["offline"] != device.ActualOffline { + t.Fatalf("unexpected actual states: %+v", repository.states) + } +} diff --git a/Sense/internal/reconcile/reconciler.go b/Sense/internal/reconcile/reconciler.go new file mode 100644 index 0000000..22d79e4 --- /dev/null +++ b/Sense/internal/reconcile/reconciler.go @@ -0,0 +1,134 @@ +// Package reconcile converges MediaMTX paths from the database desired state. +package reconcile + +import ( + "context" + "errors" + "fmt" + "net/url" + "time" + + "yovision/sense/internal/onvif" + "yovision/sense/internal/store" +) + +const defaultBatchSize = 128 + +type Repository interface { + ListDueReconcile(ctx context.Context, now time.Time, limit int) ([]store.ReconcileCandidate, error) + MarkReconciled(ctx context.Context, id string, generation int64, now time.Time) error + MarkReconcileFailure(ctx context.Context, id string, failureCount int, nextAttempt time.Time, errorCode string, now time.Time) error +} + +type MediaPaths interface { + EnsurePath(ctx context.Context, name, source string) (bool, error) +} + +type Reconciler struct { + repository Repository + discovery onvif.Adapter + media MediaPaths + now func() time.Time + baseBackoff time.Duration + maxBackoff time.Duration + batchSize int +} + +func New(repository Repository, discovery onvif.Adapter, media MediaPaths) *Reconciler { + return &Reconciler{ + repository: repository, discovery: discovery, media: media, + now: time.Now, baseBackoff: time.Second, maxBackoff: time.Minute, batchSize: defaultBatchSize, + } +} + +func (r *Reconciler) RunOnce(ctx context.Context) error { + now := r.now().UTC() + candidates, err := r.repository.ListDueReconcile(ctx, now, r.batchSize) + if err != nil { + return fmt.Errorf("list reconciliation candidates: %w", err) + } + var runErrors []error + for _, candidate := range candidates { + if err := ctx.Err(); err != nil { + return err + } + if err := r.reconcileOne(ctx, candidate, now); err != nil { + runErrors = append(runErrors, fmt.Errorf("reconcile device %s: %w", candidate.Device.ID, err)) + } + } + return errors.Join(runErrors...) +} + +func (r *Reconciler) reconcileOne(ctx context.Context, candidate store.ReconcileCandidate, now time.Time) error { + result, err := r.discovery.Probe(ctx, onvif.Target{ + EndpointRef: candidate.Device.EndpointRef, CredentialRef: candidate.Device.CredentialRef, + }) + if err == nil { + err = validateStreamURI(result.StreamURI) + } + if err == nil { + _, err = r.media.EnsurePath(ctx, candidate.Device.PathName, result.StreamURI) + } + if err == nil { + return r.repository.MarkReconciled(ctx, candidate.Device.ID, candidate.Device.Generation, now) + } + if ctx.Err() != nil { + return ctx.Err() + } + failureCount := candidate.FailureCount + 1 + nextAttempt := now.Add(r.backoff(failureCount)) + errorCode := string(onvif.CodeOf(err)) + var onvifError *onvif.Error + if !errors.As(err, &onvifError) { + errorCode = "media_error" + } + if markErr := r.repository.MarkReconcileFailure( + ctx, candidate.Device.ID, failureCount, nextAttempt, errorCode, now, + ); markErr != nil { + return errors.Join(err, fmt.Errorf("persist reconcile failure: %w", markErr)) + } + return err +} + +func validateStreamURI(value string) error { + parsed, err := url.Parse(value) + if err != nil || parsed.Host == "" || (parsed.Scheme != "rtsp" && parsed.Scheme != "rtsps") { + return &onvif.Error{Code: onvif.ErrorInvalidReply, Err: fmt.Errorf("stream URI has invalid scheme or host")} + } + return nil +} + +func (r *Reconciler) backoff(failureCount int) time.Duration { + if failureCount <= 1 { + return r.baseBackoff + } + value := r.baseBackoff + for step := 1; step < failureCount; step++ { + if value >= r.maxBackoff/2 { + return r.maxBackoff + } + value *= 2 + } + if value > r.maxBackoff { + return r.maxBackoff + } + return value +} + +func (r *Reconciler) Run(ctx context.Context, interval time.Duration, report func(error)) { + if err := r.RunOnce(ctx); err != nil && ctx.Err() == nil && report != nil { + report(err) + } + ticker := time.NewTicker(interval) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + if err := r.RunOnce(ctx); err != nil && ctx.Err() == nil && report != nil { + report(err) + } + } + } +} diff --git a/Sense/internal/reconcile/reconciler_test.go b/Sense/internal/reconcile/reconciler_test.go new file mode 100644 index 0000000..4efa0f0 --- /dev/null +++ b/Sense/internal/reconcile/reconciler_test.go @@ -0,0 +1,159 @@ +package reconcile + +import ( + "context" + "errors" + "path/filepath" + "testing" + "time" + + "yovision/sense/internal/device" + "yovision/sense/internal/onvif" + "yovision/sense/internal/store" +) + +type recordingMedia struct { + calls int + changed int + paths map[string]string +} + +func (m *recordingMedia) EnsurePath(_ context.Context, name, source string) (bool, error) { + m.calls++ + if m.paths == nil { + m.paths = make(map[string]string) + } + if m.paths[name] == source { + return false, nil + } + m.paths[name] = source + m.changed++ + return true, nil +} + +func TestReconcileConvergesOnceAndPersistsGeneration(t *testing.T) { + t.Parallel() + repository := openRepository(t, filepath.Join(t.TempDir(), "sense.db")) + createReconcileDevice(t, repository) + discovery := onvif.NewFake(map[string]onvif.FakeScenario{ + "onvif://camera-1": {Result: onvif.ProbeResult{ + Profiles: []onvif.Profile{{Token: "main", Name: "Main", VideoEncoder: true}}, + StreamURI: "rtsp://media.invalid/camera-1", + }}, + }) + media := &recordingMedia{} + reconciler := New(repository, discovery, media) + reconciler.now = func() time.Time { return time.Date(2026, 8, 4, 0, 0, 0, 0, time.UTC) } + if err := reconciler.RunOnce(context.Background()); err != nil { + t.Fatal(err) + } + if err := reconciler.RunOnce(context.Background()); err != nil { + t.Fatal(err) + } + if media.calls != 1 || media.changed != 1 { + t.Fatalf("converged generation should not repeat: calls=%d changed=%d", media.calls, media.changed) + } +} + +func TestBackoffSurvivesStoreRestart(t *testing.T) { + t.Parallel() + databasePath := filepath.Join(t.TempDir(), "sense.db") + repository := openRepository(t, databasePath) + createReconcileDevice(t, repository) + failingDiscovery := onvif.NewFake(map[string]onvif.FakeScenario{ + "onvif://camera-1": {ProbeError: onvif.ErrorAuthentication}, + }) + media := &recordingMedia{} + initialTime := time.Date(2026, 8, 4, 0, 0, 0, 0, time.UTC) + first := New(repository, failingDiscovery, media) + first.now = func() time.Time { return initialTime } + err := first.RunOnce(context.Background()) + if err == nil || onvif.CodeOf(err) != onvif.ErrorAuthentication { + t.Fatalf("expected authentication failure, got %v", err) + } + if err := repository.Close(); err != nil { + t.Fatal(err) + } + + reopened, err := store.OpenSQLite(context.Background(), "file:"+filepath.ToSlash(databasePath)) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = reopened.Close() }) + successDiscovery := onvif.NewFake(map[string]onvif.FakeScenario{ + "onvif://camera-1": {Result: onvif.ProbeResult{ + Profiles: []onvif.Profile{{Token: "main", VideoEncoder: true}}, + StreamURI: "rtsp://media.invalid/camera-1", + }}, + }) + afterRestart := New(reopened, successDiscovery, media) + afterRestart.now = func() time.Time { return initialTime.Add(500 * time.Millisecond) } + if err := afterRestart.RunOnce(context.Background()); err != nil { + t.Fatal(err) + } + if media.calls != 0 { + t.Fatal("backoff window must survive restart") + } + afterRestart.now = func() time.Time { return initialTime.Add(time.Second) } + if err := afterRestart.RunOnce(context.Background()); err != nil { + t.Fatal(err) + } + if media.calls != 1 { + t.Fatal("device must retry when persisted backoff expires") + } +} + +func TestCancellationDoesNotPersistFailure(t *testing.T) { + t.Parallel() + repository := openRepository(t, filepath.Join(t.TempDir(), "sense.db")) + createReconcileDevice(t, repository) + discovery := onvif.NewFake(map[string]onvif.FakeScenario{ + "onvif://camera-1": { + DelayMillis: 100, + Result: onvif.ProbeResult{ + Profiles: []onvif.Profile{{Token: "main", VideoEncoder: true}}, + StreamURI: "rtsp://media.invalid/camera-1", + }, + }, + }) + reconciler := New(repository, discovery, &recordingMedia{}) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Millisecond) + defer cancel() + err := reconciler.RunOnce(ctx) + if !errors.Is(err, context.DeadlineExceeded) { + t.Fatalf("expected cancellation, got %v", err) + } + candidates, err := repository.ListDueReconcile(context.Background(), time.Now().Add(time.Hour), 10) + if err != nil { + t.Fatal(err) + } + if len(candidates) != 1 || candidates[0].FailureCount != 0 { + t.Fatalf("cancellation must not consume retry budget: %+v", candidates) + } +} + +func openRepository(t *testing.T, path string) *store.SQLite { + t.Helper() + repository, err := store.OpenSQLite(context.Background(), "file:"+filepath.ToSlash(path)) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = repository.Close() }) + return repository +} + +func createReconcileDevice(t *testing.T, repository *store.SQLite) { + t.Helper() + ctx := context.Background() + if err := repository.EnsureSite(ctx, device.Site{TenantID: "tenant", ID: "site", Name: "Site"}); err != nil { + t.Fatal(err) + } + if err := repository.CreateDevice(ctx, device.Device{ + ID: "camera-1", TenantID: "tenant", SiteID: "site", SerialNumber: "camera-1", Name: "Camera 1", + Modality: device.ModalityVideo, Capabilities: []device.Capability{device.CapabilityVideoCapture}, + DesiredState: device.DesiredEnabled, ActualState: device.ActualPending, + EndpointRef: "onvif://camera-1", CredentialRef: "secret://camera-1", PathName: "camera-1", + }); err != nil { + t.Fatal(err) + } +} diff --git a/Sense/internal/store/sqlite.go b/Sense/internal/store/sqlite.go new file mode 100644 index 0000000..4cf93f6 --- /dev/null +++ b/Sense/internal/store/sqlite.go @@ -0,0 +1,594 @@ +// Package store persists the Sense desired state and reconciliation progress. +package store + +import ( + "context" + "database/sql" + "errors" + "fmt" + "os" + "path/filepath" + "sort" + "strings" + "time" + + _ "modernc.org/sqlite" + + "yovision/sense/internal/device" +) + +var ErrNotFound = errors.New("store record not found") + +type ReconcileCandidate struct { + Device device.Device + FailureCount int + NextAttempt *time.Time +} + +type SQLite struct { + db *sql.DB +} + +func OpenSQLite(ctx context.Context, dsn string) (*SQLite, error) { + if err := ensureSQLiteDirectory(dsn); err != nil { + return nil, err + } + db, err := sql.Open("sqlite", dsn) + if err != nil { + return nil, fmt.Errorf("open sqlite: %w", err) + } + // M1 runs one writer per edge instance. A single connection also gives + // deterministic quota transactions and avoids :memory: connection splits. + db.SetMaxOpenConns(1) + if err := db.PingContext(ctx); err != nil { + db.Close() + return nil, fmt.Errorf("ping sqlite: %w", err) + } + store := &SQLite{db: db} + if err := store.Migrate(ctx); err != nil { + db.Close() + return nil, err + } + return store, nil +} + +func (s *SQLite) Close() error { + return s.db.Close() +} + +func ensureSQLiteDirectory(dsn string) error { + if !strings.HasPrefix(dsn, "file:") { + return nil + } + path := strings.TrimPrefix(dsn, "file:") + path = strings.SplitN(path, "?", 2)[0] + if path == "" || path == ":memory:" || strings.HasPrefix(path, ":memory:") { + return nil + } + directory := filepath.Dir(filepath.FromSlash(path)) + if directory == "." { + return nil + } + if err := os.MkdirAll(directory, 0o750); err != nil { + return fmt.Errorf("create sqlite directory: %w", err) + } + return nil +} + +func (s *SQLite) Migrate(ctx context.Context) error { + if _, err := s.db.ExecContext(ctx, `PRAGMA foreign_keys = ON`); err != nil { + return fmt.Errorf("enable sqlite foreign keys: %w", err) + } + if _, err := s.db.ExecContext(ctx, `PRAGMA busy_timeout = 5000`); err != nil { + return fmt.Errorf("configure sqlite busy timeout: %w", err) + } + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("begin migration: %w", err) + } + defer tx.Rollback() + + for _, statement := range migrationStatements { + if _, err := tx.ExecContext(ctx, statement); err != nil { + return fmt.Errorf("apply sqlite migration: %w", err) + } + } + if _, err := tx.ExecContext(ctx, ` + INSERT INTO sense_schema_migrations(version, applied_at) + VALUES (1, ?) + ON CONFLICT(version) DO NOTHING`, formatTime(time.Now())); err != nil { + return fmt.Errorf("record sqlite migration: %w", err) + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("commit sqlite migration: %w", err) + } + return nil +} + +var migrationStatements = []string{ + `CREATE TABLE IF NOT EXISTS sense_schema_migrations ( + version INTEGER PRIMARY KEY, + applied_at TEXT NOT NULL + )`, + `CREATE TABLE IF NOT EXISTS sense_sites ( + tenant_id TEXT NOT NULL, + id TEXT NOT NULL, + name TEXT NOT NULL, + max_video_channels INTEGER NOT NULL DEFAULT 16 CHECK (max_video_channels BETWEEN 1 AND 128), + PRIMARY KEY (tenant_id, id) + )`, + `CREATE TABLE IF NOT EXISTS sense_devices ( + id TEXT PRIMARY KEY, + tenant_id TEXT NOT NULL, + site_id TEXT NOT NULL, + serial_number TEXT NOT NULL, + name TEXT NOT NULL, + modality TEXT NOT NULL, + desired_state TEXT NOT NULL CHECK (desired_state IN ('disabled', 'enabled')), + actual_state TEXT NOT NULL CHECK (actual_state IN ('pending', 'online', 'offline', 'failed')), + endpoint_ref TEXT NOT NULL DEFAULT '', + credential_ref TEXT NOT NULL DEFAULT '', + path_name TEXT NOT NULL DEFAULT '', + generation INTEGER NOT NULL, + created_at TEXT NOT NULL, + updated_at TEXT NOT NULL, + UNIQUE (tenant_id, site_id, serial_number), + FOREIGN KEY (tenant_id, site_id) REFERENCES sense_sites(tenant_id, id) + )`, + `CREATE TABLE IF NOT EXISTS sense_device_capabilities ( + device_id TEXT NOT NULL, + capability TEXT NOT NULL, + PRIMARY KEY (device_id, capability), + FOREIGN KEY (device_id) REFERENCES sense_devices(id) ON DELETE CASCADE + )`, + `CREATE TABLE IF NOT EXISTS sense_reconcile_state ( + device_id TEXT PRIMARY KEY, + failure_count INTEGER NOT NULL DEFAULT 0, + next_attempt_at TEXT, + last_error_code TEXT, + observed_generation INTEGER NOT NULL DEFAULT 0, + updated_at TEXT NOT NULL, + FOREIGN KEY (device_id) REFERENCES sense_devices(id) ON DELETE CASCADE + )`, + `CREATE INDEX IF NOT EXISTS sense_devices_site_state_idx + ON sense_devices(tenant_id, site_id, desired_state)`, + `CREATE UNIQUE INDEX IF NOT EXISTS sense_devices_path_name_idx + ON sense_devices(path_name) WHERE path_name <> ''`, + `CREATE INDEX IF NOT EXISTS sense_reconcile_due_idx + ON sense_reconcile_state(next_attempt_at)`, +} + +func (s *SQLite) EnsureSite(ctx context.Context, site device.Site) error { + site.ApplyDefaults() + if err := site.Validate(); err != nil { + return fmt.Errorf("validate site: %w", err) + } + _, err := s.db.ExecContext(ctx, ` + INSERT INTO sense_sites(tenant_id, id, name, max_video_channels) + VALUES (?, ?, ?, ?) + ON CONFLICT(tenant_id, id) DO UPDATE SET + name = excluded.name, + max_video_channels = excluded.max_video_channels`, + site.TenantID, site.ID, site.Name, site.MaxVideoChannels) + if err != nil { + return fmt.Errorf("ensure site: %w", err) + } + return nil +} + +func (s *SQLite) CreateDevice(ctx context.Context, value device.Device) error { + if value.Generation == 0 { + value.Generation = 1 + } + if value.ActualState == "" { + value.ActualState = device.ActualPending + } + if err := value.Validate(); err != nil { + return fmt.Errorf("validate device: %w", err) + } + now := time.Now().UTC() + if value.CreatedAt.IsZero() { + value.CreatedAt = now + } + value.UpdatedAt = now + + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("begin create device: %w", err) + } + defer tx.Rollback() + if value.ConsumesVideoChannel() { + if err := checkVideoQuota(ctx, tx, value.TenantID, value.SiteID); err != nil { + return err + } + } + _, err = tx.ExecContext(ctx, ` + INSERT INTO sense_devices( + id, tenant_id, site_id, serial_number, name, modality, + desired_state, actual_state, endpoint_ref, credential_ref, + path_name, generation, created_at, updated_at + ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`, + value.ID, value.TenantID, value.SiteID, value.SerialNumber, value.Name, + value.Modality, value.DesiredState, value.ActualState, value.EndpointRef, + value.CredentialRef, value.PathName, value.Generation, + formatTime(value.CreatedAt), formatTime(value.UpdatedAt)) + if err != nil { + return fmt.Errorf("insert device: %w", err) + } + for _, capability := range sortedCapabilities(value.Capabilities) { + if _, err := tx.ExecContext(ctx, + `INSERT INTO sense_device_capabilities(device_id, capability) VALUES (?, ?)`, + value.ID, capability); err != nil { + return fmt.Errorf("insert device capability: %w", err) + } + } + if _, err := tx.ExecContext(ctx, ` + INSERT INTO sense_reconcile_state(device_id, updated_at) + VALUES (?, ?)`, value.ID, formatTime(now)); err != nil { + return fmt.Errorf("insert reconcile state: %w", err) + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("commit create device: %w", err) + } + return nil +} + +func checkVideoQuota(ctx context.Context, tx *sql.Tx, tenantID, siteID string) error { + var limit int + err := tx.QueryRowContext(ctx, + `SELECT max_video_channels FROM sense_sites WHERE tenant_id = ? AND id = ?`, + tenantID, siteID).Scan(&limit) + if errors.Is(err, sql.ErrNoRows) { + return fmt.Errorf("site %s/%s: %w", tenantID, siteID, ErrNotFound) + } + if err != nil { + return fmt.Errorf("read site quota: %w", err) + } + var current int + err = tx.QueryRowContext(ctx, ` + SELECT COUNT(*) + FROM sense_devices d + JOIN sense_device_capabilities c ON c.device_id = d.id + WHERE d.tenant_id = ? AND d.site_id = ? + AND d.desired_state = 'enabled' + AND c.capability = 'video_capture'`, tenantID, siteID).Scan(¤t) + if err != nil { + return fmt.Errorf("count site video channels: %w", err) + } + if current >= limit { + return &device.QuotaExceededError{TenantID: tenantID, SiteID: siteID, Limit: limit} + } + return nil +} + +func (s *SQLite) SetDesiredState(ctx context.Context, id string, desired device.DesiredState) error { + if desired != device.DesiredEnabled && desired != device.DesiredDisabled { + return fmt.Errorf("invalid desired state %q", desired) + } + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("begin desired-state update: %w", err) + } + defer tx.Rollback() + + var tenantID, siteID, endpointRef, pathName string + var current device.DesiredState + err = tx.QueryRowContext(ctx, + `SELECT tenant_id, site_id, desired_state, endpoint_ref, path_name FROM sense_devices WHERE id = ?`, id). + Scan(&tenantID, &siteID, ¤t, &endpointRef, &pathName) + if errors.Is(err, sql.ErrNoRows) { + return ErrNotFound + } + if err != nil { + return fmt.Errorf("read device desired state: %w", err) + } + if current == desired { + return tx.Commit() + } + if desired == device.DesiredEnabled { + var videoCapability int + if err := tx.QueryRowContext(ctx, ` + SELECT COUNT(*) FROM sense_device_capabilities + WHERE device_id = ? AND capability = 'video_capture'`, id).Scan(&videoCapability); err != nil { + return fmt.Errorf("read video capability: %w", err) + } + if videoCapability > 0 { + if strings.TrimSpace(endpointRef) == "" || strings.TrimSpace(pathName) == "" { + return fmt.Errorf("enabled video devices require endpoint ref and path name") + } + if err := checkVideoQuota(ctx, tx, tenantID, siteID); err != nil { + return err + } + } + } + result, err := tx.ExecContext(ctx, ` + UPDATE sense_devices + SET desired_state = ?, actual_state = 'pending', generation = generation + 1, updated_at = ? + WHERE id = ?`, desired, formatTime(time.Now()), id) + if err != nil { + return fmt.Errorf("update desired state: %w", err) + } + if affected, _ := result.RowsAffected(); affected != 1 { + return ErrNotFound + } + if _, err := tx.ExecContext(ctx, ` + UPDATE sense_reconcile_state + SET failure_count = 0, next_attempt_at = NULL, last_error_code = NULL, updated_at = ? + WHERE device_id = ?`, formatTime(time.Now()), id); err != nil { + return fmt.Errorf("reset reconcile state: %w", err) + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("commit desired-state update: %w", err) + } + return nil +} + +func (s *SQLite) GetDevice(ctx context.Context, id string) (device.Device, error) { + row := s.db.QueryRowContext(ctx, deviceSelect+` WHERE d.id = ?`, id) + value, err := scanDevice(row) + if errors.Is(err, sql.ErrNoRows) { + return device.Device{}, ErrNotFound + } + if err != nil { + return device.Device{}, fmt.Errorf("get device: %w", err) + } + capabilities, err := s.capabilities(ctx, value.ID) + if err != nil { + return device.Device{}, err + } + value.Capabilities = capabilities + return value, nil +} + +func (s *SQLite) ListDueReconcile(ctx context.Context, now time.Time, limit int) ([]ReconcileCandidate, error) { + if limit <= 0 { + return nil, nil + } + rows, err := s.db.QueryContext(ctx, `SELECT `+deviceColumns+`, r.failure_count, r.next_attempt_at + FROM sense_devices d + JOIN sense_reconcile_state r ON r.device_id = d.id + WHERE d.desired_state = 'enabled' + AND EXISTS ( + SELECT 1 FROM sense_device_capabilities c + WHERE c.device_id = d.id AND c.capability = 'video_capture' + ) + AND (r.observed_generation < d.generation OR r.failure_count > 0) + AND (r.next_attempt_at IS NULL OR r.next_attempt_at <= ?) + ORDER BY d.updated_at, d.id + LIMIT ?`, formatTime(now), limit) + if err != nil { + return nil, fmt.Errorf("list due reconcile devices: %w", err) + } + candidates := make([]ReconcileCandidate, 0) + for rows.Next() { + var candidate ReconcileCandidate + var createdAt, updatedAt string + var nextAttempt sql.NullString + if err := rows.Scan( + &candidate.Device.ID, &candidate.Device.TenantID, &candidate.Device.SiteID, + &candidate.Device.SerialNumber, &candidate.Device.Name, &candidate.Device.Modality, + &candidate.Device.DesiredState, &candidate.Device.ActualState, + &candidate.Device.EndpointRef, &candidate.Device.CredentialRef, + &candidate.Device.PathName, &candidate.Device.Generation, + &createdAt, &updatedAt, &candidate.FailureCount, &nextAttempt, + ); err != nil { + rows.Close() + return nil, fmt.Errorf("scan due reconcile device: %w", err) + } + candidate.Device.CreatedAt, err = parseTime(createdAt) + if err != nil { + rows.Close() + return nil, err + } + candidate.Device.UpdatedAt, err = parseTime(updatedAt) + if err != nil { + rows.Close() + return nil, err + } + if nextAttempt.Valid { + value, parseErr := parseTime(nextAttempt.String) + if parseErr != nil { + rows.Close() + return nil, parseErr + } + candidate.NextAttempt = &value + } + candidates = append(candidates, candidate) + } + if err := rows.Close(); err != nil { + return nil, fmt.Errorf("close due reconcile rows: %w", err) + } + if err := rows.Err(); err != nil { + return nil, fmt.Errorf("iterate due reconcile devices: %w", err) + } + for index := range candidates { + capabilities, err := s.capabilities(ctx, candidates[index].Device.ID) + if err != nil { + return nil, err + } + candidates[index].Device.Capabilities = capabilities + } + return candidates, nil +} + +func (s *SQLite) ListEnabledVideoDevices(ctx context.Context, limit int) ([]device.Device, error) { + if limit <= 0 { + return nil, nil + } + rows, err := s.db.QueryContext(ctx, deviceSelect+` + WHERE d.desired_state = 'enabled' + AND EXISTS ( + SELECT 1 FROM sense_device_capabilities c + WHERE c.device_id = d.id AND c.capability = 'video_capture' + ) + ORDER BY d.id LIMIT ?`, limit) + if err != nil { + return nil, fmt.Errorf("list enabled video devices: %w", err) + } + values := make([]device.Device, 0) + for rows.Next() { + value, err := scanDevice(rows) + if err != nil { + rows.Close() + return nil, fmt.Errorf("scan enabled video device: %w", err) + } + values = append(values, value) + } + if err := rows.Close(); err != nil { + return nil, fmt.Errorf("close enabled video rows: %w", err) + } + if err := rows.Err(); err != nil { + return nil, fmt.Errorf("iterate enabled video devices: %w", err) + } + for index := range values { + capabilities, err := s.capabilities(ctx, values[index].ID) + if err != nil { + return nil, err + } + values[index].Capabilities = capabilities + } + return values, nil +} + +func (s *SQLite) MarkReconciled(ctx context.Context, id string, generation int64, now time.Time) error { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("begin reconciled update: %w", err) + } + defer tx.Rollback() + result, err := tx.ExecContext(ctx, ` + UPDATE sense_reconcile_state + SET failure_count = 0, next_attempt_at = NULL, last_error_code = NULL, + observed_generation = ?, updated_at = ? + WHERE device_id = ?`, generation, formatTime(now), id) + if err != nil { + return fmt.Errorf("mark device reconciled: %w", err) + } + if affected, _ := result.RowsAffected(); affected != 1 { + return ErrNotFound + } + if _, err := tx.ExecContext(ctx, ` + UPDATE sense_devices SET actual_state = 'pending', updated_at = ? WHERE id = ?`, + formatTime(now), id); err != nil { + return fmt.Errorf("mark reconciled device pending: %w", err) + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("commit reconciled update: %w", err) + } + return nil +} + +func (s *SQLite) MarkReconcileFailure(ctx context.Context, id string, failureCount int, nextAttempt time.Time, errorCode string, now time.Time) error { + tx, err := s.db.BeginTx(ctx, nil) + if err != nil { + return fmt.Errorf("begin reconcile failure update: %w", err) + } + defer tx.Rollback() + result, err := tx.ExecContext(ctx, ` + UPDATE sense_reconcile_state + SET failure_count = ?, next_attempt_at = ?, last_error_code = ?, updated_at = ? + WHERE device_id = ?`, failureCount, formatTime(nextAttempt), errorCode, formatTime(now), id) + if err != nil { + return fmt.Errorf("mark reconcile failure: %w", err) + } + if affected, _ := result.RowsAffected(); affected != 1 { + return ErrNotFound + } + if _, err := tx.ExecContext(ctx, ` + UPDATE sense_devices SET actual_state = 'failed', updated_at = ? WHERE id = ?`, + formatTime(now), id); err != nil { + return fmt.Errorf("mark failed device state: %w", err) + } + if err := tx.Commit(); err != nil { + return fmt.Errorf("commit reconcile failure update: %w", err) + } + return nil +} + +func (s *SQLite) UpdateActualState(ctx context.Context, id string, state device.ActualState, now time.Time) error { + if state != device.ActualPending && state != device.ActualOnline && state != device.ActualOffline && state != device.ActualFailed { + return fmt.Errorf("invalid actual state %q", state) + } + result, err := s.db.ExecContext(ctx, + `UPDATE sense_devices SET actual_state = ?, updated_at = ? WHERE id = ?`, + state, formatTime(now), id) + if err != nil { + return fmt.Errorf("update actual state: %w", err) + } + if affected, _ := result.RowsAffected(); affected != 1 { + return ErrNotFound + } + return nil +} + +const deviceColumns = `d.id, d.tenant_id, d.site_id, d.serial_number, d.name, d.modality, + d.desired_state, d.actual_state, d.endpoint_ref, d.credential_ref, + d.path_name, d.generation, d.created_at, d.updated_at` + +const deviceSelect = `SELECT ` + deviceColumns + ` FROM sense_devices d` + +type scanner interface { + Scan(dest ...any) error +} + +func scanDevice(row scanner) (device.Device, error) { + var value device.Device + var createdAt, updatedAt string + err := row.Scan( + &value.ID, &value.TenantID, &value.SiteID, &value.SerialNumber, + &value.Name, &value.Modality, &value.DesiredState, &value.ActualState, + &value.EndpointRef, &value.CredentialRef, &value.PathName, + &value.Generation, &createdAt, &updatedAt, + ) + if err != nil { + return device.Device{}, err + } + value.CreatedAt, err = parseTime(createdAt) + if err != nil { + return device.Device{}, err + } + value.UpdatedAt, err = parseTime(updatedAt) + if err != nil { + return device.Device{}, err + } + return value, nil +} + +func (s *SQLite) capabilities(ctx context.Context, id string) ([]device.Capability, error) { + rows, err := s.db.QueryContext(ctx, + `SELECT capability FROM sense_device_capabilities WHERE device_id = ? ORDER BY capability`, id) + if err != nil { + return nil, fmt.Errorf("list device capabilities: %w", err) + } + defer rows.Close() + values := make([]device.Capability, 0) + for rows.Next() { + var value device.Capability + if err := rows.Scan(&value); err != nil { + return nil, fmt.Errorf("scan device capability: %w", err) + } + values = append(values, value) + } + if err := rows.Err(); err != nil { + return nil, fmt.Errorf("iterate device capabilities: %w", err) + } + return values, nil +} + +func sortedCapabilities(values []device.Capability) []device.Capability { + result := append([]device.Capability(nil), values...) + sort.Slice(result, func(i, j int) bool { return result[i] < result[j] }) + return result +} + +func formatTime(value time.Time) string { + return value.UTC().Format(time.RFC3339Nano) +} + +func parseTime(value string) (time.Time, error) { + parsed, err := time.Parse(time.RFC3339Nano, value) + if err != nil { + return time.Time{}, fmt.Errorf("parse stored timestamp: %w", err) + } + return parsed, nil +} diff --git a/Sense/internal/store/sqlite_test.go b/Sense/internal/store/sqlite_test.go new file mode 100644 index 0000000..ca2a273 --- /dev/null +++ b/Sense/internal/store/sqlite_test.go @@ -0,0 +1,168 @@ +package store + +import ( + "context" + "errors" + "fmt" + "path/filepath" + "testing" + + "yovision/sense/internal/device" +) + +func TestDefaultVideoQuotaRejectsSeventeenthChannel(t *testing.T) { + t.Parallel() + store := openTestStore(t) + ctx := context.Background() + if err := store.EnsureSite(ctx, device.Site{TenantID: "tenant-a", ID: "site-a", Name: "Site A"}); err != nil { + t.Fatal(err) + } + for index := 1; index <= device.DefaultVideoChannels; index++ { + if err := store.CreateDevice(ctx, videoDevice(index, "tenant-a", "site-a")); err != nil { + t.Fatalf("create channel %d: %v", index, err) + } + } + err := store.CreateDevice(ctx, videoDevice(17, "tenant-a", "site-a")) + var quotaError *device.QuotaExceededError + if !errors.As(err, "aError) || quotaError.Limit != 16 { + t.Fatalf("expected 16-channel quota error, got %v", err) + } +} + +func TestConfiguredMaximumAccepts128AndRejects129(t *testing.T) { + t.Parallel() + store := openTestStore(t) + ctx := context.Background() + if err := store.EnsureSite(ctx, device.Site{ + TenantID: "tenant-b", ID: "site-b", Name: "Site B", MaxVideoChannels: 128, + }); err != nil { + t.Fatal(err) + } + for index := 1; index <= 128; index++ { + if err := store.CreateDevice(ctx, videoDevice(index, "tenant-b", "site-b")); err != nil { + t.Fatalf("create channel %d: %v", index, err) + } + } + err := store.CreateDevice(ctx, videoDevice(129, "tenant-b", "site-b")) + var quotaError *device.QuotaExceededError + if !errors.As(err, "aError) || quotaError.Limit != 128 { + t.Fatalf("expected 128-channel quota error, got %v", err) + } +} + +func TestSiteRejectsCapacityAbove128(t *testing.T) { + t.Parallel() + store := openTestStore(t) + err := store.EnsureSite(context.Background(), device.Site{ + TenantID: "tenant", ID: "site", Name: "Site", MaxVideoChannels: 129, + }) + if err == nil { + t.Fatal("expected capacity 129 to be rejected") + } +} + +func TestNonVideoDeviceDoesNotConsumeVideoQuota(t *testing.T) { + t.Parallel() + store := openTestStore(t) + ctx := context.Background() + if err := store.EnsureSite(ctx, device.Site{ + TenantID: "tenant", ID: "site", Name: "Site", MaxVideoChannels: 1, + }); err != nil { + t.Fatal(err) + } + radar := device.Device{ + ID: "radar-1", TenantID: "tenant", SiteID: "site", SerialNumber: "radar-1", + Name: "Radar", Modality: device.ModalityRadar, + Capabilities: []device.Capability{device.CapabilityTelemetry}, + DesiredState: device.DesiredEnabled, ActualState: device.ActualPending, + } + if err := store.CreateDevice(ctx, radar); err != nil { + t.Fatal(err) + } + if err := store.CreateDevice(ctx, videoDevice(1, "tenant", "site")); err != nil { + t.Fatalf("video channel should remain available: %v", err) + } +} + +func TestEnablingSeventeenthVideoDeviceIsRejected(t *testing.T) { + t.Parallel() + store := openTestStore(t) + ctx := context.Background() + if err := store.EnsureSite(ctx, device.Site{TenantID: "tenant-c", ID: "site-c", Name: "Site C"}); err != nil { + t.Fatal(err) + } + for index := 1; index <= 17; index++ { + value := videoDevice(index, "tenant-c", "site-c") + if index == 17 { + value.DesiredState = device.DesiredDisabled + } + if err := store.CreateDevice(ctx, value); err != nil { + t.Fatalf("create device %d: %v", index, err) + } + } + err := store.SetDesiredState(ctx, "camera-017", device.DesiredEnabled) + var quotaError *device.QuotaExceededError + if !errors.As(err, "aError) || quotaError.Limit != 16 { + t.Fatalf("expected enable to enforce quota, got %v", err) + } + value, err := store.GetDevice(ctx, "camera-017") + if err != nil { + t.Fatal(err) + } + if value.DesiredState != device.DesiredDisabled { + t.Fatal("failed enable must leave the existing desired state unchanged") + } +} + +func TestLowerQuotaDoesNotDisableExistingStreams(t *testing.T) { + t.Parallel() + store := openTestStore(t) + ctx := context.Background() + if err := store.EnsureSite(ctx, device.Site{ + TenantID: "tenant-d", ID: "site-d", Name: "Site D", MaxVideoChannels: 2, + }); err != nil { + t.Fatal(err) + } + for index := 1; index <= 2; index++ { + if err := store.CreateDevice(ctx, videoDevice(index, "tenant-d", "site-d")); err != nil { + t.Fatal(err) + } + } + if err := store.EnsureSite(ctx, device.Site{ + TenantID: "tenant-d", ID: "site-d", Name: "Site D", MaxVideoChannels: 1, + }); err != nil { + t.Fatal(err) + } + for index := 1; index <= 2; index++ { + value, err := store.GetDevice(ctx, fmt.Sprintf("camera-%03d", index)) + if err != nil { + t.Fatal(err) + } + if value.DesiredState != device.DesiredEnabled { + t.Fatalf("existing channel %d was disabled", index) + } + } +} + +func openTestStore(t *testing.T) *SQLite { + t.Helper() + dsn := "file:" + filepath.ToSlash(filepath.Join(t.TempDir(), "sense.db")) + store, err := OpenSQLite(context.Background(), dsn) + if err != nil { + t.Fatal(err) + } + t.Cleanup(func() { _ = store.Close() }) + return store +} + +func videoDevice(index int, tenantID, siteID string) device.Device { + id := fmt.Sprintf("camera-%03d", index) + return device.Device{ + ID: id, TenantID: tenantID, SiteID: siteID, SerialNumber: id, Name: id, + Modality: device.ModalityVideo, + Capabilities: []device.Capability{device.CapabilityVideoCapture, device.CapabilitySpatialRule}, + DesiredState: device.DesiredEnabled, ActualState: device.ActualPending, + EndpointRef: "onvif://" + id, CredentialRef: "secret://" + id, + PathName: "sense/" + tenantID + "/" + siteID + "/" + id, + } +} diff --git a/docs/00-ai-start-here.md b/docs/00-ai-start-here.md index 23c285c..9fb9b5b 100644 --- a/docs/00-ai-start-here.md +++ b/docs/00-ai-start-here.md @@ -40,7 +40,7 @@ MVP 以默认 16 路跑通一个场景的端到端闭环;架构、数据和 UI ## 当前阶段 -当前为 **M0:兼容性验证 + 需求定稿**。 +当前为 **M0 实机验证暂缓、M1 Sense 无实机骨架并行推进**。无实机测试不能替代 M0 白名单或 M1 五路实机出口。 优先路径: @@ -85,6 +85,10 @@ MVP 以默认 16 路跑通一个场景的端到端闭环;架构、数据和 UI python scripts/validate_agent_context.py python -m unittest discover -s tests -p "test_*.py" python scripts/validate_harness_governance.py +go -C Sense generate ./internal/mtx +go -C Sense test ./... +go -C Sense vet ./... +go -C Sense build ./... ``` -当前没有生产代码构建命令。代码出现后,以 [`03-tech-stack.md`](03-tech-stack.md) 的验证矩阵和当前任务门禁为准。 +日常优先运行根目录 `./init.ps1` 或 `./init.sh`,它会执行上述治理、生成、测试、静态检查和构建门禁。Sense 本地启动为 `go -C Sense run ./cmd/sense-api`;默认只监听回环地址,具体配置、MediaMTX 版本与校验方法见 [`03-tech-stack.md`](03-tech-stack.md) 和 [`../Sense/README.md`](../Sense/README.md)。 diff --git a/docs/03-tech-stack.md b/docs/03-tech-stack.md index 17b01df..2ac8ab8 100644 --- a/docs/03-tech-stack.md +++ b/docs/03-tech-stack.md @@ -28,6 +28,18 @@ | 指标 | Prometheus + Grafana | 三系统统一可观测入口 | | 追踪 | OpenTelemetry + Jaeger | 端到端事件链路 | +### 1.1 Sense M1 冻结版本(T-003) + +| 组件 | 冻结版本 | 许可证 / 校验 | 升级与退出路线 | +| --- | --- | --- | --- | +| Go | `1.26.5`(`go 1.26.0` + `toolchain go1.26.5`) | BSD-3-Clause;从 `go.dev/dl` 校验,Windows amd64 ZIP SHA-256 `97e6b2a833b6d89f9ff17d25419ac0a7e3b482a044e9ab18cdef834bd834fd38` | 跟随仍受支持的 Go 小版本,先在 CI/目标平台跑全量测试再升级;标准 Go module,无私有运行时绑定 | +| SQLite driver | `modernc.org/sqlite v1.54.0` | BSD-3-Clause;module sum `h1:JCxR4qwkJvOaqAoYcgDoO25Nc+ROg6EJ2LfBVzdrgog=`,go.mod sum `h1:4ntCLuNmnH8+GNqjka1wNg7KJd5/Hi5FYp8K+XQ7GZw=` | 选择无 CGO driver 以简化 Windows/边缘部署;只经 `database/sql` 与 repository 使用,可替换 driver;生产仍迁移到 PostgreSQL `sense` schema | +| MediaMTX | `v1.19.3` | MIT;官方 release `checksums.sha256`:Windows amd64 `5d82148d1032a6a190d9909a2997d9989457aaadf49af87dd02cd4512d31bebe`、Linux amd64 `a7ba21268fccda3ebc43fdad76b87fddb85ce77e725b5cb637bca724b5394fbe`、Linux arm64 `9e5b38a5b5fcab1916341b024031b2fc5dc6a2059baed9ba3f3b0d3768d231a8` | 独立进程,不链接到 Sense;升级时先更新 vendored OpenAPI、重新生成并跑假服务契约测试;可通过 `mtx` port 更换媒体数据面 | +| oapi-codegen | `v2.8.0` | Apache-2.0;module sum `h1:s4hxMxuqtR8jPzXkBTtFwY/SBuj3gEAYikmbBSdtLMM=`,go.mod sum `h1:yae2TI9IYB5vxQ35gFrpXh9L5H1eJv4MAUK1jumGMTo=` | 仅为构建工具;版本锁在 module tool dependency,生成文件与薄封装分离;升级后必须重新生成并检查 diff | +| oapi-codegen runtime | `v1.6.0` | Apache-2.0;module sum `h1:7Xx+GlueD6nRuyKoCPzL434Jfi3BetbiJOrzCHp/VPU=`,go.mod sum `h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU=` | 生成客户端的最小运行时;与生成器一起升级并跑假 HTTP 契约测试,退出时随生成客户端一并替换 | + +MediaMTX 官方 `v1.19.3` OpenAPI 固定保存于 `Sense/api/vendor/mediamtx-v1.19.3.openapi.yaml`,SHA-256 为 `a2b58195f1ec76541e124b5de4ee54645e5a3e25f70c4a73acc4a44d6f2b9c52`。下载二进制后必须对照上表或官方同版 `checksums.sha256`,不得使用浮动 `latest` URL。SQLite `v1.56.0` 在本决策日刚发布,T-003 不追新;后续依赖升级单独评审。 + ## 2. 外部项目边界 - MiBeeNvr:只用于 M0 隔离实验室、ONVIF兼容性和交互参考,不作为生产依赖。 @@ -37,7 +49,7 @@ ## 3. 待冻结项 -- Go、Python、PostgreSQL、MediaMTX、Savant/DeepStream 的精确版本。 +- Python、PostgreSQL、Savant/DeepStream 的精确版本;Go 与 MediaMTX 已为 Sense M1 冻结,后续阶段可按升级流程调整。 - Bell 前端框架和组件库。 - 事件投递 transport 从 HTTP 起步还是直接采用消息总线。 - 目标 GPU/边缘硬件、解码能力和每 worker 的 `max_sources`。 @@ -48,7 +60,7 @@ ## 4. 当前标准入口 -仓库当前只有文档和契约,未产生可构建生产代码。根目录脚本执行文档治理验证: +Sense M1 骨架建立后,根目录脚本同步 Go 依赖并执行治理与 Sense 验证: ```powershell ./init.ps1 @@ -60,6 +72,17 @@ WSL/Linux/macOS/Git Bash: ./init.sh ``` +Sense 单独执行: + +```powershell +go -C Sense mod download +go -C Sense generate ./internal/mtx +go -C Sense test ./... +go -C Sense vet ./... +go -C Sense build ./... +go -C Sense run ./cmd/sense-api +``` + 直接验证: ```powershell @@ -74,7 +97,7 @@ python scripts/validate_harness_governance.py | --- | --- | --- | --- | | Harness 文档/任务/Gitea 模板 | 上述三条 Python 命令 | 任一治理协议、清单或任务 schema 变化 | 不适用 | | `docs/raw/contracts/` | JSON Schema 校验 + 契约代码断言(实现后补命令) | schema/示例/mapper 任一变化 | 生产者与消费者联合评审 | -| Sense Go | `go test ./...`、`go vet ./...`(代码出现后) | ONVIF、存储、MediaMTX、对账或公共 API 变化 | 命中设备任务时使用指定摄像头矩阵 | +| Sense Go | `go -C Sense generate ./internal/mtx`、`go -C Sense test ./...`、`go -C Sense vet ./...`、`go -C Sense build ./...` | ONVIF、存储、MediaMTX、对账或公共 API 变化 | T-003 为无实机;命中 T-006 等设备任务时使用指定摄像头矩阵 | | Brain Python | 单元测试、类型/格式检查(命令待项目脚手架冻结) | mapper、判定状态机、模型接口变化 | 命中模型任务时用冻结数据集和目标硬件 | | Bell Go/Web | 后端测试 + 前端 lint/test/build(命令待脚手架冻结) | schema、RBAC、预警状态机或公共 UI 变化 | P0 流程由产品/值班角色验收 | | 容量/分片 | 任务内基准脚本 | 16/64/128 路里程碑 | 目标网络、媒体和 GPU 硬件必需 | diff --git a/docs/06-tasks.md b/docs/06-tasks.md index 6c52cf4..aa1cd01 100644 --- a/docs/06-tasks.md +++ b/docs/06-tasks.md @@ -14,6 +14,7 @@ 出口:5 路自动建 path、探活、断线重建;使用 MediaMTX 生产数据面,完整 MiBeeNvr 不替代生产基线。 - T-003:建立无需真实摄像头即可验证的 Sense Go 脚手架、设备台账、ONVIF port/fake、MediaMTX 生成客户端与薄封装;完成不代表 M0/M1 出口。 +- T-003 只冻结 `/healthz`、`/readyz` 运维探针,设备管理公共 API 留给后续契约任务;真实 ONVIF adapter 不用 fake 冒充。 - T-006:在 T-001 白名单与 T-003 骨架之上完成真实摄像头 5 路自动建 path、探活、断线恢复和 MediaMTX 集成验收。 - T-001 暂缓期间可推进 T-003,但 T-006 和 M1 出口继续受真实设备证据阻塞。 diff --git a/docs/api.md b/docs/api.md index 1c240a8..c70ea8b 100644 --- a/docs/api.md +++ b/docs/api.md @@ -42,6 +42,29 @@ Sense 使用 MediaMTX 官方 OpenAPI 生成客户端并加薄封装。业务代码不得散落硬编码 path API;生成代码不可手改。MediaMTX path 不是租户/站点/设备的业务真相源。 +### 4.1 T-003 已实现的内部适配契约 + +以下是 Sense 内部 Go port,不是 Bell 或第三方可依赖的公共 HTTP API: + +| Port | 操作 | 数据所有者 / 失败语义 | +| --- | --- | --- | +| ONVIF adapter | `Probe(target)`、`SetSystemDateAndTime(target, time)` | 设备是外部来源;`target` 只含 endpoint ref 与不透明 credential ref。错误稳定映射为认证失败、超时、不可用、响应无效,不记录凭据或完整流地址 | +| MediaMTX paths | `CreatePath`、`GetPath`、`EnsurePath`、`DeletePath`、`PathReady` | SQLite 设备台账持有期望态,MediaMTX 只持有运行配置;`EnsurePath` 相同 source 不写、不同 source patch、缺失时 add;当前调和器绝不枚举或删除孤儿 | +| Device repository | 站点、设备、期望态、实际态、调和进度 | SQLite 是 M1 期望态真相源;调和失败次数与下次时间持久化,进程重启不清空退避;配额读取/写入失败时拒绝新增或启用,不关闭已有流 | + +MediaMTX 薄封装调用同版官方 OpenAPI 的 `/v3/config/paths/get|add|patch|delete/{name}` 与 `/v3/paths/get/{name}`。生成源、版本和 SHA-256 见 `docs/03-tech-stack.md`;业务包不得直接 import 生成包。 + +### 4.2 设备台账语义 + +- 设备类型由 `modality` 表达物理类别,由多值 `capabilities` 表达视频采集、音频、空间规则或遥测能力,避免把“摄像头”固化为唯一设备模型。 +- 视频配额只统计 `desired_state=enabled` 且具有 `video_capture` capability 的设备;站点默认 16、可配置 1~128。禁用设备和非视频传感器不占视频路数。 +- SQLite 表使用 `sense_` 前缀对应未来 PostgreSQL `sense` schema:`sense_sites`、`sense_devices`、`sense_device_capabilities`、`sense_reconcile_state`。标识、唯一性、状态与时间字段语义保持一致;本地表名前缀不是跨系统公共契约。 +- 摄像头密码不进入设备普通字段。`credential_ref` 只保存外部密钥引用;ONVIF 返回的 stream URI 只在内存中传给 MediaMTX,不写入设备台账或日志。 + +### 4.3 Sense 进程 HTTP 面 + +T-003 只提供运维探针:`GET /healthz` 表示进程存活,`GET /readyz` 表示配置、SQLite 打开及 migration 已完成。两者返回 JSON,均不等价于摄像头、MediaMTX path 或 M1 里程碑健康。设备管理、认证、分页、幂等键与并发控制尚未冻结,因此本任务不暴露 `/api/v1/devices` 等临时接口。 + ## 5. 变更流程 1. 在对应任务文件写清调用方、提供方、数据所有者、失败语义、幂等与兼容策略。 diff --git a/docs/current-state.md b/docs/current-state.md index 40185a5..f984a02 100644 --- a/docs/current-state.md +++ b/docs/current-state.md @@ -5,12 +5,15 @@ ## 当前阶段 - 阶段:M0 摄像头兼容性验证尚未完成;已批准并行推进不依赖真实摄像头的 M1 Sense 软件骨架,但不得提前宣称 M0/M1 出口完成。 -- 生产代码:尚未开始。 +- 生产代码:Sense M1 无实机骨架已建立,包含可构建进程、SQLite 台账、ONVIF port/fake、MediaMTX 生成客户端、最小对账与探活;真实 ONVIF adapter 和五路设备验收仍未开始。 - 默认容量:16 路;单站点本阶段上限 128 路,必须横向分片。 ## 仓库现实 -- `Sense/`、`Brain/`、`Bell/` 只有目录占位。 +- `Sense/` 已有 Go module 与 `cmd/sense-api`;`Brain/`、`Bell/` 仍只有目录占位。 +- Sense 设备模型使用 `modality + capabilities`,SQLite 执行 v1 migration;视频配额默认 16、允许 1~128,17/128/129、新增/启用和“降低配额不关闭已有流”均有测试。 +- MediaMTX 固定为独立二进制 `v1.19.3`,官方 OpenAPI 已按 SHA-256 vendoring,并由固定 `oapi-codegen v2.8.0` 生成客户端;手写薄封装有 create/read/delete、幂等 ensure 与探活假 HTTP 测试。 +- T-003 对账进度与指数退避持久化,覆盖取消和 SQLite 重启恢复;当前不枚举/删除孤儿,也不包含真实摄像头 adapter。 - `docs/raw/01`~`08` 已记录需求、分析、方案、客户场景、事件比对和三系统职责。 - `docs/raw/contracts/event-v0.1.schema.json` 已冻结,并有多份示例与语义说明。 - harness coding 文档、上下文清单、Gitea Issue/PR 模板和治理脚本已接入。 @@ -27,6 +30,12 @@ Windows: ./init.ps1 ``` +该入口会下载锁定 Go module,运行三条治理验证、MediaMTX 客户端生成漂移检查、`go test`、`go vet` 和 `go build`。只启动 Sense: + +```powershell +go -C Sense run ./cmd/sense-api +``` + 跨平台直接验证: ```powershell @@ -35,7 +44,7 @@ python -m unittest discover -s tests -p "test_*.py" python scripts/validate_harness_governance.py ``` -当前没有 Go/Python 业务依赖安装、生产服务启动或端到端命令。M1 脚手架创建时必须同步更新标准入口。 +Sense 默认监听 `127.0.0.1:8080`,提供 `/healthz` 与 `/readyz` 运维探针;它们不代表摄像头或 M1 里程碑健康。MediaMTX 获取、校验和独立启动方法见 `Sense/README.md`。 ## 当前 blocker / 待确认 @@ -43,12 +52,12 @@ python scripts/validate_harness_governance.py - S2 真实生产试点的未成年人影像、公共安全视频法规适用性和最终留存政策仍需客户/法务确认,阻塞 M3 上线但不阻塞 M1 实验室骨架。 - 人脸方向已延后至 M5 的 S4 成人园区候选试点;必要性/PIP 影响评估、单独同意与替代方式、合法底库来源和删除流程未完成,阻塞人脸能力上线。 - 短信/语音具体供应商未选;生产前必须选定两条独立投递路径并验证故障切换。 -- Go/Python/PostgreSQL/MediaMTX/Savant 的精确版本、目标硬件和 Bell 前端栈尚未冻结。 +- Python/PostgreSQL/Savant 的精确版本、目标硬件和 Bell 前端栈尚未冻结;Sense M1 的 Go、SQLite driver、MediaMTX、生成器及生成运行时版本已在 T-003 冻结。 - 代码知识图谱在无业务代码阶段可能为空;工具不可用时使用 `rg` 处理文档与配置。 ## 下一步 -从 Gitea 的 `status/todo` 工单中由 dispatcher 分配依赖已满足、编号最靠前且写路径不冲突的任务。当前建议领取重构后的 T-003,先完成无实机 Sense 骨架;T-001 恢复后完成兼容性白名单,T-006 再执行真实摄像头 5 路集成验收。不要仅凭本文宣称领取成功。 +T-003 合入后仍不能宣称 M0/M1 出口完成。恢复 T-001 后先形成摄像头兼容性白名单,再领取依赖 T-001 与 T-003 的 T-006,完成真实摄像头 5 路自动建 path、探活、断线恢复和 MediaMTX 证据。实时领取状态仍以 Gitea 为准。 ## 已知风险 diff --git a/docs/tasks/T-003.md b/docs/tasks/T-003.md index 640923b..d966203 100644 --- a/docs/tasks/T-003.md +++ b/docs/tasks/T-003.md @@ -3,7 +3,7 @@ id: T-003 title: 建立 Sense M1 无实机接入骨架 phase: 1 deps: [T-002] -status: DOING +status: DONE created: 2026-08-03 issue: 3 context_ref: e28070dd035cef3ff3e4a2dad879a482c41dac3a @@ -12,6 +12,7 @@ work_branch: agent/codex/T-003 write_paths: - docs/tasks/T-003.md - Sense/ + - docs/00-ai-start-here.md - docs/03-tech-stack.md - docs/api.md - docs/06-tasks.md @@ -81,3 +82,23 @@ write_paths: - 本任务收敛为 fake ONVIF、MediaMTX 假服务、SQLite 和可选合成 RTSP 可验证的生产骨架;不得用 mock 测试宣称 M0 或 M1 里程碑完成。 - 真实设备、5 路自动建 path、探活、断线恢复和 MediaMTX 证据拆到 T-006,依赖 T-001 与 T-003。 - 任务尚未领取;Issue #3 在本次规格合入默认分支前不进入 `status/todo`。 + +### 2026-08-04 版本与实现决策 + +- 冻结 Go `1.26.5`、MediaMTX `v1.19.3`、`oapi-codegen v2.8.0` 与 `modernc.org/sqlite v1.54.0`;许可证、module sum、MediaMTX 二进制 SHA-256、OpenAPI SHA-256、升级策略与退出路线已写入 `docs/03-tech-stack.md`。 +- SQLite driver 使用无 CGO 的 `modernc.org/sqlite`,但业务代码只依赖 `database/sql` repository;migration 避免 SQLite 专有业务语义,后续映射到 PostgreSQL `sense` schema。 +- 设备模型使用 `modality + capabilities`;视频配额只统计期望启用且具备视频采集能力的设备。站点默认 16、配置允许 1~128,超出时拒绝新增/启用,已有流不受影响。 +- 数据库持有期望态;ONVIF、MediaMTX 均由 port/adapter 隔离。T-003 实现确定性 fake 与假 HTTP 契约测试,不提供真实厂商兼容结论;对账只创建/修正应有 path,不做孤儿删除。 +- MediaMTX 官方 OpenAPI 按 tag vendoring,生成代码不可手改;薄封装负责状态码、幂等与领域错误映射。服务默认只监听 `127.0.0.1`,非回环监听必须显式开启。 +- 实现中发现标准 AI 入口仍会宣称“没有生产代码”。dispatcher 串行读回 Gitea 后确认只有 T-003 处于活跃状态、无路径冲突,并以完整 `CLAIM RENEWAL` 将 `docs/00-ai-start-here.md` 加入写入范围;worker 已同步本文件后才修改该入口。 + +### 2026-08-04 实现与验证证据 + +- 建立 `Sense/go.mod`、`cmd/sense-api`、SQLite v1 migration 与 device/store/onvif/mtx/reconcile/probe 包。进程默认回环监听,只提供 `/healthz`、`/readyz`;真实 ONVIF adapter 显式返回 unavailable,避免把 fake 冒充生产兼容实现。 +- vendoring MediaMTX `v1.19.3` 官方 OpenAPI,输入 SHA-256 为 `a2b58195f1ec76541e124b5de4ee54645e5a3e25f70c4a73acc4a44d6f2b9c52`;`go generate ./internal/mtx` 生成文件 SHA-256 在重复生成前后均为 `9e10d96eac1b332783d7cbfaba5872fede62a16ef6ccc1062cdb246607db7dac`。 +- SQLite 测试覆盖默认第 17 路拒绝、配置 128 路成功、第 129 路拒绝、禁用第 17 路重新启用拒绝、非视频设备不占额度,以及下调配额不关闭已有流。migration、唯一性、期望态 generation 和持久化退避由同一 repository 测试链路执行。 +- ONVIF fixture 覆盖 profile、脱敏 stream URI、校时、认证失败和取消/超时;MediaMTX 假 HTTP 服务覆盖官方生成客户端的 create/read/delete、ensure 幂等/patch、runtime path 探活和错误脱敏。 +- 对账测试覆盖成功收敛后不重复、指数退避、取消不消耗重试预算和关闭/重开 SQLite 后恢复;探活测试覆盖 online/offline 映射。对账器不调用 `DeletePath`,没有孤儿删除旁路。 +- `go test -race ./...` 全部通过;`go test ./... -count=2` 连续两轮通过;`go vet ./...`、`go build ./...` 通过。实际构建 `sense-api` 后在随机回环端口用绕过系统代理的 curl 验证 `health=ok`、`ready=ready`,临时 EXE、SQLite 和日志随后逐项删除。 +- 根标准入口 `./init.ps1` 通过:agent-context 校验、18 项治理测试、harness 治理校验、生成漂移检查、Sense 全量测试、vet 与 build 均成功。人工核对生成头为 `oapi-codegen v2.8.0`、OpenAPI/二进制下载使用固定 `v1.19.3` URL 和 SHA-256、MediaMTX/Sense 管理端默认只绑定回环地址。 +- 设备人工验收不适用:未连接摄像头,未宣称 T-001 白名单、真实 5 路或 M0/M1 出口完成;这些证据仍由 T-006 在 T-001 恢复后提供。 diff --git a/init.ps1 b/init.ps1 index acd231e..4849716 100644 --- a/init.ps1 +++ b/init.ps1 @@ -10,11 +10,10 @@ $ErrorActionPreference = "Stop" Set-Location -Path $PSScriptRoot -# 当前仍是文档/契约基线:没有业务依赖和可启动服务,标准入口先收敛治理验证。 -# M1 创建 Sense 脚手架时必须把真实安装、验证、启动命令同步到本文档链路。 -$InstallCmd = "Write-Host '当前无业务依赖需要安装'" -$VerifyCmd = "python scripts/validate_agent_context.py; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }; python -m unittest discover -s tests -p 'test_*.py'; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }; python scripts/validate_harness_governance.py; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }" -$StartCmd = "Write-Host '当前无生产服务;请从 Gitea 工单开始 M0/M1 工作'" +# Sense 使用锁定 Go toolchain/module;生成漂移、测试、vet 与构建均进入标准门禁。 +$InstallCmd = "go -C Sense mod download" +$VerifyCmd = "python scripts/validate_agent_context.py; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }; python -m unittest discover -s tests -p 'test_*.py'; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }; python scripts/validate_harness_governance.py; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }; go -C Sense generate ./internal/mtx; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }; git diff --exit-code -- Sense/internal/mtx/generated/client.gen.go; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }; go -C Sense test ./...; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }; go -C Sense vet ./...; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }; go -C Sense build ./...; if (`$LASTEXITCODE -ne 0) { exit `$LASTEXITCODE }" +$StartCmd = "go -C Sense run ./cmd/sense-api" function Assert-Configured { param( diff --git a/init.sh b/init.sh index ce2b77f..4b9ce6d 100644 --- a/init.sh +++ b/init.sh @@ -12,11 +12,10 @@ set -euo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" cd "$ROOT_DIR" -# 当前仍是文档/契约基线:没有业务依赖和可启动服务,标准入口先收敛治理验证。 -# M1 创建 Sense 脚手架时必须把真实安装、验证、启动命令同步到本文档链路。 -INSTALL_CMD=(true) -VERIFY_CMD=(bash -lc "python3 scripts/validate_agent_context.py && python3 -m unittest discover -s tests -p 'test_*.py' && python3 scripts/validate_harness_governance.py") -START_CMD=(echo "当前无生产服务;请从 Gitea 工单开始 M0/M1 工作") +# Sense 使用锁定 Go toolchain/module;生成漂移、测试、vet 与构建均进入标准门禁。 +INSTALL_CMD=(go -C Sense mod download) +VERIFY_CMD=(bash -lc "python3 scripts/validate_agent_context.py && python3 -m unittest discover -s tests -p 'test_*.py' && python3 scripts/validate_harness_governance.py && go -C Sense generate ./internal/mtx && git diff --exit-code -- Sense/internal/mtx/generated/client.gen.go && go -C Sense test ./... && go -C Sense vet ./... && go -C Sense build ./...") +START_CMD=(go -C Sense run ./cmd/sense-api) ensure_configured() { local name="$1"