{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CloudWatchLogs.FilterLogEvents
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists log events from the specified log group. You can list all the log
-- events or filter the results using a filter pattern, a time range, and
-- the name of the log stream.
--
-- By default, this operation returns as many log events as can fit in 1 MB
-- (up to 10,000 log events) or all the events found within the time range
-- that you specify. If the results include a token, then there are more
-- log events available, and you can get additional results by specifying
-- the token in a subsequent call. This operation can return empty results
-- while there are more log events available through the token.
--
-- The returned log events are sorted by event timestamp, the timestamp
-- when the event was ingested by CloudWatch Logs, and the ID of the
-- @PutLogEvents@ request.
--
-- This operation returns paginated results.
module Amazonka.CloudWatchLogs.FilterLogEvents
  ( -- * Creating a Request
    FilterLogEvents (..),
    newFilterLogEvents,

    -- * Request Lenses
    filterLogEvents_startTime,
    filterLogEvents_nextToken,
    filterLogEvents_logStreamNames,
    filterLogEvents_logStreamNamePrefix,
    filterLogEvents_endTime,
    filterLogEvents_limit,
    filterLogEvents_filterPattern,
    filterLogEvents_interleaved,
    filterLogEvents_logGroupName,

    -- * Destructuring the Response
    FilterLogEventsResponse (..),
    newFilterLogEventsResponse,

    -- * Response Lenses
    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

-- | /See:/ 'newFilterLogEvents' smart constructor.
data FilterLogEvents = FilterLogEvents'
  { -- | The start of the time range, expressed as the number of milliseconds
    -- after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time
    -- are not returned.
    FilterLogEvents -> Maybe Natural
startTime :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next set of events to return. (You received this token
    -- from a previous call.)
    FilterLogEvents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters the results to only logs from the log streams in this list.
    --
    -- If you specify a value for both @logStreamNamePrefix@ and
    -- @logStreamNames@, the action returns an @InvalidParameterException@
    -- error.
    FilterLogEvents -> Maybe (NonEmpty Text)
logStreamNames :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | Filters the results to include only events from log streams that have
    -- names starting with this prefix.
    --
    -- If you specify a value for both @logStreamNamePrefix@ and
    -- @logStreamNames@, but the value for @logStreamNamePrefix@ does not match
    -- any log stream names specified in @logStreamNames@, the action returns
    -- an @InvalidParameterException@ error.
    FilterLogEvents -> Maybe Text
logStreamNamePrefix :: Prelude.Maybe Prelude.Text,
    -- | The end of the time range, expressed as the number of milliseconds after
    -- Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time
    -- are not returned.
    FilterLogEvents -> Maybe Natural
endTime :: Prelude.Maybe Prelude.Natural,
    -- | The maximum number of events to return. The default is 10,000 events.
    FilterLogEvents -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The filter pattern to use. For more information, see
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html Filter and Pattern Syntax>.
    --
    -- If not provided, all the events are matched.
    FilterLogEvents -> Maybe Text
filterPattern :: Prelude.Maybe Prelude.Text,
    -- | If the value is true, the operation makes a best effort to provide
    -- responses that contain events from multiple log streams within the log
    -- group, interleaved in a single response. If the value is false, all the
    -- matched log events in the first log stream are searched first, then
    -- those in the next log stream, and so on. The default is false.
    --
    -- __Important:__ Starting on June 17, 2019, this parameter is ignored and
    -- the value is assumed to be true. The response from this operation always
    -- interleaves events from multiple log streams within a log group.
    FilterLogEvents -> Maybe Bool
interleaved :: Prelude.Maybe Prelude.Bool,
    -- | The name of the log group to search.
    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)

-- |
-- Create a value of 'FilterLogEvents' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'startTime', 'filterLogEvents_startTime' - The start of the time range, expressed as the number of milliseconds
-- after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time
-- are not returned.
--
-- 'nextToken', 'filterLogEvents_nextToken' - The token for the next set of events to return. (You received this token
-- from a previous call.)
--
-- 'logStreamNames', 'filterLogEvents_logStreamNames' - Filters the results to only logs from the log streams in this list.
--
-- If you specify a value for both @logStreamNamePrefix@ and
-- @logStreamNames@, the action returns an @InvalidParameterException@
-- error.
--
-- 'logStreamNamePrefix', 'filterLogEvents_logStreamNamePrefix' - Filters the results to include only events from log streams that have
-- names starting with this prefix.
--
-- If you specify a value for both @logStreamNamePrefix@ and
-- @logStreamNames@, but the value for @logStreamNamePrefix@ does not match
-- any log stream names specified in @logStreamNames@, the action returns
-- an @InvalidParameterException@ error.
--
-- 'endTime', 'filterLogEvents_endTime' - The end of the time range, expressed as the number of milliseconds after
-- Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time
-- are not returned.
--
-- 'limit', 'filterLogEvents_limit' - The maximum number of events to return. The default is 10,000 events.
--
-- 'filterPattern', 'filterLogEvents_filterPattern' - The filter pattern to use. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html Filter and Pattern Syntax>.
--
-- If not provided, all the events are matched.
--
-- 'interleaved', 'filterLogEvents_interleaved' - If the value is true, the operation makes a best effort to provide
-- responses that contain events from multiple log streams within the log
-- group, interleaved in a single response. If the value is false, all the
-- matched log events in the first log stream are searched first, then
-- those in the next log stream, and so on. The default is false.
--
-- __Important:__ Starting on June 17, 2019, this parameter is ignored and
-- the value is assumed to be true. The response from this operation always
-- interleaves events from multiple log streams within a log group.
--
-- 'logGroupName', 'filterLogEvents_logGroupName' - The name of the log group to search.
newFilterLogEvents ::
  -- | 'logGroupName'
  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_
    }

-- | The start of the time range, expressed as the number of milliseconds
-- after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time
-- are not returned.
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)

