UNPKG

tickethead-sdk

Version:

SDK for the Tickethead API

66 lines 2.92 kB
import { AxiosInstance } from 'axios'; import { GeneralNotification, ListNotificationQuery, Notification, NotificationContent, NotificationResponse } from './types'; import { OrganizerSpecificId, TicketConfigId } from '../event'; import { IdParam, StatusResponse } from '../common/types'; /** * Service class for sending notifications. */ export declare class NotificationService { readonly client: AxiosInstance; readonly tenantClient: AxiosInstance; readonly version: string; constructor(client: AxiosInstance, tenantClient: AxiosInstance, version: string); /** * Sends a notification via the account service * @param data the content of the notification and its topic * @returns was the notification sent successfully */ sendNotification(data: Notification): Promise<StatusResponse>; /** * Sends a notification via the account service * @param id.id the id of the notification to be sent * @returns was the notification sent successfully */ sendExistingNotification(id: IdParam): Promise<StatusResponse>; /** * Sends a notification to all the users who are holding tickets for this event * @param data the content of the notification * @returns was the notification sent successfully */ sendNotificationForEvent(id: OrganizerSpecificId, data: NotificationContent): Promise<StatusResponse>; /** * Sends a notification to all the users who are holding tickets for this ticket config * @param data the content of the notification * @returns was the notification sent successfully */ sendNotificationForTicketConfig(id: TicketConfigId, data: NotificationContent): Promise<StatusResponse>; /** * Retrieves a list of notifications based on the provided query parameters. * @param query - The query parameters for filtering the notifications (optional). */ listNotifications(query?: ListNotificationQuery): Promise<NotificationResponse[]>; /** * Fetches a previously created notification * @param id.id the id of the notification to be fetched * @returns requested notification */ getNotification(id: IdParam): Promise<NotificationResponse>; /** * Creates a new notification. * @param data The notification data. */ createNotification(data: GeneralNotification): Promise<NotificationResponse>; /** * Updates a notification with the specified ID. * * @param {IdParam} id - The ID of the notification to update. * @param {GeneralNotification} data - The updated notification data. */ updateNotification(id: IdParam, data: Partial<GeneralNotification>): Promise<NotificationResponse>; /** * Deletes a notification by its ID. * @param id - The ID of the notification to delete. */ deleteNotification(id: IdParam): Promise<any>; } //# sourceMappingURL=service.d.ts.map