{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} module GitHub.Types.Events.PageBuildEvent where import Data.Aeson (FromJSON (..), ToJSON (..), object) import Data.Aeson.Types (Value (..), (.:), (.:?), (.=)) import Test.QuickCheck.Arbitrary (Arbitrary (..)) import GitHub.Types.Base import GitHub.Types.Event data PageBuildEvent = PageBuildEvent { PageBuildEvent -> Maybe Installation pageBuildEventInstallation :: Maybe Installation , PageBuildEvent -> Organization pageBuildEventOrganization :: Organization , PageBuildEvent -> Repository pageBuildEventRepository :: Repository , PageBuildEvent -> User pageBuildEventSender :: User , PageBuildEvent -> Int pageBuildEventId :: Int , PageBuildEvent -> PageBuild pageBuildEventBuild :: PageBuild } deriving (PageBuildEvent -> PageBuildEvent -> Bool (PageBuildEvent -> PageBuildEvent -> Bool) -> (PageBuildEvent -> PageBuildEvent -> Bool) -> Eq PageBuildEvent forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a $c== :: PageBuildEvent -> PageBuildEvent -> Bool == :: PageBuildEvent -> PageBuildEvent -> Bool $c/= :: PageBuildEvent -> PageBuildEvent -> Bool /= :: PageBuildEvent -> PageBuildEvent -> Bool Eq, Int -> PageBuildEvent -> ShowS [PageBuildEvent] -> ShowS PageBuildEvent -> String (Int -> PageBuildEvent -> ShowS) -> (PageBuildEvent -> String) -> ([PageBuildEvent] -> ShowS) -> Show PageBuildEvent forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a $cshowsPrec :: Int -> PageBuildEvent -> ShowS showsPrec :: Int -> PageBuildEvent -> ShowS $cshow :: PageBuildEvent -> String show :: PageBuildEvent -> String $cshowList :: [PageBuildEvent] -> ShowS showList :: [PageBuildEvent] -> ShowS Show, ReadPrec [PageBuildEvent] ReadPrec PageBuildEvent Int -> ReadS PageBuildEvent ReadS [PageBuildEvent] (Int -> ReadS PageBuildEvent) -> ReadS [PageBuildEvent] -> ReadPrec PageBuildEvent -> ReadPrec [PageBuildEvent] -> Read PageBuildEvent forall a. (Int -> ReadS a) -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a $creadsPrec :: Int -> ReadS PageBuildEvent readsPrec :: Int -> ReadS PageBuildEvent $creadList :: ReadS [PageBuildEvent] readList :: ReadS [PageBuildEvent] $creadPrec :: ReadPrec PageBuildEvent readPrec :: ReadPrec PageBuildEvent $creadListPrec :: ReadPrec [PageBuildEvent] readListPrec :: ReadPrec [PageBuildEvent] Read) instance Event PageBuildEvent where typeName :: TypeName PageBuildEvent typeName = Text -> TypeName PageBuildEvent forall a. Text -> TypeName a TypeName Text "PageBuildEvent" eventName :: EventName PageBuildEvent eventName = Text -> EventName PageBuildEvent forall a. Text -> EventName a EventName Text "page_build" instance FromJSON PageBuildEvent where parseJSON :: Value -> Parser PageBuildEvent parseJSON (Object Object x) = Maybe Installation -> Organization -> Repository -> User -> Int -> PageBuild -> PageBuildEvent PageBuildEvent (Maybe Installation -> Organization -> Repository -> User -> Int -> PageBuild -> PageBuildEvent) -> Parser (Maybe Installation) -> Parser (Organization -> Repository -> User -> Int -> PageBuild -> PageBuildEvent) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Object x Object -> Key -> Parser (Maybe Installation) forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "installation" Parser (Organization -> Repository -> User -> Int -> PageBuild -> PageBuildEvent) -> Parser Organization -> Parser (Repository -> User -> Int -> PageBuild -> PageBuildEvent) forall a b. Parser (a -> b) -> Parser a -> Parser b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser Organization forall a. FromJSON a => Object -> Key -> Parser a .: Key "organization" Parser (Repository -> User -> Int -> PageBuild -> PageBuildEvent) -> Parser Repository -> Parser (User -> Int -> PageBuild -> PageBuildEvent) forall a b. Parser (a -> b) -> Parser a -> Parser b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser Repository forall a. FromJSON a => Object -> Key -> Parser a .: Key "repository" Parser (User -> Int -> PageBuild -> PageBuildEvent) -> Parser User -> Parser (Int -> PageBuild -> PageBuildEvent) forall a b. Parser (a -> b) -> Parser a -> Parser b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser User forall a. FromJSON a => Object -> Key -> Parser a .: Key "sender" Parser (Int -> PageBuild -> PageBuildEvent) -> Parser Int -> Parser (PageBuild -> PageBuildEvent) forall a b. Parser (a -> b) -> Parser a -> Parser b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser Int forall a. FromJSON a => Object -> Key -> Parser a .: Key "id" Parser (PageBuild -> PageBuildEvent) -> Parser PageBuild -> Parser PageBuildEvent forall a b. Parser (a -> b) -> Parser a -> Parser b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser PageBuild forall a. FromJSON a => Object -> Key -> Parser a .: Key "build" parseJSON Value _ = String -> Parser PageBuildEvent forall a. String -> Parser a forall (m :: * -> *) a. MonadFail m => String -> m a fail String "PageBuildEvent" instance ToJSON PageBuildEvent where toJSON :: PageBuildEvent -> Value toJSON PageBuildEvent{Int Maybe Installation Organization User PageBuild Repository pageBuildEventInstallation :: PageBuildEvent -> Maybe Installation pageBuildEventOrganization :: PageBuildEvent -> Organization pageBuildEventRepository :: PageBuildEvent -> Repository pageBuildEventSender :: PageBuildEvent -> User pageBuildEventId :: PageBuildEvent -> Int pageBuildEventBuild :: PageBuildEvent -> PageBuild pageBuildEventInstallation :: Maybe Installation pageBuildEventOrganization :: Organization pageBuildEventRepository :: Repository pageBuildEventSender :: User pageBuildEventId :: Int pageBuildEventBuild :: PageBuild ..} = [Pair] -> Value object [ Key "installation" Key -> Maybe Installation -> Pair forall v. ToJSON v => Key -> v -> Pair forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv .= Maybe Installation pageBuildEventInstallation , Key "organization" Key -> Organization -> Pair forall v. ToJSON v => Key -> v -> Pair forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv .= Organization pageBuildEventOrganization , Key "repository" Key -> Repository -> Pair forall v. ToJSON v => Key -> v -> Pair forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv .= Repository pageBuildEventRepository , Key "sender" Key -> User -> Pair forall v. ToJSON v => Key -> v -> Pair forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv .= User pageBuildEventSender , Key "id" Key -> Int -> Pair forall v. ToJSON v => Key -> v -> Pair forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv .= Int pageBuildEventId , Key "build" Key -> PageBuild -> Pair forall v. ToJSON v => Key -> v -> Pair forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv .= PageBuild pageBuildEventBuild ] instance Arbitrary PageBuildEvent where arbitrary :: Gen PageBuildEvent arbitrary = Maybe Installation -> Organization -> Repository -> User -> Int -> PageBuild -> PageBuildEvent PageBuildEvent (Maybe Installation -> Organization -> Repository -> User -> Int -> PageBuild -> PageBuildEvent) -> Gen (Maybe Installation) -> Gen (Organization -> Repository -> User -> Int -> PageBuild -> PageBuildEvent) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b <$> Gen (Maybe Installation) forall a. Arbitrary a => Gen a arbitrary Gen (Organization -> Repository -> User -> Int -> PageBuild -> PageBuildEvent) -> Gen Organization -> Gen (Repository -> User -> Int -> PageBuild -> PageBuildEvent) forall a b. Gen (a -> b) -> Gen a -> Gen b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen Organization forall a. Arbitrary a => Gen a arbitrary Gen (Repository -> User -> Int -> PageBuild -> PageBuildEvent) -> Gen Repository -> Gen (User -> Int -> PageBuild -> PageBuildEvent) forall a b. Gen (a -> b) -> Gen a -> Gen b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen Repository forall a. Arbitrary a => Gen a arbitrary Gen (User -> Int -> PageBuild -> PageBuildEvent) -> Gen User -> Gen (Int -> PageBuild -> PageBuildEvent) forall a b. Gen (a -> b) -> Gen a -> Gen b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen User forall a. Arbitrary a => Gen a arbitrary Gen (Int -> PageBuild -> PageBuildEvent) -> Gen Int -> Gen (PageBuild -> PageBuildEvent) forall a b. Gen (a -> b) -> Gen a -> Gen b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen Int forall a. Arbitrary a => Gen a arbitrary Gen (PageBuild -> PageBuildEvent) -> Gen PageBuild -> Gen PageBuildEvent forall a b. Gen (a -> b) -> Gen a -> Gen b forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen PageBuild forall a. Arbitrary a => Gen a arbitrary