export type Brand = {id?: number | undefined, name: string}; export type KalaCommand = {brand?: Brand | undefined, id: string, name?: string | undefined, price?: number | undefined, service?: boolean | undefined}; export type AyriaPaymentKalaCommand = {count: number, description?: string | undefined, kala: KalaCommand, price?: number | undefined}; export type AyriaPaymentKalaUpdateCommand = {acceptorCode?: string | undefined, description?: string | undefined, kalas?: Array | undefined, referenceCode?: string | undefined}; export type CreateApiApiAcceptorRolesAcceptorCodeAyriaPaymentUpdateArgs = {acceptorCode: string, body: AyriaPaymentKalaUpdateCommand}; export type CreateApiApiAcceptorRolesAcceptorCodeAyriaPaymentUpdateOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * updateKala * * POST /api/acceptor-roles/{acceptorCode}/ayria-payment/update */ export const createApiApiAcceptorRolesAcceptorCodeAyriaPaymentUpdate = async (args: CreateApiApiAcceptorRolesAcceptorCodeAyriaPaymentUpdateArgs, options: CreateApiApiAcceptorRolesAcceptorCodeAyriaPaymentUpdateOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") headers.set('accept', "*/*") const url = `${baseUrl.replace(/\/+$/, '')}/api/acceptor-roles/${encodeURIComponent(String(args.acceptorCode))}/ayria-payment/update${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 res.blob() };