export type CreateApiIpAuthRemoveArgs = {body: {ip_address: string, subaccount_id?: string | undefined}}; export type CreateApiIpAuthRemoveOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove an IP Auth entry * * POST /ip_auth/remove * * Also accepts auth: sec1 */ export const createApiIpAuthRemove = async (args: CreateApiIpAuthRemoveArgs, options?: CreateApiIpAuthRemoveOptions) => { const {baseUrl = "https://api.smtp2go.com/v3", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (sec0 !== undefined) headers.set("X-Smtp2go-Api-Key", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/ip_auth/remove${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 };