export type Archivo = {height?: number | undefined, timestamp?: string | undefined, uri?: (string | null) | undefined, fileName?: (string | null) | undefined, data?: (string | null) | undefined}; export type AccountCreateUpdateRqst = {accountID?: (number | null) | undefined, accountTypeID?: (number | null) | undefined, accountName?: (string | null) | undefined, accountImage?: Archivo | undefined, paisID?: number | undefined, isActive?: boolean | undefined, haveInvoice?: boolean | undefined}; export type UpdateApiV1ApiAccountsAccountIDArgs = {AccountID: number, body: AccountCreateUpdateRqst}; export type UpdateApiV1ApiAccountsAccountIDOptions = {baseUrl: string, Bearer?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /v1/api/Accounts/{AccountID} */ export const updateApiV1ApiAccountsAccountID = async (args: UpdateApiV1ApiAccountsAccountIDArgs, options: UpdateApiV1ApiAccountsAccountIDOptions) => { 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(/\/+$/, '')}/v1/api/Accounts/${encodeURIComponent(String(args.AccountID))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", 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 };