export type GetApiPaymentsPaymentIdNotificationsRoleMapArgs = {paymentId: number, role: 'ALL' | 'PAYMENT_MANAGE' | 'TEAMS_MANAGE' | 'MY_TEAM_MANAGE' | 'MY_TEAM_READ' | 'MY_TICKET_READ', 'X-Zendesk-Doorman-Auth-Response': string}; export type GetApiPaymentsPaymentIdNotificationsRoleMapOptions = {baseUrl?: string | undefined, zendeskAuthn?: string | undefined, fetch?: typeof fetch | undefined}; /** * GET /payments/{paymentId}/notifications/{role}/map */ export const getApiPaymentsPaymentIdNotificationsRoleMap = async (args: GetApiPaymentsPaymentIdNotificationsRoleMapArgs, options?: GetApiPaymentsPaymentIdNotificationsRoleMapOptions) => { const {baseUrl = "http://api.klausapp.com", fetch: fetchFn = fetch, zendeskAuthn} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "*/*") if (args['X-Zendesk-Doorman-Auth-Response'] != null) headers.set("X-Zendesk-Doorman-Auth-Response", String(args['X-Zendesk-Doorman-Auth-Response'])) if (zendeskAuthn !== undefined) headers.set("X-Zendesk-Authn", zendeskAuthn) const url = `${baseUrl.replace(/\/+$/, '')}/payments/${encodeURIComponent(String(args.paymentId))}/notifications/${encodeURIComponent(String(args.role))}/map${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };