{-# LANGUAGE DeriveAnyClass #-}

module Hercules.API.Agents.ClusterJoinToken where

import Hercules.API.Accounts.Account (Account)
import Hercules.API.Prelude

data ClusterJoinToken = ClusterJoinToken
  { ClusterJoinToken -> Id ClusterJoinToken
id :: Id ClusterJoinToken,
    ClusterJoinToken -> Id Account
ownerId :: Id Account,
    ClusterJoinToken -> UTCTime
creationTime :: UTCTime,
    -- TODO lastAccessTime :: Maybe UTCTime
    ClusterJoinToken -> Text
description :: Text
  }
  deriving ((forall x. ClusterJoinToken -> Rep ClusterJoinToken x)
-> (forall x. Rep ClusterJoinToken x -> ClusterJoinToken)
-> Generic ClusterJoinToken
forall x. Rep ClusterJoinToken x -> ClusterJoinToken
forall x. ClusterJoinToken -> Rep ClusterJoinToken x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClusterJoinToken x -> ClusterJoinToken
$cfrom :: forall x. ClusterJoinToken -> Rep ClusterJoinToken x
Generic, Int -> ClusterJoinToken -> ShowS
[ClusterJoinToken] -> ShowS
ClusterJoinToken -> String
(Int -> ClusterJoinToken -> ShowS)
-> (ClusterJoinToken -> String)
-> ([ClusterJoinToken] -> ShowS)
-> Show ClusterJoinToken
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClusterJoinToken] -> ShowS
$cshowList :: [ClusterJoinToken] -> ShowS
show :: ClusterJoinToken -> String
$cshow :: ClusterJoinToken -> String
showsPrec :: Int -> ClusterJoinToken -> ShowS
$cshowsPrec :: Int -> ClusterJoinToken -> ShowS
Show, ClusterJoinToken -> ClusterJoinToken -> Bool
(ClusterJoinToken -> ClusterJoinToken -> Bool)
-> (ClusterJoinToken -> ClusterJoinToken -> Bool)
-> Eq ClusterJoinToken
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClusterJoinToken -> ClusterJoinToken -> Bool
$c/= :: ClusterJoinToken -> ClusterJoinToken -> Bool
== :: ClusterJoinToken -> ClusterJoinToken -> Bool
$c== :: ClusterJoinToken -> ClusterJoinToken -> Bool
Eq, ClusterJoinToken -> ()
(ClusterJoinToken -> ()) -> NFData ClusterJoinToken
forall a. (a -> ()) -> NFData a
rnf :: ClusterJoinToken -> ()
$crnf :: ClusterJoinToken -> ()
NFData, [ClusterJoinToken] -> Encoding
[ClusterJoinToken] -> Value
ClusterJoinToken -> Encoding
ClusterJoinToken -> Value
(ClusterJoinToken -> Value)
-> (ClusterJoinToken -> Encoding)
-> ([ClusterJoinToken] -> Value)
-> ([ClusterJoinToken] -> Encoding)
-> ToJSON ClusterJoinToken
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ClusterJoinToken] -> Encoding
$ctoEncodingList :: [ClusterJoinToken] -> Encoding
toJSONList :: [ClusterJoinToken] -> Value
$ctoJSONList :: [ClusterJoinToken] -> Value
toEncoding :: ClusterJoinToken -> Encoding
$ctoEncoding :: ClusterJoinToken -> Encoding
toJSON :: ClusterJoinToken -> Value
$ctoJSON :: ClusterJoinToken -> Value
ToJSON, Value -> Parser [ClusterJoinToken]
Value -> Parser ClusterJoinToken
(Value -> Parser ClusterJoinToken)
-> (Value -> Parser [ClusterJoinToken])
-> FromJSON ClusterJoinToken
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ClusterJoinToken]
$cparseJSONList :: Value -> Parser [ClusterJoinToken]
parseJSON :: Value -> Parser ClusterJoinToken
$cparseJSON :: Value -> Parser ClusterJoinToken
FromJSON, Proxy ClusterJoinToken -> Declare (Definitions Schema) NamedSchema
(Proxy ClusterJoinToken
 -> Declare (Definitions Schema) NamedSchema)
-> ToSchema ClusterJoinToken
forall a.
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
declareNamedSchema :: Proxy ClusterJoinToken -> Declare (Definitions Schema) NamedSchema
$cdeclareNamedSchema :: Proxy ClusterJoinToken -> Declare (Definitions Schema) NamedSchema
ToSchema)