export type CreateApiSaleDeskProspectsArgs = {body: {prospect?: ({lead_id?: string | undefined, olt_id?: string | undefined, contract_id?: string | undefined, start_date?: string | undefined, details?: string | undefined, state?: string | undefined, connectable_id?: string | undefined, connectable_type?: string | undefined, services_attributes?: ({description?: string | undefined, kind?: string | undefined, serviceable_id?: string | undefined, serviceable_type?: string | undefined, invoicing_discount_id?: string | undefined, contract_id?: string | undefined}) | undefined, gps_point_attributes?: ({latitude?: string | undefined, longitude?: string | undefined, street?: string | undefined, number?: string | undefined, city?: string | undefined, country?: string | undefined, state?: string | undefined, country_code?: string | undefined, additional_data?: string | undefined}) | undefined}) | undefined}}; export type CreateApiSaleDeskProspectsOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /sale_desk/prospects */ export const createApiSaleDeskProspects = async (args: CreateApiSaleDeskProspectsArgs, options?: CreateApiSaleDeskProspectsOptions) => { const {baseUrl = "https://www.cloud.wispro.co/api/v1", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (sec0 !== undefined) headers.set("Authorization", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/sale_desk/prospects${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 };