package cy.hexor.furumi.data.remote.api

import cy.hexor.furumi.data.remote.model.LoginRequest
import cy.hexor.furumi.data.remote.model.LoginResponse
import cy.hexor.furumi.data.remote.model.LogoutRequest
import cy.hexor.furumi.data.remote.model.LogoutResponse
import cy.hexor.furumi.data.remote.model.RefreshRequest
import cy.hexor.furumi.data.remote.model.SsoExchangeRequest
import cy.hexor.furumi.data.remote.model.TokenResponse
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.Header
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.Url

interface AuthApi {
    @Headers("Accept: application/json")
    @POST
    suspend fun login(
        @Url url: String,
        @Body request: LoginRequest
    ): Response<LoginResponse>

    @Headers("Accept: application/json")
    @POST
    suspend fun ssoExchange(
        @Url url: String,
        @Body request: SsoExchangeRequest
    ): Response<LoginResponse>

    @Headers("Accept: application/json")
    @POST
    suspend fun refresh(
        @Url url: String,
        @Body request: RefreshRequest
    ): Response<TokenResponse>

    @Headers("Accept: application/json")
    @POST
    suspend fun logout(
        @Url url: String,
        @Header("Authorization") bearerToken: String,
        @Body request: LogoutRequest
    ): Response<LogoutResponse>
}
