export type PublicUpdateOriginRequestPayload = {endDate?: (string | null) | undefined, requestedWeight?: (number | null) | undefined}; export type UpdateApiPublicV2EudrCustomersOriginRequestsOriginRequestIdArgs = {originRequestId: number, body: PublicUpdateOriginRequestPayload}; export type UpdateApiPublicV2EudrCustomersOriginRequestsOriginRequestIdOptions = {baseUrl?: string | undefined, TokenAuthentication?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update origin request * * PUT /public/v2/eudr/customers/origin-requests/{originRequestId} */ export const updateApiPublicV2EudrCustomersOriginRequestsOriginRequestId = async (args: UpdateApiPublicV2EudrCustomersOriginRequestsOriginRequestIdArgs, options?: UpdateApiPublicV2EudrCustomersOriginRequestsOriginRequestIdOptions) => { const {baseUrl = "https://api.prewave.com", fetch: fetchFn = fetch, TokenAuthentication} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (TokenAuthentication !== undefined) headers.set("X-Auth-Token", TokenAuthentication) const url = `${baseUrl.replace(/\/+$/, '')}/public/v2/eudr/customers/origin-requests/${encodeURIComponent(String(args.originRequestId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };