export type CameraId = string; export type ActivePatrolSlotString = string; export type CreateApiV1CamerasIdPtzPatrolStartSlotArgs = {id: CameraId, slot: ActivePatrolSlotString}; export type CreateApiV1CamerasIdPtzPatrolStartSlotOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Start a camera PTZ patrol * * POST /v1/cameras/{id}/ptz/patrol/start/{slot} */ export const createApiV1CamerasIdPtzPatrolStartSlot = async (args: CreateApiV1CamerasIdPtzPatrolStartSlotArgs, options?: CreateApiV1CamerasIdPtzPatrolStartSlotOptions) => { 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() const url = `${baseUrl.replace(/\/+$/, '')}/v1/cameras/${encodeURIComponent(String(args.id))}/ptz/patrol/start/${encodeURIComponent(String(args.slot))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };