export type DeleteApiV1TeamsTeamIdHooksHookIdArgs = {team_id: string, hook_id: string, authorization?: (string | null) | undefined, 'x-darwin-token'?: (string | null) | undefined}; export type DeleteApiV1TeamsTeamIdHooksHookIdOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Revoke Hook * * DELETE /v1/teams/{team_id}/hooks/{hook_id} */ export const deleteApiV1TeamsTeamIdHooksHookId = async (args: DeleteApiV1TeamsTeamIdHooksHookIdArgs, options: DeleteApiV1TeamsTeamIdHooksHookIdOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.authorization != null) headers.set("authorization", String(args.authorization)) if (args['x-darwin-token'] != null) headers.set("x-darwin-token", String(args['x-darwin-token'])) const url = `${baseUrl.replace(/\/+$/, '')}/v1/teams/${encodeURIComponent(String(args.team_id))}/hooks/${encodeURIComponent(String(args.hook_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 };