{-# 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.SageMaker.Types.SecondaryStatusTransition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.SecondaryStatus
data SecondaryStatusTransition = SecondaryStatusTransition'
{
SecondaryStatusTransition -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
SecondaryStatusTransition -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
SecondaryStatusTransition -> SecondaryStatus
status :: SecondaryStatus,
SecondaryStatusTransition -> POSIX
startTime :: Core.POSIX
}
deriving (SecondaryStatusTransition -> SecondaryStatusTransition -> Bool
(SecondaryStatusTransition -> SecondaryStatusTransition -> Bool)
-> (SecondaryStatusTransition -> SecondaryStatusTransition -> Bool)
-> Eq SecondaryStatusTransition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SecondaryStatusTransition -> SecondaryStatusTransition -> Bool
$c/= :: SecondaryStatusTransition -> SecondaryStatusTransition -> Bool
== :: SecondaryStatusTransition -> SecondaryStatusTransition -> Bool
$c== :: SecondaryStatusTransition -> SecondaryStatusTransition -> Bool
Prelude.Eq, ReadPrec [SecondaryStatusTransition]
ReadPrec SecondaryStatusTransition
Int -> ReadS SecondaryStatusTransition
ReadS [SecondaryStatusTransition]
(Int -> ReadS SecondaryStatusTransition)
-> ReadS [SecondaryStatusTransition]
-> ReadPrec SecondaryStatusTransition
-> ReadPrec [SecondaryStatusTransition]
-> Read SecondaryStatusTransition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SecondaryStatusTransition]
$creadListPrec :: ReadPrec [SecondaryStatusTransition]
readPrec :: ReadPrec SecondaryStatusTransition
$creadPrec :: ReadPrec SecondaryStatusTransition
readList :: ReadS [SecondaryStatusTransition]
$creadList :: ReadS [SecondaryStatusTransition]
readsPrec :: Int -> ReadS SecondaryStatusTransition
$creadsPrec :: Int -> ReadS SecondaryStatusTransition
Prelude.Read, Int -> SecondaryStatusTransition -> ShowS
[SecondaryStatusTransition] -> ShowS
SecondaryStatusTransition -> String
(Int -> SecondaryStatusTransition -> ShowS)
-> (SecondaryStatusTransition -> String)
-> ([SecondaryStatusTransition] -> ShowS)
-> Show SecondaryStatusTransition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SecondaryStatusTransition] -> ShowS
$cshowList :: [SecondaryStatusTransition] -> ShowS
show :: SecondaryStatusTransition -> String
$cshow :: SecondaryStatusTransition -> String
showsPrec :: Int -> SecondaryStatusTransition -> ShowS
$cshowsPrec :: Int -> SecondaryStatusTransition -> ShowS
Prelude.Show, (forall x.
SecondaryStatusTransition -> Rep SecondaryStatusTransition x)
-> (forall x.
Rep SecondaryStatusTransition x -> SecondaryStatusTransition)
-> Generic SecondaryStatusTransition
forall x.
Rep SecondaryStatusTransition x -> SecondaryStatusTransition
forall x.
SecondaryStatusTransition -> Rep SecondaryStatusTransition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SecondaryStatusTransition x -> SecondaryStatusTransition
$cfrom :: forall x.
SecondaryStatusTransition -> Rep SecondaryStatusTransition x
Prelude.Generic)
newSecondaryStatusTransition ::
SecondaryStatus ->
Prelude.UTCTime ->
SecondaryStatusTransition
newSecondaryStatusTransition :: SecondaryStatus -> UTCTime -> SecondaryStatusTransition
newSecondaryStatusTransition SecondaryStatus
pStatus_ UTCTime
pStartTime_ =
SecondaryStatusTransition' :: Maybe Text
-> Maybe POSIX
-> SecondaryStatus
-> POSIX
-> SecondaryStatusTransition
SecondaryStatusTransition'
{ $sel:statusMessage:SecondaryStatusTransition' :: Maybe Text
statusMessage =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:SecondaryStatusTransition' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:status:SecondaryStatusTransition' :: SecondaryStatus
status = SecondaryStatus
pStatus_,
$sel:startTime:SecondaryStatusTransition' :: POSIX
startTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartTime_
}
secondaryStatusTransition_statusMessage :: Lens.Lens' SecondaryStatusTransition (Prelude.Maybe Prelude.Text)
secondaryStatusTransition_statusMessage :: (Maybe Text -> f (Maybe Text))
-> SecondaryStatusTransition -> f SecondaryStatusTransition
secondaryStatusTransition_statusMessage = (SecondaryStatusTransition -> Maybe Text)
-> (SecondaryStatusTransition
-> Maybe Text -> SecondaryStatusTransition)
-> Lens
SecondaryStatusTransition
SecondaryStatusTransition
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecondaryStatusTransition' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:SecondaryStatusTransition' :: SecondaryStatusTransition -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: SecondaryStatusTransition
s@SecondaryStatusTransition' {} Maybe Text
a -> SecondaryStatusTransition
s {$sel:statusMessage:SecondaryStatusTransition' :: Maybe Text
statusMessage = Maybe Text
a} :: SecondaryStatusTransition)
secondaryStatusTransition_endTime :: Lens.Lens' SecondaryStatusTransition (Prelude.Maybe Prelude.UTCTime)
secondaryStatusTransition_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SecondaryStatusTransition -> f SecondaryStatusTransition
secondaryStatusTransition_endTime = (SecondaryStatusTransition -> Maybe POSIX)
-> (SecondaryStatusTransition
-> Maybe POSIX -> SecondaryStatusTransition)
-> Lens
SecondaryStatusTransition
SecondaryStatusTransition
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecondaryStatusTransition' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:SecondaryStatusTransition' :: SecondaryStatusTransition -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: SecondaryStatusTransition
s@SecondaryStatusTransition' {} Maybe POSIX
a -> SecondaryStatusTransition
s {$sel:endTime:SecondaryStatusTransition' :: Maybe POSIX
endTime = Maybe POSIX
a} :: SecondaryStatusTransition) ((Maybe POSIX -> f (Maybe POSIX))
-> SecondaryStatusTransition -> f SecondaryStatusTransition)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SecondaryStatusTransition
-> f SecondaryStatusTransition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
secondaryStatusTransition_status :: Lens.Lens' SecondaryStatusTransition SecondaryStatus
secondaryStatusTransition_status :: (SecondaryStatus -> f SecondaryStatus)
-> SecondaryStatusTransition -> f SecondaryStatusTransition
secondaryStatusTransition_status = (SecondaryStatusTransition -> SecondaryStatus)
-> (SecondaryStatusTransition
-> SecondaryStatus -> SecondaryStatusTransition)
-> Lens
SecondaryStatusTransition
SecondaryStatusTransition
SecondaryStatus
SecondaryStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecondaryStatusTransition' {SecondaryStatus
status :: SecondaryStatus
$sel:status:SecondaryStatusTransition' :: SecondaryStatusTransition -> SecondaryStatus
status} -> SecondaryStatus
status) (\s :: SecondaryStatusTransition
s@SecondaryStatusTransition' {} SecondaryStatus
a -> SecondaryStatusTransition
s {$sel:status:SecondaryStatusTransition' :: SecondaryStatus
status = SecondaryStatus
a} :: SecondaryStatusTransition)
secondaryStatusTransition_startTime :: Lens.Lens' SecondaryStatusTransition Prelude.UTCTime
secondaryStatusTransition_startTime :: (UTCTime -> f UTCTime)
-> SecondaryStatusTransition -> f SecondaryStatusTransition
secondaryStatusTransition_startTime = (SecondaryStatusTransition -> POSIX)
-> (SecondaryStatusTransition
-> POSIX -> SecondaryStatusTransition)
-> Lens
SecondaryStatusTransition SecondaryStatusTransition POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SecondaryStatusTransition' {POSIX
startTime :: POSIX
$sel:startTime:SecondaryStatusTransition' :: SecondaryStatusTransition -> POSIX
startTime} -> POSIX
startTime) (\s :: SecondaryStatusTransition
s@SecondaryStatusTransition' {} POSIX
a -> SecondaryStatusTransition
s {$sel:startTime:SecondaryStatusTransition' :: POSIX
startTime = POSIX
a} :: SecondaryStatusTransition) ((POSIX -> f POSIX)
-> SecondaryStatusTransition -> f SecondaryStatusTransition)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> SecondaryStatusTransition
-> f SecondaryStatusTransition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Core.FromJSON SecondaryStatusTransition where
parseJSON :: Value -> Parser SecondaryStatusTransition
parseJSON =
String
-> (Object -> Parser SecondaryStatusTransition)
-> Value
-> Parser SecondaryStatusTransition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SecondaryStatusTransition"
( \Object
x ->
Maybe Text
-> Maybe POSIX
-> SecondaryStatus
-> POSIX
-> SecondaryStatusTransition
SecondaryStatusTransition'
(Maybe Text
-> Maybe POSIX
-> SecondaryStatus
-> POSIX
-> SecondaryStatusTransition)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> SecondaryStatus -> POSIX -> SecondaryStatusTransition)
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
"StatusMessage")
Parser
(Maybe POSIX
-> SecondaryStatus -> POSIX -> SecondaryStatusTransition)
-> Parser (Maybe POSIX)
-> Parser (SecondaryStatus -> POSIX -> SecondaryStatusTransition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndTime")
Parser (SecondaryStatus -> POSIX -> SecondaryStatusTransition)
-> Parser SecondaryStatus
-> Parser (POSIX -> SecondaryStatusTransition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser SecondaryStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Status")
Parser (POSIX -> SecondaryStatusTransition)
-> Parser POSIX -> Parser SecondaryStatusTransition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser POSIX
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"StartTime")
)
instance Prelude.Hashable SecondaryStatusTransition
instance Prelude.NFData SecondaryStatusTransition