All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.c0x12c.featureflag.client.SlackClient.kt Maven / Gradle / Ivy

There is a newer version: 0.3.0
Show newest version
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)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy