{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CodeCommit.Types.PullRequestEvent
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodeCommit.Types.PullRequestEvent where

import Amazonka.CodeCommit.Types.ApprovalRuleEventMetadata
import Amazonka.CodeCommit.Types.ApprovalRuleOverriddenEventMetadata
import Amazonka.CodeCommit.Types.ApprovalStateChangedEventMetadata
import Amazonka.CodeCommit.Types.PullRequestCreatedEventMetadata
import Amazonka.CodeCommit.Types.PullRequestEventType
import Amazonka.CodeCommit.Types.PullRequestMergedStateChangedEventMetadata
import Amazonka.CodeCommit.Types.PullRequestSourceReferenceUpdatedEventMetadata
import Amazonka.CodeCommit.Types.PullRequestStatusChangedEventMetadata
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Returns information about a pull request event.
--
-- /See:/ 'newPullRequestEvent' smart constructor.
data PullRequestEvent = PullRequestEvent'
  { -- | Information about the change in mergability state for the pull request
    -- event.
    PullRequestEvent
-> Maybe PullRequestMergedStateChangedEventMetadata
pullRequestMergedStateChangedEventMetadata :: Prelude.Maybe PullRequestMergedStateChangedEventMetadata,
    -- | Information about the source and destination branches for the pull
    -- request.
    PullRequestEvent -> Maybe PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata :: Prelude.Maybe PullRequestCreatedEventMetadata,
    -- | Information about a pull request event.
    PullRequestEvent -> Maybe ApprovalRuleEventMetadata
approvalRuleEventMetadata :: Prelude.Maybe ApprovalRuleEventMetadata,
    -- | The type of the pull request event (for example, a status change event
    -- (PULL_REQUEST_STATUS_CHANGED) or update event
    -- (PULL_REQUEST_SOURCE_REFERENCE_UPDATED)).
    PullRequestEvent -> Maybe PullRequestEventType
pullRequestEventType :: Prelude.Maybe PullRequestEventType,
    -- | Information about the change in status for the pull request event.
    PullRequestEvent -> Maybe PullRequestStatusChangedEventMetadata
pullRequestStatusChangedEventMetadata :: Prelude.Maybe PullRequestStatusChangedEventMetadata,
    -- | The Amazon Resource Name (ARN) of the user whose actions resulted in the
    -- event. Examples include updating the pull request with more commits or
    -- changing the status of a pull request.
    PullRequestEvent -> Maybe Text
actorArn :: Prelude.Maybe Prelude.Text,
    -- | The system-generated ID of the pull request.
    PullRequestEvent -> Maybe Text
pullRequestId :: Prelude.Maybe Prelude.Text,
    -- | The day and time of the pull request event, in timestamp format.
    PullRequestEvent -> Maybe POSIX
eventDate :: Prelude.Maybe Core.POSIX,
    -- | Information about an approval state change for a pull request.
    PullRequestEvent -> Maybe ApprovalStateChangedEventMetadata
approvalStateChangedEventMetadata :: Prelude.Maybe ApprovalStateChangedEventMetadata,
    -- | Information about the updated source branch for the pull request event.
    PullRequestEvent
-> Maybe PullRequestSourceReferenceUpdatedEventMetadata
pullRequestSourceReferenceUpdatedEventMetadata :: Prelude.Maybe PullRequestSourceReferenceUpdatedEventMetadata,
    -- | Information about an approval rule override event for a pull request.
    PullRequestEvent -> Maybe ApprovalRuleOverriddenEventMetadata
approvalRuleOverriddenEventMetadata :: Prelude.Maybe ApprovalRuleOverriddenEventMetadata
  }
  deriving (PullRequestEvent -> PullRequestEvent -> Bool
(PullRequestEvent -> PullRequestEvent -> Bool)
-> (PullRequestEvent -> PullRequestEvent -> Bool)
-> Eq PullRequestEvent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PullRequestEvent -> PullRequestEvent -> Bool
$c/= :: PullRequestEvent -> PullRequestEvent -> Bool
== :: PullRequestEvent -> PullRequestEvent -> Bool
$c== :: PullRequestEvent -> PullRequestEvent -> Bool
Prelude.Eq, ReadPrec [PullRequestEvent]
ReadPrec PullRequestEvent
Int -> ReadS PullRequestEvent
ReadS [PullRequestEvent]
(Int -> ReadS PullRequestEvent)
-> ReadS [PullRequestEvent]
-> ReadPrec PullRequestEvent
-> ReadPrec [PullRequestEvent]
-> Read PullRequestEvent
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PullRequestEvent]
$creadListPrec :: ReadPrec [PullRequestEvent]
readPrec :: ReadPrec PullRequestEvent
$creadPrec :: ReadPrec PullRequestEvent
readList :: ReadS [PullRequestEvent]
$creadList :: ReadS [PullRequestEvent]
readsPrec :: Int -> ReadS PullRequestEvent
$creadsPrec :: Int -> ReadS PullRequestEvent
Prelude.Read, Int -> PullRequestEvent -> ShowS
[PullRequestEvent] -> ShowS
PullRequestEvent -> String
(Int -> PullRequestEvent -> ShowS)
-> (PullRequestEvent -> String)
-> ([PullRequestEvent] -> ShowS)
-> Show PullRequestEvent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PullRequestEvent] -> ShowS
$cshowList :: [PullRequestEvent] -> ShowS
show :: PullRequestEvent -> String
$cshow :: PullRequestEvent -> String
showsPrec :: Int -> PullRequestEvent -> ShowS
$cshowsPrec :: Int -> PullRequestEvent -> ShowS
Prelude.Show, (forall x. PullRequestEvent -> Rep PullRequestEvent x)
-> (forall x. Rep PullRequestEvent x -> PullRequestEvent)
-> Generic PullRequestEvent
forall x. Rep PullRequestEvent x -> PullRequestEvent
forall x. PullRequestEvent -> Rep PullRequestEvent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PullRequestEvent x -> PullRequestEvent
$cfrom :: forall x. PullRequestEvent -> Rep PullRequestEvent x
Prelude.Generic)

-- |
-- Create a value of 'PullRequestEvent' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'pullRequestMergedStateChangedEventMetadata', 'pullRequestEvent_pullRequestMergedStateChangedEventMetadata' - Information about the change in mergability state for the pull request
-- event.
--
-- 'pullRequestCreatedEventMetadata', 'pullRequestEvent_pullRequestCreatedEventMetadata' - Information about the source and destination branches for the pull
-- request.
--
-- 'approvalRuleEventMetadata', 'pullRequestEvent_approvalRuleEventMetadata' - Information about a pull request event.
--
-- 'pullRequestEventType', 'pullRequestEvent_pullRequestEventType' - The type of the pull request event (for example, a status change event
-- (PULL_REQUEST_STATUS_CHANGED) or update event
-- (PULL_REQUEST_SOURCE_REFERENCE_UPDATED)).
--
-- 'pullRequestStatusChangedEventMetadata', 'pullRequestEvent_pullRequestStatusChangedEventMetadata' - Information about the change in status for the pull request event.
--
-- 'actorArn', 'pullRequestEvent_actorArn' - The Amazon Resource Name (ARN) of the user whose actions resulted in the
-- event. Examples include updating the pull request with more commits or
-- changing the status of a pull request.
--
-- 'pullRequestId', 'pullRequestEvent_pullRequestId' - The system-generated ID of the pull request.
--
-- 'eventDate', 'pullRequestEvent_eventDate' - The day and time of the pull request event, in timestamp format.
--
-- 'approvalStateChangedEventMetadata', 'pullRequestEvent_approvalStateChangedEventMetadata' - Information about an approval state change for a pull request.
--
-- 'pullRequestSourceReferenceUpdatedEventMetadata', 'pullRequestEvent_pullRequestSourceReferenceUpdatedEventMetadata' - Information about the updated source branch for the pull request event.
--
-- 'approvalRuleOverriddenEventMetadata', 'pullRequestEvent_approvalRuleOverriddenEventMetadata' - Information about an approval rule override event for a pull request.
newPullRequestEvent ::
  PullRequestEvent
newPullRequestEvent :: PullRequestEvent
newPullRequestEvent =
  PullRequestEvent' :: Maybe PullRequestMergedStateChangedEventMetadata
-> Maybe PullRequestCreatedEventMetadata
-> Maybe ApprovalRuleEventMetadata
-> Maybe PullRequestEventType
-> Maybe PullRequestStatusChangedEventMetadata
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ApprovalStateChangedEventMetadata
-> Maybe PullRequestSourceReferenceUpdatedEventMetadata
-> Maybe ApprovalRuleOverriddenEventMetadata
-> PullRequestEvent
PullRequestEvent'
    { $sel:pullRequestMergedStateChangedEventMetadata:PullRequestEvent' :: Maybe PullRequestMergedStateChangedEventMetadata
pullRequestMergedStateChangedEventMetadata =
        Maybe PullRequestMergedStateChangedEventMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestCreatedEventMetadata:PullRequestEvent' :: Maybe PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata = Maybe PullRequestCreatedEventMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:approvalRuleEventMetadata:PullRequestEvent' :: Maybe ApprovalRuleEventMetadata
approvalRuleEventMetadata = Maybe ApprovalRuleEventMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestEventType:PullRequestEvent' :: Maybe PullRequestEventType
pullRequestEventType = Maybe PullRequestEventType
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestStatusChangedEventMetadata:PullRequestEvent' :: Maybe PullRequestStatusChangedEventMetadata
pullRequestStatusChangedEventMetadata =
        Maybe PullRequestStatusChangedEventMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:actorArn:PullRequestEvent' :: Maybe Text
actorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestId:PullRequestEvent' :: Maybe Text
pullRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:eventDate:PullRequestEvent' :: Maybe POSIX
eventDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:approvalStateChangedEventMetadata:PullRequestEvent' :: Maybe ApprovalStateChangedEventMetadata
approvalStateChangedEventMetadata = Maybe ApprovalStateChangedEventMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:pullRequestSourceReferenceUpdatedEventMetadata:PullRequestEvent' :: Maybe PullRequestSourceReferenceUpdatedEventMetadata
pullRequestSourceReferenceUpdatedEventMetadata =
        Maybe PullRequestSourceReferenceUpdatedEventMetadata
forall a. Maybe a
Prelude.Nothing,
      $sel:approvalRuleOverriddenEventMetadata:PullRequestEvent' :: Maybe ApprovalRuleOverriddenEventMetadata
approvalRuleOverriddenEventMetadata =
        Maybe ApprovalRuleOverriddenEventMetadata
forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the change in mergability state for the pull request
-- event.
pullRequestEvent_pullRequestMergedStateChangedEventMetadata :: Lens.Lens' PullRequestEvent (Prelude.Maybe PullRequestMergedStateChangedEventMetadata)
pullRequestEvent_pullRequestMergedStateChangedEventMetadata :: (Maybe PullRequestMergedStateChangedEventMetadata
 -> f (Maybe PullRequestMergedStateChangedEventMetadata))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_pullRequestMergedStateChangedEventMetadata = (PullRequestEvent
 -> Maybe PullRequestMergedStateChangedEventMetadata)
-> (PullRequestEvent
    -> Maybe PullRequestMergedStateChangedEventMetadata
    -> PullRequestEvent)
-> Lens
     PullRequestEvent
     PullRequestEvent
     (Maybe PullRequestMergedStateChangedEventMetadata)
     (Maybe PullRequestMergedStateChangedEventMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe PullRequestMergedStateChangedEventMetadata
pullRequestMergedStateChangedEventMetadata :: Maybe PullRequestMergedStateChangedEventMetadata
$sel:pullRequestMergedStateChangedEventMetadata:PullRequestEvent' :: PullRequestEvent
-> Maybe PullRequestMergedStateChangedEventMetadata
pullRequestMergedStateChangedEventMetadata} -> Maybe PullRequestMergedStateChangedEventMetadata
pullRequestMergedStateChangedEventMetadata) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe PullRequestMergedStateChangedEventMetadata
a -> PullRequestEvent
s {$sel:pullRequestMergedStateChangedEventMetadata:PullRequestEvent' :: Maybe PullRequestMergedStateChangedEventMetadata
pullRequestMergedStateChangedEventMetadata = Maybe PullRequestMergedStateChangedEventMetadata
a} :: PullRequestEvent)

