-- | Imports
module Pinecone.Imports
    ( -- * Main types
      Import(..)
    , StartImport(..)
    , _StartImport
    , StartImportResponse(..)
    , Imports(..)
    , ImportModel(..)

      -- * Other types
    , ErrorMode(..)
    , OnError(..)
    , Status(..)

      -- * Servant
    , API
    ) where

import Pinecone.Pagination
import Pinecone.Prelude
import Prelude hiding (id)

-- | Unique identifier for the import operation
newtype Import = Import{ Import -> Text
text :: Text }
    deriving newtype (Import -> Import -> Bool
(Import -> Import -> Bool)
-> (Import -> Import -> Bool) -> Eq Import
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Import -> Import -> Bool
== :: Import -> Import -> Bool
$c/= :: Import -> Import -> Bool
/= :: Import -> Import -> Bool
Eq, Maybe Import
Value -> Parser [Import]
Value -> Parser Import
(Value -> Parser Import)
-> (Value -> Parser [Import]) -> Maybe Import -> FromJSON Import
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser Import
parseJSON :: Value -> Parser Import
$cparseJSONList :: Value -> Parser [Import]
parseJSONList :: Value -> Parser [Import]
$comittedField :: Maybe Import
omittedField :: Maybe Import
FromJSON, String -> Import
(String -> Import) -> IsString Import
forall a. (String -> a) -> IsString a
$cfromString :: String -> Import
fromString :: String -> Import
IsString, Int -> Import -> ShowS
[Import] -> ShowS
Import -> String
(Int -> Import -> ShowS)
-> (Import -> String) -> ([Import] -> ShowS) -> Show Import
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Import -> ShowS
showsPrec :: Int -> Import -> ShowS
$cshow :: Import -> String
show :: Import -> String
$cshowList :: [Import] -> ShowS
showList :: [Import] -> ShowS
Show, Import -> Text
Import -> ByteString
Import -> Builder
(Import -> Text)
-> (Import -> Builder)
-> (Import -> ByteString)
-> (Import -> Text)
-> (Import -> Builder)
-> ToHttpApiData Import
forall a.
(a -> Text)
-> (a -> Builder)
-> (a -> ByteString)
-> (a -> Text)
-> (a -> Builder)
-> ToHttpApiData a
$ctoUrlPiece :: Import -> Text
toUrlPiece :: Import -> Text
$ctoEncodedUrlPiece :: Import -> Builder
toEncodedUrlPiece :: Import -> Builder
$ctoHeader :: Import -> ByteString
toHeader :: Import -> ByteString
$ctoQueryParam :: Import -> Text
toQueryParam :: Import -> Text
$ctoEncodedQueryParam :: Import -> Builder
toEncodedQueryParam :: Import -> Builder
ToHttpApiData, [Import] -> Value
[Import] -> Encoding
Import -> Bool
Import -> Value
Import -> Encoding
(Import -> Value)
-> (Import -> Encoding)
-> ([Import] -> Value)
-> ([Import] -> Encoding)
-> (Import -> Bool)
-> ToJSON Import
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: Import -> Value
toJSON :: Import -> Value
$ctoEncoding :: Import -> Encoding
toEncoding :: Import -> Encoding
$ctoJSONList :: [Import] -> Value
toJSONList :: [Import] -> Value
$ctoEncodingList :: [Import] -> Encoding
toEncodingList :: [Import] -> Encoding
$comitField :: Import -> Bool
omitField :: Import -> Bool
ToJSON)

-- | Request body for @\/bulk\/imports@
data StartImport = StartImport
    { StartImport -> Text
uri :: Text
    , StartImport -> Maybe Text
integrationId :: Maybe Text
    , StartImport -> Maybe ErrorMode
errorMode :: Maybe ErrorMode
    } deriving stock (StartImport -> StartImport -> Bool
(StartImport -> StartImport -> Bool)
-> (StartImport -> StartImport -> Bool) -> Eq StartImport
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StartImport -> StartImport -> Bool
== :: StartImport -> StartImport -> Bool
$c/= :: StartImport -> StartImport -> Bool
/= :: StartImport -> StartImport -> Bool
Eq, (forall x. StartImport -> Rep StartImport x)
-> (forall x. Rep StartImport x -> StartImport)
-> Generic StartImport
forall x. Rep StartImport x -> StartImport
forall x. StartImport -> Rep StartImport x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StartImport -> Rep StartImport x
from :: forall x. StartImport -> Rep StartImport x
$cto :: forall x. Rep StartImport x -> StartImport
to :: forall x. Rep StartImport x -> StartImport
Generic, Int -> StartImport -> ShowS
[StartImport] -> ShowS
StartImport -> String
(Int -> StartImport -> ShowS)
-> (StartImport -> String)
-> ([StartImport] -> ShowS)
-> Show StartImport
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StartImport -> ShowS
showsPrec :: Int -> StartImport -> ShowS
$cshow :: StartImport -> String
show :: StartImport -> String
$cshowList :: [StartImport] -> ShowS
showList :: [StartImport] -> ShowS
Show)
      deriving anyclass (Maybe StartImport
Value -> Parser [StartImport]
Value -> Parser StartImport
(Value -> Parser StartImport)
-> (Value -> Parser [StartImport])
-> Maybe StartImport
-> FromJSON StartImport
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser StartImport
parseJSON :: Value -> Parser StartImport
$cparseJSONList :: Value -> Parser [StartImport]
parseJSONList :: Value -> Parser [StartImport]
$comittedField :: Maybe StartImport
omittedField :: Maybe StartImport
FromJSON, [StartImport] -> Value
[StartImport] -> Encoding
StartImport -> Bool
StartImport -> Value
StartImport -> Encoding
(StartImport -> Value)
-> (StartImport -> Encoding)
-> ([StartImport] -> Value)
-> ([StartImport] -> Encoding)
-> (StartImport -> Bool)
-> ToJSON StartImport
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: StartImport -> Value
toJSON :: StartImport -> Value
$ctoEncoding :: StartImport -> Encoding
toEncoding :: StartImport -> Encoding
$ctoJSONList :: [StartImport] -> Value
toJSONList :: [StartImport] -> Value
$ctoEncodingList :: [StartImport] -> Encoding
toEncodingList :: [StartImport] -> Encoding
$comitField :: StartImport -> Bool
omitField :: StartImport -> Bool
ToJSON)

-- | Default `StartImport`
_StartImport :: StartImport
_StartImport :: StartImport
_StartImport = StartImport
    { $sel:integrationId:StartImport :: Maybe Text
integrationId = Maybe Text
forall a. Maybe a
Nothing
    , $sel:errorMode:StartImport :: Maybe ErrorMode
errorMode = Maybe ErrorMode
forall a. Maybe a
Nothing
    }

-- | Response body for @\/bulk\/imports@
data StartImportResponse = StartImportResponse
    { StartImportResponse -> Import
id :: Import
    } deriving stock (StartImportResponse -> StartImportResponse -> Bool
(StartImportResponse -> StartImportResponse -> Bool)
-> (StartImportResponse -> StartImportResponse -> Bool)
-> Eq StartImportResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: StartImportResponse -> StartImportResponse -> Bool
== :: StartImportResponse -> StartImportResponse -> Bool
$c/= :: StartImportResponse -> StartImportResponse -> Bool
/= :: StartImportResponse -> StartImportResponse -> Bool
Eq, (forall x. StartImportResponse -> Rep StartImportResponse x)
-> (forall x. Rep StartImportResponse x -> StartImportResponse)
-> Generic StartImportResponse
forall x. Rep StartImportResponse x -> StartImportResponse
forall x. StartImportResponse -> Rep StartImportResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. StartImportResponse -> Rep StartImportResponse x
from :: forall x. StartImportResponse -> Rep StartImportResponse x
$cto :: forall x. Rep StartImportResponse x -> StartImportResponse
to :: forall x. Rep StartImportResponse x -> StartImportResponse
Generic, Int -> StartImportResponse -> ShowS
[StartImportResponse] -> ShowS
StartImportResponse -> String
(Int -> StartImportResponse -> ShowS)
-> (StartImportResponse -> String)
-> ([StartImportResponse] -> ShowS)
-> Show StartImportResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> StartImportResponse -> ShowS
showsPrec :: Int -> StartImportResponse -> ShowS
$cshow :: StartImportResponse -> String
show :: StartImportResponse -> String
$cshowList :: [StartImportResponse] -> ShowS
showList :: [StartImportResponse] -> ShowS
Show)
      deriving anyclass (Maybe StartImportResponse
Value -> Parser [StartImportResponse]
Value -> Parser StartImportResponse
(Value -> Parser StartImportResponse)
-> (Value -> Parser [StartImportResponse])
-> Maybe StartImportResponse
-> FromJSON StartImportResponse
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser StartImportResponse
parseJSON :: Value -> Parser StartImportResponse
$cparseJSONList :: Value -> Parser [StartImportResponse]
parseJSONList :: Value -> Parser [StartImportResponse]
$comittedField :: Maybe StartImportResponse
omittedField :: Maybe StartImportResponse
FromJSON, [StartImportResponse] -> Value
[StartImportResponse] -> Encoding
StartImportResponse -> Bool
StartImportResponse -> Value
StartImportResponse -> Encoding
(StartImportResponse -> Value)
-> (StartImportResponse -> Encoding)
-> ([StartImportResponse] -> Value)
-> ([StartImportResponse] -> Encoding)
-> (StartImportResponse -> Bool)
-> ToJSON StartImportResponse
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: StartImportResponse -> Value
toJSON :: StartImportResponse -> Value
$ctoEncoding :: StartImportResponse -> Encoding
toEncoding :: StartImportResponse -> Encoding
$ctoJSONList :: [StartImportResponse] -> Value
toJSONList :: [StartImportResponse] -> Value
$ctoEncodingList :: [StartImportResponse] -> Encoding
toEncodingList :: [StartImportResponse] -> Encoding
$comitField :: StartImportResponse -> Bool
omitField :: StartImportResponse -> Bool
ToJSON)

