{-# 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.ApprovalResult where
import Amazonka.CodePipeline.Types.ApprovalStatus
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ApprovalResult = ApprovalResult'
{
ApprovalResult -> Text
summary :: Prelude.Text,
ApprovalResult -> ApprovalStatus
status :: ApprovalStatus
}
deriving (ApprovalResult -> ApprovalResult -> Bool
(ApprovalResult -> ApprovalResult -> Bool)
-> (ApprovalResult -> ApprovalResult -> Bool) -> Eq ApprovalResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ApprovalResult -> ApprovalResult -> Bool
$c/= :: ApprovalResult -> ApprovalResult -> Bool
== :: ApprovalResult -> ApprovalResult -> Bool
$c== :: ApprovalResult -> ApprovalResult -> Bool
Prelude.Eq, ReadPrec [ApprovalResult]
ReadPrec ApprovalResult
Int -> ReadS ApprovalResult
ReadS [ApprovalResult]
(Int -> ReadS ApprovalResult)
-> ReadS [ApprovalResult]
-> ReadPrec ApprovalResult
-> ReadPrec [ApprovalResult]
-> Read ApprovalResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ApprovalResult]
$creadListPrec :: ReadPrec [ApprovalResult]
readPrec :: ReadPrec ApprovalResult
$creadPrec :: ReadPrec ApprovalResult
readList :: ReadS [ApprovalResult]
$creadList :: ReadS [ApprovalResult]
readsPrec :: Int -> ReadS ApprovalResult
$creadsPrec :: Int -> ReadS ApprovalResult
Prelude.Read, Int -> ApprovalResult -> ShowS
[ApprovalResult] -> ShowS
ApprovalResult -> String
(Int -> ApprovalResult -> ShowS)
-> (ApprovalResult -> String)
-> ([ApprovalResult] -> ShowS)
-> Show ApprovalResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ApprovalResult] -> ShowS
$cshowList :: [ApprovalResult] -> ShowS
show :: ApprovalResult -> String
$cshow :: ApprovalResult -> String
showsPrec :: Int -> ApprovalResult -> ShowS
$cshowsPrec :: Int -> ApprovalResult -> ShowS
Prelude.Show, (forall x. ApprovalResult -> Rep ApprovalResult x)
-> (forall x. Rep ApprovalResult x -> ApprovalResult)
-> Generic ApprovalResult
forall x. Rep ApprovalResult x -> ApprovalResult
forall x. ApprovalResult -> Rep ApprovalResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ApprovalResult x -> ApprovalResult
$cfrom :: forall x. ApprovalResult -> Rep ApprovalResult x
Prelude.Generic)
newApprovalResult ::
Prelude.Text ->
ApprovalStatus ->
ApprovalResult
newApprovalResult :: Text -> ApprovalStatus -> ApprovalResult
newApprovalResult Text
pSummary_ ApprovalStatus
pStatus_ =
ApprovalResult' :: Text -> ApprovalStatus -> ApprovalResult
ApprovalResult'
{ $sel:summary:ApprovalResult' :: Text
summary = Text
pSummary_,
$sel:status:ApprovalResult' :: ApprovalStatus
status = ApprovalStatus
pStatus_
}
approvalResult_summary :: Lens.Lens' ApprovalResult Prelude.Text
approvalResult_summary :: (Text -> f Text) -> ApprovalResult -> f ApprovalResult
approvalResult_summary = (ApprovalResult -> Text)
-> (ApprovalResult -> Text -> ApprovalResult)
-> Lens ApprovalResult ApprovalResult Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApprovalResult' {Text
summary :: Text
$sel:summary:ApprovalResult' :: ApprovalResult -> Text
summary} -> Text
summary) (\s :: ApprovalResult
s@ApprovalResult' {} Text
a -> ApprovalResult
s {$sel:summary:ApprovalResult' :: Text
summary = Text
a} :: ApprovalResult)
approvalResult_status :: Lens.Lens' ApprovalResult ApprovalStatus
approvalResult_status :: (ApprovalStatus -> f ApprovalStatus)
-> ApprovalResult -> f ApprovalResult
approvalResult_status = (ApprovalResult -> ApprovalStatus)
-> (ApprovalResult -> ApprovalStatus -> ApprovalResult)
-> Lens ApprovalResult ApprovalResult ApprovalStatus ApprovalStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ApprovalResult' {ApprovalStatus
status :: ApprovalStatus
$sel:status:ApprovalResult' :: ApprovalResult -> ApprovalStatus
status} -> ApprovalStatus
status) (\s :: ApprovalResult
s@ApprovalResult' {} ApprovalStatus
a -> ApprovalResult
s {$sel:status:ApprovalResult' :: ApprovalStatus
status = ApprovalStatus
a} :: ApprovalResult)
instance Prelude.Hashable ApprovalResult
instance Prelude.NFData ApprovalResult
instance Core.ToJSON ApprovalResult where
toJSON :: ApprovalResult -> Value
toJSON ApprovalResult' {Text
ApprovalStatus
status :: ApprovalStatus
summary :: Text
$sel:status:ApprovalResult' :: ApprovalResult -> ApprovalStatus
$sel:summary:ApprovalResult' :: ApprovalResult -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"summary" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
summary),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"status" Text -> ApprovalStatus -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ApprovalStatus
status)
]
)