module Network.Nakadi.Subscriptions.Subscription
( subscriptionGet
, subscriptionDelete
) where
import Network.Nakadi.Internal.Prelude
import Network.Nakadi.Internal.Conversions
import Network.Nakadi.Internal.Http
path :: SubscriptionId -> ByteString
path subscriptionId =
"/subscriptions/"
<> subscriptionIdToByteString subscriptionId
subscriptionGet ::
MonadNakadi b m
=> SubscriptionId
-> m Subscription
subscriptionGet subscriptionId =
httpJsonBody ok200 [(status404, errorSubscriptionNotFound)]
(setRequestMethod "GET" . setRequestPath (path subscriptionId))
subscriptionDelete ::
MonadNakadi b m
=> SubscriptionId
-> m ()
subscriptionDelete subscriptionId =
httpJsonNoBody status204 [(status404, errorSubscriptionNotFound)]
(setRequestMethod "DELETE" . setRequestPath (path subscriptionId))