{-# 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 #-}
module Amazonka.CodePipeline.Types.ActionState where
import Amazonka.CodePipeline.Types.ActionExecution
import Amazonka.CodePipeline.Types.ActionRevision
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ActionState = ActionState'
{
ActionState -> Maybe Text
revisionUrl :: Prelude.Maybe Prelude.Text,
ActionState -> Maybe Text
entityUrl :: Prelude.Maybe Prelude.Text,
ActionState -> Maybe Text
actionName :: Prelude.Maybe Prelude.Text,
ActionState -> Maybe ActionRevision
currentRevision :: Prelude.Maybe ActionRevision,
ActionState -> Maybe ActionExecution
latestExecution :: Prelude.Maybe ActionExecution
}
deriving (ActionState -> ActionState -> Bool
(ActionState -> ActionState -> Bool)
-> (ActionState -> ActionState -> Bool) -> Eq ActionState
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionState -> ActionState -> Bool
$c/= :: ActionState -> ActionState -> Bool
== :: ActionState -> ActionState -> Bool
$c== :: ActionState -> ActionState -> Bool
Prelude.Eq, ReadPrec [ActionState]
ReadPrec ActionState
Int -> ReadS ActionState
ReadS [ActionState]
(Int -> ReadS ActionState)
-> ReadS [ActionState]
-> ReadPrec ActionState
-> ReadPrec [ActionState]
-> Read ActionState
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionState]
$creadListPrec :: ReadPrec [ActionState]
readPrec :: ReadPrec ActionState
$creadPrec :: ReadPrec ActionState
readList :: ReadS [ActionState]
$creadList :: ReadS [ActionState]
readsPrec :: Int -> ReadS ActionState
$creadsPrec :: Int -> ReadS ActionState
Prelude.Read, Int -> ActionState -> ShowS
[ActionState] -> ShowS
ActionState -> String
(Int -> ActionState -> ShowS)
-> (ActionState -> String)
-> ([ActionState] -> ShowS)
-> Show ActionState
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionState] -> ShowS
$cshowList :: [ActionState] -> ShowS
show :: ActionState -> String
$cshow :: ActionState -> String
showsPrec :: Int -> ActionState -> ShowS
$cshowsPrec :: Int -> ActionState -> ShowS
Prelude.Show, (forall x. ActionState -> Rep ActionState x)
-> (forall x. Rep ActionState x -> ActionState)
-> Generic ActionState
forall x. Rep ActionState x -> ActionState
forall x. ActionState -> Rep ActionState x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionState x -> ActionState
$cfrom :: forall x. ActionState -> Rep ActionState x
Prelude.Generic)
newActionState ::
ActionState
newActionState :: ActionState
newActionState =
ActionState' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ActionRevision
-> Maybe ActionExecution
-> ActionState
ActionState'
{ $sel:revisionUrl:ActionState' :: Maybe Text
revisionUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:entityUrl:ActionState' :: Maybe Text
entityUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:actionName:ActionState' :: Maybe Text
actionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:currentRevision:ActionState' :: Maybe ActionRevision
currentRevision = Maybe ActionRevision
forall a. Maybe a
Prelude.Nothing,
$sel:latestExecution:ActionState' :: Maybe ActionExecution
latestExecution = Maybe ActionExecution
forall a. Maybe a
Prelude.Nothing
}
actionState_revisionUrl :: Lens.Lens' ActionState (Prelude.Maybe Prelude.Text)
actionState_revisionUrl :: (Maybe Text -> f (Maybe Text)) -> ActionState -> f ActionState
actionState_revisionUrl = (ActionState -> Maybe Text)
-> (ActionState -> Maybe Text -> ActionState)
-> Lens ActionState ActionState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionState' {Maybe Text
revisionUrl :: Maybe Text
$sel:revisionUrl:ActionState' :: ActionState -> Maybe Text
revisionUrl} -> Maybe Text
revisionUrl) (\s :: ActionState
s@ActionState' {} Maybe Text
a -> ActionState
s {$sel:revisionUrl:ActionState' :: Maybe Text
revisionUrl = Maybe Text
a} :: ActionState)
actionState_entityUrl :: Lens.Lens' ActionState (Prelude.Maybe Prelude.Text)
actionState_entityUrl :: (Maybe Text -> f (Maybe Text)) -> ActionState -> f ActionState
actionState_entityUrl = (ActionState -> Maybe Text)
-> (ActionState -> Maybe Text -> ActionState)
-> Lens ActionState ActionState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionState' {Maybe Text
entityUrl :: Maybe Text
$sel:entityUrl:ActionState' :: ActionState -> Maybe Text
entityUrl} -> Maybe Text
entityUrl) (\s :: ActionState
s@ActionState' {} Maybe Text
a -> ActionState
s {$sel:entityUrl:ActionState' :: Maybe Text
entityUrl = Maybe Text
a} :: ActionState)
actionState_actionName :: Lens.Lens' ActionState (Prelude.Maybe Prelude.Text)
actionState_actionName :: (Maybe Text -> f (Maybe Text)) -> ActionState -> f ActionState
actionState_actionName = (ActionState -> Maybe Text)
-> (ActionState -> Maybe Text -> ActionState)
-> Lens ActionState ActionState (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionState' {Maybe Text
actionName :: Maybe Text
$sel:actionName:ActionState' :: ActionState -> Maybe Text
actionName} -> Maybe Text
actionName) (\s :: ActionState
s@ActionState' {} Maybe Text
a -> ActionState
s {$sel:actionName:ActionState' :: Maybe Text
actionName = Maybe Text
a} :: ActionState)
actionState_currentRevision :: Lens.Lens' ActionState (Prelude.Maybe ActionRevision)
actionState_currentRevision :: (Maybe ActionRevision -> f (Maybe ActionRevision))
-> ActionState -> f ActionState
actionState_currentRevision = (ActionState -> Maybe ActionRevision)
-> (ActionState -> Maybe ActionRevision -> ActionState)
-> Lens
ActionState
ActionState
(Maybe ActionRevision)
(Maybe ActionRevision)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionState' {Maybe ActionRevision
currentRevision :: Maybe ActionRevision
$sel:currentRevision:ActionState' :: ActionState -> Maybe ActionRevision
currentRevision} -> Maybe ActionRevision
currentRevision) (\s :: ActionState
s@ActionState' {} Maybe ActionRevision
a -> ActionState
s {$sel:currentRevision:ActionState' :: Maybe ActionRevision
currentRevision = Maybe ActionRevision
a} :: ActionState)
actionState_latestExecution :: Lens.Lens' ActionState (Prelude.Maybe ActionExecution)
actionState_latestExecution :: (Maybe ActionExecution -> f (Maybe ActionExecution))
-> ActionState -> f ActionState
actionState_latestExecution = (ActionState -> Maybe ActionExecution)
-> (ActionState -> Maybe ActionExecution -> ActionState)
-> Lens
ActionState
ActionState
(Maybe ActionExecution)
(Maybe ActionExecution)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionState' {Maybe ActionExecution
latestExecution :: Maybe ActionExecution
$sel:latestExecution:ActionState' :: ActionState -> Maybe ActionExecution
latestExecution} -> Maybe ActionExecution
latestExecution) (\s :: ActionState
s@ActionState' {} Maybe ActionExecution
a -> ActionState
s {$sel:latestExecution:ActionState' :: Maybe ActionExecution
latestExecution = Maybe ActionExecution
a} :: ActionState)
instance Core.FromJSON ActionState where
parseJSON :: Value -> Parser ActionState
parseJSON =
String
-> (Object -> Parser ActionState) -> Value -> Parser ActionState
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ActionState"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ActionRevision
-> Maybe ActionExecution
-> ActionState
ActionState'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ActionRevision
-> Maybe ActionExecution
-> ActionState)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe ActionRevision
-> Maybe ActionExecution
-> ActionState)
forall (f :: * -> *) a b. Functor 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
"revisionUrl")
Parser
(Maybe Text
-> Maybe Text
-> Maybe ActionRevision
-> Maybe ActionExecution
-> ActionState)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe ActionRevision -> Maybe ActionExecution -> ActionState)
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
"entityUrl")
Parser
(Maybe Text
-> Maybe ActionRevision -> Maybe ActionExecution -> ActionState)
-> Parser (Maybe Text)
-> Parser
(Maybe ActionRevision -> Maybe ActionExecution -> ActionState)
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
"actionName")
Parser
(Maybe ActionRevision -> Maybe ActionExecution -> ActionState)
-> Parser (Maybe ActionRevision)
-> Parser (Maybe ActionExecution -> ActionState)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ActionRevision)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"currentRevision")
Parser (Maybe ActionExecution -> ActionState)
-> Parser (Maybe ActionExecution) -> Parser ActionState
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ActionExecution)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"latestExecution")
)
instance Prelude.Hashable ActionState
instance Prelude.NFData ActionState