-- | A list of import operations
data Imports = ListImport
    { Imports -> Vector ImportModel
data_ :: Vector ImportModel
    , Imports -> Maybe Pagination
pagination :: Maybe Pagination
    } deriving stock (Imports -> Imports -> Bool
(Imports -> Imports -> Bool)
-> (Imports -> Imports -> Bool) -> Eq Imports
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Imports -> Imports -> Bool
== :: Imports -> Imports -> Bool
$c/= :: Imports -> Imports -> Bool
/= :: Imports -> Imports -> Bool
Eq, (forall x. Imports -> Rep Imports x)
-> (forall x. Rep Imports x -> Imports) -> Generic Imports
forall x. Rep Imports x -> Imports
forall x. Imports -> Rep Imports x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Imports -> Rep Imports x
from :: forall x. Imports -> Rep Imports x
$cto :: forall x. Rep Imports x -> Imports
to :: forall x. Rep Imports x -> Imports
Generic, Int -> Imports -> ShowS
[Imports] -> ShowS
Imports -> String
(Int -> Imports -> ShowS)
-> (Imports -> String) -> ([Imports] -> ShowS) -> Show Imports
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Imports -> ShowS
showsPrec :: Int -> Imports -> ShowS
$cshow :: Imports -> String
show :: Imports -> String
$cshowList :: [Imports] -> ShowS
showList :: [Imports] -> ShowS
Show)

instance FromJSON Imports where
    parseJSON :: Value -> Parser Imports
parseJSON = Options -> Value -> Parser Imports
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
aesonOptions

instance ToJSON Imports where
    toJSON :: Imports -> Value
toJSON = Options -> Imports -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
aesonOptions

-- | The model for an import operation.
data ImportModel = ImportModel
    { ImportModel -> Import
id :: Import
    , ImportModel -> Text
uri :: Text
    , ImportModel -> Status
status :: Status
    , ImportModel -> POSIXTime
createdAt :: POSIXTime
    , ImportModel -> POSIXTime
finishedAt :: POSIXTime
    , ImportModel -> Double
percentComplete :: Double
    , ImportModel -> Natural
recordsImported :: Natural
    , ImportModel -> Text
error :: Text
    } deriving stock (ImportModel -> ImportModel -> Bool
(ImportModel -> ImportModel -> Bool)
-> (ImportModel -> ImportModel -> Bool) -> Eq ImportModel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ImportModel -> ImportModel -> Bool
== :: ImportModel -> ImportModel -> Bool
$c/= :: ImportModel -> ImportModel -> Bool
/= :: ImportModel -> ImportModel -> Bool
Eq, (forall x. ImportModel -> Rep ImportModel x)
-> (forall x. Rep ImportModel x -> ImportModel)
-> Generic ImportModel
forall x. Rep ImportModel x -> ImportModel
forall x. ImportModel -> Rep ImportModel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ImportModel -> Rep ImportModel x
from :: forall x. ImportModel -> Rep ImportModel x
$cto :: forall x. Rep ImportModel x -> ImportModel
to :: forall x. Rep ImportModel x -> ImportModel
Generic, Int -> ImportModel -> ShowS
[ImportModel] -> ShowS
ImportModel -> String
(Int -> ImportModel -> ShowS)
-> (ImportModel -> String)
-> ([ImportModel] -> ShowS)
-> Show ImportModel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ImportModel -> ShowS
showsPrec :: Int -> ImportModel -> ShowS
$cshow :: ImportModel -> String
show :: ImportModel -> String
$cshowList :: [ImportModel] -> ShowS
showList :: [ImportModel] -> ShowS
Show)
      deriving anyclass (Maybe ImportModel
Value -> Parser [ImportModel]
Value -> Parser ImportModel
(Value -> Parser ImportModel)
-> (Value -> Parser [ImportModel])
-> Maybe ImportModel
-> FromJSON ImportModel
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser ImportModel
parseJSON :: Value -> Parser ImportModel
$cparseJSONList :: Value -> Parser [ImportModel]
parseJSONList :: Value -> Parser [ImportModel]
$comittedField :: Maybe ImportModel
omittedField :: Maybe ImportModel
FromJSON, [ImportModel] -> Value
[ImportModel] -> Encoding
ImportModel -> Bool
ImportModel -> Value
ImportModel -> Encoding
(ImportModel -> Value)
-> (ImportModel -> Encoding)
-> ([ImportModel] -> Value)
-> ([ImportModel] -> Encoding)
-> (ImportModel -> Bool)
-> ToJSON ImportModel
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: ImportModel -> Value
toJSON :: ImportModel -> Value
$ctoEncoding :: ImportModel -> Encoding
toEncoding :: ImportModel -> Encoding
$ctoJSONList :: [ImportModel] -> Value
toJSONList :: [ImportModel] -> Value
$ctoEncodingList :: [ImportModel] -> Encoding
toEncodingList :: [ImportModel] -> Encoding
$comitField :: ImportModel -> Bool
omitField :: ImportModel -> Bool
ToJSON)

-- | Indicates how to respond to errors during the import process.
data ErrorMode = ErrorMode
    { ErrorMode -> OnError
onError :: OnError
    } deriving stock (ErrorMode -> ErrorMode -> Bool
(ErrorMode -> ErrorMode -> Bool)
-> (ErrorMode -> ErrorMode -> Bool) -> Eq ErrorMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ErrorMode -> ErrorMode -> Bool
== :: ErrorMode -> ErrorMode -> Bool
$c/= :: ErrorMode -> ErrorMode -> Bool
/= :: ErrorMode -> ErrorMode -> Bool
Eq, (forall x. ErrorMode -> Rep ErrorMode x)
-> (forall x. Rep ErrorMode x -> ErrorMode) -> Generic ErrorMode
forall x. Rep ErrorMode x -> ErrorMode
forall x. ErrorMode -> Rep ErrorMode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ErrorMode -> Rep ErrorMode x
from :: forall x. ErrorMode -> Rep ErrorMode x
$cto :: forall x. Rep ErrorMode x -> ErrorMode
to :: forall x. Rep ErrorMode x -> ErrorMode
Generic, Int -> ErrorMode -> ShowS
[ErrorMode] -> ShowS
ErrorMode -> String
(Int -> ErrorMode -> ShowS)
-> (ErrorMode -> String)
-> ([ErrorMode] -> ShowS)
-> Show ErrorMode
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ErrorMode -> ShowS
showsPrec :: Int -> ErrorMode -> ShowS
$cshow :: ErrorMode -> String
show :: ErrorMode -> String
$cshowList :: [ErrorMode] -> ShowS
showList :: [ErrorMode] -> ShowS
Show)
      deriving anyclass (Maybe ErrorMode
Value -> Parser [ErrorMode]
Value -> Parser ErrorMode
(Value -> Parser ErrorMode)
-> (Value -> Parser [ErrorMode])
-> Maybe ErrorMode
-> FromJSON ErrorMode
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser ErrorMode
parseJSON :: Value -> Parser ErrorMode
$cparseJSONList :: Value -> Parser [ErrorMode]
parseJSONList :: Value -> Parser [ErrorMode]
$comittedField :: Maybe ErrorMode
omittedField :: Maybe ErrorMode
FromJSON, [ErrorMode] -> Value
[ErrorMode] -> Encoding
ErrorMode -> Bool
ErrorMode -> Value
ErrorMode -> Encoding
(ErrorMode -> Value)
-> (ErrorMode -> Encoding)
-> ([ErrorMode] -> Value)
-> ([ErrorMode] -> Encoding)
-> (ErrorMode -> Bool)
-> ToJSON ErrorMode
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: ErrorMode -> Value
toJSON :: ErrorMode -> Value
$ctoEncoding :: ErrorMode -> Encoding
toEncoding :: ErrorMode -> Encoding
$ctoJSONList :: [ErrorMode] -> Value
toJSONList :: [ErrorMode] -> Value
$ctoEncodingList :: [ErrorMode] -> Encoding
toEncodingList :: [ErrorMode] -> Encoding
$comitField :: ErrorMode -> Bool
omitField :: ErrorMode -> Bool
ToJSON)