-- | Information about the source and destination branches for the pull
-- request.
pullRequestEvent_pullRequestCreatedEventMetadata :: Lens.Lens' PullRequestEvent (Prelude.Maybe PullRequestCreatedEventMetadata)
pullRequestEvent_pullRequestCreatedEventMetadata :: (Maybe PullRequestCreatedEventMetadata
 -> f (Maybe PullRequestCreatedEventMetadata))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_pullRequestCreatedEventMetadata = (PullRequestEvent -> Maybe PullRequestCreatedEventMetadata)
-> (PullRequestEvent
    -> Maybe PullRequestCreatedEventMetadata -> PullRequestEvent)
-> Lens
     PullRequestEvent
     PullRequestEvent
     (Maybe PullRequestCreatedEventMetadata)
     (Maybe PullRequestCreatedEventMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata :: Maybe PullRequestCreatedEventMetadata
$sel:pullRequestCreatedEventMetadata:PullRequestEvent' :: PullRequestEvent -> Maybe PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata} -> Maybe PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe PullRequestCreatedEventMetadata
a -> PullRequestEvent
s {$sel:pullRequestCreatedEventMetadata:PullRequestEvent' :: Maybe PullRequestCreatedEventMetadata
pullRequestCreatedEventMetadata = Maybe PullRequestCreatedEventMetadata
a} :: PullRequestEvent)

-- | Information about a pull request event.
pullRequestEvent_approvalRuleEventMetadata :: Lens.Lens' PullRequestEvent (Prelude.Maybe ApprovalRuleEventMetadata)
pullRequestEvent_approvalRuleEventMetadata :: (Maybe ApprovalRuleEventMetadata
 -> f (Maybe ApprovalRuleEventMetadata))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_approvalRuleEventMetadata = (PullRequestEvent -> Maybe ApprovalRuleEventMetadata)
-> (PullRequestEvent
    -> Maybe ApprovalRuleEventMetadata -> PullRequestEvent)
-> Lens
     PullRequestEvent
     PullRequestEvent
     (Maybe ApprovalRuleEventMetadata)
     (Maybe ApprovalRuleEventMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe ApprovalRuleEventMetadata
approvalRuleEventMetadata :: Maybe ApprovalRuleEventMetadata
$sel:approvalRuleEventMetadata:PullRequestEvent' :: PullRequestEvent -> Maybe ApprovalRuleEventMetadata
approvalRuleEventMetadata} -> Maybe ApprovalRuleEventMetadata
approvalRuleEventMetadata) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe ApprovalRuleEventMetadata
a -> PullRequestEvent
s {$sel:approvalRuleEventMetadata:PullRequestEvent' :: Maybe ApprovalRuleEventMetadata
approvalRuleEventMetadata = Maybe ApprovalRuleEventMetadata
a} :: PullRequestEvent)

-- | The type of the pull request event (for example, a status change event
-- (PULL_REQUEST_STATUS_CHANGED) or update event
-- (PULL_REQUEST_SOURCE_REFERENCE_UPDATED)).
pullRequestEvent_pullRequestEventType :: Lens.Lens' PullRequestEvent (Prelude.Maybe PullRequestEventType)
pullRequestEvent_pullRequestEventType :: (Maybe PullRequestEventType -> f (Maybe PullRequestEventType))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_pullRequestEventType = (PullRequestEvent -> Maybe PullRequestEventType)
-> (PullRequestEvent
    -> Maybe PullRequestEventType -> PullRequestEvent)
-> Lens
     PullRequestEvent
     PullRequestEvent
     (Maybe PullRequestEventType)
     (Maybe PullRequestEventType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe PullRequestEventType
pullRequestEventType :: Maybe PullRequestEventType
$sel:pullRequestEventType:PullRequestEvent' :: PullRequestEvent -> Maybe PullRequestEventType
pullRequestEventType} -> Maybe PullRequestEventType
pullRequestEventType) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe PullRequestEventType
a -> PullRequestEvent
s {$sel:pullRequestEventType:PullRequestEvent' :: Maybe PullRequestEventType
pullRequestEventType = Maybe PullRequestEventType
a} :: PullRequestEvent)

