com.c0x12c.featureflag.client.SlackClient.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core Show documentation
Show all versions of core Show documentation
A module for managing feature flags
package com.c0x12c.featureflag.client
import com.c0x12c.featureflag.notification.SlackPayload
import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.Body
import retrofit2.http.HeaderMap
import retrofit2.http.POST
interface SlackClient {
@POST(".")
fun sendMessage(
@Body payload: SlackPayload,
@HeaderMap headers: Map
): retrofit2.Response
companion object {
fun create(webhookUrl: String): SlackClient =
Retrofit
.Builder()
.baseUrl(webhookUrl)
.addConverterFactory(GsonConverterFactory.create())
.build()
.create(SlackClient::class.java)
}
}