{-# 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.CloudWatchLogs.FilterLogEvents
(
FilterLogEvents (..),
newFilterLogEvents,
filterLogEvents_startTime,
filterLogEvents_nextToken,
filterLogEvents_logStreamNames,
filterLogEvents_logStreamNamePrefix,
filterLogEvents_endTime,
filterLogEvents_limit,
filterLogEvents_filterPattern,
filterLogEvents_interleaved,
filterLogEvents_logGroupName,
FilterLogEventsResponse (..),
newFilterLogEventsResponse,
filterLogEventsResponse_searchedLogStreams,
filterLogEventsResponse_nextToken,
filterLogEventsResponse_events,
filterLogEventsResponse_httpStatus,
)
where
import Amazonka.CloudWatchLogs.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 FilterLogEvents = FilterLogEvents'
{
FilterLogEvents -> Maybe Natural
startTime :: Prelude.Maybe Prelude.Natural,
FilterLogEvents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
FilterLogEvents -> Maybe (NonEmpty Text)
logStreamNames :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
FilterLogEvents -> Maybe Text
logStreamNamePrefix :: Prelude.Maybe Prelude.Text,
FilterLogEvents -> Maybe Natural
endTime :: Prelude.Maybe Prelude.Natural,
FilterLogEvents -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
FilterLogEvents -> Maybe Text
filterPattern :: Prelude.Maybe Prelude.Text,
FilterLogEvents -> Maybe Bool
interleaved :: Prelude.Maybe Prelude.Bool,
FilterLogEvents -> Text
logGroupName :: Prelude.Text
}
deriving (FilterLogEvents -> FilterLogEvents -> Bool
(FilterLogEvents -> FilterLogEvents -> Bool)
-> (FilterLogEvents -> FilterLogEvents -> Bool)
-> Eq FilterLogEvents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FilterLogEvents -> FilterLogEvents -> Bool
$c/= :: FilterLogEvents -> FilterLogEvents -> Bool
== :: FilterLogEvents -> FilterLogEvents -> Bool
$c== :: FilterLogEvents -> FilterLogEvents -> Bool
Prelude.Eq, ReadPrec [FilterLogEvents]
ReadPrec FilterLogEvents
Int -> ReadS FilterLogEvents
ReadS [FilterLogEvents]
(Int -> ReadS FilterLogEvents)
-> ReadS [FilterLogEvents]
-> ReadPrec FilterLogEvents
-> ReadPrec [FilterLogEvents]
-> Read FilterLogEvents
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FilterLogEvents]
$creadListPrec :: ReadPrec [FilterLogEvents]
readPrec :: ReadPrec FilterLogEvents
$creadPrec :: ReadPrec FilterLogEvents
readList :: ReadS [FilterLogEvents]
$creadList :: ReadS [FilterLogEvents]
readsPrec :: Int -> ReadS FilterLogEvents
$creadsPrec :: Int -> ReadS FilterLogEvents
Prelude.Read, Int -> FilterLogEvents -> ShowS
[FilterLogEvents] -> ShowS
FilterLogEvents -> String
(Int -> FilterLogEvents -> ShowS)
-> (FilterLogEvents -> String)
-> ([FilterLogEvents] -> ShowS)
-> Show FilterLogEvents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FilterLogEvents] -> ShowS
$cshowList :: [FilterLogEvents] -> ShowS
show :: FilterLogEvents -> String
$cshow :: FilterLogEvents -> String
showsPrec :: Int -> FilterLogEvents -> ShowS
$cshowsPrec :: Int -> FilterLogEvents -> ShowS
Prelude.Show, (forall x. FilterLogEvents -> Rep FilterLogEvents x)
-> (forall x. Rep FilterLogEvents x -> FilterLogEvents)
-> Generic FilterLogEvents
forall x. Rep FilterLogEvents x -> FilterLogEvents
forall x. FilterLogEvents -> Rep FilterLogEvents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FilterLogEvents x -> FilterLogEvents
$cfrom :: forall x. FilterLogEvents -> Rep FilterLogEvents x
Prelude.Generic)
newFilterLogEvents ::
Prelude.Text ->
FilterLogEvents
newFilterLogEvents :: Text -> FilterLogEvents
newFilterLogEvents Text
pLogGroupName_ =
FilterLogEvents' :: Maybe Natural
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Text
-> Maybe Natural
-> Maybe Natural
-> Maybe Text
-> Maybe Bool
-> Text
-> FilterLogEvents
FilterLogEvents'
{ $sel:startTime:FilterLogEvents' :: Maybe Natural
startTime = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:FilterLogEvents' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:logStreamNames:FilterLogEvents' :: Maybe (NonEmpty Text)
logStreamNames = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:logStreamNamePrefix:FilterLogEvents' :: Maybe Text
logStreamNamePrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endTime:FilterLogEvents' :: Maybe Natural
endTime = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:limit:FilterLogEvents' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:filterPattern:FilterLogEvents' :: Maybe Text
filterPattern = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:interleaved:FilterLogEvents' :: Maybe Bool
interleaved = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:logGroupName:FilterLogEvents' :: Text
logGroupName = Text
pLogGroupName_
}
filterLogEvents_startTime :: Lens.Lens' FilterLogEvents (Prelude.Maybe Prelude.Natural)
filterLogEvents_startTime :: (Maybe Natural -> f (Maybe Natural))
-> FilterLogEvents -> f FilterLogEvents
filterLogEvents_startTime = (FilterLogEvents -> Maybe Natural)
-> (FilterLogEvents -> Maybe Natural -> FilterLogEvents)
-> Lens
FilterLogEvents FilterLogEvents (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEvents' {Maybe Natural
startTime :: Maybe Natural
$sel:startTime:FilterLogEvents' :: FilterLogEvents -> Maybe Natural
startTime} -> Maybe Natural
startTime) (\s :: FilterLogEvents
s@FilterLogEvents' {} Maybe Natural
a -> FilterLogEvents
s {$sel:startTime:FilterLogEvents' :: Maybe Natural
startTime = Maybe Natural
a} :: FilterLogEvents)
filterLogEvents_nextToken :: Lens.Lens' FilterLogEvents (Prelude.Maybe Prelude.Text)
filterLogEvents_nextToken :: (Maybe Text -> f (Maybe Text))
-> FilterLogEvents -> f FilterLogEvents
filterLogEvents_nextToken = (FilterLogEvents -> Maybe Text)
-> (FilterLogEvents -> Maybe Text -> FilterLogEvents)
-> Lens FilterLogEvents FilterLogEvents (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEvents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:FilterLogEvents' :: FilterLogEvents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: FilterLogEvents
s@FilterLogEvents' {} Maybe Text
a -> FilterLogEvents
s {$sel:nextToken:FilterLogEvents' :: Maybe Text
nextToken = Maybe Text
a} :: FilterLogEvents)
filterLogEvents_logStreamNames :: Lens.Lens' FilterLogEvents (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
filterLogEvents_logStreamNames :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> FilterLogEvents -> f FilterLogEvents
filterLogEvents_logStreamNames = (FilterLogEvents -> Maybe (NonEmpty Text))
-> (FilterLogEvents -> Maybe (NonEmpty Text) -> FilterLogEvents)
-> Lens
FilterLogEvents
FilterLogEvents
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEvents' {Maybe (NonEmpty Text)
logStreamNames :: Maybe (NonEmpty Text)
$sel:logStreamNames:FilterLogEvents' :: FilterLogEvents -> Maybe (NonEmpty Text)
logStreamNames} -> Maybe (NonEmpty Text)
logStreamNames) (\s :: FilterLogEvents
s@FilterLogEvents' {} Maybe (NonEmpty Text)
a -> FilterLogEvents
s {$sel:logStreamNames:FilterLogEvents' :: Maybe (NonEmpty Text)
logStreamNames = Maybe (NonEmpty Text)
a} :: FilterLogEvents) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> FilterLogEvents -> f FilterLogEvents)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> FilterLogEvents
-> f FilterLogEvents
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
filterLogEvents_logStreamNamePrefix :: Lens.Lens' FilterLogEvents (Prelude.Maybe Prelude.Text)
filterLogEvents_logStreamNamePrefix :: (Maybe Text -> f (Maybe Text))
-> FilterLogEvents -> f FilterLogEvents
filterLogEvents_logStreamNamePrefix = (FilterLogEvents -> Maybe Text)
-> (FilterLogEvents -> Maybe Text -> FilterLogEvents)
-> Lens FilterLogEvents FilterLogEvents (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEvents' {Maybe Text
logStreamNamePrefix :: Maybe Text
$sel:logStreamNamePrefix:FilterLogEvents' :: FilterLogEvents -> Maybe Text
logStreamNamePrefix} -> Maybe Text
logStreamNamePrefix) (\s :: FilterLogEvents
s@FilterLogEvents' {} Maybe Text
a -> FilterLogEvents
s {$sel:logStreamNamePrefix:FilterLogEvents' :: Maybe Text
logStreamNamePrefix = Maybe Text
a} :: FilterLogEvents)
filterLogEvents_endTime :: Lens.Lens' FilterLogEvents (Prelude.Maybe Prelude.Natural)
filterLogEvents_endTime :: (Maybe Natural -> f (Maybe Natural))
-> FilterLogEvents -> f FilterLogEvents
filterLogEvents_endTime = (FilterLogEvents -> Maybe Natural)
-> (FilterLogEvents -> Maybe Natural -> FilterLogEvents)
-> Lens
FilterLogEvents FilterLogEvents (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEvents' {Maybe Natural
endTime :: Maybe Natural
$sel:endTime:FilterLogEvents' :: FilterLogEvents -> Maybe Natural
endTime} -> Maybe Natural
endTime) (\s :: FilterLogEvents
s@FilterLogEvents' {} Maybe Natural
a -> FilterLogEvents
s {$sel:endTime:FilterLogEvents' :: Maybe Natural
endTime = Maybe Natural
a} :: FilterLogEvents)
filterLogEvents_limit :: Lens.Lens' FilterLogEvents (Prelude.Maybe Prelude.Natural)
filterLogEvents_limit :: (Maybe Natural -> f (Maybe Natural))
-> FilterLogEvents -> f FilterLogEvents
filterLogEvents_limit = (FilterLogEvents -> Maybe Natural)
-> (FilterLogEvents -> Maybe Natural -> FilterLogEvents)
-> Lens
FilterLogEvents FilterLogEvents (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEvents' {Maybe Natural
limit :: Maybe Natural
$sel:limit:FilterLogEvents' :: FilterLogEvents -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: FilterLogEvents
s@FilterLogEvents' {} Maybe Natural
a -> FilterLogEvents
s {$sel:limit:FilterLogEvents' :: Maybe Natural
limit = Maybe Natural
a} :: FilterLogEvents)
filterLogEvents_filterPattern :: Lens.Lens' FilterLogEvents (Prelude.Maybe Prelude.Text)
filterLogEvents_filterPattern :: (Maybe Text -> f (Maybe Text))
-> FilterLogEvents -> f FilterLogEvents
filterLogEvents_filterPattern = (FilterLogEvents -> Maybe Text)
-> (FilterLogEvents -> Maybe Text -> FilterLogEvents)
-> Lens FilterLogEvents FilterLogEvents (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEvents' {Maybe Text
filterPattern :: Maybe Text
$sel:filterPattern:FilterLogEvents' :: FilterLogEvents -> Maybe Text
filterPattern} -> Maybe Text
filterPattern) (\s :: FilterLogEvents
s@FilterLogEvents' {} Maybe Text
a -> FilterLogEvents
s {$sel:filterPattern:FilterLogEvents' :: Maybe Text
filterPattern = Maybe Text
a} :: FilterLogEvents)
filterLogEvents_interleaved :: Lens.Lens' FilterLogEvents (Prelude.Maybe Prelude.Bool)
filterLogEvents_interleaved :: (Maybe Bool -> f (Maybe Bool))
-> FilterLogEvents -> f FilterLogEvents
filterLogEvents_interleaved = (FilterLogEvents -> Maybe Bool)
-> (FilterLogEvents -> Maybe Bool -> FilterLogEvents)
-> Lens FilterLogEvents FilterLogEvents (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEvents' {Maybe Bool
interleaved :: Maybe Bool
$sel:interleaved:FilterLogEvents' :: FilterLogEvents -> Maybe Bool
interleaved} -> Maybe Bool
interleaved) (\s :: FilterLogEvents
s@FilterLogEvents' {} Maybe Bool
a -> FilterLogEvents
s {$sel:interleaved:FilterLogEvents' :: Maybe Bool
interleaved = Maybe Bool
a} :: FilterLogEvents)
filterLogEvents_logGroupName :: Lens.Lens' FilterLogEvents Prelude.Text
filterLogEvents_logGroupName :: (Text -> f Text) -> FilterLogEvents -> f FilterLogEvents
filterLogEvents_logGroupName = (FilterLogEvents -> Text)
-> (FilterLogEvents -> Text -> FilterLogEvents)
-> Lens FilterLogEvents FilterLogEvents Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEvents' {Text
logGroupName :: Text
$sel:logGroupName:FilterLogEvents' :: FilterLogEvents -> Text
logGroupName} -> Text
logGroupName) (\s :: FilterLogEvents
s@FilterLogEvents' {} Text
a -> FilterLogEvents
s {$sel:logGroupName:FilterLogEvents' :: Text
logGroupName = Text
a} :: FilterLogEvents)
instance Core.AWSPager FilterLogEvents where
page :: FilterLogEvents
-> AWSResponse FilterLogEvents -> Maybe FilterLogEvents
page FilterLogEvents
rq AWSResponse FilterLogEvents
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse FilterLogEvents
FilterLogEventsResponse
rs
FilterLogEventsResponse
-> Getting (First Text) FilterLogEventsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> FilterLogEventsResponse
-> Const (First Text) FilterLogEventsResponse
Lens' FilterLogEventsResponse (Maybe Text)
filterLogEventsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> FilterLogEventsResponse
-> Const (First Text) FilterLogEventsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) FilterLogEventsResponse 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 FilterLogEvents
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
FilterLogEvents -> Maybe FilterLogEvents
forall a. a -> Maybe a
Prelude.Just (FilterLogEvents -> Maybe FilterLogEvents)
-> FilterLogEvents -> Maybe FilterLogEvents
forall a b. (a -> b) -> a -> b
Prelude.$
FilterLogEvents
rq
FilterLogEvents
-> (FilterLogEvents -> FilterLogEvents) -> FilterLogEvents
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> FilterLogEvents -> Identity FilterLogEvents
Lens FilterLogEvents FilterLogEvents (Maybe Text) (Maybe Text)
filterLogEvents_nextToken
((Maybe Text -> Identity (Maybe Text))
-> FilterLogEvents -> Identity FilterLogEvents)
-> Maybe Text -> FilterLogEvents -> FilterLogEvents
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse FilterLogEvents
FilterLogEventsResponse
rs
FilterLogEventsResponse
-> Getting (First Text) FilterLogEventsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> FilterLogEventsResponse
-> Const (First Text) FilterLogEventsResponse
Lens' FilterLogEventsResponse (Maybe Text)
filterLogEventsResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> FilterLogEventsResponse
-> Const (First Text) FilterLogEventsResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) FilterLogEventsResponse 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 FilterLogEvents where
type
AWSResponse FilterLogEvents =
FilterLogEventsResponse
request :: FilterLogEvents -> Request FilterLogEvents
request = Service -> FilterLogEvents -> Request FilterLogEvents
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy FilterLogEvents
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse FilterLogEvents)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse FilterLogEvents))
-> Logger
-> Service
-> Proxy FilterLogEvents
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse FilterLogEvents)))
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 [SearchedLogStream]
-> Maybe Text
-> Maybe [FilteredLogEvent]
-> Int
-> FilterLogEventsResponse
FilterLogEventsResponse'
(Maybe [SearchedLogStream]
-> Maybe Text
-> Maybe [FilteredLogEvent]
-> Int
-> FilterLogEventsResponse)
-> Either String (Maybe [SearchedLogStream])
-> Either
String
(Maybe Text
-> Maybe [FilteredLogEvent] -> Int -> FilterLogEventsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [SearchedLogStream]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"searchedLogStreams"
Either String (Maybe (Maybe [SearchedLogStream]))
-> Maybe [SearchedLogStream]
-> Either String (Maybe [SearchedLogStream])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SearchedLogStream]
forall a. Monoid a => a
Prelude.mempty
)
Either
String
(Maybe Text
-> Maybe [FilteredLogEvent] -> Int -> FilterLogEventsResponse)
-> Either String (Maybe Text)
-> Either
String (Maybe [FilteredLogEvent] -> Int -> FilterLogEventsResponse)
forall (f :: * -> *) a b. Applicative f => 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 [FilteredLogEvent] -> Int -> FilterLogEventsResponse)
-> Either String (Maybe [FilteredLogEvent])
-> Either String (Int -> FilterLogEventsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [FilteredLogEvent]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"events" Either String (Maybe (Maybe [FilteredLogEvent]))
-> Maybe [FilteredLogEvent]
-> Either String (Maybe [FilteredLogEvent])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [FilteredLogEvent]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> FilterLogEventsResponse)
-> Either String Int -> Either String FilterLogEventsResponse
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 FilterLogEvents
instance Prelude.NFData FilterLogEvents
instance Core.ToHeaders FilterLogEvents where
toHeaders :: FilterLogEvents -> ResponseHeaders
toHeaders =
ResponseHeaders -> FilterLogEvents -> 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
"Logs_20140328.FilterLogEvents" ::
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 FilterLogEvents where
toJSON :: FilterLogEvents -> Value
toJSON FilterLogEvents' {Maybe Bool
Maybe Natural
Maybe (NonEmpty Text)
Maybe Text
Text
logGroupName :: Text
interleaved :: Maybe Bool
filterPattern :: Maybe Text
limit :: Maybe Natural
endTime :: Maybe Natural
logStreamNamePrefix :: Maybe Text
logStreamNames :: Maybe (NonEmpty Text)
nextToken :: Maybe Text
startTime :: Maybe Natural
$sel:logGroupName:FilterLogEvents' :: FilterLogEvents -> Text
$sel:interleaved:FilterLogEvents' :: FilterLogEvents -> Maybe Bool
$sel:filterPattern:FilterLogEvents' :: FilterLogEvents -> Maybe Text
$sel:limit:FilterLogEvents' :: FilterLogEvents -> Maybe Natural
$sel:endTime:FilterLogEvents' :: FilterLogEvents -> Maybe Natural
$sel:logStreamNamePrefix:FilterLogEvents' :: FilterLogEvents -> Maybe Text
$sel:logStreamNames:FilterLogEvents' :: FilterLogEvents -> Maybe (NonEmpty Text)
$sel:nextToken:FilterLogEvents' :: FilterLogEvents -> Maybe Text
$sel:startTime:FilterLogEvents' :: FilterLogEvents -> Maybe Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"startTime" 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
startTime,
(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
"logStreamNames" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
logStreamNames,
(Text
"logStreamNamePrefix" 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
logStreamNamePrefix,
(Text
"endTime" 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
endTime,
(Text
"limit" 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
limit,
(Text
"filterPattern" 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
filterPattern,
(Text
"interleaved" 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
interleaved,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"logGroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
logGroupName)
]
)
instance Core.ToPath FilterLogEvents where
toPath :: FilterLogEvents -> ByteString
toPath = ByteString -> FilterLogEvents -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery FilterLogEvents where
toQuery :: FilterLogEvents -> QueryString
toQuery = QueryString -> FilterLogEvents -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data FilterLogEventsResponse = FilterLogEventsResponse'
{
FilterLogEventsResponse -> Maybe [SearchedLogStream]
searchedLogStreams :: Prelude.Maybe [SearchedLogStream],
FilterLogEventsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
FilterLogEventsResponse -> Maybe [FilteredLogEvent]
events :: Prelude.Maybe [FilteredLogEvent],
FilterLogEventsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (FilterLogEventsResponse -> FilterLogEventsResponse -> Bool
(FilterLogEventsResponse -> FilterLogEventsResponse -> Bool)
-> (FilterLogEventsResponse -> FilterLogEventsResponse -> Bool)
-> Eq FilterLogEventsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FilterLogEventsResponse -> FilterLogEventsResponse -> Bool
$c/= :: FilterLogEventsResponse -> FilterLogEventsResponse -> Bool
== :: FilterLogEventsResponse -> FilterLogEventsResponse -> Bool
$c== :: FilterLogEventsResponse -> FilterLogEventsResponse -> Bool
Prelude.Eq, ReadPrec [FilterLogEventsResponse]
ReadPrec FilterLogEventsResponse
Int -> ReadS FilterLogEventsResponse
ReadS [FilterLogEventsResponse]
(Int -> ReadS FilterLogEventsResponse)
-> ReadS [FilterLogEventsResponse]
-> ReadPrec FilterLogEventsResponse
-> ReadPrec [FilterLogEventsResponse]
-> Read FilterLogEventsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FilterLogEventsResponse]
$creadListPrec :: ReadPrec [FilterLogEventsResponse]
readPrec :: ReadPrec FilterLogEventsResponse
$creadPrec :: ReadPrec FilterLogEventsResponse
readList :: ReadS [FilterLogEventsResponse]
$creadList :: ReadS [FilterLogEventsResponse]
readsPrec :: Int -> ReadS FilterLogEventsResponse
$creadsPrec :: Int -> ReadS FilterLogEventsResponse
Prelude.Read, Int -> FilterLogEventsResponse -> ShowS
[FilterLogEventsResponse] -> ShowS
FilterLogEventsResponse -> String
(Int -> FilterLogEventsResponse -> ShowS)
-> (FilterLogEventsResponse -> String)
-> ([FilterLogEventsResponse] -> ShowS)
-> Show FilterLogEventsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FilterLogEventsResponse] -> ShowS
$cshowList :: [FilterLogEventsResponse] -> ShowS
show :: FilterLogEventsResponse -> String
$cshow :: FilterLogEventsResponse -> String
showsPrec :: Int -> FilterLogEventsResponse -> ShowS
$cshowsPrec :: Int -> FilterLogEventsResponse -> ShowS
Prelude.Show, (forall x.
FilterLogEventsResponse -> Rep FilterLogEventsResponse x)
-> (forall x.
Rep FilterLogEventsResponse x -> FilterLogEventsResponse)
-> Generic FilterLogEventsResponse
forall x. Rep FilterLogEventsResponse x -> FilterLogEventsResponse
forall x. FilterLogEventsResponse -> Rep FilterLogEventsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep FilterLogEventsResponse x -> FilterLogEventsResponse
$cfrom :: forall x. FilterLogEventsResponse -> Rep FilterLogEventsResponse x
Prelude.Generic)
newFilterLogEventsResponse ::
Prelude.Int ->
FilterLogEventsResponse
newFilterLogEventsResponse :: Int -> FilterLogEventsResponse
newFilterLogEventsResponse Int
pHttpStatus_ =
FilterLogEventsResponse' :: Maybe [SearchedLogStream]
-> Maybe Text
-> Maybe [FilteredLogEvent]
-> Int
-> FilterLogEventsResponse
FilterLogEventsResponse'
{ $sel:searchedLogStreams:FilterLogEventsResponse' :: Maybe [SearchedLogStream]
searchedLogStreams =
Maybe [SearchedLogStream]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:FilterLogEventsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:events:FilterLogEventsResponse' :: Maybe [FilteredLogEvent]
events = Maybe [FilteredLogEvent]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:FilterLogEventsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
filterLogEventsResponse_searchedLogStreams :: Lens.Lens' FilterLogEventsResponse (Prelude.Maybe [SearchedLogStream])
filterLogEventsResponse_searchedLogStreams :: (Maybe [SearchedLogStream] -> f (Maybe [SearchedLogStream]))
-> FilterLogEventsResponse -> f FilterLogEventsResponse
filterLogEventsResponse_searchedLogStreams = (FilterLogEventsResponse -> Maybe [SearchedLogStream])
-> (FilterLogEventsResponse
-> Maybe [SearchedLogStream] -> FilterLogEventsResponse)
-> Lens
FilterLogEventsResponse
FilterLogEventsResponse
(Maybe [SearchedLogStream])
(Maybe [SearchedLogStream])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEventsResponse' {Maybe [SearchedLogStream]
searchedLogStreams :: Maybe [SearchedLogStream]
$sel:searchedLogStreams:FilterLogEventsResponse' :: FilterLogEventsResponse -> Maybe [SearchedLogStream]
searchedLogStreams} -> Maybe [SearchedLogStream]
searchedLogStreams) (\s :: FilterLogEventsResponse
s@FilterLogEventsResponse' {} Maybe [SearchedLogStream]
a -> FilterLogEventsResponse
s {$sel:searchedLogStreams:FilterLogEventsResponse' :: Maybe [SearchedLogStream]
searchedLogStreams = Maybe [SearchedLogStream]
a} :: FilterLogEventsResponse) ((Maybe [SearchedLogStream] -> f (Maybe [SearchedLogStream]))
-> FilterLogEventsResponse -> f FilterLogEventsResponse)
-> ((Maybe [SearchedLogStream] -> f (Maybe [SearchedLogStream]))
-> Maybe [SearchedLogStream] -> f (Maybe [SearchedLogStream]))
-> (Maybe [SearchedLogStream] -> f (Maybe [SearchedLogStream]))
-> FilterLogEventsResponse
-> f FilterLogEventsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[SearchedLogStream]
[SearchedLogStream]
[SearchedLogStream]
[SearchedLogStream]
-> Iso
(Maybe [SearchedLogStream])
(Maybe [SearchedLogStream])
(Maybe [SearchedLogStream])
(Maybe [SearchedLogStream])
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
[SearchedLogStream]
[SearchedLogStream]
[SearchedLogStream]
[SearchedLogStream]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
filterLogEventsResponse_nextToken :: Lens.Lens' FilterLogEventsResponse (Prelude.Maybe Prelude.Text)
filterLogEventsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> FilterLogEventsResponse -> f FilterLogEventsResponse
filterLogEventsResponse_nextToken = (FilterLogEventsResponse -> Maybe Text)
-> (FilterLogEventsResponse
-> Maybe Text -> FilterLogEventsResponse)
-> Lens' FilterLogEventsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEventsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:FilterLogEventsResponse' :: FilterLogEventsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: FilterLogEventsResponse
s@FilterLogEventsResponse' {} Maybe Text
a -> FilterLogEventsResponse
s {$sel:nextToken:FilterLogEventsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: FilterLogEventsResponse)
filterLogEventsResponse_events :: Lens.Lens' FilterLogEventsResponse (Prelude.Maybe [FilteredLogEvent])
filterLogEventsResponse_events :: (Maybe [FilteredLogEvent] -> f (Maybe [FilteredLogEvent]))
-> FilterLogEventsResponse -> f FilterLogEventsResponse
filterLogEventsResponse_events = (FilterLogEventsResponse -> Maybe [FilteredLogEvent])
-> (FilterLogEventsResponse
-> Maybe [FilteredLogEvent] -> FilterLogEventsResponse)
-> Lens
FilterLogEventsResponse
FilterLogEventsResponse
(Maybe [FilteredLogEvent])
(Maybe [FilteredLogEvent])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEventsResponse' {Maybe [FilteredLogEvent]
events :: Maybe [FilteredLogEvent]
$sel:events:FilterLogEventsResponse' :: FilterLogEventsResponse -> Maybe [FilteredLogEvent]
events} -> Maybe [FilteredLogEvent]
events) (\s :: FilterLogEventsResponse
s@FilterLogEventsResponse' {} Maybe [FilteredLogEvent]
a -> FilterLogEventsResponse
s {$sel:events:FilterLogEventsResponse' :: Maybe [FilteredLogEvent]
events = Maybe [FilteredLogEvent]
a} :: FilterLogEventsResponse) ((Maybe [FilteredLogEvent] -> f (Maybe [FilteredLogEvent]))
-> FilterLogEventsResponse -> f FilterLogEventsResponse)
-> ((Maybe [FilteredLogEvent] -> f (Maybe [FilteredLogEvent]))
-> Maybe [FilteredLogEvent] -> f (Maybe [FilteredLogEvent]))
-> (Maybe [FilteredLogEvent] -> f (Maybe [FilteredLogEvent]))
-> FilterLogEventsResponse
-> f FilterLogEventsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[FilteredLogEvent]
[FilteredLogEvent]
[FilteredLogEvent]
[FilteredLogEvent]
-> Iso
(Maybe [FilteredLogEvent])
(Maybe [FilteredLogEvent])
(Maybe [FilteredLogEvent])
(Maybe [FilteredLogEvent])
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
[FilteredLogEvent]
[FilteredLogEvent]
[FilteredLogEvent]
[FilteredLogEvent]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
filterLogEventsResponse_httpStatus :: Lens.Lens' FilterLogEventsResponse Prelude.Int
filterLogEventsResponse_httpStatus :: (Int -> f Int)
-> FilterLogEventsResponse -> f FilterLogEventsResponse
filterLogEventsResponse_httpStatus = (FilterLogEventsResponse -> Int)
-> (FilterLogEventsResponse -> Int -> FilterLogEventsResponse)
-> Lens FilterLogEventsResponse FilterLogEventsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FilterLogEventsResponse' {Int
httpStatus :: Int
$sel:httpStatus:FilterLogEventsResponse' :: FilterLogEventsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: FilterLogEventsResponse
s@FilterLogEventsResponse' {} Int
a -> FilterLogEventsResponse
s {$sel:httpStatus:FilterLogEventsResponse' :: Int
httpStatus = Int
a} :: FilterLogEventsResponse)
instance Prelude.NFData FilterLogEventsResponse