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

24 lines
840 B
Kotlin

package com.danilafe.fencelessgrazing.requests.authenticated
import com.android.volley.Response
import com.danilafe.fencelessgrazing.model.CollarSummary
import com.danilafe.fencelessgrazing.requests.toGsonListener
/**
* 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
)