{-# 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.XRay.GetInsightEvents
-- 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)
--
-- X-Ray reevaluates insights periodically until they\'re resolved, and
-- records each intermediate state as an event. You can review an
-- insight\'s events in the Impact Timeline on the Inspect page in the
-- X-Ray console.
module Amazonka.XRay.GetInsightEvents
  ( -- * Creating a Request
    GetInsightEvents (..),
    newGetInsightEvents,

    -- * Request Lenses
    getInsightEvents_nextToken,
    getInsightEvents_maxResults,
    getInsightEvents_insightId,

    -- * Destructuring the Response
    GetInsightEventsResponse (..),
    newGetInsightEventsResponse,

    -- * Response Lenses
    getInsightEventsResponse_insightEvents,
    getInsightEventsResponse_nextToken,
    getInsightEventsResponse_httpStatus,
  )
where

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
import Amazonka.XRay.Types

-- | /See:/ 'newGetInsightEvents' smart constructor.
data GetInsightEvents = GetInsightEvents'
  { -- | Specify the pagination token returned by a previous request to retrieve
    -- the next page of events.
    GetInsightEvents -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Used to retrieve at most the specified value of events.
    GetInsightEvents -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The insight\'s unique identifier. Use the GetInsightSummaries action to
    -- retrieve an InsightId.
    GetInsightEvents -> Text
insightId :: Prelude.Text
  }
  deriving (GetInsightEvents -> GetInsightEvents -> Bool
(GetInsightEvents -> GetInsightEvents -> Bool)
-> (GetInsightEvents -> GetInsightEvents -> Bool)
-> Eq GetInsightEvents
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInsightEvents -> GetInsightEvents -> Bool
$c/= :: GetInsightEvents -> GetInsightEvents -> Bool
== :: GetInsightEvents -> GetInsightEvents -> Bool
$c== :: GetInsightEvents -> GetInsightEvents -> Bool
Prelude.Eq, ReadPrec [GetInsightEvents]
ReadPrec GetInsightEvents
Int -> ReadS GetInsightEvents
ReadS [GetInsightEvents]
(Int -> ReadS GetInsightEvents)
-> ReadS [GetInsightEvents]
-> ReadPrec GetInsightEvents
-> ReadPrec [GetInsightEvents]
-> Read GetInsightEvents
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInsightEvents]
$creadListPrec :: ReadPrec [GetInsightEvents]
readPrec :: ReadPrec GetInsightEvents
$creadPrec :: ReadPrec GetInsightEvents
readList :: ReadS [GetInsightEvents]
$creadList :: ReadS [GetInsightEvents]
readsPrec :: Int -> ReadS GetInsightEvents
$creadsPrec :: Int -> ReadS GetInsightEvents
Prelude.Read, Int -> GetInsightEvents -> ShowS
[GetInsightEvents] -> ShowS
GetInsightEvents -> String
(Int -> GetInsightEvents -> ShowS)
-> (GetInsightEvents -> String)
-> ([GetInsightEvents] -> ShowS)
-> Show GetInsightEvents
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInsightEvents] -> ShowS
$cshowList :: [GetInsightEvents] -> ShowS
show :: GetInsightEvents -> String
$cshow :: GetInsightEvents -> String
showsPrec :: Int -> GetInsightEvents -> ShowS
$cshowsPrec :: Int -> GetInsightEvents -> ShowS
Prelude.Show, (forall x. GetInsightEvents -> Rep GetInsightEvents x)
-> (forall x. Rep GetInsightEvents x -> GetInsightEvents)
-> Generic GetInsightEvents
forall x. Rep GetInsightEvents x -> GetInsightEvents
forall x. GetInsightEvents -> Rep GetInsightEvents x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetInsightEvents x -> GetInsightEvents
$cfrom :: forall x. GetInsightEvents -> Rep GetInsightEvents x
Prelude.Generic)

-- |
-- Create a value of 'GetInsightEvents' 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:
--
-- 'nextToken', 'getInsightEvents_nextToken' - Specify the pagination token returned by a previous request to retrieve
-- the next page of events.
--
-- 'maxResults', 'getInsightEvents_maxResults' - Used to retrieve at most the specified value of events.
--
-- 'insightId', 'getInsightEvents_insightId' - The insight\'s unique identifier. Use the GetInsightSummaries action to
-- retrieve an InsightId.
newGetInsightEvents ::
  -- | 'insightId'
  Prelude.Text ->
  GetInsightEvents
