export type TransferReceiveInfo = {organizationId: string}; export type UpdateApiApiV1TransfersId4nReceiveInfoArgs = {id4n: string, body: TransferReceiveInfo}; export type UpdateApiApiV1TransfersId4nReceiveInfoOptions = {baseUrl: string, Authorization?: string | undefined, fetch?: typeof fetch | undefined}; /** * Transfer a GUID or collection, obtaining it (i.e. becoming the holder) and if allowed also taking ownership * * PUT /api/v1/transfers/{id4n}/receiveInfo */ export const updateApiApiV1TransfersId4nReceiveInfo = async (args: UpdateApiApiV1TransfersId4nReceiveInfoArgs, options: UpdateApiApiV1TransfersId4nReceiveInfoOptions) => { const {baseUrl, fetch: fetchFn = fetch, Authorization} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Authorization !== undefined) headers.set("Authorization", Authorization) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/transfers/${encodeURIComponent(String(args.id4n))}/receiveInfo${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 };