export type DeleteApiAgentsConnectionsHttpConnectionIdArgs = {connection_id: string}; export type DeleteApiAgentsConnectionsHttpConnectionIdOptions = {baseUrl?: string | undefined, FronteggHTTPAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Agent Http Connection * * DELETE /agents/connections/http/{connection_id} */ export const deleteApiAgentsConnectionsHttpConnectionId = async (args: DeleteApiAgentsConnectionsHttpConnectionIdArgs, options?: DeleteApiAgentsConnectionsHttpConnectionIdOptions) => { const {baseUrl = "https://api.streamkap.com", fetch: fetchFn = fetch, FronteggHTTPAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (FronteggHTTPAuthentication !== undefined) headers.set('authorization', `Bearer ${FronteggHTTPAuthentication}`) const url = `${baseUrl.replace(/\/+$/, '')}/agents/connections/http/${encodeURIComponent(String(args.connection_id))}${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 };