package it.danieleverducci.openweddingapp.networking

import android.content.Context
import it.danieleverducci.openweddingapp.Config
import it.danieleverducci.openweddingapp.entities.Presence
import org.json.JSONObject

class PresenceNet(context: Context, token: String): AuthenticatedItemNet<Presence>(context, token) {
    companion object {
        val TAG = "PresenceNet"
    }

    fun postItem(listener: OnItemPostedListener<Presence>, item: Presence) {
        val url = "${Config.API_BASE_URL}${Config.API_ENDPOINT_PRESENCE}"
        super.postItem(url, listener, item)
    }

    fun getList(listener: OnItemListObtainedListener<Presence>) {
        val url = "${Config.API_BASE_URL}${Config.API_ENDPOINT_PRESENCE}"
        super.getList(url, 1, listener)
    }

    override fun newItem(jo: JSONObject): Presence {
        return Presence(jo)
    }
}