public class AddPurchase extends Request
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
additionalData
A dictionary of additional data for the interaction.
|
protected java.lang.Double |
amount
Amount (number) of purchased items.
|
protected java.lang.Boolean |
cascadeCreate
Sets whether the given user/item should be created if not present in the database.
|
protected java.lang.String |
itemId
Purchased item
|
protected java.lang.Double |
price
Price paid by the user for the item.
|
protected java.lang.Double |
profit
Your profit from the purchased item.
|
protected java.lang.String |
recommId
If this purchase is based on a recommendation request, `recommId` is the id of the clicked recommendation.
|
protected java.util.Date |
timestamp
UTC timestamp of the purchase as ISO8601-1 pattern or UTC epoch time.
|
protected java.lang.String |
userId
User who purchased the item
|
Constructor and Description |
---|
AddPurchase(java.lang.String userId,
java.lang.String itemId)
Construct the request
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.lang.Object> |
getAdditionalData() |
double |
getAmount() |
java.util.Map<java.lang.String,java.lang.Object> |
getBodyParameters()
Get body parameters
|
boolean |
getCascadeCreate() |
HTTPMethod |
getHTTPMethod() |
java.lang.String |
getItemId() |
java.lang.String |
getPath() |
double |
getPrice() |
double |
getProfit() |
java.util.Map<java.lang.String,java.lang.Object> |
getQueryParameters()
Get query parameters
|
java.lang.String |
getRecommId() |
java.util.Date |
getTimestamp() |
java.lang.String |
getUserId() |
AddPurchase |
setAdditionalData(java.util.Map<java.lang.String,java.lang.Object> additionalData) |
AddPurchase |
setAmount(double amount) |
AddPurchase |
setCascadeCreate(boolean cascadeCreate) |
AddPurchase |
setPrice(double price) |
AddPurchase |
setProfit(double profit) |
AddPurchase |
setRecommId(java.lang.String recommId) |
AddPurchase |
setTimestamp(java.util.Date timestamp) |
getEnsureHttps, getTimeout, setTimeout
protected java.lang.String userId
protected java.lang.String itemId
protected java.util.Date timestamp
protected java.lang.Boolean cascadeCreate
protected java.lang.Double amount
protected java.lang.Double price
protected java.lang.Double profit
protected java.lang.String recommId
protected java.util.Map<java.lang.String,java.lang.Object> additionalData
public AddPurchase(java.lang.String userId, java.lang.String itemId)
userId
- User who purchased the itemitemId
- Purchased itempublic AddPurchase setTimestamp(java.util.Date timestamp)
timestamp
- UTC timestamp of the purchase as ISO8601-1 pattern or UTC epoch time. The default value is the current time.public AddPurchase setCascadeCreate(boolean cascadeCreate)
cascadeCreate
- Sets whether the given user/item should be created if not present in the database.public AddPurchase setAmount(double amount)
amount
- Amount (number) of purchased items. The default is 1. For example if `user-x` purchases two `item-y` during a single order (session...), the `amount` should equal to 2.public AddPurchase setPrice(double price)
price
- Price paid by the user for the item. If `amount` is greater than 1, sum of prices of all the items should be given.public AddPurchase setProfit(double profit)
profit
- Your profit from the purchased item. The profit is natural in e-commerce domain (for example if `user-x` purchases `item-y` for $100 and the gross margin is 30 %, then the profit is $30), but is applicable also in other domains (for example at a news company it may be income from displayed advertisement on article page). If `amount` is greater than 1, sum of profit of all the items should be given.public AddPurchase setRecommId(java.lang.String recommId)
recommId
- If this purchase is based on a recommendation request, `recommId` is the id of the clicked recommendation.public AddPurchase setAdditionalData(java.util.Map<java.lang.String,java.lang.Object> additionalData)
additionalData
- A dictionary of additional data for the interaction.public java.lang.String getUserId()
public java.lang.String getItemId()
public java.util.Date getTimestamp()
public boolean getCascadeCreate()
public double getAmount()
public double getPrice()
public double getProfit()
public java.lang.String getRecommId()
public java.util.Map<java.lang.String,java.lang.Object> getAdditionalData()
public HTTPMethod getHTTPMethod()
getHTTPMethod
in class Request
public java.lang.String getPath()
public java.util.Map<java.lang.String,java.lang.Object> getQueryParameters()
getQueryParameters
in class Request
public java.util.Map<java.lang.String,java.lang.Object> getBodyParameters()
getBodyParameters
in class Request