export type UpdateApiDatasourcesEmailIdArgs = {id: number, body: {email_signature?: string | undefined, add_signature_to_campaign?: boolean | undefined, add_signature_to_replies?: boolean | undefined, max_emails_day?: number | undefined, max_emails_hour?: number | undefined}}; export type UpdateApiDatasourcesEmailIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Update an email data source * * PUT /datasources/email/{id} */ export const updateApiDatasourcesEmailId = async (args: UpdateApiDatasourcesEmailIdArgs, options?: UpdateApiDatasourcesEmailIdOptions) => { const {baseUrl = "https://api.salesflare.com", 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(/\/+$/, '')}/datasources/email/${encodeURIComponent(String(args.id))}${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 res.blob() };