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

28 lines
1.1 KiB
Kotlin

package com.danilafe.fencelessgrazing.requests.authenticated
import com.android.volley.Response
import com.danilafe.fencelessgrazing.model.CollarPos
/**
* Request to the API's `/collar/<id>/boundary/set` endpoint, used to update a collar's
* valid grazing area. Note that although this request takes an arbitrary number of points,
* the collar itself only supports at most 10 vertices.
*
* @param baseUrl the base URl of the API.
* @param token the API token used for authentication.
* @param identifier the collar whose boundary is being set.
* @param coordinates the list of coordinates representing, in order, the new grazing boundary's vertices.
* @param listener the listener to be called when an OK response is received.
* @param error the error listener.
*/
class SetBoundaryRequest(
baseUrl: String,
token: String,
identifier: Int,
coordinates: List<CollarPos>,
listener: Response.Listener<String>,
error: Response.ErrorListener
) : AuthenticatedPostRequest<List<CollarPos>>(
coordinates, baseUrl, "/collars/${identifier}/boundary/set",
token, listener, error
)