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