newGetInsightEvents :: Text -> GetInsightEvents
newGetInsightEvents Text
pInsightId_ =
  GetInsightEvents' :: Maybe Text -> Maybe Natural -> Text -> GetInsightEvents
GetInsightEvents'
    { $sel:nextToken:GetInsightEvents' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetInsightEvents' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:insightId:GetInsightEvents' :: Text
insightId = Text
pInsightId_
    }

-- | Specify the pagination token returned by a previous request to retrieve
-- the next page of events.
getInsightEvents_nextToken :: Lens.Lens' GetInsightEvents (Prelude.Maybe Prelude.Text)
getInsightEvents_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetInsightEvents -> f GetInsightEvents
getInsightEvents_nextToken = (GetInsightEvents -> Maybe Text)
-> (GetInsightEvents -> Maybe Text -> GetInsightEvents)
-> Lens GetInsightEvents GetInsightEvents (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInsightEvents' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetInsightEvents' :: GetInsightEvents -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetInsightEvents
s@GetInsightEvents' {} Maybe Text
a -> GetInsightEvents
s {$sel:nextToken:GetInsightEvents' :: Maybe Text
nextToken = Maybe Text
a} :: GetInsightEvents)

-- | Used to retrieve at most the specified value of events.
getInsightEvents_maxResults :: Lens.Lens' GetInsightEvents (Prelude.Maybe Prelude.Natural)
getInsightEvents_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> GetInsightEvents -> f GetInsightEvents
getInsightEvents_maxResults = (GetInsightEvents -> Maybe Natural)
-> (GetInsightEvents -> Maybe Natural -> GetInsightEvents)
-> Lens
     GetInsightEvents GetInsightEvents (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInsightEvents' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetInsightEvents' :: GetInsightEvents -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetInsightEvents
s@GetInsightEvents' {} Maybe Natural
a -> GetInsightEvents
s {$sel:maxResults:GetInsightEvents' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetInsightEvents)

-- | The insight\'s unique identifier. Use the GetInsightSummaries action to
-- retrieve an InsightId.
getInsightEvents_insightId :: Lens.Lens' GetInsightEvents Prelude.Text
getInsightEvents_insightId :: (Text -> f Text) -> GetInsightEvents -> f GetInsightEvents
getInsightEvents_insightId = (GetInsightEvents -> Text)
-> (GetInsightEvents -> Text -> GetInsightEvents)
-> Lens GetInsightEvents GetInsightEvents Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInsightEvents' {Text
insightId :: Text
$sel:insightId:GetInsightEvents' :: GetInsightEvents -> Text
insightId} -> Text
insightId) (\s :: GetInsightEvents
s@GetInsightEvents' {} Text
a -> GetInsightEvents
s {$sel:insightId:GetInsightEvents' :: Text
insightId = Text
a} :: GetInsightEvents)

instance Core.AWSRequest GetInsightEvents where
  type
    AWSResponse GetInsightEvents =
      GetInsightEventsResponse
  request :: GetInsightEvents -> Request GetInsightEvents
request = Service -> GetInsightEvents -> Request GetInsightEvents
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetInsightEvents
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetInsightEvents)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetInsightEvents))
-> Logger
-> Service
-> Proxy GetInsightEvents
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetInsightEvents)))
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 [InsightEvent]
-> Maybe Text -> Int -> GetInsightEventsResponse
GetInsightEventsResponse'
            (Maybe [InsightEvent]
 -> Maybe Text -> Int -> GetInsightEventsResponse)
-> Either String (Maybe [InsightEvent])
-> Either String (Maybe Text -> Int -> GetInsightEventsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [InsightEvent]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"InsightEvents" Either String (Maybe (Maybe [InsightEvent]))
-> Maybe [InsightEvent] -> Either String (Maybe [InsightEvent])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [InsightEvent]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> GetInsightEventsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetInsightEventsResponse)
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 (Int -> GetInsightEventsResponse)
-> Either String Int -> Either String GetInsightEventsResponse
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 GetInsightEvents

instance Prelude.NFData GetInsightEvents

instance Core.ToHeaders GetInsightEvents where
  toHeaders :: GetInsightEvents -> ResponseHeaders
toHeaders = ResponseHeaders -> GetInsightEvents -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON GetInsightEvents where
  toJSON :: GetInsightEvents -> Value