-- | Indicates how to respond to errors during the import process.
data OnError = Abort | Continue
    deriving stock (OnError -> OnError -> Bool
(OnError -> OnError -> Bool)
-> (OnError -> OnError -> Bool) -> Eq OnError
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: OnError -> OnError -> Bool
== :: OnError -> OnError -> Bool
$c/= :: OnError -> OnError -> Bool
/= :: OnError -> OnError -> Bool
Eq, (forall x. OnError -> Rep OnError x)
-> (forall x. Rep OnError x -> OnError) -> Generic OnError
forall x. Rep OnError x -> OnError
forall x. OnError -> Rep OnError x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. OnError -> Rep OnError x
from :: forall x. OnError -> Rep OnError x
$cto :: forall x. Rep OnError x -> OnError
to :: forall x. Rep OnError x -> OnError
Generic, Int -> OnError -> ShowS
[OnError] -> ShowS
OnError -> String
(Int -> OnError -> ShowS)
-> (OnError -> String) -> ([OnError] -> ShowS) -> Show OnError
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> OnError -> ShowS
showsPrec :: Int -> OnError -> ShowS
$cshow :: OnError -> String
show :: OnError -> String
$cshowList :: [OnError] -> ShowS
showList :: [OnError] -> ShowS
Show)

instance FromJSON OnError where
    parseJSON :: Value -> Parser OnError
parseJSON = Options -> Value -> Parser OnError
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
aesonOptions

instance ToJSON OnError where
    toJSON :: OnError -> Value
toJSON = Options -> OnError -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
aesonOptions

-- | The status of the operation.
data Status
    = Pending
    | InProgress
    | Failed
    | Completed
    | Cancelled
    deriving stock (Status -> Status -> Bool
(Status -> Status -> Bool)
-> (Status -> Status -> Bool) -> Eq Status
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Status -> Status -> Bool
== :: Status -> Status -> Bool
$c/= :: Status -> Status -> Bool
/= :: Status -> Status -> Bool
Eq, (forall x. Status -> Rep Status x)
-> (forall x. Rep Status x -> Status) -> Generic Status
forall x. Rep Status x -> Status
forall x. Status -> Rep Status x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Status -> Rep Status x
from :: forall x. Status -> Rep Status x
$cto :: forall x. Rep Status x -> Status
to :: forall x. Rep Status x -> Status
Generic, Int -> Status -> ShowS
[Status] -> ShowS
Status -> String
(Int -> Status -> ShowS)
-> (Status -> String) -> ([Status] -> ShowS) -> Show Status
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Status -> ShowS
showsPrec :: Int -> Status -> ShowS
$cshow :: Status -> String
show :: Status -> String
$cshowList :: [Status] -> ShowS
showList :: [Status] -> ShowS
Show)

instance FromJSON Status where
    parseJSON :: Value -> Parser Status
parseJSON = Options -> Value -> Parser Status
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
aesonOptions{ constructorTagModifier = \String
x -> String
x }

instance ToJSON Status where
    toJSON :: Status -> Value
toJSON = Options -> Status -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
aesonOptions{ constructorTagModifier = \String
x -> String
x }

-- | Servant API
type API =
        "bulk"
    :>  "imports"
    :>  (         ReqBody '[JSON] StartImport
              :>  Post '[JSON] StartImportResponse

        :<|>      QueryParam "limit" Natural
              :>  QueryParam "paginationToken" Text
              :>  Get '[JSON] Imports

        :<|>      Capture "id" Import
              :>  Get '[JSON] ImportModel

        :<|>      Capture "id" Import
              :>  Delete '[JSON] NoContent
        )