-- | The token for the next set of events to return. (You received this token
-- from a previous call.)
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)

-- | Filters the results to only logs from the log streams in this list.
--
-- If you specify a value for both @logStreamNamePrefix@ and
-- @logStreamNames@, the action returns an @InvalidParameterException@
-- error.
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

-- | Filters the results to include only events from log streams that have
-- names starting with this prefix.
--
-- If you specify a value for both @logStreamNamePrefix@ and
-- @logStreamNames@, but the value for @logStreamNamePrefix@ does not match
-- any log stream names specified in @logStreamNames@, the action returns
-- an @InvalidParameterException@ error.
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)

-- | The end of the time range, expressed as the number of milliseconds after
-- Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time
-- are not returned.
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)

-- | The maximum number of events to return. The default is 10,000 events.
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)

-- | The filter pattern to use. For more information, see
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html Filter and Pattern Syntax>.
--
-- If not provided, all the events are matched.
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)

-- | If the value is true, the operation makes a best effort to provide
-- responses that contain events from multiple log streams within the log
-- group, interleaved in a single response. If the value is false, all the
-- matched log events in the first log stream are searched first, then
-- those in the next log stream, and so on. The default is false.
--
-- __Important:__ Starting on June 17, 2019, this parameter is ignored and
-- the value is assumed to be true. The response from this operation always
-- interleaves events from multiple log streams within a log group.
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)

-- | The name of the log group to search.
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

-- | /See:/ 'newFilterLogEventsResponse' smart constructor.
data FilterLogEventsResponse = FilterLogEventsResponse'
  { -- | __IMPORTANT__ Starting on May 15, 2020, this parameter will be
    -- deprecated. This parameter will be an empty list after the deprecation
    -- occurs.
    --
    -- Indicates which log streams have been searched and whether each has been
    -- searched completely.
    FilterLogEventsResponse -> Maybe [SearchedLogStream]
searchedLogStreams :: Prelude.Maybe [SearchedLogStream],
    -- | The token to use when requesting the next set of items. The token
    -- expires after 24 hours.
    FilterLogEventsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The matched events.
    FilterLogEventsResponse -> Maybe [FilteredLogEvent]
events :: Prelude.Maybe [FilteredLogEvent],
    -- | The response's http status code.
    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)

-- |
-- Create a value of 'FilterLogEventsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'searchedLogStreams', 'filterLogEventsResponse_searchedLogStreams' - __IMPORTANT__ Starting on May 15, 2020, this parameter will be
-- deprecated. This parameter will be an empty list after the deprecation
-- occurs.
--
-- Indicates which log streams have been searched and whether each has been
-- searched completely.
--
-- 'nextToken', 'filterLogEventsResponse_nextToken' - The token to use when requesting the next set of items. The token
-- expires after 24 hours.
--
-- 'events', 'filterLogEventsResponse_events' - The matched events.
--
-- 'httpStatus', 'filterLogEventsResponse_httpStatus' - The response's http status code.
newFilterLogEventsResponse ::
  -- | 'httpStatus'
  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_
    }

-- | __IMPORTANT__ Starting on May 15, 2020, this parameter will be
-- deprecated. This parameter will be an empty list after the deprecation
-- occurs.
--
-- Indicates which log streams have been searched and whether each has been
-- searched completely.
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

-- | The token to use when requesting the next set of items. The token
-- expires after 24 hours.
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)

-- | The matched events.
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

-- | The response's http status code.
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