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
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Details] -> ShowS
$cshowList :: [Details] -> ShowS
show :: Details -> String
$cshow :: Details -> String
showsPrec :: Int -> Details -> ShowS
$cshowsPrec :: Int -> Details -> ShowS
Show, 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
$cto :: forall x. Rep Details x -> Details
$cfrom :: forall x. Details -> Rep Details x
Generic)
  deriving anyclass (Value -> Parser [Details]
Value -> Parser Details
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Details]
$cparseJSONList :: Value -> Parser [Details]
parseJSON :: Value -> Parser Details
$cparseJSON :: Value -> Parser Details
FromJSON, [Details] -> Encoding
[Details] -> Value
Details -> Encoding
Details -> Value
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Details] -> Encoding
$ctoEncodingList :: [Details] -> Encoding
toJSONList :: [Details] -> Value
$ctoJSONList :: [Details] -> Value
toEncoding :: Details -> Encoding
$ctoEncoding :: Details -> Encoding
toJSON :: Details -> Value
$ctoJSON :: Details -> Value
ToJSON, Proxy Details -> Declare (Definitions Schema) NamedSchema
forall a.
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
declareNamedSchema :: Proxy Details -> Declare (Definitions Schema) NamedSchema
$cdeclareNamedSchema :: Proxy Details -> Declare (Definitions Schema) NamedSchema
ToSchema, Details -> ()
forall a. (a -> ()) -> NFData a
rnf :: Details -> ()
$crnf :: Details -> ()
NFData)

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