26 lines
986 B
Kotlin
26 lines
986 B
Kotlin
package com.danilafe.fencelessgrazing.requests.authenticated
|
|
|
|
import com.android.volley.Response
|
|
import com.danilafe.fencelessgrazing.model.CollarDetails
|
|
import com.danilafe.fencelessgrazing.requests.toGsonListener
|
|
|
|
/**
|
|
* Request to the `/collars/<id>/details` API endpoint. Retrieves detailed information
|
|
* about a single collar, stored in a [CollarDetails] object.
|
|
*
|
|
* @param baseUrl the base URL of the API.
|
|
* @param collarId the identifier of the collar whose details are being retrieved.
|
|
* @param token the API token for authentication.
|
|
* @param listener the listener that will be called if a valid list of collar details is received.
|
|
* @param error the error listener for the request.
|
|
*/
|
|
class CollarDetailRequest(
|
|
baseUrl: String,
|
|
collarId: Int,
|
|
token : String,
|
|
listener: Response.Listener<CollarDetails>,
|
|
error: Response.ErrorListener
|
|
) : AuthenticatedRequest(
|
|
baseUrl, "/collars/$collarId/details", token,
|
|
listener.toGsonListener(), error
|
|
) |