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