export type PatchApiLogisticsStopRequestsStopRequestIdCancelArgs = {stopRequestId: number}; export type PatchApiLogisticsStopRequestsStopRequestIdCancelOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * PATCH /logistics-stop-requests/{stopRequestId}/cancel */ export const patchApiLogisticsStopRequestsStopRequestIdCancel = async (args: PatchApiLogisticsStopRequestsStopRequestIdCancelArgs, options: PatchApiLogisticsStopRequestsStopRequestIdCancelOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() const url = `${baseUrl.replace(/\/+$/, '')}/logistics-stop-requests/${encodeURIComponent(String(args.stopRequestId))}/cancel${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };