export type ForwardingNumberId = {forwardingNumberId?: string | undefined}; export type DeleteForwardingNumbersRequest = {records?: Array | undefined}; export type DeleteApiRestapiV10AccountAccountIdExtensionExtensionIdForwardingNumberArgs = {accountId: string, extensionId: string, body: DeleteForwardingNumbersRequest}; export type DeleteApiRestapiV10AccountAccountIdExtensionExtensionIdForwardingNumberOptions = {baseUrl?: string | undefined, OAuth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete Forwarding Numbers * * DELETE /restapi/v1.0/account/{accountId}/extension/{extensionId}/forwarding-number */ export const deleteApiRestapiV10AccountAccountIdExtensionExtensionIdForwardingNumber = async (args: DeleteApiRestapiV10AccountAccountIdExtensionExtensionIdForwardingNumberArgs, options?: DeleteApiRestapiV10AccountAccountIdExtensionExtensionIdForwardingNumberOptions) => { const {baseUrl = "https://platform.ringcentral.com", fetch: fetchFn = fetch, OAuth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (OAuth2 !== undefined) headers.set('authorization', `Bearer ${OAuth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/restapi/v1.0/account/${encodeURIComponent(String(args.accountId))}/extension/${encodeURIComponent(String(args.extensionId))}/forwarding-number${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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 };