export type CreateApiMeEmailsEmailIdVerificationResendArgs = {email_id: string, 'X-CSRF-Protection': boolean}; export type CreateApiMeEmailsEmailIdVerificationResendOptions = {baseUrl: string, backendAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Confirm the email address * * POST /me/emails/{email_id}/verification/resend */ export const createApiMeEmailsEmailIdVerificationResend = async (args: CreateApiMeEmailsEmailIdVerificationResendArgs, options: CreateApiMeEmailsEmailIdVerificationResendOptions) => { const {baseUrl, fetch: fetchFn = fetch, backendAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args['X-CSRF-Protection'] != null) headers.set("X-CSRF-Protection", String(args['X-CSRF-Protection'])) if (backendAuth !== undefined) cookies.push("mtls-prd=" + encodeURIComponent(backendAuth)) const url = `${baseUrl.replace(/\/+$/, '')}/me/emails/${encodeURIComponent(String(args.email_id))}/verification/resend${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };