export interface OfferEvent extends OfferEventPayloadOneOf {
    /** a payload when event type is AGENT_MARK */
    agentMark?: AgentMarkedPayload;
    /**
     * a payload when event type is MAIN_CTA_CLICK
     * currently will not be returned as part of summary response
     */
    mainCtaClick?: CTAClickPayload;
    /**
     * a payload when event type is SECONDARY_CTA_CLICK
     * currently will not be returned as part of summary response
     */
    secondaryCtaClick?: CTAClickPayload;
    /**
     * unique guid
     * @format GUID
     */
    offerId?: string;
    /**
     * the direct user recieved the offer - returned only for AGENT_MARK summary/query
     * OPTIONAL - NOT RECOMMENDED to pass in report event.
     * @format GUID
     */
    userId?: string | null;
    /**
     * the target account context recieved the offer
     * OPTIONAL - NOT RECOMMENDED to pass in report event.
     * @format GUID
     */
    targetAccountId?: string | null;
    /**
     * returned only for AGENT_MARK summary/query
     * OPTIONAL - NOT RECOMMENDED to pass in report event.
     * @format GUID
     */
    loggedInAccountId?: string | null;
    /**
     * the site context recieved the offer
     * OPTIONAL - NOT RECOMMENDED to pass in report event.
     * @format GUID
     */
    siteId?: string | null;
    /**
     * returned only for AGENT_MARK summary/query
     * @format GUID
     * @readonly
     */
    eventId?: string | null;
    /**
     * creation timestamp
     * @readonly
     */
    createdAt?: Date | null;
    /**
     * for some of the event types a payload should be passed
     * for example if u pass MAIN_CTA_CLICK then main_cta_click payload should also be passed with target_url
     */
    type?: EventType;
    /** currently will not be returned as part of summary/query response */
    realEstateId?: string | null;
    /**
     * URL of a web page which is initial cause/source of the event (if available)
     * if left blank and grpc endpoint is exposed over http rest - taken from HTTP referrer header
     * currently will not be returned as part of summary response - not supported for AGENT_MARK
     */
    httpReferrer?: string | null;
    /**
     * Some external asset guid. Can be the banner/LB campaign creative guid, but isn't specific to LB/banner assets.
     * currently will not be returned as part of summary response - not supported for AGENT_MARK
     * @format GUID
     */
    assetId?: string | null;
    /**
     * For placements that are used in multiple platforms simultaneously, pass the information of where this interaction happened.
     * standard platforms for bi: BUSINESS_MANAGER, EDITORX, EDITORX, ADI, OWNER_APP
     */
    platform?: PlatformEnum;
}
/** @oneof */
export interface OfferEventPayloadOneOf {
    /** a payload when event type is AGENT_MARK */
    agentMark?: AgentMarkedPayload;
    /**
     * a payload when event type is MAIN_CTA_CLICK
     * currently will not be returned as part of summary response
     */
    mainCtaClick?: CTAClickPayload;
    /**
     * a payload when event type is SECONDARY_CTA_CLICK
     * currently will not be returned as part of summary response
     */
    secondaryCtaClick?: CTAClickPayload;
}
export declare enum EventType {
    UNKNOWN = "UNKNOWN",
    VIEW = "VIEW",
    MAIN_CTA_CLICK = "MAIN_CTA_CLICK",
    SECONDARY_CTA_CLICK = "SECONDARY_CTA_CLICK",
    AGENT_MARK = "AGENT_MARK",
    SKIP = "SKIP",
    UNSKIP = "UNSKIP",
    CLOSE = "CLOSE",
    SHOW_LATER = "SHOW_LATER"
}
export interface AgentMarkedPayload {
    /**
     * id of related agent
     * @format GUID
     */
    agentId?: string | null;
    /** Offer status */
    status?: AgentOfferStatusEnum;
}
export declare enum AgentOfferStatusEnum {
    NOT_STARTED = "NOT_STARTED",
    SUGGESTED = "SUGGESTED",
    REJECTED = "REJECTED",
    REQUESTED = "REQUESTED",
    ALREADY_COMPLETED = "ALREADY_COMPLETED",
    NOT_RELEVANT = "NOT_RELEVANT",
    PAUSED = "PAUSED"
}
export interface CTAClickPayload {
    /**
     * destination url of the cta if available (i.e. CTA href etc.)
     * in some cases Cta is not url - therfore a simple string can be passed
     */
    targetUrl?: string | null;
}
export declare enum PlatformEnum {
    UNKNOWN = "UNKNOWN",
    BUSINESS_MANAGER = "BUSINESS_MANAGER",
    EDITORX = "EDITORX",
    EDITOR = "EDITOR",
    ADI = "ADI",
    OWNER_APP = "OWNER_APP",
    BRANDED_APP = "BRANDED_APP",
    DEV_CENTER = "DEV_CENTER"
}
export interface ReportEventRequest {
    /** Event properties container */
    event?: OfferEvent;
    /**
     * Deviant Art specific use-case: signed jwt token with uuid of deviant art user in wix bi infra
     * @maxLength 4096
     */
    deviantArtUserId?: string | null;
}
export interface ReportEventResponse {
}
export interface ListEventsSummaryRequest {
    /**
     * each element in response.eventsSummary is a summary of offerId
     * @format GUID
     */
    offerIds?: string[];
    /**
     * each element in response.campaignEventsSummary is a summary of corresponding campaignId
     * @format GUID
     */
    campaignIds?: string[];
    /**
     * applied to each requested offer or each offer within requested campaigns
     * all fields are optional - if not passing fields mask then no summary will be returned
     */
    summaryFilter?: SummaryFilter;
}
export interface SummaryFilter {
    /**
     * OPNIONAL - only events reported with this user id will be taken into account - supported by AGENT_MARK only
     * @format GUID
     */
    userId?: string | null;
    /**
     * OPNIONAL - only events reported with this account id will be taken into account
     * @format GUID
     */
    targetAccountId?: string | null;
    /**
     * OPNIONAL - only events reported with this site id will be taken into account
     * @format GUID
     */
    siteId?: string | null;
    /**
     * which placement offers take into account in campaign scope (applicable only for campaign_ids requests)
     * @format GUID
     */
    placementId?: string | null;
    /**
     * Array of strings that will determine which events will be included in EventsSummary response
     * In the format of EventsSummary fields "<event_usecase>.<event_type>"
     *
     * Possible values for VIEW events:
     * - lastEvent.VIEW
     * - eventsCount.VIEW
     * Possible values for MAIN_CTA_CLICK events:
     * * get last main cta click of any action type:
     * - lastEvent.MAIN_CTA_CLICK
     * - eventsCount.MAIN_CTA_CLICK
     *
     * Possible values for AGENT_MARK events:
     * * get last event of any status:
     * - lastEvent.AGENT_MARK
     *
     *
     * For example:
     * "lastEvent.VIEW,lastEvent.AGENT_MARK,eventsCount.MAIN_CTA_CLICK"
     *
     * will result in (if CLOSE event exists for given offer/user/metasite)
     * {
     * lastEvent: {
     * VIEW: {...(OfferEvent data)},
     * AGENT_MARK: {...(OfferEvent data)}
     * },
     * eventsCount:{ MAIN_CTA_CLICK: { totalCount: 20 }}
     * }
     */
    fieldMask?: string[];
}
export interface ListEventsSummaryResponse {
    /** list of event summaries for requested offer ids, will be empty if only campaign events requested */
    eventsSummary?: EventsSummary[];
    /** list of event summaries for requested campaign ids, will be empty if only offer events requested */
    campaignEventsSummary?: EventsSummary[];
}
export interface EventsSummary {
    /**
     * If set - means this summary is about the offer
     * @format GUID
     */
    offerId?: string | null;
    /**
     * If set - means this summary is about the campaign
     * @format GUID
     */
    campaignId?: string | null;
    /**
     * Campaign summary: Last event per type among all offers within campaign (+ placement if filter specified)
     * Offer summary: Last event per type for given offer
     *
     * key is a value from EventType enum
     * OfferEvent enity eill be returned partailly dependeing on event type - see details on entity
     */
    lastEvent?: Record<string, OfferEvent>;
    /**
     * Campaign summary: cumulative counters for all offer events of the same type within this campaign (+ placement if filter specified)
     * Offer summary: event counts per type for given offer
     *
     * key is a value from EventType enum
     */
    eventsCount?: Record<string, EventCounts>;
}
export interface EventCounts {
    /** counter */
    totalCount?: number | null;
}
export interface QueryEventsRequest {
    /**
     * 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 } }
     */
    query: Query;
}
export interface Query {
    /**
     * Filter object in the following format:
     * `"filter" : {
     * "fieldName1": "value1",
     * "fieldName2":{"$operator":"value2"}
     * }`
     * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
     */
    filter?: any;
    /**
     * Sort object in the following format:
     * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
     */
    sort?: Sorting[];
    /** Paging options to limit and skip the number of items. */
    paging?: Paging;
    /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
    fields?: string[];
    /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
    fieldsets?: string[];
}
export interface Sorting {
    /**
     * Name of the field to sort by.
     * @maxLength 512
     */
    fieldName?: string;
    /** Sort order. */
    order?: SortOrder;
    /**
     * When `field_name` is a property of repeated field that is marked as `MATCH_ITEMS` and sort should be done by
     * a specific element from a collection, filter can/should be provided to ensure correct sort value is picked.
     *
     * If multiple filters are provided, they are combined with AND operator.
     *
     * Example:
     * Given we have document like {"id": "1", "nestedField": [{"price": 10, "region": "EU"}, {"price": 20, "region": "US"}]}
     * and `nestedField` is marked as `MATCH_ITEMS`, to ensure that sorting is done by correct region, filter should be
     * { fieldName: "nestedField.price", "select_items_by": [{"nestedField.region": "US"}] }
     * @internal
     * @maxSize 10
     */
    selectItemsBy?: Record<string, any>[] | null;
}
export declare enum SortOrder {
    ASC = "ASC",
    DESC = "DESC"
}
export interface Paging {
    /** Number of items to load. */
    limit?: number | null;
    /** Number of items to skip in the current sort order. */
    offset?: number | null;
}
export interface QueryEventsResponse {
    /** List of offer events */
    events?: OfferEvent[];
    /** result paging status */
    pagingMetadata?: PagingMetadata;
}
export interface PagingMetadata {
    /** Number of items returned in the response. */
    count?: number | null;
    /** Offset that was requested. */
    offset?: number | null;
    /** Total number of items that match the query. */
    total?: number | null;
    /** Flag that indicates the server failed to calculate the `total` field. */
    tooManyToCount?: boolean | null;
    /**
     * Indicates if there are more results after the current page.
     * If `true`, another page of results can be retrieved.
     * If `false`, this is the last page.
     * @internal
     */
    hasNext?: boolean | null;
}
