Package ai.promoted.delivery.client
Class DeliveryRequest
java.lang.Object
ai.promoted.delivery.client.DeliveryRequest
- All Implemented Interfaces:
Cloneable
DeliveryRequest is the input into delivery.
-
Constructor Summary
ConstructorsConstructorDescriptionDeliveryRequest(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
Modifier and TypeMethodDescriptionclone()Gets the experiment to use for this request, if any.Gets the underlying request for ranked content.intGets the insertion start.booleanChecks whether or not to only perform logging and not call Delivery API.validate(boolean isShadowTraffic) Checks the state of this delivery requests and collects/returns any validation errors.
-
Constructor Details
-
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
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
Instantiates a new delivery request.- Parameters:
request- the request to process =
-
-
Method Details
-
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
Gets the experiment to use for this request, if any.- Returns:
- the experiment
-
clone
- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
validate
Checks the state of this delivery requests and collects/returns any validation errors.- Parameters:
isShadowTraffic-- Returns:
- a list of validation errors, which may be empty.
-