Package ai.promoted.delivery.client
Class DeliveryRequest
- java.lang.Object
-
- ai.promoted.delivery.client.DeliveryRequest
-
-
Constructor Summary
Constructors Constructor Description DeliveryRequest(Request request)Instantiates a new delivery request.DeliveryRequest(Request request, CohortMembership experiment)Instantiates a new delivery request.DeliveryRequest(Request request, CohortMembership experiment, boolean onlyLog, int retrievalInsertionOffset)Instantiates a new delivery request.DeliveryRequest(Request request, CohortMembership experiment, boolean onlyLog, int retrievalInsertionOffset, DeliveryRequestValidator validator)Instantiates a new delivery request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DeliveryRequestclone()CohortMembershipgetExperiment()Gets the experiment to use for this request, if any.RequestgetRequest()Gets the underlying request for ranked content.intgetRetrievalInsertionOffset()Gets the insertion start.booleanisOnlyLog()Checks whether or not to only perform logging and not call Delivery API.List<String>validate()Checks the state of this delivery requests and collects/returns any validation errors.
-
-
-
Constructor Detail
-
DeliveryRequest
public DeliveryRequest(Request request, CohortMembership experiment, boolean onlyLog, int retrievalInsertionOffset, DeliveryRequestValidator validator)
Instantiates a new delivery request.- Parameters:
request- the request to processexperiment- the experiment that the user is in, may be null, which means apply the treatmentonlyLog- if true, will log to Promoted.ai Metrics but not call Delivery API to re-rankretrievalInsertionOffset- start index in the request insertions in the list of ALL insertions
-
DeliveryRequest
public DeliveryRequest(Request request, CohortMembership experiment, boolean onlyLog, int retrievalInsertionOffset)
Instantiates a new delivery request.- Parameters:
request- the request to processexperiment- the experiment that the user is in, may be null, which means apply the treatmentonlyLog- if true, will log to Promoted.ai Metrics but not call Delivery API to re-rankretrievalInsertionOffset- start index in the request insertions in the list of ALL insertions
-
DeliveryRequest
public DeliveryRequest(Request request, CohortMembership experiment)
Instantiates a new delivery request.- Parameters:
request- the request to processexperiment- the experiment that the user is in, may be null, which means apply the treatment
-
DeliveryRequest
public DeliveryRequest(Request request)
Instantiates a new delivery request.- Parameters:
request- the request to process =
-
-
Method Detail
-
getRequest
public Request getRequest()
Gets the underlying request for ranked content.- Returns:
- the request
-
isOnlyLog
public boolean isOnlyLog()
Checks whether or not to only perform logging and not call Delivery API.- Returns:
- true, if is only log
-
getRetrievalInsertionOffset
public int getRetrievalInsertionOffset()
Gets the insertion start.- Returns:
- the insertion start
-
getExperiment
public CohortMembership getExperiment()
Gets the experiment to use for this request, if any.- Returns:
- the experiment
-
clone
public DeliveryRequest clone() throws CloneNotSupportedException
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
-