toJSON GetInsightEvents' {Maybe Natural
Maybe Text
Text
insightId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:insightId:GetInsightEvents' :: GetInsightEvents -> Text
$sel:maxResults:GetInsightEvents' :: GetInsightEvents -> Maybe Natural
$sel:nextToken:GetInsightEvents' :: GetInsightEvents -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"InsightId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
insightId)
          ]
      )

instance Core.ToPath GetInsightEvents where
  toPath :: GetInsightEvents -> ByteString
toPath = ByteString -> GetInsightEvents -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/InsightEvents"

instance Core.ToQuery GetInsightEvents where
  toQuery :: GetInsightEvents -> QueryString
toQuery = QueryString -> GetInsightEvents -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetInsightEventsResponse' smart constructor.
data GetInsightEventsResponse = GetInsightEventsResponse'
  { -- | A detailed description of the event. This includes the time of the
    -- event, client and root cause impact statistics, and the top anomalous
    -- service at the time of the event.
    GetInsightEventsResponse -> Maybe [InsightEvent]
insightEvents :: Prelude.Maybe [InsightEvent],
    -- | Use this token to retrieve the next page of insight events.
    GetInsightEventsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetInsightEventsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetInsightEventsResponse -> GetInsightEventsResponse -> Bool
(GetInsightEventsResponse -> GetInsightEventsResponse -> Bool)
-> (GetInsightEventsResponse -> GetInsightEventsResponse -> Bool)
-> Eq GetInsightEventsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetInsightEventsResponse -> GetInsightEventsResponse -> Bool
$c/= :: GetInsightEventsResponse -> GetInsightEventsResponse -> Bool
== :: GetInsightEventsResponse -> GetInsightEventsResponse -> Bool
$c== :: GetInsightEventsResponse -> GetInsightEventsResponse -> Bool
Prelude.Eq, ReadPrec [GetInsightEventsResponse]
ReadPrec GetInsightEventsResponse
Int -> ReadS GetInsightEventsResponse
ReadS [GetInsightEventsResponse]
(Int -> ReadS GetInsightEventsResponse)
-> ReadS [GetInsightEventsResponse]
-> ReadPrec GetInsightEventsResponse
-> ReadPrec [GetInsightEventsResponse]
-> Read GetInsightEventsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetInsightEventsResponse]
$creadListPrec :: ReadPrec [GetInsightEventsResponse]
readPrec :: ReadPrec GetInsightEventsResponse
$creadPrec :: ReadPrec GetInsightEventsResponse
readList :: ReadS [GetInsightEventsResponse]
$creadList :: ReadS [GetInsightEventsResponse]
readsPrec :: Int -> ReadS GetInsightEventsResponse
$creadsPrec :: Int -> ReadS GetInsightEventsResponse
Prelude.Read, Int -> GetInsightEventsResponse -> ShowS
[GetInsightEventsResponse] -> ShowS
GetInsightEventsResponse -> String
(Int -> GetInsightEventsResponse -> ShowS)
-> (GetInsightEventsResponse -> String)
-> ([GetInsightEventsResponse] -> ShowS)
-> Show GetInsightEventsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetInsightEventsResponse] -> ShowS
$cshowList :: [GetInsightEventsResponse] -> ShowS
show :: GetInsightEventsResponse -> String
$cshow :: GetInsightEventsResponse -> String
showsPrec :: Int -> GetInsightEventsResponse -> ShowS
$cshowsPrec :: Int -> GetInsightEventsResponse -> ShowS
Prelude.Show, (forall x.
 GetInsightEventsResponse -> Rep GetInsightEventsResponse x)
-> (forall x.
    Rep GetInsightEventsResponse x -> GetInsightEventsResponse)
-> Generic GetInsightEventsResponse
forall x.
Rep GetInsightEventsResponse x -> GetInsightEventsResponse
forall x.
GetInsightEventsResponse -> Rep GetInsightEventsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetInsightEventsResponse x -> GetInsightEventsResponse
$cfrom :: forall x.
GetInsightEventsResponse -> Rep GetInsightEventsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetInsightEventsResponse' 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:
--
-- 'insightEvents', 'getInsightEventsResponse_insightEvents' - A detailed description of the event. This includes the time of the
-- event, client and root cause impact statistics, and the top anomalous
-- service at the time of the event.
--
-- 'nextToken', 'getInsightEventsResponse_nextToken' - Use this token to retrieve the next page of insight events.
--
-- 'httpStatus', 'getInsightEventsResponse_httpStatus' - The response's http status code.
newGetInsightEventsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetInsightEventsResponse
newGetInsightEventsResponse :: Int -> GetInsightEventsResponse
newGetInsightEventsResponse Int
pHttpStatus_ =
  GetInsightEventsResponse' :: Maybe [InsightEvent]
