export type DeleteApiApiV3VariableGroupsVariableGroupIdVariablesVariableIdArgs = {variable_group_id: string, variable_id: string}; export type DeleteApiApiV3VariableGroupsVariableGroupIdVariablesVariableIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete the variable * * DELETE /api/v3/variable-groups/{variable_group_id}/variables/{variable_id} */ export const deleteApiApiV3VariableGroupsVariableGroupIdVariablesVariableId = async (args: DeleteApiApiV3VariableGroupsVariableGroupIdVariablesVariableIdArgs, options?: DeleteApiApiV3VariableGroupsVariableGroupIdVariablesVariableIdOptions) => { const {baseUrl = "https://codemagic.io", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("x-auth-token", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v3/variable-groups/${encodeURIComponent(String(args.variable_group_id))}/variables/${encodeURIComponent(String(args.variable_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 };