import * as wrapper from './proto/proto-generated';
var DealerOfferEventsService = wrapper.wix.dealerOfferEvents.api.v1.DealerOfferEventsService;
/**
 * Report an event for a Dealer Offer for a specific user identity and metasite.
 * required fields: event.type, event.offer_id and event.real_estate_id (placementId) in addition - some of the event types require specific payload.
 * For example MAIN_CTA_CLICK needs to be reported with main_cta_click payload that contains additional data on the event such as target_url.
 * VIEW event does not require any additional information.
 *
 * Identity and metasite are taken implicitly from request by default - NO NEED TO PASS SUCH INFO.
 * If an event is reported from metasite(BM/EDITOR), MAKE SURE request is sent with an authorization header.
 *
 * For some EDGE CASES - privileged apps with DEALER.OFFER_EVENTS_EXPLICIT_CONTEXT can report on behalf of user and fill identity(user_id and msid) fields.
 */
export function reportEvent(payload) {
    var serviceArtifactId = 'com.wixpress.dealer-offer-events-service';
    var serviceProtoClass = DealerOfferEventsService;
    var methodName = 'reportEvent';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
/**
 * return list of offer events summary for a bulk of offer ids.
 * a summary response contains last event happened for each event type or event counts.
 * - you have to provide field masks for all the event types you want to get for each offer.
 * BY DEFAULT Summaries will be filtered by the implicit identity and metasite in the request.
 *
 * FOR SOME EDGE CASES - special permission DEALER.OFFER_EVENTS_EXPLICIT_CONTEXT is required in order to pass explicit identity and metasite filter.
 *
 * You can request event summary data for specific offers or specific campaigns.
 *
 * In case campaign level events summary requested, cumulative data is returned:
 * — events counters are a sum of all campaign's offer events counters
 * — lastEvent for campaign is the lastEvent of the "latest" offer within campaign
 * — etc.
 *
 * If summary_filter.placement_id is set, then only offers belonging to campaign & placement is counted
 * for campaign level summary
 *
 * If offer_ids is empty — you get empty result.events_summary
 * If campaign_ids empty — you get empty result.campaign_events_summary
 */
export function listEventsSummary(payload) {
    var serviceArtifactId = 'com.wixpress.dealer-offer-events-service';
    var serviceProtoClass = DealerOfferEventsService;
    var methodName = 'listEventsSummary';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
/**
 * ONLY SUPPORTED FOR EVENT TYPE AGENT_MARK - USER JOURNEY USE CASES
 * Returns list of offer events for given filters.
 * Filters: offer_id (required), event_type (required, only AGENT_MARK); siteId is taken implicitly
 * from aspects, so they must be server signed with siteId.
 * Supported `paging`. Events limit by default is 200.
 * Not supported 'sort`, `fields` and `fieldsets`. Events are sorted in descending order by creation_date.
 *
 * Query examples:
 * query: { filter: { offer_id: <uuid> }, event_type: 'AGENT_MARK'}}
 * query: { filter: { offer_id: { $in: [<uuid1>, <uuid2>] }, event_type: 'AGENT_MARK'}}
 * query: { filter: { offer_id: { $in: [<uuid1>, <uuid2>] }, event_type: 'AGENT_MARK'}, paging: { offset: 10, limit: 100 } }
 */
export function queryEvents(payload) {
    var serviceArtifactId = 'com.wixpress.dealer-offer-events-service';
    var serviceProtoClass = DealerOfferEventsService;
    var methodName = 'queryEvents';
    var requestData = payload;
    return {
        serviceProtoClass: serviceProtoClass,
        serviceArtifactId: serviceArtifactId,
        methodName: methodName,
        requestData: requestData,
    };
}
//# sourceMappingURL=rpc.impl.js.map