package com.pubnub.api.services

import retrofit2.Call
import retrofit2.http.*

interface PublishService {

    @GET("publish/{pubKey}/{subKey}/0/{channel}/0/{message}")
    fun publish(
        @Path("pubKey") pubKey: String,
        @Path("subKey") subKey: String,
        @Path("channel") channel: String,
        @Path(value = "message", encoded = true) message: String,
        @QueryMap(encoded = true) options: Map<String, String>
    ): Call<List<Any>>

    @POST("publish/{pubKey}/{subKey}/0/{channel}/0")
    @Headers("Content-Type: application/json; charset=UTF-8")
    fun publishWithPost(
        @Path("pubKey") pubKey: String,
        @Path("subKey") subKey: String,
        @Path("channel") channel: String,
        @Body body: Any,
        @QueryMap(encoded = true) options: Map<String, String>
    ): Call<List<Any>>
}