export type CreateApiRunnersVariablesProjectsProjectIdVariableSetsVariableSetIdDetachArgs = {projectId: string, variableSetId: string}; export type CreateApiRunnersVariablesProjectsProjectIdVariableSetsVariableSetIdDetachOptions = {baseUrl?: string | undefined, JWTAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Detach a variable set from a project * * POST /runners/variables/projects/{projectId}/variable-sets/{variableSetId}/detach */ export const createApiRunnersVariablesProjectsProjectIdVariableSetsVariableSetIdDetach = async (args: CreateApiRunnersVariablesProjectsProjectIdVariableSetsVariableSetIdDetachArgs, options?: CreateApiRunnersVariablesProjectsProjectIdVariableSetsVariableSetIdDetachOptions) => { const {baseUrl = "https://api.firefly.ai/v2", fetch: fetchFn = fetch, JWTAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (JWTAuth !== undefined) headers.set('authorization', `Bearer ${JWTAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/runners/variables/projects/${encodeURIComponent(String(args.projectId))}/variable-sets/${encodeURIComponent(String(args.variableSetId))}/detach${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 };