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