{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
module Language.Github.Actions.Workflow.Trigger
( BranchProtectionRuleActivityType (..),
CheckRunActivityType (..),
DiscussionActivityType (..),
DiscussionCommentActivityType (..),
IssueCommentActivityType (..),
IssuesActivityType (..),
LabelActivityType (..),
MilestoneActivityType (..),
PullRequestActivityType (..),
PullRequestReviewActivityType (..),
PullRequestReviewCommentActivityType (..),
PullRequestTargetActivityType (..),
PullRequestTargetTriggerAttributes (..),
PullRequestTriggerAttributes (..),
PushTriggerAttributes (..),
RegistryPackageActivityType (..),
ReleaseActivityType (..),
WorkflowCallAttributes (..),
WorkflowDispatchAttributes (..),
WorkflowDispatchInput (..),
WorkflowDispatchInputType (..),
WorkflowRunActivityType (..),
WorkflowRunTriggerAttributes (..),
WorkflowTrigger (..),
gen,
)
where
import Control.Applicative ((<|>))
import Control.Monad (guard)
import Control.Monad.Fail.Hoist (hoistFail')
import Data.Aeson (FromJSON, ToJSON, ToJSONKey, (.:), (.:?), (.=))
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.KeyMap as AesonKeyMap
import qualified Data.Aeson.Types as Aeson
import Data.List.NonEmpty (NonEmpty (..), nonEmpty)
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Maybe (catMaybes, fromMaybe, isJust)
import Data.String.Interpolate (i)
import Data.Text (Text)
import Data.Traversable (for)
import qualified Data.Vector as Vector
import GHC.Generics (Generic)
import Hedgehog (MonadGen)
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Language.Github.Actions.Internal (inverseMap)
data BranchProtectionRuleActivityType
= BranchProtectionRuleCreated
| BranchProtectionRuleDeleted
| BranchProtectionRuleEdited
deriving stock (BranchProtectionRuleActivityType
BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> Bounded BranchProtectionRuleActivityType
forall a. a -> a -> Bounded a
$cminBound :: BranchProtectionRuleActivityType
minBound :: BranchProtectionRuleActivityType
$cmaxBound :: BranchProtectionRuleActivityType
maxBound :: BranchProtectionRuleActivityType
Bounded, Int -> BranchProtectionRuleActivityType
BranchProtectionRuleActivityType -> Int
BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
(BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType)
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType)
-> (Int -> BranchProtectionRuleActivityType)
-> (BranchProtectionRuleActivityType -> Int)
-> (BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType])
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType])
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType])
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType])
-> Enum BranchProtectionRuleActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
succ :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
$cpred :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
pred :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
$ctoEnum :: Int -> BranchProtectionRuleActivityType
toEnum :: Int -> BranchProtectionRuleActivityType
$cfromEnum :: BranchProtectionRuleActivityType -> Int
fromEnum :: BranchProtectionRuleActivityType -> Int
$cenumFrom :: BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
enumFrom :: BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
$cenumFromThen :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
enumFromThen :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
$cenumFromTo :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
enumFromTo :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
$cenumFromThenTo :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
enumFromThenTo :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> [BranchProtectionRuleActivityType]
Enum, BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
(BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool)
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool)
-> Eq BranchProtectionRuleActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
== :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
$c/= :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
/= :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
Eq, (forall x.
BranchProtectionRuleActivityType
-> Rep BranchProtectionRuleActivityType x)
-> (forall x.
Rep BranchProtectionRuleActivityType x
-> BranchProtectionRuleActivityType)
-> Generic BranchProtectionRuleActivityType
forall x.
Rep BranchProtectionRuleActivityType x
-> BranchProtectionRuleActivityType
forall x.
BranchProtectionRuleActivityType
-> Rep BranchProtectionRuleActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
BranchProtectionRuleActivityType
-> Rep BranchProtectionRuleActivityType x
from :: forall x.
BranchProtectionRuleActivityType
-> Rep BranchProtectionRuleActivityType x
$cto :: forall x.
Rep BranchProtectionRuleActivityType x
-> BranchProtectionRuleActivityType
to :: forall x.
Rep BranchProtectionRuleActivityType x
-> BranchProtectionRuleActivityType
Generic, Eq BranchProtectionRuleActivityType
Eq BranchProtectionRuleActivityType =>
(BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Ordering)
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool)
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool)
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool)
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool)
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType)
-> (BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType)
-> Ord BranchProtectionRuleActivityType
BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Ordering
BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
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
$ccompare :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Ordering
compare :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Ordering
$c< :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
< :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
$c<= :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
<= :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
$c> :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
> :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
$c>= :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
>= :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType -> Bool
$cmax :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
max :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
$cmin :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
min :: BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
-> BranchProtectionRuleActivityType
Ord, Int -> BranchProtectionRuleActivityType -> ShowS
[BranchProtectionRuleActivityType] -> ShowS
BranchProtectionRuleActivityType -> String
(Int -> BranchProtectionRuleActivityType -> ShowS)
-> (BranchProtectionRuleActivityType -> String)
-> ([BranchProtectionRuleActivityType] -> ShowS)
-> Show BranchProtectionRuleActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BranchProtectionRuleActivityType -> ShowS
showsPrec :: Int -> BranchProtectionRuleActivityType -> ShowS
$cshow :: BranchProtectionRuleActivityType -> String
show :: BranchProtectionRuleActivityType -> String
$cshowList :: [BranchProtectionRuleActivityType] -> ShowS
showList :: [BranchProtectionRuleActivityType] -> ShowS
Show)
instance FromJSON BranchProtectionRuleActivityType where
parseJSON :: Value -> Parser BranchProtectionRuleActivityType
parseJSON =
String
-> (Text -> Parser BranchProtectionRuleActivityType)
-> Value
-> Parser BranchProtectionRuleActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"BranchProtectionRuleActivityType" ((Text -> Parser BranchProtectionRuleActivityType)
-> Value -> Parser BranchProtectionRuleActivityType)
-> (Text -> Parser BranchProtectionRuleActivityType)
-> Value
-> Parser BranchProtectionRuleActivityType
forall a b. (a -> b) -> a -> b
$
Either String BranchProtectionRuleActivityType
-> Parser BranchProtectionRuleActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String BranchProtectionRuleActivityType
-> Parser BranchProtectionRuleActivityType)
-> (Text -> Either String BranchProtectionRuleActivityType)
-> Text
-> Parser BranchProtectionRuleActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String BranchProtectionRuleActivityType
parseBranchProtectionRuleActivityType
instance ToJSON BranchProtectionRuleActivityType where
toJSON :: BranchProtectionRuleActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (BranchProtectionRuleActivityType -> Text)
-> BranchProtectionRuleActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BranchProtectionRuleActivityType -> Text
renderBranchProtectionRuleActivityType
renderBranchProtectionRuleActivityType :: BranchProtectionRuleActivityType -> Text
renderBranchProtectionRuleActivityType :: BranchProtectionRuleActivityType -> Text
renderBranchProtectionRuleActivityType = \case
BranchProtectionRuleActivityType
BranchProtectionRuleCreated -> Text
"created"
BranchProtectionRuleActivityType
BranchProtectionRuleDeleted -> Text
"deleted"
BranchProtectionRuleActivityType
BranchProtectionRuleEdited -> Text
"edited"
parseBranchProtectionRuleActivityType :: Text -> Either String BranchProtectionRuleActivityType
parseBranchProtectionRuleActivityType :: Text -> Either String BranchProtectionRuleActivityType
parseBranchProtectionRuleActivityType Text
t =
Either String BranchProtectionRuleActivityType
-> (BranchProtectionRuleActivityType
-> Either String BranchProtectionRuleActivityType)
-> Maybe BranchProtectionRuleActivityType
-> Either String BranchProtectionRuleActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String BranchProtectionRuleActivityType
forall a b. a -> Either a b
Left [i|Unknown BranchProtectionRuleActivityType: #{t}|]) BranchProtectionRuleActivityType
-> Either String BranchProtectionRuleActivityType
forall a b. b -> Either a b
Right (Maybe BranchProtectionRuleActivityType
-> Either String BranchProtectionRuleActivityType)
-> Maybe BranchProtectionRuleActivityType
-> Either String BranchProtectionRuleActivityType
forall a b. (a -> b) -> a -> b
$
(BranchProtectionRuleActivityType -> Text)
-> Text -> Maybe BranchProtectionRuleActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap BranchProtectionRuleActivityType -> Text
renderBranchProtectionRuleActivityType Text
t
data CheckRunActivityType
= CheckRunCompleted
| CheckRunCreated
| CheckRunRequestedAction
| CheckRunRerequested
deriving stock (CheckRunActivityType
CheckRunActivityType
-> CheckRunActivityType -> Bounded CheckRunActivityType
forall a. a -> a -> Bounded a
$cminBound :: CheckRunActivityType
minBound :: CheckRunActivityType
$cmaxBound :: CheckRunActivityType
maxBound :: CheckRunActivityType
Bounded, Int -> CheckRunActivityType
CheckRunActivityType -> Int
CheckRunActivityType -> [CheckRunActivityType]
CheckRunActivityType -> CheckRunActivityType
CheckRunActivityType
-> CheckRunActivityType -> [CheckRunActivityType]
CheckRunActivityType
-> CheckRunActivityType
-> CheckRunActivityType
-> [CheckRunActivityType]
(CheckRunActivityType -> CheckRunActivityType)
-> (CheckRunActivityType -> CheckRunActivityType)
-> (Int -> CheckRunActivityType)
-> (CheckRunActivityType -> Int)
-> (CheckRunActivityType -> [CheckRunActivityType])
-> (CheckRunActivityType
-> CheckRunActivityType -> [CheckRunActivityType])
-> (CheckRunActivityType
-> CheckRunActivityType -> [CheckRunActivityType])
-> (CheckRunActivityType
-> CheckRunActivityType
-> CheckRunActivityType
-> [CheckRunActivityType])
-> Enum CheckRunActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: CheckRunActivityType -> CheckRunActivityType
succ :: CheckRunActivityType -> CheckRunActivityType
$cpred :: CheckRunActivityType -> CheckRunActivityType
pred :: CheckRunActivityType -> CheckRunActivityType
$ctoEnum :: Int -> CheckRunActivityType
toEnum :: Int -> CheckRunActivityType
$cfromEnum :: CheckRunActivityType -> Int
fromEnum :: CheckRunActivityType -> Int
$cenumFrom :: CheckRunActivityType -> [CheckRunActivityType]
enumFrom :: CheckRunActivityType -> [CheckRunActivityType]
$cenumFromThen :: CheckRunActivityType
-> CheckRunActivityType -> [CheckRunActivityType]
enumFromThen :: CheckRunActivityType
-> CheckRunActivityType -> [CheckRunActivityType]
$cenumFromTo :: CheckRunActivityType
-> CheckRunActivityType -> [CheckRunActivityType]
enumFromTo :: CheckRunActivityType
-> CheckRunActivityType -> [CheckRunActivityType]
$cenumFromThenTo :: CheckRunActivityType
-> CheckRunActivityType
-> CheckRunActivityType
-> [CheckRunActivityType]
enumFromThenTo :: CheckRunActivityType
-> CheckRunActivityType
-> CheckRunActivityType
-> [CheckRunActivityType]
Enum, CheckRunActivityType -> CheckRunActivityType -> Bool
(CheckRunActivityType -> CheckRunActivityType -> Bool)
-> (CheckRunActivityType -> CheckRunActivityType -> Bool)
-> Eq CheckRunActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CheckRunActivityType -> CheckRunActivityType -> Bool
== :: CheckRunActivityType -> CheckRunActivityType -> Bool
$c/= :: CheckRunActivityType -> CheckRunActivityType -> Bool
/= :: CheckRunActivityType -> CheckRunActivityType -> Bool
Eq, (forall x. CheckRunActivityType -> Rep CheckRunActivityType x)
-> (forall x. Rep CheckRunActivityType x -> CheckRunActivityType)
-> Generic CheckRunActivityType
forall x. Rep CheckRunActivityType x -> CheckRunActivityType
forall x. CheckRunActivityType -> Rep CheckRunActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. CheckRunActivityType -> Rep CheckRunActivityType x
from :: forall x. CheckRunActivityType -> Rep CheckRunActivityType x
$cto :: forall x. Rep CheckRunActivityType x -> CheckRunActivityType
to :: forall x. Rep CheckRunActivityType x -> CheckRunActivityType
Generic, Eq CheckRunActivityType
Eq CheckRunActivityType =>
(CheckRunActivityType -> CheckRunActivityType -> Ordering)
-> (CheckRunActivityType -> CheckRunActivityType -> Bool)
-> (CheckRunActivityType -> CheckRunActivityType -> Bool)
-> (CheckRunActivityType -> CheckRunActivityType -> Bool)
-> (CheckRunActivityType -> CheckRunActivityType -> Bool)
-> (CheckRunActivityType
-> CheckRunActivityType -> CheckRunActivityType)
-> (CheckRunActivityType
-> CheckRunActivityType -> CheckRunActivityType)
-> Ord CheckRunActivityType
CheckRunActivityType -> CheckRunActivityType -> Bool
CheckRunActivityType -> CheckRunActivityType -> Ordering
CheckRunActivityType
-> CheckRunActivityType -> CheckRunActivityType
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
$ccompare :: CheckRunActivityType -> CheckRunActivityType -> Ordering
compare :: CheckRunActivityType -> CheckRunActivityType -> Ordering
$c< :: CheckRunActivityType -> CheckRunActivityType -> Bool
< :: CheckRunActivityType -> CheckRunActivityType -> Bool
$c<= :: CheckRunActivityType -> CheckRunActivityType -> Bool
<= :: CheckRunActivityType -> CheckRunActivityType -> Bool
$c> :: CheckRunActivityType -> CheckRunActivityType -> Bool
> :: CheckRunActivityType -> CheckRunActivityType -> Bool
$c>= :: CheckRunActivityType -> CheckRunActivityType -> Bool
>= :: CheckRunActivityType -> CheckRunActivityType -> Bool
$cmax :: CheckRunActivityType
-> CheckRunActivityType -> CheckRunActivityType
max :: CheckRunActivityType
-> CheckRunActivityType -> CheckRunActivityType
$cmin :: CheckRunActivityType
-> CheckRunActivityType -> CheckRunActivityType
min :: CheckRunActivityType
-> CheckRunActivityType -> CheckRunActivityType
Ord, Int -> CheckRunActivityType -> ShowS
[CheckRunActivityType] -> ShowS
CheckRunActivityType -> String
(Int -> CheckRunActivityType -> ShowS)
-> (CheckRunActivityType -> String)
-> ([CheckRunActivityType] -> ShowS)
-> Show CheckRunActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CheckRunActivityType -> ShowS
showsPrec :: Int -> CheckRunActivityType -> ShowS
$cshow :: CheckRunActivityType -> String
show :: CheckRunActivityType -> String
$cshowList :: [CheckRunActivityType] -> ShowS
showList :: [CheckRunActivityType] -> ShowS
Show)
instance FromJSON CheckRunActivityType where
parseJSON :: Value -> Parser CheckRunActivityType
parseJSON =
String
-> (Text -> Parser CheckRunActivityType)
-> Value
-> Parser CheckRunActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"CheckRunActivityType" ((Text -> Parser CheckRunActivityType)
-> Value -> Parser CheckRunActivityType)
-> (Text -> Parser CheckRunActivityType)
-> Value
-> Parser CheckRunActivityType
forall a b. (a -> b) -> a -> b
$
Either String CheckRunActivityType -> Parser CheckRunActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String CheckRunActivityType -> Parser CheckRunActivityType)
-> (Text -> Either String CheckRunActivityType)
-> Text
-> Parser CheckRunActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String CheckRunActivityType
parseCheckRunActivityType
instance ToJSON CheckRunActivityType where
toJSON :: CheckRunActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (CheckRunActivityType -> Text) -> CheckRunActivityType -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CheckRunActivityType -> Text
renderCheckRunActivityType
renderCheckRunActivityType :: CheckRunActivityType -> Text
renderCheckRunActivityType :: CheckRunActivityType -> Text
renderCheckRunActivityType = \case
CheckRunActivityType
CheckRunCompleted -> Text
"completed"
CheckRunActivityType
CheckRunCreated -> Text
"created"
CheckRunActivityType
CheckRunRequestedAction -> Text
"requested_action"
CheckRunActivityType
CheckRunRerequested -> Text
"rerequested"
parseCheckRunActivityType :: Text -> Either String CheckRunActivityType
parseCheckRunActivityType :: Text -> Either String CheckRunActivityType
parseCheckRunActivityType Text
t =
Either String CheckRunActivityType
-> (CheckRunActivityType -> Either String CheckRunActivityType)
-> Maybe CheckRunActivityType
-> Either String CheckRunActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String CheckRunActivityType
forall a b. a -> Either a b
Left [i|Unknown CheckRunActivityType: #{t}|]) CheckRunActivityType -> Either String CheckRunActivityType
forall a b. b -> Either a b
Right (Maybe CheckRunActivityType -> Either String CheckRunActivityType)
-> Maybe CheckRunActivityType -> Either String CheckRunActivityType
forall a b. (a -> b) -> a -> b
$
(CheckRunActivityType -> Text)
-> Text -> Maybe CheckRunActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap CheckRunActivityType -> Text
renderCheckRunActivityType Text
t
data DiscussionActivityType
= DiscussionAnswered
| DiscussionCategoryChanged
| DiscussionCreated
| DiscussionDeleted
| DiscussionEdited
| DiscussionLabeled
| DiscussionLocked
| DiscussionPinned
| DiscussionTransferred
| DiscussionUnanswered
| DiscussionUnlabeled
| DiscussionUnlocked
| DiscussionUnpinned
deriving stock (DiscussionActivityType
DiscussionActivityType
-> DiscussionActivityType -> Bounded DiscussionActivityType
forall a. a -> a -> Bounded a
$cminBound :: DiscussionActivityType
minBound :: DiscussionActivityType
$cmaxBound :: DiscussionActivityType
maxBound :: DiscussionActivityType
Bounded, Int -> DiscussionActivityType
DiscussionActivityType -> Int
DiscussionActivityType -> [DiscussionActivityType]
DiscussionActivityType -> DiscussionActivityType
DiscussionActivityType
-> DiscussionActivityType -> [DiscussionActivityType]
DiscussionActivityType
-> DiscussionActivityType
-> DiscussionActivityType
-> [DiscussionActivityType]
(DiscussionActivityType -> DiscussionActivityType)
-> (DiscussionActivityType -> DiscussionActivityType)
-> (Int -> DiscussionActivityType)
-> (DiscussionActivityType -> Int)
-> (DiscussionActivityType -> [DiscussionActivityType])
-> (DiscussionActivityType
-> DiscussionActivityType -> [DiscussionActivityType])
-> (DiscussionActivityType
-> DiscussionActivityType -> [DiscussionActivityType])
-> (DiscussionActivityType
-> DiscussionActivityType
-> DiscussionActivityType
-> [DiscussionActivityType])
-> Enum DiscussionActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: DiscussionActivityType -> DiscussionActivityType
succ :: DiscussionActivityType -> DiscussionActivityType
$cpred :: DiscussionActivityType -> DiscussionActivityType
pred :: DiscussionActivityType -> DiscussionActivityType
$ctoEnum :: Int -> DiscussionActivityType
toEnum :: Int -> DiscussionActivityType
$cfromEnum :: DiscussionActivityType -> Int
fromEnum :: DiscussionActivityType -> Int
$cenumFrom :: DiscussionActivityType -> [DiscussionActivityType]
enumFrom :: DiscussionActivityType -> [DiscussionActivityType]
$cenumFromThen :: DiscussionActivityType
-> DiscussionActivityType -> [DiscussionActivityType]
enumFromThen :: DiscussionActivityType
-> DiscussionActivityType -> [DiscussionActivityType]
$cenumFromTo :: DiscussionActivityType
-> DiscussionActivityType -> [DiscussionActivityType]
enumFromTo :: DiscussionActivityType
-> DiscussionActivityType -> [DiscussionActivityType]
$cenumFromThenTo :: DiscussionActivityType
-> DiscussionActivityType
-> DiscussionActivityType
-> [DiscussionActivityType]
enumFromThenTo :: DiscussionActivityType
-> DiscussionActivityType
-> DiscussionActivityType
-> [DiscussionActivityType]
Enum, DiscussionActivityType -> DiscussionActivityType -> Bool
(DiscussionActivityType -> DiscussionActivityType -> Bool)
-> (DiscussionActivityType -> DiscussionActivityType -> Bool)
-> Eq DiscussionActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DiscussionActivityType -> DiscussionActivityType -> Bool
== :: DiscussionActivityType -> DiscussionActivityType -> Bool
$c/= :: DiscussionActivityType -> DiscussionActivityType -> Bool
/= :: DiscussionActivityType -> DiscussionActivityType -> Bool
Eq, (forall x. DiscussionActivityType -> Rep DiscussionActivityType x)
-> (forall x.
Rep DiscussionActivityType x -> DiscussionActivityType)
-> Generic DiscussionActivityType
forall x. Rep DiscussionActivityType x -> DiscussionActivityType
forall x. DiscussionActivityType -> Rep DiscussionActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. DiscussionActivityType -> Rep DiscussionActivityType x
from :: forall x. DiscussionActivityType -> Rep DiscussionActivityType x
$cto :: forall x. Rep DiscussionActivityType x -> DiscussionActivityType
to :: forall x. Rep DiscussionActivityType x -> DiscussionActivityType
Generic, Eq DiscussionActivityType
Eq DiscussionActivityType =>
(DiscussionActivityType -> DiscussionActivityType -> Ordering)
-> (DiscussionActivityType -> DiscussionActivityType -> Bool)
-> (DiscussionActivityType -> DiscussionActivityType -> Bool)
-> (DiscussionActivityType -> DiscussionActivityType -> Bool)
-> (DiscussionActivityType -> DiscussionActivityType -> Bool)
-> (DiscussionActivityType
-> DiscussionActivityType -> DiscussionActivityType)
-> (DiscussionActivityType
-> DiscussionActivityType -> DiscussionActivityType)
-> Ord DiscussionActivityType
DiscussionActivityType -> DiscussionActivityType -> Bool
DiscussionActivityType -> DiscussionActivityType -> Ordering
DiscussionActivityType
-> DiscussionActivityType -> DiscussionActivityType
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
$ccompare :: DiscussionActivityType -> DiscussionActivityType -> Ordering
compare :: DiscussionActivityType -> DiscussionActivityType -> Ordering
$c< :: DiscussionActivityType -> DiscussionActivityType -> Bool
< :: DiscussionActivityType -> DiscussionActivityType -> Bool
$c<= :: DiscussionActivityType -> DiscussionActivityType -> Bool
<= :: DiscussionActivityType -> DiscussionActivityType -> Bool
$c> :: DiscussionActivityType -> DiscussionActivityType -> Bool
> :: DiscussionActivityType -> DiscussionActivityType -> Bool
$c>= :: DiscussionActivityType -> DiscussionActivityType -> Bool
>= :: DiscussionActivityType -> DiscussionActivityType -> Bool
$cmax :: DiscussionActivityType
-> DiscussionActivityType -> DiscussionActivityType
max :: DiscussionActivityType
-> DiscussionActivityType -> DiscussionActivityType
$cmin :: DiscussionActivityType
-> DiscussionActivityType -> DiscussionActivityType
min :: DiscussionActivityType
-> DiscussionActivityType -> DiscussionActivityType
Ord, Int -> DiscussionActivityType -> ShowS
[DiscussionActivityType] -> ShowS
DiscussionActivityType -> String
(Int -> DiscussionActivityType -> ShowS)
-> (DiscussionActivityType -> String)
-> ([DiscussionActivityType] -> ShowS)
-> Show DiscussionActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DiscussionActivityType -> ShowS
showsPrec :: Int -> DiscussionActivityType -> ShowS
$cshow :: DiscussionActivityType -> String
show :: DiscussionActivityType -> String
$cshowList :: [DiscussionActivityType] -> ShowS
showList :: [DiscussionActivityType] -> ShowS
Show)
instance FromJSON DiscussionActivityType where
parseJSON :: Value -> Parser DiscussionActivityType
parseJSON =
String
-> (Text -> Parser DiscussionActivityType)
-> Value
-> Parser DiscussionActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"DiscussionActivityType" ((Text -> Parser DiscussionActivityType)
-> Value -> Parser DiscussionActivityType)
-> (Text -> Parser DiscussionActivityType)
-> Value
-> Parser DiscussionActivityType
forall a b. (a -> b) -> a -> b
$
Either String DiscussionActivityType
-> Parser DiscussionActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String DiscussionActivityType
-> Parser DiscussionActivityType)
-> (Text -> Either String DiscussionActivityType)
-> Text
-> Parser DiscussionActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String DiscussionActivityType
parseDiscussionActivityType
instance ToJSON DiscussionActivityType where
toJSON :: DiscussionActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (DiscussionActivityType -> Text)
-> DiscussionActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DiscussionActivityType -> Text
renderDiscussionActivityType
renderDiscussionActivityType :: DiscussionActivityType -> Text
renderDiscussionActivityType :: DiscussionActivityType -> Text
renderDiscussionActivityType = \case
DiscussionActivityType
DiscussionAnswered -> Text
"answered"
DiscussionActivityType
DiscussionCategoryChanged -> Text
"category_changed"
DiscussionActivityType
DiscussionCreated -> Text
"created"
DiscussionActivityType
DiscussionDeleted -> Text
"deleted"
DiscussionActivityType
DiscussionEdited -> Text
"edited"
DiscussionActivityType
DiscussionLabeled -> Text
"labeled"
DiscussionActivityType
DiscussionLocked -> Text
"locked"
DiscussionActivityType
DiscussionPinned -> Text
"pinned"
DiscussionActivityType
DiscussionTransferred -> Text
"transferred"
DiscussionActivityType
DiscussionUnanswered -> Text
"unanswered"
DiscussionActivityType
DiscussionUnlabeled -> Text
"unlabeled"
DiscussionActivityType
DiscussionUnlocked -> Text
"unlocked"
DiscussionActivityType
DiscussionUnpinned -> Text
"unpinned"
parseDiscussionActivityType :: Text -> Either String DiscussionActivityType
parseDiscussionActivityType :: Text -> Either String DiscussionActivityType
parseDiscussionActivityType Text
t =
Either String DiscussionActivityType
-> (DiscussionActivityType -> Either String DiscussionActivityType)
-> Maybe DiscussionActivityType
-> Either String DiscussionActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String DiscussionActivityType
forall a b. a -> Either a b
Left [i|Unknown DiscussionActivityType: #{t}|]) DiscussionActivityType -> Either String DiscussionActivityType
forall a b. b -> Either a b
Right (Maybe DiscussionActivityType
-> Either String DiscussionActivityType)
-> Maybe DiscussionActivityType
-> Either String DiscussionActivityType
forall a b. (a -> b) -> a -> b
$
(DiscussionActivityType -> Text)
-> Text -> Maybe DiscussionActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap DiscussionActivityType -> Text
renderDiscussionActivityType Text
t
data
=
|
|
deriving stock (DiscussionCommentActivityType
DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> Bounded DiscussionCommentActivityType
forall a. a -> a -> Bounded a
$cminBound :: DiscussionCommentActivityType
minBound :: DiscussionCommentActivityType
$cmaxBound :: DiscussionCommentActivityType
maxBound :: DiscussionCommentActivityType
Bounded, Int -> DiscussionCommentActivityType
DiscussionCommentActivityType -> Int
DiscussionCommentActivityType -> [DiscussionCommentActivityType]
DiscussionCommentActivityType -> DiscussionCommentActivityType
DiscussionCommentActivityType
-> DiscussionCommentActivityType -> [DiscussionCommentActivityType]
DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> [DiscussionCommentActivityType]
(DiscussionCommentActivityType -> DiscussionCommentActivityType)
-> (DiscussionCommentActivityType -> DiscussionCommentActivityType)
-> (Int -> DiscussionCommentActivityType)
-> (DiscussionCommentActivityType -> Int)
-> (DiscussionCommentActivityType
-> [DiscussionCommentActivityType])
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> [DiscussionCommentActivityType])
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> [DiscussionCommentActivityType])
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> [DiscussionCommentActivityType])
-> Enum DiscussionCommentActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: DiscussionCommentActivityType -> DiscussionCommentActivityType
succ :: DiscussionCommentActivityType -> DiscussionCommentActivityType
$cpred :: DiscussionCommentActivityType -> DiscussionCommentActivityType
pred :: DiscussionCommentActivityType -> DiscussionCommentActivityType
$ctoEnum :: Int -> DiscussionCommentActivityType
toEnum :: Int -> DiscussionCommentActivityType
$cfromEnum :: DiscussionCommentActivityType -> Int
fromEnum :: DiscussionCommentActivityType -> Int
$cenumFrom :: DiscussionCommentActivityType -> [DiscussionCommentActivityType]
enumFrom :: DiscussionCommentActivityType -> [DiscussionCommentActivityType]
$cenumFromThen :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> [DiscussionCommentActivityType]
enumFromThen :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> [DiscussionCommentActivityType]
$cenumFromTo :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> [DiscussionCommentActivityType]
enumFromTo :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> [DiscussionCommentActivityType]
$cenumFromThenTo :: DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> [DiscussionCommentActivityType]
enumFromThenTo :: DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> DiscussionCommentActivityType
-> [DiscussionCommentActivityType]
Enum, DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
(DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool)
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool)
-> Eq DiscussionCommentActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
== :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
$c/= :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
/= :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
Eq, (forall x.
DiscussionCommentActivityType
-> Rep DiscussionCommentActivityType x)
-> (forall x.
Rep DiscussionCommentActivityType x
-> DiscussionCommentActivityType)
-> Generic DiscussionCommentActivityType
forall x.
Rep DiscussionCommentActivityType x
-> DiscussionCommentActivityType
forall x.
DiscussionCommentActivityType
-> Rep DiscussionCommentActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
DiscussionCommentActivityType
-> Rep DiscussionCommentActivityType x
from :: forall x.
DiscussionCommentActivityType
-> Rep DiscussionCommentActivityType x
$cto :: forall x.
Rep DiscussionCommentActivityType x
-> DiscussionCommentActivityType
to :: forall x.
Rep DiscussionCommentActivityType x
-> DiscussionCommentActivityType
Generic, Eq DiscussionCommentActivityType
Eq DiscussionCommentActivityType =>
(DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Ordering)
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool)
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool)
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool)
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool)
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType -> DiscussionCommentActivityType)
-> (DiscussionCommentActivityType
-> DiscussionCommentActivityType -> DiscussionCommentActivityType)
-> Ord DiscussionCommentActivityType
DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Ordering
DiscussionCommentActivityType
-> DiscussionCommentActivityType -> DiscussionCommentActivityType
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
$ccompare :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Ordering
compare :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Ordering
$c< :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
< :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
$c<= :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
<= :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
$c> :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
> :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
$c>= :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
>= :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> Bool
$cmax :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> DiscussionCommentActivityType
max :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> DiscussionCommentActivityType
$cmin :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> DiscussionCommentActivityType
min :: DiscussionCommentActivityType
-> DiscussionCommentActivityType -> DiscussionCommentActivityType
Ord, Int -> DiscussionCommentActivityType -> ShowS
[DiscussionCommentActivityType] -> ShowS
DiscussionCommentActivityType -> String
(Int -> DiscussionCommentActivityType -> ShowS)
-> (DiscussionCommentActivityType -> String)
-> ([DiscussionCommentActivityType] -> ShowS)
-> Show DiscussionCommentActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DiscussionCommentActivityType -> ShowS
showsPrec :: Int -> DiscussionCommentActivityType -> ShowS
$cshow :: DiscussionCommentActivityType -> String
show :: DiscussionCommentActivityType -> String
$cshowList :: [DiscussionCommentActivityType] -> ShowS
showList :: [DiscussionCommentActivityType] -> ShowS
Show)
instance FromJSON DiscussionCommentActivityType where
parseJSON :: Value -> Parser DiscussionCommentActivityType
parseJSON =
String
-> (Text -> Parser DiscussionCommentActivityType)
-> Value
-> Parser DiscussionCommentActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"DiscussionCommentActivityType" ((Text -> Parser DiscussionCommentActivityType)
-> Value -> Parser DiscussionCommentActivityType)
-> (Text -> Parser DiscussionCommentActivityType)
-> Value
-> Parser DiscussionCommentActivityType
forall a b. (a -> b) -> a -> b
$
Either String DiscussionCommentActivityType
-> Parser DiscussionCommentActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String DiscussionCommentActivityType
-> Parser DiscussionCommentActivityType)
-> (Text -> Either String DiscussionCommentActivityType)
-> Text
-> Parser DiscussionCommentActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String DiscussionCommentActivityType
parseDiscussionCommentActivityType
instance ToJSON DiscussionCommentActivityType where
toJSON :: DiscussionCommentActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (DiscussionCommentActivityType -> Text)
-> DiscussionCommentActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DiscussionCommentActivityType -> Text
renderDiscussionCommentActivityType
renderDiscussionCommentActivityType :: DiscussionCommentActivityType -> Text
= \case
DiscussionCommentActivityType
DiscussionCommentCreated -> Text
"created"
DiscussionCommentActivityType
DiscussionCommentDeleted -> Text
"deleted"
DiscussionCommentActivityType
DiscussionCommentEdited -> Text
"edited"
parseDiscussionCommentActivityType :: Text -> Either String DiscussionCommentActivityType
Text
t =
Either String DiscussionCommentActivityType
-> (DiscussionCommentActivityType
-> Either String DiscussionCommentActivityType)
-> Maybe DiscussionCommentActivityType
-> Either String DiscussionCommentActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String DiscussionCommentActivityType
forall a b. a -> Either a b
Left [i|Unknown DiscussionCommentActivityType: #{t}|]) DiscussionCommentActivityType
-> Either String DiscussionCommentActivityType
forall a b. b -> Either a b
Right (Maybe DiscussionCommentActivityType
-> Either String DiscussionCommentActivityType)
-> Maybe DiscussionCommentActivityType
-> Either String DiscussionCommentActivityType
forall a b. (a -> b) -> a -> b
$
(DiscussionCommentActivityType -> Text)
-> Text -> Maybe DiscussionCommentActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap DiscussionCommentActivityType -> Text
renderDiscussionCommentActivityType Text
t
data
=
|
|
deriving stock (IssueCommentActivityType
IssueCommentActivityType
-> IssueCommentActivityType -> Bounded IssueCommentActivityType
forall a. a -> a -> Bounded a
$cminBound :: IssueCommentActivityType
minBound :: IssueCommentActivityType
$cmaxBound :: IssueCommentActivityType
maxBound :: IssueCommentActivityType
Bounded, Int -> IssueCommentActivityType
IssueCommentActivityType -> Int
IssueCommentActivityType -> [IssueCommentActivityType]
IssueCommentActivityType -> IssueCommentActivityType
IssueCommentActivityType
-> IssueCommentActivityType -> [IssueCommentActivityType]
IssueCommentActivityType
-> IssueCommentActivityType
-> IssueCommentActivityType
-> [IssueCommentActivityType]
(IssueCommentActivityType -> IssueCommentActivityType)
-> (IssueCommentActivityType -> IssueCommentActivityType)
-> (Int -> IssueCommentActivityType)
-> (IssueCommentActivityType -> Int)
-> (IssueCommentActivityType -> [IssueCommentActivityType])
-> (IssueCommentActivityType
-> IssueCommentActivityType -> [IssueCommentActivityType])
-> (IssueCommentActivityType
-> IssueCommentActivityType -> [IssueCommentActivityType])
-> (IssueCommentActivityType
-> IssueCommentActivityType
-> IssueCommentActivityType
-> [IssueCommentActivityType])
-> Enum IssueCommentActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: IssueCommentActivityType -> IssueCommentActivityType
succ :: IssueCommentActivityType -> IssueCommentActivityType
$cpred :: IssueCommentActivityType -> IssueCommentActivityType
pred :: IssueCommentActivityType -> IssueCommentActivityType
$ctoEnum :: Int -> IssueCommentActivityType
toEnum :: Int -> IssueCommentActivityType
$cfromEnum :: IssueCommentActivityType -> Int
fromEnum :: IssueCommentActivityType -> Int
$cenumFrom :: IssueCommentActivityType -> [IssueCommentActivityType]
enumFrom :: IssueCommentActivityType -> [IssueCommentActivityType]
$cenumFromThen :: IssueCommentActivityType
-> IssueCommentActivityType -> [IssueCommentActivityType]
enumFromThen :: IssueCommentActivityType
-> IssueCommentActivityType -> [IssueCommentActivityType]
$cenumFromTo :: IssueCommentActivityType
-> IssueCommentActivityType -> [IssueCommentActivityType]
enumFromTo :: IssueCommentActivityType
-> IssueCommentActivityType -> [IssueCommentActivityType]
$cenumFromThenTo :: IssueCommentActivityType
-> IssueCommentActivityType
-> IssueCommentActivityType
-> [IssueCommentActivityType]
enumFromThenTo :: IssueCommentActivityType
-> IssueCommentActivityType
-> IssueCommentActivityType
-> [IssueCommentActivityType]
Enum, IssueCommentActivityType -> IssueCommentActivityType -> Bool
(IssueCommentActivityType -> IssueCommentActivityType -> Bool)
-> (IssueCommentActivityType -> IssueCommentActivityType -> Bool)
-> Eq IssueCommentActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
== :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
$c/= :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
/= :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
Eq, (forall x.
IssueCommentActivityType -> Rep IssueCommentActivityType x)
-> (forall x.
Rep IssueCommentActivityType x -> IssueCommentActivityType)
-> Generic IssueCommentActivityType
forall x.
Rep IssueCommentActivityType x -> IssueCommentActivityType
forall x.
IssueCommentActivityType -> Rep IssueCommentActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
IssueCommentActivityType -> Rep IssueCommentActivityType x
from :: forall x.
IssueCommentActivityType -> Rep IssueCommentActivityType x
$cto :: forall x.
Rep IssueCommentActivityType x -> IssueCommentActivityType
to :: forall x.
Rep IssueCommentActivityType x -> IssueCommentActivityType
Generic, Eq IssueCommentActivityType
Eq IssueCommentActivityType =>
(IssueCommentActivityType -> IssueCommentActivityType -> Ordering)
-> (IssueCommentActivityType -> IssueCommentActivityType -> Bool)
-> (IssueCommentActivityType -> IssueCommentActivityType -> Bool)
-> (IssueCommentActivityType -> IssueCommentActivityType -> Bool)
-> (IssueCommentActivityType -> IssueCommentActivityType -> Bool)
-> (IssueCommentActivityType
-> IssueCommentActivityType -> IssueCommentActivityType)
-> (IssueCommentActivityType
-> IssueCommentActivityType -> IssueCommentActivityType)
-> Ord IssueCommentActivityType
IssueCommentActivityType -> IssueCommentActivityType -> Bool
IssueCommentActivityType -> IssueCommentActivityType -> Ordering
IssueCommentActivityType
-> IssueCommentActivityType -> IssueCommentActivityType
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
$ccompare :: IssueCommentActivityType -> IssueCommentActivityType -> Ordering
compare :: IssueCommentActivityType -> IssueCommentActivityType -> Ordering
$c< :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
< :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
$c<= :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
<= :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
$c> :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
> :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
$c>= :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
>= :: IssueCommentActivityType -> IssueCommentActivityType -> Bool
$cmax :: IssueCommentActivityType
-> IssueCommentActivityType -> IssueCommentActivityType
max :: IssueCommentActivityType
-> IssueCommentActivityType -> IssueCommentActivityType
$cmin :: IssueCommentActivityType
-> IssueCommentActivityType -> IssueCommentActivityType
min :: IssueCommentActivityType
-> IssueCommentActivityType -> IssueCommentActivityType
Ord, Int -> IssueCommentActivityType -> ShowS
[IssueCommentActivityType] -> ShowS
IssueCommentActivityType -> String
(Int -> IssueCommentActivityType -> ShowS)
-> (IssueCommentActivityType -> String)
-> ([IssueCommentActivityType] -> ShowS)
-> Show IssueCommentActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IssueCommentActivityType -> ShowS
showsPrec :: Int -> IssueCommentActivityType -> ShowS
$cshow :: IssueCommentActivityType -> String
show :: IssueCommentActivityType -> String
$cshowList :: [IssueCommentActivityType] -> ShowS
showList :: [IssueCommentActivityType] -> ShowS
Show)
instance FromJSON IssueCommentActivityType where
parseJSON :: Value -> Parser IssueCommentActivityType
parseJSON =
String
-> (Text -> Parser IssueCommentActivityType)
-> Value
-> Parser IssueCommentActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"IssueCommentActivityType" ((Text -> Parser IssueCommentActivityType)
-> Value -> Parser IssueCommentActivityType)
-> (Text -> Parser IssueCommentActivityType)
-> Value
-> Parser IssueCommentActivityType
forall a b. (a -> b) -> a -> b
$
Either String IssueCommentActivityType
-> Parser IssueCommentActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String IssueCommentActivityType
-> Parser IssueCommentActivityType)
-> (Text -> Either String IssueCommentActivityType)
-> Text
-> Parser IssueCommentActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String IssueCommentActivityType
parseIssueCommentActivityType
instance ToJSON IssueCommentActivityType where
toJSON :: IssueCommentActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (IssueCommentActivityType -> Text)
-> IssueCommentActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IssueCommentActivityType -> Text
renderIssueCommentActivityType
renderIssueCommentActivityType :: IssueCommentActivityType -> Text
= \case
IssueCommentActivityType
IssueCommentCreated -> Text
"created"
IssueCommentActivityType
IssueCommentDeleted -> Text
"deleted"
IssueCommentActivityType
IssueCommentEdited -> Text
"edited"
parseIssueCommentActivityType :: Text -> Either String IssueCommentActivityType
Text
t =
Either String IssueCommentActivityType
-> (IssueCommentActivityType
-> Either String IssueCommentActivityType)
-> Maybe IssueCommentActivityType
-> Either String IssueCommentActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String IssueCommentActivityType
forall a b. a -> Either a b
Left [i|Unknown IssueCommentActivityType: #{t}|]) IssueCommentActivityType -> Either String IssueCommentActivityType
forall a b. b -> Either a b
Right (Maybe IssueCommentActivityType
-> Either String IssueCommentActivityType)
-> Maybe IssueCommentActivityType
-> Either String IssueCommentActivityType
forall a b. (a -> b) -> a -> b
$
(IssueCommentActivityType -> Text)
-> Text -> Maybe IssueCommentActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap IssueCommentActivityType -> Text
renderIssueCommentActivityType Text
t
data IssuesActivityType
= IssuesAssigned
| IssuesClosed
| IssuesDeleted
| IssuesDemilestoned
| IssuesEdited
| IssuesLabeled
| IssuesLocked
| IssuesMilestoned
| IssuesOpened
| IssuesPinned
| IssuesReopened
| IssuesTransferred
| IssuesUnassigned
| IssuesUnlabeled
| IssuesUnlocked
| IssuesUnpinned
deriving stock (IssuesActivityType
IssuesActivityType
-> IssuesActivityType -> Bounded IssuesActivityType
forall a. a -> a -> Bounded a
$cminBound :: IssuesActivityType
minBound :: IssuesActivityType
$cmaxBound :: IssuesActivityType
maxBound :: IssuesActivityType
Bounded, Int -> IssuesActivityType
IssuesActivityType -> Int
IssuesActivityType -> [IssuesActivityType]
IssuesActivityType -> IssuesActivityType
IssuesActivityType -> IssuesActivityType -> [IssuesActivityType]
IssuesActivityType
-> IssuesActivityType -> IssuesActivityType -> [IssuesActivityType]
(IssuesActivityType -> IssuesActivityType)
-> (IssuesActivityType -> IssuesActivityType)
-> (Int -> IssuesActivityType)
-> (IssuesActivityType -> Int)
-> (IssuesActivityType -> [IssuesActivityType])
-> (IssuesActivityType
-> IssuesActivityType -> [IssuesActivityType])
-> (IssuesActivityType
-> IssuesActivityType -> [IssuesActivityType])
-> (IssuesActivityType
-> IssuesActivityType
-> IssuesActivityType
-> [IssuesActivityType])
-> Enum IssuesActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: IssuesActivityType -> IssuesActivityType
succ :: IssuesActivityType -> IssuesActivityType
$cpred :: IssuesActivityType -> IssuesActivityType
pred :: IssuesActivityType -> IssuesActivityType
$ctoEnum :: Int -> IssuesActivityType
toEnum :: Int -> IssuesActivityType
$cfromEnum :: IssuesActivityType -> Int
fromEnum :: IssuesActivityType -> Int
$cenumFrom :: IssuesActivityType -> [IssuesActivityType]
enumFrom :: IssuesActivityType -> [IssuesActivityType]
$cenumFromThen :: IssuesActivityType -> IssuesActivityType -> [IssuesActivityType]
enumFromThen :: IssuesActivityType -> IssuesActivityType -> [IssuesActivityType]
$cenumFromTo :: IssuesActivityType -> IssuesActivityType -> [IssuesActivityType]
enumFromTo :: IssuesActivityType -> IssuesActivityType -> [IssuesActivityType]
$cenumFromThenTo :: IssuesActivityType
-> IssuesActivityType -> IssuesActivityType -> [IssuesActivityType]
enumFromThenTo :: IssuesActivityType
-> IssuesActivityType -> IssuesActivityType -> [IssuesActivityType]
Enum, IssuesActivityType -> IssuesActivityType -> Bool
(IssuesActivityType -> IssuesActivityType -> Bool)
-> (IssuesActivityType -> IssuesActivityType -> Bool)
-> Eq IssuesActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IssuesActivityType -> IssuesActivityType -> Bool
== :: IssuesActivityType -> IssuesActivityType -> Bool
$c/= :: IssuesActivityType -> IssuesActivityType -> Bool
/= :: IssuesActivityType -> IssuesActivityType -> Bool
Eq, (forall x. IssuesActivityType -> Rep IssuesActivityType x)
-> (forall x. Rep IssuesActivityType x -> IssuesActivityType)
-> Generic IssuesActivityType
forall x. Rep IssuesActivityType x -> IssuesActivityType
forall x. IssuesActivityType -> Rep IssuesActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. IssuesActivityType -> Rep IssuesActivityType x
from :: forall x. IssuesActivityType -> Rep IssuesActivityType x
$cto :: forall x. Rep IssuesActivityType x -> IssuesActivityType
to :: forall x. Rep IssuesActivityType x -> IssuesActivityType
Generic, Eq IssuesActivityType
Eq IssuesActivityType =>
(IssuesActivityType -> IssuesActivityType -> Ordering)
-> (IssuesActivityType -> IssuesActivityType -> Bool)
-> (IssuesActivityType -> IssuesActivityType -> Bool)
-> (IssuesActivityType -> IssuesActivityType -> Bool)
-> (IssuesActivityType -> IssuesActivityType -> Bool)
-> (IssuesActivityType -> IssuesActivityType -> IssuesActivityType)
-> (IssuesActivityType -> IssuesActivityType -> IssuesActivityType)
-> Ord IssuesActivityType
IssuesActivityType -> IssuesActivityType -> Bool
IssuesActivityType -> IssuesActivityType -> Ordering
IssuesActivityType -> IssuesActivityType -> IssuesActivityType
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
$ccompare :: IssuesActivityType -> IssuesActivityType -> Ordering
compare :: IssuesActivityType -> IssuesActivityType -> Ordering
$c< :: IssuesActivityType -> IssuesActivityType -> Bool
< :: IssuesActivityType -> IssuesActivityType -> Bool
$c<= :: IssuesActivityType -> IssuesActivityType -> Bool
<= :: IssuesActivityType -> IssuesActivityType -> Bool
$c> :: IssuesActivityType -> IssuesActivityType -> Bool
> :: IssuesActivityType -> IssuesActivityType -> Bool
$c>= :: IssuesActivityType -> IssuesActivityType -> Bool
>= :: IssuesActivityType -> IssuesActivityType -> Bool
$cmax :: IssuesActivityType -> IssuesActivityType -> IssuesActivityType
max :: IssuesActivityType -> IssuesActivityType -> IssuesActivityType
$cmin :: IssuesActivityType -> IssuesActivityType -> IssuesActivityType
min :: IssuesActivityType -> IssuesActivityType -> IssuesActivityType
Ord, Int -> IssuesActivityType -> ShowS
[IssuesActivityType] -> ShowS
IssuesActivityType -> String
(Int -> IssuesActivityType -> ShowS)
-> (IssuesActivityType -> String)
-> ([IssuesActivityType] -> ShowS)
-> Show IssuesActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IssuesActivityType -> ShowS
showsPrec :: Int -> IssuesActivityType -> ShowS
$cshow :: IssuesActivityType -> String
show :: IssuesActivityType -> String
$cshowList :: [IssuesActivityType] -> ShowS
showList :: [IssuesActivityType] -> ShowS
Show)
instance FromJSON IssuesActivityType where
parseJSON :: Value -> Parser IssuesActivityType
parseJSON =
String
-> (Text -> Parser IssuesActivityType)
-> Value
-> Parser IssuesActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"IssuesActivityType" ((Text -> Parser IssuesActivityType)
-> Value -> Parser IssuesActivityType)
-> (Text -> Parser IssuesActivityType)
-> Value
-> Parser IssuesActivityType
forall a b. (a -> b) -> a -> b
$
Either String IssuesActivityType -> Parser IssuesActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String IssuesActivityType -> Parser IssuesActivityType)
-> (Text -> Either String IssuesActivityType)
-> Text
-> Parser IssuesActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String IssuesActivityType
parseIssuesActivityType
instance ToJSON IssuesActivityType where
toJSON :: IssuesActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (IssuesActivityType -> Text) -> IssuesActivityType -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IssuesActivityType -> Text
renderIssuesActivityType
renderIssuesActivityType :: IssuesActivityType -> Text
renderIssuesActivityType :: IssuesActivityType -> Text
renderIssuesActivityType = \case
IssuesActivityType
IssuesAssigned -> Text
"assigned"
IssuesActivityType
IssuesClosed -> Text
"closed"
IssuesActivityType
IssuesDeleted -> Text
"deleted"
IssuesActivityType
IssuesDemilestoned -> Text
"demilestoned"
IssuesActivityType
IssuesEdited -> Text
"edited"
IssuesActivityType
IssuesLabeled -> Text
"labeled"
IssuesActivityType
IssuesLocked -> Text
"locked"
IssuesActivityType
IssuesMilestoned -> Text
"milestoned"
IssuesActivityType
IssuesOpened -> Text
"opened"
IssuesActivityType
IssuesPinned -> Text
"pinned"
IssuesActivityType
IssuesReopened -> Text
"reopened"
IssuesActivityType
IssuesTransferred -> Text
"transferred"
IssuesActivityType
IssuesUnassigned -> Text
"unassigned"
IssuesActivityType
IssuesUnlabeled -> Text
"unlabeled"
IssuesActivityType
IssuesUnlocked -> Text
"unlocked"
IssuesActivityType
IssuesUnpinned -> Text
"unpinned"
parseIssuesActivityType :: Text -> Either String IssuesActivityType
parseIssuesActivityType :: Text -> Either String IssuesActivityType
parseIssuesActivityType Text
t =
Either String IssuesActivityType
-> (IssuesActivityType -> Either String IssuesActivityType)
-> Maybe IssuesActivityType
-> Either String IssuesActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String IssuesActivityType
forall a b. a -> Either a b
Left [i|Unknown IssuesActivityType: #{t}|]) IssuesActivityType -> Either String IssuesActivityType
forall a b. b -> Either a b
Right (Maybe IssuesActivityType -> Either String IssuesActivityType)
-> Maybe IssuesActivityType -> Either String IssuesActivityType
forall a b. (a -> b) -> a -> b
$
(IssuesActivityType -> Text) -> Text -> Maybe IssuesActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap IssuesActivityType -> Text
renderIssuesActivityType Text
t
data LabelActivityType
= LabelCreated
| LabelDeleted
| LabelEdited
deriving stock (LabelActivityType
LabelActivityType -> LabelActivityType -> Bounded LabelActivityType
forall a. a -> a -> Bounded a
$cminBound :: LabelActivityType
minBound :: LabelActivityType
$cmaxBound :: LabelActivityType
maxBound :: LabelActivityType
Bounded, Int -> LabelActivityType
LabelActivityType -> Int
LabelActivityType -> [LabelActivityType]
LabelActivityType -> LabelActivityType
LabelActivityType -> LabelActivityType -> [LabelActivityType]
LabelActivityType
-> LabelActivityType -> LabelActivityType -> [LabelActivityType]
(LabelActivityType -> LabelActivityType)
-> (LabelActivityType -> LabelActivityType)
-> (Int -> LabelActivityType)
-> (LabelActivityType -> Int)
-> (LabelActivityType -> [LabelActivityType])
-> (LabelActivityType -> LabelActivityType -> [LabelActivityType])
-> (LabelActivityType -> LabelActivityType -> [LabelActivityType])
-> (LabelActivityType
-> LabelActivityType -> LabelActivityType -> [LabelActivityType])
-> Enum LabelActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: LabelActivityType -> LabelActivityType
succ :: LabelActivityType -> LabelActivityType
$cpred :: LabelActivityType -> LabelActivityType
pred :: LabelActivityType -> LabelActivityType
$ctoEnum :: Int -> LabelActivityType
toEnum :: Int -> LabelActivityType
$cfromEnum :: LabelActivityType -> Int
fromEnum :: LabelActivityType -> Int
$cenumFrom :: LabelActivityType -> [LabelActivityType]
enumFrom :: LabelActivityType -> [LabelActivityType]
$cenumFromThen :: LabelActivityType -> LabelActivityType -> [LabelActivityType]
enumFromThen :: LabelActivityType -> LabelActivityType -> [LabelActivityType]
$cenumFromTo :: LabelActivityType -> LabelActivityType -> [LabelActivityType]
enumFromTo :: LabelActivityType -> LabelActivityType -> [LabelActivityType]
$cenumFromThenTo :: LabelActivityType
-> LabelActivityType -> LabelActivityType -> [LabelActivityType]
enumFromThenTo :: LabelActivityType
-> LabelActivityType -> LabelActivityType -> [LabelActivityType]
Enum, LabelActivityType -> LabelActivityType -> Bool
(LabelActivityType -> LabelActivityType -> Bool)
-> (LabelActivityType -> LabelActivityType -> Bool)
-> Eq LabelActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: LabelActivityType -> LabelActivityType -> Bool
== :: LabelActivityType -> LabelActivityType -> Bool
$c/= :: LabelActivityType -> LabelActivityType -> Bool
/= :: LabelActivityType -> LabelActivityType -> Bool
Eq, (forall x. LabelActivityType -> Rep LabelActivityType x)
-> (forall x. Rep LabelActivityType x -> LabelActivityType)
-> Generic LabelActivityType
forall x. Rep LabelActivityType x -> LabelActivityType
forall x. LabelActivityType -> Rep LabelActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. LabelActivityType -> Rep LabelActivityType x
from :: forall x. LabelActivityType -> Rep LabelActivityType x
$cto :: forall x. Rep LabelActivityType x -> LabelActivityType
to :: forall x. Rep LabelActivityType x -> LabelActivityType
Generic, Eq LabelActivityType
Eq LabelActivityType =>
(LabelActivityType -> LabelActivityType -> Ordering)
-> (LabelActivityType -> LabelActivityType -> Bool)
-> (LabelActivityType -> LabelActivityType -> Bool)
-> (LabelActivityType -> LabelActivityType -> Bool)
-> (LabelActivityType -> LabelActivityType -> Bool)
-> (LabelActivityType -> LabelActivityType -> LabelActivityType)
-> (LabelActivityType -> LabelActivityType -> LabelActivityType)
-> Ord LabelActivityType
LabelActivityType -> LabelActivityType -> Bool
LabelActivityType -> LabelActivityType -> Ordering
LabelActivityType -> LabelActivityType -> LabelActivityType
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
$ccompare :: LabelActivityType -> LabelActivityType -> Ordering
compare :: LabelActivityType -> LabelActivityType -> Ordering
$c< :: LabelActivityType -> LabelActivityType -> Bool
< :: LabelActivityType -> LabelActivityType -> Bool
$c<= :: LabelActivityType -> LabelActivityType -> Bool
<= :: LabelActivityType -> LabelActivityType -> Bool
$c> :: LabelActivityType -> LabelActivityType -> Bool
> :: LabelActivityType -> LabelActivityType -> Bool
$c>= :: LabelActivityType -> LabelActivityType -> Bool
>= :: LabelActivityType -> LabelActivityType -> Bool
$cmax :: LabelActivityType -> LabelActivityType -> LabelActivityType
max :: LabelActivityType -> LabelActivityType -> LabelActivityType
$cmin :: LabelActivityType -> LabelActivityType -> LabelActivityType
min :: LabelActivityType -> LabelActivityType -> LabelActivityType
Ord, Int -> LabelActivityType -> ShowS
[LabelActivityType] -> ShowS
LabelActivityType -> String
(Int -> LabelActivityType -> ShowS)
-> (LabelActivityType -> String)
-> ([LabelActivityType] -> ShowS)
-> Show LabelActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> LabelActivityType -> ShowS
showsPrec :: Int -> LabelActivityType -> ShowS
$cshow :: LabelActivityType -> String
show :: LabelActivityType -> String
$cshowList :: [LabelActivityType] -> ShowS
showList :: [LabelActivityType] -> ShowS
Show)
instance FromJSON LabelActivityType where
parseJSON :: Value -> Parser LabelActivityType
parseJSON =
String
-> (Text -> Parser LabelActivityType)
-> Value
-> Parser LabelActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"LabelActivityType" ((Text -> Parser LabelActivityType)
-> Value -> Parser LabelActivityType)
-> (Text -> Parser LabelActivityType)
-> Value
-> Parser LabelActivityType
forall a b. (a -> b) -> a -> b
$
Either String LabelActivityType -> Parser LabelActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String LabelActivityType -> Parser LabelActivityType)
-> (Text -> Either String LabelActivityType)
-> Text
-> Parser LabelActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String LabelActivityType
parseLabelActivityType
instance ToJSON LabelActivityType where
toJSON :: LabelActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (LabelActivityType -> Text) -> LabelActivityType -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. LabelActivityType -> Text
renderLabelActivityType
renderLabelActivityType :: LabelActivityType -> Text
renderLabelActivityType :: LabelActivityType -> Text
renderLabelActivityType = \case
LabelActivityType
LabelCreated -> Text
"created"
LabelActivityType
LabelDeleted -> Text
"deleted"
LabelActivityType
LabelEdited -> Text
"edited"
parseLabelActivityType :: Text -> Either String LabelActivityType
parseLabelActivityType :: Text -> Either String LabelActivityType
parseLabelActivityType Text
t =
Either String LabelActivityType
-> (LabelActivityType -> Either String LabelActivityType)
-> Maybe LabelActivityType
-> Either String LabelActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String LabelActivityType
forall a b. a -> Either a b
Left [i|Unknown LabelActivityType: #{t}|]) LabelActivityType -> Either String LabelActivityType
forall a b. b -> Either a b
Right (Maybe LabelActivityType -> Either String LabelActivityType)
-> Maybe LabelActivityType -> Either String LabelActivityType
forall a b. (a -> b) -> a -> b
$
(LabelActivityType -> Text) -> Text -> Maybe LabelActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap LabelActivityType -> Text
renderLabelActivityType Text
t
data MilestoneActivityType
= MilestoneCreated
| MilestoneClosed
| MilestoneDeleted
| MilestoneEdited
| MilestoneOpened
deriving stock (MilestoneActivityType
MilestoneActivityType
-> MilestoneActivityType -> Bounded MilestoneActivityType
forall a. a -> a -> Bounded a
$cminBound :: MilestoneActivityType
minBound :: MilestoneActivityType
$cmaxBound :: MilestoneActivityType
maxBound :: MilestoneActivityType
Bounded, Int -> MilestoneActivityType
MilestoneActivityType -> Int
MilestoneActivityType -> [MilestoneActivityType]
MilestoneActivityType -> MilestoneActivityType
MilestoneActivityType
-> MilestoneActivityType -> [MilestoneActivityType]
MilestoneActivityType
-> MilestoneActivityType
-> MilestoneActivityType
-> [MilestoneActivityType]
(MilestoneActivityType -> MilestoneActivityType)
-> (MilestoneActivityType -> MilestoneActivityType)
-> (Int -> MilestoneActivityType)
-> (MilestoneActivityType -> Int)
-> (MilestoneActivityType -> [MilestoneActivityType])
-> (MilestoneActivityType
-> MilestoneActivityType -> [MilestoneActivityType])
-> (MilestoneActivityType
-> MilestoneActivityType -> [MilestoneActivityType])
-> (MilestoneActivityType
-> MilestoneActivityType
-> MilestoneActivityType
-> [MilestoneActivityType])
-> Enum MilestoneActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: MilestoneActivityType -> MilestoneActivityType
succ :: MilestoneActivityType -> MilestoneActivityType
$cpred :: MilestoneActivityType -> MilestoneActivityType
pred :: MilestoneActivityType -> MilestoneActivityType
$ctoEnum :: Int -> MilestoneActivityType
toEnum :: Int -> MilestoneActivityType
$cfromEnum :: MilestoneActivityType -> Int
fromEnum :: MilestoneActivityType -> Int
$cenumFrom :: MilestoneActivityType -> [MilestoneActivityType]
enumFrom :: MilestoneActivityType -> [MilestoneActivityType]
$cenumFromThen :: MilestoneActivityType
-> MilestoneActivityType -> [MilestoneActivityType]
enumFromThen :: MilestoneActivityType
-> MilestoneActivityType -> [MilestoneActivityType]
$cenumFromTo :: MilestoneActivityType
-> MilestoneActivityType -> [MilestoneActivityType]
enumFromTo :: MilestoneActivityType
-> MilestoneActivityType -> [MilestoneActivityType]
$cenumFromThenTo :: MilestoneActivityType
-> MilestoneActivityType
-> MilestoneActivityType
-> [MilestoneActivityType]
enumFromThenTo :: MilestoneActivityType
-> MilestoneActivityType
-> MilestoneActivityType
-> [MilestoneActivityType]
Enum, MilestoneActivityType -> MilestoneActivityType -> Bool
(MilestoneActivityType -> MilestoneActivityType -> Bool)
-> (MilestoneActivityType -> MilestoneActivityType -> Bool)
-> Eq MilestoneActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MilestoneActivityType -> MilestoneActivityType -> Bool
== :: MilestoneActivityType -> MilestoneActivityType -> Bool
$c/= :: MilestoneActivityType -> MilestoneActivityType -> Bool
/= :: MilestoneActivityType -> MilestoneActivityType -> Bool
Eq, (forall x. MilestoneActivityType -> Rep MilestoneActivityType x)
-> (forall x. Rep MilestoneActivityType x -> MilestoneActivityType)
-> Generic MilestoneActivityType
forall x. Rep MilestoneActivityType x -> MilestoneActivityType
forall x. MilestoneActivityType -> Rep MilestoneActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. MilestoneActivityType -> Rep MilestoneActivityType x
from :: forall x. MilestoneActivityType -> Rep MilestoneActivityType x
$cto :: forall x. Rep MilestoneActivityType x -> MilestoneActivityType
to :: forall x. Rep MilestoneActivityType x -> MilestoneActivityType
Generic, Eq MilestoneActivityType
Eq MilestoneActivityType =>
(MilestoneActivityType -> MilestoneActivityType -> Ordering)
-> (MilestoneActivityType -> MilestoneActivityType -> Bool)
-> (MilestoneActivityType -> MilestoneActivityType -> Bool)
-> (MilestoneActivityType -> MilestoneActivityType -> Bool)
-> (MilestoneActivityType -> MilestoneActivityType -> Bool)
-> (MilestoneActivityType
-> MilestoneActivityType -> MilestoneActivityType)
-> (MilestoneActivityType
-> MilestoneActivityType -> MilestoneActivityType)
-> Ord MilestoneActivityType
MilestoneActivityType -> MilestoneActivityType -> Bool
MilestoneActivityType -> MilestoneActivityType -> Ordering
MilestoneActivityType
-> MilestoneActivityType -> MilestoneActivityType
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
$ccompare :: MilestoneActivityType -> MilestoneActivityType -> Ordering
compare :: MilestoneActivityType -> MilestoneActivityType -> Ordering
$c< :: MilestoneActivityType -> MilestoneActivityType -> Bool
< :: MilestoneActivityType -> MilestoneActivityType -> Bool
$c<= :: MilestoneActivityType -> MilestoneActivityType -> Bool
<= :: MilestoneActivityType -> MilestoneActivityType -> Bool
$c> :: MilestoneActivityType -> MilestoneActivityType -> Bool
> :: MilestoneActivityType -> MilestoneActivityType -> Bool
$c>= :: MilestoneActivityType -> MilestoneActivityType -> Bool
>= :: MilestoneActivityType -> MilestoneActivityType -> Bool
$cmax :: MilestoneActivityType
-> MilestoneActivityType -> MilestoneActivityType
max :: MilestoneActivityType
-> MilestoneActivityType -> MilestoneActivityType
$cmin :: MilestoneActivityType
-> MilestoneActivityType -> MilestoneActivityType
min :: MilestoneActivityType
-> MilestoneActivityType -> MilestoneActivityType
Ord, Int -> MilestoneActivityType -> ShowS
[MilestoneActivityType] -> ShowS
MilestoneActivityType -> String
(Int -> MilestoneActivityType -> ShowS)
-> (MilestoneActivityType -> String)
-> ([MilestoneActivityType] -> ShowS)
-> Show MilestoneActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MilestoneActivityType -> ShowS
showsPrec :: Int -> MilestoneActivityType -> ShowS
$cshow :: MilestoneActivityType -> String
show :: MilestoneActivityType -> String
$cshowList :: [MilestoneActivityType] -> ShowS
showList :: [MilestoneActivityType] -> ShowS
Show)
instance FromJSON MilestoneActivityType where
parseJSON :: Value -> Parser MilestoneActivityType
parseJSON =
String
-> (Text -> Parser MilestoneActivityType)
-> Value
-> Parser MilestoneActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"MilestoneActivityType" ((Text -> Parser MilestoneActivityType)
-> Value -> Parser MilestoneActivityType)
-> (Text -> Parser MilestoneActivityType)
-> Value
-> Parser MilestoneActivityType
forall a b. (a -> b) -> a -> b
$
Either String MilestoneActivityType -> Parser MilestoneActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String MilestoneActivityType
-> Parser MilestoneActivityType)
-> (Text -> Either String MilestoneActivityType)
-> Text
-> Parser MilestoneActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String MilestoneActivityType
parseMilestoneActivityType
instance ToJSON MilestoneActivityType where
toJSON :: MilestoneActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (MilestoneActivityType -> Text)
-> MilestoneActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MilestoneActivityType -> Text
renderMilestoneActivityType
renderMilestoneActivityType :: MilestoneActivityType -> Text
renderMilestoneActivityType :: MilestoneActivityType -> Text
renderMilestoneActivityType = \case
MilestoneActivityType
MilestoneCreated -> Text
"created"
MilestoneActivityType
MilestoneClosed -> Text
"closed"
MilestoneActivityType
MilestoneDeleted -> Text
"deleted"
MilestoneActivityType
MilestoneEdited -> Text
"edited"
MilestoneActivityType
MilestoneOpened -> Text
"opened"
parseMilestoneActivityType :: Text -> Either String MilestoneActivityType
parseMilestoneActivityType :: Text -> Either String MilestoneActivityType
parseMilestoneActivityType Text
t =
Either String MilestoneActivityType
-> (MilestoneActivityType -> Either String MilestoneActivityType)
-> Maybe MilestoneActivityType
-> Either String MilestoneActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String MilestoneActivityType
forall a b. a -> Either a b
Left [i|Unknown MilestoneActivityType: #{t}|]) MilestoneActivityType -> Either String MilestoneActivityType
forall a b. b -> Either a b
Right (Maybe MilestoneActivityType
-> Either String MilestoneActivityType)
-> Maybe MilestoneActivityType
-> Either String MilestoneActivityType
forall a b. (a -> b) -> a -> b
$
(MilestoneActivityType -> Text)
-> Text -> Maybe MilestoneActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap MilestoneActivityType -> Text
renderMilestoneActivityType Text
t
data PullRequestActivityType
=
PullRequestAssigned
|
PullRequestAutoMergeDisabled
|
PullRequestAutoMergeEnabled
|
PullRequestClosed
|
PullRequestConvertedToDraft
|
PullRequestDemilestoned
|
PullRequestDequeued
|
PullRequestEdited
|
PullRequestEnqueued
|
PullRequestLabeled
|
PullRequestLocked
|
PullRequestMilestoned
|
PullRequestOpened
|
PullRequestReadyForReview
|
PullRequestReopened
|
PullRequestReviewRequestRemoved
|
PullRequestReviewRequested
|
PullRequestSynchronize
|
PullRequestUnassigned
|
PullRequestUnlabeled
|
PullRequestUnlocked
deriving stock (PullRequestActivityType
PullRequestActivityType
-> PullRequestActivityType -> Bounded PullRequestActivityType
forall a. a -> a -> Bounded a
$cminBound :: PullRequestActivityType
minBound :: PullRequestActivityType
$cmaxBound :: PullRequestActivityType
maxBound :: PullRequestActivityType
Bounded, Int -> PullRequestActivityType
PullRequestActivityType -> Int
PullRequestActivityType -> [PullRequestActivityType]
PullRequestActivityType -> PullRequestActivityType
PullRequestActivityType
-> PullRequestActivityType -> [PullRequestActivityType]
PullRequestActivityType
-> PullRequestActivityType
-> PullRequestActivityType
-> [PullRequestActivityType]
(PullRequestActivityType -> PullRequestActivityType)
-> (PullRequestActivityType -> PullRequestActivityType)
-> (Int -> PullRequestActivityType)
-> (PullRequestActivityType -> Int)
-> (PullRequestActivityType -> [PullRequestActivityType])
-> (PullRequestActivityType
-> PullRequestActivityType -> [PullRequestActivityType])
-> (PullRequestActivityType
-> PullRequestActivityType -> [PullRequestActivityType])
-> (PullRequestActivityType
-> PullRequestActivityType
-> PullRequestActivityType
-> [PullRequestActivityType])
-> Enum PullRequestActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: PullRequestActivityType -> PullRequestActivityType
succ :: PullRequestActivityType -> PullRequestActivityType
$cpred :: PullRequestActivityType -> PullRequestActivityType
pred :: PullRequestActivityType -> PullRequestActivityType
$ctoEnum :: Int -> PullRequestActivityType
toEnum :: Int -> PullRequestActivityType
$cfromEnum :: PullRequestActivityType -> Int
fromEnum :: PullRequestActivityType -> Int
$cenumFrom :: PullRequestActivityType -> [PullRequestActivityType]
enumFrom :: PullRequestActivityType -> [PullRequestActivityType]
$cenumFromThen :: PullRequestActivityType
-> PullRequestActivityType -> [PullRequestActivityType]
enumFromThen :: PullRequestActivityType
-> PullRequestActivityType -> [PullRequestActivityType]
$cenumFromTo :: PullRequestActivityType
-> PullRequestActivityType -> [PullRequestActivityType]
enumFromTo :: PullRequestActivityType
-> PullRequestActivityType -> [PullRequestActivityType]
$cenumFromThenTo :: PullRequestActivityType
-> PullRequestActivityType
-> PullRequestActivityType
-> [PullRequestActivityType]
enumFromThenTo :: PullRequestActivityType
-> PullRequestActivityType
-> PullRequestActivityType
-> [PullRequestActivityType]
Enum, PullRequestActivityType -> PullRequestActivityType -> Bool
(PullRequestActivityType -> PullRequestActivityType -> Bool)
-> (PullRequestActivityType -> PullRequestActivityType -> Bool)
-> Eq PullRequestActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PullRequestActivityType -> PullRequestActivityType -> Bool
== :: PullRequestActivityType -> PullRequestActivityType -> Bool
$c/= :: PullRequestActivityType -> PullRequestActivityType -> Bool
/= :: PullRequestActivityType -> PullRequestActivityType -> Bool
Eq, (forall x.
PullRequestActivityType -> Rep PullRequestActivityType x)
-> (forall x.
Rep PullRequestActivityType x -> PullRequestActivityType)
-> Generic PullRequestActivityType
forall x. Rep PullRequestActivityType x -> PullRequestActivityType
forall x. PullRequestActivityType -> Rep PullRequestActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PullRequestActivityType -> Rep PullRequestActivityType x
from :: forall x. PullRequestActivityType -> Rep PullRequestActivityType x
$cto :: forall x. Rep PullRequestActivityType x -> PullRequestActivityType
to :: forall x. Rep PullRequestActivityType x -> PullRequestActivityType
Generic, Eq PullRequestActivityType
Eq PullRequestActivityType =>
(PullRequestActivityType -> PullRequestActivityType -> Ordering)
-> (PullRequestActivityType -> PullRequestActivityType -> Bool)
-> (PullRequestActivityType -> PullRequestActivityType -> Bool)
-> (PullRequestActivityType -> PullRequestActivityType -> Bool)
-> (PullRequestActivityType -> PullRequestActivityType -> Bool)
-> (PullRequestActivityType
-> PullRequestActivityType -> PullRequestActivityType)
-> (PullRequestActivityType
-> PullRequestActivityType -> PullRequestActivityType)
-> Ord PullRequestActivityType
PullRequestActivityType -> PullRequestActivityType -> Bool
PullRequestActivityType -> PullRequestActivityType -> Ordering
PullRequestActivityType
-> PullRequestActivityType -> PullRequestActivityType
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
$ccompare :: PullRequestActivityType -> PullRequestActivityType -> Ordering
compare :: PullRequestActivityType -> PullRequestActivityType -> Ordering
$c< :: PullRequestActivityType -> PullRequestActivityType -> Bool
< :: PullRequestActivityType -> PullRequestActivityType -> Bool
$c<= :: PullRequestActivityType -> PullRequestActivityType -> Bool
<= :: PullRequestActivityType -> PullRequestActivityType -> Bool
$c> :: PullRequestActivityType -> PullRequestActivityType -> Bool
> :: PullRequestActivityType -> PullRequestActivityType -> Bool
$c>= :: PullRequestActivityType -> PullRequestActivityType -> Bool
>= :: PullRequestActivityType -> PullRequestActivityType -> Bool
$cmax :: PullRequestActivityType
-> PullRequestActivityType -> PullRequestActivityType
max :: PullRequestActivityType
-> PullRequestActivityType -> PullRequestActivityType
$cmin :: PullRequestActivityType
-> PullRequestActivityType -> PullRequestActivityType
min :: PullRequestActivityType
-> PullRequestActivityType -> PullRequestActivityType
Ord, Int -> PullRequestActivityType -> ShowS
[PullRequestActivityType] -> ShowS
PullRequestActivityType -> String
(Int -> PullRequestActivityType -> ShowS)
-> (PullRequestActivityType -> String)
-> ([PullRequestActivityType] -> ShowS)
-> Show PullRequestActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PullRequestActivityType -> ShowS
showsPrec :: Int -> PullRequestActivityType -> ShowS
$cshow :: PullRequestActivityType -> String
show :: PullRequestActivityType -> String
$cshowList :: [PullRequestActivityType] -> ShowS
showList :: [PullRequestActivityType] -> ShowS
Show)
instance FromJSON PullRequestActivityType where
parseJSON :: Value -> Parser PullRequestActivityType
parseJSON =
String
-> (Text -> Parser PullRequestActivityType)
-> Value
-> Parser PullRequestActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"PullRequestActivityType" ((Text -> Parser PullRequestActivityType)
-> Value -> Parser PullRequestActivityType)
-> (Text -> Parser PullRequestActivityType)
-> Value
-> Parser PullRequestActivityType
forall a b. (a -> b) -> a -> b
$
Either String PullRequestActivityType
-> Parser PullRequestActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String PullRequestActivityType
-> Parser PullRequestActivityType)
-> (Text -> Either String PullRequestActivityType)
-> Text
-> Parser PullRequestActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String PullRequestActivityType
parsePullRequestActivityType
instance ToJSON PullRequestActivityType where
toJSON :: PullRequestActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (PullRequestActivityType -> Text)
-> PullRequestActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PullRequestActivityType -> Text
renderPullRequestActivityType
renderPullRequestActivityType :: PullRequestActivityType -> Text
renderPullRequestActivityType :: PullRequestActivityType -> Text
renderPullRequestActivityType = \case
PullRequestActivityType
PullRequestAssigned -> Text
"assigned"
PullRequestActivityType
PullRequestAutoMergeDisabled -> Text
"auto_merge_disabled"
PullRequestActivityType
PullRequestAutoMergeEnabled -> Text
"auto_merge_enabled"
PullRequestActivityType
PullRequestClosed -> Text
"closed"
PullRequestActivityType
PullRequestConvertedToDraft -> Text
"converted_to_draft"
PullRequestActivityType
PullRequestDemilestoned -> Text
"demilestoned"
PullRequestActivityType
PullRequestDequeued -> Text
"dequeued"
PullRequestActivityType
PullRequestEdited -> Text
"edited"
PullRequestActivityType
PullRequestEnqueued -> Text
"enqueued"
PullRequestActivityType
PullRequestLabeled -> Text
"labeled"
PullRequestActivityType
PullRequestLocked -> Text
"locked"
PullRequestActivityType
PullRequestMilestoned -> Text
"milestoned"
PullRequestActivityType
PullRequestOpened -> Text
"opened"
PullRequestActivityType
PullRequestReadyForReview -> Text
"ready_for_review"
PullRequestActivityType
PullRequestReopened -> Text
"reopened"
PullRequestActivityType
PullRequestReviewRequestRemoved -> Text
"review_request_removed"
PullRequestActivityType
PullRequestReviewRequested -> Text
"review_requested"
PullRequestActivityType
PullRequestSynchronize -> Text
"synchronize"
PullRequestActivityType
PullRequestUnassigned -> Text
"unassigned"
PullRequestActivityType
PullRequestUnlabeled -> Text
"unlabeled"
PullRequestActivityType
PullRequestUnlocked -> Text
"unlocked"
parsePullRequestActivityType :: Text -> Either String PullRequestActivityType
parsePullRequestActivityType :: Text -> Either String PullRequestActivityType
parsePullRequestActivityType Text
t =
Either String PullRequestActivityType
-> (PullRequestActivityType
-> Either String PullRequestActivityType)
-> Maybe PullRequestActivityType
-> Either String PullRequestActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String PullRequestActivityType
forall a b. a -> Either a b
Left [i|Unknown PullRequestActivityType: #{t}|]) PullRequestActivityType -> Either String PullRequestActivityType
forall a b. b -> Either a b
Right (Maybe PullRequestActivityType
-> Either String PullRequestActivityType)
-> Maybe PullRequestActivityType
-> Either String PullRequestActivityType
forall a b. (a -> b) -> a -> b
$
(PullRequestActivityType -> Text)
-> Text -> Maybe PullRequestActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap PullRequestActivityType -> Text
renderPullRequestActivityType Text
t
data PullRequestTriggerAttributes = PullRequestTriggerAttributes
{ PullRequestTriggerAttributes
-> Maybe (NonEmpty PullRequestActivityType)
activityTypes :: Maybe (NonEmpty PullRequestActivityType),
PullRequestTriggerAttributes -> Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text),
PullRequestTriggerAttributes -> Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text),
PullRequestTriggerAttributes -> Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text),
PullRequestTriggerAttributes -> Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
}
deriving stock (PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
(PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool)
-> (PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool)
-> Eq PullRequestTriggerAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
== :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
$c/= :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
/= :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
Eq, (forall x.
PullRequestTriggerAttributes -> Rep PullRequestTriggerAttributes x)
-> (forall x.
Rep PullRequestTriggerAttributes x -> PullRequestTriggerAttributes)
-> Generic PullRequestTriggerAttributes
forall x.
Rep PullRequestTriggerAttributes x -> PullRequestTriggerAttributes
forall x.
PullRequestTriggerAttributes -> Rep PullRequestTriggerAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
PullRequestTriggerAttributes -> Rep PullRequestTriggerAttributes x
from :: forall x.
PullRequestTriggerAttributes -> Rep PullRequestTriggerAttributes x
$cto :: forall x.
Rep PullRequestTriggerAttributes x -> PullRequestTriggerAttributes
to :: forall x.
Rep PullRequestTriggerAttributes x -> PullRequestTriggerAttributes
Generic, Eq PullRequestTriggerAttributes
Eq PullRequestTriggerAttributes =>
(PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Ordering)
-> (PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool)
-> (PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool)
-> (PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool)
-> (PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool)
-> (PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> PullRequestTriggerAttributes)
-> (PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> PullRequestTriggerAttributes)
-> Ord PullRequestTriggerAttributes
PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Ordering
PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> PullRequestTriggerAttributes
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
$ccompare :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Ordering
compare :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Ordering
$c< :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
< :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
$c<= :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
<= :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
$c> :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
> :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
$c>= :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
>= :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> Bool
$cmax :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> PullRequestTriggerAttributes
max :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> PullRequestTriggerAttributes
$cmin :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> PullRequestTriggerAttributes
min :: PullRequestTriggerAttributes
-> PullRequestTriggerAttributes -> PullRequestTriggerAttributes
Ord, Int -> PullRequestTriggerAttributes -> ShowS
[PullRequestTriggerAttributes] -> ShowS
PullRequestTriggerAttributes -> String
(Int -> PullRequestTriggerAttributes -> ShowS)
-> (PullRequestTriggerAttributes -> String)
-> ([PullRequestTriggerAttributes] -> ShowS)
-> Show PullRequestTriggerAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PullRequestTriggerAttributes -> ShowS
showsPrec :: Int -> PullRequestTriggerAttributes -> ShowS
$cshow :: PullRequestTriggerAttributes -> String
show :: PullRequestTriggerAttributes -> String
$cshowList :: [PullRequestTriggerAttributes] -> ShowS
showList :: [PullRequestTriggerAttributes] -> ShowS
Show)
instance FromJSON PullRequestTriggerAttributes where
parseJSON :: Value -> Parser PullRequestTriggerAttributes
parseJSON = String
-> (Object -> Parser PullRequestTriggerAttributes)
-> Value
-> Parser PullRequestTriggerAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"PullRequestTriggerAttributes" ((Object -> Parser PullRequestTriggerAttributes)
-> Value -> Parser PullRequestTriggerAttributes)
-> (Object -> Parser PullRequestTriggerAttributes)
-> Value
-> Parser PullRequestTriggerAttributes
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe (NonEmpty PullRequestActivityType)
activityTypes <- Object
o Object -> Key -> Parser (Maybe (NonEmpty PullRequestActivityType))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"types"
Maybe (NonEmpty Text)
branches <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"branches"
Maybe (NonEmpty Text)
branchesIgnore <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"branches-ignore"
Maybe (NonEmpty Text)
paths <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"paths"
Maybe (NonEmpty Text)
pathsIgnore <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"paths-ignore"
PullRequestTriggerAttributes -> Parser PullRequestTriggerAttributes
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PullRequestTriggerAttributes {Maybe (NonEmpty Text)
Maybe (NonEmpty PullRequestActivityType)
activityTypes :: Maybe (NonEmpty PullRequestActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
activityTypes :: Maybe (NonEmpty PullRequestActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
..}
instance ToJSON PullRequestTriggerAttributes where
toJSON :: PullRequestTriggerAttributes -> Value
toJSON PullRequestTriggerAttributes {Maybe (NonEmpty Text)
Maybe (NonEmpty PullRequestActivityType)
activityTypes :: PullRequestTriggerAttributes
-> Maybe (NonEmpty PullRequestActivityType)
branches :: PullRequestTriggerAttributes -> Maybe (NonEmpty Text)
branchesIgnore :: PullRequestTriggerAttributes -> Maybe (NonEmpty Text)
paths :: PullRequestTriggerAttributes -> Maybe (NonEmpty Text)
pathsIgnore :: PullRequestTriggerAttributes -> Maybe (NonEmpty Text)
activityTypes :: Maybe (NonEmpty PullRequestActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ (Key
"branches" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
branches,
(Key
"branches-ignore" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
branchesIgnore,
(Key
"paths" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
paths,
(Key
"paths-ignore" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
pathsIgnore,
(Key
"types" Key -> NonEmpty PullRequestActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty PullRequestActivityType -> Pair)
-> Maybe (NonEmpty PullRequestActivityType) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty PullRequestActivityType)
activityTypes
]
data PullRequestReviewActivityType
= PullRequestReviewDismissed
| PullRequestReviewEdited
| PullRequestReviewSubmitted
deriving stock (PullRequestReviewActivityType
PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> Bounded PullRequestReviewActivityType
forall a. a -> a -> Bounded a
$cminBound :: PullRequestReviewActivityType
minBound :: PullRequestReviewActivityType
$cmaxBound :: PullRequestReviewActivityType
maxBound :: PullRequestReviewActivityType
Bounded, Int -> PullRequestReviewActivityType
PullRequestReviewActivityType -> Int
PullRequestReviewActivityType -> [PullRequestReviewActivityType]
PullRequestReviewActivityType -> PullRequestReviewActivityType
PullRequestReviewActivityType
-> PullRequestReviewActivityType -> [PullRequestReviewActivityType]
PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> [PullRequestReviewActivityType]
(PullRequestReviewActivityType -> PullRequestReviewActivityType)
-> (PullRequestReviewActivityType -> PullRequestReviewActivityType)
-> (Int -> PullRequestReviewActivityType)
-> (PullRequestReviewActivityType -> Int)
-> (PullRequestReviewActivityType
-> [PullRequestReviewActivityType])
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> [PullRequestReviewActivityType])
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> [PullRequestReviewActivityType])
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> [PullRequestReviewActivityType])
-> Enum PullRequestReviewActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: PullRequestReviewActivityType -> PullRequestReviewActivityType
succ :: PullRequestReviewActivityType -> PullRequestReviewActivityType
$cpred :: PullRequestReviewActivityType -> PullRequestReviewActivityType
pred :: PullRequestReviewActivityType -> PullRequestReviewActivityType
$ctoEnum :: Int -> PullRequestReviewActivityType
toEnum :: Int -> PullRequestReviewActivityType
$cfromEnum :: PullRequestReviewActivityType -> Int
fromEnum :: PullRequestReviewActivityType -> Int
$cenumFrom :: PullRequestReviewActivityType -> [PullRequestReviewActivityType]
enumFrom :: PullRequestReviewActivityType -> [PullRequestReviewActivityType]
$cenumFromThen :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> [PullRequestReviewActivityType]
enumFromThen :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> [PullRequestReviewActivityType]
$cenumFromTo :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> [PullRequestReviewActivityType]
enumFromTo :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> [PullRequestReviewActivityType]
$cenumFromThenTo :: PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> [PullRequestReviewActivityType]
enumFromThenTo :: PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> PullRequestReviewActivityType
-> [PullRequestReviewActivityType]
Enum, PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
(PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool)
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool)
-> Eq PullRequestReviewActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
== :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
$c/= :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
/= :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
Eq, (forall x.
PullRequestReviewActivityType
-> Rep PullRequestReviewActivityType x)
-> (forall x.
Rep PullRequestReviewActivityType x
-> PullRequestReviewActivityType)
-> Generic PullRequestReviewActivityType
forall x.
Rep PullRequestReviewActivityType x
-> PullRequestReviewActivityType
forall x.
PullRequestReviewActivityType
-> Rep PullRequestReviewActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
PullRequestReviewActivityType
-> Rep PullRequestReviewActivityType x
from :: forall x.
PullRequestReviewActivityType
-> Rep PullRequestReviewActivityType x
$cto :: forall x.
Rep PullRequestReviewActivityType x
-> PullRequestReviewActivityType
to :: forall x.
Rep PullRequestReviewActivityType x
-> PullRequestReviewActivityType
Generic, Eq PullRequestReviewActivityType
Eq PullRequestReviewActivityType =>
(PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Ordering)
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool)
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool)
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool)
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool)
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType -> PullRequestReviewActivityType)
-> (PullRequestReviewActivityType
-> PullRequestReviewActivityType -> PullRequestReviewActivityType)
-> Ord PullRequestReviewActivityType
PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Ordering
PullRequestReviewActivityType
-> PullRequestReviewActivityType -> PullRequestReviewActivityType
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
$ccompare :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Ordering
compare :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Ordering
$c< :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
< :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
$c<= :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
<= :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
$c> :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
> :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
$c>= :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
>= :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> Bool
$cmax :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> PullRequestReviewActivityType
max :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> PullRequestReviewActivityType
$cmin :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> PullRequestReviewActivityType
min :: PullRequestReviewActivityType
-> PullRequestReviewActivityType -> PullRequestReviewActivityType
Ord, Int -> PullRequestReviewActivityType -> ShowS
[PullRequestReviewActivityType] -> ShowS
PullRequestReviewActivityType -> String
(Int -> PullRequestReviewActivityType -> ShowS)
-> (PullRequestReviewActivityType -> String)
-> ([PullRequestReviewActivityType] -> ShowS)
-> Show PullRequestReviewActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PullRequestReviewActivityType -> ShowS
showsPrec :: Int -> PullRequestReviewActivityType -> ShowS
$cshow :: PullRequestReviewActivityType -> String
show :: PullRequestReviewActivityType -> String
$cshowList :: [PullRequestReviewActivityType] -> ShowS
showList :: [PullRequestReviewActivityType] -> ShowS
Show)
instance FromJSON PullRequestReviewActivityType where
parseJSON :: Value -> Parser PullRequestReviewActivityType
parseJSON =
String
-> (Text -> Parser PullRequestReviewActivityType)
-> Value
-> Parser PullRequestReviewActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"PullRequestReviewActivityType" ((Text -> Parser PullRequestReviewActivityType)
-> Value -> Parser PullRequestReviewActivityType)
-> (Text -> Parser PullRequestReviewActivityType)
-> Value
-> Parser PullRequestReviewActivityType
forall a b. (a -> b) -> a -> b
$
Either String PullRequestReviewActivityType
-> Parser PullRequestReviewActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String PullRequestReviewActivityType
-> Parser PullRequestReviewActivityType)
-> (Text -> Either String PullRequestReviewActivityType)
-> Text
-> Parser PullRequestReviewActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String PullRequestReviewActivityType
parsePullRequestReviewActivityType
instance ToJSON PullRequestReviewActivityType where
toJSON :: PullRequestReviewActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (PullRequestReviewActivityType -> Text)
-> PullRequestReviewActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PullRequestReviewActivityType -> Text
renderPullRequestReviewActivityType
renderPullRequestReviewActivityType :: PullRequestReviewActivityType -> Text
renderPullRequestReviewActivityType :: PullRequestReviewActivityType -> Text
renderPullRequestReviewActivityType = \case
PullRequestReviewActivityType
PullRequestReviewDismissed -> Text
"dismissed"
PullRequestReviewActivityType
PullRequestReviewEdited -> Text
"edited"
PullRequestReviewActivityType
PullRequestReviewSubmitted -> Text
"submitted"
parsePullRequestReviewActivityType :: Text -> Either String PullRequestReviewActivityType
parsePullRequestReviewActivityType :: Text -> Either String PullRequestReviewActivityType
parsePullRequestReviewActivityType Text
t =
Either String PullRequestReviewActivityType
-> (PullRequestReviewActivityType
-> Either String PullRequestReviewActivityType)
-> Maybe PullRequestReviewActivityType
-> Either String PullRequestReviewActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String PullRequestReviewActivityType
forall a b. a -> Either a b
Left [i|Unknown PullRequestReviewActivityType: #{t}|]) PullRequestReviewActivityType
-> Either String PullRequestReviewActivityType
forall a b. b -> Either a b
Right (Maybe PullRequestReviewActivityType
-> Either String PullRequestReviewActivityType)
-> Maybe PullRequestReviewActivityType
-> Either String PullRequestReviewActivityType
forall a b. (a -> b) -> a -> b
$
(PullRequestReviewActivityType -> Text)
-> Text -> Maybe PullRequestReviewActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap PullRequestReviewActivityType -> Text
renderPullRequestReviewActivityType Text
t
data
=
|
|
deriving stock (PullRequestReviewCommentActivityType
PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> Bounded PullRequestReviewCommentActivityType
forall a. a -> a -> Bounded a
$cminBound :: PullRequestReviewCommentActivityType
minBound :: PullRequestReviewCommentActivityType
$cmaxBound :: PullRequestReviewCommentActivityType
maxBound :: PullRequestReviewCommentActivityType
Bounded, Int -> PullRequestReviewCommentActivityType
PullRequestReviewCommentActivityType -> Int
PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
(PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType)
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType)
-> (Int -> PullRequestReviewCommentActivityType)
-> (PullRequestReviewCommentActivityType -> Int)
-> (PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType])
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType])
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType])
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType])
-> Enum PullRequestReviewCommentActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
succ :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
$cpred :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
pred :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
$ctoEnum :: Int -> PullRequestReviewCommentActivityType
toEnum :: Int -> PullRequestReviewCommentActivityType
$cfromEnum :: PullRequestReviewCommentActivityType -> Int
fromEnum :: PullRequestReviewCommentActivityType -> Int
$cenumFrom :: PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
enumFrom :: PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
$cenumFromThen :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
enumFromThen :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
$cenumFromTo :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
enumFromTo :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
$cenumFromThenTo :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
enumFromThenTo :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> [PullRequestReviewCommentActivityType]
Enum, PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
(PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool)
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool)
-> Eq PullRequestReviewCommentActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
== :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
$c/= :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
/= :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
Eq, (forall x.
PullRequestReviewCommentActivityType
-> Rep PullRequestReviewCommentActivityType x)
-> (forall x.
Rep PullRequestReviewCommentActivityType x
-> PullRequestReviewCommentActivityType)
-> Generic PullRequestReviewCommentActivityType
forall x.
Rep PullRequestReviewCommentActivityType x
-> PullRequestReviewCommentActivityType
forall x.
PullRequestReviewCommentActivityType
-> Rep PullRequestReviewCommentActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
PullRequestReviewCommentActivityType
-> Rep PullRequestReviewCommentActivityType x
from :: forall x.
PullRequestReviewCommentActivityType
-> Rep PullRequestReviewCommentActivityType x
$cto :: forall x.
Rep PullRequestReviewCommentActivityType x
-> PullRequestReviewCommentActivityType
to :: forall x.
Rep PullRequestReviewCommentActivityType x
-> PullRequestReviewCommentActivityType
Generic, Eq PullRequestReviewCommentActivityType
Eq PullRequestReviewCommentActivityType =>
(PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Ordering)
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool)
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool)
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool)
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool)
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType)
-> (PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType)
-> Ord PullRequestReviewCommentActivityType
PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Ordering
PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
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
$ccompare :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Ordering
compare :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Ordering
$c< :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
< :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
$c<= :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
<= :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
$c> :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
> :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
$c>= :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
>= :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType -> Bool
$cmax :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
max :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
$cmin :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
min :: PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
-> PullRequestReviewCommentActivityType
Ord, Int -> PullRequestReviewCommentActivityType -> ShowS
[PullRequestReviewCommentActivityType] -> ShowS
PullRequestReviewCommentActivityType -> String
(Int -> PullRequestReviewCommentActivityType -> ShowS)
-> (PullRequestReviewCommentActivityType -> String)
-> ([PullRequestReviewCommentActivityType] -> ShowS)
-> Show PullRequestReviewCommentActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PullRequestReviewCommentActivityType -> ShowS
showsPrec :: Int -> PullRequestReviewCommentActivityType -> ShowS
$cshow :: PullRequestReviewCommentActivityType -> String
show :: PullRequestReviewCommentActivityType -> String
$cshowList :: [PullRequestReviewCommentActivityType] -> ShowS
showList :: [PullRequestReviewCommentActivityType] -> ShowS
Show)
instance FromJSON PullRequestReviewCommentActivityType where
parseJSON :: Value -> Parser PullRequestReviewCommentActivityType
parseJSON =
String
-> (Text -> Parser PullRequestReviewCommentActivityType)
-> Value
-> Parser PullRequestReviewCommentActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"PullRequestReviewCommentActivityType" ((Text -> Parser PullRequestReviewCommentActivityType)
-> Value -> Parser PullRequestReviewCommentActivityType)
-> (Text -> Parser PullRequestReviewCommentActivityType)
-> Value
-> Parser PullRequestReviewCommentActivityType
forall a b. (a -> b) -> a -> b
$
Either String PullRequestReviewCommentActivityType
-> Parser PullRequestReviewCommentActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String PullRequestReviewCommentActivityType
-> Parser PullRequestReviewCommentActivityType)
-> (Text -> Either String PullRequestReviewCommentActivityType)
-> Text
-> Parser PullRequestReviewCommentActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String PullRequestReviewCommentActivityType
parsePullRequestReviewCommentActivityType
instance ToJSON PullRequestReviewCommentActivityType where
toJSON :: PullRequestReviewCommentActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (PullRequestReviewCommentActivityType -> Text)
-> PullRequestReviewCommentActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PullRequestReviewCommentActivityType -> Text
renderPullRequestReviewCommentActivityType
renderPullRequestReviewCommentActivityType :: PullRequestReviewCommentActivityType -> Text
= \case
PullRequestReviewCommentActivityType
PullRequestReviewCommentCreated -> Text
"created"
PullRequestReviewCommentActivityType
PullRequestReviewCommentDeleted -> Text
"deleted"
PullRequestReviewCommentActivityType
PullRequestReviewCommentEdited -> Text
"edited"
parsePullRequestReviewCommentActivityType :: Text -> Either String PullRequestReviewCommentActivityType
Text
t =
Either String PullRequestReviewCommentActivityType
-> (PullRequestReviewCommentActivityType
-> Either String PullRequestReviewCommentActivityType)
-> Maybe PullRequestReviewCommentActivityType
-> Either String PullRequestReviewCommentActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String PullRequestReviewCommentActivityType
forall a b. a -> Either a b
Left [i|Unknown PullRequestReviewCommentActivityType: #{t}|]) PullRequestReviewCommentActivityType
-> Either String PullRequestReviewCommentActivityType
forall a b. b -> Either a b
Right (Maybe PullRequestReviewCommentActivityType
-> Either String PullRequestReviewCommentActivityType)
-> Maybe PullRequestReviewCommentActivityType
-> Either String PullRequestReviewCommentActivityType
forall a b. (a -> b) -> a -> b
$
(PullRequestReviewCommentActivityType -> Text)
-> Text -> Maybe PullRequestReviewCommentActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap PullRequestReviewCommentActivityType -> Text
renderPullRequestReviewCommentActivityType Text
t
data PullRequestTargetActivityType
= PullRequestTargetAssigned
| PullRequestTargetAutoMergeDisabled
| PullRequestTargetAutoMergeEnabled
| PullRequestTargetClosed
| PullRequestTargetConvertedToDraft
| PullRequestTargetEdited
| PullRequestTargetLabeled
| PullRequestTargetLocked
| PullRequestTargetOpened
| PullRequestTargetReadyForReview
| PullRequestTargetReopened
| PullRequestTargetReviewRequestRemoved
| PullRequestTargetReviewRequested
| PullRequestTargetSynchronize
| PullRequestTargetUnassigned
| PullRequestTargetUnlabeled
| PullRequestTargetUnlocked
deriving stock (PullRequestTargetActivityType
PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> Bounded PullRequestTargetActivityType
forall a. a -> a -> Bounded a
$cminBound :: PullRequestTargetActivityType
minBound :: PullRequestTargetActivityType
$cmaxBound :: PullRequestTargetActivityType
maxBound :: PullRequestTargetActivityType
Bounded, Int -> PullRequestTargetActivityType
PullRequestTargetActivityType -> Int
PullRequestTargetActivityType -> [PullRequestTargetActivityType]
PullRequestTargetActivityType -> PullRequestTargetActivityType
PullRequestTargetActivityType
-> PullRequestTargetActivityType -> [PullRequestTargetActivityType]
PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> [PullRequestTargetActivityType]
(PullRequestTargetActivityType -> PullRequestTargetActivityType)
-> (PullRequestTargetActivityType -> PullRequestTargetActivityType)
-> (Int -> PullRequestTargetActivityType)
-> (PullRequestTargetActivityType -> Int)
-> (PullRequestTargetActivityType
-> [PullRequestTargetActivityType])
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> [PullRequestTargetActivityType])
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> [PullRequestTargetActivityType])
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> [PullRequestTargetActivityType])
-> Enum PullRequestTargetActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: PullRequestTargetActivityType -> PullRequestTargetActivityType
succ :: PullRequestTargetActivityType -> PullRequestTargetActivityType
$cpred :: PullRequestTargetActivityType -> PullRequestTargetActivityType
pred :: PullRequestTargetActivityType -> PullRequestTargetActivityType
$ctoEnum :: Int -> PullRequestTargetActivityType
toEnum :: Int -> PullRequestTargetActivityType
$cfromEnum :: PullRequestTargetActivityType -> Int
fromEnum :: PullRequestTargetActivityType -> Int
$cenumFrom :: PullRequestTargetActivityType -> [PullRequestTargetActivityType]
enumFrom :: PullRequestTargetActivityType -> [PullRequestTargetActivityType]
$cenumFromThen :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> [PullRequestTargetActivityType]
enumFromThen :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> [PullRequestTargetActivityType]
$cenumFromTo :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> [PullRequestTargetActivityType]
enumFromTo :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> [PullRequestTargetActivityType]
$cenumFromThenTo :: PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> [PullRequestTargetActivityType]
enumFromThenTo :: PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> PullRequestTargetActivityType
-> [PullRequestTargetActivityType]
Enum, PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
(PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool)
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool)
-> Eq PullRequestTargetActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
== :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
$c/= :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
/= :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
Eq, (forall x.
PullRequestTargetActivityType
-> Rep PullRequestTargetActivityType x)
-> (forall x.
Rep PullRequestTargetActivityType x
-> PullRequestTargetActivityType)
-> Generic PullRequestTargetActivityType
forall x.
Rep PullRequestTargetActivityType x
-> PullRequestTargetActivityType
forall x.
PullRequestTargetActivityType
-> Rep PullRequestTargetActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
PullRequestTargetActivityType
-> Rep PullRequestTargetActivityType x
from :: forall x.
PullRequestTargetActivityType
-> Rep PullRequestTargetActivityType x
$cto :: forall x.
Rep PullRequestTargetActivityType x
-> PullRequestTargetActivityType
to :: forall x.
Rep PullRequestTargetActivityType x
-> PullRequestTargetActivityType
Generic, Eq PullRequestTargetActivityType
Eq PullRequestTargetActivityType =>
(PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Ordering)
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool)
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool)
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool)
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool)
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType -> PullRequestTargetActivityType)
-> (PullRequestTargetActivityType
-> PullRequestTargetActivityType -> PullRequestTargetActivityType)
-> Ord PullRequestTargetActivityType
PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Ordering
PullRequestTargetActivityType
-> PullRequestTargetActivityType -> PullRequestTargetActivityType
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
$ccompare :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Ordering
compare :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Ordering
$c< :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
< :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
$c<= :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
<= :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
$c> :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
> :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
$c>= :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
>= :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> Bool
$cmax :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> PullRequestTargetActivityType
max :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> PullRequestTargetActivityType
$cmin :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> PullRequestTargetActivityType
min :: PullRequestTargetActivityType
-> PullRequestTargetActivityType -> PullRequestTargetActivityType
Ord, Int -> PullRequestTargetActivityType -> ShowS
[PullRequestTargetActivityType] -> ShowS
PullRequestTargetActivityType -> String
(Int -> PullRequestTargetActivityType -> ShowS)
-> (PullRequestTargetActivityType -> String)
-> ([PullRequestTargetActivityType] -> ShowS)
-> Show PullRequestTargetActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PullRequestTargetActivityType -> ShowS
showsPrec :: Int -> PullRequestTargetActivityType -> ShowS
$cshow :: PullRequestTargetActivityType -> String
show :: PullRequestTargetActivityType -> String
$cshowList :: [PullRequestTargetActivityType] -> ShowS
showList :: [PullRequestTargetActivityType] -> ShowS
Show)
instance FromJSON PullRequestTargetActivityType where
parseJSON :: Value -> Parser PullRequestTargetActivityType
parseJSON =
String
-> (Text -> Parser PullRequestTargetActivityType)
-> Value
-> Parser PullRequestTargetActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"PullRequestTargetActivityType" ((Text -> Parser PullRequestTargetActivityType)
-> Value -> Parser PullRequestTargetActivityType)
-> (Text -> Parser PullRequestTargetActivityType)
-> Value
-> Parser PullRequestTargetActivityType
forall a b. (a -> b) -> a -> b
$
Either String PullRequestTargetActivityType
-> Parser PullRequestTargetActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String PullRequestTargetActivityType
-> Parser PullRequestTargetActivityType)
-> (Text -> Either String PullRequestTargetActivityType)
-> Text
-> Parser PullRequestTargetActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String PullRequestTargetActivityType
parsePullRequestTargetActivityType
instance ToJSON PullRequestTargetActivityType where
toJSON :: PullRequestTargetActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (PullRequestTargetActivityType -> Text)
-> PullRequestTargetActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PullRequestTargetActivityType -> Text
renderPullRequestTargetActivityType
renderPullRequestTargetActivityType :: PullRequestTargetActivityType -> Text
renderPullRequestTargetActivityType :: PullRequestTargetActivityType -> Text
renderPullRequestTargetActivityType = \case
PullRequestTargetActivityType
PullRequestTargetAssigned -> Text
"assigned"
PullRequestTargetActivityType
PullRequestTargetAutoMergeDisabled -> Text
"auto_merge_disabled"
PullRequestTargetActivityType
PullRequestTargetAutoMergeEnabled -> Text
"auto_merge_enabled"
PullRequestTargetActivityType
PullRequestTargetClosed -> Text
"closed"
PullRequestTargetActivityType
PullRequestTargetConvertedToDraft -> Text
"converted_to_draft"
PullRequestTargetActivityType
PullRequestTargetEdited -> Text
"edited"
PullRequestTargetActivityType
PullRequestTargetLabeled -> Text
"labeled"
PullRequestTargetActivityType
PullRequestTargetLocked -> Text
"locked"
PullRequestTargetActivityType
PullRequestTargetOpened -> Text
"opened"
PullRequestTargetActivityType
PullRequestTargetReadyForReview -> Text
"ready_for_review"
PullRequestTargetActivityType
PullRequestTargetReopened -> Text
"reopened"
PullRequestTargetActivityType
PullRequestTargetReviewRequestRemoved -> Text
"review_request_removed"
PullRequestTargetActivityType
PullRequestTargetReviewRequested -> Text
"review_requested"
PullRequestTargetActivityType
PullRequestTargetSynchronize -> Text
"synchronize"
PullRequestTargetActivityType
PullRequestTargetUnassigned -> Text
"unassigned"
PullRequestTargetActivityType
PullRequestTargetUnlabeled -> Text
"unlabeled"
PullRequestTargetActivityType
PullRequestTargetUnlocked -> Text
"unlocked"
parsePullRequestTargetActivityType :: Text -> Either String PullRequestTargetActivityType
parsePullRequestTargetActivityType :: Text -> Either String PullRequestTargetActivityType
parsePullRequestTargetActivityType Text
t =
Either String PullRequestTargetActivityType
-> (PullRequestTargetActivityType
-> Either String PullRequestTargetActivityType)
-> Maybe PullRequestTargetActivityType
-> Either String PullRequestTargetActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String PullRequestTargetActivityType
forall a b. a -> Either a b
Left [i|Unknown PullRequestTargetActivityType: #{t}|]) PullRequestTargetActivityType
-> Either String PullRequestTargetActivityType
forall a b. b -> Either a b
Right (Maybe PullRequestTargetActivityType
-> Either String PullRequestTargetActivityType)
-> Maybe PullRequestTargetActivityType
-> Either String PullRequestTargetActivityType
forall a b. (a -> b) -> a -> b
$
(PullRequestTargetActivityType -> Text)
-> Text -> Maybe PullRequestTargetActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap PullRequestTargetActivityType -> Text
renderPullRequestTargetActivityType Text
t
data PullRequestTargetTriggerAttributes = PullRequestTargetTriggerAttributes
{ PullRequestTargetTriggerAttributes
-> Maybe (NonEmpty PullRequestTargetActivityType)
activityTypes :: Maybe (NonEmpty PullRequestTargetActivityType),
PullRequestTargetTriggerAttributes -> Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text),
PullRequestTargetTriggerAttributes -> Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text),
PullRequestTargetTriggerAttributes -> Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text),
PullRequestTargetTriggerAttributes -> Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
}
deriving stock (PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
(PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool)
-> (PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool)
-> Eq PullRequestTargetTriggerAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
== :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
$c/= :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
/= :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
Eq, (forall x.
PullRequestTargetTriggerAttributes
-> Rep PullRequestTargetTriggerAttributes x)
-> (forall x.
Rep PullRequestTargetTriggerAttributes x
-> PullRequestTargetTriggerAttributes)
-> Generic PullRequestTargetTriggerAttributes
forall x.
Rep PullRequestTargetTriggerAttributes x
-> PullRequestTargetTriggerAttributes
forall x.
PullRequestTargetTriggerAttributes
-> Rep PullRequestTargetTriggerAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
PullRequestTargetTriggerAttributes
-> Rep PullRequestTargetTriggerAttributes x
from :: forall x.
PullRequestTargetTriggerAttributes
-> Rep PullRequestTargetTriggerAttributes x
$cto :: forall x.
Rep PullRequestTargetTriggerAttributes x
-> PullRequestTargetTriggerAttributes
to :: forall x.
Rep PullRequestTargetTriggerAttributes x
-> PullRequestTargetTriggerAttributes
Generic, Eq PullRequestTargetTriggerAttributes
Eq PullRequestTargetTriggerAttributes =>
(PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Ordering)
-> (PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool)
-> (PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool)
-> (PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool)
-> (PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool)
-> (PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes)
-> (PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes)
-> Ord PullRequestTargetTriggerAttributes
PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Ordering
PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
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
$ccompare :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Ordering
compare :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Ordering
$c< :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
< :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
$c<= :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
<= :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
$c> :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
> :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
$c>= :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
>= :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes -> Bool
$cmax :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
max :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
$cmin :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
min :: PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
-> PullRequestTargetTriggerAttributes
Ord, Int -> PullRequestTargetTriggerAttributes -> ShowS
[PullRequestTargetTriggerAttributes] -> ShowS
PullRequestTargetTriggerAttributes -> String
(Int -> PullRequestTargetTriggerAttributes -> ShowS)
-> (PullRequestTargetTriggerAttributes -> String)
-> ([PullRequestTargetTriggerAttributes] -> ShowS)
-> Show PullRequestTargetTriggerAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PullRequestTargetTriggerAttributes -> ShowS
showsPrec :: Int -> PullRequestTargetTriggerAttributes -> ShowS
$cshow :: PullRequestTargetTriggerAttributes -> String
show :: PullRequestTargetTriggerAttributes -> String
$cshowList :: [PullRequestTargetTriggerAttributes] -> ShowS
showList :: [PullRequestTargetTriggerAttributes] -> ShowS
Show)
instance FromJSON PullRequestTargetTriggerAttributes where
parseJSON :: Value -> Parser PullRequestTargetTriggerAttributes
parseJSON = String
-> (Object -> Parser PullRequestTargetTriggerAttributes)
-> Value
-> Parser PullRequestTargetTriggerAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"PullRequestTargetTriggerAttributes" ((Object -> Parser PullRequestTargetTriggerAttributes)
-> Value -> Parser PullRequestTargetTriggerAttributes)
-> (Object -> Parser PullRequestTargetTriggerAttributes)
-> Value
-> Parser PullRequestTargetTriggerAttributes
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe (NonEmpty PullRequestTargetActivityType)
activityTypes <- Object
o Object
-> Key -> Parser (Maybe (NonEmpty PullRequestTargetActivityType))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"types"
Maybe (NonEmpty Text)
branches <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"branches"
Maybe (NonEmpty Text)
branchesIgnore <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"branches-ignore"
Maybe (NonEmpty Text)
paths <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"paths"
Maybe (NonEmpty Text)
pathsIgnore <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"paths-ignore"
PullRequestTargetTriggerAttributes
-> Parser PullRequestTargetTriggerAttributes
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PullRequestTargetTriggerAttributes {Maybe (NonEmpty Text)
Maybe (NonEmpty PullRequestTargetActivityType)
activityTypes :: Maybe (NonEmpty PullRequestTargetActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
activityTypes :: Maybe (NonEmpty PullRequestTargetActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
..}
instance ToJSON PullRequestTargetTriggerAttributes where
toJSON :: PullRequestTargetTriggerAttributes -> Value
toJSON PullRequestTargetTriggerAttributes {Maybe (NonEmpty Text)
Maybe (NonEmpty PullRequestTargetActivityType)
activityTypes :: PullRequestTargetTriggerAttributes
-> Maybe (NonEmpty PullRequestTargetActivityType)
branches :: PullRequestTargetTriggerAttributes -> Maybe (NonEmpty Text)
branchesIgnore :: PullRequestTargetTriggerAttributes -> Maybe (NonEmpty Text)
paths :: PullRequestTargetTriggerAttributes -> Maybe (NonEmpty Text)
pathsIgnore :: PullRequestTargetTriggerAttributes -> Maybe (NonEmpty Text)
activityTypes :: Maybe (NonEmpty PullRequestTargetActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ (Key
"branches" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
branches,
(Key
"branches-ignore" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
branchesIgnore,
(Key
"paths" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
paths,
(Key
"paths-ignore" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
pathsIgnore,
(Key
"types" Key -> NonEmpty PullRequestTargetActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty PullRequestTargetActivityType -> Pair)
-> Maybe (NonEmpty PullRequestTargetActivityType) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty PullRequestTargetActivityType)
activityTypes
]
data PushTriggerAttributes = PushTriggerAttributes
{
PushTriggerAttributes -> Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text),
PushTriggerAttributes -> Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text),
PushTriggerAttributes -> Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text),
PushTriggerAttributes -> Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text),
PushTriggerAttributes -> Maybe (NonEmpty Text)
tags :: Maybe (NonEmpty Text)
}
deriving stock (PushTriggerAttributes -> PushTriggerAttributes -> Bool
(PushTriggerAttributes -> PushTriggerAttributes -> Bool)
-> (PushTriggerAttributes -> PushTriggerAttributes -> Bool)
-> Eq PushTriggerAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
== :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
$c/= :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
/= :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
Eq, (forall x. PushTriggerAttributes -> Rep PushTriggerAttributes x)
-> (forall x. Rep PushTriggerAttributes x -> PushTriggerAttributes)
-> Generic PushTriggerAttributes
forall x. Rep PushTriggerAttributes x -> PushTriggerAttributes
forall x. PushTriggerAttributes -> Rep PushTriggerAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. PushTriggerAttributes -> Rep PushTriggerAttributes x
from :: forall x. PushTriggerAttributes -> Rep PushTriggerAttributes x
$cto :: forall x. Rep PushTriggerAttributes x -> PushTriggerAttributes
to :: forall x. Rep PushTriggerAttributes x -> PushTriggerAttributes
Generic, Eq PushTriggerAttributes
Eq PushTriggerAttributes =>
(PushTriggerAttributes -> PushTriggerAttributes -> Ordering)
-> (PushTriggerAttributes -> PushTriggerAttributes -> Bool)
-> (PushTriggerAttributes -> PushTriggerAttributes -> Bool)
-> (PushTriggerAttributes -> PushTriggerAttributes -> Bool)
-> (PushTriggerAttributes -> PushTriggerAttributes -> Bool)
-> (PushTriggerAttributes
-> PushTriggerAttributes -> PushTriggerAttributes)
-> (PushTriggerAttributes
-> PushTriggerAttributes -> PushTriggerAttributes)
-> Ord PushTriggerAttributes
PushTriggerAttributes -> PushTriggerAttributes -> Bool
PushTriggerAttributes -> PushTriggerAttributes -> Ordering
PushTriggerAttributes
-> PushTriggerAttributes -> PushTriggerAttributes
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
$ccompare :: PushTriggerAttributes -> PushTriggerAttributes -> Ordering
compare :: PushTriggerAttributes -> PushTriggerAttributes -> Ordering
$c< :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
< :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
$c<= :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
<= :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
$c> :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
> :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
$c>= :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
>= :: PushTriggerAttributes -> PushTriggerAttributes -> Bool
$cmax :: PushTriggerAttributes
-> PushTriggerAttributes -> PushTriggerAttributes
max :: PushTriggerAttributes
-> PushTriggerAttributes -> PushTriggerAttributes
$cmin :: PushTriggerAttributes
-> PushTriggerAttributes -> PushTriggerAttributes
min :: PushTriggerAttributes
-> PushTriggerAttributes -> PushTriggerAttributes
Ord, Int -> PushTriggerAttributes -> ShowS
[PushTriggerAttributes] -> ShowS
PushTriggerAttributes -> String
(Int -> PushTriggerAttributes -> ShowS)
-> (PushTriggerAttributes -> String)
-> ([PushTriggerAttributes] -> ShowS)
-> Show PushTriggerAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> PushTriggerAttributes -> ShowS
showsPrec :: Int -> PushTriggerAttributes -> ShowS
$cshow :: PushTriggerAttributes -> String
show :: PushTriggerAttributes -> String
$cshowList :: [PushTriggerAttributes] -> ShowS
showList :: [PushTriggerAttributes] -> ShowS
Show)
instance FromJSON PushTriggerAttributes where
parseJSON :: Value -> Parser PushTriggerAttributes
parseJSON = String
-> (Object -> Parser PushTriggerAttributes)
-> Value
-> Parser PushTriggerAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"PushTriggerAttributes" ((Object -> Parser PushTriggerAttributes)
-> Value -> Parser PushTriggerAttributes)
-> (Object -> Parser PushTriggerAttributes)
-> Value
-> Parser PushTriggerAttributes
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe (NonEmpty Text)
branches <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"branches"
Maybe (NonEmpty Text)
branchesIgnore <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"branches-ignore"
Maybe (NonEmpty Text)
paths <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"paths"
Maybe (NonEmpty Text)
pathsIgnore <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"paths-ignore"
Maybe (NonEmpty Text)
tags <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"tags"
PushTriggerAttributes -> Parser PushTriggerAttributes
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PushTriggerAttributes {Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
tags :: Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
tags :: Maybe (NonEmpty Text)
..}
instance ToJSON PushTriggerAttributes where
toJSON :: PushTriggerAttributes -> Value
toJSON PushTriggerAttributes {Maybe (NonEmpty Text)
branches :: PushTriggerAttributes -> Maybe (NonEmpty Text)
branchesIgnore :: PushTriggerAttributes -> Maybe (NonEmpty Text)
paths :: PushTriggerAttributes -> Maybe (NonEmpty Text)
pathsIgnore :: PushTriggerAttributes -> Maybe (NonEmpty Text)
tags :: PushTriggerAttributes -> Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
tags :: Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ (Key
"branches" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
branches,
(Key
"branches-ignore" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
branchesIgnore,
(Key
"paths" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
paths,
(Key
"paths-ignore" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
pathsIgnore,
(Key
"tags" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
tags
]
data RegistryPackageActivityType
= RegistryPackagePublished
| RegistryPackageUpdated
deriving stock (RegistryPackageActivityType
RegistryPackageActivityType
-> RegistryPackageActivityType
-> Bounded RegistryPackageActivityType
forall a. a -> a -> Bounded a
$cminBound :: RegistryPackageActivityType
minBound :: RegistryPackageActivityType
$cmaxBound :: RegistryPackageActivityType
maxBound :: RegistryPackageActivityType
Bounded, Int -> RegistryPackageActivityType
RegistryPackageActivityType -> Int
RegistryPackageActivityType -> [RegistryPackageActivityType]
RegistryPackageActivityType -> RegistryPackageActivityType
RegistryPackageActivityType
-> RegistryPackageActivityType -> [RegistryPackageActivityType]
RegistryPackageActivityType
-> RegistryPackageActivityType
-> RegistryPackageActivityType
-> [RegistryPackageActivityType]
(RegistryPackageActivityType -> RegistryPackageActivityType)
-> (RegistryPackageActivityType -> RegistryPackageActivityType)
-> (Int -> RegistryPackageActivityType)
-> (RegistryPackageActivityType -> Int)
-> (RegistryPackageActivityType -> [RegistryPackageActivityType])
-> (RegistryPackageActivityType
-> RegistryPackageActivityType -> [RegistryPackageActivityType])
-> (RegistryPackageActivityType
-> RegistryPackageActivityType -> [RegistryPackageActivityType])
-> (RegistryPackageActivityType
-> RegistryPackageActivityType
-> RegistryPackageActivityType
-> [RegistryPackageActivityType])
-> Enum RegistryPackageActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: RegistryPackageActivityType -> RegistryPackageActivityType
succ :: RegistryPackageActivityType -> RegistryPackageActivityType
$cpred :: RegistryPackageActivityType -> RegistryPackageActivityType
pred :: RegistryPackageActivityType -> RegistryPackageActivityType
$ctoEnum :: Int -> RegistryPackageActivityType
toEnum :: Int -> RegistryPackageActivityType
$cfromEnum :: RegistryPackageActivityType -> Int
fromEnum :: RegistryPackageActivityType -> Int
$cenumFrom :: RegistryPackageActivityType -> [RegistryPackageActivityType]
enumFrom :: RegistryPackageActivityType -> [RegistryPackageActivityType]
$cenumFromThen :: RegistryPackageActivityType
-> RegistryPackageActivityType -> [RegistryPackageActivityType]
enumFromThen :: RegistryPackageActivityType
-> RegistryPackageActivityType -> [RegistryPackageActivityType]
$cenumFromTo :: RegistryPackageActivityType
-> RegistryPackageActivityType -> [RegistryPackageActivityType]
enumFromTo :: RegistryPackageActivityType
-> RegistryPackageActivityType -> [RegistryPackageActivityType]
$cenumFromThenTo :: RegistryPackageActivityType
-> RegistryPackageActivityType
-> RegistryPackageActivityType
-> [RegistryPackageActivityType]
enumFromThenTo :: RegistryPackageActivityType
-> RegistryPackageActivityType
-> RegistryPackageActivityType
-> [RegistryPackageActivityType]
Enum, RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
(RegistryPackageActivityType
-> RegistryPackageActivityType -> Bool)
-> (RegistryPackageActivityType
-> RegistryPackageActivityType -> Bool)
-> Eq RegistryPackageActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
== :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
$c/= :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
/= :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
Eq, (forall x.
RegistryPackageActivityType -> Rep RegistryPackageActivityType x)
-> (forall x.
Rep RegistryPackageActivityType x -> RegistryPackageActivityType)
-> Generic RegistryPackageActivityType
forall x.
Rep RegistryPackageActivityType x -> RegistryPackageActivityType
forall x.
RegistryPackageActivityType -> Rep RegistryPackageActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
RegistryPackageActivityType -> Rep RegistryPackageActivityType x
from :: forall x.
RegistryPackageActivityType -> Rep RegistryPackageActivityType x
$cto :: forall x.
Rep RegistryPackageActivityType x -> RegistryPackageActivityType
to :: forall x.
Rep RegistryPackageActivityType x -> RegistryPackageActivityType
Generic, Eq RegistryPackageActivityType
Eq RegistryPackageActivityType =>
(RegistryPackageActivityType
-> RegistryPackageActivityType -> Ordering)
-> (RegistryPackageActivityType
-> RegistryPackageActivityType -> Bool)
-> (RegistryPackageActivityType
-> RegistryPackageActivityType -> Bool)
-> (RegistryPackageActivityType
-> RegistryPackageActivityType -> Bool)
-> (RegistryPackageActivityType
-> RegistryPackageActivityType -> Bool)
-> (RegistryPackageActivityType
-> RegistryPackageActivityType -> RegistryPackageActivityType)
-> (RegistryPackageActivityType
-> RegistryPackageActivityType -> RegistryPackageActivityType)
-> Ord RegistryPackageActivityType
RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
RegistryPackageActivityType
-> RegistryPackageActivityType -> Ordering
RegistryPackageActivityType
-> RegistryPackageActivityType -> RegistryPackageActivityType
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
$ccompare :: RegistryPackageActivityType
-> RegistryPackageActivityType -> Ordering
compare :: RegistryPackageActivityType
-> RegistryPackageActivityType -> Ordering
$c< :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
< :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
$c<= :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
<= :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
$c> :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
> :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
$c>= :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
>= :: RegistryPackageActivityType -> RegistryPackageActivityType -> Bool
$cmax :: RegistryPackageActivityType
-> RegistryPackageActivityType -> RegistryPackageActivityType
max :: RegistryPackageActivityType
-> RegistryPackageActivityType -> RegistryPackageActivityType
$cmin :: RegistryPackageActivityType
-> RegistryPackageActivityType -> RegistryPackageActivityType
min :: RegistryPackageActivityType
-> RegistryPackageActivityType -> RegistryPackageActivityType
Ord, Int -> RegistryPackageActivityType -> ShowS
[RegistryPackageActivityType] -> ShowS
RegistryPackageActivityType -> String
(Int -> RegistryPackageActivityType -> ShowS)
-> (RegistryPackageActivityType -> String)
-> ([RegistryPackageActivityType] -> ShowS)
-> Show RegistryPackageActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RegistryPackageActivityType -> ShowS
showsPrec :: Int -> RegistryPackageActivityType -> ShowS
$cshow :: RegistryPackageActivityType -> String
show :: RegistryPackageActivityType -> String
$cshowList :: [RegistryPackageActivityType] -> ShowS
showList :: [RegistryPackageActivityType] -> ShowS
Show)
instance FromJSON RegistryPackageActivityType where
parseJSON :: Value -> Parser RegistryPackageActivityType
parseJSON =
String
-> (Text -> Parser RegistryPackageActivityType)
-> Value
-> Parser RegistryPackageActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"RegistryPackageActivityType" ((Text -> Parser RegistryPackageActivityType)
-> Value -> Parser RegistryPackageActivityType)
-> (Text -> Parser RegistryPackageActivityType)
-> Value
-> Parser RegistryPackageActivityType
forall a b. (a -> b) -> a -> b
$
Either String RegistryPackageActivityType
-> Parser RegistryPackageActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String RegistryPackageActivityType
-> Parser RegistryPackageActivityType)
-> (Text -> Either String RegistryPackageActivityType)
-> Text
-> Parser RegistryPackageActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String RegistryPackageActivityType
parseRegistryPackageActivityType
instance ToJSON RegistryPackageActivityType where
toJSON :: RegistryPackageActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (RegistryPackageActivityType -> Text)
-> RegistryPackageActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. RegistryPackageActivityType -> Text
renderRegistryPackageActivityType
renderRegistryPackageActivityType :: RegistryPackageActivityType -> Text
renderRegistryPackageActivityType :: RegistryPackageActivityType -> Text
renderRegistryPackageActivityType = \case
RegistryPackageActivityType
RegistryPackagePublished -> Text
"published"
RegistryPackageActivityType
RegistryPackageUpdated -> Text
"updated"
parseRegistryPackageActivityType :: Text -> Either String RegistryPackageActivityType
parseRegistryPackageActivityType :: Text -> Either String RegistryPackageActivityType
parseRegistryPackageActivityType Text
t =
Either String RegistryPackageActivityType
-> (RegistryPackageActivityType
-> Either String RegistryPackageActivityType)
-> Maybe RegistryPackageActivityType
-> Either String RegistryPackageActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String RegistryPackageActivityType
forall a b. a -> Either a b
Left [i|Unknown RegistryPackageActivityType: #{t}|]) RegistryPackageActivityType
-> Either String RegistryPackageActivityType
forall a b. b -> Either a b
Right (Maybe RegistryPackageActivityType
-> Either String RegistryPackageActivityType)
-> Maybe RegistryPackageActivityType
-> Either String RegistryPackageActivityType
forall a b. (a -> b) -> a -> b
$
(RegistryPackageActivityType -> Text)
-> Text -> Maybe RegistryPackageActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap RegistryPackageActivityType -> Text
renderRegistryPackageActivityType Text
t
data ReleaseActivityType
= ReleaseCreated
| ReleaseDeleted
| ReleaseEdited
| ReleasePrereleased
| ReleasePublished
| ReleaseReleased
| ReleaseUnpublished
deriving stock (ReleaseActivityType
ReleaseActivityType
-> ReleaseActivityType -> Bounded ReleaseActivityType
forall a. a -> a -> Bounded a
$cminBound :: ReleaseActivityType
minBound :: ReleaseActivityType
$cmaxBound :: ReleaseActivityType
maxBound :: ReleaseActivityType
Bounded, Int -> ReleaseActivityType
ReleaseActivityType -> Int
ReleaseActivityType -> [ReleaseActivityType]
ReleaseActivityType -> ReleaseActivityType
ReleaseActivityType -> ReleaseActivityType -> [ReleaseActivityType]
ReleaseActivityType
-> ReleaseActivityType
-> ReleaseActivityType
-> [ReleaseActivityType]
(ReleaseActivityType -> ReleaseActivityType)
-> (ReleaseActivityType -> ReleaseActivityType)
-> (Int -> ReleaseActivityType)
-> (ReleaseActivityType -> Int)
-> (ReleaseActivityType -> [ReleaseActivityType])
-> (ReleaseActivityType
-> ReleaseActivityType -> [ReleaseActivityType])
-> (ReleaseActivityType
-> ReleaseActivityType -> [ReleaseActivityType])
-> (ReleaseActivityType
-> ReleaseActivityType
-> ReleaseActivityType
-> [ReleaseActivityType])
-> Enum ReleaseActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ReleaseActivityType -> ReleaseActivityType
succ :: ReleaseActivityType -> ReleaseActivityType
$cpred :: ReleaseActivityType -> ReleaseActivityType
pred :: ReleaseActivityType -> ReleaseActivityType
$ctoEnum :: Int -> ReleaseActivityType
toEnum :: Int -> ReleaseActivityType
$cfromEnum :: ReleaseActivityType -> Int
fromEnum :: ReleaseActivityType -> Int
$cenumFrom :: ReleaseActivityType -> [ReleaseActivityType]
enumFrom :: ReleaseActivityType -> [ReleaseActivityType]
$cenumFromThen :: ReleaseActivityType -> ReleaseActivityType -> [ReleaseActivityType]
enumFromThen :: ReleaseActivityType -> ReleaseActivityType -> [ReleaseActivityType]
$cenumFromTo :: ReleaseActivityType -> ReleaseActivityType -> [ReleaseActivityType]
enumFromTo :: ReleaseActivityType -> ReleaseActivityType -> [ReleaseActivityType]
$cenumFromThenTo :: ReleaseActivityType
-> ReleaseActivityType
-> ReleaseActivityType
-> [ReleaseActivityType]
enumFromThenTo :: ReleaseActivityType
-> ReleaseActivityType
-> ReleaseActivityType
-> [ReleaseActivityType]
Enum, ReleaseActivityType -> ReleaseActivityType -> Bool
(ReleaseActivityType -> ReleaseActivityType -> Bool)
-> (ReleaseActivityType -> ReleaseActivityType -> Bool)
-> Eq ReleaseActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ReleaseActivityType -> ReleaseActivityType -> Bool
== :: ReleaseActivityType -> ReleaseActivityType -> Bool
$c/= :: ReleaseActivityType -> ReleaseActivityType -> Bool
/= :: ReleaseActivityType -> ReleaseActivityType -> Bool
Eq, (forall x. ReleaseActivityType -> Rep ReleaseActivityType x)
-> (forall x. Rep ReleaseActivityType x -> ReleaseActivityType)
-> Generic ReleaseActivityType
forall x. Rep ReleaseActivityType x -> ReleaseActivityType
forall x. ReleaseActivityType -> Rep ReleaseActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ReleaseActivityType -> Rep ReleaseActivityType x
from :: forall x. ReleaseActivityType -> Rep ReleaseActivityType x
$cto :: forall x. Rep ReleaseActivityType x -> ReleaseActivityType
to :: forall x. Rep ReleaseActivityType x -> ReleaseActivityType
Generic, Eq ReleaseActivityType
Eq ReleaseActivityType =>
(ReleaseActivityType -> ReleaseActivityType -> Ordering)
-> (ReleaseActivityType -> ReleaseActivityType -> Bool)
-> (ReleaseActivityType -> ReleaseActivityType -> Bool)
-> (ReleaseActivityType -> ReleaseActivityType -> Bool)
-> (ReleaseActivityType -> ReleaseActivityType -> Bool)
-> (ReleaseActivityType
-> ReleaseActivityType -> ReleaseActivityType)
-> (ReleaseActivityType
-> ReleaseActivityType -> ReleaseActivityType)
-> Ord ReleaseActivityType
ReleaseActivityType -> ReleaseActivityType -> Bool
ReleaseActivityType -> ReleaseActivityType -> Ordering
ReleaseActivityType -> ReleaseActivityType -> ReleaseActivityType
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
$ccompare :: ReleaseActivityType -> ReleaseActivityType -> Ordering
compare :: ReleaseActivityType -> ReleaseActivityType -> Ordering
$c< :: ReleaseActivityType -> ReleaseActivityType -> Bool
< :: ReleaseActivityType -> ReleaseActivityType -> Bool
$c<= :: ReleaseActivityType -> ReleaseActivityType -> Bool
<= :: ReleaseActivityType -> ReleaseActivityType -> Bool
$c> :: ReleaseActivityType -> ReleaseActivityType -> Bool
> :: ReleaseActivityType -> ReleaseActivityType -> Bool
$c>= :: ReleaseActivityType -> ReleaseActivityType -> Bool
>= :: ReleaseActivityType -> ReleaseActivityType -> Bool
$cmax :: ReleaseActivityType -> ReleaseActivityType -> ReleaseActivityType
max :: ReleaseActivityType -> ReleaseActivityType -> ReleaseActivityType
$cmin :: ReleaseActivityType -> ReleaseActivityType -> ReleaseActivityType
min :: ReleaseActivityType -> ReleaseActivityType -> ReleaseActivityType
Ord, Int -> ReleaseActivityType -> ShowS
[ReleaseActivityType] -> ShowS
ReleaseActivityType -> String
(Int -> ReleaseActivityType -> ShowS)
-> (ReleaseActivityType -> String)
-> ([ReleaseActivityType] -> ShowS)
-> Show ReleaseActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ReleaseActivityType -> ShowS
showsPrec :: Int -> ReleaseActivityType -> ShowS
$cshow :: ReleaseActivityType -> String
show :: ReleaseActivityType -> String
$cshowList :: [ReleaseActivityType] -> ShowS
showList :: [ReleaseActivityType] -> ShowS
Show)
instance FromJSON ReleaseActivityType where
parseJSON :: Value -> Parser ReleaseActivityType
parseJSON =
String
-> (Text -> Parser ReleaseActivityType)
-> Value
-> Parser ReleaseActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"ReleaseActivityType" ((Text -> Parser ReleaseActivityType)
-> Value -> Parser ReleaseActivityType)
-> (Text -> Parser ReleaseActivityType)
-> Value
-> Parser ReleaseActivityType
forall a b. (a -> b) -> a -> b
$ Either String ReleaseActivityType -> Parser ReleaseActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String ReleaseActivityType -> Parser ReleaseActivityType)
-> (Text -> Either String ReleaseActivityType)
-> Text
-> Parser ReleaseActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String ReleaseActivityType
parseReleaseActivityType
instance ToJSON ReleaseActivityType where
toJSON :: ReleaseActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (ReleaseActivityType -> Text) -> ReleaseActivityType -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ReleaseActivityType -> Text
renderReleaseActivityType
renderReleaseActivityType :: ReleaseActivityType -> Text
renderReleaseActivityType :: ReleaseActivityType -> Text
renderReleaseActivityType = \case
ReleaseActivityType
ReleaseCreated -> Text
"created"
ReleaseActivityType
ReleaseDeleted -> Text
"deleted"
ReleaseActivityType
ReleaseEdited -> Text
"edited"
ReleaseActivityType
ReleasePrereleased -> Text
"prereleased"
ReleaseActivityType
ReleasePublished -> Text
"published"
ReleaseActivityType
ReleaseReleased -> Text
"released"
ReleaseActivityType
ReleaseUnpublished -> Text
"unpublished"
parseReleaseActivityType :: Text -> Either String ReleaseActivityType
parseReleaseActivityType :: Text -> Either String ReleaseActivityType
parseReleaseActivityType Text
t =
Either String ReleaseActivityType
-> (ReleaseActivityType -> Either String ReleaseActivityType)
-> Maybe ReleaseActivityType
-> Either String ReleaseActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String ReleaseActivityType
forall a b. a -> Either a b
Left [i|Unknown ReleaseActivityType: #{t}|]) ReleaseActivityType -> Either String ReleaseActivityType
forall a b. b -> Either a b
Right (Maybe ReleaseActivityType -> Either String ReleaseActivityType)
-> Maybe ReleaseActivityType -> Either String ReleaseActivityType
forall a b. (a -> b) -> a -> b
$
(ReleaseActivityType -> Text) -> Text -> Maybe ReleaseActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap ReleaseActivityType -> Text
renderReleaseActivityType Text
t
data WorkflowCallInputType
= WorkflowCallInputTypeBoolean
| WorkflowCallInputTypeNumber
| WorkflowCallInputTypeString
deriving stock (WorkflowCallInputType
WorkflowCallInputType
-> WorkflowCallInputType -> Bounded WorkflowCallInputType
forall a. a -> a -> Bounded a
$cminBound :: WorkflowCallInputType
minBound :: WorkflowCallInputType
$cmaxBound :: WorkflowCallInputType
maxBound :: WorkflowCallInputType
Bounded, Int -> WorkflowCallInputType
WorkflowCallInputType -> Int
WorkflowCallInputType -> [WorkflowCallInputType]
WorkflowCallInputType -> WorkflowCallInputType
WorkflowCallInputType
-> WorkflowCallInputType -> [WorkflowCallInputType]
WorkflowCallInputType
-> WorkflowCallInputType
-> WorkflowCallInputType
-> [WorkflowCallInputType]
(WorkflowCallInputType -> WorkflowCallInputType)
-> (WorkflowCallInputType -> WorkflowCallInputType)
-> (Int -> WorkflowCallInputType)
-> (WorkflowCallInputType -> Int)
-> (WorkflowCallInputType -> [WorkflowCallInputType])
-> (WorkflowCallInputType
-> WorkflowCallInputType -> [WorkflowCallInputType])
-> (WorkflowCallInputType
-> WorkflowCallInputType -> [WorkflowCallInputType])
-> (WorkflowCallInputType
-> WorkflowCallInputType
-> WorkflowCallInputType
-> [WorkflowCallInputType])
-> Enum WorkflowCallInputType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: WorkflowCallInputType -> WorkflowCallInputType
succ :: WorkflowCallInputType -> WorkflowCallInputType
$cpred :: WorkflowCallInputType -> WorkflowCallInputType
pred :: WorkflowCallInputType -> WorkflowCallInputType
$ctoEnum :: Int -> WorkflowCallInputType
toEnum :: Int -> WorkflowCallInputType
$cfromEnum :: WorkflowCallInputType -> Int
fromEnum :: WorkflowCallInputType -> Int
$cenumFrom :: WorkflowCallInputType -> [WorkflowCallInputType]
enumFrom :: WorkflowCallInputType -> [WorkflowCallInputType]
$cenumFromThen :: WorkflowCallInputType
-> WorkflowCallInputType -> [WorkflowCallInputType]
enumFromThen :: WorkflowCallInputType
-> WorkflowCallInputType -> [WorkflowCallInputType]
$cenumFromTo :: WorkflowCallInputType
-> WorkflowCallInputType -> [WorkflowCallInputType]
enumFromTo :: WorkflowCallInputType
-> WorkflowCallInputType -> [WorkflowCallInputType]
$cenumFromThenTo :: WorkflowCallInputType
-> WorkflowCallInputType
-> WorkflowCallInputType
-> [WorkflowCallInputType]
enumFromThenTo :: WorkflowCallInputType
-> WorkflowCallInputType
-> WorkflowCallInputType
-> [WorkflowCallInputType]
Enum, WorkflowCallInputType -> WorkflowCallInputType -> Bool
(WorkflowCallInputType -> WorkflowCallInputType -> Bool)
-> (WorkflowCallInputType -> WorkflowCallInputType -> Bool)
-> Eq WorkflowCallInputType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
== :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
$c/= :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
/= :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
Eq, (forall x. WorkflowCallInputType -> Rep WorkflowCallInputType x)
-> (forall x. Rep WorkflowCallInputType x -> WorkflowCallInputType)
-> Generic WorkflowCallInputType
forall x. Rep WorkflowCallInputType x -> WorkflowCallInputType
forall x. WorkflowCallInputType -> Rep WorkflowCallInputType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WorkflowCallInputType -> Rep WorkflowCallInputType x
from :: forall x. WorkflowCallInputType -> Rep WorkflowCallInputType x
$cto :: forall x. Rep WorkflowCallInputType x -> WorkflowCallInputType
to :: forall x. Rep WorkflowCallInputType x -> WorkflowCallInputType
Generic, Eq WorkflowCallInputType
Eq WorkflowCallInputType =>
(WorkflowCallInputType -> WorkflowCallInputType -> Ordering)
-> (WorkflowCallInputType -> WorkflowCallInputType -> Bool)
-> (WorkflowCallInputType -> WorkflowCallInputType -> Bool)
-> (WorkflowCallInputType -> WorkflowCallInputType -> Bool)
-> (WorkflowCallInputType -> WorkflowCallInputType -> Bool)
-> (WorkflowCallInputType
-> WorkflowCallInputType -> WorkflowCallInputType)
-> (WorkflowCallInputType
-> WorkflowCallInputType -> WorkflowCallInputType)
-> Ord WorkflowCallInputType
WorkflowCallInputType -> WorkflowCallInputType -> Bool
WorkflowCallInputType -> WorkflowCallInputType -> Ordering
WorkflowCallInputType
-> WorkflowCallInputType -> WorkflowCallInputType
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
$ccompare :: WorkflowCallInputType -> WorkflowCallInputType -> Ordering
compare :: WorkflowCallInputType -> WorkflowCallInputType -> Ordering
$c< :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
< :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
$c<= :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
<= :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
$c> :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
> :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
$c>= :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
>= :: WorkflowCallInputType -> WorkflowCallInputType -> Bool
$cmax :: WorkflowCallInputType
-> WorkflowCallInputType -> WorkflowCallInputType
max :: WorkflowCallInputType
-> WorkflowCallInputType -> WorkflowCallInputType
$cmin :: WorkflowCallInputType
-> WorkflowCallInputType -> WorkflowCallInputType
min :: WorkflowCallInputType
-> WorkflowCallInputType -> WorkflowCallInputType
Ord, Int -> WorkflowCallInputType -> ShowS
[WorkflowCallInputType] -> ShowS
WorkflowCallInputType -> String
(Int -> WorkflowCallInputType -> ShowS)
-> (WorkflowCallInputType -> String)
-> ([WorkflowCallInputType] -> ShowS)
-> Show WorkflowCallInputType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowCallInputType -> ShowS
showsPrec :: Int -> WorkflowCallInputType -> ShowS
$cshow :: WorkflowCallInputType -> String
show :: WorkflowCallInputType -> String
$cshowList :: [WorkflowCallInputType] -> ShowS
showList :: [WorkflowCallInputType] -> ShowS
Show)
instance FromJSON WorkflowCallInputType where
parseJSON :: Value -> Parser WorkflowCallInputType
parseJSON =
String
-> (Text -> Parser WorkflowCallInputType)
-> Value
-> Parser WorkflowCallInputType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"WorkflowCallInputType" ((Text -> Parser WorkflowCallInputType)
-> Value -> Parser WorkflowCallInputType)
-> (Text -> Parser WorkflowCallInputType)
-> Value
-> Parser WorkflowCallInputType
forall a b. (a -> b) -> a -> b
$ Either String WorkflowCallInputType -> Parser WorkflowCallInputType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String WorkflowCallInputType
-> Parser WorkflowCallInputType)
-> (Text -> Either String WorkflowCallInputType)
-> Text
-> Parser WorkflowCallInputType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String WorkflowCallInputType
parseWorkflowCallInputType
instance ToJSON WorkflowCallInputType where
toJSON :: WorkflowCallInputType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (WorkflowCallInputType -> Text)
-> WorkflowCallInputType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WorkflowCallInputType -> Text
renderWorkflowCallInputType
renderWorkflowCallInputType :: WorkflowCallInputType -> Text
renderWorkflowCallInputType :: WorkflowCallInputType -> Text
renderWorkflowCallInputType = \case
WorkflowCallInputType
WorkflowCallInputTypeBoolean -> Text
"boolean"
WorkflowCallInputType
WorkflowCallInputTypeNumber -> Text
"number"
WorkflowCallInputType
WorkflowCallInputTypeString -> Text
"string"
parseWorkflowCallInputType :: Text -> Either String WorkflowCallInputType
parseWorkflowCallInputType :: Text -> Either String WorkflowCallInputType
parseWorkflowCallInputType Text
t =
Either String WorkflowCallInputType
-> (WorkflowCallInputType -> Either String WorkflowCallInputType)
-> Maybe WorkflowCallInputType
-> Either String WorkflowCallInputType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String WorkflowCallInputType
forall a b. a -> Either a b
Left [i|Unknown WorkflowCallInputType: #{t}|]) WorkflowCallInputType -> Either String WorkflowCallInputType
forall a b. b -> Either a b
Right (Maybe WorkflowCallInputType
-> Either String WorkflowCallInputType)
-> Maybe WorkflowCallInputType
-> Either String WorkflowCallInputType
forall a b. (a -> b) -> a -> b
$
(WorkflowCallInputType -> Text)
-> Text -> Maybe WorkflowCallInputType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap WorkflowCallInputType -> Text
renderWorkflowCallInputType Text
t
data WorkflowCallInput = WorkflowCallInput
{ WorkflowCallInput -> Maybe Text
description :: Maybe Text,
WorkflowCallInput -> Maybe Value
default_ :: Maybe Aeson.Value,
WorkflowCallInput -> Maybe Bool
required :: Maybe Bool,
WorkflowCallInput -> WorkflowCallInputType
type_ :: WorkflowCallInputType
}
deriving stock (WorkflowCallInput -> WorkflowCallInput -> Bool
(WorkflowCallInput -> WorkflowCallInput -> Bool)
-> (WorkflowCallInput -> WorkflowCallInput -> Bool)
-> Eq WorkflowCallInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowCallInput -> WorkflowCallInput -> Bool
== :: WorkflowCallInput -> WorkflowCallInput -> Bool
$c/= :: WorkflowCallInput -> WorkflowCallInput -> Bool
/= :: WorkflowCallInput -> WorkflowCallInput -> Bool
Eq, (forall x. WorkflowCallInput -> Rep WorkflowCallInput x)
-> (forall x. Rep WorkflowCallInput x -> WorkflowCallInput)
-> Generic WorkflowCallInput
forall x. Rep WorkflowCallInput x -> WorkflowCallInput
forall x. WorkflowCallInput -> Rep WorkflowCallInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WorkflowCallInput -> Rep WorkflowCallInput x
from :: forall x. WorkflowCallInput -> Rep WorkflowCallInput x
$cto :: forall x. Rep WorkflowCallInput x -> WorkflowCallInput
to :: forall x. Rep WorkflowCallInput x -> WorkflowCallInput
Generic, Eq WorkflowCallInput
Eq WorkflowCallInput =>
(WorkflowCallInput -> WorkflowCallInput -> Ordering)
-> (WorkflowCallInput -> WorkflowCallInput -> Bool)
-> (WorkflowCallInput -> WorkflowCallInput -> Bool)
-> (WorkflowCallInput -> WorkflowCallInput -> Bool)
-> (WorkflowCallInput -> WorkflowCallInput -> Bool)
-> (WorkflowCallInput -> WorkflowCallInput -> WorkflowCallInput)
-> (WorkflowCallInput -> WorkflowCallInput -> WorkflowCallInput)
-> Ord WorkflowCallInput
WorkflowCallInput -> WorkflowCallInput -> Bool
WorkflowCallInput -> WorkflowCallInput -> Ordering
WorkflowCallInput -> WorkflowCallInput -> WorkflowCallInput
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
$ccompare :: WorkflowCallInput -> WorkflowCallInput -> Ordering
compare :: WorkflowCallInput -> WorkflowCallInput -> Ordering
$c< :: WorkflowCallInput -> WorkflowCallInput -> Bool
< :: WorkflowCallInput -> WorkflowCallInput -> Bool
$c<= :: WorkflowCallInput -> WorkflowCallInput -> Bool
<= :: WorkflowCallInput -> WorkflowCallInput -> Bool
$c> :: WorkflowCallInput -> WorkflowCallInput -> Bool
> :: WorkflowCallInput -> WorkflowCallInput -> Bool
$c>= :: WorkflowCallInput -> WorkflowCallInput -> Bool
>= :: WorkflowCallInput -> WorkflowCallInput -> Bool
$cmax :: WorkflowCallInput -> WorkflowCallInput -> WorkflowCallInput
max :: WorkflowCallInput -> WorkflowCallInput -> WorkflowCallInput
$cmin :: WorkflowCallInput -> WorkflowCallInput -> WorkflowCallInput
min :: WorkflowCallInput -> WorkflowCallInput -> WorkflowCallInput
Ord, Int -> WorkflowCallInput -> ShowS
[WorkflowCallInput] -> ShowS
WorkflowCallInput -> String
(Int -> WorkflowCallInput -> ShowS)
-> (WorkflowCallInput -> String)
-> ([WorkflowCallInput] -> ShowS)
-> Show WorkflowCallInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowCallInput -> ShowS
showsPrec :: Int -> WorkflowCallInput -> ShowS
$cshow :: WorkflowCallInput -> String
show :: WorkflowCallInput -> String
$cshowList :: [WorkflowCallInput] -> ShowS
showList :: [WorkflowCallInput] -> ShowS
Show)
instance FromJSON WorkflowCallInput where
parseJSON :: Value -> Parser WorkflowCallInput
parseJSON = String
-> (Object -> Parser WorkflowCallInput)
-> Value
-> Parser WorkflowCallInput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkflowCallInput" ((Object -> Parser WorkflowCallInput)
-> Value -> Parser WorkflowCallInput)
-> (Object -> Parser WorkflowCallInput)
-> Value
-> Parser WorkflowCallInput
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
description <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"description"
Maybe Value
default_ <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"default"
Maybe Bool
required <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"required"
WorkflowCallInputType
type_ <- Object
o Object -> Key -> Parser WorkflowCallInputType
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"type"
WorkflowCallInput -> Parser WorkflowCallInput
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowCallInput {Maybe Bool
Maybe Value
Maybe Text
WorkflowCallInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: WorkflowCallInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: WorkflowCallInputType
..}
instance ToJSON WorkflowCallInput where
toJSON :: WorkflowCallInput -> Value
toJSON WorkflowCallInput {Maybe Bool
Maybe Value
Maybe Text
WorkflowCallInputType
description :: WorkflowCallInput -> Maybe Text
default_ :: WorkflowCallInput -> Maybe Value
required :: WorkflowCallInput -> Maybe Bool
type_ :: WorkflowCallInput -> WorkflowCallInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: WorkflowCallInputType
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ (Key
"description" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Text
description,
(Key
"default" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Value -> Pair) -> Maybe Value -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Value
default_,
(Key
"required" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Bool
required,
Pair -> Maybe Pair
forall a. a -> Maybe a
Just (Pair -> Maybe Pair) -> Pair -> Maybe Pair
forall a b. (a -> b) -> a -> b
$ Key
"type" Key -> WorkflowCallInputType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= WorkflowCallInputType
type_
]
data WorkflowCallOutput = WorkflowCallOutput
{ WorkflowCallOutput -> Maybe Text
description :: Maybe Text,
WorkflowCallOutput -> Text
value :: Text
}
deriving stock (WorkflowCallOutput -> WorkflowCallOutput -> Bool
(WorkflowCallOutput -> WorkflowCallOutput -> Bool)
-> (WorkflowCallOutput -> WorkflowCallOutput -> Bool)
-> Eq WorkflowCallOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
== :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
$c/= :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
/= :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
Eq, (forall x. WorkflowCallOutput -> Rep WorkflowCallOutput x)
-> (forall x. Rep WorkflowCallOutput x -> WorkflowCallOutput)
-> Generic WorkflowCallOutput
forall x. Rep WorkflowCallOutput x -> WorkflowCallOutput
forall x. WorkflowCallOutput -> Rep WorkflowCallOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WorkflowCallOutput -> Rep WorkflowCallOutput x
from :: forall x. WorkflowCallOutput -> Rep WorkflowCallOutput x
$cto :: forall x. Rep WorkflowCallOutput x -> WorkflowCallOutput
to :: forall x. Rep WorkflowCallOutput x -> WorkflowCallOutput
Generic, Eq WorkflowCallOutput
Eq WorkflowCallOutput =>
(WorkflowCallOutput -> WorkflowCallOutput -> Ordering)
-> (WorkflowCallOutput -> WorkflowCallOutput -> Bool)
-> (WorkflowCallOutput -> WorkflowCallOutput -> Bool)
-> (WorkflowCallOutput -> WorkflowCallOutput -> Bool)
-> (WorkflowCallOutput -> WorkflowCallOutput -> Bool)
-> (WorkflowCallOutput -> WorkflowCallOutput -> WorkflowCallOutput)
-> (WorkflowCallOutput -> WorkflowCallOutput -> WorkflowCallOutput)
-> Ord WorkflowCallOutput
WorkflowCallOutput -> WorkflowCallOutput -> Bool
WorkflowCallOutput -> WorkflowCallOutput -> Ordering
WorkflowCallOutput -> WorkflowCallOutput -> WorkflowCallOutput
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
$ccompare :: WorkflowCallOutput -> WorkflowCallOutput -> Ordering
compare :: WorkflowCallOutput -> WorkflowCallOutput -> Ordering
$c< :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
< :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
$c<= :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
<= :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
$c> :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
> :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
$c>= :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
>= :: WorkflowCallOutput -> WorkflowCallOutput -> Bool
$cmax :: WorkflowCallOutput -> WorkflowCallOutput -> WorkflowCallOutput
max :: WorkflowCallOutput -> WorkflowCallOutput -> WorkflowCallOutput
$cmin :: WorkflowCallOutput -> WorkflowCallOutput -> WorkflowCallOutput
min :: WorkflowCallOutput -> WorkflowCallOutput -> WorkflowCallOutput
Ord, Int -> WorkflowCallOutput -> ShowS
[WorkflowCallOutput] -> ShowS
WorkflowCallOutput -> String
(Int -> WorkflowCallOutput -> ShowS)
-> (WorkflowCallOutput -> String)
-> ([WorkflowCallOutput] -> ShowS)
-> Show WorkflowCallOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowCallOutput -> ShowS
showsPrec :: Int -> WorkflowCallOutput -> ShowS
$cshow :: WorkflowCallOutput -> String
show :: WorkflowCallOutput -> String
$cshowList :: [WorkflowCallOutput] -> ShowS
showList :: [WorkflowCallOutput] -> ShowS
Show)
instance FromJSON WorkflowCallOutput where
parseJSON :: Value -> Parser WorkflowCallOutput
parseJSON = String
-> (Object -> Parser WorkflowCallOutput)
-> Value
-> Parser WorkflowCallOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkflowCallOutput" ((Object -> Parser WorkflowCallOutput)
-> Value -> Parser WorkflowCallOutput)
-> (Object -> Parser WorkflowCallOutput)
-> Value
-> Parser WorkflowCallOutput
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
description <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"description"
Text
value <- Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"value"
WorkflowCallOutput -> Parser WorkflowCallOutput
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowCallOutput {Maybe Text
Text
description :: Maybe Text
value :: Text
description :: Maybe Text
value :: Text
..}
instance ToJSON WorkflowCallOutput where
toJSON :: WorkflowCallOutput -> Value
toJSON WorkflowCallOutput {Maybe Text
Text
description :: WorkflowCallOutput -> Maybe Text
value :: WorkflowCallOutput -> Text
description :: Maybe Text
value :: Text
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ (Key
"description" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Text
description,
Pair -> Maybe Pair
forall a. a -> Maybe a
Just (Pair -> Maybe Pair) -> Pair -> Maybe Pair
forall a b. (a -> b) -> a -> b
$ Key
"value" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
value
]
data WorkflowCallSecret = WorkflowCallSecret
{ WorkflowCallSecret -> Maybe Text
description :: Maybe Text,
WorkflowCallSecret -> Maybe Bool
required :: Maybe Bool
}
deriving stock (WorkflowCallSecret -> WorkflowCallSecret -> Bool
(WorkflowCallSecret -> WorkflowCallSecret -> Bool)
-> (WorkflowCallSecret -> WorkflowCallSecret -> Bool)
-> Eq WorkflowCallSecret
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
== :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
$c/= :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
/= :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
Eq, (forall x. WorkflowCallSecret -> Rep WorkflowCallSecret x)
-> (forall x. Rep WorkflowCallSecret x -> WorkflowCallSecret)
-> Generic WorkflowCallSecret
forall x. Rep WorkflowCallSecret x -> WorkflowCallSecret
forall x. WorkflowCallSecret -> Rep WorkflowCallSecret x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WorkflowCallSecret -> Rep WorkflowCallSecret x
from :: forall x. WorkflowCallSecret -> Rep WorkflowCallSecret x
$cto :: forall x. Rep WorkflowCallSecret x -> WorkflowCallSecret
to :: forall x. Rep WorkflowCallSecret x -> WorkflowCallSecret
Generic, Eq WorkflowCallSecret
Eq WorkflowCallSecret =>
(WorkflowCallSecret -> WorkflowCallSecret -> Ordering)
-> (WorkflowCallSecret -> WorkflowCallSecret -> Bool)
-> (WorkflowCallSecret -> WorkflowCallSecret -> Bool)
-> (WorkflowCallSecret -> WorkflowCallSecret -> Bool)
-> (WorkflowCallSecret -> WorkflowCallSecret -> Bool)
-> (WorkflowCallSecret -> WorkflowCallSecret -> WorkflowCallSecret)
-> (WorkflowCallSecret -> WorkflowCallSecret -> WorkflowCallSecret)
-> Ord WorkflowCallSecret
WorkflowCallSecret -> WorkflowCallSecret -> Bool
WorkflowCallSecret -> WorkflowCallSecret -> Ordering
WorkflowCallSecret -> WorkflowCallSecret -> WorkflowCallSecret
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
$ccompare :: WorkflowCallSecret -> WorkflowCallSecret -> Ordering
compare :: WorkflowCallSecret -> WorkflowCallSecret -> Ordering
$c< :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
< :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
$c<= :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
<= :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
$c> :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
> :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
$c>= :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
>= :: WorkflowCallSecret -> WorkflowCallSecret -> Bool
$cmax :: WorkflowCallSecret -> WorkflowCallSecret -> WorkflowCallSecret
max :: WorkflowCallSecret -> WorkflowCallSecret -> WorkflowCallSecret
$cmin :: WorkflowCallSecret -> WorkflowCallSecret -> WorkflowCallSecret
min :: WorkflowCallSecret -> WorkflowCallSecret -> WorkflowCallSecret
Ord, Int -> WorkflowCallSecret -> ShowS
[WorkflowCallSecret] -> ShowS
WorkflowCallSecret -> String
(Int -> WorkflowCallSecret -> ShowS)
-> (WorkflowCallSecret -> String)
-> ([WorkflowCallSecret] -> ShowS)
-> Show WorkflowCallSecret
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowCallSecret -> ShowS
showsPrec :: Int -> WorkflowCallSecret -> ShowS
$cshow :: WorkflowCallSecret -> String
show :: WorkflowCallSecret -> String
$cshowList :: [WorkflowCallSecret] -> ShowS
showList :: [WorkflowCallSecret] -> ShowS
Show)
instance FromJSON WorkflowCallSecret where
parseJSON :: Value -> Parser WorkflowCallSecret
parseJSON = String
-> (Object -> Parser WorkflowCallSecret)
-> Value
-> Parser WorkflowCallSecret
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkflowCallSecret" ((Object -> Parser WorkflowCallSecret)
-> Value -> Parser WorkflowCallSecret)
-> (Object -> Parser WorkflowCallSecret)
-> Value
-> Parser WorkflowCallSecret
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
description <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"description"
Maybe Bool
required <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"required"
WorkflowCallSecret -> Parser WorkflowCallSecret
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowCallSecret {Maybe Bool
Maybe Text
description :: Maybe Text
required :: Maybe Bool
description :: Maybe Text
required :: Maybe Bool
..}
instance ToJSON WorkflowCallSecret where
toJSON :: WorkflowCallSecret -> Value
toJSON WorkflowCallSecret {Maybe Bool
Maybe Text
description :: WorkflowCallSecret -> Maybe Text
required :: WorkflowCallSecret -> Maybe Bool
description :: Maybe Text
required :: Maybe Bool
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ (Key
"description" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Text
description,
(Key
"required" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Bool
required
]
data WorkflowCallAttributes = WorkflowCallAttributes
{ WorkflowCallAttributes -> Maybe (Map Text WorkflowCallInput)
inputs :: Maybe (Map Text WorkflowCallInput),
WorkflowCallAttributes -> Maybe (Map Text WorkflowCallOutput)
outputs :: Maybe (Map Text WorkflowCallOutput),
WorkflowCallAttributes -> Maybe (Map Text WorkflowCallSecret)
secrets :: Maybe (Map Text WorkflowCallSecret)
}
deriving stock (WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
(WorkflowCallAttributes -> WorkflowCallAttributes -> Bool)
-> (WorkflowCallAttributes -> WorkflowCallAttributes -> Bool)
-> Eq WorkflowCallAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
== :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
$c/= :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
/= :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
Eq, (forall x. WorkflowCallAttributes -> Rep WorkflowCallAttributes x)
-> (forall x.
Rep WorkflowCallAttributes x -> WorkflowCallAttributes)
-> Generic WorkflowCallAttributes
forall x. Rep WorkflowCallAttributes x -> WorkflowCallAttributes
forall x. WorkflowCallAttributes -> Rep WorkflowCallAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WorkflowCallAttributes -> Rep WorkflowCallAttributes x
from :: forall x. WorkflowCallAttributes -> Rep WorkflowCallAttributes x
$cto :: forall x. Rep WorkflowCallAttributes x -> WorkflowCallAttributes
to :: forall x. Rep WorkflowCallAttributes x -> WorkflowCallAttributes
Generic, Eq WorkflowCallAttributes
Eq WorkflowCallAttributes =>
(WorkflowCallAttributes -> WorkflowCallAttributes -> Ordering)
-> (WorkflowCallAttributes -> WorkflowCallAttributes -> Bool)
-> (WorkflowCallAttributes -> WorkflowCallAttributes -> Bool)
-> (WorkflowCallAttributes -> WorkflowCallAttributes -> Bool)
-> (WorkflowCallAttributes -> WorkflowCallAttributes -> Bool)
-> (WorkflowCallAttributes
-> WorkflowCallAttributes -> WorkflowCallAttributes)
-> (WorkflowCallAttributes
-> WorkflowCallAttributes -> WorkflowCallAttributes)
-> Ord WorkflowCallAttributes
WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
WorkflowCallAttributes -> WorkflowCallAttributes -> Ordering
WorkflowCallAttributes
-> WorkflowCallAttributes -> WorkflowCallAttributes
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
$ccompare :: WorkflowCallAttributes -> WorkflowCallAttributes -> Ordering
compare :: WorkflowCallAttributes -> WorkflowCallAttributes -> Ordering
$c< :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
< :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
$c<= :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
<= :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
$c> :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
> :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
$c>= :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
>= :: WorkflowCallAttributes -> WorkflowCallAttributes -> Bool
$cmax :: WorkflowCallAttributes
-> WorkflowCallAttributes -> WorkflowCallAttributes
max :: WorkflowCallAttributes
-> WorkflowCallAttributes -> WorkflowCallAttributes
$cmin :: WorkflowCallAttributes
-> WorkflowCallAttributes -> WorkflowCallAttributes
min :: WorkflowCallAttributes
-> WorkflowCallAttributes -> WorkflowCallAttributes
Ord, Int -> WorkflowCallAttributes -> ShowS
[WorkflowCallAttributes] -> ShowS
WorkflowCallAttributes -> String
(Int -> WorkflowCallAttributes -> ShowS)
-> (WorkflowCallAttributes -> String)
-> ([WorkflowCallAttributes] -> ShowS)
-> Show WorkflowCallAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowCallAttributes -> ShowS
showsPrec :: Int -> WorkflowCallAttributes -> ShowS
$cshow :: WorkflowCallAttributes -> String
show :: WorkflowCallAttributes -> String
$cshowList :: [WorkflowCallAttributes] -> ShowS
showList :: [WorkflowCallAttributes] -> ShowS
Show)
instance FromJSON WorkflowCallAttributes where
parseJSON :: Value -> Parser WorkflowCallAttributes
parseJSON = String
-> (Object -> Parser WorkflowCallAttributes)
-> Value
-> Parser WorkflowCallAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkflowCallAttributes" ((Object -> Parser WorkflowCallAttributes)
-> Value -> Parser WorkflowCallAttributes)
-> (Object -> Parser WorkflowCallAttributes)
-> Value
-> Parser WorkflowCallAttributes
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe (Map Text WorkflowCallInput)
inputs <- Object
o Object -> Key -> Parser (Maybe (Map Text WorkflowCallInput))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"inputs"
Maybe (Map Text WorkflowCallOutput)
outputs <- Object
o Object -> Key -> Parser (Maybe (Map Text WorkflowCallOutput))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"outputs"
Maybe (Map Text WorkflowCallSecret)
secrets <- Object
o Object -> Key -> Parser (Maybe (Map Text WorkflowCallSecret))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"secrets"
WorkflowCallAttributes -> Parser WorkflowCallAttributes
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowCallAttributes {Maybe (Map Text WorkflowCallSecret)
Maybe (Map Text WorkflowCallOutput)
Maybe (Map Text WorkflowCallInput)
inputs :: Maybe (Map Text WorkflowCallInput)
outputs :: Maybe (Map Text WorkflowCallOutput)
secrets :: Maybe (Map Text WorkflowCallSecret)
inputs :: Maybe (Map Text WorkflowCallInput)
outputs :: Maybe (Map Text WorkflowCallOutput)
secrets :: Maybe (Map Text WorkflowCallSecret)
..}
instance ToJSON WorkflowCallAttributes where
toJSON :: WorkflowCallAttributes -> Value
toJSON WorkflowCallAttributes {Maybe (Map Text WorkflowCallSecret)
Maybe (Map Text WorkflowCallOutput)
Maybe (Map Text WorkflowCallInput)
inputs :: WorkflowCallAttributes -> Maybe (Map Text WorkflowCallInput)
outputs :: WorkflowCallAttributes -> Maybe (Map Text WorkflowCallOutput)
secrets :: WorkflowCallAttributes -> Maybe (Map Text WorkflowCallSecret)
inputs :: Maybe (Map Text WorkflowCallInput)
outputs :: Maybe (Map Text WorkflowCallOutput)
secrets :: Maybe (Map Text WorkflowCallSecret)
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ (Key
"inputs" Key -> Map Text WorkflowCallInput -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Map Text WorkflowCallInput -> Pair)
-> Maybe (Map Text WorkflowCallInput) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Map Text WorkflowCallInput)
inputs,
(Key
"outputs" Key -> Map Text WorkflowCallOutput -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Map Text WorkflowCallOutput -> Pair)
-> Maybe (Map Text WorkflowCallOutput) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Map Text WorkflowCallOutput)
outputs,
(Key
"secrets" Key -> Map Text WorkflowCallSecret -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Map Text WorkflowCallSecret -> Pair)
-> Maybe (Map Text WorkflowCallSecret) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Map Text WorkflowCallSecret)
secrets
]
data WorkflowDispatchInputType
= WorkflowDispatchInputTypeBoolean
| WorkflowDispatchInputTypeChoice (NonEmpty Text)
| WorkflowDispatchInputTypeEnvironment
| WorkflowDispatchInputTypeNumber
| WorkflowDispatchInputTypeString
deriving stock (WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
(WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool)
-> (WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool)
-> Eq WorkflowDispatchInputType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
== :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
$c/= :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
/= :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
Eq, (forall x.
WorkflowDispatchInputType -> Rep WorkflowDispatchInputType x)
-> (forall x.
Rep WorkflowDispatchInputType x -> WorkflowDispatchInputType)
-> Generic WorkflowDispatchInputType
forall x.
Rep WorkflowDispatchInputType x -> WorkflowDispatchInputType
forall x.
WorkflowDispatchInputType -> Rep WorkflowDispatchInputType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
WorkflowDispatchInputType -> Rep WorkflowDispatchInputType x
from :: forall x.
WorkflowDispatchInputType -> Rep WorkflowDispatchInputType x
$cto :: forall x.
Rep WorkflowDispatchInputType x -> WorkflowDispatchInputType
to :: forall x.
Rep WorkflowDispatchInputType x -> WorkflowDispatchInputType
Generic, Eq WorkflowDispatchInputType
Eq WorkflowDispatchInputType =>
(WorkflowDispatchInputType
-> WorkflowDispatchInputType -> Ordering)
-> (WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool)
-> (WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool)
-> (WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool)
-> (WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool)
-> (WorkflowDispatchInputType
-> WorkflowDispatchInputType -> WorkflowDispatchInputType)
-> (WorkflowDispatchInputType
-> WorkflowDispatchInputType -> WorkflowDispatchInputType)
-> Ord WorkflowDispatchInputType
WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
WorkflowDispatchInputType -> WorkflowDispatchInputType -> Ordering
WorkflowDispatchInputType
-> WorkflowDispatchInputType -> WorkflowDispatchInputType
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
$ccompare :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Ordering
compare :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Ordering
$c< :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
< :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
$c<= :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
<= :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
$c> :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
> :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
$c>= :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
>= :: WorkflowDispatchInputType -> WorkflowDispatchInputType -> Bool
$cmax :: WorkflowDispatchInputType
-> WorkflowDispatchInputType -> WorkflowDispatchInputType
max :: WorkflowDispatchInputType
-> WorkflowDispatchInputType -> WorkflowDispatchInputType
$cmin :: WorkflowDispatchInputType
-> WorkflowDispatchInputType -> WorkflowDispatchInputType
min :: WorkflowDispatchInputType
-> WorkflowDispatchInputType -> WorkflowDispatchInputType
Ord, Int -> WorkflowDispatchInputType -> ShowS
[WorkflowDispatchInputType] -> ShowS
WorkflowDispatchInputType -> String
(Int -> WorkflowDispatchInputType -> ShowS)
-> (WorkflowDispatchInputType -> String)
-> ([WorkflowDispatchInputType] -> ShowS)
-> Show WorkflowDispatchInputType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowDispatchInputType -> ShowS
showsPrec :: Int -> WorkflowDispatchInputType -> ShowS
$cshow :: WorkflowDispatchInputType -> String
show :: WorkflowDispatchInputType -> String
$cshowList :: [WorkflowDispatchInputType] -> ShowS
showList :: [WorkflowDispatchInputType] -> ShowS
Show)
instance FromJSON WorkflowDispatchInputType where
parseJSON :: Value -> Parser WorkflowDispatchInputType
parseJSON = String
-> (Object -> Parser WorkflowDispatchInputType)
-> Value
-> Parser WorkflowDispatchInputType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkflowDispatchInputType" ((Object -> Parser WorkflowDispatchInputType)
-> Value -> Parser WorkflowDispatchInputType)
-> (Object -> Parser WorkflowDispatchInputType)
-> Value
-> Parser WorkflowDispatchInputType
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Text
t :: Text <- Object
o Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"type"
Maybe (NonEmpty Text)
maybeOptions <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"options"
case Text
t of
Text
"boolean" -> WorkflowDispatchInputType -> Parser WorkflowDispatchInputType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInputType
WorkflowDispatchInputTypeBoolean
Text
"choice" -> case Maybe (NonEmpty Text)
maybeOptions of
Just (Text
op :| [Text]
ops) -> WorkflowDispatchInputType -> Parser WorkflowDispatchInputType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (WorkflowDispatchInputType -> Parser WorkflowDispatchInputType)
-> WorkflowDispatchInputType -> Parser WorkflowDispatchInputType
forall a b. (a -> b) -> a -> b
$ NonEmpty Text -> WorkflowDispatchInputType
WorkflowDispatchInputTypeChoice (NonEmpty Text -> WorkflowDispatchInputType)
-> NonEmpty Text -> WorkflowDispatchInputType
forall a b. (a -> b) -> a -> b
$ Text
op Text -> [Text] -> NonEmpty Text
forall a. a -> [a] -> NonEmpty a
:| [Text]
ops
Maybe (NonEmpty Text)
Nothing -> String -> Parser WorkflowDispatchInputType
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail String
"Expected a non-empty list of options"
Text
"environment" -> WorkflowDispatchInputType -> Parser WorkflowDispatchInputType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInputType
WorkflowDispatchInputTypeEnvironment
Text
"number" -> WorkflowDispatchInputType -> Parser WorkflowDispatchInputType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInputType
WorkflowDispatchInputTypeNumber
Text
"string" -> WorkflowDispatchInputType -> Parser WorkflowDispatchInputType
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInputType
WorkflowDispatchInputTypeString
Text
_ -> String -> Parser WorkflowDispatchInputType
forall a. String -> Parser a
forall (m :: * -> *) a. MonadFail m => String -> m a
fail [i|Unknown WorkflowDispatchInputType: #{t}|]
data WorkflowDispatchInput = WorkflowDispatchInput
{ WorkflowDispatchInput -> Maybe Text
description :: Maybe Text,
WorkflowDispatchInput -> Maybe Value
default_ :: Maybe Aeson.Value,
WorkflowDispatchInput -> Maybe Bool
required :: Maybe Bool,
WorkflowDispatchInput -> Maybe WorkflowDispatchInputType
type_ :: Maybe WorkflowDispatchInputType
}
deriving stock (WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
(WorkflowDispatchInput -> WorkflowDispatchInput -> Bool)
-> (WorkflowDispatchInput -> WorkflowDispatchInput -> Bool)
-> Eq WorkflowDispatchInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
== :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
$c/= :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
/= :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
Eq, (forall x. WorkflowDispatchInput -> Rep WorkflowDispatchInput x)
-> (forall x. Rep WorkflowDispatchInput x -> WorkflowDispatchInput)
-> Generic WorkflowDispatchInput
forall x. Rep WorkflowDispatchInput x -> WorkflowDispatchInput
forall x. WorkflowDispatchInput -> Rep WorkflowDispatchInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WorkflowDispatchInput -> Rep WorkflowDispatchInput x
from :: forall x. WorkflowDispatchInput -> Rep WorkflowDispatchInput x
$cto :: forall x. Rep WorkflowDispatchInput x -> WorkflowDispatchInput
to :: forall x. Rep WorkflowDispatchInput x -> WorkflowDispatchInput
Generic, Eq WorkflowDispatchInput
Eq WorkflowDispatchInput =>
(WorkflowDispatchInput -> WorkflowDispatchInput -> Ordering)
-> (WorkflowDispatchInput -> WorkflowDispatchInput -> Bool)
-> (WorkflowDispatchInput -> WorkflowDispatchInput -> Bool)
-> (WorkflowDispatchInput -> WorkflowDispatchInput -> Bool)
-> (WorkflowDispatchInput -> WorkflowDispatchInput -> Bool)
-> (WorkflowDispatchInput
-> WorkflowDispatchInput -> WorkflowDispatchInput)
-> (WorkflowDispatchInput
-> WorkflowDispatchInput -> WorkflowDispatchInput)
-> Ord WorkflowDispatchInput
WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
WorkflowDispatchInput -> WorkflowDispatchInput -> Ordering
WorkflowDispatchInput
-> WorkflowDispatchInput -> WorkflowDispatchInput
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
$ccompare :: WorkflowDispatchInput -> WorkflowDispatchInput -> Ordering
compare :: WorkflowDispatchInput -> WorkflowDispatchInput -> Ordering
$c< :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
< :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
$c<= :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
<= :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
$c> :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
> :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
$c>= :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
>= :: WorkflowDispatchInput -> WorkflowDispatchInput -> Bool
$cmax :: WorkflowDispatchInput
-> WorkflowDispatchInput -> WorkflowDispatchInput
max :: WorkflowDispatchInput
-> WorkflowDispatchInput -> WorkflowDispatchInput
$cmin :: WorkflowDispatchInput
-> WorkflowDispatchInput -> WorkflowDispatchInput
min :: WorkflowDispatchInput
-> WorkflowDispatchInput -> WorkflowDispatchInput
Ord, Int -> WorkflowDispatchInput -> ShowS
[WorkflowDispatchInput] -> ShowS
WorkflowDispatchInput -> String
(Int -> WorkflowDispatchInput -> ShowS)
-> (WorkflowDispatchInput -> String)
-> ([WorkflowDispatchInput] -> ShowS)
-> Show WorkflowDispatchInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowDispatchInput -> ShowS
showsPrec :: Int -> WorkflowDispatchInput -> ShowS
$cshow :: WorkflowDispatchInput -> String
show :: WorkflowDispatchInput -> String
$cshowList :: [WorkflowDispatchInput] -> ShowS
showList :: [WorkflowDispatchInput] -> ShowS
Show)
instance FromJSON WorkflowDispatchInput where
parseJSON :: Value -> Parser WorkflowDispatchInput
parseJSON = String
-> (Object -> Parser WorkflowDispatchInput)
-> Value
-> Parser WorkflowDispatchInput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkflowDispatchInput" ((Object -> Parser WorkflowDispatchInput)
-> Value -> Parser WorkflowDispatchInput)
-> (Object -> Parser WorkflowDispatchInput)
-> Value
-> Parser WorkflowDispatchInput
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe Text
description <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"description"
Maybe Value
default_ <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"default"
Maybe Bool
required <- Object
o Object -> Key -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"required"
Maybe Text
workflowDispatchInputTypeText :: Maybe Text <- Object
o Object -> Key -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"type"
Maybe WorkflowDispatchInputType
type_ <-
Parser (Maybe WorkflowDispatchInputType)
-> (Text -> Parser (Maybe WorkflowDispatchInputType))
-> Maybe Text
-> Parser (Maybe WorkflowDispatchInputType)
forall b a. b -> (a -> b) -> Maybe a -> b
maybe
(Maybe WorkflowDispatchInputType
-> Parser (Maybe WorkflowDispatchInputType)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe WorkflowDispatchInputType
forall a. Maybe a
Nothing)
(Parser (Maybe WorkflowDispatchInputType)
-> Text -> Parser (Maybe WorkflowDispatchInputType)
forall a b. a -> b -> a
const (Parser (Maybe WorkflowDispatchInputType)
-> Text -> Parser (Maybe WorkflowDispatchInputType))
-> (Value -> Parser (Maybe WorkflowDispatchInputType))
-> Value
-> Text
-> Parser (Maybe WorkflowDispatchInputType)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Value -> Parser (Maybe WorkflowDispatchInputType)
forall a. FromJSON a => Value -> Parser a
Aeson.parseJSON (Value -> Text -> Parser (Maybe WorkflowDispatchInputType))
-> Value -> Text -> Parser (Maybe WorkflowDispatchInputType)
forall a b. (a -> b) -> a -> b
$ Object -> Value
Aeson.Object Object
o)
Maybe Text
workflowDispatchInputTypeText
WorkflowDispatchInput -> Parser WorkflowDispatchInput
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInput {Maybe Bool
Maybe Value
Maybe Text
Maybe WorkflowDispatchInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: Maybe WorkflowDispatchInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: Maybe WorkflowDispatchInputType
..}
instance ToJSON WorkflowDispatchInput where
toJSON :: WorkflowDispatchInput -> Value
toJSON WorkflowDispatchInput {Maybe Bool
Maybe Value
Maybe Text
Maybe WorkflowDispatchInputType
description :: WorkflowDispatchInput -> Maybe Text
default_ :: WorkflowDispatchInput -> Maybe Value
required :: WorkflowDispatchInput -> Maybe Bool
type_ :: WorkflowDispatchInput -> Maybe WorkflowDispatchInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: Maybe WorkflowDispatchInputType
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ (Key
"description" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Text
description,
(Key
"default" Key -> Value -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Value -> Pair) -> Maybe Value -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Value
default_,
(Key
"required" Key -> Bool -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe Bool
required,
(Key
"type" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=)
(Text -> Pair)
-> (WorkflowDispatchInputType -> Text)
-> WorkflowDispatchInputType
-> Pair
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ( \case
WorkflowDispatchInputType
WorkflowDispatchInputTypeBoolean ->
Text
"boolean" :: Text
WorkflowDispatchInputTypeChoice NonEmpty Text
_ ->
Text
"choice"
WorkflowDispatchInputType
WorkflowDispatchInputTypeEnvironment ->
Text
"environment"
WorkflowDispatchInputType
WorkflowDispatchInputTypeNumber ->
Text
"number"
WorkflowDispatchInputType
WorkflowDispatchInputTypeString ->
Text
"string"
)
(WorkflowDispatchInputType -> Pair)
-> Maybe WorkflowDispatchInputType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe WorkflowDispatchInputType
type_,
Maybe WorkflowDispatchInputType
type_
Maybe WorkflowDispatchInputType
-> (WorkflowDispatchInputType -> Maybe Pair) -> Maybe Pair
forall a b. Maybe a -> (a -> Maybe b) -> Maybe b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= ( \case
WorkflowDispatchInputTypeChoice NonEmpty Text
ops ->
Pair -> Maybe Pair
forall a. a -> Maybe a
Just (Pair -> Maybe Pair) -> Pair -> Maybe Pair
forall a b. (a -> b) -> a -> b
$ Key
"options" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty Text
ops
WorkflowDispatchInputType
_ ->
Maybe Pair
forall a. Maybe a
Nothing
)
]
newtype WorkflowDispatchAttributes = WorkflowDispatchAttributes
{ WorkflowDispatchAttributes
-> Maybe (Map Text WorkflowDispatchInput)
inputs :: Maybe (Map Text WorkflowDispatchInput)
}
deriving stock (WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
(WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool)
-> (WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> Bool)
-> Eq WorkflowDispatchAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
== :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
$c/= :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
/= :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
Eq, (forall x.
WorkflowDispatchAttributes -> Rep WorkflowDispatchAttributes x)
-> (forall x.
Rep WorkflowDispatchAttributes x -> WorkflowDispatchAttributes)
-> Generic WorkflowDispatchAttributes
forall x.
Rep WorkflowDispatchAttributes x -> WorkflowDispatchAttributes
forall x.
WorkflowDispatchAttributes -> Rep WorkflowDispatchAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
WorkflowDispatchAttributes -> Rep WorkflowDispatchAttributes x
from :: forall x.
WorkflowDispatchAttributes -> Rep WorkflowDispatchAttributes x
$cto :: forall x.
Rep WorkflowDispatchAttributes x -> WorkflowDispatchAttributes
to :: forall x.
Rep WorkflowDispatchAttributes x -> WorkflowDispatchAttributes
Generic, Eq WorkflowDispatchAttributes
Eq WorkflowDispatchAttributes =>
(WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> Ordering)
-> (WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> Bool)
-> (WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> Bool)
-> (WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> Bool)
-> (WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> Bool)
-> (WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> WorkflowDispatchAttributes)
-> (WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> WorkflowDispatchAttributes)
-> Ord WorkflowDispatchAttributes
WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> Ordering
WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> WorkflowDispatchAttributes
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
$ccompare :: WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> Ordering
compare :: WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> Ordering
$c< :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
< :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
$c<= :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
<= :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
$c> :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
> :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
$c>= :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
>= :: WorkflowDispatchAttributes -> WorkflowDispatchAttributes -> Bool
$cmax :: WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> WorkflowDispatchAttributes
max :: WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> WorkflowDispatchAttributes
$cmin :: WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> WorkflowDispatchAttributes
min :: WorkflowDispatchAttributes
-> WorkflowDispatchAttributes -> WorkflowDispatchAttributes
Ord, Int -> WorkflowDispatchAttributes -> ShowS
[WorkflowDispatchAttributes] -> ShowS
WorkflowDispatchAttributes -> String
(Int -> WorkflowDispatchAttributes -> ShowS)
-> (WorkflowDispatchAttributes -> String)
-> ([WorkflowDispatchAttributes] -> ShowS)
-> Show WorkflowDispatchAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowDispatchAttributes -> ShowS
showsPrec :: Int -> WorkflowDispatchAttributes -> ShowS
$cshow :: WorkflowDispatchAttributes -> String
show :: WorkflowDispatchAttributes -> String
$cshowList :: [WorkflowDispatchAttributes] -> ShowS
showList :: [WorkflowDispatchAttributes] -> ShowS
Show)
instance FromJSON WorkflowDispatchAttributes where
parseJSON :: Value -> Parser WorkflowDispatchAttributes
parseJSON = String
-> (Object -> Parser WorkflowDispatchAttributes)
-> Value
-> Parser WorkflowDispatchAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkflowDispatchAttributes" ((Object -> Parser WorkflowDispatchAttributes)
-> Value -> Parser WorkflowDispatchAttributes)
-> (Object -> Parser WorkflowDispatchAttributes)
-> Value
-> Parser WorkflowDispatchAttributes
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe (Map Text WorkflowDispatchInput)
inputs <- Object
o Object -> Key -> Parser (Maybe (Map Text WorkflowDispatchInput))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"inputs"
WorkflowDispatchAttributes -> Parser WorkflowDispatchAttributes
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchAttributes {Maybe (Map Text WorkflowDispatchInput)
inputs :: Maybe (Map Text WorkflowDispatchInput)
inputs :: Maybe (Map Text WorkflowDispatchInput)
..}
instance ToJSON WorkflowDispatchAttributes where
toJSON :: WorkflowDispatchAttributes -> Value
toJSON WorkflowDispatchAttributes {Maybe (Map Text WorkflowDispatchInput)
inputs :: WorkflowDispatchAttributes
-> Maybe (Map Text WorkflowDispatchInput)
inputs :: Maybe (Map Text WorkflowDispatchInput)
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ (Key
"inputs" Key -> Map Text WorkflowDispatchInput -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (Map Text WorkflowDispatchInput -> Pair)
-> Maybe (Map Text WorkflowDispatchInput) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (Map Text WorkflowDispatchInput)
inputs
]
data WorkflowRunActivityType
= WorkflowRunCompleted
| WorkflowRunInProgress
| WorkflowRunRequested
deriving stock (WorkflowRunActivityType
WorkflowRunActivityType
-> WorkflowRunActivityType -> Bounded WorkflowRunActivityType
forall a. a -> a -> Bounded a
$cminBound :: WorkflowRunActivityType
minBound :: WorkflowRunActivityType
$cmaxBound :: WorkflowRunActivityType
maxBound :: WorkflowRunActivityType
Bounded, Int -> WorkflowRunActivityType
WorkflowRunActivityType -> Int
WorkflowRunActivityType -> [WorkflowRunActivityType]
WorkflowRunActivityType -> WorkflowRunActivityType
WorkflowRunActivityType
-> WorkflowRunActivityType -> [WorkflowRunActivityType]
WorkflowRunActivityType
-> WorkflowRunActivityType
-> WorkflowRunActivityType
-> [WorkflowRunActivityType]
(WorkflowRunActivityType -> WorkflowRunActivityType)
-> (WorkflowRunActivityType -> WorkflowRunActivityType)
-> (Int -> WorkflowRunActivityType)
-> (WorkflowRunActivityType -> Int)
-> (WorkflowRunActivityType -> [WorkflowRunActivityType])
-> (WorkflowRunActivityType
-> WorkflowRunActivityType -> [WorkflowRunActivityType])
-> (WorkflowRunActivityType
-> WorkflowRunActivityType -> [WorkflowRunActivityType])
-> (WorkflowRunActivityType
-> WorkflowRunActivityType
-> WorkflowRunActivityType
-> [WorkflowRunActivityType])
-> Enum WorkflowRunActivityType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: WorkflowRunActivityType -> WorkflowRunActivityType
succ :: WorkflowRunActivityType -> WorkflowRunActivityType
$cpred :: WorkflowRunActivityType -> WorkflowRunActivityType
pred :: WorkflowRunActivityType -> WorkflowRunActivityType
$ctoEnum :: Int -> WorkflowRunActivityType
toEnum :: Int -> WorkflowRunActivityType
$cfromEnum :: WorkflowRunActivityType -> Int
fromEnum :: WorkflowRunActivityType -> Int
$cenumFrom :: WorkflowRunActivityType -> [WorkflowRunActivityType]
enumFrom :: WorkflowRunActivityType -> [WorkflowRunActivityType]
$cenumFromThen :: WorkflowRunActivityType
-> WorkflowRunActivityType -> [WorkflowRunActivityType]
enumFromThen :: WorkflowRunActivityType
-> WorkflowRunActivityType -> [WorkflowRunActivityType]
$cenumFromTo :: WorkflowRunActivityType
-> WorkflowRunActivityType -> [WorkflowRunActivityType]
enumFromTo :: WorkflowRunActivityType
-> WorkflowRunActivityType -> [WorkflowRunActivityType]
$cenumFromThenTo :: WorkflowRunActivityType
-> WorkflowRunActivityType
-> WorkflowRunActivityType
-> [WorkflowRunActivityType]
enumFromThenTo :: WorkflowRunActivityType
-> WorkflowRunActivityType
-> WorkflowRunActivityType
-> [WorkflowRunActivityType]
Enum, WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
(WorkflowRunActivityType -> WorkflowRunActivityType -> Bool)
-> (WorkflowRunActivityType -> WorkflowRunActivityType -> Bool)
-> Eq WorkflowRunActivityType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
== :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
$c/= :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
/= :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
Eq, (forall x.
WorkflowRunActivityType -> Rep WorkflowRunActivityType x)
-> (forall x.
Rep WorkflowRunActivityType x -> WorkflowRunActivityType)
-> Generic WorkflowRunActivityType
forall x. Rep WorkflowRunActivityType x -> WorkflowRunActivityType
forall x. WorkflowRunActivityType -> Rep WorkflowRunActivityType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WorkflowRunActivityType -> Rep WorkflowRunActivityType x
from :: forall x. WorkflowRunActivityType -> Rep WorkflowRunActivityType x
$cto :: forall x. Rep WorkflowRunActivityType x -> WorkflowRunActivityType
to :: forall x. Rep WorkflowRunActivityType x -> WorkflowRunActivityType
Generic, Eq WorkflowRunActivityType
Eq WorkflowRunActivityType =>
(WorkflowRunActivityType -> WorkflowRunActivityType -> Ordering)
-> (WorkflowRunActivityType -> WorkflowRunActivityType -> Bool)
-> (WorkflowRunActivityType -> WorkflowRunActivityType -> Bool)
-> (WorkflowRunActivityType -> WorkflowRunActivityType -> Bool)
-> (WorkflowRunActivityType -> WorkflowRunActivityType -> Bool)
-> (WorkflowRunActivityType
-> WorkflowRunActivityType -> WorkflowRunActivityType)
-> (WorkflowRunActivityType
-> WorkflowRunActivityType -> WorkflowRunActivityType)
-> Ord WorkflowRunActivityType
WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
WorkflowRunActivityType -> WorkflowRunActivityType -> Ordering
WorkflowRunActivityType
-> WorkflowRunActivityType -> WorkflowRunActivityType
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
$ccompare :: WorkflowRunActivityType -> WorkflowRunActivityType -> Ordering
compare :: WorkflowRunActivityType -> WorkflowRunActivityType -> Ordering
$c< :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
< :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
$c<= :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
<= :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
$c> :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
> :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
$c>= :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
>= :: WorkflowRunActivityType -> WorkflowRunActivityType -> Bool
$cmax :: WorkflowRunActivityType
-> WorkflowRunActivityType -> WorkflowRunActivityType
max :: WorkflowRunActivityType
-> WorkflowRunActivityType -> WorkflowRunActivityType
$cmin :: WorkflowRunActivityType
-> WorkflowRunActivityType -> WorkflowRunActivityType
min :: WorkflowRunActivityType
-> WorkflowRunActivityType -> WorkflowRunActivityType
Ord, Int -> WorkflowRunActivityType -> ShowS
[WorkflowRunActivityType] -> ShowS
WorkflowRunActivityType -> String
(Int -> WorkflowRunActivityType -> ShowS)
-> (WorkflowRunActivityType -> String)
-> ([WorkflowRunActivityType] -> ShowS)
-> Show WorkflowRunActivityType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowRunActivityType -> ShowS
showsPrec :: Int -> WorkflowRunActivityType -> ShowS
$cshow :: WorkflowRunActivityType -> String
show :: WorkflowRunActivityType -> String
$cshowList :: [WorkflowRunActivityType] -> ShowS
showList :: [WorkflowRunActivityType] -> ShowS
Show)
instance FromJSON WorkflowRunActivityType where
parseJSON :: Value -> Parser WorkflowRunActivityType
parseJSON =
String
-> (Text -> Parser WorkflowRunActivityType)
-> Value
-> Parser WorkflowRunActivityType
forall a. String -> (Text -> Parser a) -> Value -> Parser a
Aeson.withText String
"WorkflowRunActivityType" ((Text -> Parser WorkflowRunActivityType)
-> Value -> Parser WorkflowRunActivityType)
-> (Text -> Parser WorkflowRunActivityType)
-> Value
-> Parser WorkflowRunActivityType
forall a b. (a -> b) -> a -> b
$ Either String WorkflowRunActivityType
-> Parser WorkflowRunActivityType
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail' (Either String WorkflowRunActivityType
-> Parser WorkflowRunActivityType)
-> (Text -> Either String WorkflowRunActivityType)
-> Text
-> Parser WorkflowRunActivityType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Text -> Either String WorkflowRunActivityType
parseWorkflowRunActivityType
instance ToJSON WorkflowRunActivityType where
toJSON :: WorkflowRunActivityType -> Value
toJSON = Text -> Value
Aeson.String (Text -> Value)
-> (WorkflowRunActivityType -> Text)
-> WorkflowRunActivityType
-> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WorkflowRunActivityType -> Text
renderWorkflowRunActivityType
renderWorkflowRunActivityType :: WorkflowRunActivityType -> Text
renderWorkflowRunActivityType :: WorkflowRunActivityType -> Text
renderWorkflowRunActivityType = \case
WorkflowRunActivityType
WorkflowRunCompleted -> Text
"completed"
WorkflowRunActivityType
WorkflowRunInProgress -> Text
"in_progress"
WorkflowRunActivityType
WorkflowRunRequested -> Text
"requested"
parseWorkflowRunActivityType :: Text -> Either String WorkflowRunActivityType
parseWorkflowRunActivityType :: Text -> Either String WorkflowRunActivityType
parseWorkflowRunActivityType Text
t =
Either String WorkflowRunActivityType
-> (WorkflowRunActivityType
-> Either String WorkflowRunActivityType)
-> Maybe WorkflowRunActivityType
-> Either String WorkflowRunActivityType
forall b a. b -> (a -> b) -> Maybe a -> b
maybe (String -> Either String WorkflowRunActivityType
forall a b. a -> Either a b
Left [i|Unknown WorkflowRunActivityType: #{t}|]) WorkflowRunActivityType -> Either String WorkflowRunActivityType
forall a b. b -> Either a b
Right (Maybe WorkflowRunActivityType
-> Either String WorkflowRunActivityType)
-> Maybe WorkflowRunActivityType
-> Either String WorkflowRunActivityType
forall a b. (a -> b) -> a -> b
$
(WorkflowRunActivityType -> Text)
-> Text -> Maybe WorkflowRunActivityType
forall a k. (Bounded a, Enum a, Ord k) => (a -> k) -> k -> Maybe a
inverseMap WorkflowRunActivityType -> Text
renderWorkflowRunActivityType Text
t
data WorkflowRunTriggerAttributes = WorkflowRunTriggerAttributes
{ WorkflowRunTriggerAttributes -> NonEmpty WorkflowRunActivityType
activityTypes :: NonEmpty WorkflowRunActivityType,
WorkflowRunTriggerAttributes -> Maybe (NonEmpty Text)
workflows :: Maybe (NonEmpty Text),
WorkflowRunTriggerAttributes -> Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text),
WorkflowRunTriggerAttributes -> Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
}
deriving stock (WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
(WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool)
-> (WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool)
-> Eq WorkflowRunTriggerAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
== :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
$c/= :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
/= :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
Eq, (forall x.
WorkflowRunTriggerAttributes -> Rep WorkflowRunTriggerAttributes x)
-> (forall x.
Rep WorkflowRunTriggerAttributes x -> WorkflowRunTriggerAttributes)
-> Generic WorkflowRunTriggerAttributes
forall x.
Rep WorkflowRunTriggerAttributes x -> WorkflowRunTriggerAttributes
forall x.
WorkflowRunTriggerAttributes -> Rep WorkflowRunTriggerAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x.
WorkflowRunTriggerAttributes -> Rep WorkflowRunTriggerAttributes x
from :: forall x.
WorkflowRunTriggerAttributes -> Rep WorkflowRunTriggerAttributes x
$cto :: forall x.
Rep WorkflowRunTriggerAttributes x -> WorkflowRunTriggerAttributes
to :: forall x.
Rep WorkflowRunTriggerAttributes x -> WorkflowRunTriggerAttributes
Generic, Eq WorkflowRunTriggerAttributes
Eq WorkflowRunTriggerAttributes =>
(WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Ordering)
-> (WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool)
-> (WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool)
-> (WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool)
-> (WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool)
-> (WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> WorkflowRunTriggerAttributes)
-> (WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> WorkflowRunTriggerAttributes)
-> Ord WorkflowRunTriggerAttributes
WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Ordering
WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> WorkflowRunTriggerAttributes
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
$ccompare :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Ordering
compare :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Ordering
$c< :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
< :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
$c<= :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
<= :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
$c> :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
> :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
$c>= :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
>= :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> Bool
$cmax :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> WorkflowRunTriggerAttributes
max :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> WorkflowRunTriggerAttributes
$cmin :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> WorkflowRunTriggerAttributes
min :: WorkflowRunTriggerAttributes
-> WorkflowRunTriggerAttributes -> WorkflowRunTriggerAttributes
Ord, Int -> WorkflowRunTriggerAttributes -> ShowS
[WorkflowRunTriggerAttributes] -> ShowS
WorkflowRunTriggerAttributes -> String
(Int -> WorkflowRunTriggerAttributes -> ShowS)
-> (WorkflowRunTriggerAttributes -> String)
-> ([WorkflowRunTriggerAttributes] -> ShowS)
-> Show WorkflowRunTriggerAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowRunTriggerAttributes -> ShowS
showsPrec :: Int -> WorkflowRunTriggerAttributes -> ShowS
$cshow :: WorkflowRunTriggerAttributes -> String
show :: WorkflowRunTriggerAttributes -> String
$cshowList :: [WorkflowRunTriggerAttributes] -> ShowS
showList :: [WorkflowRunTriggerAttributes] -> ShowS
Show)
instance FromJSON WorkflowRunTriggerAttributes where
parseJSON :: Value -> Parser WorkflowRunTriggerAttributes
parseJSON = String
-> (Object -> Parser WorkflowRunTriggerAttributes)
-> Value
-> Parser WorkflowRunTriggerAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkflowRunTriggerAttributes" ((Object -> Parser WorkflowRunTriggerAttributes)
-> Value -> Parser WorkflowRunTriggerAttributes)
-> (Object -> Parser WorkflowRunTriggerAttributes)
-> Value
-> Parser WorkflowRunTriggerAttributes
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
NonEmpty WorkflowRunActivityType
activityTypes <- Object
o Object -> Key -> Parser (NonEmpty WorkflowRunActivityType)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"types"
Maybe (NonEmpty Text)
workflows <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"workflows"
Maybe (NonEmpty Text)
branches <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"branches"
Maybe (NonEmpty Text)
branchesIgnore <- Object
o Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"branches-ignore"
WorkflowRunTriggerAttributes -> Parser WorkflowRunTriggerAttributes
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowRunTriggerAttributes {Maybe (NonEmpty Text)
NonEmpty WorkflowRunActivityType
activityTypes :: NonEmpty WorkflowRunActivityType
workflows :: Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
activityTypes :: NonEmpty WorkflowRunActivityType
workflows :: Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
..}
instance ToJSON WorkflowRunTriggerAttributes where
toJSON :: WorkflowRunTriggerAttributes -> Value
toJSON WorkflowRunTriggerAttributes {Maybe (NonEmpty Text)
NonEmpty WorkflowRunActivityType
activityTypes :: WorkflowRunTriggerAttributes -> NonEmpty WorkflowRunActivityType
workflows :: WorkflowRunTriggerAttributes -> Maybe (NonEmpty Text)
branches :: WorkflowRunTriggerAttributes -> Maybe (NonEmpty Text)
branchesIgnore :: WorkflowRunTriggerAttributes -> Maybe (NonEmpty Text)
activityTypes :: NonEmpty WorkflowRunActivityType
workflows :: Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Aeson.object ([Pair] -> Value) -> [Pair] -> Value
forall a b. (a -> b) -> a -> b
$
[Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Just (Pair -> Maybe Pair) -> Pair -> Maybe Pair
forall a b. (a -> b) -> a -> b
$ Key
"types" Key -> NonEmpty WorkflowRunActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty WorkflowRunActivityType
activityTypes,
(Key
"workflows" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
workflows,
(Key
"branches" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
branches,
(Key
"branches-ignore" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
branchesIgnore
]
data WorkflowTrigger
=
BranchProtectionRuleTrigger (NonEmpty BranchProtectionRuleActivityType)
|
CheckRunTrigger (NonEmpty CheckRunActivityType)
|
CheckSuiteCompletedTrigger
|
CreateTrigger
|
DeleteTrigger
|
DeploymentTrigger
|
DeploymentStatusTrigger
|
DiscussionTrigger (NonEmpty DiscussionActivityType)
|
(NonEmpty DiscussionCommentActivityType)
|
ForkTrigger
|
GollumTrigger
|
(NonEmpty IssueCommentActivityType)
|
IssuesTrigger (NonEmpty IssuesActivityType)
|
LabelTrigger (NonEmpty LabelActivityType)
|
MergeGroupChecksRequestedTrigger
|
MilestoneTrigger (NonEmpty MilestoneActivityType)
|
PageBuildTrigger
|
PublicTrigger
|
PullRequestTrigger PullRequestTriggerAttributes
|
PullRequestReviewTrigger (NonEmpty PullRequestReviewActivityType)
|
(NonEmpty PullRequestReviewCommentActivityType)
|
PullRequestTargetTrigger PullRequestTargetTriggerAttributes
|
PushTrigger PushTriggerAttributes
|
RegistryPackageTrigger (NonEmpty RegistryPackageActivityType)
|
ReleaseTrigger (NonEmpty ReleaseActivityType)
|
RepositoryDispatchTrigger (NonEmpty Text)
|
ScheduleTrigger (NonEmpty Text)
|
StatusTrigger
|
WatchStartedTrigger
|
WorkflowCallTrigger WorkflowCallAttributes
|
WorkflowDispatchTrigger WorkflowDispatchAttributes
|
WorkflowRunTrigger WorkflowRunTriggerAttributes
deriving stock (WorkflowTrigger -> WorkflowTrigger -> Bool
(WorkflowTrigger -> WorkflowTrigger -> Bool)
-> (WorkflowTrigger -> WorkflowTrigger -> Bool)
-> Eq WorkflowTrigger
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: WorkflowTrigger -> WorkflowTrigger -> Bool
== :: WorkflowTrigger -> WorkflowTrigger -> Bool
$c/= :: WorkflowTrigger -> WorkflowTrigger -> Bool
/= :: WorkflowTrigger -> WorkflowTrigger -> Bool
Eq, (forall x. WorkflowTrigger -> Rep WorkflowTrigger x)
-> (forall x. Rep WorkflowTrigger x -> WorkflowTrigger)
-> Generic WorkflowTrigger
forall x. Rep WorkflowTrigger x -> WorkflowTrigger
forall x. WorkflowTrigger -> Rep WorkflowTrigger x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. WorkflowTrigger -> Rep WorkflowTrigger x
from :: forall x. WorkflowTrigger -> Rep WorkflowTrigger x
$cto :: forall x. Rep WorkflowTrigger x -> WorkflowTrigger
to :: forall x. Rep WorkflowTrigger x -> WorkflowTrigger
Generic, Eq WorkflowTrigger
Eq WorkflowTrigger =>
(WorkflowTrigger -> WorkflowTrigger -> Ordering)
-> (WorkflowTrigger -> WorkflowTrigger -> Bool)
-> (WorkflowTrigger -> WorkflowTrigger -> Bool)
-> (WorkflowTrigger -> WorkflowTrigger -> Bool)
-> (WorkflowTrigger -> WorkflowTrigger -> Bool)
-> (WorkflowTrigger -> WorkflowTrigger -> WorkflowTrigger)
-> (WorkflowTrigger -> WorkflowTrigger -> WorkflowTrigger)
-> Ord WorkflowTrigger
WorkflowTrigger -> WorkflowTrigger -> Bool
WorkflowTrigger -> WorkflowTrigger -> Ordering
WorkflowTrigger -> WorkflowTrigger -> WorkflowTrigger
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
$ccompare :: WorkflowTrigger -> WorkflowTrigger -> Ordering
compare :: WorkflowTrigger -> WorkflowTrigger -> Ordering
$c< :: WorkflowTrigger -> WorkflowTrigger -> Bool
< :: WorkflowTrigger -> WorkflowTrigger -> Bool
$c<= :: WorkflowTrigger -> WorkflowTrigger -> Bool
<= :: WorkflowTrigger -> WorkflowTrigger -> Bool
$c> :: WorkflowTrigger -> WorkflowTrigger -> Bool
> :: WorkflowTrigger -> WorkflowTrigger -> Bool
$c>= :: WorkflowTrigger -> WorkflowTrigger -> Bool
>= :: WorkflowTrigger -> WorkflowTrigger -> Bool
$cmax :: WorkflowTrigger -> WorkflowTrigger -> WorkflowTrigger
max :: WorkflowTrigger -> WorkflowTrigger -> WorkflowTrigger
$cmin :: WorkflowTrigger -> WorkflowTrigger -> WorkflowTrigger
min :: WorkflowTrigger -> WorkflowTrigger -> WorkflowTrigger
Ord, Int -> WorkflowTrigger -> ShowS
[WorkflowTrigger] -> ShowS
WorkflowTrigger -> String
(Int -> WorkflowTrigger -> ShowS)
-> (WorkflowTrigger -> String)
-> ([WorkflowTrigger] -> ShowS)
-> Show WorkflowTrigger
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> WorkflowTrigger -> ShowS
showsPrec :: Int -> WorkflowTrigger -> ShowS
$cshow :: WorkflowTrigger -> String
show :: WorkflowTrigger -> String
$cshowList :: [WorkflowTrigger] -> ShowS
showList :: [WorkflowTrigger] -> ShowS
Show)
instance FromJSON WorkflowTrigger where
parseJSON :: Value -> Parser WorkflowTrigger
parseJSON = String
-> (Object -> Parser WorkflowTrigger)
-> Value
-> Parser WorkflowTrigger
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"WorkflowTrigger" ((Object -> Parser WorkflowTrigger)
-> Value -> Parser WorkflowTrigger)
-> (Object -> Parser WorkflowTrigger)
-> Value
-> Parser WorkflowTrigger
forall a b. (a -> b) -> a -> b
$ \Object
o -> do
Maybe (NonEmpty BranchProtectionRuleActivityType)
maybeBranchProtectionRuleActivityTypes <-
Object
-> Key
-> Parser (Maybe (NonEmpty BranchProtectionRuleActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"branch_protection_rule"
Maybe (NonEmpty CheckRunActivityType)
maybeCheckRunActivityTypes <- Object -> Key -> Parser (Maybe (NonEmpty CheckRunActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"check_run"
Maybe (NonEmpty Text)
maybeCheckSuiteActivityTypes :: Maybe (NonEmpty Text) <-
Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"check_suite"
Maybe Value
maybeCreate :: Maybe Aeson.Value <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"create"
Maybe Value
maybeDelete :: Maybe Aeson.Value <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"delete"
Maybe Value
maybeDeployment :: Maybe Aeson.Value <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"deployment"
Maybe Value
maybeDeploymentStatus :: Maybe Aeson.Value <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"deployment_status"
Maybe (NonEmpty DiscussionActivityType)
maybeDiscussionActivityTypes <-
Object -> Key -> Parser (Maybe (NonEmpty DiscussionActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"discussion"
Maybe (NonEmpty DiscussionCommentActivityType)
maybeDiscussionCommentActivityTypes <-
Object
-> Key -> Parser (Maybe (NonEmpty DiscussionCommentActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"discussion_comment"
Maybe Value
maybeFork :: Maybe Aeson.Value <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"fork"
Maybe Value
maybeGollum :: Maybe Aeson.Value <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"gollum"
Maybe (NonEmpty IssueCommentActivityType)
maybeIssueCommentActivityTypes <-
Object -> Key -> Parser (Maybe (NonEmpty IssueCommentActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"issue_comment"
Maybe (NonEmpty IssuesActivityType)
maybeIssuesActivityTypes <- Object -> Key -> Parser (Maybe (NonEmpty IssuesActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"issues"
Maybe (NonEmpty LabelActivityType)
maybeLabelActivityTypes <- Object -> Key -> Parser (Maybe (NonEmpty LabelActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"label"
Maybe (NonEmpty Text)
maybeMergeGroupChecksRequestedActivityTypes :: Maybe (NonEmpty Text) <-
Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"merge_group"
Maybe (NonEmpty MilestoneActivityType)
maybeMilestoneActivityTypes <- Object -> Key -> Parser (Maybe (NonEmpty MilestoneActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"milestone"
Maybe Value
maybePageBuild :: Maybe Aeson.Value <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"page_build"
Maybe Value
maybePublic :: Maybe Aeson.Value <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"public"
Maybe PullRequestTriggerAttributes
maybePullRequestTriggerAttributes <- Object
o Object -> Key -> Parser (Maybe PullRequestTriggerAttributes)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"pull_request"
Maybe (NonEmpty PullRequestReviewActivityType)
maybePullRequestReviewActivityTypes <-
Object
-> Key -> Parser (Maybe (NonEmpty PullRequestReviewActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"pull_request_review"
Maybe (NonEmpty PullRequestReviewCommentActivityType)
maybePullRequestReviewCommentActivityTypes <-
Object
-> Key
-> Parser (Maybe (NonEmpty PullRequestReviewCommentActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"pull_request_review_comment"
Maybe PullRequestTargetTriggerAttributes
maybePullRequestTargetTriggerAttributes <- Object
o Object -> Key -> Parser (Maybe PullRequestTargetTriggerAttributes)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"pull_request_target"
Maybe PushTriggerAttributes
maybePushTriggerAttributes <- Object
o Object -> Key -> Parser (Maybe PushTriggerAttributes)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"push"
Maybe (NonEmpty RegistryPackageActivityType)
maybeRegistryPackageActivityTypes <- Object
-> Key -> Parser (Maybe (NonEmpty RegistryPackageActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"registry_package"
Maybe (NonEmpty ReleaseActivityType)
maybeReleaseActivityTypes <- Object -> Key -> Parser (Maybe (NonEmpty ReleaseActivityType))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"release"
Maybe (NonEmpty Text)
maybeRepositoryDispatchActivityTypes :: Maybe (NonEmpty Text) <-
Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"repository_dispatch"
Maybe (NonEmpty Text)
maybeScheduleCrons <- Object -> Parser (Maybe (NonEmpty Text))
maybeScheduleCronsParser Object
o
Maybe Value
maybeStatus :: Maybe Aeson.Value <- Object
o Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"status"
Maybe (NonEmpty Text)
maybeWatchStartedActivityTypes :: Maybe (NonEmpty Text) <-
Object -> Key -> Parser (Maybe (NonEmpty Text))
forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
"watch"
Maybe WorkflowCallAttributes
maybeWorkflowCall <- Object
o Object -> Key -> Parser (Maybe WorkflowCallAttributes)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"workflow_call"
Maybe WorkflowDispatchAttributes
maybeWorkflowDispatch <- Object
o Object -> Key -> Parser (Maybe WorkflowDispatchAttributes)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"workflow_dispatch"
Maybe WorkflowRunTriggerAttributes
maybeWorkflowRun <- Object
o Object -> Key -> Parser (Maybe WorkflowRunTriggerAttributes)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"workflow_run"
Either String WorkflowTrigger -> Parser WorkflowTrigger
forall (t :: * -> *) (m :: * -> *) a.
(PluckError String t m, MonadFail m) =>
t a -> m a
hoistFail'
(Either String WorkflowTrigger -> Parser WorkflowTrigger)
-> (Maybe (Either String WorkflowTrigger)
-> Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Parser WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Either String WorkflowTrigger
-> Maybe (Either String WorkflowTrigger)
-> Either String WorkflowTrigger
forall a. a -> Maybe a -> a
fromMaybe (String -> Either String WorkflowTrigger
forall a b. a -> Either a b
Left [i|Invalid workflow trigger (`on` property):\n#{AesonKeyMap.keys o}|])
(Maybe (Either String WorkflowTrigger) -> Parser WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger) -> Parser WorkflowTrigger
forall a b. (a -> b) -> a -> b
$ (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty BranchProtectionRuleActivityType -> WorkflowTrigger)
-> NonEmpty BranchProtectionRuleActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty BranchProtectionRuleActivityType -> WorkflowTrigger
BranchProtectionRuleTrigger (NonEmpty BranchProtectionRuleActivityType
-> Either String WorkflowTrigger)
-> Maybe (NonEmpty BranchProtectionRuleActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty BranchProtectionRuleActivityType)
maybeBranchProtectionRuleActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty CheckRunActivityType -> WorkflowTrigger)
-> NonEmpty CheckRunActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty CheckRunActivityType -> WorkflowTrigger
CheckRunTrigger (NonEmpty CheckRunActivityType -> Either String WorkflowTrigger)
-> Maybe (NonEmpty CheckRunActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty CheckRunActivityType)
maybeCheckRunActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> ( WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
CheckSuiteCompletedTrigger
Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard
(Maybe (NonEmpty Text)
maybeCheckSuiteActivityTypes Maybe (NonEmpty Text) -> Maybe (NonEmpty Text) -> Bool
forall a. Eq a => a -> a -> Bool
== NonEmpty Text -> Maybe (NonEmpty Text)
forall a. a -> Maybe a
Just (Text
"completed" Text -> [Text] -> NonEmpty Text
forall a. a -> [a] -> NonEmpty a
:| []))
)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
CreateTrigger Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust Maybe Value
maybeCreate))
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
DeleteTrigger Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust Maybe Value
maybeDelete))
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
DeploymentTrigger Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust Maybe Value
maybeDeployment))
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
DeploymentStatusTrigger Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust Maybe Value
maybeDeploymentStatus))
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty DiscussionActivityType -> WorkflowTrigger)
-> NonEmpty DiscussionActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty DiscussionActivityType -> WorkflowTrigger
DiscussionTrigger (NonEmpty DiscussionActivityType -> Either String WorkflowTrigger)
-> Maybe (NonEmpty DiscussionActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty DiscussionActivityType)
maybeDiscussionActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty DiscussionCommentActivityType -> WorkflowTrigger)
-> NonEmpty DiscussionCommentActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty DiscussionCommentActivityType -> WorkflowTrigger
DiscussionCommentTrigger (NonEmpty DiscussionCommentActivityType
-> Either String WorkflowTrigger)
-> Maybe (NonEmpty DiscussionCommentActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty DiscussionCommentActivityType)
maybeDiscussionCommentActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
ForkTrigger Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust Maybe Value
maybeFork))
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
GollumTrigger Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust Maybe Value
maybeGollum))
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty IssueCommentActivityType -> WorkflowTrigger)
-> NonEmpty IssueCommentActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty IssueCommentActivityType -> WorkflowTrigger
IssueCommentTrigger (NonEmpty IssueCommentActivityType
-> Either String WorkflowTrigger)
-> Maybe (NonEmpty IssueCommentActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty IssueCommentActivityType)
maybeIssueCommentActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty IssuesActivityType -> WorkflowTrigger)
-> NonEmpty IssuesActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty IssuesActivityType -> WorkflowTrigger
IssuesTrigger (NonEmpty IssuesActivityType -> Either String WorkflowTrigger)
-> Maybe (NonEmpty IssuesActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty IssuesActivityType)
maybeIssuesActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty LabelActivityType -> WorkflowTrigger)
-> NonEmpty LabelActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty LabelActivityType -> WorkflowTrigger
LabelTrigger (NonEmpty LabelActivityType -> Either String WorkflowTrigger)
-> Maybe (NonEmpty LabelActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty LabelActivityType)
maybeLabelActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> ( WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
MergeGroupChecksRequestedTrigger
Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard
(Maybe (NonEmpty Text)
maybeMergeGroupChecksRequestedActivityTypes Maybe (NonEmpty Text) -> Maybe (NonEmpty Text) -> Bool
forall a. Eq a => a -> a -> Bool
== NonEmpty Text -> Maybe (NonEmpty Text)
forall a. a -> Maybe a
Just (Text
"checks_requested" Text -> [Text] -> NonEmpty Text
forall a. a -> [a] -> NonEmpty a
:| []))
)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty MilestoneActivityType -> WorkflowTrigger)
-> NonEmpty MilestoneActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty MilestoneActivityType -> WorkflowTrigger
MilestoneTrigger (NonEmpty MilestoneActivityType -> Either String WorkflowTrigger)
-> Maybe (NonEmpty MilestoneActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty MilestoneActivityType)
maybeMilestoneActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
PageBuildTrigger Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust Maybe Value
maybePageBuild))
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
PublicTrigger Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust Maybe Value
maybePublic))
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (PullRequestTriggerAttributes -> WorkflowTrigger)
-> PullRequestTriggerAttributes
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PullRequestTriggerAttributes -> WorkflowTrigger
PullRequestTrigger (PullRequestTriggerAttributes -> Either String WorkflowTrigger)
-> Maybe PullRequestTriggerAttributes
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe PullRequestTriggerAttributes
maybePullRequestTriggerAttributes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty PullRequestReviewActivityType -> WorkflowTrigger)
-> NonEmpty PullRequestReviewActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty PullRequestReviewActivityType -> WorkflowTrigger
PullRequestReviewTrigger (NonEmpty PullRequestReviewActivityType
-> Either String WorkflowTrigger)
-> Maybe (NonEmpty PullRequestReviewActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty PullRequestReviewActivityType)
maybePullRequestReviewActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty PullRequestReviewCommentActivityType
-> WorkflowTrigger)
-> NonEmpty PullRequestReviewCommentActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty PullRequestReviewCommentActivityType -> WorkflowTrigger
PullRequestReviewCommentTrigger (NonEmpty PullRequestReviewCommentActivityType
-> Either String WorkflowTrigger)
-> Maybe (NonEmpty PullRequestReviewCommentActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty PullRequestReviewCommentActivityType)
maybePullRequestReviewCommentActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (PullRequestTargetTriggerAttributes -> WorkflowTrigger)
-> PullRequestTargetTriggerAttributes
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PullRequestTargetTriggerAttributes -> WorkflowTrigger
PullRequestTargetTrigger (PullRequestTargetTriggerAttributes
-> Either String WorkflowTrigger)
-> Maybe PullRequestTargetTriggerAttributes
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe PullRequestTargetTriggerAttributes
maybePullRequestTargetTriggerAttributes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (PushTriggerAttributes -> WorkflowTrigger)
-> PushTriggerAttributes
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PushTriggerAttributes -> WorkflowTrigger
PushTrigger (PushTriggerAttributes -> Either String WorkflowTrigger)
-> Maybe PushTriggerAttributes
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe PushTriggerAttributes
maybePushTriggerAttributes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty RegistryPackageActivityType -> WorkflowTrigger)
-> NonEmpty RegistryPackageActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty RegistryPackageActivityType -> WorkflowTrigger
RegistryPackageTrigger (NonEmpty RegistryPackageActivityType
-> Either String WorkflowTrigger)
-> Maybe (NonEmpty RegistryPackageActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty RegistryPackageActivityType)
maybeRegistryPackageActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty ReleaseActivityType -> WorkflowTrigger)
-> NonEmpty ReleaseActivityType
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty ReleaseActivityType -> WorkflowTrigger
ReleaseTrigger (NonEmpty ReleaseActivityType -> Either String WorkflowTrigger)
-> Maybe (NonEmpty ReleaseActivityType)
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty ReleaseActivityType)
maybeReleaseActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty Text -> WorkflowTrigger)
-> NonEmpty Text
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty Text -> WorkflowTrigger
RepositoryDispatchTrigger (NonEmpty Text -> Either String WorkflowTrigger)
-> Maybe (NonEmpty Text) -> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
maybeRepositoryDispatchActivityTypes)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (NonEmpty Text -> WorkflowTrigger)
-> NonEmpty Text
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. NonEmpty Text -> WorkflowTrigger
ScheduleTrigger (NonEmpty Text -> Either String WorkflowTrigger)
-> Maybe (NonEmpty Text) -> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe (NonEmpty Text)
maybeScheduleCrons)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
StatusTrigger Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard (Maybe Value -> Bool
forall a. Maybe a -> Bool
isJust Maybe Value
maybeStatus))
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> ( WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right WorkflowTrigger
WatchStartedTrigger
Either String WorkflowTrigger
-> Maybe () -> Maybe (Either String WorkflowTrigger)
forall a b. a -> Maybe b -> Maybe a
forall (f :: * -> *) a b. Functor f => a -> f b -> f a
<$ Bool -> Maybe ()
forall (f :: * -> *). Alternative f => Bool -> f ()
guard
(Maybe (NonEmpty Text)
maybeWatchStartedActivityTypes Maybe (NonEmpty Text) -> Maybe (NonEmpty Text) -> Bool
forall a. Eq a => a -> a -> Bool
== NonEmpty Text -> Maybe (NonEmpty Text)
forall a. a -> Maybe a
Just (Text
"started" Text -> [Text] -> NonEmpty Text
forall a. a -> [a] -> NonEmpty a
:| []))
)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (WorkflowCallAttributes -> WorkflowTrigger)
-> WorkflowCallAttributes
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WorkflowCallAttributes -> WorkflowTrigger
WorkflowCallTrigger (WorkflowCallAttributes -> Either String WorkflowTrigger)
-> Maybe WorkflowCallAttributes
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe WorkflowCallAttributes
maybeWorkflowCall)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (WorkflowDispatchAttributes -> WorkflowTrigger)
-> WorkflowDispatchAttributes
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WorkflowDispatchAttributes -> WorkflowTrigger
WorkflowDispatchTrigger (WorkflowDispatchAttributes -> Either String WorkflowTrigger)
-> Maybe WorkflowDispatchAttributes
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe WorkflowDispatchAttributes
maybeWorkflowDispatch)
Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
-> Maybe (Either String WorkflowTrigger)
forall a. Maybe a -> Maybe a -> Maybe a
forall (f :: * -> *) a. Alternative f => f a -> f a -> f a
<|> (WorkflowTrigger -> Either String WorkflowTrigger
forall a b. b -> Either a b
Right (WorkflowTrigger -> Either String WorkflowTrigger)
-> (WorkflowRunTriggerAttributes -> WorkflowTrigger)
-> WorkflowRunTriggerAttributes
-> Either String WorkflowTrigger
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WorkflowRunTriggerAttributes -> WorkflowTrigger
WorkflowRunTrigger (WorkflowRunTriggerAttributes -> Either String WorkflowTrigger)
-> Maybe WorkflowRunTriggerAttributes
-> Maybe (Either String WorkflowTrigger)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Maybe WorkflowRunTriggerAttributes
maybeWorkflowRun)
where
maybeActivityTypesInNestedObject ::
(FromJSON a) =>
Aeson.Object ->
Aeson.Key ->
Aeson.Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject :: forall a.
FromJSON a =>
Object -> Key -> Parser (Maybe (NonEmpty a))
maybeActivityTypesInNestedObject Object
o Key
attributeName =
Object
o
Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
attributeName
Parser (Maybe Value)
-> (Maybe Value -> Parser (Maybe (NonEmpty a)))
-> Parser (Maybe (NonEmpty a))
forall a b. Parser a -> (a -> Parser b) -> Parser b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Parser (Maybe (NonEmpty a))
-> (Value -> Parser (Maybe (NonEmpty a)))
-> Maybe Value
-> Parser (Maybe (NonEmpty a))
forall b a. b -> (a -> b) -> Maybe a -> b
maybe
(Maybe (NonEmpty a) -> Parser (Maybe (NonEmpty a))
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe (NonEmpty a)
forall a. Maybe a
Nothing)
(String
-> (Object -> Parser (Maybe (NonEmpty a)))
-> Value
-> Parser (Maybe (NonEmpty a))
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"ActivityTypes" (Object -> Key -> Parser (Maybe (NonEmpty a))
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"types"))
maybeScheduleCronsParser :: Aeson.Object -> Aeson.Parser (Maybe (NonEmpty Text))
maybeScheduleCronsParser :: Object -> Parser (Maybe (NonEmpty Text))
maybeScheduleCronsParser Object
o =
Object
o
Object -> Key -> Parser (Maybe Value)
forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
.:? Key
"schedule"
Parser (Maybe Value)
-> (Maybe Value -> Parser (Maybe (NonEmpty Text)))
-> Parser (Maybe (NonEmpty Text))
forall a b. Parser a -> (a -> Parser b) -> Parser b
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= Parser (Maybe (NonEmpty Text))
-> (Value -> Parser (Maybe (NonEmpty Text)))
-> Maybe Value
-> Parser (Maybe (NonEmpty Text))
forall b a. b -> (a -> b) -> Maybe a -> b
maybe
(Maybe (NonEmpty Text) -> Parser (Maybe (NonEmpty Text))
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure Maybe (NonEmpty Text)
forall a. Maybe a
Nothing)
( String
-> (Array -> Parser (Maybe (NonEmpty Text)))
-> Value
-> Parser (Maybe (NonEmpty Text))
forall a. String -> (Array -> Parser a) -> Value -> Parser a
Aeson.withArray String
"Crons" ((Array -> Parser (Maybe (NonEmpty Text)))
-> Value -> Parser (Maybe (NonEmpty Text)))
-> (Array -> Parser (Maybe (NonEmpty Text)))
-> Value
-> Parser (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ \Array
a ->
([Text] -> Maybe (NonEmpty Text))
-> Parser [Text] -> Parser (Maybe (NonEmpty Text))
forall a b. (a -> b) -> Parser a -> Parser b
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap [Text] -> Maybe (NonEmpty Text)
forall a. [a] -> Maybe (NonEmpty a)
nonEmpty (Parser [Text] -> Parser (Maybe (NonEmpty Text)))
-> ((Value -> Parser Text) -> Parser [Text])
-> (Value -> Parser Text)
-> Parser (Maybe (NonEmpty Text))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Value] -> (Value -> Parser Text) -> Parser [Text]
forall (t :: * -> *) (f :: * -> *) a b.
(Traversable t, Applicative f) =>
t a -> (a -> f b) -> f (t b)
for (Array -> [Value]
forall a. Vector a -> [a]
Vector.toList Array
a) ((Value -> Parser Text) -> Parser (Maybe (NonEmpty Text)))
-> (Value -> Parser Text) -> Parser (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$
String -> (Object -> Parser Text) -> Value -> Parser Text
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Aeson.withObject String
"Cron" (Object -> Key -> Parser Text
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"cron")
)
instance ToJSONKey WorkflowTrigger where
toJSONKey :: ToJSONKeyFunction WorkflowTrigger
toJSONKey =
(WorkflowTrigger -> Text) -> ToJSONKeyFunction WorkflowTrigger
forall a. (a -> Text) -> ToJSONKeyFunction a
Aeson.toJSONKeyText ((WorkflowTrigger -> Text) -> ToJSONKeyFunction WorkflowTrigger)
-> (WorkflowTrigger -> Text) -> ToJSONKeyFunction WorkflowTrigger
forall a b. (a -> b) -> a -> b
$ \case
BranchProtectionRuleTrigger NonEmpty BranchProtectionRuleActivityType
_ -> Text
"branch_protection_rule"
CheckRunTrigger NonEmpty CheckRunActivityType
_ -> Text
"check_run"
WorkflowTrigger
CheckSuiteCompletedTrigger -> Text
"check_suite"
WorkflowTrigger
CreateTrigger -> Text
"create"
WorkflowTrigger
DeleteTrigger -> Text
"delete"
WorkflowTrigger
DeploymentTrigger -> Text
"deployment"
WorkflowTrigger
DeploymentStatusTrigger -> Text
"deployment_status"
DiscussionTrigger NonEmpty DiscussionActivityType
_ -> Text
"discussion"
DiscussionCommentTrigger NonEmpty DiscussionCommentActivityType
_ -> Text
"discussion_comment"
WorkflowTrigger
ForkTrigger -> Text
"fork"
WorkflowTrigger
GollumTrigger -> Text
"gollum"
IssueCommentTrigger NonEmpty IssueCommentActivityType
_ -> Text
"issue_comment"
IssuesTrigger NonEmpty IssuesActivityType
_ -> Text
"issues"
LabelTrigger NonEmpty LabelActivityType
_ -> Text
"label"
WorkflowTrigger
MergeGroupChecksRequestedTrigger -> Text
"merge_group"
MilestoneTrigger NonEmpty MilestoneActivityType
_ -> Text
"milestone"
WorkflowTrigger
PageBuildTrigger -> Text
"page_build"
WorkflowTrigger
PublicTrigger -> Text
"public"
PullRequestTrigger PullRequestTriggerAttributes
_ -> Text
"pull_request"
PullRequestReviewTrigger NonEmpty PullRequestReviewActivityType
_ -> Text
"pull_request_review"
PullRequestReviewCommentTrigger NonEmpty PullRequestReviewCommentActivityType
_ -> Text
"pull_request_review_comment"
PullRequestTargetTrigger PullRequestTargetTriggerAttributes
_ -> Text
"pull_request_target"
PushTrigger PushTriggerAttributes
_ -> Text
"push"
RegistryPackageTrigger NonEmpty RegistryPackageActivityType
_ -> Text
"registry_package"
ReleaseTrigger NonEmpty ReleaseActivityType
_ -> Text
"release"
RepositoryDispatchTrigger NonEmpty Text
_ -> Text
"repository_dispatch"
ScheduleTrigger NonEmpty Text
_ -> Text
"schedule"
WorkflowTrigger
StatusTrigger -> Text
"status"
WorkflowTrigger
WatchStartedTrigger -> Text
"watch"
WorkflowCallTrigger WorkflowCallAttributes
_ -> Text
"workflow_call"
WorkflowDispatchTrigger WorkflowDispatchAttributes
_ -> Text
"workflow_dispatch"
WorkflowRunTrigger WorkflowRunTriggerAttributes
_ -> Text
"workflow_run"
instance ToJSON WorkflowTrigger where
toJSON :: WorkflowTrigger -> Value
toJSON WorkflowTrigger
trigger =
Map WorkflowTrigger Value -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON (Map WorkflowTrigger Value -> Value)
-> (Value -> Map WorkflowTrigger Value) -> Value -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. WorkflowTrigger -> Value -> Map WorkflowTrigger Value
forall k a. k -> a -> Map k a
Map.singleton WorkflowTrigger
trigger (Value -> Value) -> Value -> Value
forall a b. (a -> b) -> a -> b
$ case WorkflowTrigger
trigger of
BranchProtectionRuleTrigger NonEmpty BranchProtectionRuleActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty BranchProtectionRuleActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty BranchProtectionRuleActivityType
activityTypes]
CheckRunTrigger NonEmpty CheckRunActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty CheckRunActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty CheckRunActivityType
activityTypes]
WorkflowTrigger
CheckSuiteCompletedTrigger ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> [Value] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [Text -> Value
Aeson.String Text
"completed"]]
WorkflowTrigger
CreateTrigger ->
[Pair] -> Value
Aeson.object []
WorkflowTrigger
DeleteTrigger ->
[Pair] -> Value
Aeson.object []
WorkflowTrigger
DeploymentTrigger ->
[Pair] -> Value
Aeson.object []
WorkflowTrigger
DeploymentStatusTrigger ->
[Pair] -> Value
Aeson.object []
DiscussionTrigger NonEmpty DiscussionActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty DiscussionActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty DiscussionActivityType
activityTypes]
DiscussionCommentTrigger NonEmpty DiscussionCommentActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty DiscussionCommentActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty DiscussionCommentActivityType
activityTypes]
WorkflowTrigger
ForkTrigger ->
[Pair] -> Value
Aeson.object []
WorkflowTrigger
GollumTrigger ->
[Pair] -> Value
Aeson.object []
IssueCommentTrigger NonEmpty IssueCommentActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty IssueCommentActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty IssueCommentActivityType
activityTypes]
IssuesTrigger NonEmpty IssuesActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty IssuesActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty IssuesActivityType
activityTypes]
LabelTrigger NonEmpty LabelActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty LabelActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty LabelActivityType
activityTypes]
WorkflowTrigger
MergeGroupChecksRequestedTrigger ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> [Value] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [Text -> Value
Aeson.String Text
"checks_requested"]]
MilestoneTrigger NonEmpty MilestoneActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty MilestoneActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty MilestoneActivityType
activityTypes]
WorkflowTrigger
PageBuildTrigger ->
[Pair] -> Value
Aeson.object []
WorkflowTrigger
PublicTrigger ->
[Pair] -> Value
Aeson.object []
PullRequestTrigger PullRequestTriggerAttributes
attrs ->
PullRequestTriggerAttributes -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON PullRequestTriggerAttributes
attrs
PullRequestReviewTrigger NonEmpty PullRequestReviewActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty PullRequestReviewActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty PullRequestReviewActivityType
activityTypes]
PullRequestReviewCommentTrigger NonEmpty PullRequestReviewCommentActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty PullRequestReviewCommentActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty PullRequestReviewCommentActivityType
activityTypes]
PullRequestTargetTrigger PullRequestTargetTriggerAttributes
attrs ->
PullRequestTargetTriggerAttributes -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON PullRequestTargetTriggerAttributes
attrs
PushTrigger PushTriggerAttributes
attrs ->
PushTriggerAttributes -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON PushTriggerAttributes
attrs
RegistryPackageTrigger NonEmpty RegistryPackageActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty RegistryPackageActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty RegistryPackageActivityType
activityTypes]
ReleaseTrigger NonEmpty ReleaseActivityType
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty ReleaseActivityType -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty ReleaseActivityType
activityTypes]
RepositoryDispatchTrigger NonEmpty Text
activityTypes ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> NonEmpty Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= NonEmpty Text
activityTypes]
ScheduleTrigger NonEmpty Text
crons ->
NonEmpty Value -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON (NonEmpty Value -> Value) -> NonEmpty Value -> Value
forall a b. (a -> b) -> a -> b
$ (\Text
cron -> [Pair] -> Value
Aeson.object [Key
"cron" Key -> Text -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= Text
cron]) (Text -> Value) -> NonEmpty Text -> NonEmpty Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> NonEmpty Text
crons
WorkflowTrigger
StatusTrigger ->
[Pair] -> Value
Aeson.object []
WorkflowTrigger
WatchStartedTrigger ->
[Pair] -> Value
Aeson.object [Key
"types" Key -> [Value] -> Pair
forall v. ToJSON v => Key -> v -> Pair
forall e kv v. (KeyValue e kv, ToJSON v) => Key -> v -> kv
.= [Text -> Value
Aeson.String Text
"started"]]
WorkflowCallTrigger WorkflowCallAttributes
attrs ->
WorkflowCallAttributes -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON WorkflowCallAttributes
attrs
WorkflowDispatchTrigger WorkflowDispatchAttributes
attrs ->
WorkflowDispatchAttributes -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON WorkflowDispatchAttributes
attrs
WorkflowRunTrigger WorkflowRunTriggerAttributes
attrs ->
WorkflowRunTriggerAttributes -> Value
forall a. ToJSON a => a -> Value
Aeson.toJSON WorkflowRunTriggerAttributes
attrs
gen :: (MonadGen m) => m WorkflowTrigger
gen :: forall (m :: * -> *). MonadGen m => m WorkflowTrigger
gen =
[m WorkflowTrigger] -> m WorkflowTrigger
forall (m :: * -> *) a. MonadGen m => [m a] -> m a
Gen.choice
[ NonEmpty BranchProtectionRuleActivityType -> WorkflowTrigger
BranchProtectionRuleTrigger (NonEmpty BranchProtectionRuleActivityType -> WorkflowTrigger)
-> m (NonEmpty BranchProtectionRuleActivityType)
-> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m BranchProtectionRuleActivityType
-> m (NonEmpty BranchProtectionRuleActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m BranchProtectionRuleActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
NonEmpty CheckRunActivityType -> WorkflowTrigger
CheckRunTrigger (NonEmpty CheckRunActivityType -> WorkflowTrigger)
-> m (NonEmpty CheckRunActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m CheckRunActivityType -> m (NonEmpty CheckRunActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m CheckRunActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
CheckSuiteCompletedTrigger,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
CreateTrigger,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
DeleteTrigger,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
DeploymentTrigger,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
DeploymentStatusTrigger,
NonEmpty DiscussionActivityType -> WorkflowTrigger
DiscussionTrigger (NonEmpty DiscussionActivityType -> WorkflowTrigger)
-> m (NonEmpty DiscussionActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m DiscussionActivityType -> m (NonEmpty DiscussionActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m DiscussionActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
NonEmpty DiscussionCommentActivityType -> WorkflowTrigger
DiscussionCommentTrigger (NonEmpty DiscussionCommentActivityType -> WorkflowTrigger)
-> m (NonEmpty DiscussionCommentActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m DiscussionCommentActivityType
-> m (NonEmpty DiscussionCommentActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m DiscussionCommentActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
ForkTrigger,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
GollumTrigger,
NonEmpty IssueCommentActivityType -> WorkflowTrigger
IssueCommentTrigger (NonEmpty IssueCommentActivityType -> WorkflowTrigger)
-> m (NonEmpty IssueCommentActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m IssueCommentActivityType
-> m (NonEmpty IssueCommentActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m IssueCommentActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
NonEmpty IssuesActivityType -> WorkflowTrigger
IssuesTrigger (NonEmpty IssuesActivityType -> WorkflowTrigger)
-> m (NonEmpty IssuesActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m IssuesActivityType -> m (NonEmpty IssuesActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m IssuesActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
NonEmpty LabelActivityType -> WorkflowTrigger
LabelTrigger (NonEmpty LabelActivityType -> WorkflowTrigger)
-> m (NonEmpty LabelActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int -> m LabelActivityType -> m (NonEmpty LabelActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m LabelActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
MergeGroupChecksRequestedTrigger,
NonEmpty MilestoneActivityType -> WorkflowTrigger
MilestoneTrigger (NonEmpty MilestoneActivityType -> WorkflowTrigger)
-> m (NonEmpty MilestoneActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m MilestoneActivityType -> m (NonEmpty MilestoneActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m MilestoneActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
PageBuildTrigger,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
PublicTrigger,
PullRequestTriggerAttributes -> WorkflowTrigger
PullRequestTrigger (PullRequestTriggerAttributes -> WorkflowTrigger)
-> m PullRequestTriggerAttributes -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m PullRequestTriggerAttributes
forall (m :: * -> *). MonadGen m => m PullRequestTriggerAttributes
genPullRequestTriggerAttributes,
NonEmpty PullRequestReviewActivityType -> WorkflowTrigger
PullRequestReviewTrigger (NonEmpty PullRequestReviewActivityType -> WorkflowTrigger)
-> m (NonEmpty PullRequestReviewActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m PullRequestReviewActivityType
-> m (NonEmpty PullRequestReviewActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m PullRequestReviewActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
NonEmpty PullRequestReviewCommentActivityType -> WorkflowTrigger
PullRequestReviewCommentTrigger (NonEmpty PullRequestReviewCommentActivityType -> WorkflowTrigger)
-> m (NonEmpty PullRequestReviewCommentActivityType)
-> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m PullRequestReviewCommentActivityType
-> m (NonEmpty PullRequestReviewCommentActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m PullRequestReviewCommentActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
PullRequestTargetTriggerAttributes -> WorkflowTrigger
PullRequestTargetTrigger (PullRequestTargetTriggerAttributes -> WorkflowTrigger)
-> m PullRequestTargetTriggerAttributes -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m PullRequestTargetTriggerAttributes
forall (m :: * -> *).
MonadGen m =>
m PullRequestTargetTriggerAttributes
genPullRequestTargetAttributes,
PushTriggerAttributes -> WorkflowTrigger
PushTrigger (PushTriggerAttributes -> WorkflowTrigger)
-> m PushTriggerAttributes -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m PushTriggerAttributes
forall (m :: * -> *). MonadGen m => m PushTriggerAttributes
genPushTriggerAttributes,
NonEmpty RegistryPackageActivityType -> WorkflowTrigger
RegistryPackageTrigger (NonEmpty RegistryPackageActivityType -> WorkflowTrigger)
-> m (NonEmpty RegistryPackageActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m RegistryPackageActivityType
-> m (NonEmpty RegistryPackageActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m RegistryPackageActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
NonEmpty ReleaseActivityType -> WorkflowTrigger
ReleaseTrigger (NonEmpty ReleaseActivityType -> WorkflowTrigger)
-> m (NonEmpty ReleaseActivityType) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int
-> m ReleaseActivityType -> m (NonEmpty ReleaseActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m ReleaseActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded,
NonEmpty Text -> WorkflowTrigger
RepositoryDispatchTrigger (NonEmpty Text -> WorkflowTrigger)
-> m (NonEmpty Text) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m Text
forall (m :: * -> *). MonadGen m => m Text
genText,
NonEmpty Text -> WorkflowTrigger
ScheduleTrigger (NonEmpty Text -> WorkflowTrigger)
-> m (NonEmpty Text) -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
StatusTrigger,
WorkflowTrigger -> m WorkflowTrigger
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowTrigger
WatchStartedTrigger,
WorkflowCallAttributes -> WorkflowTrigger
WorkflowCallTrigger (WorkflowCallAttributes -> WorkflowTrigger)
-> m WorkflowCallAttributes -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m WorkflowCallAttributes
forall (m :: * -> *). MonadGen m => m WorkflowCallAttributes
genWorkflowCallAttributes,
WorkflowDispatchAttributes -> WorkflowTrigger
WorkflowDispatchTrigger (WorkflowDispatchAttributes -> WorkflowTrigger)
-> m WorkflowDispatchAttributes -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m WorkflowDispatchAttributes
forall (m :: * -> *). MonadGen m => m WorkflowDispatchAttributes
genWorkflowDispatchAttributes,
WorkflowRunTriggerAttributes -> WorkflowTrigger
WorkflowRunTrigger (WorkflowRunTriggerAttributes -> WorkflowTrigger)
-> m WorkflowRunTriggerAttributes -> m WorkflowTrigger
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> m WorkflowRunTriggerAttributes
forall (m :: * -> *). MonadGen m => m WorkflowRunTriggerAttributes
genWorkflowRunTriggerAttributes
]
genText :: (MonadGen m) => m Text
genText :: forall (m :: * -> *). MonadGen m => m Text
genText = Range Int -> m Char -> m Text
forall (m :: * -> *). MonadGen m => Range Int -> m Char -> m Text
Gen.text (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Char
forall (m :: * -> *). MonadGen m => m Char
Gen.alphaNum
genMap :: (MonadGen m) => m a -> m (Map Text a)
genMap :: forall (m :: * -> *) a. MonadGen m => m a -> m (Map Text a)
genMap m a
ga = Range Int -> m (Text, a) -> m (Map Text a)
forall (m :: * -> *) k v.
(MonadGen m, Ord k) =>
Range Int -> m (k, v) -> m (Map k v)
Gen.map (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) (m (Text, a) -> m (Map Text a)) -> m (Text, a) -> m (Map Text a)
forall a b. (a -> b) -> a -> b
$ (Text -> a -> (Text, a)) -> m Text -> m a -> m (Text, a)
forall a b c. (a -> b -> c) -> m a -> m b -> m c
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 (,) m Text
forall (m :: * -> *). MonadGen m => m Text
genText m a
ga
genPullRequestTargetAttributes :: (MonadGen m) => m PullRequestTargetTriggerAttributes
genPullRequestTargetAttributes :: forall (m :: * -> *).
MonadGen m =>
m PullRequestTargetTriggerAttributes
genPullRequestTargetAttributes = do
Maybe (NonEmpty PullRequestTargetActivityType)
activityTypes <-
m (NonEmpty PullRequestTargetActivityType)
-> m (Maybe (NonEmpty PullRequestTargetActivityType))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty PullRequestTargetActivityType)
-> m (Maybe (NonEmpty PullRequestTargetActivityType)))
-> m (NonEmpty PullRequestTargetActivityType)
-> m (Maybe (NonEmpty PullRequestTargetActivityType))
forall a b. (a -> b) -> a -> b
$
Range Int
-> m PullRequestTargetActivityType
-> m (NonEmpty PullRequestTargetActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m PullRequestTargetActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded
Maybe (NonEmpty Text)
branches <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
branchesIgnore <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
paths <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
pathsIgnore <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
PullRequestTargetTriggerAttributes
-> m PullRequestTargetTriggerAttributes
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PullRequestTargetTriggerAttributes {Maybe (NonEmpty Text)
Maybe (NonEmpty PullRequestTargetActivityType)
activityTypes :: Maybe (NonEmpty PullRequestTargetActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
activityTypes :: Maybe (NonEmpty PullRequestTargetActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
..}
genPullRequestTriggerAttributes :: (MonadGen m) => m PullRequestTriggerAttributes
genPullRequestTriggerAttributes :: forall (m :: * -> *). MonadGen m => m PullRequestTriggerAttributes
genPullRequestTriggerAttributes = do
Maybe (NonEmpty PullRequestActivityType)
activityTypes <-
m (NonEmpty PullRequestActivityType)
-> m (Maybe (NonEmpty PullRequestActivityType))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty PullRequestActivityType)
-> m (Maybe (NonEmpty PullRequestActivityType)))
-> m (NonEmpty PullRequestActivityType)
-> m (Maybe (NonEmpty PullRequestActivityType))
forall a b. (a -> b) -> a -> b
$
Range Int
-> m PullRequestActivityType
-> m (NonEmpty PullRequestActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m PullRequestActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded
Maybe (NonEmpty Text)
branches <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
branchesIgnore <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
paths <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
pathsIgnore <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
PullRequestTriggerAttributes -> m PullRequestTriggerAttributes
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PullRequestTriggerAttributes {Maybe (NonEmpty Text)
Maybe (NonEmpty PullRequestActivityType)
activityTypes :: Maybe (NonEmpty PullRequestActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
activityTypes :: Maybe (NonEmpty PullRequestActivityType)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
..}
genPushTriggerAttributes :: (MonadGen m) => m PushTriggerAttributes
genPushTriggerAttributes :: forall (m :: * -> *). MonadGen m => m PushTriggerAttributes
genPushTriggerAttributes = do
Maybe (NonEmpty Text)
branches <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
branchesIgnore <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
paths <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
pathsIgnore <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
tags <-
m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
PushTriggerAttributes -> m PushTriggerAttributes
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure PushTriggerAttributes {Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
tags :: Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
paths :: Maybe (NonEmpty Text)
pathsIgnore :: Maybe (NonEmpty Text)
tags :: Maybe (NonEmpty Text)
..}
genWorkflowCallAttributes :: (MonadGen m) => m WorkflowCallAttributes
genWorkflowCallAttributes :: forall (m :: * -> *). MonadGen m => m WorkflowCallAttributes
genWorkflowCallAttributes = do
Maybe (Map Text WorkflowCallInput)
inputs <- m (Map Text WorkflowCallInput)
-> m (Maybe (Map Text WorkflowCallInput))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (Map Text WorkflowCallInput)
-> m (Maybe (Map Text WorkflowCallInput)))
-> m (Map Text WorkflowCallInput)
-> m (Maybe (Map Text WorkflowCallInput))
forall a b. (a -> b) -> a -> b
$ m WorkflowCallInput -> m (Map Text WorkflowCallInput)
forall (m :: * -> *) a. MonadGen m => m a -> m (Map Text a)
genMap m WorkflowCallInput
forall (m :: * -> *). MonadGen m => m WorkflowCallInput
genWorkflowCallInput
Maybe (Map Text WorkflowCallOutput)
outputs <- m (Map Text WorkflowCallOutput)
-> m (Maybe (Map Text WorkflowCallOutput))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (Map Text WorkflowCallOutput)
-> m (Maybe (Map Text WorkflowCallOutput)))
-> m (Map Text WorkflowCallOutput)
-> m (Maybe (Map Text WorkflowCallOutput))
forall a b. (a -> b) -> a -> b
$ m WorkflowCallOutput -> m (Map Text WorkflowCallOutput)
forall (m :: * -> *) a. MonadGen m => m a -> m (Map Text a)
genMap m WorkflowCallOutput
forall (m :: * -> *). MonadGen m => m WorkflowCallOutput
genWorkflowCallOutput
Maybe (Map Text WorkflowCallSecret)
secrets <- m (Map Text WorkflowCallSecret)
-> m (Maybe (Map Text WorkflowCallSecret))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (Map Text WorkflowCallSecret)
-> m (Maybe (Map Text WorkflowCallSecret)))
-> m (Map Text WorkflowCallSecret)
-> m (Maybe (Map Text WorkflowCallSecret))
forall a b. (a -> b) -> a -> b
$ m WorkflowCallSecret -> m (Map Text WorkflowCallSecret)
forall (m :: * -> *) a. MonadGen m => m a -> m (Map Text a)
genMap m WorkflowCallSecret
forall (m :: * -> *). MonadGen m => m WorkflowCallSecret
genWorkflowCallSecret
WorkflowCallAttributes -> m WorkflowCallAttributes
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowCallAttributes {Maybe (Map Text WorkflowCallSecret)
Maybe (Map Text WorkflowCallOutput)
Maybe (Map Text WorkflowCallInput)
inputs :: Maybe (Map Text WorkflowCallInput)
outputs :: Maybe (Map Text WorkflowCallOutput)
secrets :: Maybe (Map Text WorkflowCallSecret)
inputs :: Maybe (Map Text WorkflowCallInput)
outputs :: Maybe (Map Text WorkflowCallOutput)
secrets :: Maybe (Map Text WorkflowCallSecret)
..}
genWorkflowCallInput :: (MonadGen m) => m WorkflowCallInput
genWorkflowCallInput :: forall (m :: * -> *). MonadGen m => m WorkflowCallInput
genWorkflowCallInput = do
Maybe Text
description <- m Text -> m (Maybe Text)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe Value
default_ <-
m Value -> m (Maybe Value)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m Value -> m (Maybe Value)) -> m Value -> m (Maybe Value)
forall a b. (a -> b) -> a -> b
$
Text -> Value
Aeson.String
(Text -> Value) -> m Text -> m Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int -> m Char -> m Text
forall (m :: * -> *). MonadGen m => Range Int -> m Char -> m Text
Gen.text (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
3 Int
20) m Char
forall (m :: * -> *). MonadGen m => m Char
Gen.alphaNum
Maybe Bool
required <- m Bool -> m (Maybe Bool)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe m Bool
forall (m :: * -> *). MonadGen m => m Bool
Gen.bool
WorkflowCallInputType
type_ <- m WorkflowCallInputType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded
WorkflowCallInput -> m WorkflowCallInput
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowCallInput {Maybe Bool
Maybe Value
Maybe Text
WorkflowCallInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: WorkflowCallInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: WorkflowCallInputType
..}
genWorkflowCallOutput :: (MonadGen m) => m WorkflowCallOutput
genWorkflowCallOutput :: forall (m :: * -> *). MonadGen m => m WorkflowCallOutput
genWorkflowCallOutput = do
Maybe Text
description <- m Text -> m (Maybe Text)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Text
value <- m Text
forall (m :: * -> *). MonadGen m => m Text
genText
WorkflowCallOutput -> m WorkflowCallOutput
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowCallOutput {Maybe Text
Text
description :: Maybe Text
value :: Text
description :: Maybe Text
value :: Text
..}
genWorkflowCallSecret :: (MonadGen m) => m WorkflowCallSecret
genWorkflowCallSecret :: forall (m :: * -> *). MonadGen m => m WorkflowCallSecret
genWorkflowCallSecret = do
Maybe Text
description <- m Text -> m (Maybe Text)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe Bool
required <- m Bool -> m (Maybe Bool)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe m Bool
forall (m :: * -> *). MonadGen m => m Bool
Gen.bool
WorkflowCallSecret -> m WorkflowCallSecret
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowCallSecret {Maybe Bool
Maybe Text
description :: Maybe Text
required :: Maybe Bool
description :: Maybe Text
required :: Maybe Bool
..}
genWorkflowDispatchAttributes :: (MonadGen m) => m WorkflowDispatchAttributes
genWorkflowDispatchAttributes :: forall (m :: * -> *). MonadGen m => m WorkflowDispatchAttributes
genWorkflowDispatchAttributes = do
Maybe (Map Text WorkflowDispatchInput)
inputs <- m (Map Text WorkflowDispatchInput)
-> m (Maybe (Map Text WorkflowDispatchInput))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (Map Text WorkflowDispatchInput)
-> m (Maybe (Map Text WorkflowDispatchInput)))
-> m (Map Text WorkflowDispatchInput)
-> m (Maybe (Map Text WorkflowDispatchInput))
forall a b. (a -> b) -> a -> b
$ m WorkflowDispatchInput -> m (Map Text WorkflowDispatchInput)
forall (m :: * -> *) a. MonadGen m => m a -> m (Map Text a)
genMap m WorkflowDispatchInput
forall (m :: * -> *). MonadGen m => m WorkflowDispatchInput
genWorkflowDispatchInput
WorkflowDispatchAttributes -> m WorkflowDispatchAttributes
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchAttributes {Maybe (Map Text WorkflowDispatchInput)
inputs :: Maybe (Map Text WorkflowDispatchInput)
inputs :: Maybe (Map Text WorkflowDispatchInput)
..}
genWorkflowDispatchInput :: (MonadGen m) => m WorkflowDispatchInput
genWorkflowDispatchInput :: forall (m :: * -> *). MonadGen m => m WorkflowDispatchInput
genWorkflowDispatchInput = do
Maybe Text
description <- m Text -> m (Maybe Text)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe Value
default_ <-
m Value -> m (Maybe Value)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m Value -> m (Maybe Value)) -> m Value -> m (Maybe Value)
forall a b. (a -> b) -> a -> b
$
Text -> Value
Aeson.String
(Text -> Value) -> m Text -> m Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int -> m Char -> m Text
forall (m :: * -> *). MonadGen m => Range Int -> m Char -> m Text
Gen.text (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
3 Int
20) m Char
forall (m :: * -> *). MonadGen m => m Char
Gen.alphaNum
Maybe Bool
required <- m Bool -> m (Maybe Bool)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe m Bool
forall (m :: * -> *). MonadGen m => m Bool
Gen.bool
Maybe WorkflowDispatchInputType
type_ <- m WorkflowDispatchInputType -> m (Maybe WorkflowDispatchInputType)
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe m WorkflowDispatchInputType
forall (m :: * -> *). MonadGen m => m WorkflowDispatchInputType
genWorkflowDispatchInputType
WorkflowDispatchInput -> m WorkflowDispatchInput
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInput {Maybe Bool
Maybe Value
Maybe Text
Maybe WorkflowDispatchInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: Maybe WorkflowDispatchInputType
description :: Maybe Text
default_ :: Maybe Value
required :: Maybe Bool
type_ :: Maybe WorkflowDispatchInputType
..}
genWorkflowDispatchInputType :: (MonadGen m) => m WorkflowDispatchInputType
genWorkflowDispatchInputType :: forall (m :: * -> *). MonadGen m => m WorkflowDispatchInputType
genWorkflowDispatchInputType = do
[m WorkflowDispatchInputType] -> m WorkflowDispatchInputType
forall (m :: * -> *) a. MonadGen m => [m a] -> m a
Gen.choice
[ WorkflowDispatchInputType -> m WorkflowDispatchInputType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInputType
WorkflowDispatchInputTypeBoolean,
NonEmpty Text -> WorkflowDispatchInputType
WorkflowDispatchInputTypeChoice (NonEmpty Text -> WorkflowDispatchInputType)
-> m (NonEmpty Text) -> m WorkflowDispatchInputType
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText,
WorkflowDispatchInputType -> m WorkflowDispatchInputType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInputType
WorkflowDispatchInputTypeEnvironment,
WorkflowDispatchInputType -> m WorkflowDispatchInputType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInputType
WorkflowDispatchInputTypeNumber,
WorkflowDispatchInputType -> m WorkflowDispatchInputType
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowDispatchInputType
WorkflowDispatchInputTypeString
]
genWorkflowRunTriggerAttributes :: (MonadGen m) => m WorkflowRunTriggerAttributes
genWorkflowRunTriggerAttributes :: forall (m :: * -> *). MonadGen m => m WorkflowRunTriggerAttributes
genWorkflowRunTriggerAttributes = do
NonEmpty WorkflowRunActivityType
activityTypes <- Range Int
-> m WorkflowRunActivityType
-> m (NonEmpty WorkflowRunActivityType)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
3) m WorkflowRunActivityType
forall (m :: * -> *) a. (MonadGen m, Enum a, Bounded a) => m a
Gen.enumBounded
Maybe (NonEmpty Text)
workflows <- m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
branches <- m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
Maybe (NonEmpty Text)
branchesIgnore <- m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall (m :: * -> *) a. MonadGen m => m a -> m (Maybe a)
Gen.maybe (m (NonEmpty Text) -> m (Maybe (NonEmpty Text)))
-> m (NonEmpty Text) -> m (Maybe (NonEmpty Text))
forall a b. (a -> b) -> a -> b
$ Range Int -> m Text -> m (NonEmpty Text)
forall (m :: * -> *) a.
MonadGen m =>
Range Int -> m a -> m (NonEmpty a)
Gen.nonEmpty (Int -> Int -> Range Int
forall a. Integral a => a -> a -> Range a
Range.linear Int
1 Int
5) m Text
forall (m :: * -> *). MonadGen m => m Text
genText
WorkflowRunTriggerAttributes -> m WorkflowRunTriggerAttributes
forall a. a -> m a
forall (f :: * -> *) a. Applicative f => a -> f a
pure WorkflowRunTriggerAttributes {Maybe (NonEmpty Text)
NonEmpty WorkflowRunActivityType
activityTypes :: NonEmpty WorkflowRunActivityType
workflows :: Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
activityTypes :: NonEmpty WorkflowRunActivityType
workflows :: Maybe (NonEmpty Text)
branches :: Maybe (NonEmpty Text)
branchesIgnore :: Maybe (NonEmpty Text)
..}