package com.omixlab.lckcontrol.data.remote

import retrofit2.http.*

interface LckApiService {

    // ── Health ────────────────────────────────────────────

    @GET("health")
    suspend fun healthCheck(): HealthResponse

    // ── Auth ─────────────────────────────────────────────

    @POST("auth/meta/callback")
    suspend fun metaCallback(@Body body: MetaCallbackRequest): AuthTokensResponse

    @POST("auth/refresh")
    suspend fun refreshSession(@Body body: RefreshRequest): AuthTokensResponse

    @GET("auth/me")
    suspend fun getMe(): UserProfileResponse

    @POST("auth/logout")
    suspend fun logout(): SuccessResponse

    // ── Providers ────────────────────────────────────────

    @GET("providers/accounts")
    suspend fun getLinkedAccounts(): List<LinkedAccountResponse>

    @GET("providers/youtube/auth-url")
    suspend fun getYouTubeAuthUrl(): AuthUrlResponse

    @POST("providers/youtube/callback")
    suspend fun youtubeCallback(@Body body: ProviderCallbackRequest): LinkedAccountResponse

    @GET("providers/twitch/auth-url")
    suspend fun getTwitchAuthUrl(): AuthUrlResponse

    @POST("providers/twitch/callback")
    suspend fun twitchCallback(@Body body: ProviderCallbackRequest): LinkedAccountResponse

    @POST("providers/accounts/custom-rtmp")
    suspend fun createCustomRtmpAccount(@Body body: CreateCustomRtmpRequest): LinkedAccountResponse

    @DELETE("providers/accounts/{id}")
    suspend fun unlinkAccount(@Path("id") id: String): SuccessResponse

    // ── Streams ──────────────────────────────────────────

    @GET("streams/plans")
    suspend fun getStreamPlans(): List<StreamPlanResponse>

    @POST("streams/plans")
    suspend fun createStreamPlan(@Body body: CreateStreamPlanRequest): StreamPlanResponse

    @GET("streams/plans/{id}")
    suspend fun getStreamPlan(@Path("id") id: String): StreamPlanResponse

    @PUT("streams/plans/{id}")
    suspend fun updateStreamPlan(@Path("id") id: String, @Body body: UpdateStreamPlanRequest): StreamPlanResponse

    @DELETE("streams/plans/{id}")
    suspend fun deleteStreamPlan(@Path("id") id: String): SuccessResponse

    @POST("streams/plans/{id}/prepare")
    suspend fun prepareStreamPlan(@Path("id") id: String): PrepareResponse

    @POST("streams/plans/{id}/start")
    suspend fun startStreamPlan(@Path("id") id: String): StatusResponse

    @POST("streams/plans/{id}/end")
    suspend fun endStreamPlan(@Path("id") id: String): StatusResponse
}
