app/app/src/main/java/com/danilafe/fencelessgrazing/requests/CollarRequest.kt

25 lines
854 B
Kotlin
Raw Normal View History

2020-02-01 20:43:56 -08:00
package com.danilafe.fencelessgrazing.requests
import com.android.volley.Response
import com.android.volley.toolbox.StringRequest
import com.danilafe.fencelessgrazing.model.CollarSummary
import com.google.gson.reflect.TypeToken
2020-05-13 15:41:50 -07:00
/**
* A request to the `/collars` API endpoint. Retrieves a list of collar summaries, represented
* as [CollarSummary] objects.
*
* @param baseUrl the base URL of the API.
* @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.
*/
2020-02-01 20:43:56 -08:00
class CollarRequest(
baseUrl: String,
token : String,
2020-02-01 20:43:56 -08:00
listener: Response.Listener<List<CollarSummary>>,
error: Response.ErrorListener
) : AuthenticatedRequest(
baseUrl, "/collars", token,
listener.toGsonListener(), error
)