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

module Hercules.API.Projects.Project where

import Data.OpenApi qualified as O3
import Hercules.API.Accounts.Account (Account)
import Hercules.API.Accounts.SimpleAccount (SimpleAccount)
import Hercules.API.Forge.Forge (Forge)
import Hercules.API.Prelude
import Hercules.API.Repos.Repo (Repo)

data Project = Project
  { Project -> Id Project
id :: Id Project,
    Project -> SimpleAccount
owner :: SimpleAccount,
    Project -> Id Account
ownerId :: Id Account,
    Project -> Id Repo
repoId :: Id Repo,
    Project -> Bool
enabled :: Bool,
    Project -> Name Forge
siteSlug :: Name Forge,
    Project -> Name Account
ownerSlug :: Name Account,
    Project -> Name Project
name :: Name Project,
    Project -> Name Project
slug :: Name Project,
    Project -> Text
displayName :: Text,
    Project -> Maybe Text
imageURL :: Maybe Text,
    -- | True if no authorization is required for retrieving basic
    --   information about a project, such as its existence, name,
    --   job statuses etc.
    Project -> Bool
isPublic :: Bool
  }
  deriving ((forall x. Project -> Rep Project x)
-> (forall x. Rep Project x -> Project) -> Generic Project
forall x. Rep Project x -> Project
forall x. Project -> Rep Project x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. Project -> Rep Project x
from :: forall x. Project -> Rep Project x
$cto :: forall x. Rep Project x -> Project
to :: forall x. Rep Project x -> Project
Generic, Int -> Project -> ShowS
[Project] -> ShowS
Project -> String
(Int -> Project -> ShowS)
-> (Project -> String) -> ([Project] -> ShowS) -> Show Project
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Project -> ShowS
showsPrec :: Int -> Project -> ShowS
$cshow :: Project -> String
show :: Project -> String
$cshowList :: [Project] -> ShowS
showList :: [Project] -> ShowS
Show, Project -> Project -> Bool
(Project -> Project -> Bool)
-> (Project -> Project -> Bool) -> Eq Project
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Project -> Project -> Bool
== :: Project -> Project -> Bool
$c/= :: Project -> Project -> Bool
/= :: Project -> Project -> Bool
Eq)
  deriving anyclass (Project -> ()
(Project -> ()) -> NFData Project
forall a. (a -> ()) -> NFData a
$crnf :: Project -> ()
rnf :: Project -> ()
NFData, [Project] -> Value
[Project] -> Encoding
Project -> Value
Project -> Encoding
(Project -> Value)
-> (Project -> Encoding)
-> ([Project] -> Value)
-> ([Project] -> Encoding)
-> ToJSON Project
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
$ctoJSON :: Project -> Value
toJSON :: Project -> Value
$ctoEncoding :: Project -> Encoding
toEncoding :: Project -> Encoding
$ctoJSONList :: [Project] -> Value
toJSONList :: [Project] -> Value
$ctoEncodingList :: [Project] -> Encoding
toEncodingList :: [Project] -> Encoding
ToJSON, Value -> Parser [Project]
Value -> Parser Project
(Value -> Parser Project)
-> (Value -> Parser [Project]) -> FromJSON Project
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
$cparseJSON :: Value -> Parser Project
parseJSON :: Value -> Parser Project
$cparseJSONList :: Value -> Parser [Project]
parseJSONList :: Value -> Parser [Project]
FromJSON, Proxy Project -> Declare (Definitions Schema) NamedSchema
(Proxy Project -> Declare (Definitions Schema) NamedSchema)
-> ToSchema Project
forall a.
(Proxy a -> Declare (Definitions Schema) NamedSchema) -> ToSchema a
$cdeclareNamedSchema :: Proxy Project -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy Project -> Declare (Definitions Schema) NamedSchema
ToSchema, Typeable Project
Typeable Project
-> (Proxy Project -> Declare (Definitions Schema) NamedSchema)
-> ToSchema Project
Proxy Project -> Declare (Definitions Schema) NamedSchema
forall a.
Typeable a
-> (Proxy a -> Declare (Definitions Schema) NamedSchema)
-> ToSchema a
$cdeclareNamedSchema :: Proxy Project -> Declare (Definitions Schema) NamedSchema
declareNamedSchema :: Proxy Project -> Declare (Definitions Schema) NamedSchema
O3.ToSchema)