-
public final class BsLogItemEvent.BuilderBsLogItemEvent is required to log item related events which included when an item is viewed and when an item's detail is viewed.
-
-
Field Summary
Fields Modifier and Type Field Description private Stringitem_action_valueprivate ItemModelitem_valueprivate Stringsearch_idprivate DrugCatalogModeldrug_model
-
Constructor Summary
Constructors Constructor Description BsLogItemEvent.Builder(Context context, String item_action_value, ItemModel item_value, String item_id, Integer item_quantity, Float item_price, String item_currency, String item_type, String item_stockStatus, String item_promoId, String search_id, DrugCatalogModel drug_model, Object meta, Boolean update_immediately)
-
Method Summary
Modifier and Type Method Description final StringgetItem_action_value()final UnitsetItem_action_value(String item_action_value)final ItemModelgetItem_value()final UnitsetItem_value(ItemModel item_value)final StringgetSearch_id()final UnitsetSearch_id(String search_id)final DrugCatalogModelgetDrug_model()final UnitsetDrug_model(DrugCatalogModel drug_model)final <ERROR CLASS>init(Context context)init is required to pass context to the SDK method and log the event. final <ERROR CLASS>setItemAction(ItemAction item_actionValue)setItemViewAction is required to set Type for the type of log in this case, if a user is viewing an item or it's details. final <ERROR CLASS>setItemAction(String item_actionValue)setItemViewAction is required to set Type for the type of log in this case, if a user is viewing an item or it's details. final <ERROR CLASS>setItemId(String item_id)setItemId is required to log the Id for item the events are being logged. final <ERROR CLASS>setItemQuantity(Integer item_quantity)setItemQuantity is required to log the quantity for item the events are being logged. final <ERROR CLASS>setItemPrice(Float item_price)setItemPrice is required to log the price for item the events are being logged. final <ERROR CLASS>setItemPrice(Integer item_price)final <ERROR CLASS>setItemPrice(Double item_price)final <ERROR CLASS>setItemCurrency(String currency_code)setItemCurrency is required to log the currency for item the events are being logged. final <ERROR CLASS>setItemType(ItemType item_type)setItemType is required to log the type for item the events are being logged. final <ERROR CLASS>setItemType(String item_type)final <ERROR CLASS>setItemStockStatus(ItemStockStatus stock_status)setItemStockStatus is required to log the stock status for item the events are being logged. final <ERROR CLASS>setItemStockStatus(String stock_status)final <ERROR CLASS>setItemPromoId(String promo_id)setItemPromoId is required to log the promo Id for item the events are being logged. final <ERROR CLASS>setItem(ItemModel item)setItem can be used to pass the whole item as an object as well. final <ERROR CLASS>setItem(String itemJsonString)setItem can be used to pass the whole item as a Json String object as well. final <ERROR CLASS>setSearchId(String search_id)setSearchId is used to associate the search id with the item being viewed by the user. final <ERROR CLASS>setMeta(Object meta)You can pass any type of value in setMeta. final <ERROR CLASS>updateImmediately(Boolean update_immediately)updateImmediately is responsible for updating the values ot the backend immediately. final <ERROR CLASS>setDrugProperties(DrugCatalogModel drugProperties)final <ERROR CLASS>setDrugProperties(String drugProperties)final <ERROR CLASS>build()build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources. -
-
Constructor Detail
-
BsLogItemEvent.Builder
BsLogItemEvent.Builder(Context context, String item_action_value, ItemModel item_value, String item_id, Integer item_quantity, Float item_price, String item_currency, String item_type, String item_stockStatus, String item_promoId, String search_id, DrugCatalogModel drug_model, Object meta, Boolean update_immediately)
-
-
Method Detail
-
getItem_action_value
final String getItem_action_value()
-
setItem_action_value
final Unit setItem_action_value(String item_action_value)
-
getItem_value
final ItemModel getItem_value()
-
setItem_value
final Unit setItem_value(ItemModel item_value)
-
getSearch_id
final String getSearch_id()
-
setSearch_id
final Unit setSearch_id(String search_id)
-
getDrug_model
final DrugCatalogModel getDrug_model()
-
setDrug_model
final Unit setDrug_model(DrugCatalogModel drug_model)
-
init
final <ERROR CLASS> init(Context context)
init is required to pass context to the SDK method and log the event. if not provided, it will throw an exception on runtime.
-
setItemAction
final <ERROR CLASS> setItemAction(ItemAction item_actionValue)
setItemViewAction is required to set Type for the type of log in this case, if a user is viewing an item or it's details. setType log is used to define if the log is about the item itself or if the user id going into the details. you can provide the values using 2 different methods, one is for enum based and the other is for string based. Below is the method for the enum based approach.
-
setItemAction
final <ERROR CLASS> setItemAction(String item_actionValue)
setItemViewAction is required to set Type for the type of log in this case, if a user is viewing an item or it's details. setType log is used to define if the log is about the item itself or if the user id going into the details. you can provide the values using 2 different methods, one is for enum based and the other is for string based. Below is the method for the string based approach. Remember to note that for string input you need to use the same names as defined in the enum or else the events will be discarded.
-
setItemId
final <ERROR CLASS> setItemId(String item_id)
setItemId is required to log the Id for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.
-
setItemQuantity
final <ERROR CLASS> setItemQuantity(Integer item_quantity)
setItemQuantity is required to log the quantity for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.
-
setItemPrice
final <ERROR CLASS> setItemPrice(Float item_price)
setItemPrice is required to log the price for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.
-
setItemPrice
final <ERROR CLASS> setItemPrice(Integer item_price)
-
setItemPrice
final <ERROR CLASS> setItemPrice(Double item_price)
-
setItemCurrency
final <ERROR CLASS> setItemCurrency(String currency_code)
setItemCurrency is required to log the currency for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.
-
setItemType
final <ERROR CLASS> setItemType(ItemType item_type)
setItemType is required to log the type for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.
-
setItemType
final <ERROR CLASS> setItemType(String item_type)
-
setItemStockStatus
final <ERROR CLASS> setItemStockStatus(ItemStockStatus stock_status)
setItemStockStatus is required to log the stock status for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item.
-
setItemStockStatus
final <ERROR CLASS> setItemStockStatus(String stock_status)
-
setItemPromoId
final <ERROR CLASS> setItemPromoId(String promo_id)
setItemPromoId is required to log the promo Id for item the events are being logged. Details about the item are to be provided in the catalog for more details about the item. If there is not promo associated with the product, you do not need to pass it.
-
setItem
final <ERROR CLASS> setItem(ItemModel item)
setItem can be used to pass the whole item as an object as well. You can use the POJO ItemModel to parse the data int he required format and pass that to this function to log the event.
-
setItem
final <ERROR CLASS> setItem(String itemJsonString)
setItem can be used to pass the whole item as a Json String object as well. You can use the POJO ItemModel to parse the data int he required format and pass that to this function as a string to log the event. You can use Gson to convert the object to string but SDK will parse the Json string back to POJO so pass it in the log. This method should be used with caution and is suitable for react native bridge.
-
setSearchId
final <ERROR CLASS> setSearchId(String search_id)
setSearchId is used to associate the search id with the item being viewed by the user. It is required to track if the item is a result of some search performed by the user in the app.
-
setMeta
final <ERROR CLASS> setMeta(Object meta)
You can pass any type of value in setMeta. It is for developer and partners to log additional information with the log that they find would be helpful for logging and providing more context to the log. Default value for the meta is null.
-
updateImmediately
final <ERROR CLASS> updateImmediately(Boolean update_immediately)
updateImmediately is responsible for updating the values ot the backend immediately. By default this is set to false or whatever the developer has set in the SDK initialisation block. This differs the time for which the logs will be logged, if true, the SDK will log the content instantly and if false it will wait till the end of user session which is whenever the app goes into background.
-
setDrugProperties
final <ERROR CLASS> setDrugProperties(DrugCatalogModel drugProperties)
-
setDrugProperties
final <ERROR CLASS> setDrugProperties(String drugProperties)
-
build
final <ERROR CLASS> build()
build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources.
-
-
-
-