export type DeleteApiV2ValsValIdBranchesBranchIdArgs = {val_id: string, branch_id: string}; export type DeleteApiV2ValsValIdBranchesBranchIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a branch * * DELETE /v2/vals/{val_id}/branches/{branch_id} */ export const deleteApiV2ValsValIdBranchesBranchId = async (args: DeleteApiV2ValsValIdBranchesBranchIdArgs, options?: DeleteApiV2ValsValIdBranchesBranchIdOptions) => { const {baseUrl = "https://api.val.town", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/v2/vals/${encodeURIComponent(String(args.val_id))}/branches/${encodeURIComponent(String(args.branch_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 };