Rename the authenticated request.

This commit is contained in:
Danila Fedorin 2020-05-13 23:52:00 -07:00
parent e13572ae67
commit 7cd3706b7d
5 changed files with 7 additions and 7 deletions

View File

@ -7,7 +7,7 @@ import com.android.volley.toolbox.StringRequest
* General request aimed at a protected endpoint of the API. The token can be retrieved
* via a [LoginRequest], or, if you've made it past the login screen, via Shared Preferences.
*
* The [AuthenticatedRequest] expects to receive a string from the API endpoint; how this string
* The [AuthenticatedGetRequest] expects to receive a string from the API endpoint; how this string
* is handled is determined by the [Response.Listener] object. One may use
* [Response.Listener.toGsonListener] to create a JSON deserializer that expects a [String].
*
@ -17,10 +17,10 @@ import com.android.volley.toolbox.StringRequest
* @param listener the listener object called if a valid response is received.
* @param error the error listener for the request.
*/
open class AuthenticatedRequest(
open class AuthenticatedGetRequest(
baseUrl: String,
apiEndpoint: String,
private val token: String,
val token: String,
listener: Response.Listener<String>,
error: Response.ErrorListener
) : StringRequest(

View File

@ -20,7 +20,7 @@ class CollarDetailRequest(
token : String,
listener: Response.Listener<CollarDetails>,
error: Response.ErrorListener
) : AuthenticatedRequest(
) : AuthenticatedGetRequest(
baseUrl, "/collars/$collarId/details", token,
listener.toGsonListener(), error
)

View File

@ -21,7 +21,7 @@ class CollarHistoryRequest(
token : String,
listener: Response.Listener<List<CollarPos>>,
error: Response.ErrorListener
) : AuthenticatedRequest(
) : AuthenticatedGetRequest(
baseUrl, "/collars/$collarId/history", token,
listener.toGsonListener(), error
)

View File

@ -18,7 +18,7 @@ class CollarRequest(
token : String,
listener: Response.Listener<List<CollarSummary>>,
error: Response.ErrorListener
) : AuthenticatedRequest(
) : AuthenticatedGetRequest(
baseUrl, "/collars", token,
listener.toGsonListener(), error
)

View File

@ -19,7 +19,7 @@ class DistanceTraveledRequest(
token : String,
listener: Response.Listener<List<CollarDistance>>,
error: Response.ErrorListener
) : AuthenticatedRequest(
) : AuthenticatedGetRequest(
baseUrl, "/collars/stats/distance", token,
listener.toGsonListener(), error
)