{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudTrail.LookupEvents
(
LookupEvents (..),
newLookupEvents,
lookupEvents_eventCategory,
lookupEvents_startTime,
lookupEvents_lookupAttributes,
lookupEvents_nextToken,
lookupEvents_endTime,
lookupEvents_maxResults,
LookupEventsResponse (..),
newLookupEventsResponse,
lookupEventsResponse_nextToken,
lookupEventsResponse_events,
lookupEventsResponse_httpStatus,
)
where
import Amazonka.CloudTrail.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data LookupEvents = LookupEvents'
{
LookupEvents -> Maybe EventCategory
eventCategory :: Prelude.Maybe EventCategory,
LookupEvents -> Maybe POSIX
startTime :: Prelude.Maybe Core.POSIX,
LookupEvents -> Maybe [LookupAttribute]
lookupAttributes :: Prelude.Maybe [LookupAttribute],
LookupEvents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
LookupEvents -> Maybe POSIX
endTime :: Prelude.Maybe Core.POSIX,
LookupEvents -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (LookupEvents -> LookupEvents -> Bool
(LookupEvents -> LookupEvents -> Bool)
-> (LookupEvents -> LookupEvents -> Bool) -> Eq LookupEvents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LookupEvents -> LookupEvents -> Bool
$c/= :: LookupEvents -> LookupEvents -> Bool
== :: LookupEvents -> LookupEvents -> Bool
$c== :: LookupEvents -> LookupEvents -> Bool
Prelude.Eq, ReadPrec [LookupEvents]
ReadPrec LookupEvents
Int -> ReadS LookupEvents
ReadS [LookupEvents]
(Int -> ReadS LookupEvents)
-> ReadS [LookupEvents]
-> ReadPrec LookupEvents
-> ReadPrec [LookupEvents]
-> Read LookupEvents
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LookupEvents]
$creadListPrec :: ReadPrec [LookupEvents]
readPrec :: ReadPrec LookupEvents
$creadPrec :: ReadPrec LookupEvents
readList :: ReadS [LookupEvents]
$creadList :: ReadS [LookupEvents]
readsPrec :: Int -> ReadS LookupEvents
$creadsPrec :: Int -> ReadS LookupEvents
Prelude.Read, Int -> LookupEvents -> ShowS
[LookupEvents] -> ShowS
LookupEvents -> String
(Int -> LookupEvents -> ShowS)
-> (LookupEvents -> String)
-> ([LookupEvents] -> ShowS)
-> Show LookupEvents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LookupEvents] -> ShowS
$cshowList :: [LookupEvents] -> ShowS
show :: LookupEvents -> String
$cshow :: LookupEvents -> String
showsPrec :: Int -> LookupEvents -> ShowS
$cshowsPrec :: Int -> LookupEvents -> ShowS
Prelude.Show, (forall x. LookupEvents -> Rep LookupEvents x)
-> (forall x. Rep LookupEvents x -> LookupEvents)
-> Generic LookupEvents
forall x. Rep LookupEvents x -> LookupEvents
forall x. LookupEvents -> Rep LookupEvents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LookupEvents x -> LookupEvents
$cfrom :: forall x. LookupEvents -> Rep LookupEvents x
Prelude.Generic)
newLookupEvents ::
LookupEvents
newLookupEvents :: LookupEvents
newLookupEvents =
LookupEvents' :: Maybe EventCategory
-> Maybe POSIX
-> Maybe [LookupAttribute]
-> Maybe Text
-> Maybe POSIX
-> Maybe Natural
-> LookupEvents
LookupEvents'
{ $sel:eventCategory:LookupEvents' :: Maybe EventCategory
eventCategory = Maybe EventCategory
forall a. Maybe a
Prelude.Nothing,
$sel:startTime:LookupEvents' :: Maybe POSIX
startTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lookupAttributes:LookupEvents' :: Maybe [LookupAttribute]
lookupAttributes = Maybe [LookupAttribute]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:LookupEvents' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:LookupEvents' :: Maybe POSIX
endTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:LookupEvents' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
lookupEvents_eventCategory :: Lens.Lens' LookupEvents (Prelude.Maybe EventCategory)
lookupEvents_eventCategory :: (Maybe EventCategory -> f (Maybe EventCategory))
-> LookupEvents -> f LookupEvents
lookupEvents_eventCategory = (LookupEvents -> Maybe EventCategory)
-> (LookupEvents -> Maybe EventCategory -> LookupEvents)
-> Lens
LookupEvents
LookupEvents
(Maybe EventCategory)
(Maybe EventCategory)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupEvents' {Maybe EventCategory
eventCategory :: Maybe EventCategory
$sel:eventCategory:LookupEvents' :: LookupEvents -> Maybe EventCategory
eventCategory} -> Maybe EventCategory
eventCategory) (\s :: LookupEvents
s@LookupEvents' {} Maybe EventCategory
a -> LookupEvents
s {$sel:eventCategory:LookupEvents' :: Maybe EventCategory
eventCategory = Maybe EventCategory
a} :: LookupEvents)
lookupEvents_startTime :: Lens.Lens' LookupEvents (Prelude.Maybe Prelude.UTCTime)
lookupEvents_startTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LookupEvents -> f LookupEvents
lookupEvents_startTime = (LookupEvents -> Maybe POSIX)
-> (LookupEvents -> Maybe POSIX -> LookupEvents)
-> Lens LookupEvents LookupEvents (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupEvents' {Maybe POSIX
startTime :: Maybe POSIX
$sel:startTime:LookupEvents' :: LookupEvents -> Maybe POSIX
startTime} -> Maybe POSIX
startTime) (\s :: LookupEvents
s@LookupEvents' {} Maybe POSIX
a -> LookupEvents
s {$sel:startTime:LookupEvents' :: Maybe POSIX
startTime = Maybe POSIX
a} :: LookupEvents) ((Maybe POSIX -> f (Maybe POSIX))
-> LookupEvents -> f LookupEvents)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LookupEvents
-> f LookupEvents
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
lookupEvents_lookupAttributes :: Lens.Lens' LookupEvents (Prelude.Maybe [LookupAttribute])
lookupEvents_lookupAttributes :: (Maybe [LookupAttribute] -> f (Maybe [LookupAttribute]))
-> LookupEvents -> f LookupEvents
lookupEvents_lookupAttributes = (LookupEvents -> Maybe [LookupAttribute])
-> (LookupEvents -> Maybe [LookupAttribute] -> LookupEvents)
-> Lens
LookupEvents
LookupEvents
(Maybe [LookupAttribute])
(Maybe [LookupAttribute])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupEvents' {Maybe [LookupAttribute]
lookupAttributes :: Maybe [LookupAttribute]
$sel:lookupAttributes:LookupEvents' :: LookupEvents -> Maybe [LookupAttribute]
lookupAttributes} -> Maybe [LookupAttribute]
lookupAttributes) (\s :: LookupEvents
s@LookupEvents' {} Maybe [LookupAttribute]
a -> LookupEvents
s {$sel:lookupAttributes:LookupEvents' :: Maybe [LookupAttribute]
lookupAttributes = Maybe [LookupAttribute]
a} :: LookupEvents) ((Maybe [LookupAttribute] -> f (Maybe [LookupAttribute]))
-> LookupEvents -> f LookupEvents)
-> ((Maybe [LookupAttribute] -> f (Maybe [LookupAttribute]))
-> Maybe [LookupAttribute] -> f (Maybe [LookupAttribute]))
-> (Maybe [LookupAttribute] -> f (Maybe [LookupAttribute]))
-> LookupEvents
-> f LookupEvents
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[LookupAttribute]
[LookupAttribute]
[LookupAttribute]
[LookupAttribute]
-> Iso
(Maybe [LookupAttribute])
(Maybe [LookupAttribute])
(Maybe [LookupAttribute])
(Maybe [LookupAttribute])
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
[LookupAttribute]
[LookupAttribute]
[LookupAttribute]
[LookupAttribute]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
lookupEvents_nextToken :: Lens.Lens' LookupEvents (Prelude.Maybe Prelude.Text)
lookupEvents_nextToken :: (Maybe Text -> f (Maybe Text)) -> LookupEvents -> f LookupEvents
lookupEvents_nextToken = (LookupEvents -> Maybe Text)
-> (LookupEvents -> Maybe Text -> LookupEvents)
-> Lens LookupEvents LookupEvents (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupEvents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:LookupEvents' :: LookupEvents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: LookupEvents
s@LookupEvents' {} Maybe Text
a -> LookupEvents
s {$sel:nextToken:LookupEvents' :: Maybe Text
nextToken = Maybe Text
a} :: LookupEvents)
lookupEvents_endTime :: Lens.Lens' LookupEvents (Prelude.Maybe Prelude.UTCTime)
lookupEvents_endTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> LookupEvents -> f LookupEvents
lookupEvents_endTime = (LookupEvents -> Maybe POSIX)
-> (LookupEvents -> Maybe POSIX -> LookupEvents)
-> Lens LookupEvents LookupEvents (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupEvents' {Maybe POSIX
endTime :: Maybe POSIX
$sel:endTime:LookupEvents' :: LookupEvents -> Maybe POSIX
endTime} -> Maybe POSIX
endTime) (\s :: LookupEvents
s@LookupEvents' {} Maybe POSIX
a -> LookupEvents
s {$sel:endTime:LookupEvents' :: Maybe POSIX
endTime = Maybe POSIX
a} :: LookupEvents) ((Maybe POSIX -> f (Maybe POSIX))
-> LookupEvents -> f LookupEvents)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> LookupEvents
-> f LookupEvents
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
lookupEvents_maxResults :: Lens.Lens' LookupEvents (Prelude.Maybe Prelude.Natural)
lookupEvents_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> LookupEvents -> f LookupEvents
lookupEvents_maxResults = (LookupEvents -> Maybe Natural)
-> (LookupEvents -> Maybe Natural -> LookupEvents)
-> Lens LookupEvents LookupEvents (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupEvents' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:LookupEvents' :: LookupEvents -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: LookupEvents
s@LookupEvents' {} Maybe Natural
a -> LookupEvents
s {$sel:maxResults:LookupEvents' :: Maybe Natural
maxResults = Maybe Natural
a} :: LookupEvents)
instance Core.AWSPager LookupEvents where
page :: LookupEvents -> AWSResponse LookupEvents -> Maybe LookupEvents
page LookupEvents
rq AWSResponse LookupEvents
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse LookupEvents
LookupEventsResponse
rs
LookupEventsResponse
-> Getting (First Text) LookupEventsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> LookupEventsResponse -> Const (First Text) LookupEventsResponse
Lens' LookupEventsResponse (Maybe Text)
lookupEventsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> LookupEventsResponse -> Const (First Text) LookupEventsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) LookupEventsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe LookupEvents
forall a. Maybe a
Prelude.Nothing
| Maybe [Event] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse LookupEvents
LookupEventsResponse
rs
LookupEventsResponse
-> Getting (First [Event]) LookupEventsResponse [Event]
-> Maybe [Event]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Event] -> Const (First [Event]) (Maybe [Event]))
-> LookupEventsResponse
-> Const (First [Event]) LookupEventsResponse
Lens' LookupEventsResponse (Maybe [Event])
lookupEventsResponse_events ((Maybe [Event] -> Const (First [Event]) (Maybe [Event]))
-> LookupEventsResponse
-> Const (First [Event]) LookupEventsResponse)
-> (([Event] -> Const (First [Event]) [Event])
-> Maybe [Event] -> Const (First [Event]) (Maybe [Event]))
-> Getting (First [Event]) LookupEventsResponse [Event]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Event] -> Const (First [Event]) [Event])
-> Maybe [Event] -> Const (First [Event]) (Maybe [Event])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe LookupEvents
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
LookupEvents -> Maybe LookupEvents
forall a. a -> Maybe a
Prelude.Just (LookupEvents -> Maybe LookupEvents)
-> LookupEvents -> Maybe LookupEvents
forall a b. (a -> b) -> a -> b
Prelude.$
LookupEvents
rq
LookupEvents -> (LookupEvents -> LookupEvents) -> LookupEvents
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> LookupEvents -> Identity LookupEvents
Lens LookupEvents LookupEvents (Maybe Text) (Maybe Text)
lookupEvents_nextToken
((Maybe Text -> Identity (Maybe Text))
-> LookupEvents -> Identity LookupEvents)
-> Maybe Text -> LookupEvents -> LookupEvents
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse LookupEvents
LookupEventsResponse
rs
LookupEventsResponse
-> Getting (First Text) LookupEventsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> LookupEventsResponse -> Const (First Text) LookupEventsResponse
Lens' LookupEventsResponse (Maybe Text)
lookupEventsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
-> LookupEventsResponse -> Const (First Text) LookupEventsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) LookupEventsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest LookupEvents where
type AWSResponse LookupEvents = LookupEventsResponse
request :: LookupEvents -> Request LookupEvents
request = Service -> LookupEvents -> Request LookupEvents
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy LookupEvents
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse LookupEvents)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse LookupEvents))
-> Logger
-> Service
-> Proxy LookupEvents
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse LookupEvents)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text -> Maybe [Event] -> Int -> LookupEventsResponse
LookupEventsResponse'
(Maybe Text -> Maybe [Event] -> Int -> LookupEventsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Event] -> Int -> LookupEventsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
Either String (Maybe [Event] -> Int -> LookupEventsResponse)
-> Either String (Maybe [Event])
-> Either String (Int -> LookupEventsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Event]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Events" Either String (Maybe (Maybe [Event]))
-> Maybe [Event] -> Either String (Maybe [Event])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Event]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> LookupEventsResponse)
-> Either String Int -> Either String LookupEventsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable LookupEvents
instance Prelude.NFData LookupEvents
instance Core.ToHeaders LookupEvents where
toHeaders :: LookupEvents -> ResponseHeaders
toHeaders =
ResponseHeaders -> LookupEvents -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101.LookupEvents" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON LookupEvents where
toJSON :: LookupEvents -> Value
toJSON LookupEvents' {Maybe Natural
Maybe [LookupAttribute]
Maybe Text
Maybe POSIX
Maybe EventCategory
maxResults :: Maybe Natural
endTime :: Maybe POSIX
nextToken :: Maybe Text
lookupAttributes :: Maybe [LookupAttribute]
startTime :: Maybe POSIX
eventCategory :: Maybe EventCategory
$sel:maxResults:LookupEvents' :: LookupEvents -> Maybe Natural
$sel:endTime:LookupEvents' :: LookupEvents -> Maybe POSIX
$sel:nextToken:LookupEvents' :: LookupEvents -> Maybe Text
$sel:lookupAttributes:LookupEvents' :: LookupEvents -> Maybe [LookupAttribute]
$sel:startTime:LookupEvents' :: LookupEvents -> Maybe POSIX
$sel:eventCategory:LookupEvents' :: LookupEvents -> Maybe EventCategory
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EventCategory" Text -> EventCategory -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (EventCategory -> Pair) -> Maybe EventCategory -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EventCategory
eventCategory,
(Text
"StartTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
startTime,
(Text
"LookupAttributes" Text -> [LookupAttribute] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([LookupAttribute] -> Pair)
-> Maybe [LookupAttribute] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [LookupAttribute]
lookupAttributes,
(Text
"NextToken" 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
nextToken,
(Text
"EndTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
endTime,
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
]
)
instance Core.ToPath LookupEvents where
toPath :: LookupEvents -> ByteString
toPath = ByteString -> LookupEvents -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery LookupEvents where
toQuery :: LookupEvents -> QueryString
toQuery = QueryString -> LookupEvents -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data LookupEventsResponse = LookupEventsResponse'
{
LookupEventsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
LookupEventsResponse -> Maybe [Event]
events :: Prelude.Maybe [Event],
LookupEventsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (LookupEventsResponse -> LookupEventsResponse -> Bool
(LookupEventsResponse -> LookupEventsResponse -> Bool)
-> (LookupEventsResponse -> LookupEventsResponse -> Bool)
-> Eq LookupEventsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LookupEventsResponse -> LookupEventsResponse -> Bool
$c/= :: LookupEventsResponse -> LookupEventsResponse -> Bool
== :: LookupEventsResponse -> LookupEventsResponse -> Bool
$c== :: LookupEventsResponse -> LookupEventsResponse -> Bool
Prelude.Eq, ReadPrec [LookupEventsResponse]
ReadPrec LookupEventsResponse
Int -> ReadS LookupEventsResponse
ReadS [LookupEventsResponse]
(Int -> ReadS LookupEventsResponse)
-> ReadS [LookupEventsResponse]
-> ReadPrec LookupEventsResponse
-> ReadPrec [LookupEventsResponse]
-> Read LookupEventsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LookupEventsResponse]
$creadListPrec :: ReadPrec [LookupEventsResponse]
readPrec :: ReadPrec LookupEventsResponse
$creadPrec :: ReadPrec LookupEventsResponse
readList :: ReadS [LookupEventsResponse]
$creadList :: ReadS [LookupEventsResponse]
readsPrec :: Int -> ReadS LookupEventsResponse
$creadsPrec :: Int -> ReadS LookupEventsResponse
Prelude.Read, Int -> LookupEventsResponse -> ShowS
[LookupEventsResponse] -> ShowS
LookupEventsResponse -> String
(Int -> LookupEventsResponse -> ShowS)
-> (LookupEventsResponse -> String)
-> ([LookupEventsResponse] -> ShowS)
-> Show LookupEventsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LookupEventsResponse] -> ShowS
$cshowList :: [LookupEventsResponse] -> ShowS
show :: LookupEventsResponse -> String
$cshow :: LookupEventsResponse -> String
showsPrec :: Int -> LookupEventsResponse -> ShowS
$cshowsPrec :: Int -> LookupEventsResponse -> ShowS
Prelude.Show, (forall x. LookupEventsResponse -> Rep LookupEventsResponse x)
-> (forall x. Rep LookupEventsResponse x -> LookupEventsResponse)
-> Generic LookupEventsResponse
forall x. Rep LookupEventsResponse x -> LookupEventsResponse
forall x. LookupEventsResponse -> Rep LookupEventsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LookupEventsResponse x -> LookupEventsResponse
$cfrom :: forall x. LookupEventsResponse -> Rep LookupEventsResponse x
Prelude.Generic)
newLookupEventsResponse ::
Prelude.Int ->
LookupEventsResponse
newLookupEventsResponse :: Int -> LookupEventsResponse
newLookupEventsResponse Int
pHttpStatus_ =
LookupEventsResponse' :: Maybe Text -> Maybe [Event] -> Int -> LookupEventsResponse
LookupEventsResponse'
{ $sel:nextToken:LookupEventsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:events:LookupEventsResponse' :: Maybe [Event]
events = Maybe [Event]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:LookupEventsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
lookupEventsResponse_nextToken :: Lens.Lens' LookupEventsResponse (Prelude.Maybe Prelude.Text)
lookupEventsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> LookupEventsResponse -> f LookupEventsResponse
lookupEventsResponse_nextToken = (LookupEventsResponse -> Maybe Text)
-> (LookupEventsResponse -> Maybe Text -> LookupEventsResponse)
-> Lens' LookupEventsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupEventsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:LookupEventsResponse' :: LookupEventsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: LookupEventsResponse
s@LookupEventsResponse' {} Maybe Text
a -> LookupEventsResponse
s {$sel:nextToken:LookupEventsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: LookupEventsResponse)
lookupEventsResponse_events :: Lens.Lens' LookupEventsResponse (Prelude.Maybe [Event])
lookupEventsResponse_events :: (Maybe [Event] -> f (Maybe [Event]))
-> LookupEventsResponse -> f LookupEventsResponse
lookupEventsResponse_events = (LookupEventsResponse -> Maybe [Event])
-> (LookupEventsResponse -> Maybe [Event] -> LookupEventsResponse)
-> Lens' LookupEventsResponse (Maybe [Event])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupEventsResponse' {Maybe [Event]
events :: Maybe [Event]
$sel:events:LookupEventsResponse' :: LookupEventsResponse -> Maybe [Event]
events} -> Maybe [Event]
events) (\s :: LookupEventsResponse
s@LookupEventsResponse' {} Maybe [Event]
a -> LookupEventsResponse
s {$sel:events:LookupEventsResponse' :: Maybe [Event]
events = Maybe [Event]
a} :: LookupEventsResponse) ((Maybe [Event] -> f (Maybe [Event]))
-> LookupEventsResponse -> f LookupEventsResponse)
-> ((Maybe [Event] -> f (Maybe [Event]))
-> Maybe [Event] -> f (Maybe [Event]))
-> (Maybe [Event] -> f (Maybe [Event]))
-> LookupEventsResponse
-> f LookupEventsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Event] [Event] [Event] [Event]
-> Iso
(Maybe [Event]) (Maybe [Event]) (Maybe [Event]) (Maybe [Event])
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 [Event] [Event] [Event] [Event]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
lookupEventsResponse_httpStatus :: Lens.Lens' LookupEventsResponse Prelude.Int
lookupEventsResponse_httpStatus :: (Int -> f Int) -> LookupEventsResponse -> f LookupEventsResponse
lookupEventsResponse_httpStatus = (LookupEventsResponse -> Int)
-> (LookupEventsResponse -> Int -> LookupEventsResponse)
-> Lens LookupEventsResponse LookupEventsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LookupEventsResponse' {Int
httpStatus :: Int
$sel:httpStatus:LookupEventsResponse' :: LookupEventsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: LookupEventsResponse
s@LookupEventsResponse' {} Int
a -> LookupEventsResponse
s {$sel:httpStatus:LookupEventsResponse' :: Int
httpStatus = Int
a} :: LookupEventsResponse)
instance Prelude.NFData LookupEventsResponse