{-# LANGUAGE DeriveAnyClass #-}

module Hercules.API.Projects.Project where

import Hercules.API.Accounts.Account (Account)
import Hercules.API.Prelude
import Hercules.API.Repos.Repo (Repo)
import Hercules.API.SourceHostingSite.SourceHostingSite
  ( SourceHostingSite,
  )

data Project = Project
  { Project -> Id Project
id :: Id Project,
    Project -> Id Account
ownerId :: Id Account,
    Project -> Id Repo
repoId :: Id Repo,
    Project -> Bool
enabled :: Bool,
    Project -> Name SourceHostingSite
siteSlug :: Name SourceHostingSite,
    Project -> Name Account
ownerSlug :: Name Account,
    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
$cto :: forall x. Rep Project x -> Project
$cfrom :: forall x. Project -> Rep Project x
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
showList :: [Project] -> ShowS
$cshowList :: [Project] -> ShowS
show :: Project -> String
$cshow :: Project -> String
showsPrec :: Int -> Project -> ShowS
$cshowsPrec :: Int -> Project -> ShowS
Show, Project -> Project -> Bool
(Project -> Project -> Bool)
-> (Project -> Project -> Bool) -> Eq Project
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Project -> Project -> Bool
$c/= :: Project -> Project -> Bool
== :: Project -> Project -> Bool
$c== :: Project -> Project -> Bool
Eq, Project -> ()
(Project -> ()) -> NFData Project
forall a. (a -> ()) -> NFData a
rnf :: Project -> ()
$crnf :: Project -> ()
NFData, [Project] -> Encoding
[Project] -> Value
Project -> Encoding
Project -> Value
(Project -> Value)
-> (Project -> Encoding)
-> ([Project] -> Value)
-> ([Project] -> Encoding)
-> ToJSON Project
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Project] -> Encoding
$ctoEncodingList :: [Project] -> Encoding
toJSONList :: [Project] -> Value
$ctoJSONList :: [Project] -> Value
toEncoding :: Project -> Encoding
$ctoEncoding :: Project -> Encoding
toJSON :: Project -> Value
$ctoJSON :: Project -> Value
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
parseJSONList :: Value -> Parser [Project]
$cparseJSONList :: Value -> Parser [Project]
parseJSON :: Value -> Parser Project
$cparseJSON :: 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
declareNamedSchema :: Proxy Project -> Declare (Definitions Schema) NamedSchema
$cdeclareNamedSchema :: Proxy Project -> Declare (Definitions Schema) NamedSchema
ToSchema)