Class ChallengesAPI
- java.lang.Object
-
- com.cheetahdigital.corekit.models.module.Controller
-
- com.cheetahdigital.challenges.core.api.ChallengesAPI
-
- All Implemented Interfaces:
RestController
public class ChallengesAPI extends Controller
Class for setting the query parameters of Challenges API. AllNullable
parameters means you can remove the parameter by passing anull
value.
-
-
Field Summary
-
Fields inherited from class com.cheetahdigital.corekit.models.module.Controller
STANDARD_DATE_FORMAT, TIMEZONE_DATE_FORMAT
-
-
Constructor Summary
Constructors Constructor Description ChallengesAPI()
-
Method Summary
-
Methods inherited from class com.cheetahdigital.corekit.models.module.Controller
createCache, createHttpClient, createRetrofitInterface, evictAllCache, getGsonConfiguration, getRestAdapter, getTimeoutConnectionInSeconds, getTimeoutSocketInSeconds, initialize, removeResponsesFromCache
-
-
-
-
Method Detail
-
getInstance
public static ChallengesAPI getInstance()
-
getChallenges
public void getChallenges(ChallengeParams params, boolean clearCache, ListenerModel<BaseModel<Challenges>,Challenges> listener)
Get list of challenges- Parameters:
params
-ChallengeParams
for the Challenges APIclearCache
- clear previously stored cachelistener
- callback to handle the result
-
getChallenge
public void getChallenge(ChallengeParams params, boolean clearCache, ListenerModel<BaseModel<Challenge>,Challenge> listener)
Get the challenge- Parameters:
params
-ChallengeParams
for the Challenges APIclearCache
- clear previously stored cachelistener
- callback to handle the result
-
getChallengeHeaders
protected ChallengeHeaders getChallengeHeaders()
-
getChallenge
public void getChallenge(ChallengeHeaders headers, ChallengeParams params, boolean clearCache, ListenerModel<BaseModel<Challenge>,Challenge> listener)
Get the challenge- Parameters:
headers
-ChallengeHeaders
for the Challenges APIparams
-ChallengeParams
for the Challenges APIclearCache
- clear previously stored cachelistener
- callback to handle the result
-
getChallengeResponses
public void getChallengeResponses(ChallengeParams params, boolean clearCache, ListenerModel<BaseModel<ChallengeResponses>,ChallengeResponses> listener)
Get the challenge responses- Parameters:
params
-ChallengeParams
for the Challenges APIclearCache
- clear previously stored cachelistener
- callback to handle the result
-
getChallengeResponse
public void getChallengeResponse(ChallengeParams params, boolean clearCache, ListenerModel<BaseModel<ChallengeResponse>,ChallengeResponse> listener)
Get the challenge response- Parameters:
params
-ChallengeParams
for the Challenges APIclearCache
- clear previously stored cachelistener
- callback to handle the result
-
postChallenge
public void postChallenge(ChallengeParams params, ChallengeFields fields, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challenge- Parameters:
params
-ChallengeParams
for the Challenges APIfields
-ChallengeFields
for the Challenges APIlistener
- callback to handle the result
-
postChallenge
public void postChallenge(ChallengeParams params, ChallengeParts parts, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challenge- Parameters:
params
-ChallengeParams
for the Challenges APIparts
-ChallengeParts
for the Challenges APIlistener
- callback to handle the result
-
postChallenge
public void postChallenge(ChallengeParams params, okhttp3.RequestBody body, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challenge- Parameters:
params
-ChallengeParams
for the Challenges APIbody
-RequestBody
for the Challenges APIlistener
- callback to handle the result
-
putChallenge
public void putChallenge(ChallengeParams params, ChallengeFields fields, ListenerModel<BaseModel<Response>,Response> listener)
Retry responding to a challenge- Parameters:
params
-ChallengeParams
for the Challenges APIfields
-ChallengeFields
for the Challenges APIlistener
- callback to handle the result
-
putChallenge
public void putChallenge(ChallengeParams params, ChallengeParts parts, ListenerModel<BaseModel<Response>,Response> listener)
Retry responding to a challenge- Parameters:
params
-ChallengeParams
for the Challenges APIparts
- instance ofChallengeParts
that contains the attachmentlistener
- callback to handle the result
-
putChallenge
public void putChallenge(ChallengeParams params, okhttp3.RequestBody body, ListenerModel<BaseModel<Response>,Response> listener)
Respond to a challenge- Parameters:
params
-ChallengeParams
for the Challenges APIbody
-RequestBody
for the Challenges APIlistener
- callback to handle the result
-
-