/** * Events service. * @module api/EventsApi */ export default class EventsApi { /** * Constructs a new EventsApi. * @alias EventsApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient?: any); apiClient: any; /** * Callback function to receive the result of the trackCustomEvent operation. * @callback trackCustomEventCallback * @param {Error|null} error Error object if failed, null otherwise. * @param {EventsCreateResponseBody} [data] The data returned by the service call. * @param {Object} [response] Full response object if successful. */ /** * Track Custom Event * To track a custom event, you create an event object. The event object must be linked to the customer who performs the action. If a customer doesnt exist in Voucherify, the customer will be created. * @param {EventsCreateRequestBody} eventsCreateRequestBody Specify the details of the custom event. * @param {trackCustomEventCallback} [callback] The callback function, accepting three arguments: error, data, response * data is of type: {@link EventsCreateResponseBody} * @returns {Promise<(EventsCreateResponseBody | undefined)>} Depending on whether the `callback` parameter is provided, the promise will resolve with a `EventsCreateResponseBody` object or with `undefined`. */ trackCustomEvent(eventsCreateRequestBody: EventsCreateRequestBody, callback?: (error: Error | null, data?: EventsCreateResponseBody, response?: any) => any): Promise<(EventsCreateResponseBody | undefined)>; } import EventsCreateRequestBody from '../model/EventsCreateRequestBody'; import EventsCreateResponseBody from '../model/EventsCreateResponseBody';