export type DeleteApiApiBusinessBusinessIdBranchBranchIdBreakBreakIdArgs = {businessId: string, branchId: string, breakId: string}; export type DeleteApiApiBusinessBusinessIdBranchBranchIdBreakBreakIdOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Delete a break * * DELETE /api/business/{businessId}/branch/{branchId}/break/{breakId} */ export const deleteApiApiBusinessBusinessIdBranchBranchIdBreakBreakId = async (args: DeleteApiApiBusinessBusinessIdBranchBranchIdBreakBreakIdArgs, options?: DeleteApiApiBusinessBusinessIdBranchBranchIdBreakBreakIdOptions) => { const {baseUrl = "http://api-gateway-eu.phorest.com/third-party-api-server", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/business/${encodeURIComponent(String(args.businessId))}/branch/${encodeURIComponent(String(args.branchId))}/break/${encodeURIComponent(String(args.breakId))}${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 };