-> Maybe Text -> Int -> GetInsightEventsResponse
GetInsightEventsResponse'
    { $sel:insightEvents:GetInsightEventsResponse' :: Maybe [InsightEvent]
insightEvents =
        Maybe [InsightEvent]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetInsightEventsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetInsightEventsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A detailed description of the event. This includes the time of the
-- event, client and root cause impact statistics, and the top anomalous
-- service at the time of the event.
getInsightEventsResponse_insightEvents :: Lens.Lens' GetInsightEventsResponse (Prelude.Maybe [InsightEvent])
getInsightEventsResponse_insightEvents :: (Maybe [InsightEvent] -> f (Maybe [InsightEvent]))
-> GetInsightEventsResponse -> f GetInsightEventsResponse
getInsightEventsResponse_insightEvents = (GetInsightEventsResponse -> Maybe [InsightEvent])
-> (GetInsightEventsResponse
    -> Maybe [InsightEvent] -> GetInsightEventsResponse)
-> Lens
     GetInsightEventsResponse
     GetInsightEventsResponse
     (Maybe [InsightEvent])
     (Maybe [InsightEvent])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInsightEventsResponse' {Maybe [InsightEvent]
insightEvents :: Maybe [InsightEvent]
$sel:insightEvents:GetInsightEventsResponse' :: GetInsightEventsResponse -> Maybe [InsightEvent]
insightEvents} -> Maybe [InsightEvent]
insightEvents) (\s :: GetInsightEventsResponse
s@GetInsightEventsResponse' {} Maybe [InsightEvent]
a -> GetInsightEventsResponse
s {$sel:insightEvents:GetInsightEventsResponse' :: Maybe [InsightEvent]
insightEvents = Maybe [InsightEvent]
a} :: GetInsightEventsResponse) ((Maybe [InsightEvent] -> f (Maybe [InsightEvent]))
 -> GetInsightEventsResponse -> f GetInsightEventsResponse)
-> ((Maybe [InsightEvent] -> f (Maybe [InsightEvent]))
    -> Maybe [InsightEvent] -> f (Maybe [InsightEvent]))
-> (Maybe [InsightEvent] -> f (Maybe [InsightEvent]))
-> GetInsightEventsResponse
-> f GetInsightEventsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [InsightEvent] [InsightEvent] [InsightEvent] [InsightEvent]
-> Iso
     (Maybe [InsightEvent])
     (Maybe [InsightEvent])
     (Maybe [InsightEvent])
     (Maybe [InsightEvent])
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 [InsightEvent] [InsightEvent] [InsightEvent] [InsightEvent]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Use this token to retrieve the next page of insight events.
getInsightEventsResponse_nextToken :: Lens.Lens' GetInsightEventsResponse (Prelude.Maybe Prelude.Text)
getInsightEventsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetInsightEventsResponse -> f GetInsightEventsResponse
getInsightEventsResponse_nextToken = (GetInsightEventsResponse -> Maybe Text)
-> (GetInsightEventsResponse
    -> Maybe Text -> GetInsightEventsResponse)
-> Lens
     GetInsightEventsResponse
     GetInsightEventsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInsightEventsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetInsightEventsResponse' :: GetInsightEventsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetInsightEventsResponse
s@GetInsightEventsResponse' {} Maybe Text
a -> GetInsightEventsResponse
s {$sel:nextToken:GetInsightEventsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetInsightEventsResponse)

-- | The response's http status code.
getInsightEventsResponse_httpStatus :: Lens.Lens' GetInsightEventsResponse Prelude.Int
getInsightEventsResponse_httpStatus :: (Int -> f Int)
-> GetInsightEventsResponse -> f GetInsightEventsResponse
getInsightEventsResponse_httpStatus = (GetInsightEventsResponse -> Int)
-> (GetInsightEventsResponse -> Int -> GetInsightEventsResponse)
-> Lens GetInsightEventsResponse GetInsightEventsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetInsightEventsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetInsightEventsResponse' :: GetInsightEventsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetInsightEventsResponse
s@GetInsightEventsResponse' {} Int
a -> GetInsightEventsResponse
s {$sel:httpStatus:GetInsightEventsResponse' :: Int
httpStatus = Int
a} :: GetInsightEventsResponse)

instance Prelude.NFData GetInsightEventsResponse