export type PaymentToolTerminalNameCommand = {id: number, name?: string | undefined}; export type UpdateApiApiAcceptorRolesAcceptorCodeTerminalUpdateArgs = {acceptorCode: string, body: PaymentToolTerminalNameCommand}; export type UpdateApiApiAcceptorRolesAcceptorCodeTerminalUpdateOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * updateTerminal * * PUT /api/acceptor-roles/{acceptorCode}/terminal/update */ export const updateApiApiAcceptorRolesAcceptorCodeTerminalUpdate = async (args: UpdateApiApiAcceptorRolesAcceptorCodeTerminalUpdateArgs, options: UpdateApiApiAcceptorRolesAcceptorCodeTerminalUpdateOptions) => { 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))}/terminal/update${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 res.blob() };