export type UpdateEmailAccountDto = {emailAccountIds: Array, senderFirstName: string, senderLastName?: string | undefined, dailyQuota?: number | undefined, bcc?: string | undefined, signatureHtml?: string | undefined, sendingIntervalMin?: number | undefined, sendingIntervalMax?: number | undefined, rampUpInitialSendingLimit?: number | undefined, rampUpPercent?: number | undefined, clientId?: number | undefined}; export type CreateApiV1EmailAccountsBulkUpdateArgs = {body: UpdateEmailAccountDto}; export type CreateApiV1EmailAccountsBulkUpdateOptions = {baseUrl: string, xApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Bulk Updates Email accounts * * POST /v1/email-accounts/bulk-update */ export const createApiV1EmailAccountsBulkUpdate = async (args: CreateApiV1EmailAccountsBulkUpdateArgs, options: CreateApiV1EmailAccountsBulkUpdateOptions) => { const {baseUrl, fetch: fetchFn = fetch, xApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (xApiKey !== undefined) headers.set("x-api-key", xApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/email-accounts/bulk-update${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 };