-- | Information about the change in status for the pull request event.
pullRequestEvent_pullRequestStatusChangedEventMetadata :: Lens.Lens' PullRequestEvent (Prelude.Maybe PullRequestStatusChangedEventMetadata)
pullRequestEvent_pullRequestStatusChangedEventMetadata :: (Maybe PullRequestStatusChangedEventMetadata
 -> f (Maybe PullRequestStatusChangedEventMetadata))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_pullRequestStatusChangedEventMetadata = (PullRequestEvent -> Maybe PullRequestStatusChangedEventMetadata)
-> (PullRequestEvent
    -> Maybe PullRequestStatusChangedEventMetadata -> PullRequestEvent)
-> Lens
     PullRequestEvent
     PullRequestEvent
     (Maybe PullRequestStatusChangedEventMetadata)
     (Maybe PullRequestStatusChangedEventMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe PullRequestStatusChangedEventMetadata
pullRequestStatusChangedEventMetadata :: Maybe PullRequestStatusChangedEventMetadata
$sel:pullRequestStatusChangedEventMetadata:PullRequestEvent' :: PullRequestEvent -> Maybe PullRequestStatusChangedEventMetadata
pullRequestStatusChangedEventMetadata} -> Maybe PullRequestStatusChangedEventMetadata
pullRequestStatusChangedEventMetadata) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe PullRequestStatusChangedEventMetadata
a -> PullRequestEvent
s {$sel:pullRequestStatusChangedEventMetadata:PullRequestEvent' :: Maybe PullRequestStatusChangedEventMetadata
pullRequestStatusChangedEventMetadata = Maybe PullRequestStatusChangedEventMetadata
a} :: PullRequestEvent)

-- | The Amazon Resource Name (ARN) of the user whose actions resulted in the
-- event. Examples include updating the pull request with more commits or
-- changing the status of a pull request.
pullRequestEvent_actorArn :: Lens.Lens' PullRequestEvent (Prelude.Maybe Prelude.Text)
pullRequestEvent_actorArn :: (Maybe Text -> f (Maybe Text))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_actorArn = (PullRequestEvent -> Maybe Text)
-> (PullRequestEvent -> Maybe Text -> PullRequestEvent)
-> Lens PullRequestEvent PullRequestEvent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe Text
actorArn :: Maybe Text
$sel:actorArn:PullRequestEvent' :: PullRequestEvent -> Maybe Text
actorArn} -> Maybe Text
actorArn) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe Text
a -> PullRequestEvent
s {$sel:actorArn:PullRequestEvent' :: Maybe Text
actorArn = Maybe Text
a} :: PullRequestEvent)

-- | The system-generated ID of the pull request.
pullRequestEvent_pullRequestId :: Lens.Lens' PullRequestEvent (Prelude.Maybe Prelude.Text)
pullRequestEvent_pullRequestId :: (Maybe Text -> f (Maybe Text))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_pullRequestId = (PullRequestEvent -> Maybe Text)
-> (PullRequestEvent -> Maybe Text -> PullRequestEvent)
-> Lens PullRequestEvent PullRequestEvent (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe Text
pullRequestId :: Maybe Text
$sel:pullRequestId:PullRequestEvent' :: PullRequestEvent -> Maybe Text
pullRequestId} -> Maybe Text
pullRequestId) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe Text
a -> PullRequestEvent
s {$sel:pullRequestId:PullRequestEvent' :: Maybe Text
pullRequestId = Maybe Text
a} :: PullRequestEvent)

-- | The day and time of the pull request event, in timestamp format.
pullRequestEvent_eventDate :: Lens.Lens' PullRequestEvent (Prelude.Maybe Prelude.UTCTime)
pullRequestEvent_eventDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_eventDate = (PullRequestEvent -> Maybe POSIX)
-> (PullRequestEvent -> Maybe POSIX -> PullRequestEvent)
-> Lens
     PullRequestEvent PullRequestEvent (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe POSIX
eventDate :: Maybe POSIX
$sel:eventDate:PullRequestEvent' :: PullRequestEvent -> Maybe POSIX
eventDate} -> Maybe POSIX
eventDate) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe POSIX
a -> PullRequestEvent
s {$sel:eventDate:PullRequestEvent' :: Maybe POSIX
eventDate = Maybe POSIX
a} :: PullRequestEvent) ((Maybe POSIX -> f (Maybe POSIX))
 -> PullRequestEvent -> f PullRequestEvent)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PullRequestEvent
-> f PullRequestEvent
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Information about an approval state change for a pull request.
pullRequestEvent_approvalStateChangedEventMetadata :: Lens.Lens' PullRequestEvent (Prelude.Maybe ApprovalStateChangedEventMetadata)
pullRequestEvent_approvalStateChangedEventMetadata :: (Maybe ApprovalStateChangedEventMetadata
 -> f (Maybe ApprovalStateChangedEventMetadata))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_approvalStateChangedEventMetadata = (PullRequestEvent -> Maybe ApprovalStateChangedEventMetadata)
-> (PullRequestEvent
    -> Maybe ApprovalStateChangedEventMetadata -> PullRequestEvent)
-> Lens
     PullRequestEvent
     PullRequestEvent
     (Maybe ApprovalStateChangedEventMetadata)
     (Maybe ApprovalStateChangedEventMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe ApprovalStateChangedEventMetadata
approvalStateChangedEventMetadata :: Maybe ApprovalStateChangedEventMetadata
$sel:approvalStateChangedEventMetadata:PullRequestEvent' :: PullRequestEvent -> Maybe ApprovalStateChangedEventMetadata
approvalStateChangedEventMetadata} -> Maybe ApprovalStateChangedEventMetadata
approvalStateChangedEventMetadata) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe ApprovalStateChangedEventMetadata
a -> PullRequestEvent
s {$sel:approvalStateChangedEventMetadata:PullRequestEvent' :: Maybe ApprovalStateChangedEventMetadata
approvalStateChangedEventMetadata = Maybe ApprovalStateChangedEventMetadata
a} :: PullRequestEvent)

-- | Information about the updated source branch for the pull request event.
pullRequestEvent_pullRequestSourceReferenceUpdatedEventMetadata :: Lens.Lens' PullRequestEvent (Prelude.Maybe PullRequestSourceReferenceUpdatedEventMetadata)
pullRequestEvent_pullRequestSourceReferenceUpdatedEventMetadata :: (Maybe PullRequestSourceReferenceUpdatedEventMetadata
 -> f (Maybe PullRequestSourceReferenceUpdatedEventMetadata))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_pullRequestSourceReferenceUpdatedEventMetadata = (PullRequestEvent
 -> Maybe PullRequestSourceReferenceUpdatedEventMetadata)
-> (PullRequestEvent
    -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
    -> PullRequestEvent)
-> Lens
     PullRequestEvent
     PullRequestEvent
     (Maybe PullRequestSourceReferenceUpdatedEventMetadata)
     (Maybe PullRequestSourceReferenceUpdatedEventMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe PullRequestSourceReferenceUpdatedEventMetadata
pullRequestSourceReferenceUpdatedEventMetadata :: Maybe PullRequestSourceReferenceUpdatedEventMetadata
$sel:pullRequestSourceReferenceUpdatedEventMetadata:PullRequestEvent' :: PullRequestEvent
-> Maybe PullRequestSourceReferenceUpdatedEventMetadata
pullRequestSourceReferenceUpdatedEventMetadata} -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
pullRequestSourceReferenceUpdatedEventMetadata) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe PullRequestSourceReferenceUpdatedEventMetadata
a -> PullRequestEvent
s {$sel:pullRequestSourceReferenceUpdatedEventMetadata:PullRequestEvent' :: Maybe PullRequestSourceReferenceUpdatedEventMetadata
pullRequestSourceReferenceUpdatedEventMetadata = Maybe PullRequestSourceReferenceUpdatedEventMetadata
a} :: PullRequestEvent)

-- | Information about an approval rule override event for a pull request.
pullRequestEvent_approvalRuleOverriddenEventMetadata :: Lens.Lens' PullRequestEvent (Prelude.Maybe ApprovalRuleOverriddenEventMetadata)
pullRequestEvent_approvalRuleOverriddenEventMetadata :: (Maybe ApprovalRuleOverriddenEventMetadata
 -> f (Maybe ApprovalRuleOverriddenEventMetadata))
-> PullRequestEvent -> f PullRequestEvent
pullRequestEvent_approvalRuleOverriddenEventMetadata = (PullRequestEvent -> Maybe ApprovalRuleOverriddenEventMetadata)
-> (PullRequestEvent
    -> Maybe ApprovalRuleOverriddenEventMetadata -> PullRequestEvent)
-> Lens
     PullRequestEvent
     PullRequestEvent
     (Maybe ApprovalRuleOverriddenEventMetadata)
     (Maybe ApprovalRuleOverriddenEventMetadata)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PullRequestEvent' {Maybe ApprovalRuleOverriddenEventMetadata
approvalRuleOverriddenEventMetadata :: Maybe ApprovalRuleOverriddenEventMetadata
$sel:approvalRuleOverriddenEventMetadata:PullRequestEvent' :: PullRequestEvent -> Maybe ApprovalRuleOverriddenEventMetadata
approvalRuleOverriddenEventMetadata} -> Maybe ApprovalRuleOverriddenEventMetadata
approvalRuleOverriddenEventMetadata) (\s :: PullRequestEvent
s@PullRequestEvent' {} Maybe ApprovalRuleOverriddenEventMetadata
a -> PullRequestEvent
s {$sel:approvalRuleOverriddenEventMetadata:PullRequestEvent' :: Maybe ApprovalRuleOverriddenEventMetadata
approvalRuleOverriddenEventMetadata = Maybe ApprovalRuleOverriddenEventMetadata
a} :: PullRequestEvent)

instance Core.FromJSON PullRequestEvent where
  parseJSON :: Value -> Parser PullRequestEvent
parseJSON =
    String
-> (Object -> Parser PullRequestEvent)
-> Value
-> Parser PullRequestEvent
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PullRequestEvent"
      ( \Object
x ->
          Maybe PullRequestMergedStateChangedEventMetadata
-> Maybe PullRequestCreatedEventMetadata
-> Maybe ApprovalRuleEventMetadata
-> Maybe PullRequestEventType
-> Maybe PullRequestStatusChangedEventMetadata
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ApprovalStateChangedEventMetadata
-> Maybe PullRequestSourceReferenceUpdatedEventMetadata
-> Maybe ApprovalRuleOverriddenEventMetadata
-> PullRequestEvent
PullRequestEvent'
            (Maybe PullRequestMergedStateChangedEventMetadata
 -> Maybe PullRequestCreatedEventMetadata
 -> Maybe ApprovalRuleEventMetadata
 -> Maybe PullRequestEventType
 -> Maybe PullRequestStatusChangedEventMetadata
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe ApprovalStateChangedEventMetadata
 -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
 -> Maybe ApprovalRuleOverriddenEventMetadata
 -> PullRequestEvent)
-> Parser (Maybe PullRequestMergedStateChangedEventMetadata)
-> Parser
     (Maybe PullRequestCreatedEventMetadata
      -> Maybe ApprovalRuleEventMetadata
      -> Maybe PullRequestEventType
      -> Maybe PullRequestStatusChangedEventMetadata
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ApprovalStateChangedEventMetadata
      -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
      -> Maybe ApprovalRuleOverriddenEventMetadata
      -> PullRequestEvent)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x
                            Object
-> Text
-> Parser (Maybe PullRequestMergedStateChangedEventMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pullRequestMergedStateChangedEventMetadata"
                        )
            Parser
  (Maybe PullRequestCreatedEventMetadata
   -> Maybe ApprovalRuleEventMetadata
   -> Maybe PullRequestEventType
   -> Maybe PullRequestStatusChangedEventMetadata
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ApprovalStateChangedEventMetadata
   -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
   -> Maybe ApprovalRuleOverriddenEventMetadata
   -> PullRequestEvent)
-> Parser (Maybe PullRequestCreatedEventMetadata)
-> Parser
     (Maybe ApprovalRuleEventMetadata
      -> Maybe PullRequestEventType
      -> Maybe PullRequestStatusChangedEventMetadata
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ApprovalStateChangedEventMetadata
      -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
      -> Maybe ApprovalRuleOverriddenEventMetadata
      -> PullRequestEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PullRequestCreatedEventMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pullRequestCreatedEventMetadata")
            Parser
  (Maybe ApprovalRuleEventMetadata
   -> Maybe PullRequestEventType
   -> Maybe PullRequestStatusChangedEventMetadata
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ApprovalStateChangedEventMetadata
   -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
   -> Maybe ApprovalRuleOverriddenEventMetadata
   -> PullRequestEvent)
-> Parser (Maybe ApprovalRuleEventMetadata)
-> Parser
     (Maybe PullRequestEventType
      -> Maybe PullRequestStatusChangedEventMetadata
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ApprovalStateChangedEventMetadata
      -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
      -> Maybe ApprovalRuleOverriddenEventMetadata
      -> PullRequestEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ApprovalRuleEventMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"approvalRuleEventMetadata")
            Parser
  (Maybe PullRequestEventType
   -> Maybe PullRequestStatusChangedEventMetadata
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ApprovalStateChangedEventMetadata
   -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
   -> Maybe ApprovalRuleOverriddenEventMetadata
   -> PullRequestEvent)
-> Parser (Maybe PullRequestEventType)
-> Parser
     (Maybe PullRequestStatusChangedEventMetadata
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ApprovalStateChangedEventMetadata
      -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
      -> Maybe ApprovalRuleOverriddenEventMetadata
      -> PullRequestEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PullRequestEventType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pullRequestEventType")
            Parser
  (Maybe PullRequestStatusChangedEventMetadata
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ApprovalStateChangedEventMetadata
   -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
   -> Maybe ApprovalRuleOverriddenEventMetadata
   -> PullRequestEvent)
-> Parser (Maybe PullRequestStatusChangedEventMetadata)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe ApprovalStateChangedEventMetadata
      -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
      -> Maybe ApprovalRuleOverriddenEventMetadata
      -> PullRequestEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe PullRequestStatusChangedEventMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pullRequestStatusChangedEventMetadata")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe ApprovalStateChangedEventMetadata
   -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
   -> Maybe ApprovalRuleOverriddenEventMetadata
   -> PullRequestEvent)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe ApprovalStateChangedEventMetadata
      -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
      -> Maybe ApprovalRuleOverriddenEventMetadata
      -> PullRequestEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"actorArn")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe ApprovalStateChangedEventMetadata
   -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
   -> Maybe ApprovalRuleOverriddenEventMetadata
   -> PullRequestEvent)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe ApprovalStateChangedEventMetadata
      -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
      -> Maybe ApprovalRuleOverriddenEventMetadata
      -> PullRequestEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pullRequestId")
            Parser
  (Maybe POSIX
   -> Maybe ApprovalStateChangedEventMetadata
   -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
   -> Maybe ApprovalRuleOverriddenEventMetadata
   -> PullRequestEvent)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ApprovalStateChangedEventMetadata
      -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
      -> Maybe ApprovalRuleOverriddenEventMetadata
      -> PullRequestEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"eventDate")
            Parser
  (Maybe ApprovalStateChangedEventMetadata
   -> Maybe PullRequestSourceReferenceUpdatedEventMetadata
   -> Maybe ApprovalRuleOverriddenEventMetadata
   -> PullRequestEvent)
-> Parser (Maybe ApprovalStateChangedEventMetadata)
-> Parser
     (Maybe PullRequestSourceReferenceUpdatedEventMetadata
      -> Maybe ApprovalRuleOverriddenEventMetadata -> PullRequestEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ApprovalStateChangedEventMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"approvalStateChangedEventMetadata")
            Parser
  (Maybe PullRequestSourceReferenceUpdatedEventMetadata
   -> Maybe ApprovalRuleOverriddenEventMetadata -> PullRequestEvent)
-> Parser (Maybe PullRequestSourceReferenceUpdatedEventMetadata)
-> Parser
     (Maybe ApprovalRuleOverriddenEventMetadata -> PullRequestEvent)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            Object
-> Text
-> Parser (Maybe PullRequestSourceReferenceUpdatedEventMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"pullRequestSourceReferenceUpdatedEventMetadata"
                        )
            Parser
  (Maybe ApprovalRuleOverriddenEventMetadata -> PullRequestEvent)
-> Parser (Maybe ApprovalRuleOverriddenEventMetadata)
-> Parser PullRequestEvent
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Parser (Maybe ApprovalRuleOverriddenEventMetadata)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"approvalRuleOverriddenEventMetadata")
      )

instance Prelude.Hashable PullRequestEvent

instance Prelude.NFData PullRequestEvent