All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.mparticle.sdk.model.eventprocessing.ProductActionEvent Maven / Gradle / Ivy

There is a newer version: 3.2.0
Show newest version
package com.mparticle.sdk.model.eventprocessing;

import com.fasterxml.jackson.annotation.JsonProperty;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

public final class ProductActionEvent extends Event {

    @JsonProperty(value="action", required=true)
    private Action action;

    @JsonProperty("transaction_id")
    private String transactionId;

    @JsonProperty("affiliation")
    private String affiliation;

    @JsonProperty("total_amount")
    private BigDecimal totalAmount;

    @JsonProperty("tax_amount")
    private BigDecimal taxAmount;

    @JsonProperty("shipping_amount")
    private BigDecimal shippingAmount;

    @JsonProperty("currency_code")
    private String currencyCode;

    @JsonProperty("coupon_code")
    private String couponCode;

    @JsonProperty("products")
    private List products;

    @JsonProperty("attributes")
    private Map attributes;

    @JsonProperty("custom_flags")
    private Map customFlags;

    public ProductActionEvent() {
        super(Type.PRODUCT_ACTION);
    }

    public Action getAction() {
        return action;
    }

    public ProductActionEvent setAction(Action action) {
        this.action = action;
        return this;
    }

    public String getTransactionId() {
        return transactionId;
    }

    public ProductActionEvent setTransactionId(String transactionId) {
        this.transactionId = transactionId;
        return this;
    }

    public String getAffiliation() {
        return affiliation;
    }

    public ProductActionEvent setAffiliation(String affiliation) {
        this.affiliation = affiliation;
        return this;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public ProductActionEvent setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
        return this;
    }

    public BigDecimal getTaxAmount() {
        return taxAmount;
    }

    public ProductActionEvent setTaxAmount(BigDecimal taxAmount) {
        this.taxAmount = taxAmount;
        return this;
    }

    public BigDecimal getShippingAmount() {
        return shippingAmount;
    }

    public ProductActionEvent setShippingAmount(BigDecimal shippingAmount) {
        this.shippingAmount = shippingAmount;
        return this;
    }

    public String getCurrencyCode() {
        return currencyCode;
    }

    public ProductActionEvent setCurrencyCode(String currencyCode) {
        this.currencyCode = currencyCode;
        return this;
    }

    public String getCouponCode() {
        return couponCode;
    }

    public ProductActionEvent setCouponCode(String couponCode) {
        this.couponCode = couponCode;
        return this;
    }

    public List getProducts() {
        return products;
    }

    public ProductActionEvent setProducts(List products) {
        this.products = products;
        return this;
    }

    public Map getAttributes() {
        return attributes;
    }

    public ProductActionEvent setAttributes(Map attributes) {
        this.attributes = attributes;
        return this;
    }

    /**
     *
     * @return custom flags map
     */
    public Map getCustomFlags() { return customFlags; }

    /**
     *
     * @param customFlags custom flags map
     */
    public void setCustomFlags(Map customFlags) { this.customFlags = customFlags; }

    public enum Action {
        ADD_TO_WISHLIST,
        REMOVE_FROM_WISH_LIST,
        ADD_TO_CART,
        REMOVE_FROM_CART,
        CHECKOUT,
        PURCHASE,
        REFUND,
        CHECKOUT_OPTION,
        CLICK,
        VIEW_DETAIL;

        @Override
        public String toString() {
            return this.name().toLowerCase();
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy