{-# 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.MacieV2.Types.SessionContextAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SessionContextAttributes = SessionContextAttributes'
{
SessionContextAttributes -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
SessionContextAttributes -> Maybe Bool
mfaAuthenticated :: Prelude.Maybe Prelude.Bool
}
deriving (SessionContextAttributes -> SessionContextAttributes -> Bool
(SessionContextAttributes -> SessionContextAttributes -> Bool)
-> (SessionContextAttributes -> SessionContextAttributes -> Bool)
-> Eq SessionContextAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SessionContextAttributes -> SessionContextAttributes -> Bool
$c/= :: SessionContextAttributes -> SessionContextAttributes -> Bool
== :: SessionContextAttributes -> SessionContextAttributes -> Bool
$c== :: SessionContextAttributes -> SessionContextAttributes -> Bool
Prelude.Eq, ReadPrec [SessionContextAttributes]
ReadPrec SessionContextAttributes
Int -> ReadS SessionContextAttributes
ReadS [SessionContextAttributes]
(Int -> ReadS SessionContextAttributes)
-> ReadS [SessionContextAttributes]
-> ReadPrec SessionContextAttributes
-> ReadPrec [SessionContextAttributes]
-> Read SessionContextAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SessionContextAttributes]
$creadListPrec :: ReadPrec [SessionContextAttributes]
readPrec :: ReadPrec SessionContextAttributes
$creadPrec :: ReadPrec SessionContextAttributes
readList :: ReadS [SessionContextAttributes]
$creadList :: ReadS [SessionContextAttributes]
readsPrec :: Int -> ReadS SessionContextAttributes
$creadsPrec :: Int -> ReadS SessionContextAttributes
Prelude.Read, Int -> SessionContextAttributes -> ShowS
[SessionContextAttributes] -> ShowS
SessionContextAttributes -> String
(Int -> SessionContextAttributes -> ShowS)
-> (SessionContextAttributes -> String)
-> ([SessionContextAttributes] -> ShowS)
-> Show SessionContextAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SessionContextAttributes] -> ShowS
$cshowList :: [SessionContextAttributes] -> ShowS
show :: SessionContextAttributes -> String
$cshow :: SessionContextAttributes -> String
showsPrec :: Int -> SessionContextAttributes -> ShowS
$cshowsPrec :: Int -> SessionContextAttributes -> ShowS
Prelude.Show, (forall x.
SessionContextAttributes -> Rep SessionContextAttributes x)
-> (forall x.
Rep SessionContextAttributes x -> SessionContextAttributes)
-> Generic SessionContextAttributes
forall x.
Rep SessionContextAttributes x -> SessionContextAttributes
forall x.
SessionContextAttributes -> Rep SessionContextAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SessionContextAttributes x -> SessionContextAttributes
$cfrom :: forall x.
SessionContextAttributes -> Rep SessionContextAttributes x
Prelude.Generic)
newSessionContextAttributes ::
SessionContextAttributes
newSessionContextAttributes :: SessionContextAttributes
newSessionContextAttributes =
SessionContextAttributes' :: Maybe POSIX -> Maybe Bool -> SessionContextAttributes
SessionContextAttributes'
{ $sel:creationDate:SessionContextAttributes' :: Maybe POSIX
creationDate =
Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:mfaAuthenticated:SessionContextAttributes' :: Maybe Bool
mfaAuthenticated = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
sessionContextAttributes_creationDate :: Lens.Lens' SessionContextAttributes (Prelude.Maybe Prelude.UTCTime)
sessionContextAttributes_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SessionContextAttributes -> f SessionContextAttributes
sessionContextAttributes_creationDate = (SessionContextAttributes -> Maybe POSIX)
-> (SessionContextAttributes
-> Maybe POSIX -> SessionContextAttributes)
-> Lens
SessionContextAttributes
SessionContextAttributes
(Maybe POSIX)
(Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionContextAttributes' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:SessionContextAttributes' :: SessionContextAttributes -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: SessionContextAttributes
s@SessionContextAttributes' {} Maybe POSIX
a -> SessionContextAttributes
s {$sel:creationDate:SessionContextAttributes' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: SessionContextAttributes) ((Maybe POSIX -> f (Maybe POSIX))
-> SessionContextAttributes -> f SessionContextAttributes)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SessionContextAttributes
-> f SessionContextAttributes
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
sessionContextAttributes_mfaAuthenticated :: Lens.Lens' SessionContextAttributes (Prelude.Maybe Prelude.Bool)
sessionContextAttributes_mfaAuthenticated :: (Maybe Bool -> f (Maybe Bool))
-> SessionContextAttributes -> f SessionContextAttributes
sessionContextAttributes_mfaAuthenticated = (SessionContextAttributes -> Maybe Bool)
-> (SessionContextAttributes
-> Maybe Bool -> SessionContextAttributes)
-> Lens
SessionContextAttributes
SessionContextAttributes
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SessionContextAttributes' {Maybe Bool
mfaAuthenticated :: Maybe Bool
$sel:mfaAuthenticated:SessionContextAttributes' :: SessionContextAttributes -> Maybe Bool
mfaAuthenticated} -> Maybe Bool
mfaAuthenticated) (\s :: SessionContextAttributes
s@SessionContextAttributes' {} Maybe Bool
a -> SessionContextAttributes
s {$sel:mfaAuthenticated:SessionContextAttributes' :: Maybe Bool
mfaAuthenticated = Maybe Bool
a} :: SessionContextAttributes)
instance Core.FromJSON SessionContextAttributes where
parseJSON :: Value -> Parser SessionContextAttributes
parseJSON =
String
-> (Object -> Parser SessionContextAttributes)
-> Value
-> Parser SessionContextAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SessionContextAttributes"
( \Object
x ->
Maybe POSIX -> Maybe Bool -> SessionContextAttributes
SessionContextAttributes'
(Maybe POSIX -> Maybe Bool -> SessionContextAttributes)
-> Parser (Maybe POSIX)
-> Parser (Maybe Bool -> SessionContextAttributes)
forall (f :: * -> *) a b. Functor 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
"creationDate")
Parser (Maybe Bool -> SessionContextAttributes)
-> Parser (Maybe Bool) -> Parser SessionContextAttributes
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"mfaAuthenticated")
)
instance Prelude.Hashable SessionContextAttributes
instance Prelude.NFData SessionContextAttributes