{-# 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.ActionContext where
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 ActionContext = ActionContext'
{
ActionContext -> Maybe Text
actionExecutionId :: Prelude.Maybe Prelude.Text,
ActionContext -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (ActionContext -> ActionContext -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionContext -> ActionContext -> Bool
$c/= :: ActionContext -> ActionContext -> Bool
== :: ActionContext -> ActionContext -> Bool
$c== :: ActionContext -> ActionContext -> Bool
Prelude.Eq, ReadPrec [ActionContext]
ReadPrec ActionContext
Int -> ReadS ActionContext
ReadS [ActionContext]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionContext]
$creadListPrec :: ReadPrec [ActionContext]
readPrec :: ReadPrec ActionContext
$creadPrec :: ReadPrec ActionContext
readList :: ReadS [ActionContext]
$creadList :: ReadS [ActionContext]
readsPrec :: Int -> ReadS ActionContext
$creadsPrec :: Int -> ReadS ActionContext
Prelude.Read, Int -> ActionContext -> ShowS
[ActionContext] -> ShowS
ActionContext -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionContext] -> ShowS
$cshowList :: [ActionContext] -> ShowS
show :: ActionContext -> String
$cshow :: ActionContext -> String
showsPrec :: Int -> ActionContext -> ShowS
$cshowsPrec :: Int -> ActionContext -> ShowS
Prelude.Show, forall x. Rep ActionContext x -> ActionContext
forall x. ActionContext -> Rep ActionContext x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionContext x -> ActionContext
$cfrom :: forall x. ActionContext -> Rep ActionContext x
Prelude.Generic)
newActionContext ::
ActionContext
newActionContext :: ActionContext
newActionContext =
ActionContext'
{ $sel:actionExecutionId:ActionContext' :: Maybe Text
actionExecutionId = forall a. Maybe a
Prelude.Nothing,
$sel:name:ActionContext' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
}
actionContext_actionExecutionId :: Lens.Lens' ActionContext (Prelude.Maybe Prelude.Text)
actionContext_actionExecutionId :: Lens' ActionContext (Maybe Text)
actionContext_actionExecutionId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionContext' {Maybe Text
actionExecutionId :: Maybe Text
$sel:actionExecutionId:ActionContext' :: ActionContext -> Maybe Text
actionExecutionId} -> Maybe Text
actionExecutionId) (\s :: ActionContext
s@ActionContext' {} Maybe Text
a -> ActionContext
s {$sel:actionExecutionId:ActionContext' :: Maybe Text
actionExecutionId = Maybe Text
a} :: ActionContext)
actionContext_name :: Lens.Lens' ActionContext (Prelude.Maybe Prelude.Text)
actionContext_name :: Lens' ActionContext (Maybe Text)
actionContext_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionContext' {Maybe Text
name :: Maybe Text
$sel:name:ActionContext' :: ActionContext -> Maybe Text
name} -> Maybe Text
name) (\s :: ActionContext
s@ActionContext' {} Maybe Text
a -> ActionContext
s {$sel:name:ActionContext' :: Maybe Text
name = Maybe Text
a} :: ActionContext)
instance Data.FromJSON ActionContext where
parseJSON :: Value -> Parser ActionContext
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ActionContext"
( \Object
x ->
Maybe Text -> Maybe Text -> ActionContext
ActionContext'
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
"actionExecutionId")
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
"name")
)
instance Prelude.Hashable ActionContext where
hashWithSalt :: Int -> ActionContext -> Int
hashWithSalt Int
_salt ActionContext' {Maybe Text
name :: Maybe Text
actionExecutionId :: Maybe Text
$sel:name:ActionContext' :: ActionContext -> Maybe Text
$sel:actionExecutionId:ActionContext' :: ActionContext -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
actionExecutionId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
instance Prelude.NFData ActionContext where
rnf :: ActionContext -> ()
rnf ActionContext' {Maybe Text
name :: Maybe Text
actionExecutionId :: Maybe Text
$sel:name:ActionContext' :: ActionContext -> Maybe Text
$sel:actionExecutionId:ActionContext' :: ActionContext -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
actionExecutionId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name