export type CreateApiRestapiV2AccountsAccountIdSendActivationEmailArgs = {accountId: string}; export type CreateApiRestapiV2AccountsAccountIdSendActivationEmailOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Send/Resend Activation Email * * POST /restapi/v2/accounts/{accountId}/send-activation-email */ export const createApiRestapiV2AccountsAccountIdSendActivationEmail = async (args: CreateApiRestapiV2AccountsAccountIdSendActivationEmailArgs, options?: CreateApiRestapiV2AccountsAccountIdSendActivationEmailOptions) => { const {baseUrl = "https://platform.ringcentral.com", fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/restapi/v2/accounts/${encodeURIComponent(String(args.accountId))}/send-activation-email${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 };