{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DerivingStrategies #-}

module Hercules.API.Agents.ClusterJoinToken where

import Data.OpenApi qualified as O3
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
$cfrom :: forall x. ClusterJoinToken -> Rep ClusterJoinToken x
from :: forall x. ClusterJoinToken -> Rep ClusterJoinToken x
$cto :: forall x. Rep ClusterJoinToken x -> ClusterJoinToken
to :: forall x. Rep ClusterJoinToken x -> ClusterJoinToken
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
$cshowsPrec :: Int -> ClusterJoinToken -> ShowS
showsPrec :: Int -> ClusterJoinToken -> ShowS
$cshow :: ClusterJoinToken -> String
show :: ClusterJoinToken -> String
$cshowList :: [ClusterJoinToken] -> ShowS
showList :: [ClusterJoinToken] -> ShowS
Show, ClusterJoinToken -> ClusterJoinToken -> Bool
(ClusterJoinToken -> ClusterJoinToken -> Bool)
-> (ClusterJoinToken -> ClusterJoinToken -> Bool)
-> Eq ClusterJoinToken
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ClusterJoinToken -> ClusterJoinToken -> Bool
== :: ClusterJoinToken -> ClusterJoinToken -> Bool
$c/= :: ClusterJoinToken -> ClusterJoinToken -> Bool
/= :: ClusterJoinToken -> ClusterJoinToken -> Bool
Eq)
  deriving anyclass (ClusterJoinToken -> ()
(ClusterJoinToken -> ()) -> NFData ClusterJoinToken
forall a. (a -> ()) -> NFData a
$crnf :: ClusterJoinToken -> ()
rnf :: ClusterJoinToken -> ()
NFData, [ClusterJoinToken] -> Value
[ClusterJoinToken] -> Encoding
ClusterJoinToken -> Value
ClusterJoinToken -> Encoding
(ClusterJoinToken -> Value)
-> (ClusterJoinToken -> Encoding)
-> ([ClusterJoinToken] -> Value)
-> ([ClusterJoinToken] -> Encoding)
-> ToJSON ClusterJoinToken
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: ClusterJoinToken -> Value
toJSON :: ClusterJoinToken -> Value
$ctoEncoding :: ClusterJoinToken -> Encoding
toEncoding :: ClusterJoinToken -> Encoding
$ctoJSONList :: [ClusterJoinToken] -> Value
toJSONList :: [ClusterJoinToken] -> Value
$ctoEncodingList :: [ClusterJoinToken] -> Encoding
toEncodingList :: [ClusterJoinToken] -> Encoding
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
$cparseJSON :: Value -> Parser ClusterJoinToken
parseJSON :: Value -> Parser ClusterJoinToken
$cparseJSONList :: Value -> Parser [ClusterJoinToken]
parseJSONList :: 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
$cdeclareNamedSchema :: Proxy ClusterJoinToken -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy ClusterJoinToken -> Declare (Definitions Schema) NamedSchema
ToSchema, Typeable ClusterJoinToken
Typeable ClusterJoinToken
-> (Proxy ClusterJoinToken
    -> Declare (Definitions Schema) NamedSchema)
-> ToSchema ClusterJoinToken
Proxy ClusterJoinToken -> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a
-> (Proxy a -> Declare (Definitions Schema) NamedSchema)
-> ToSchema a
$cdeclareNamedSchema :: Proxy ClusterJoinToken -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy ClusterJoinToken -> Declare (Definitions Schema) NamedSchema
O3.ToSchema)