export type OrganizationID = string; export type DeleteApiOrganizationsOrganizationIDProjectsProjectIDBranchesBranchIDArgs = {organizationID: OrganizationID, projectID: string, branchID: string}; export type DeleteApiOrganizationsOrganizationIDProjectsProjectIDBranchesBranchIDOptions = {baseUrl?: string | undefined, xata?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a branch * * DELETE /organizations/{organizationID}/projects/{projectID}/branches/{branchID} */ export const deleteApiOrganizationsOrganizationIDProjectsProjectIDBranchesBranchID = async (args: DeleteApiOrganizationsOrganizationIDProjectsProjectIDBranchesBranchIDArgs, options?: DeleteApiOrganizationsOrganizationIDProjectsProjectIDBranchesBranchIDOptions) => { const {baseUrl = "https://api.xata.tech", fetch: fetchFn = fetch, xata} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (xata !== undefined) headers.set('authorization', `Bearer ${xata}`) const url = `${baseUrl.replace(/\/+$/, '')}/organizations/${encodeURIComponent(String(args.organizationID))}/projects/${encodeURIComponent(String(args.projectID))}/branches/${encodeURIComponent(String(args.branchID))}${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 };