{-# 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.CodeBuild.Types.PhaseContext where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PhaseContext = PhaseContext'
{
PhaseContext -> Maybe Text
message :: Prelude.Maybe Prelude.Text,
PhaseContext -> Maybe Text
statusCode :: Prelude.Maybe Prelude.Text
}
deriving (PhaseContext -> PhaseContext -> Bool
(PhaseContext -> PhaseContext -> Bool)
-> (PhaseContext -> PhaseContext -> Bool) -> Eq PhaseContext
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PhaseContext -> PhaseContext -> Bool
$c/= :: PhaseContext -> PhaseContext -> Bool
== :: PhaseContext -> PhaseContext -> Bool
$c== :: PhaseContext -> PhaseContext -> Bool
Prelude.Eq, ReadPrec [PhaseContext]
ReadPrec PhaseContext
Int -> ReadS PhaseContext
ReadS [PhaseContext]
(Int -> ReadS PhaseContext)
-> ReadS [PhaseContext]
-> ReadPrec PhaseContext
-> ReadPrec [PhaseContext]
-> Read PhaseContext
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PhaseContext]
$creadListPrec :: ReadPrec [PhaseContext]
readPrec :: ReadPrec PhaseContext
$creadPrec :: ReadPrec PhaseContext
readList :: ReadS [PhaseContext]
$creadList :: ReadS [PhaseContext]
readsPrec :: Int -> ReadS PhaseContext
$creadsPrec :: Int -> ReadS PhaseContext
Prelude.Read, Int -> PhaseContext -> ShowS
[PhaseContext] -> ShowS
PhaseContext -> String
(Int -> PhaseContext -> ShowS)
-> (PhaseContext -> String)
-> ([PhaseContext] -> ShowS)
-> Show PhaseContext
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PhaseContext] -> ShowS
$cshowList :: [PhaseContext] -> ShowS
show :: PhaseContext -> String
$cshow :: PhaseContext -> String
showsPrec :: Int -> PhaseContext -> ShowS
$cshowsPrec :: Int -> PhaseContext -> ShowS
Prelude.Show, (forall x. PhaseContext -> Rep PhaseContext x)
-> (forall x. Rep PhaseContext x -> PhaseContext)
-> Generic PhaseContext
forall x. Rep PhaseContext x -> PhaseContext
forall x. PhaseContext -> Rep PhaseContext x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PhaseContext x -> PhaseContext
$cfrom :: forall x. PhaseContext -> Rep PhaseContext x
Prelude.Generic)
newPhaseContext ::
PhaseContext
newPhaseContext :: PhaseContext
newPhaseContext =
PhaseContext' :: Maybe Text -> Maybe Text -> PhaseContext
PhaseContext'
{ $sel:message:PhaseContext' :: Maybe Text
message = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:statusCode:PhaseContext' :: Maybe Text
statusCode = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
phaseContext_message :: Lens.Lens' PhaseContext (Prelude.Maybe Prelude.Text)
phaseContext_message :: (Maybe Text -> f (Maybe Text)) -> PhaseContext -> f PhaseContext
phaseContext_message = (PhaseContext -> Maybe Text)
-> (PhaseContext -> Maybe Text -> PhaseContext)
-> Lens PhaseContext PhaseContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhaseContext' {Maybe Text
message :: Maybe Text
$sel:message:PhaseContext' :: PhaseContext -> Maybe Text
message} -> Maybe Text
message) (\s :: PhaseContext
s@PhaseContext' {} Maybe Text
a -> PhaseContext
s {$sel:message:PhaseContext' :: Maybe Text
message = Maybe Text
a} :: PhaseContext)
phaseContext_statusCode :: Lens.Lens' PhaseContext (Prelude.Maybe Prelude.Text)
phaseContext_statusCode :: (Maybe Text -> f (Maybe Text)) -> PhaseContext -> f PhaseContext
phaseContext_statusCode = (PhaseContext -> Maybe Text)
-> (PhaseContext -> Maybe Text -> PhaseContext)
-> Lens PhaseContext PhaseContext (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PhaseContext' {Maybe Text
statusCode :: Maybe Text
$sel:statusCode:PhaseContext' :: PhaseContext -> Maybe Text
statusCode} -> Maybe Text
statusCode) (\s :: PhaseContext
s@PhaseContext' {} Maybe Text
a -> PhaseContext
s {$sel:statusCode:PhaseContext' :: Maybe Text
statusCode = Maybe Text
a} :: PhaseContext)
instance Core.FromJSON PhaseContext where
parseJSON :: Value -> Parser PhaseContext
parseJSON =
String
-> (Object -> Parser PhaseContext) -> Value -> Parser PhaseContext
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PhaseContext"
( \Object
x ->
Maybe Text -> Maybe Text -> PhaseContext
PhaseContext'
(Maybe Text -> Maybe Text -> PhaseContext)
-> Parser (Maybe Text) -> Parser (Maybe Text -> PhaseContext)
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
"message")
Parser (Maybe Text -> PhaseContext)
-> Parser (Maybe Text) -> Parser PhaseContext
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
"statusCode")
)
instance Prelude.Hashable PhaseContext
instance Prelude.NFData PhaseContext