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

module Hercules.API.Forge.Forge where

import Data.OpenApi qualified as O3
import Hercules.API.Prelude

-- | A source hosting site (example github for github.com) used for
-- source code, permissions, CI statuses, ...
data Forge = Forge
  { Forge -> Id Forge
id :: Id Forge,
    Forge -> Name Forge
slug :: Name Forge,
    Forge -> Text
displayName :: Text,
    Forge -> Text
typ :: Text,
    Forge -> Maybe Text
newInstallationURL :: Maybe Text,
    -- | Does the requesting user have admin permissions?
    Forge -> Maybe Bool
adminPermission :: Maybe Bool
  }
  deriving ((forall x. Forge -> Rep Forge x)
-> (forall x. Rep Forge x -> Forge) -> Generic Forge
forall x. Rep Forge x -> Forge
forall x. Forge -> Rep Forge x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Forge -> Rep Forge x
from :: forall x. Forge -> Rep Forge x
$cto :: forall x. Rep Forge x -> Forge
to :: forall x. Rep Forge x -> Forge
Generic, Int -> Forge -> ShowS
[Forge] -> ShowS
Forge -> String
(Int -> Forge -> ShowS)
-> (Forge -> String) -> ([Forge] -> ShowS) -> Show Forge
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Forge -> ShowS
showsPrec :: Int -> Forge -> ShowS
$cshow :: Forge -> String
show :: Forge -> String
$cshowList :: [Forge] -> ShowS
showList :: [Forge] -> ShowS
Show, Forge -> Forge -> Bool
(Forge -> Forge -> Bool) -> (Forge -> Forge -> Bool) -> Eq Forge
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Forge -> Forge -> Bool
== :: Forge -> Forge -> Bool
$c/= :: Forge -> Forge -> Bool
/= :: Forge -> Forge -> Bool
Eq)
  deriving anyclass (Forge -> ()
(Forge -> ()) -> NFData Forge
forall a. (a -> ()) -> NFData a
$crnf :: Forge -> ()
rnf :: Forge -> ()
NFData, [Forge] -> Value
[Forge] -> Encoding
Forge -> Value
Forge -> Encoding
(Forge -> Value)
-> (Forge -> Encoding)
-> ([Forge] -> Value)
-> ([Forge] -> Encoding)
-> ToJSON Forge
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: Forge -> Value
toJSON :: Forge -> Value
$ctoEncoding :: Forge -> Encoding
toEncoding :: Forge -> Encoding
$ctoJSONList :: [Forge] -> Value
toJSONList :: [Forge] -> Value
$ctoEncodingList :: [Forge] -> Encoding
toEncodingList :: [Forge] -> Encoding
ToJSON, Value -> Parser [Forge]
Value -> Parser Forge
(Value -> Parser Forge)
-> (Value -> Parser [Forge]) -> FromJSON Forge
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser Forge
parseJSON :: Value -> Parser Forge
$cparseJSONList :: Value -> Parser [Forge]
parseJSONList :: Value -> Parser [Forge]
FromJSON, Proxy Forge -> Declare (Definitions Schema) NamedSchema
(Proxy Forge -> Declare (Definitions Schema) NamedSchema)
-> ToSchema Forge
forall a.
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy Forge -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy Forge -> Declare (Definitions Schema) NamedSchema
ToSchema, Typeable Forge
Typeable Forge =>
(Proxy Forge -> Declare (Definitions Schema) NamedSchema)
-> ToSchema Forge
Proxy Forge -> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a =>
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy Forge -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy Forge -> Declare (Definitions Schema) NamedSchema
O3.ToSchema)