{-# 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.SecurityHub.Types.AwsIamAccessKeySessionContextAttributes where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsIamAccessKeySessionContextAttributes = AwsIamAccessKeySessionContextAttributes'
{
AwsIamAccessKeySessionContextAttributes -> Maybe Text
creationDate :: Prelude.Maybe Prelude.Text,
AwsIamAccessKeySessionContextAttributes -> Maybe Bool
mfaAuthenticated :: Prelude.Maybe Prelude.Bool
}
deriving (AwsIamAccessKeySessionContextAttributes
-> AwsIamAccessKeySessionContextAttributes -> Bool
(AwsIamAccessKeySessionContextAttributes
-> AwsIamAccessKeySessionContextAttributes -> Bool)
-> (AwsIamAccessKeySessionContextAttributes
-> AwsIamAccessKeySessionContextAttributes -> Bool)
-> Eq AwsIamAccessKeySessionContextAttributes
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsIamAccessKeySessionContextAttributes
-> AwsIamAccessKeySessionContextAttributes -> Bool
$c/= :: AwsIamAccessKeySessionContextAttributes
-> AwsIamAccessKeySessionContextAttributes -> Bool
== :: AwsIamAccessKeySessionContextAttributes
-> AwsIamAccessKeySessionContextAttributes -> Bool
$c== :: AwsIamAccessKeySessionContextAttributes
-> AwsIamAccessKeySessionContextAttributes -> Bool
Prelude.Eq, ReadPrec [AwsIamAccessKeySessionContextAttributes]
ReadPrec AwsIamAccessKeySessionContextAttributes
Int -> ReadS AwsIamAccessKeySessionContextAttributes
ReadS [AwsIamAccessKeySessionContextAttributes]
(Int -> ReadS AwsIamAccessKeySessionContextAttributes)
-> ReadS [AwsIamAccessKeySessionContextAttributes]
-> ReadPrec AwsIamAccessKeySessionContextAttributes
-> ReadPrec [AwsIamAccessKeySessionContextAttributes]
-> Read AwsIamAccessKeySessionContextAttributes
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsIamAccessKeySessionContextAttributes]
$creadListPrec :: ReadPrec [AwsIamAccessKeySessionContextAttributes]
readPrec :: ReadPrec AwsIamAccessKeySessionContextAttributes
$creadPrec :: ReadPrec AwsIamAccessKeySessionContextAttributes
readList :: ReadS [AwsIamAccessKeySessionContextAttributes]
$creadList :: ReadS [AwsIamAccessKeySessionContextAttributes]
readsPrec :: Int -> ReadS AwsIamAccessKeySessionContextAttributes
$creadsPrec :: Int -> ReadS AwsIamAccessKeySessionContextAttributes
Prelude.Read, Int -> AwsIamAccessKeySessionContextAttributes -> ShowS
[AwsIamAccessKeySessionContextAttributes] -> ShowS
AwsIamAccessKeySessionContextAttributes -> String
(Int -> AwsIamAccessKeySessionContextAttributes -> ShowS)
-> (AwsIamAccessKeySessionContextAttributes -> String)
-> ([AwsIamAccessKeySessionContextAttributes] -> ShowS)
-> Show AwsIamAccessKeySessionContextAttributes
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsIamAccessKeySessionContextAttributes] -> ShowS
$cshowList :: [AwsIamAccessKeySessionContextAttributes] -> ShowS
show :: AwsIamAccessKeySessionContextAttributes -> String
$cshow :: AwsIamAccessKeySessionContextAttributes -> String
showsPrec :: Int -> AwsIamAccessKeySessionContextAttributes -> ShowS
$cshowsPrec :: Int -> AwsIamAccessKeySessionContextAttributes -> ShowS
Prelude.Show, (forall x.
AwsIamAccessKeySessionContextAttributes
-> Rep AwsIamAccessKeySessionContextAttributes x)
-> (forall x.
Rep AwsIamAccessKeySessionContextAttributes x
-> AwsIamAccessKeySessionContextAttributes)
-> Generic AwsIamAccessKeySessionContextAttributes
forall x.
Rep AwsIamAccessKeySessionContextAttributes x
-> AwsIamAccessKeySessionContextAttributes
forall x.
AwsIamAccessKeySessionContextAttributes
-> Rep AwsIamAccessKeySessionContextAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsIamAccessKeySessionContextAttributes x
-> AwsIamAccessKeySessionContextAttributes
$cfrom :: forall x.
AwsIamAccessKeySessionContextAttributes
-> Rep AwsIamAccessKeySessionContextAttributes x
Prelude.Generic)
newAwsIamAccessKeySessionContextAttributes ::
AwsIamAccessKeySessionContextAttributes
newAwsIamAccessKeySessionContextAttributes :: AwsIamAccessKeySessionContextAttributes
newAwsIamAccessKeySessionContextAttributes =
AwsIamAccessKeySessionContextAttributes' :: Maybe Text -> Maybe Bool -> AwsIamAccessKeySessionContextAttributes
AwsIamAccessKeySessionContextAttributes'
{ $sel:creationDate:AwsIamAccessKeySessionContextAttributes' :: Maybe Text
creationDate =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:mfaAuthenticated:AwsIamAccessKeySessionContextAttributes' :: Maybe Bool
mfaAuthenticated = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
awsIamAccessKeySessionContextAttributes_creationDate :: Lens.Lens' AwsIamAccessKeySessionContextAttributes (Prelude.Maybe Prelude.Text)
awsIamAccessKeySessionContextAttributes_creationDate :: (Maybe Text -> f (Maybe Text))
-> AwsIamAccessKeySessionContextAttributes
-> f AwsIamAccessKeySessionContextAttributes
awsIamAccessKeySessionContextAttributes_creationDate = (AwsIamAccessKeySessionContextAttributes -> Maybe Text)
-> (AwsIamAccessKeySessionContextAttributes
-> Maybe Text -> AwsIamAccessKeySessionContextAttributes)
-> Lens
AwsIamAccessKeySessionContextAttributes
AwsIamAccessKeySessionContextAttributes
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamAccessKeySessionContextAttributes' {Maybe Text
creationDate :: Maybe Text
$sel:creationDate:AwsIamAccessKeySessionContextAttributes' :: AwsIamAccessKeySessionContextAttributes -> Maybe Text
creationDate} -> Maybe Text
creationDate) (\s :: AwsIamAccessKeySessionContextAttributes
s@AwsIamAccessKeySessionContextAttributes' {} Maybe Text
a -> AwsIamAccessKeySessionContextAttributes
s {$sel:creationDate:AwsIamAccessKeySessionContextAttributes' :: Maybe Text
creationDate = Maybe Text
a} :: AwsIamAccessKeySessionContextAttributes)
awsIamAccessKeySessionContextAttributes_mfaAuthenticated :: Lens.Lens' AwsIamAccessKeySessionContextAttributes (Prelude.Maybe Prelude.Bool)
awsIamAccessKeySessionContextAttributes_mfaAuthenticated :: (Maybe Bool -> f (Maybe Bool))
-> AwsIamAccessKeySessionContextAttributes
-> f AwsIamAccessKeySessionContextAttributes
awsIamAccessKeySessionContextAttributes_mfaAuthenticated = (AwsIamAccessKeySessionContextAttributes -> Maybe Bool)
-> (AwsIamAccessKeySessionContextAttributes
-> Maybe Bool -> AwsIamAccessKeySessionContextAttributes)
-> Lens
AwsIamAccessKeySessionContextAttributes
AwsIamAccessKeySessionContextAttributes
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsIamAccessKeySessionContextAttributes' {Maybe Bool
mfaAuthenticated :: Maybe Bool
$sel:mfaAuthenticated:AwsIamAccessKeySessionContextAttributes' :: AwsIamAccessKeySessionContextAttributes -> Maybe Bool
mfaAuthenticated} -> Maybe Bool
mfaAuthenticated) (\s :: AwsIamAccessKeySessionContextAttributes
s@AwsIamAccessKeySessionContextAttributes' {} Maybe Bool
a -> AwsIamAccessKeySessionContextAttributes
s {$sel:mfaAuthenticated:AwsIamAccessKeySessionContextAttributes' :: Maybe Bool
mfaAuthenticated = Maybe Bool
a} :: AwsIamAccessKeySessionContextAttributes)
instance
Core.FromJSON
AwsIamAccessKeySessionContextAttributes
where
parseJSON :: Value -> Parser AwsIamAccessKeySessionContextAttributes
parseJSON =
String
-> (Object -> Parser AwsIamAccessKeySessionContextAttributes)
-> Value
-> Parser AwsIamAccessKeySessionContextAttributes
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsIamAccessKeySessionContextAttributes"
( \Object
x ->
Maybe Text -> Maybe Bool -> AwsIamAccessKeySessionContextAttributes
AwsIamAccessKeySessionContextAttributes'
(Maybe Text
-> Maybe Bool -> AwsIamAccessKeySessionContextAttributes)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> AwsIamAccessKeySessionContextAttributes)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationDate")
Parser (Maybe Bool -> AwsIamAccessKeySessionContextAttributes)
-> Parser (Maybe Bool)
-> Parser AwsIamAccessKeySessionContextAttributes
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
AwsIamAccessKeySessionContextAttributes
instance
Prelude.NFData
AwsIamAccessKeySessionContextAttributes
instance
Core.ToJSON
AwsIamAccessKeySessionContextAttributes
where
toJSON :: AwsIamAccessKeySessionContextAttributes -> Value
toJSON AwsIamAccessKeySessionContextAttributes' {Maybe Bool
Maybe Text
mfaAuthenticated :: Maybe Bool
creationDate :: Maybe Text
$sel:mfaAuthenticated:AwsIamAccessKeySessionContextAttributes' :: AwsIamAccessKeySessionContextAttributes -> Maybe Bool
$sel:creationDate:AwsIamAccessKeySessionContextAttributes' :: AwsIamAccessKeySessionContextAttributes -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"CreationDate" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
creationDate,
(Text
"MfaAuthenticated" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
mfaAuthenticated
]
)