{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE StrictData #-} module GitHub.Types.Events.PullRequestEvent where import Data.Aeson (FromJSON (..), ToJSON (..), object) import Data.Aeson.Types (Value (..), (.:), (.:?), (.=)) import Data.Text (Text) import Test.QuickCheck.Arbitrary (Arbitrary (..)) import GitHub.Types.Base import GitHub.Types.Event data PullRequestEvent = PullRequestEvent { PullRequestEvent -> Maybe Installation pullRequestEventInstallation :: Maybe Installation , PullRequestEvent -> Organization pullRequestEventOrganization :: Organization , PullRequestEvent -> Repository pullRequestEventRepository :: Repository , PullRequestEvent -> User pullRequestEventSender :: User , PullRequestEvent -> Text pullRequestEventAction :: Text , PullRequestEvent -> Maybe Text pullRequestEventAfter :: Maybe Text , PullRequestEvent -> Maybe User pullRequestEventAssignee :: Maybe User , PullRequestEvent -> Maybe Text pullRequestEventBefore :: Maybe Text , PullRequestEvent -> Maybe Changes pullRequestEventChanges :: Maybe Changes , PullRequestEvent -> Maybe Label pullRequestEventLabel :: Maybe Label , PullRequestEvent -> Int pullRequestEventNumber :: Int , PullRequestEvent -> PullRequest pullRequestEventPullRequest :: PullRequest , PullRequestEvent -> Maybe User pullRequestEventRequestedReviewer :: Maybe User , PullRequestEvent -> Maybe Team pullRequestEventRequestedTeam :: Maybe Team } deriving (PullRequestEvent -> PullRequestEvent -> Bool (PullRequestEvent -> PullRequestEvent -> Bool) -> (PullRequestEvent -> PullRequestEvent -> Bool) -> Eq PullRequestEvent forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a /= :: PullRequestEvent -> PullRequestEvent -> Bool $c/= :: PullRequestEvent -> PullRequestEvent -> Bool == :: PullRequestEvent -> PullRequestEvent -> Bool $c== :: PullRequestEvent -> PullRequestEvent -> Bool Eq, Int -> PullRequestEvent -> ShowS [PullRequestEvent] -> ShowS PullRequestEvent -> String (Int -> PullRequestEvent -> ShowS) -> (PullRequestEvent -> String) -> ([PullRequestEvent] -> ShowS) -> Show PullRequestEvent forall a. (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a showList :: [PullRequestEvent] -> ShowS $cshowList :: [PullRequestEvent] -> ShowS show :: PullRequestEvent -> String $cshow :: PullRequestEvent -> String showsPrec :: Int -> PullRequestEvent -> ShowS $cshowsPrec :: Int -> PullRequestEvent -> ShowS Show, ReadPrec [PullRequestEvent] ReadPrec PullRequestEvent Int -> ReadS PullRequestEvent ReadS [PullRequestEvent] (Int -> ReadS PullRequestEvent) -> ReadS [PullRequestEvent] -> ReadPrec PullRequestEvent -> ReadPrec [PullRequestEvent] -> Read PullRequestEvent forall a. (Int -> ReadS a) -> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a readListPrec :: ReadPrec [PullRequestEvent] $creadListPrec :: ReadPrec [PullRequestEvent] readPrec :: ReadPrec PullRequestEvent $creadPrec :: ReadPrec PullRequestEvent readList :: ReadS [PullRequestEvent] $creadList :: ReadS [PullRequestEvent] readsPrec :: Int -> ReadS PullRequestEvent $creadsPrec :: Int -> ReadS PullRequestEvent Read) instance Event PullRequestEvent where typeName :: TypeName PullRequestEvent typeName = Text -> TypeName PullRequestEvent forall a. Text -> TypeName a TypeName Text "PullRequestEvent" eventName :: EventName PullRequestEvent eventName = Text -> EventName PullRequestEvent forall a. Text -> EventName a EventName Text "pull_request" instance FromJSON PullRequestEvent where parseJSON :: Value -> Parser PullRequestEvent parseJSON (Object Object x) = Maybe Installation -> Organization -> Repository -> User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent PullRequestEvent (Maybe Installation -> Organization -> Repository -> User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser (Maybe Installation) -> Parser (Organization -> Repository -> User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) 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 -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser Organization -> Parser (Repository -> User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) 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 -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser Repository -> Parser (User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) 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 -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser User -> Parser (Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) 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 (Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser Text -> Parser (Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser Text forall a. FromJSON a => Object -> Key -> Parser a .: Key "action" Parser (Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser (Maybe Text) -> Parser (Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser (Maybe Text) forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "after" Parser (Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser (Maybe User) -> Parser (Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser (Maybe User) forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "assignee" Parser (Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser (Maybe Text) -> Parser (Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser (Maybe Text) forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "before" Parser (Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser (Maybe Changes) -> Parser (Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser (Maybe Changes) forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "changes" Parser (Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser (Maybe Label) -> Parser (Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser (Maybe Label) forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "label" Parser (Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser Int -> Parser (PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) 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 "number" Parser (PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Parser PullRequest -> Parser (Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser PullRequest forall a. FromJSON a => Object -> Key -> Parser a .: Key "pull_request" Parser (Maybe User -> Maybe Team -> PullRequestEvent) -> Parser (Maybe User) -> Parser (Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser (Maybe User) forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "requested_reviewer" Parser (Maybe Team -> PullRequestEvent) -> Parser (Maybe Team) -> Parser PullRequestEvent forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Object x Object -> Key -> Parser (Maybe Team) forall a. FromJSON a => Object -> Key -> Parser (Maybe a) .:? Key "requested_team" parseJSON Value _ = String -> Parser PullRequestEvent forall (m :: * -> *) a. MonadFail m => String -> m a fail String "PullRequestEvent" instance ToJSON PullRequestEvent where toJSON :: PullRequestEvent -> Value toJSON PullRequestEvent{Int Maybe Text Maybe Changes Maybe Installation Maybe Label Maybe Team Maybe User Text Organization User Repository PullRequest pullRequestEventRequestedTeam :: Maybe Team pullRequestEventRequestedReviewer :: Maybe User pullRequestEventPullRequest :: PullRequest pullRequestEventNumber :: Int pullRequestEventLabel :: Maybe Label pullRequestEventChanges :: Maybe Changes pullRequestEventBefore :: Maybe Text pullRequestEventAssignee :: Maybe User pullRequestEventAfter :: Maybe Text pullRequestEventAction :: Text pullRequestEventSender :: User pullRequestEventRepository :: Repository pullRequestEventOrganization :: Organization pullRequestEventInstallation :: Maybe Installation pullRequestEventRequestedTeam :: PullRequestEvent -> Maybe Team pullRequestEventRequestedReviewer :: PullRequestEvent -> Maybe User pullRequestEventPullRequest :: PullRequestEvent -> PullRequest pullRequestEventNumber :: PullRequestEvent -> Int pullRequestEventLabel :: PullRequestEvent -> Maybe Label pullRequestEventChanges :: PullRequestEvent -> Maybe Changes pullRequestEventBefore :: PullRequestEvent -> Maybe Text pullRequestEventAssignee :: PullRequestEvent -> Maybe User pullRequestEventAfter :: PullRequestEvent -> Maybe Text pullRequestEventAction :: PullRequestEvent -> Text pullRequestEventSender :: PullRequestEvent -> User pullRequestEventRepository :: PullRequestEvent -> Repository pullRequestEventOrganization :: PullRequestEvent -> Organization pullRequestEventInstallation :: PullRequestEvent -> Maybe Installation ..} = [Pair] -> Value object [ Key "installation" Key -> Maybe Installation -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Maybe Installation pullRequestEventInstallation , Key "organization" Key -> Organization -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Organization pullRequestEventOrganization , Key "repository" Key -> Repository -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Repository pullRequestEventRepository , Key "sender" Key -> User -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= User pullRequestEventSender , Key "action" Key -> Text -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Text pullRequestEventAction , Key "after" Key -> Maybe Text -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Maybe Text pullRequestEventAfter , Key "assignee" Key -> Maybe User -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Maybe User pullRequestEventAssignee , Key "before" Key -> Maybe Text -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Maybe Text pullRequestEventBefore , Key "changes" Key -> Maybe Changes -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Maybe Changes pullRequestEventChanges , Key "label" Key -> Maybe Label -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Maybe Label pullRequestEventLabel , Key "number" Key -> Int -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Int pullRequestEventNumber , Key "pull_request" Key -> PullRequest -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= PullRequest pullRequestEventPullRequest , Key "requested_reviewer" Key -> Maybe User -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Maybe User pullRequestEventRequestedReviewer , Key "requested_team" Key -> Maybe Team -> Pair forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv .= Maybe Team pullRequestEventRequestedTeam ] instance Arbitrary PullRequestEvent where arbitrary :: Gen PullRequestEvent arbitrary = Maybe Installation -> Organization -> Repository -> User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent PullRequestEvent (Maybe Installation -> Organization -> Repository -> User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen (Maybe Installation) -> Gen (Organization -> Repository -> User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) 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 -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen Organization -> Gen (Repository -> User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) 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 -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen Repository -> Gen (User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen Repository forall a. Arbitrary a => Gen a arbitrary Gen (User -> Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen User -> Gen (Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen User forall a. Arbitrary a => Gen a arbitrary Gen (Text -> Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen Text -> Gen (Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen Text forall a. Arbitrary a => Gen a arbitrary Gen (Maybe Text -> Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen (Maybe Text) -> Gen (Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen (Maybe Text) forall a. Arbitrary a => Gen a arbitrary Gen (Maybe User -> Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen (Maybe User) -> Gen (Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen (Maybe User) forall a. Arbitrary a => Gen a arbitrary Gen (Maybe Text -> Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen (Maybe Text) -> Gen (Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen (Maybe Text) forall a. Arbitrary a => Gen a arbitrary Gen (Maybe Changes -> Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen (Maybe Changes) -> Gen (Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen (Maybe Changes) forall a. Arbitrary a => Gen a arbitrary Gen (Maybe Label -> Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen (Maybe Label) -> Gen (Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen (Maybe Label) forall a. Arbitrary a => Gen a arbitrary Gen (Int -> PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen Int -> Gen (PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen Int forall a. Arbitrary a => Gen a arbitrary Gen (PullRequest -> Maybe User -> Maybe Team -> PullRequestEvent) -> Gen PullRequest -> Gen (Maybe User -> Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen PullRequest forall a. Arbitrary a => Gen a arbitrary Gen (Maybe User -> Maybe Team -> PullRequestEvent) -> Gen (Maybe User) -> Gen (Maybe Team -> PullRequestEvent) forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen (Maybe User) forall a. Arbitrary a => Gen a arbitrary Gen (Maybe Team -> PullRequestEvent) -> Gen (Maybe Team) -> Gen PullRequestEvent forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b <*> Gen (Maybe Team) forall a. Arbitrary a => Gen a arbitrary