module Cachix.Types.DeployResponse.V2 where

import Data.Aeson
  ( FromJSON,
    ToJSON,
  )
import Data.HashMap.Strict
import Data.Swagger (ToSchema)
import Data.UUID (UUID)
import Protolude

data Details = Details
  { Details -> UUID
id :: UUID,
    Details -> Text
url :: Text
  }
  deriving stock (Int -> Details -> ShowS
[Details] -> ShowS
Details -> String
(Int -> Details -> ShowS)
-> (Details -> String) -> ([Details] -> ShowS) -> Show Details
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Details -> ShowS
showsPrec :: Int -> Details -> ShowS
$cshow :: Details -> String
show :: Details -> String
$cshowList :: [Details] -> ShowS
showList :: [Details] -> ShowS
Show, (forall x. Details -> Rep Details x)
-> (forall x. Rep Details x -> Details) -> Generic Details
forall x. Rep Details x -> Details
forall x. Details -> Rep Details x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Details -> Rep Details x
from :: forall x. Details -> Rep Details x
$cto :: forall x. Rep Details x -> Details
to :: forall x. Rep Details x -> Details
Generic)
  deriving anyclass (Maybe Details
Value -> Parser [Details]
Value -> Parser Details
(Value -> Parser Details)
-> (Value -> Parser [Details]) -> Maybe Details -> FromJSON Details
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser Details
parseJSON :: Value -> Parser Details
$cparseJSONList :: Value -> Parser [Details]
parseJSONList :: Value -> Parser [Details]
$comittedField :: Maybe Details
omittedField :: Maybe Details
FromJSON, [Details] -> Value
[Details] -> Encoding
Details -> Bool
Details -> Value
Details -> Encoding
(Details -> Value)
-> (Details -> Encoding)
-> ([Details] -> Value)
-> ([Details] -> Encoding)
-> (Details -> Bool)
-> ToJSON Details
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: Details -> Value
toJSON :: Details -> Value
$ctoEncoding :: Details -> Encoding
toEncoding :: Details -> Encoding
$ctoJSONList :: [Details] -> Value
toJSONList :: [Details] -> Value
$ctoEncodingList :: [Details] -> Encoding
toEncodingList :: [Details] -> Encoding
$comitField :: Details -> Bool
omitField :: Details -> Bool
ToJSON, Proxy Details -> Declare (Definitions Schema) NamedSchema
(Proxy Details -> Declare (Definitions Schema) NamedSchema)
-> ToSchema Details
forall a.
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy Details -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy Details -> Declare (Definitions Schema) NamedSchema
ToSchema, Details -> ()
(Details -> ()) -> NFData Details
forall a. (a -> ()) -> NFData a
$crnf :: Details -> ()
rnf :: Details -> ()
NFData)

newtype DeployResponse = DeployResponse
  { DeployResponse -> HashMap Text Details
agents :: HashMap Text Details
  }
  deriving stock (Int -> DeployResponse -> ShowS
[DeployResponse] -> ShowS
DeployResponse -> String
(Int -> DeployResponse -> ShowS)
-> (DeployResponse -> String)
-> ([DeployResponse] -> ShowS)
-> Show DeployResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DeployResponse -> ShowS
showsPrec :: Int -> DeployResponse -> ShowS
$cshow :: DeployResponse -> String
show :: DeployResponse -> String
$cshowList :: [DeployResponse] -> ShowS
showList :: [DeployResponse] -> ShowS
Show, (forall x. DeployResponse -> Rep DeployResponse x)
-> (forall x. Rep DeployResponse x -> DeployResponse)
-> Generic DeployResponse
forall x. Rep DeployResponse x -> DeployResponse
forall x. DeployResponse -> Rep DeployResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DeployResponse -> Rep DeployResponse x
from :: forall x. DeployResponse -> Rep DeployResponse x
$cto :: forall x. Rep DeployResponse x -> DeployResponse
to :: forall x. Rep DeployResponse x -> DeployResponse
Generic)
  deriving anyclass (Maybe DeployResponse
Value -> Parser [DeployResponse]
Value -> Parser DeployResponse
(Value -> Parser DeployResponse)
-> (Value -> Parser [DeployResponse])
-> Maybe DeployResponse
-> FromJSON DeployResponse
forall a.
(Value -> Parser a)
-> (Value -> Parser [a]) -> Maybe a -> FromJSON a
$cparseJSON :: Value -> Parser DeployResponse
parseJSON :: Value -> Parser DeployResponse
$cparseJSONList :: Value -> Parser [DeployResponse]
parseJSONList :: Value -> Parser [DeployResponse]
$comittedField :: Maybe DeployResponse
omittedField :: Maybe DeployResponse
FromJSON, [DeployResponse] -> Value
[DeployResponse] -> Encoding
DeployResponse -> Bool
DeployResponse -> Value
DeployResponse -> Encoding
(DeployResponse -> Value)
-> (DeployResponse -> Encoding)
-> ([DeployResponse] -> Value)
-> ([DeployResponse] -> Encoding)
-> (DeployResponse -> Bool)
-> ToJSON DeployResponse
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> (a -> Bool)
-> ToJSON a
$ctoJSON :: DeployResponse -> Value
toJSON :: DeployResponse -> Value
$ctoEncoding :: DeployResponse -> Encoding
toEncoding :: DeployResponse -> Encoding
$ctoJSONList :: [DeployResponse] -> Value
toJSONList :: [DeployResponse] -> Value
$ctoEncodingList :: [DeployResponse] -> Encoding
toEncodingList :: [DeployResponse] -> Encoding
$comitField :: DeployResponse -> Bool
omitField :: DeployResponse -> Bool
ToJSON, Proxy DeployResponse -> Declare (Definitions Schema) NamedSchema
(Proxy DeployResponse -> Declare (Definitions Schema) NamedSchema)
-> ToSchema DeployResponse
forall a.
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy DeployResponse -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy DeployResponse -> Declare (Definitions Schema) NamedSchema
ToSchema, DeployResponse -> ()
(DeployResponse -> ()) -> NFData DeployResponse
forall a. (a -> ()) -> NFData a
$crnf :: DeployResponse -> ()
rnf :: DeployResponse -> ()
NFData)