Interface TargetRecommendationsAPIClient
-
@ProviderType public interface TargetRecommendationsAPIClient
Provides support for the Target Recommendations APIs
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
checkConnection(java.lang.String clientCode, java.lang.String email, java.lang.String password)
Checks the connection to Target Recommendations using the given credentialsvoid
deleteAlgorithm(int id, Configuration ttConfig)
Deletes an algorithm from Target Recommendationsvoid
deleteFeed(int id, Configuration ttConfig)
Removes a product feed from Target Recommendationsvoid
deleteRecommendation(int id, Configuration ttConfig)
Removes a recommendation from Target Recommendationsvoid
deleteTemplate(int id, Configuration ttConfig)
Deletes a template from the Target Recommendations backendRecommendationAlgorithm
getAlgorithm(int id, Configuration ttConfig)
Get a single algorithm from a given idjava.util.List<RecommendationAlgorithm>
getAlgorithms(Configuration ttConfig)
Get a list of available algorithms for the given TesT&TargetConfiguration
ProductFeed
getFeed(int id, Configuration ttConfig)
Get a single product feed based on a given idjava.util.List<ProductFeed>
getFeeds(Configuration ttConfig)
Get all defined product feeds in Target Recommendations related to a given TesT&Target configurationjava.util.List<RecommendationMbox>
getMBoxes(Configuration ttConfig)
Get the list of available MBoxes for a given T&T configurationTargetRecommendation
getRecommendation(int id, Configuration ttConfig)
Get a single recommendation from a given idjava.util.List<TargetRecommendation>
getRecommendations(Configuration ttConfig)
Get all recommendations related to the given TesT&TargetConfiguration
RecommendationTemplate
getTemplate(int id, Configuration ttConfig)
Get a single template having a given idjava.util.List<RecommendationTemplate>
getTemplates(Configuration ttConfig)
Get the list of available templates associated with a given TesT&TargetConfiguration
void
removeProducts(java.util.List<java.lang.String> productList, Configuration ttConfig)
Removes a list of products from the Target Recommendations indexRecommendationAlgorithm
saveAlgorithm(RecommendationAlgorithm algorithm, Configuration ttConfig)
Saves an algorithm in Target Recommendations using the given cloud configurationProductFeed
saveFeed(ProductFeed feed, Configuration ttConfig)
Saves the givenProductFeed
in Target Recommendations using the given cloud configurationTargetRecommendation
saveRecommendation(TargetRecommendation recommendation, Configuration ttConfig)
Saves a givenTargetRecommendation
in Target Recommendations system using the given cloud configurationRecommendationTemplate
saveTemplate(RecommendationTemplate template, Configuration ttConfig)
Saves a template in Target Recommendations backend using the given T&T cloud configuration
-
-
-
Method Detail
-
getTemplates
java.util.List<RecommendationTemplate> getTemplates(Configuration ttConfig) throws TargetRecommendationsException
Get the list of available templates associated with a given TesT&TargetConfiguration
- Parameters:
ttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- a
List
containing theRecommendationTemplate
objects available for the given T&T client - Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
getTemplate
RecommendationTemplate getTemplate(int id, Configuration ttConfig) throws TargetRecommendationsException
Get a single template having a given id- Parameters:
id
- - aInteger
value identifying a recommendation templatettConfig
- - theConfiguration
that identifies the Target config- Returns:
- a
RecommendationTemplate
if a valid template is found for the given id and configuration ornull
if none is found - Throws:
TargetRecommendationsException
-TargetRecommendationsException
$
-
saveTemplate
RecommendationTemplate saveTemplate(RecommendationTemplate template, Configuration ttConfig) throws TargetRecommendationsException
Saves a template in Target Recommendations backend using the given T&T cloud configuration- Parameters:
template
- - theRecommendationTemplate
that needs to be persisted in the Recommendations backendttConfig
- - the TargetConfiguration
- Returns:
- the saved
RecommendationTemplate
- Throws:
TargetRecommendationsException
-TargetRecommendationsException
on any issues encountered during template update operation
-
deleteTemplate
void deleteTemplate(int id, Configuration ttConfig) throws TargetRecommendationsException
Deletes a template from the Target Recommendations backend- Parameters:
id
- - theInteger
id of the template that needs to be deletedttConfig
- - the TargetConfiguration
- Throws:
TargetRecommendationsException
-TargetRecommendationsException
on any issues encountered during template deletion
-
getMBoxes
java.util.List<RecommendationMbox> getMBoxes(Configuration ttConfig) throws TargetRecommendationsException
Get the list of available MBoxes for a given T&T configuration- Parameters:
ttConfig
- - the TargetConfiguration
- Returns:
- a
List
containing the MBoxes available for the given T&T client - Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
getAlgorithms
java.util.List<RecommendationAlgorithm> getAlgorithms(Configuration ttConfig) throws TargetRecommendationsException
Get a list of available algorithms for the given TesT&TargetConfiguration
- Parameters:
ttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- a
List
containing theRecommendationAlgorithm
objects available for the given T&T client - Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
getAlgorithm
RecommendationAlgorithm getAlgorithm(int id, Configuration ttConfig) throws TargetRecommendationsException
Get a single algorithm from a given id- Parameters:
id
- - the Target Recommendations id of the needed algorithmttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- a
RecommendationAlgorithm
object if a valid algorithm with the given id is found in Target Recommendations ornull
if none is found - Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
saveAlgorithm
RecommendationAlgorithm saveAlgorithm(RecommendationAlgorithm algorithm, Configuration ttConfig) throws TargetRecommendationsException
Saves an algorithm in Target Recommendations using the given cloud configuration- Parameters:
algorithm
- - theRecommendationAlgorithm
to be updated in Target RecommendationsttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- the saved
RecommendationAlgorithm
- Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
deleteAlgorithm
void deleteAlgorithm(int id, Configuration ttConfig) throws TargetRecommendationsException
Deletes an algorithm from Target Recommendations- Parameters:
id
- - the Target Recommendations id of the algorithm to be deletedttConfig
- - theConfiguration
that identifies the Target cloud configuration- Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
getRecommendations
java.util.List<TargetRecommendation> getRecommendations(Configuration ttConfig) throws TargetRecommendationsException
Get all recommendations related to the given TesT&TargetConfiguration
- Parameters:
ttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- a
List
containing all theTargetRecommendation
objects available to the given T&T client - Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
getRecommendation
TargetRecommendation getRecommendation(int id, Configuration ttConfig) throws TargetRecommendationsException
Get a single recommendation from a given id- Parameters:
id
- - the Target Recommendations id of the required recommendationttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- a
TargetRecommendation
object if a valid recommendation with the given id is found in Target Recommendations ornull
if none is found - Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
saveRecommendation
TargetRecommendation saveRecommendation(TargetRecommendation recommendation, Configuration ttConfig) throws TargetRecommendationsException
Saves a givenTargetRecommendation
in Target Recommendations system using the given cloud configuration- Parameters:
recommendation
- - theTargetRecommendation
recommendation object to be persisted in Target RecommendationsttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- the saved
TargetRecommendation
- Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
deleteRecommendation
void deleteRecommendation(int id, Configuration ttConfig) throws TargetRecommendationsException
Removes a recommendation from Target Recommendations- Parameters:
id
- - the recommendation idttConfig
- - theConfiguration
that identifies the Target cloud configuration- Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
getFeeds
java.util.List<ProductFeed> getFeeds(Configuration ttConfig) throws TargetRecommendationsException
Get all defined product feeds in Target Recommendations related to a given TesT&Target configuration- Parameters:
ttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- a
List
containing all theProductFeed
feeds defined for the given T&T account - Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
getFeed
ProductFeed getFeed(int id, Configuration ttConfig) throws TargetRecommendationsException
Get a single product feed based on a given id- Parameters:
id
- - the Target Recommendations id of the required product feedttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- a
ProductFeed
abstraction of the recommendations product feed if one with the given id is found in Target Recommendations backend ornull
if none is found - Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
saveFeed
ProductFeed saveFeed(ProductFeed feed, Configuration ttConfig) throws TargetRecommendationsException
Saves the givenProductFeed
in Target Recommendations using the given cloud configuration- Parameters:
feed
- - theProductFeed
to be updated in Target RecsttConfig
- - theConfiguration
that identifies the Target cloud configuration- Returns:
- the updated
ProductFeed
- Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
deleteFeed
void deleteFeed(int id, Configuration ttConfig) throws TargetRecommendationsException
Removes a product feed from Target Recommendations- Parameters:
id
- - the product feed idttConfig
- - theConfiguration
that identifies the Target cloud configuration- Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
removeProducts
void removeProducts(java.util.List<java.lang.String> productList, Configuration ttConfig) throws TargetRecommendationsException
Removes a list of products from the Target Recommendations index- Parameters:
productList
- - the list of product ids to be removed from the Recommendations indexttConfig
- - theConfiguration
that identifies the Target cloud configuration- Throws:
TargetRecommendationsException
-TargetRecommendationsException
-
checkConnection
void checkConnection(java.lang.String clientCode, java.lang.String email, java.lang.String password) throws TargetRecommendationsException
Checks the connection to Target Recommendations using the given credentials- Parameters:
clientCode
- clientCodeemail
- emailpassword
- password- Throws:
TargetRecommendationsException
-TargetRecommendationsException
on any connection error
-
-