export type PatchApiInquiriesInquiryIdArgs = {inquiry_id: number, body: {branch_id: number, manager_id?: number | undefined, asset_id?: number | undefined, client_id?: number | undefined, client_name?: string | undefined, client_phone?: string | undefined, email?: string | undefined, urgent?: boolean | undefined, due_date?: string | undefined, ad_campaign_id?: number | undefined, comment?: string | undefined, manager_notes?: string | undefined, address?: ({country: string, state?: string | undefined, city?: string | undefined, address_line_1: string, address_line_2?: string | undefined, postal_code?: string | undefined, comment?: string | undefined}) | undefined, custom_fields?: unknown | undefined}}; export type PatchApiInquiriesInquiryIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update Inquiry * * PATCH /inquiries/{inquiry_id} */ export const patchApiInquiriesInquiryId = async (args: PatchApiInquiriesInquiryIdArgs, options?: PatchApiInquiriesInquiryIdOptions) => { const {baseUrl = "https://api.roapp.io/v2", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (apiKey !== undefined) headers.set('authorization', `Bearer ${apiKey}`) const url = `${baseUrl.replace(/\/+$/, '')}/inquiries/${encodeURIComponent(String(args.inquiry_id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PATCH", 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 };