export type AltaInmuebleRequest = {anioContrato?: string | undefined, calle?: string | undefined, clusterid?: string | undefined, codigo?: string | undefined, contacto?: string | undefined, couta?: boolean | undefined, disponible?: boolean | undefined, estatus?: string | undefined, estatusvivienda?: string | undefined, fechapago?: string | undefined, fechapagoexterno?: string | undefined, fechapagointerno?: string | undefined, folioMercantil?: string | undefined, idInmueble?: number | undefined, idlote?: string | undefined, latitud?: string | undefined, longitud?: string | undefined, manzana?: string | undefined, numExt?: string | undefined, referencia?: string | undefined, rfc?: string | undefined, saldo?: string | undefined}; export type CreateApiApiNuevoInmuebleArgs = {body: AltaInmuebleRequest}; export type CreateApiApiNuevoInmuebleOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * Agrega nuevos inmuebles * * POST /api/nuevoInmueble */ export const createApiApiNuevoInmueble = async (args: CreateApiApiNuevoInmuebleArgs, options: CreateApiApiNuevoInmuebleOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/nuevoInmueble${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 res.blob() };