Package ai.promoted.delivery.client
Class ApiDelivery
- java.lang.Object
-
- ai.promoted.delivery.client.ApiDelivery
-
-
Constructor Summary
Constructors Constructor Description ApiDelivery(String endpoint, String apiKey, long timeoutMillis, boolean warmup, int maxRequestInsertions, boolean acceptGzip, boolean useGrpc)Instantiates a new Delivery API client.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ResponserunDelivery(DeliveryRequest deliveryRequest)Do delivery.
-
-
-
Constructor Detail
-
ApiDelivery
public ApiDelivery(String endpoint, String apiKey, long timeoutMillis, boolean warmup, int maxRequestInsertions, boolean acceptGzip, boolean useGrpc)
Instantiates a new Delivery API client.- Parameters:
endpoint- the endpointapiKey- the api keytimeoutMillis- the timeout in millismaxRequestInsertions- the max number of request insertionsacceptGzip- whether to accept gzipuseGrpc- whether to use gRPC instead of HTTP for deliverywarmup-
-
-
Method Detail
-
runDelivery
public Response runDelivery(DeliveryRequest deliveryRequest) throws DeliveryException
Do delivery.- Specified by:
runDeliveryin interfaceDelivery- Parameters:
deliveryRequest- the delivery request- Returns:
- the response with insertions from Promoted.ai
- Throws:
DeliveryException- any delivery exception that may occur
-
-