{-# 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.AccessPreview where
import Amazonka.AccessAnalyzer.Types.AccessPreviewStatus
import Amazonka.AccessAnalyzer.Types.AccessPreviewStatusReason
import Amazonka.AccessAnalyzer.Types.Configuration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AccessPreview = AccessPreview'
{
AccessPreview -> Maybe AccessPreviewStatusReason
statusReason :: Prelude.Maybe AccessPreviewStatusReason,
AccessPreview -> Text
analyzerArn :: Prelude.Text,
AccessPreview -> HashMap Text Configuration
configurations :: Prelude.HashMap Prelude.Text Configuration,
AccessPreview -> POSIX
createdAt :: Core.POSIX,
AccessPreview -> Text
id :: Prelude.Text,
AccessPreview -> AccessPreviewStatus
status :: AccessPreviewStatus
}
deriving (AccessPreview -> AccessPreview -> Bool
(AccessPreview -> AccessPreview -> Bool)
-> (AccessPreview -> AccessPreview -> Bool) -> Eq AccessPreview
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccessPreview -> AccessPreview -> Bool
$c/= :: AccessPreview -> AccessPreview -> Bool
== :: AccessPreview -> AccessPreview -> Bool
$c== :: AccessPreview -> AccessPreview -> Bool
Prelude.Eq, ReadPrec [AccessPreview]
ReadPrec AccessPreview
Int -> ReadS AccessPreview
ReadS [AccessPreview]
(Int -> ReadS AccessPreview)
-> ReadS [AccessPreview]
-> ReadPrec AccessPreview
-> ReadPrec [AccessPreview]
-> Read AccessPreview
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccessPreview]
$creadListPrec :: ReadPrec [AccessPreview]
readPrec :: ReadPrec AccessPreview
$creadPrec :: ReadPrec AccessPreview
readList :: ReadS [AccessPreview]
$creadList :: ReadS [AccessPreview]
readsPrec :: Int -> ReadS AccessPreview
$creadsPrec :: Int -> ReadS AccessPreview
Prelude.Read, Int -> AccessPreview -> ShowS
[AccessPreview] -> ShowS
AccessPreview -> String
(Int -> AccessPreview -> ShowS)
-> (AccessPreview -> String)
-> ([AccessPreview] -> ShowS)
-> Show AccessPreview
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccessPreview] -> ShowS
$cshowList :: [AccessPreview] -> ShowS
show :: AccessPreview -> String
$cshow :: AccessPreview -> String
showsPrec :: Int -> AccessPreview -> ShowS
$cshowsPrec :: Int -> AccessPreview -> ShowS
Prelude.Show, (forall x. AccessPreview -> Rep AccessPreview x)
-> (forall x. Rep AccessPreview x -> AccessPreview)
-> Generic AccessPreview
forall x. Rep AccessPreview x -> AccessPreview
forall x. AccessPreview -> Rep AccessPreview x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccessPreview x -> AccessPreview
$cfrom :: forall x. AccessPreview -> Rep AccessPreview x
Prelude.Generic)
newAccessPreview ::
Prelude.Text ->
Prelude.UTCTime ->
Prelude.Text ->
AccessPreviewStatus ->
AccessPreview
newAccessPreview :: Text -> UTCTime -> Text -> AccessPreviewStatus -> AccessPreview
newAccessPreview
Text
pAnalyzerArn_
UTCTime
pCreatedAt_
Text
pId_
AccessPreviewStatus
pStatus_ =
AccessPreview' :: Maybe AccessPreviewStatusReason
-> Text
-> HashMap Text Configuration
-> POSIX
-> Text
-> AccessPreviewStatus
-> AccessPreview
AccessPreview'
{ $sel:statusReason:AccessPreview' :: Maybe AccessPreviewStatusReason
statusReason = Maybe AccessPreviewStatusReason
forall a. Maybe a
Prelude.Nothing,
$sel:analyzerArn:AccessPreview' :: Text
analyzerArn = Text
pAnalyzerArn_,
$sel:configurations:AccessPreview' :: HashMap Text Configuration
configurations = HashMap Text Configuration
forall a. Monoid a => a
Prelude.mempty,
$sel:createdAt:AccessPreview' :: 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:AccessPreview' :: Text
id = Text
pId_,
$sel:status:AccessPreview' :: AccessPreviewStatus
status = AccessPreviewStatus
pStatus_
}
accessPreview_statusReason :: Lens.Lens' AccessPreview (Prelude.Maybe AccessPreviewStatusReason)
accessPreview_statusReason :: (Maybe AccessPreviewStatusReason
-> f (Maybe AccessPreviewStatusReason))
-> AccessPreview -> f AccessPreview
accessPreview_statusReason = (AccessPreview -> Maybe AccessPreviewStatusReason)
-> (AccessPreview
-> Maybe AccessPreviewStatusReason -> AccessPreview)
-> Lens
AccessPreview
AccessPreview
(Maybe AccessPreviewStatusReason)
(Maybe AccessPreviewStatusReason)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreview' {Maybe AccessPreviewStatusReason
statusReason :: Maybe AccessPreviewStatusReason
$sel:statusReason:AccessPreview' :: AccessPreview -> Maybe AccessPreviewStatusReason
statusReason} -> Maybe AccessPreviewStatusReason
statusReason) (\s :: AccessPreview
s@AccessPreview' {} Maybe AccessPreviewStatusReason
a -> AccessPreview
s {$sel:statusReason:AccessPreview' :: Maybe AccessPreviewStatusReason
statusReason = Maybe AccessPreviewStatusReason
a} :: AccessPreview)
accessPreview_analyzerArn :: Lens.Lens' AccessPreview Prelude.Text
accessPreview_analyzerArn :: (Text -> f Text) -> AccessPreview -> f AccessPreview
accessPreview_analyzerArn = (AccessPreview -> Text)
-> (AccessPreview -> Text -> AccessPreview)
-> Lens AccessPreview AccessPreview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreview' {Text
analyzerArn :: Text
$sel:analyzerArn:AccessPreview' :: AccessPreview -> Text
analyzerArn} -> Text
analyzerArn) (\s :: AccessPreview
s@AccessPreview' {} Text
a -> AccessPreview
s {$sel:analyzerArn:AccessPreview' :: Text
analyzerArn = Text
a} :: AccessPreview)
accessPreview_configurations :: Lens.Lens' AccessPreview (Prelude.HashMap Prelude.Text Configuration)
accessPreview_configurations :: (HashMap Text Configuration -> f (HashMap Text Configuration))
-> AccessPreview -> f AccessPreview
accessPreview_configurations = (AccessPreview -> HashMap Text Configuration)
-> (AccessPreview -> HashMap Text Configuration -> AccessPreview)
-> Lens
AccessPreview
AccessPreview
(HashMap Text Configuration)
(HashMap Text Configuration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreview' {HashMap Text Configuration
configurations :: HashMap Text Configuration
$sel:configurations:AccessPreview' :: AccessPreview -> HashMap Text Configuration
configurations} -> HashMap Text Configuration
configurations) (\s :: AccessPreview
s@AccessPreview' {} HashMap Text Configuration
a -> AccessPreview
s {$sel:configurations:AccessPreview' :: HashMap Text Configuration
configurations = HashMap Text Configuration
a} :: AccessPreview) ((HashMap Text Configuration -> f (HashMap Text Configuration))
-> AccessPreview -> f AccessPreview)
-> ((HashMap Text Configuration -> f (HashMap Text Configuration))
-> HashMap Text Configuration -> f (HashMap Text Configuration))
-> (HashMap Text Configuration -> f (HashMap Text Configuration))
-> AccessPreview
-> f AccessPreview
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (HashMap Text Configuration -> f (HashMap Text Configuration))
-> HashMap Text Configuration -> f (HashMap Text Configuration)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
accessPreview_createdAt :: Lens.Lens' AccessPreview Prelude.UTCTime
accessPreview_createdAt :: (UTCTime -> f UTCTime) -> AccessPreview -> f AccessPreview
accessPreview_createdAt = (AccessPreview -> POSIX)
-> (AccessPreview -> POSIX -> AccessPreview)
-> Lens AccessPreview AccessPreview POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreview' {POSIX
createdAt :: POSIX
$sel:createdAt:AccessPreview' :: AccessPreview -> POSIX
createdAt} -> POSIX
createdAt) (\s :: AccessPreview
s@AccessPreview' {} POSIX
a -> AccessPreview
s {$sel:createdAt:AccessPreview' :: POSIX
createdAt = POSIX
a} :: AccessPreview) ((POSIX -> f POSIX) -> AccessPreview -> f AccessPreview)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> AccessPreview
-> f AccessPreview
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
accessPreview_id :: Lens.Lens' AccessPreview Prelude.Text
accessPreview_id :: (Text -> f Text) -> AccessPreview -> f AccessPreview
accessPreview_id = (AccessPreview -> Text)
-> (AccessPreview -> Text -> AccessPreview)
-> Lens AccessPreview AccessPreview Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreview' {Text
id :: Text
$sel:id:AccessPreview' :: AccessPreview -> Text
id} -> Text
id) (\s :: AccessPreview
s@AccessPreview' {} Text
a -> AccessPreview
s {$sel:id:AccessPreview' :: Text
id = Text
a} :: AccessPreview)
accessPreview_status :: Lens.Lens' AccessPreview AccessPreviewStatus
accessPreview_status :: (AccessPreviewStatus -> f AccessPreviewStatus)
-> AccessPreview -> f AccessPreview
accessPreview_status = (AccessPreview -> AccessPreviewStatus)
-> (AccessPreview -> AccessPreviewStatus -> AccessPreview)
-> Lens
AccessPreview AccessPreview AccessPreviewStatus AccessPreviewStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccessPreview' {AccessPreviewStatus
status :: AccessPreviewStatus
$sel:status:AccessPreview' :: AccessPreview -> AccessPreviewStatus
status} -> AccessPreviewStatus
status) (\s :: AccessPreview
s@AccessPreview' {} AccessPreviewStatus
a -> AccessPreview
s {$sel:status:AccessPreview' :: AccessPreviewStatus
status = AccessPreviewStatus
a} :: AccessPreview)
instance Core.FromJSON AccessPreview where
parseJSON :: Value -> Parser AccessPreview
parseJSON =
String
-> (Object -> Parser AccessPreview)
-> Value
-> Parser AccessPreview
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AccessPreview"
( \Object
x ->
Maybe AccessPreviewStatusReason
-> Text
-> HashMap Text Configuration
-> POSIX
-> Text
-> AccessPreviewStatus
-> AccessPreview
AccessPreview'
(Maybe AccessPreviewStatusReason
-> Text
-> HashMap Text Configuration
-> POSIX
-> Text
-> AccessPreviewStatus
-> AccessPreview)
-> Parser (Maybe AccessPreviewStatusReason)
-> Parser
(Text
-> HashMap Text Configuration
-> POSIX
-> Text
-> AccessPreviewStatus
-> AccessPreview)
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
-> HashMap Text Configuration
-> POSIX
-> Text
-> AccessPreviewStatus
-> AccessPreview)
-> Parser Text
-> Parser
(HashMap Text Configuration
-> POSIX -> Text -> AccessPreviewStatus -> AccessPreview)
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
(HashMap Text Configuration
-> POSIX -> Text -> AccessPreviewStatus -> AccessPreview)
-> Parser (HashMap Text Configuration)
-> Parser (POSIX -> Text -> AccessPreviewStatus -> AccessPreview)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (HashMap Text Configuration))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configurations" Parser (Maybe (HashMap Text Configuration))
-> HashMap Text Configuration
-> Parser (HashMap Text Configuration)
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= HashMap Text Configuration
forall a. Monoid a => a
Prelude.mempty)
Parser (POSIX -> Text -> AccessPreviewStatus -> AccessPreview)
-> Parser POSIX
-> Parser (Text -> AccessPreviewStatus -> AccessPreview)
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 -> AccessPreview)
-> Parser Text -> Parser (AccessPreviewStatus -> AccessPreview)
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 -> AccessPreview)
-> Parser AccessPreviewStatus -> Parser AccessPreview
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 AccessPreview
instance Prelude.NFData AccessPreview