export type CameraId = string; export type ChannelQuality = 'high' | 'medium' | 'low' | 'package'; export type RemovedQualities = Array | ChannelQuality; export type DeleteApiV1CamerasIdRtspsStreamArgs = {id: CameraId, qualities: RemovedQualities}; export type DeleteApiV1CamerasIdRtspsStreamOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete camera RTSPS stream * * DELETE /v1/cameras/{id}/rtsps-stream */ export const deleteApiV1CamerasIdRtspsStream = async (args: DeleteApiV1CamerasIdRtspsStreamArgs, options?: DeleteApiV1CamerasIdRtspsStreamOptions) => { const {baseUrl = "https://api.ui.com/v1/connector/consoles/942A6FF664C0000000000964970E0000000009E710560000000068A9873F:9999999999/proxy/protect/integration", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.qualities != null) query.append("qualities", String(args.qualities)) const url = `${baseUrl.replace(/\/+$/, '')}/v1/cameras/${encodeURIComponent(String(args.id))}/rtsps-stream${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };