27 lines
1.0 KiB
Kotlin
27 lines
1.0 KiB
Kotlin
package com.danilafe.fencelessgrazing.requests.authenticated
|
|
|
|
import com.android.volley.Response
|
|
import com.danilafe.fencelessgrazing.model.CollarPos
|
|
import com.danilafe.fencelessgrazing.requests.toGsonListener
|
|
|
|
/**
|
|
* A request to the `/collars/<id>/history` API endpoint. Retrieves the entire list
|
|
* of coordinates, represented as [CollarPos] objects, that the collar has transmitted.
|
|
* The coordinates are sorted by date.
|
|
*
|
|
* @param baseUrl the base URL of the API.
|
|
* @param collarId the identifier of the collar whose history is being retrieved.
|
|
* @param token the API token for authentication.
|
|
* @param listener the listener that will be called if a valid list of coordinates is received.
|
|
* @param error the error listener for the request.
|
|
*/
|
|
class CollarHistoryRequest(
|
|
baseUrl: String,
|
|
collarId: Int,
|
|
token : String,
|
|
listener: Response.Listener<List<CollarPos>>,
|
|
error: Response.ErrorListener
|
|
) : AuthenticatedGetRequest(
|
|
baseUrl, "/collars/$collarId/history", token,
|
|
listener.toGsonListener(), error
|
|
) |