{-# 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.AccessPreviewSummary where
import Amazonka.AccessAnalyzer.Types.AccessPreviewStatus
import Amazonka.AccessAnalyzer.Types.AccessPreviewStatusReason
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AccessPreviewSummary = AccessPreviewSummary'
{ AccessPreviewSummary -> Maybe AccessPreviewStatusReason
statusReason :: Prelude.Maybe AccessPreviewStatusReason,
AccessPreviewSummary -> Text
analyzerArn :: Prelude.Text,
AccessPreviewSummary -> POSIX
createdAt :: Core.POSIX,
AccessPreviewSummary -> Text
id :: Prelude.Text,
AccessPreviewSummary -> AccessPreviewStatus
status :: AccessPreviewStatus
}
deriving (AccessPreviewSummary -> AccessPreviewSummary -> Bool
(AccessPreviewSummary -> AccessPreviewSummary -> Bool)
-> (AccessPreviewSummary -> AccessPreviewSummary -> Bool)
-> Eq AccessPreviewSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccessPreviewSummary -> AccessPreviewSummary -> Bool
$c/= :: AccessPreviewSummary -> AccessPreviewSummary -> Bool
== :: AccessPreviewSummary -> AccessPreviewSummary -> Bool
$c== :: AccessPreviewSummary -> AccessPreviewSummary -> Bool
Prelude.Eq, ReadPrec [AccessPreviewSummary]
ReadPrec AccessPreviewSummary
Int -> ReadS AccessPreviewSummary
ReadS [AccessPreviewSummary]
(Int -> ReadS AccessPreviewSummary)
-> ReadS [AccessPreviewSummary]
-> ReadPrec AccessPreviewSummary
-> ReadPrec [AccessPreviewSummary]
-> Read AccessPreviewSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccessPreviewSummary]
$creadListPrec :: ReadPrec [AccessPreviewSummary]
readPrec :: ReadPrec AccessPreviewSummary
$creadPrec :: ReadPrec AccessPreviewSummary
readList :: ReadS [AccessPreviewSummary]
$creadList :: ReadS [AccessPreviewSummary]
readsPrec :: Int -> ReadS AccessPreviewSummary
$creadsPrec :: Int -> ReadS AccessPreviewSummary
Prelude.Read, Int -> AccessPreviewSummary -> ShowS
[AccessPreviewSummary] -> ShowS
AccessPreviewSummary -> String
(Int -> AccessPreviewSummary -> ShowS)
-> (AccessPreviewSummary -> String)
-> ([AccessPreviewSummary] -> ShowS)
-> Show AccessPreviewSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccessPreviewSummary] -> ShowS
$cshowList :: [AccessPreviewSummary] -> ShowS
show :: AccessPreviewSummary -> String
$cshow :: AccessPreviewSummary -> String
showsPrec :: Int -> AccessPreviewSummary -> ShowS
$cshowsPrec :: Int -> AccessPreviewSummary -> ShowS
Prelude.Show, (forall x. AccessPreviewSummary -> Rep AccessPreviewSummary x)
-> (forall x. Rep AccessPreviewSummary x -> AccessPreviewSummary)
-> Generic AccessPreviewSummary
forall x. Rep AccessPreviewSummary x -> AccessPreviewSummary
forall x. AccessPreviewSummary -> Rep AccessPreviewSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccessPreviewSummary x -> AccessPreviewSummary
$cfrom :: forall x. AccessPreviewSummary -> Rep AccessPreviewSummary x
Prelude.Generic)
newAccessPreviewSummary ::
Prelude.Text ->
Prelude.UTCTime ->
Prelude.Text ->
AccessPreviewStatus ->
AccessPreviewSummary
newAccessPreviewSummary :: Text
-> UTCTime -> Text -> AccessPreviewStatus -> AccessPreviewSummary
newAccessPreviewSummary
Text
pAnalyzerArn_
UTCTime
pCreatedAt_
Text
pId_
AccessPreviewStatus
pStatus_ =
AccessPreviewSummary' :: Maybe AccessPreviewStatusReason
-> Text
-> POSIX
-> Text
-> AccessPreviewStatus
-> AccessPreviewSummary
AccessPreviewSummary'
{ $sel:statusReason:AccessPreviewSummary' :: Maybe AccessPreviewStatusReason
statusReason =
Maybe AccessPreviewStatusReason
forall a. Maybe a
Prelude.Nothing,
$sel:analyzerArn:AccessPreviewSummary' :: Text
analyzerArn = Text
pAnalyzerArn_,
$sel:createdAt:AccessPreviewSummary' :: POSIX
createdAt = 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
pCreatedAt_,
$sel:id:AccessPreviewSummary' :: Text
id = Text
pId_,
$sel:status:AccessPreviewSummary' :: AccessPreviewStatus
status = AccessPreviewStatus
pStatus_
}
accessPreviewSummary_statusReason :: Lens.Lens' AccessPreviewSummary (Prelude.Maybe AccessPreviewStatusReason)
accessPreviewSummary_statusReason :: (Maybe AccessPreviewStatusReason
-> f (Maybe AccessPreviewStatusReason))
-> AccessPreviewSummary -> f AccessPreviewSummary
accessPreviewSummary_statusReason = (AccessPreviewSummary -> Maybe AccessPreviewStatusReason)
-> (AccessPreviewSummary
-> Maybe AccessPreviewStatusReason -> AccessPreviewSummary)
-> Lens
AccessPreviewSummary
AccessPreviewSummary
(Maybe AccessPreviewStatusReason)
(Maybe AccessPreviewStatusReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewSummary' {Maybe AccessPreviewStatusReason
statusReason :: Maybe AccessPreviewStatusReason
$sel:statusReason:AccessPreviewSummary' :: AccessPreviewSummary -> Maybe AccessPreviewStatusReason
statusReason} -> Maybe AccessPreviewStatusReason
statusReason) (\s :: AccessPreviewSummary
s@AccessPreviewSummary' {} Maybe AccessPreviewStatusReason
a -> AccessPreviewSummary
s {$sel:statusReason:AccessPreviewSummary' :: Maybe AccessPreviewStatusReason
statusReason = Maybe AccessPreviewStatusReason
a} :: AccessPreviewSummary)
accessPreviewSummary_analyzerArn :: Lens.Lens' AccessPreviewSummary Prelude.Text
accessPreviewSummary_analyzerArn :: (Text -> f Text) -> AccessPreviewSummary -> f AccessPreviewSummary
accessPreviewSummary_analyzerArn = (AccessPreviewSummary -> Text)
-> (AccessPreviewSummary -> Text -> AccessPreviewSummary)
-> Lens AccessPreviewSummary AccessPreviewSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewSummary' {Text
analyzerArn :: Text
$sel:analyzerArn:AccessPreviewSummary' :: AccessPreviewSummary -> Text
analyzerArn} -> Text
analyzerArn) (\s :: AccessPreviewSummary
s@AccessPreviewSummary' {} Text
a -> AccessPreviewSummary
s {$sel:analyzerArn:AccessPreviewSummary' :: Text
analyzerArn = Text
a} :: AccessPreviewSummary)
accessPreviewSummary_createdAt :: Lens.Lens' AccessPreviewSummary Prelude.UTCTime
accessPreviewSummary_createdAt :: (UTCTime -> f UTCTime)
-> AccessPreviewSummary -> f AccessPreviewSummary
accessPreviewSummary_createdAt = (AccessPreviewSummary -> POSIX)
-> (AccessPreviewSummary -> POSIX -> AccessPreviewSummary)
-> Lens AccessPreviewSummary AccessPreviewSummary POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewSummary' {POSIX
createdAt :: POSIX
$sel:createdAt:AccessPreviewSummary' :: AccessPreviewSummary -> POSIX
createdAt} -> POSIX
createdAt) (\s :: AccessPreviewSummary
s@AccessPreviewSummary' {} POSIX
a -> AccessPreviewSummary
s {$sel:createdAt:AccessPreviewSummary' :: POSIX
createdAt = POSIX
a} :: AccessPreviewSummary) ((POSIX -> f POSIX)
-> AccessPreviewSummary -> f AccessPreviewSummary)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AccessPreviewSummary
-> f AccessPreviewSummary
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
accessPreviewSummary_id :: Lens.Lens' AccessPreviewSummary Prelude.Text
accessPreviewSummary_id :: (Text -> f Text) -> AccessPreviewSummary -> f AccessPreviewSummary
accessPreviewSummary_id = (AccessPreviewSummary -> Text)
-> (AccessPreviewSummary -> Text -> AccessPreviewSummary)
-> Lens AccessPreviewSummary AccessPreviewSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewSummary' {Text
id :: Text
$sel:id:AccessPreviewSummary' :: AccessPreviewSummary -> Text
id} -> Text
id) (\s :: AccessPreviewSummary
s@AccessPreviewSummary' {} Text
a -> AccessPreviewSummary
s {$sel:id:AccessPreviewSummary' :: Text
id = Text
a} :: AccessPreviewSummary)
accessPreviewSummary_status :: Lens.Lens' AccessPreviewSummary AccessPreviewStatus
accessPreviewSummary_status :: (AccessPreviewStatus -> f AccessPreviewStatus)
-> AccessPreviewSummary -> f AccessPreviewSummary
accessPreviewSummary_status = (AccessPreviewSummary -> AccessPreviewStatus)
-> (AccessPreviewSummary
-> AccessPreviewStatus -> AccessPreviewSummary)
-> Lens
AccessPreviewSummary
AccessPreviewSummary
AccessPreviewStatus
AccessPreviewStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreviewSummary' {AccessPreviewStatus
status :: AccessPreviewStatus
$sel:status:AccessPreviewSummary' :: AccessPreviewSummary -> AccessPreviewStatus
status} -> AccessPreviewStatus
status) (\s :: AccessPreviewSummary
s@AccessPreviewSummary' {} AccessPreviewStatus
a -> AccessPreviewSummary
s {$sel:status:AccessPreviewSummary' :: AccessPreviewStatus
status = AccessPreviewStatus
a} :: AccessPreviewSummary)
instance Core.FromJSON AccessPreviewSummary where
parseJSON :: Value -> Parser AccessPreviewSummary
parseJSON =
String
-> (Object -> Parser AccessPreviewSummary)
-> Value
-> Parser AccessPreviewSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AccessPreviewSummary"
( \Object
x ->
Maybe AccessPreviewStatusReason
-> Text
-> POSIX
-> Text
-> AccessPreviewStatus
-> AccessPreviewSummary
AccessPreviewSummary'
(Maybe AccessPreviewStatusReason
-> Text
-> POSIX
-> Text
-> AccessPreviewStatus
-> AccessPreviewSummary)
-> Parser (Maybe AccessPreviewStatusReason)
-> Parser
(Text
-> POSIX -> Text -> AccessPreviewStatus -> AccessPreviewSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AccessPreviewStatusReason)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statusReason")
Parser
(Text
-> POSIX -> Text -> AccessPreviewStatus -> AccessPreviewSummary)
-> Parser Text
-> Parser
(POSIX -> Text -> AccessPreviewStatus -> AccessPreviewSummary)
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
"analyzerArn")
Parser
(POSIX -> Text -> AccessPreviewStatus -> AccessPreviewSummary)
-> Parser POSIX
-> Parser (Text -> AccessPreviewStatus -> AccessPreviewSummary)
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
"createdAt")
Parser (Text -> AccessPreviewStatus -> AccessPreviewSummary)
-> Parser Text
-> Parser (AccessPreviewStatus -> AccessPreviewSummary)
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
"id")
Parser (AccessPreviewStatus -> AccessPreviewSummary)
-> Parser AccessPreviewStatus -> Parser AccessPreviewSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AccessPreviewStatus
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"status")
)
instance Prelude.Hashable AccessPreviewSummary
instance Prelude.NFData AccessPreviewSummary