Class TestandtargetCallOptions
java.lang.Object
com.day.cq.analytics.testandtarget.TestandtargetCallOptions
Provides a nice way of grouping the options of an API call. Those options include (but are not limited to) the API
location, the API method (GET, POST etc.), the API version to use etc.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the API version used.Returns the call method (GET, POST etc.)Returns the client code.Returns the HTTP parameters.Returns API location to useReturns the solution to be used.withApiVersion(String apiVersion) Sets the API version to invoke.Adds the call method to the options.withClientCode(String clientCode) Sets the client codewithLocation(String location) Sets the API location to invoke.withParameters(TestandtargetHttpParameters httpParameters) Sets the HTTP parametersSets the Adobe Target solution for which the options object is invoked
-
Constructor Details
-
TestandtargetCallOptions
public TestandtargetCallOptions()
-
-
Method Details
-
withCallMethod
public TestandtargetCallOptions withCallMethod(TestandtargetHttpClient.TestandtargetMethodType callMethod) Adds the call method to the options.- Parameters:
callMethod- the HTTP method (GET, POST etc)- Returns:
- an instance of this object
-
withClientCode
Sets the client code- Parameters:
clientCode- the client code- Returns:
- an instance of this object
-
withLocation
Sets the API location to invoke.- Parameters:
location- the API location to invoke (e.g./rest/v1/campaignor/rest/v5/segments- Returns:
- an instance of this object
-
withSolution
public TestandtargetCallOptions withSolution(TestandtargetHttpClient.TestandtargetSolution solution) Sets the Adobe Target solution for which the options object is invoked- Parameters:
solution- the Adobe Target solution to use (Target or Target Recommendation)- Returns:
- an instance of this object
-
withParameters
Sets the HTTP parameters- Parameters:
httpParameters- the additional HTTP parameters- Returns:
- an instance of this object
-
withApiVersion
Sets the API version to invoke.- Parameters:
apiVersion- the API version to invoke. Ifnullis supplied then the v1 version is used.- Returns:
- an instance of this object
-
getCallMethod
Returns the call method (GET, POST etc.)- Returns:
- a
TestandtargetHttpClient.TestandtargetMethodTypeobject representing the method
-
getClientCode
Returns the client code.- Returns:
- a
Stringobject representing the client code
-
getLocation
Returns API location to use- Returns:
- a
Stringobject representing the location (e.g.campaign/23.json
-
getSolution
Returns the solution to be used.- Returns:
- a
TestandtargetHttpClient.TestandtargetSolutionobject representing the method
-
getHttpParameters
Returns the HTTP parameters.- Returns:
- a
TestandtargetHttpParametersobject representing the additional HTTP parameters.
-
getApiVersion
Returns the API version used.- Returns:
- a
Stringobject representing the API version.
-