Interface WebServiceProxy
-
public interface WebServiceProxyThis class lists REST endpoints that are used to access to the server.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classWebServiceProxy.InstanceHolderThis class creates an instance of Web Proxy Server that creates a JSON object out of the question object and logs HTTP traffic and builds the actual HTTP requests.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description io.reactivex.Single<Question>createQuestion(Question question, String bearerToken)This method defines the behavior of a POST request to the URL /interviewprep/questions/.io.reactivex.CompletabledeleteQuestion(UUID questionId, String bearerToken)This method defines the behavior of a DELETE request to the URL /interviewprep/questions/questionId.static WebServiceProxygetInstance()Returns a single instance of the class instance holder.io.reactivex.Single<Question>getQuestion(UUID questionId, String bearerToken)This method defines the behavior of a GET request to the URL /interviewprep/questions/questionId.io.reactivex.Single<List<Question>>getQuestions(String bearerToken)This method defines the behavior of a GET request to the URL /interviewprep/questions/.io.reactivex.Single<Question>getRandomQuestion(String bearerToken)This method defines the behavior of a GET request to the URL /interviewprep/questions/random.io.reactivex.Single<Question>updateQuestion(UUID questionId, Question question, String bearerToken)This method defines the behavior of a PUT request to the URL /interviewprep/questions/questionId.
-
-
-
Method Detail
-
getQuestions
@GET("questions") io.reactivex.Single<List<Question>> getQuestions(@Header("Authorization") String bearerToken)This method defines the behavior of a GET request to the URL /interviewprep/questions/. It returns all questions from the server.
-
getRandomQuestion
@GET("questions/random") io.reactivex.Single<Question> getRandomQuestion(@Header("Authorization") String bearerToken)This method defines the behavior of a GET request to the URL /interviewprep/questions/random. It returns a random question from the server.- Parameters:
bearerToken- Token in the form of a bearer token used to authenticate with the server. *- Returns:
- A random
Questionin the form of a ReactiveXSingle.
-
getQuestion
@GET("questions/{questionId}") io.reactivex.Single<Question> getQuestion(@Path("questionId") UUID questionId, @Header("Authorization") String bearerToken)This method defines the behavior of a GET request to the URL /interviewprep/questions/questionId. It returns a single question from the server.- Parameters:
bearerToken- Token in the form of a bearer token used to authenticate with the server.questionId- A question id in the form of a universally unique identifier.- Returns:
- A single
Questionin the form of a ReactiveXSingle.
-
updateQuestion
@PUT("questions/{questionId}") io.reactivex.Single<Question> updateQuestion(@Path("questionId") UUID questionId, @Body Question question, @Header("Authorization") String bearerToken)This method defines the behavior of a PUT request to the URL /interviewprep/questions/questionId. It sends and returns an updated question from the server.
-
createQuestion
@POST("questions") io.reactivex.Single<Question> createQuestion(@Body Question question, @Header("Authorization") String bearerToken)This method defines the behavior of a POST request to the URL /interviewprep/questions/. It sends a newly created question to the server.
-
deleteQuestion
@DELETE("questions/{questionId}") io.reactivex.Completable deleteQuestion(@Path("questionId") UUID questionId, @Header("Authorization") String bearerToken)This method defines the behavior of a DELETE request to the URL /interviewprep/questions/questionId. It deletes a specified question from the server.- Parameters:
bearerToken- Token in the form of a bearer token used to authenticate with the server.questionId- A question id in the form of a universally unique identifier.- Returns:
- A ReactiveX
Completable.
-
getInstance
static WebServiceProxy getInstance()
Returns a single instance of the class instance holder.- Returns:
- A single instance of the class instance holder.
-
-