module Cachix.Types.ByteStringStreaming where

import qualified Data.ByteString.Lazy as LBS
import Data.Swagger (NamedSchema (..), ToSchema (..), binarySchema)
import Protolude

newtype ByteStringStreaming = ByteStringStreaming ByteString

instance ToSchema ByteStringStreaming where
  declareNamedSchema :: Proxy ByteStringStreaming
-> Declare (Definitions Schema) NamedSchema
declareNamedSchema Proxy ByteStringStreaming
_ = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Maybe Text -> Schema -> NamedSchema
NamedSchema (forall a. a -> Maybe a
Just Text
"ByteString") Schema
binarySchema

newtype LazyByteStringStreaming = LazyByteStringStreaming LBS.ByteString

instance ToSchema LazyByteStringStreaming where
  declareNamedSchema :: Proxy LazyByteStringStreaming
-> Declare (Definitions Schema) NamedSchema
declareNamedSchema Proxy LazyByteStringStreaming
_ = forall (f :: * -> *) a. Applicative f => a -> f a
pure forall a b. (a -> b) -> a -> b
$ Maybe Text -> Schema -> NamedSchema
NamedSchema (forall a. a -> Maybe a
Just Text
"lazyByteString") Schema
binarySchema