export type TransferWarehouseInventoryRequestDto = Record; export type CreateApiOrganizationsIdWarehouseInventoryTransferArgs = {'x-icr-api-version'?: string | undefined, id: string, body: TransferWarehouseInventoryRequestDto}; export type CreateApiOrganizationsIdWarehouseInventoryTransferOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /organizations/{id}/warehouse/inventory/transfer */ export const createApiOrganizationsIdWarehouseInventoryTransfer = async (args: CreateApiOrganizationsIdWarehouseInventoryTransferArgs, options?: CreateApiOrganizationsIdWarehouseInventoryTransferOptions) => { const {baseUrl = "https://api.carbonregistry.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['x-icr-api-version'] != null) headers.set("x-icr-api-version", String(args['x-icr-api-version'])) const url = `${baseUrl.replace(/\/+$/, '')}/organizations/${encodeURIComponent(String(args.id))}/warehouse/inventory/transfer${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };