{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data ActionState = ActionState'
{
ActionState -> Maybe Text
actionName :: Prelude.Maybe Prelude.Text,
ActionState -> Maybe ActionRevision
currentRevision :: Prelude.Maybe ActionRevision,
ActionState -> Maybe Text
entityUrl :: Prelude.Maybe Prelude.Text,
ActionState -> Maybe ActionExecution
latestExecution :: Prelude.Maybe ActionExecution,
ActionState -> Maybe Text
revisionUrl :: Prelude.Maybe Prelude.Text
}
deriving (ActionState -> ActionState -> Bool
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]
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
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. 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'
{ $sel:actionName:ActionState' :: Maybe Text
actionName = forall a. Maybe a
Prelude.Nothing,
$sel:currentRevision:ActionState' :: Maybe ActionRevision
currentRevision = forall a. Maybe a
Prelude.Nothing,
$sel:entityUrl:ActionState' :: Maybe Text
entityUrl = forall a. Maybe a
Prelude.Nothing,
$sel:latestExecution:ActionState' :: Maybe ActionExecution
latestExecution = forall a. Maybe a
Prelude.Nothing,
$sel:revisionUrl:ActionState' :: Maybe Text
revisionUrl = forall a. Maybe a
Prelude.Nothing
}
actionState_actionName :: Lens.Lens' ActionState (Prelude.Maybe Prelude.Text)
actionState_actionName :: Lens' ActionState (Maybe Text)
actionState_actionName = 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 :: Lens' ActionState (Maybe ActionRevision)
actionState_currentRevision = 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_entityUrl :: Lens.Lens' ActionState (Prelude.Maybe Prelude.Text)
actionState_entityUrl :: Lens' ActionState (Maybe Text)
actionState_entityUrl = 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_latestExecution :: Lens.Lens' ActionState (Prelude.Maybe ActionExecution)
actionState_latestExecution :: Lens' ActionState (Maybe ActionExecution)
actionState_latestExecution = 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)
actionState_revisionUrl :: Lens.Lens' ActionState (Prelude.Maybe Prelude.Text)
actionState_revisionUrl :: Lens' ActionState (Maybe Text)
actionState_revisionUrl = 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)
instance Data.FromJSON ActionState where
parseJSON :: Value -> Parser ActionState
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ActionState"
( \Object
x ->
Maybe Text
-> Maybe ActionRevision
-> Maybe Text
-> Maybe ActionExecution
-> Maybe Text
-> ActionState
ActionState'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"actionName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"currentRevision")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"entityUrl")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"latestExecution")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"revisionUrl")
)
instance Prelude.Hashable ActionState where
hashWithSalt :: Int -> ActionState -> Int
hashWithSalt Int
_salt ActionState' {Maybe Text
Maybe ActionRevision
Maybe ActionExecution
revisionUrl :: Maybe Text
latestExecution :: Maybe ActionExecution
entityUrl :: Maybe Text
currentRevision :: Maybe ActionRevision
actionName :: Maybe Text
$sel:revisionUrl:ActionState' :: ActionState -> Maybe Text
$sel:latestExecution:ActionState' :: ActionState -> Maybe ActionExecution
$sel:entityUrl:ActionState' :: ActionState -> Maybe Text
$sel:currentRevision:ActionState' :: ActionState -> Maybe ActionRevision
$sel:actionName:ActionState' :: ActionState -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
actionName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ActionRevision
currentRevision
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
entityUrl
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ActionExecution
latestExecution
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
revisionUrl
instance Prelude.NFData ActionState where
rnf :: ActionState -> ()
rnf ActionState' {Maybe Text
Maybe ActionRevision
Maybe ActionExecution
revisionUrl :: Maybe Text
latestExecution :: Maybe ActionExecution
entityUrl :: Maybe Text
currentRevision :: Maybe ActionRevision
actionName :: Maybe Text
$sel:revisionUrl:ActionState' :: ActionState -> Maybe Text
$sel:latestExecution:ActionState' :: ActionState -> Maybe ActionExecution
$sel:entityUrl:ActionState' :: ActionState -> Maybe Text
$sel:currentRevision:ActionState' :: ActionState -> Maybe ActionRevision
$sel:actionName:ActionState' :: ActionState -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
actionName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ActionRevision
currentRevision
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
entityUrl
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ActionExecution
latestExecution
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
revisionUrl