export type AccountType = 1 | 2 | 3; export type CreateAccountCommand = {userId?: (string | null) | undefined, bank?: (string | null) | undefined, accountOwnerName?: (string | null) | undefined, accountNumber?: (string | null) | undefined, cardOwnerName?: (string | null) | undefined, cardNumber?: (string | null) | undefined, agencyId?: (number | null) | undefined, shebaNumber?: (string | null) | undefined, type?: AccountType | undefined, description?: (string | null) | undefined, status?: boolean | undefined}; export type CreateApiApiVVersionAccountCreateAccountArgs = {version: string, body: CreateAccountCommand}; export type CreateApiApiVVersionAccountCreateAccountOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * POST /api/v{version}/Account/CreateAccount */ export const createApiApiVVersionAccountCreateAccount = async (args: CreateApiApiVVersionAccountCreateAccountArgs, options: CreateApiApiVVersionAccountCreateAccountOptions) => { const {baseUrl, fetch: fetchFn = fetch, Bearer} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (Bearer !== undefined) headers.set("Authorization", Bearer) const url = `${baseUrl.replace(/\/+$/, '')}/api/v${encodeURIComponent(String(args.version))}/Account/CreateAccount${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 };