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

25 lines
854 B
Kotlin

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
/**
* 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.
*/
class CollarRequest(
baseUrl: String,
token : String,
listener: Response.Listener<List<CollarSummary>>,
error: Response.ErrorListener
) : AuthenticatedRequest(
baseUrl, "/collars", token,
listener.toGsonListener(), error
)