{-# 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.Proton.Types.RepositorySyncAttempt where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Proton.Types.RepositorySyncEvent
import Amazonka.Proton.Types.RepositorySyncStatus
data RepositorySyncAttempt = RepositorySyncAttempt'
{
RepositorySyncAttempt -> [RepositorySyncEvent]
events :: [RepositorySyncEvent],
RepositorySyncAttempt -> POSIX
startedAt :: Data.POSIX,
RepositorySyncAttempt -> RepositorySyncStatus
status :: RepositorySyncStatus
}
deriving (RepositorySyncAttempt -> RepositorySyncAttempt -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RepositorySyncAttempt -> RepositorySyncAttempt -> Bool
$c/= :: RepositorySyncAttempt -> RepositorySyncAttempt -> Bool
== :: RepositorySyncAttempt -> RepositorySyncAttempt -> Bool
$c== :: RepositorySyncAttempt -> RepositorySyncAttempt -> Bool
Prelude.Eq, ReadPrec [RepositorySyncAttempt]
ReadPrec RepositorySyncAttempt
Int -> ReadS RepositorySyncAttempt
ReadS [RepositorySyncAttempt]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RepositorySyncAttempt]
$creadListPrec :: ReadPrec [RepositorySyncAttempt]
readPrec :: ReadPrec RepositorySyncAttempt
$creadPrec :: ReadPrec RepositorySyncAttempt
readList :: ReadS [RepositorySyncAttempt]
$creadList :: ReadS [RepositorySyncAttempt]
readsPrec :: Int -> ReadS RepositorySyncAttempt
$creadsPrec :: Int -> ReadS RepositorySyncAttempt
Prelude.Read, Int -> RepositorySyncAttempt -> ShowS
[RepositorySyncAttempt] -> ShowS
RepositorySyncAttempt -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RepositorySyncAttempt] -> ShowS
$cshowList :: [RepositorySyncAttempt] -> ShowS
show :: RepositorySyncAttempt -> String
$cshow :: RepositorySyncAttempt -> String
showsPrec :: Int -> RepositorySyncAttempt -> ShowS
$cshowsPrec :: Int -> RepositorySyncAttempt -> ShowS
Prelude.Show, forall x. Rep RepositorySyncAttempt x -> RepositorySyncAttempt
forall x. RepositorySyncAttempt -> Rep RepositorySyncAttempt x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RepositorySyncAttempt x -> RepositorySyncAttempt
$cfrom :: forall x. RepositorySyncAttempt -> Rep RepositorySyncAttempt x
Prelude.Generic)
newRepositorySyncAttempt ::
Prelude.UTCTime ->
RepositorySyncStatus ->
RepositorySyncAttempt
newRepositorySyncAttempt :: UTCTime -> RepositorySyncStatus -> RepositorySyncAttempt
newRepositorySyncAttempt UTCTime
pStartedAt_ RepositorySyncStatus
pStatus_ =
RepositorySyncAttempt'
{ $sel:events:RepositorySyncAttempt' :: [RepositorySyncEvent]
events = forall a. Monoid a => a
Prelude.mempty,
$sel:startedAt:RepositorySyncAttempt' :: POSIX
startedAt = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartedAt_,
$sel:status:RepositorySyncAttempt' :: RepositorySyncStatus
status = RepositorySyncStatus
pStatus_
}
repositorySyncAttempt_events :: Lens.Lens' RepositorySyncAttempt [RepositorySyncEvent]
repositorySyncAttempt_events :: Lens' RepositorySyncAttempt [RepositorySyncEvent]
repositorySyncAttempt_events = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositorySyncAttempt' {[RepositorySyncEvent]
events :: [RepositorySyncEvent]
$sel:events:RepositorySyncAttempt' :: RepositorySyncAttempt -> [RepositorySyncEvent]
events} -> [RepositorySyncEvent]
events) (\s :: RepositorySyncAttempt
s@RepositorySyncAttempt' {} [RepositorySyncEvent]
a -> RepositorySyncAttempt
s {$sel:events:RepositorySyncAttempt' :: [RepositorySyncEvent]
events = [RepositorySyncEvent]
a} :: RepositorySyncAttempt) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
repositorySyncAttempt_startedAt :: Lens.Lens' RepositorySyncAttempt Prelude.UTCTime
repositorySyncAttempt_startedAt :: Lens' RepositorySyncAttempt UTCTime
repositorySyncAttempt_startedAt = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositorySyncAttempt' {POSIX
startedAt :: POSIX
$sel:startedAt:RepositorySyncAttempt' :: RepositorySyncAttempt -> POSIX
startedAt} -> POSIX
startedAt) (\s :: RepositorySyncAttempt
s@RepositorySyncAttempt' {} POSIX
a -> RepositorySyncAttempt
s {$sel:startedAt:RepositorySyncAttempt' :: POSIX
startedAt = POSIX
a} :: RepositorySyncAttempt) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
repositorySyncAttempt_status :: Lens.Lens' RepositorySyncAttempt RepositorySyncStatus
repositorySyncAttempt_status :: Lens' RepositorySyncAttempt RepositorySyncStatus
repositorySyncAttempt_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RepositorySyncAttempt' {RepositorySyncStatus
status :: RepositorySyncStatus
$sel:status:RepositorySyncAttempt' :: RepositorySyncAttempt -> RepositorySyncStatus
status} -> RepositorySyncStatus
status) (\s :: RepositorySyncAttempt
s@RepositorySyncAttempt' {} RepositorySyncStatus
a -> RepositorySyncAttempt
s {$sel:status:RepositorySyncAttempt' :: RepositorySyncStatus
status = RepositorySyncStatus
a} :: RepositorySyncAttempt)
instance Data.FromJSON RepositorySyncAttempt where
parseJSON :: Value -> Parser RepositorySyncAttempt
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"RepositorySyncAttempt"
( \Object
x ->
[RepositorySyncEvent]
-> POSIX -> RepositorySyncStatus -> RepositorySyncAttempt
RepositorySyncAttempt'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"events" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"startedAt")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"status")
)
instance Prelude.Hashable RepositorySyncAttempt where
hashWithSalt :: Int -> RepositorySyncAttempt -> Int
hashWithSalt Int
_salt RepositorySyncAttempt' {[RepositorySyncEvent]
POSIX
RepositorySyncStatus
status :: RepositorySyncStatus
startedAt :: POSIX
events :: [RepositorySyncEvent]
$sel:status:RepositorySyncAttempt' :: RepositorySyncAttempt -> RepositorySyncStatus
$sel:startedAt:RepositorySyncAttempt' :: RepositorySyncAttempt -> POSIX
$sel:events:RepositorySyncAttempt' :: RepositorySyncAttempt -> [RepositorySyncEvent]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [RepositorySyncEvent]
events
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` POSIX
startedAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` RepositorySyncStatus
status
instance Prelude.NFData RepositorySyncAttempt where
rnf :: RepositorySyncAttempt -> ()
rnf RepositorySyncAttempt' {[RepositorySyncEvent]
POSIX
RepositorySyncStatus
status :: RepositorySyncStatus
startedAt :: POSIX
events :: [RepositorySyncEvent]
$sel:status:RepositorySyncAttempt' :: RepositorySyncAttempt -> RepositorySyncStatus
$sel:startedAt:RepositorySyncAttempt' :: RepositorySyncAttempt -> POSIX
$sel:events:RepositorySyncAttempt' :: RepositorySyncAttempt -> [RepositorySyncEvent]
..} =
forall a. NFData a => a -> ()
Prelude.rnf [RepositorySyncEvent]
events
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf POSIX
startedAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf RepositorySyncStatus
status