Recombee API Client
Public Member Functions | Properties | List of all members
Recombee.ApiClient.ApiRequests.Batch Class Reference

Batch request for submitting multiple atomic requests. More...

Inheritance diagram for Recombee.ApiClient.ApiRequests.Batch:
Inheritance graph
[legend]
Collaboration diagram for Recombee.ApiClient.ApiRequests.Batch:
Collaboration graph
[legend]

Public Member Functions

 Batch (IEnumerable< Request > requests, bool?distinctRecomms=null)
 Construct the request More...
 
override string Path ()
 
Returns
URI to the endpoint including path parameters
More...
 
override Dictionary< string, object > QueryParameters ()
 Get query parameters More...
 
override Dictionary< string, object > BodyParameters ()
 Get body parameters More...
 
- Public Member Functions inherited from Recombee.ApiClient.ApiRequests.Request
 Request (HttpMethod httpMethod, int timeoutMilliseconds, bool ensureHttps=false)
 Construct the request More...
 

Properties

IEnumerable< RequestRequests [get]
 
bool DistinctRecomms [get]
 Makes all the recommended items for a certain user distinct among multiple recommendation requests in the batch. More...
 
- Properties inherited from Recombee.ApiClient.ApiRequests.Request
TimeSpan Timeout [get, set]
 Timeout for the request in milliseconds More...
 
bool EnsureHttps [get]
 If true, HTTPS must be chosen over HTTP for this request More...
 
HttpMethod RequestHttpMehod [get]
 Used HTTP method More...
 

Additional Inherited Members

- Protected Member Functions inherited from Recombee.ApiClient.ApiRequests.Request
double ConvertToUnixTimestamp (DateTime date)
 
Returns
Converts DateTime to UNIX timestamp (epoch)
More...
 

Detailed Description

Batch request for submitting multiple atomic requests.

In many cases, it may be desirable to execute multiple requests at once. For example, when synchronizing the catalog of items in periodical manner, you would have to execute a sequence of thousands of separate POST requests, which is very ineffective and may take a very long time to complete. Most notably, network latencies can make execution of such a sequence very slow and even if executed in multiple parallel threads, there will still be unreasonable overhead caused by the HTTP(s). To avoid the problems mentioned, batch processing may be used, encapsulating a sequence of requests into a single HTTP request. Batch processing allows you to submit arbitrary sequence of requests in form of JSON array. Any type of request from the above documentation may be used in the batch, and the batch may combine different types of requests arbitrarily as well. Note that:

Constructor & Destructor Documentation

Recombee.ApiClient.ApiRequests.Batch.Batch ( IEnumerable< Request requests,
bool?  distinctRecomms = null 
)
inline

Construct the request

Parameters
requestsIEnumerable containing the requests.
distinctRecommsMakes all the recommended items for a certain user distinct among multiple recommendation requests in the batch.

Member Function Documentation

override Dictionary<string, object> Recombee.ApiClient.ApiRequests.Batch.BodyParameters ( )
inlinevirtual

Get body parameters

Returns
Dictionary containing values of body parameters (name of parameter: value of the parameter)

Implements Recombee.ApiClient.ApiRequests.Request.

override string Recombee.ApiClient.ApiRequests.Batch.Path ( )
inlinevirtual

Returns
URI to the endpoint including path parameters

Implements Recombee.ApiClient.ApiRequests.Request.

override Dictionary<string, object> Recombee.ApiClient.ApiRequests.Batch.QueryParameters ( )
inlinevirtual

Get query parameters

Returns
Dictionary containing values of query parameters (name of parameter: value of the parameter)

Implements Recombee.ApiClient.ApiRequests.Request.

Property Documentation

bool Recombee.ApiClient.ApiRequests.Batch.DistinctRecomms
get

Makes all the recommended items for a certain user distinct among multiple recommendation requests in the batch.

IEnumerable<Request> Recombee.ApiClient.ApiRequests.Batch.Requests
get

The documentation for this class was generated from the following file: