export type NotificationRequest = {notificationType: 'REPORT' | 'RATING' | 'COMMENT' | 'THREAD_FEEDBACK' | 'MENTION' | 'FEEDBACK' | 'NO_REVIEW' | 'SOME_DATA_READY' | 'ALL_DATA_READY' | 'DISPUTE_FEEDBACK_REQUESTED' | 'DISPUTE_RELATED_TO_USER_CREATED' | 'DISPUTE_ACCEPTED' | 'DISPUTE_REJECTED' | 'DISPUTE_RELATED_TO_USER_REJECTED' | 'DISPUTE_RELATED_TO_USER_ACCEPTED' | 'INVITE' | 'CONVERTED_TO_BOT', channel: 'EMAIL' | 'SLACK', frequency: 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'HOURLY' | 'INSTANT' | 'HOURS_3' | 'HOURS_6' | 'OFF', userChangeAllowed?: boolean | undefined}; export type UpdateApiPaymentsPaymentIdUsersNotificationsArgs = {paymentId: number, 'X-Zendesk-Doorman-Auth-Response': string, body: NotificationRequest}; export type UpdateApiPaymentsPaymentIdUsersNotificationsOptions = {baseUrl?: string | undefined, zendeskAuthn?: string | undefined, fetch?: typeof fetch | undefined}; /** * PUT /payments/{paymentId}/users/notifications */ export const updateApiPaymentsPaymentIdUsersNotifications = async (args: UpdateApiPaymentsPaymentIdUsersNotificationsArgs, options?: UpdateApiPaymentsPaymentIdUsersNotificationsOptions) => { const {baseUrl = "http://api.klausapp.com", fetch: fetchFn = fetch, zendeskAuthn} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") 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))}/users/notifications${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() };