{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE OverloadedStrings #-} module Zuul.ProjectConfig ( ProjectPipeline (..), ProjectPipelineJob (..), ProjectPipelineConfig (..), ProjectConfig (..), ) where import Data.Aeson (FromJSON (..), ToJSON (..)) import Data.Text (Text) import GHC.Generics (Generic) import Zuul.Aeson (zuulParseJSON, zuulToJSON) import Zuul.Nodeset (Nodeset) import Zuul.SourceContext (SourceContext) data ProjectPipelineJob = ProjectPipelineJob { ProjectPipelineJob -> Text ppjName :: Text, ProjectPipelineJob -> SourceContext ppjSourceContext :: SourceContext, ProjectPipelineJob -> Maybe Nodeset ppjNodeset :: Maybe Nodeset } deriving (Int -> ProjectPipelineJob -> ShowS [ProjectPipelineJob] -> ShowS ProjectPipelineJob -> String (Int -> ProjectPipelineJob -> ShowS) -> (ProjectPipelineJob -> String) -> ([ProjectPipelineJob] -> ShowS) -> Show ProjectPipelineJob forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [ProjectPipelineJob] -> ShowS $cshowList :: [ProjectPipelineJob] -> ShowS show :: ProjectPipelineJob -> String $cshow :: ProjectPipelineJob -> String showsPrec :: Int -> ProjectPipelineJob -> ShowS $cshowsPrec :: Int -> ProjectPipelineJob -> ShowS Show, ProjectPipelineJob -> ProjectPipelineJob -> Bool (ProjectPipelineJob -> ProjectPipelineJob -> Bool) -> (ProjectPipelineJob -> ProjectPipelineJob -> Bool) -> Eq ProjectPipelineJob forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: ProjectPipelineJob -> ProjectPipelineJob -> Bool $c/= :: ProjectPipelineJob -> ProjectPipelineJob -> Bool == :: ProjectPipelineJob -> ProjectPipelineJob -> Bool $c== :: ProjectPipelineJob -> ProjectPipelineJob -> Bool Eq, Eq ProjectPipelineJob Eq ProjectPipelineJob -> (ProjectPipelineJob -> ProjectPipelineJob -> Ordering) -> (ProjectPipelineJob -> ProjectPipelineJob -> Bool) -> (ProjectPipelineJob -> ProjectPipelineJob -> Bool) -> (ProjectPipelineJob -> ProjectPipelineJob -> Bool) -> (ProjectPipelineJob -> ProjectPipelineJob -> Bool) -> (ProjectPipelineJob -> ProjectPipelineJob -> ProjectPipelineJob) -> (ProjectPipelineJob -> ProjectPipelineJob -> ProjectPipelineJob) -> Ord ProjectPipelineJob ProjectPipelineJob -> ProjectPipelineJob -> Bool ProjectPipelineJob -> ProjectPipelineJob -> Ordering ProjectPipelineJob -> ProjectPipelineJob -> ProjectPipelineJob forall a. Eq a -> (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> a) -> (a -> a -> a) -> Ord a min :: ProjectPipelineJob -> ProjectPipelineJob -> ProjectPipelineJob $cmin :: ProjectPipelineJob -> ProjectPipelineJob -> ProjectPipelineJob max :: ProjectPipelineJob -> ProjectPipelineJob -> ProjectPipelineJob $cmax :: ProjectPipelineJob -> ProjectPipelineJob -> ProjectPipelineJob >= :: ProjectPipelineJob -> ProjectPipelineJob -> Bool $c>= :: ProjectPipelineJob -> ProjectPipelineJob -> Bool > :: ProjectPipelineJob -> ProjectPipelineJob -> Bool $c> :: ProjectPipelineJob -> ProjectPipelineJob -> Bool <= :: ProjectPipelineJob -> ProjectPipelineJob -> Bool $c<= :: ProjectPipelineJob -> ProjectPipelineJob -> Bool < :: ProjectPipelineJob -> ProjectPipelineJob -> Bool $c< :: ProjectPipelineJob -> ProjectPipelineJob -> Bool compare :: ProjectPipelineJob -> ProjectPipelineJob -> Ordering $ccompare :: ProjectPipelineJob -> ProjectPipelineJob -> Ordering $cp1Ord :: Eq ProjectPipelineJob Ord, (forall x. ProjectPipelineJob -> Rep ProjectPipelineJob x) -> (forall x. Rep ProjectPipelineJob x -> ProjectPipelineJob) -> Generic ProjectPipelineJob forall x. Rep ProjectPipelineJob x -> ProjectPipelineJob forall x. ProjectPipelineJob -> Rep ProjectPipelineJob x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep ProjectPipelineJob x -> ProjectPipelineJob $cfrom :: forall x. ProjectPipelineJob -> Rep ProjectPipelineJob x Generic) instance ToJSON ProjectPipelineJob where toJSON :: ProjectPipelineJob -> Value toJSON = Text -> ProjectPipelineJob -> Value forall a. (Generic a, GToJSON' Value Zero (Rep a)) => Text -> a -> Value zuulToJSON Text "ppj" instance FromJSON ProjectPipelineJob where parseJSON :: Value -> Parser ProjectPipelineJob parseJSON = Text -> Value -> Parser ProjectPipelineJob forall a. (Generic a, GFromJSON Zero (Rep a)) => Text -> Value -> Parser a zuulParseJSON Text "ppj" data ProjectPipeline = ProjectPipeline { ProjectPipeline -> Text ppName :: Text, ProjectPipeline -> [[ProjectPipelineJob]] ppJobs :: [[ProjectPipelineJob]] } deriving (Int -> ProjectPipeline -> ShowS [ProjectPipeline] -> ShowS ProjectPipeline -> String (Int -> ProjectPipeline -> ShowS) -> (ProjectPipeline -> String) -> ([ProjectPipeline] -> ShowS) -> Show ProjectPipeline forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [ProjectPipeline] -> ShowS $cshowList :: [ProjectPipeline] -> ShowS show :: ProjectPipeline -> String $cshow :: ProjectPipeline -> String showsPrec :: Int -> ProjectPipeline -> ShowS $cshowsPrec :: Int -> ProjectPipeline -> ShowS Show, ProjectPipeline -> ProjectPipeline -> Bool (ProjectPipeline -> ProjectPipeline -> Bool) -> (ProjectPipeline -> ProjectPipeline -> Bool) -> Eq ProjectPipeline forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: ProjectPipeline -> ProjectPipeline -> Bool $c/= :: ProjectPipeline -> ProjectPipeline -> Bool == :: ProjectPipeline -> ProjectPipeline -> Bool $c== :: ProjectPipeline -> ProjectPipeline -> Bool Eq, Eq ProjectPipeline Eq ProjectPipeline -> (ProjectPipeline -> ProjectPipeline -> Ordering) -> (ProjectPipeline -> ProjectPipeline -> Bool) -> (ProjectPipeline -> ProjectPipeline -> Bool) -> (ProjectPipeline -> ProjectPipeline -> Bool) -> (ProjectPipeline -> ProjectPipeline -> Bool) -> (ProjectPipeline -> ProjectPipeline -> ProjectPipeline) -> (ProjectPipeline -> ProjectPipeline -> ProjectPipeline) -> Ord ProjectPipeline ProjectPipeline -> ProjectPipeline -> Bool ProjectPipeline -> ProjectPipeline -> Ordering ProjectPipeline -> ProjectPipeline -> ProjectPipeline forall a. Eq a -> (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> a) -> (a -> a -> a) -> Ord a min :: ProjectPipeline -> ProjectPipeline -> ProjectPipeline $cmin :: ProjectPipeline -> ProjectPipeline -> ProjectPipeline max :: ProjectPipeline -> ProjectPipeline -> ProjectPipeline $cmax :: ProjectPipeline -> ProjectPipeline -> ProjectPipeline >= :: ProjectPipeline -> ProjectPipeline -> Bool $c>= :: ProjectPipeline -> ProjectPipeline -> Bool > :: ProjectPipeline -> ProjectPipeline -> Bool $c> :: ProjectPipeline -> ProjectPipeline -> Bool <= :: ProjectPipeline -> ProjectPipeline -> Bool $c<= :: ProjectPipeline -> ProjectPipeline -> Bool < :: ProjectPipeline -> ProjectPipeline -> Bool $c< :: ProjectPipeline -> ProjectPipeline -> Bool compare :: ProjectPipeline -> ProjectPipeline -> Ordering $ccompare :: ProjectPipeline -> ProjectPipeline -> Ordering $cp1Ord :: Eq ProjectPipeline Ord, (forall x. ProjectPipeline -> Rep ProjectPipeline x) -> (forall x. Rep ProjectPipeline x -> ProjectPipeline) -> Generic ProjectPipeline forall x. Rep ProjectPipeline x -> ProjectPipeline forall x. ProjectPipeline -> Rep ProjectPipeline x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep ProjectPipeline x -> ProjectPipeline $cfrom :: forall x. ProjectPipeline -> Rep ProjectPipeline x Generic) instance ToJSON ProjectPipeline where toJSON :: ProjectPipeline -> Value toJSON = Text -> ProjectPipeline -> Value forall a. (Generic a, GToJSON' Value Zero (Rep a)) => Text -> a -> Value zuulToJSON Text "pp" instance FromJSON ProjectPipeline where parseJSON :: Value -> Parser ProjectPipeline parseJSON = Text -> Value -> Parser ProjectPipeline forall a. (Generic a, GFromJSON Zero (Rep a)) => Text -> Value -> Parser a zuulParseJSON Text "pp" data ProjectPipelineConfig = ProjectPipelineConfig { ProjectPipelineConfig -> Maybe Text ppcDefaultBranch :: Maybe Text, ProjectPipelineConfig -> [ProjectPipeline] ppcPipelines :: [ProjectPipeline] } deriving (Int -> ProjectPipelineConfig -> ShowS [ProjectPipelineConfig] -> ShowS ProjectPipelineConfig -> String (Int -> ProjectPipelineConfig -> ShowS) -> (ProjectPipelineConfig -> String) -> ([ProjectPipelineConfig] -> ShowS) -> Show ProjectPipelineConfig forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [ProjectPipelineConfig] -> ShowS $cshowList :: [ProjectPipelineConfig] -> ShowS show :: ProjectPipelineConfig -> String $cshow :: ProjectPipelineConfig -> String showsPrec :: Int -> ProjectPipelineConfig -> ShowS $cshowsPrec :: Int -> ProjectPipelineConfig -> ShowS Show, ProjectPipelineConfig -> ProjectPipelineConfig -> Bool (ProjectPipelineConfig -> ProjectPipelineConfig -> Bool) -> (ProjectPipelineConfig -> ProjectPipelineConfig -> Bool) -> Eq ProjectPipelineConfig forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool $c/= :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool == :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool $c== :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool Eq, Eq ProjectPipelineConfig Eq ProjectPipelineConfig -> (ProjectPipelineConfig -> ProjectPipelineConfig -> Ordering) -> (ProjectPipelineConfig -> ProjectPipelineConfig -> Bool) -> (ProjectPipelineConfig -> ProjectPipelineConfig -> Bool) -> (ProjectPipelineConfig -> ProjectPipelineConfig -> Bool) -> (ProjectPipelineConfig -> ProjectPipelineConfig -> Bool) -> (ProjectPipelineConfig -> ProjectPipelineConfig -> ProjectPipelineConfig) -> (ProjectPipelineConfig -> ProjectPipelineConfig -> ProjectPipelineConfig) -> Ord ProjectPipelineConfig ProjectPipelineConfig -> ProjectPipelineConfig -> Bool ProjectPipelineConfig -> ProjectPipelineConfig -> Ordering ProjectPipelineConfig -> ProjectPipelineConfig -> ProjectPipelineConfig forall a. Eq a -> (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> a) -> (a -> a -> a) -> Ord a min :: ProjectPipelineConfig -> ProjectPipelineConfig -> ProjectPipelineConfig $cmin :: ProjectPipelineConfig -> ProjectPipelineConfig -> ProjectPipelineConfig max :: ProjectPipelineConfig -> ProjectPipelineConfig -> ProjectPipelineConfig $cmax :: ProjectPipelineConfig -> ProjectPipelineConfig -> ProjectPipelineConfig >= :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool $c>= :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool > :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool $c> :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool <= :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool $c<= :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool < :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool $c< :: ProjectPipelineConfig -> ProjectPipelineConfig -> Bool compare :: ProjectPipelineConfig -> ProjectPipelineConfig -> Ordering $ccompare :: ProjectPipelineConfig -> ProjectPipelineConfig -> Ordering $cp1Ord :: Eq ProjectPipelineConfig Ord, (forall x. ProjectPipelineConfig -> Rep ProjectPipelineConfig x) -> (forall x. Rep ProjectPipelineConfig x -> ProjectPipelineConfig) -> Generic ProjectPipelineConfig forall x. Rep ProjectPipelineConfig x -> ProjectPipelineConfig forall x. ProjectPipelineConfig -> Rep ProjectPipelineConfig x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep ProjectPipelineConfig x -> ProjectPipelineConfig $cfrom :: forall x. ProjectPipelineConfig -> Rep ProjectPipelineConfig x Generic) instance ToJSON ProjectPipelineConfig where toJSON :: ProjectPipelineConfig -> Value toJSON = Text -> ProjectPipelineConfig -> Value forall a. (Generic a, GToJSON' Value Zero (Rep a)) => Text -> a -> Value zuulToJSON Text "ppc" instance FromJSON ProjectPipelineConfig where parseJSON :: Value -> Parser ProjectPipelineConfig parseJSON = Text -> Value -> Parser ProjectPipelineConfig forall a. (Generic a, GFromJSON Zero (Rep a)) => Text -> Value -> Parser a zuulParseJSON Text "ppc" data ProjectConfig = ProjectConfig { ProjectConfig -> Text projectConfigName :: Text, ProjectConfig -> Text projectConfigCanonicalName :: Text, ProjectConfig -> Text projectConfigConnectionName :: Text, ProjectConfig -> [ProjectPipelineConfig] projectConfigConfigs :: [ProjectPipelineConfig] } deriving (Int -> ProjectConfig -> ShowS [ProjectConfig] -> ShowS ProjectConfig -> String (Int -> ProjectConfig -> ShowS) -> (ProjectConfig -> String) -> ([ProjectConfig] -> ShowS) -> Show ProjectConfig forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [ProjectConfig] -> ShowS $cshowList :: [ProjectConfig] -> ShowS show :: ProjectConfig -> String $cshow :: ProjectConfig -> String showsPrec :: Int -> ProjectConfig -> ShowS $cshowsPrec :: Int -> ProjectConfig -> ShowS Show, ProjectConfig -> ProjectConfig -> Bool (ProjectConfig -> ProjectConfig -> Bool) -> (ProjectConfig -> ProjectConfig -> Bool) -> Eq ProjectConfig forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: ProjectConfig -> ProjectConfig -> Bool $c/= :: ProjectConfig -> ProjectConfig -> Bool == :: ProjectConfig -> ProjectConfig -> Bool $c== :: ProjectConfig -> ProjectConfig -> Bool Eq, Eq ProjectConfig Eq ProjectConfig -> (ProjectConfig -> ProjectConfig -> Ordering) -> (ProjectConfig -> ProjectConfig -> Bool) -> (ProjectConfig -> ProjectConfig -> Bool) -> (ProjectConfig -> ProjectConfig -> Bool) -> (ProjectConfig -> ProjectConfig -> Bool) -> (ProjectConfig -> ProjectConfig -> ProjectConfig) -> (ProjectConfig -> ProjectConfig -> ProjectConfig) -> Ord ProjectConfig ProjectConfig -> ProjectConfig -> Bool ProjectConfig -> ProjectConfig -> Ordering ProjectConfig -> ProjectConfig -> ProjectConfig forall a. Eq a -> (a -> a -> Ordering) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> Bool) -> (a -> a -> a) -> (a -> a -> a) -> Ord a min :: ProjectConfig -> ProjectConfig -> ProjectConfig $cmin :: ProjectConfig -> ProjectConfig -> ProjectConfig max :: ProjectConfig -> ProjectConfig -> ProjectConfig $cmax :: ProjectConfig -> ProjectConfig -> ProjectConfig >= :: ProjectConfig -> ProjectConfig -> Bool $c>= :: ProjectConfig -> ProjectConfig -> Bool > :: ProjectConfig -> ProjectConfig -> Bool $c> :: ProjectConfig -> ProjectConfig -> Bool <= :: ProjectConfig -> ProjectConfig -> Bool $c<= :: ProjectConfig -> ProjectConfig -> Bool < :: ProjectConfig -> ProjectConfig -> Bool $c< :: ProjectConfig -> ProjectConfig -> Bool compare :: ProjectConfig -> ProjectConfig -> Ordering $ccompare :: ProjectConfig -> ProjectConfig -> Ordering $cp1Ord :: Eq ProjectConfig Ord, (forall x. ProjectConfig -> Rep ProjectConfig x) -> (forall x. Rep ProjectConfig x -> ProjectConfig) -> Generic ProjectConfig forall x. Rep ProjectConfig x -> ProjectConfig forall x. ProjectConfig -> Rep ProjectConfig x forall a. (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a $cto :: forall x. Rep ProjectConfig x -> ProjectConfig $cfrom :: forall x. ProjectConfig -> Rep ProjectConfig x Generic) instance ToJSON ProjectConfig where toJSON :: ProjectConfig -> Value toJSON = Text -> ProjectConfig -> Value forall a. (Generic a, GToJSON' Value Zero (Rep a)) => Text -> a -> Value zuulToJSON Text "projectConfig" instance FromJSON ProjectConfig where parseJSON :: Value -> Parser ProjectConfig parseJSON = Text -> Value -> Parser ProjectConfig forall a. (Generic a, GFromJSON Zero (Rep a)) => Text -> Value -> Parser a zuulParseJSON Text "projectConfig"