{-# 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.AccessAnalyzer.Types.PolicyGeneration where
import Amazonka.AccessAnalyzer.Types.JobStatus
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
data PolicyGeneration = PolicyGeneration'
{
PolicyGeneration -> Maybe ISO8601
completedOn :: Prelude.Maybe Data.ISO8601,
PolicyGeneration -> Text
jobId :: Prelude.Text,
PolicyGeneration -> Text
principalArn :: Prelude.Text,
PolicyGeneration -> JobStatus
status :: JobStatus,
PolicyGeneration -> ISO8601
startedOn :: Data.ISO8601
}
deriving (PolicyGeneration -> PolicyGeneration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PolicyGeneration -> PolicyGeneration -> Bool
$c/= :: PolicyGeneration -> PolicyGeneration -> Bool
== :: PolicyGeneration -> PolicyGeneration -> Bool
$c== :: PolicyGeneration -> PolicyGeneration -> Bool
Prelude.Eq, ReadPrec [PolicyGeneration]
ReadPrec PolicyGeneration
Int -> ReadS PolicyGeneration
ReadS [PolicyGeneration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PolicyGeneration]
$creadListPrec :: ReadPrec [PolicyGeneration]
readPrec :: ReadPrec PolicyGeneration
$creadPrec :: ReadPrec PolicyGeneration
readList :: ReadS [PolicyGeneration]
$creadList :: ReadS [PolicyGeneration]
readsPrec :: Int -> ReadS PolicyGeneration
$creadsPrec :: Int -> ReadS PolicyGeneration
Prelude.Read, Int -> PolicyGeneration -> ShowS
[PolicyGeneration] -> ShowS
PolicyGeneration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PolicyGeneration] -> ShowS
$cshowList :: [PolicyGeneration] -> ShowS
show :: PolicyGeneration -> String
$cshow :: PolicyGeneration -> String
showsPrec :: Int -> PolicyGeneration -> ShowS
$cshowsPrec :: Int -> PolicyGeneration -> ShowS
Prelude.Show, forall x. Rep PolicyGeneration x -> PolicyGeneration
forall x. PolicyGeneration -> Rep PolicyGeneration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PolicyGeneration x -> PolicyGeneration
$cfrom :: forall x. PolicyGeneration -> Rep PolicyGeneration x
Prelude.Generic)
newPolicyGeneration ::
Prelude.Text ->
Prelude.Text ->
JobStatus ->
Prelude.UTCTime ->
PolicyGeneration
newPolicyGeneration :: Text -> Text -> JobStatus -> UTCTime -> PolicyGeneration
newPolicyGeneration
Text
pJobId_
Text
pPrincipalArn_
JobStatus
pStatus_
UTCTime
pStartedOn_ =
PolicyGeneration'
{ $sel:completedOn:PolicyGeneration' :: Maybe ISO8601
completedOn = forall a. Maybe a
Prelude.Nothing,
$sel:jobId:PolicyGeneration' :: Text
jobId = Text
pJobId_,
$sel:principalArn:PolicyGeneration' :: Text
principalArn = Text
pPrincipalArn_,
$sel:status:PolicyGeneration' :: JobStatus
status = JobStatus
pStatus_,
$sel:startedOn:PolicyGeneration' :: ISO8601
startedOn = forall (a :: Format). Iso' (Time a) UTCTime
Data._Time forall t b. AReview t b -> b -> t
Lens.# UTCTime
pStartedOn_
}
policyGeneration_completedOn :: Lens.Lens' PolicyGeneration (Prelude.Maybe Prelude.UTCTime)
policyGeneration_completedOn :: Lens' PolicyGeneration (Maybe UTCTime)
policyGeneration_completedOn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGeneration' {Maybe ISO8601
completedOn :: Maybe ISO8601
$sel:completedOn:PolicyGeneration' :: PolicyGeneration -> Maybe ISO8601
completedOn} -> Maybe ISO8601
completedOn) (\s :: PolicyGeneration
s@PolicyGeneration' {} Maybe ISO8601
a -> PolicyGeneration
s {$sel:completedOn:PolicyGeneration' :: Maybe ISO8601
completedOn = Maybe ISO8601
a} :: PolicyGeneration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
policyGeneration_jobId :: Lens.Lens' PolicyGeneration Prelude.Text
policyGeneration_jobId :: Lens' PolicyGeneration Text
policyGeneration_jobId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGeneration' {Text
jobId :: Text
$sel:jobId:PolicyGeneration' :: PolicyGeneration -> Text
jobId} -> Text
jobId) (\s :: PolicyGeneration
s@PolicyGeneration' {} Text
a -> PolicyGeneration
s {$sel:jobId:PolicyGeneration' :: Text
jobId = Text
a} :: PolicyGeneration)
policyGeneration_principalArn :: Lens.Lens' PolicyGeneration Prelude.Text
policyGeneration_principalArn :: Lens' PolicyGeneration Text
policyGeneration_principalArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGeneration' {Text
principalArn :: Text
$sel:principalArn:PolicyGeneration' :: PolicyGeneration -> Text
principalArn} -> Text
principalArn) (\s :: PolicyGeneration
s@PolicyGeneration' {} Text
a -> PolicyGeneration
s {$sel:principalArn:PolicyGeneration' :: Text
principalArn = Text
a} :: PolicyGeneration)
policyGeneration_status :: Lens.Lens' PolicyGeneration JobStatus
policyGeneration_status :: Lens' PolicyGeneration JobStatus
policyGeneration_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGeneration' {JobStatus
status :: JobStatus
$sel:status:PolicyGeneration' :: PolicyGeneration -> JobStatus
status} -> JobStatus
status) (\s :: PolicyGeneration
s@PolicyGeneration' {} JobStatus
a -> PolicyGeneration
s {$sel:status:PolicyGeneration' :: JobStatus
status = JobStatus
a} :: PolicyGeneration)
policyGeneration_startedOn :: Lens.Lens' PolicyGeneration Prelude.UTCTime
policyGeneration_startedOn :: Lens' PolicyGeneration UTCTime
policyGeneration_startedOn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PolicyGeneration' {ISO8601
startedOn :: ISO8601
$sel:startedOn:PolicyGeneration' :: PolicyGeneration -> ISO8601
startedOn} -> ISO8601
startedOn) (\s :: PolicyGeneration
s@PolicyGeneration' {} ISO8601
a -> PolicyGeneration
s {$sel:startedOn:PolicyGeneration' :: ISO8601
startedOn = ISO8601
a} :: PolicyGeneration) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (a :: Format). Iso' (Time a) UTCTime
Data._Time
instance Data.FromJSON PolicyGeneration where
parseJSON :: Value -> Parser PolicyGeneration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"PolicyGeneration"
( \Object
x ->
Maybe ISO8601
-> Text -> Text -> JobStatus -> ISO8601 -> PolicyGeneration
PolicyGeneration'
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
"completedOn")
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
"jobId")
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
"principalArn")
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")
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
"startedOn")
)
instance Prelude.Hashable PolicyGeneration where
hashWithSalt :: Int -> PolicyGeneration -> Int
hashWithSalt Int
_salt PolicyGeneration' {Maybe ISO8601
Text
ISO8601
JobStatus
startedOn :: ISO8601
status :: JobStatus
principalArn :: Text
jobId :: Text
completedOn :: Maybe ISO8601
$sel:startedOn:PolicyGeneration' :: PolicyGeneration -> ISO8601
$sel:status:PolicyGeneration' :: PolicyGeneration -> JobStatus
$sel:principalArn:PolicyGeneration' :: PolicyGeneration -> Text
$sel:jobId:PolicyGeneration' :: PolicyGeneration -> Text
$sel:completedOn:PolicyGeneration' :: PolicyGeneration -> Maybe ISO8601
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
completedOn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
jobId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
principalArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` JobStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ISO8601
startedOn
instance Prelude.NFData PolicyGeneration where
rnf :: PolicyGeneration -> ()
rnf PolicyGeneration' {Maybe ISO8601
Text
ISO8601
JobStatus
startedOn :: ISO8601
status :: JobStatus
principalArn :: Text
jobId :: Text
completedOn :: Maybe ISO8601
$sel:startedOn:PolicyGeneration' :: PolicyGeneration -> ISO8601
$sel:status:PolicyGeneration' :: PolicyGeneration -> JobStatus
$sel:principalArn:PolicyGeneration' :: PolicyGeneration -> Text
$sel:jobId:PolicyGeneration' :: PolicyGeneration -> Text
$sel:completedOn:PolicyGeneration' :: PolicyGeneration -> Maybe ISO8601
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
completedOn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
jobId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
principalArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf JobStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ISO8601
startedOn