package kr.co.vividnext.sodalive.audio_content.playlist

import io.reactivex.rxjava3.core.Single
import kr.co.vividnext.sodalive.audio_content.playlist.create.CreatePlaylistRequest
import kr.co.vividnext.sodalive.audio_content.playlist.detail.GetPlaylistDetailResponse
import kr.co.vividnext.sodalive.audio_content.playlist.modify.UpdatePlaylistRequest
import kr.co.vividnext.sodalive.common.ApiResponse
import retrofit2.http.Body
import retrofit2.http.DELETE
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.POST
import retrofit2.http.PUT
import retrofit2.http.Path

interface PlaylistApi {
    @GET("/audio-content/playlist")
    fun getPlaylistList(
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<GetPlaylistsResponse>>

    @GET("/audio-content/playlist/{id}")
    fun getPlaylistDetail(
        @Path("id") id: Long,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<GetPlaylistDetailResponse>>

    @POST("/audio-content/playlist")
    fun createPlaylist(
        @Body request: CreatePlaylistRequest,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<Any>>

    @DELETE("/audio-content/playlist/{id}")
    fun deletePlaylist(
        @Path("id") id: Long,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<Any>>

    @PUT("/audio-content/playlist/{id}")
    fun updatePlaylist(
        @Path("id") id: Long,
        @Body request: UpdatePlaylistRequest,
        @Header("Authorization") authHeader: String
    ): Single<ApiResponse<Any>>
}
