{-# 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.DevOpsGuru.ListInsights
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns a list of insights in your Amazon Web Services account. You can
-- specify which insights are returned by their start time and status
-- (@ONGOING@, @CLOSED@, or @ANY@).
--
-- This operation returns paginated results.
module Amazonka.DevOpsGuru.ListInsights
  ( -- * Creating a Request
    ListInsights (..),
    newListInsights,

    -- * Request Lenses
    listInsights_maxResults,
    listInsights_nextToken,
    listInsights_statusFilter,

    -- * Destructuring the Response
    ListInsightsResponse (..),
    newListInsightsResponse,

    -- * Response Lenses
    listInsightsResponse_nextToken,
    listInsightsResponse_proactiveInsights,
    listInsightsResponse_reactiveInsights,
    listInsightsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DevOpsGuru.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListInsights' smart constructor.
data ListInsights = ListInsights'
  { -- | The maximum number of results to return with a single call. To retrieve
    -- the remaining results, make another call with the returned @nextToken@
    -- value.
    ListInsights -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If this value is null, it retrieves the first page.
    ListInsights -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A filter used to filter the returned insights by their status. You can
    -- specify one status filter.
    ListInsights -> ListInsightsStatusFilter
statusFilter :: ListInsightsStatusFilter
  }
  deriving (ListInsights -> ListInsights -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInsights -> ListInsights -> Bool
$c/= :: ListInsights -> ListInsights -> Bool
== :: ListInsights -> ListInsights -> Bool
$c== :: ListInsights -> ListInsights -> Bool
Prelude.Eq, ReadPrec [ListInsights]
ReadPrec ListInsights
Int -> ReadS ListInsights
ReadS [ListInsights]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInsights]
$creadListPrec :: ReadPrec [ListInsights]
readPrec :: ReadPrec ListInsights
$creadPrec :: ReadPrec ListInsights
readList :: ReadS [ListInsights]
$creadList :: ReadS [ListInsights]
readsPrec :: Int -> ReadS ListInsights
$creadsPrec :: Int -> ReadS ListInsights
Prelude.Read, Int -> ListInsights -> ShowS
[ListInsights] -> ShowS
ListInsights -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInsights] -> ShowS
$cshowList :: [ListInsights] -> ShowS
show :: ListInsights -> String
$cshow :: ListInsights -> String
showsPrec :: Int -> ListInsights -> ShowS
$cshowsPrec :: Int -> ListInsights -> ShowS
Prelude.Show, forall x. Rep ListInsights x -> ListInsights
forall x. ListInsights -> Rep ListInsights x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListInsights x -> ListInsights
$cfrom :: forall x. ListInsights -> Rep ListInsights x
Prelude.Generic)

-- |
-- Create a value of 'ListInsights' 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:
--
-- 'maxResults', 'listInsights_maxResults' - The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
--
-- 'nextToken', 'listInsights_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
--
-- 'statusFilter', 'listInsights_statusFilter' - A filter used to filter the returned insights by their status. You can
-- specify one status filter.
newListInsights ::
  -- | 'statusFilter'
  ListInsightsStatusFilter ->
  ListInsights
newListInsights :: ListInsightsStatusFilter -> ListInsights
newListInsights ListInsightsStatusFilter
pStatusFilter_ =
  ListInsights'
    { $sel:maxResults:ListInsights' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListInsights' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:statusFilter:ListInsights' :: ListInsightsStatusFilter
statusFilter = ListInsightsStatusFilter
pStatusFilter_
    }

-- | The maximum number of results to return with a single call. To retrieve
-- the remaining results, make another call with the returned @nextToken@
-- value.
listInsights_maxResults :: Lens.Lens' ListInsights (Prelude.Maybe Prelude.Natural)
listInsights_maxResults :: Lens' ListInsights (Maybe Natural)
listInsights_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInsights' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListInsights' :: ListInsights -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListInsights
s@ListInsights' {} Maybe Natural
a -> ListInsights
s {$sel:maxResults:ListInsights' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListInsights)

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If this value is null, it retrieves the first page.
listInsights_nextToken :: Lens.Lens' ListInsights (Prelude.Maybe Prelude.Text)
listInsights_nextToken :: Lens' ListInsights (Maybe Text)
listInsights_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInsights' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInsights' :: ListInsights -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInsights
s@ListInsights' {} Maybe Text
a -> ListInsights
s {$sel:nextToken:ListInsights' :: Maybe Text
nextToken = Maybe Text
a} :: ListInsights)

-- | A filter used to filter the returned insights by their status. You can
-- specify one status filter.
listInsights_statusFilter :: Lens.Lens' ListInsights ListInsightsStatusFilter
listInsights_statusFilter :: Lens' ListInsights ListInsightsStatusFilter
listInsights_statusFilter = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInsights' {ListInsightsStatusFilter
statusFilter :: ListInsightsStatusFilter
$sel:statusFilter:ListInsights' :: ListInsights -> ListInsightsStatusFilter
statusFilter} -> ListInsightsStatusFilter
statusFilter) (\s :: ListInsights
s@ListInsights' {} ListInsightsStatusFilter
a -> ListInsights
s {$sel:statusFilter:ListInsights' :: ListInsightsStatusFilter
statusFilter = ListInsightsStatusFilter
a} :: ListInsights)

instance Core.AWSPager ListInsights where
  page :: ListInsights -> AWSResponse ListInsights -> Maybe ListInsights
page ListInsights
rq AWSResponse ListInsights
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListInsights
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInsightsResponse (Maybe Text)
listInsightsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListInsights
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInsightsResponse (Maybe [ProactiveInsightSummary])
listInsightsResponse_proactiveInsights
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListInsights
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInsightsResponse (Maybe [ReactiveInsightSummary])
listInsightsResponse_reactiveInsights
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ ListInsights
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListInsights (Maybe Text)
listInsights_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListInsights
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInsightsResponse (Maybe Text)
listInsightsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest ListInsights where
  type AWSResponse ListInsights = ListInsightsResponse
  request :: (Service -> Service) -> ListInsights -> Request ListInsights
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListInsights
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListInsights)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [ProactiveInsightSummary]
-> Maybe [ReactiveInsightSummary]
-> Int
-> ListInsightsResponse
ListInsightsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ProactiveInsights"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"ReactiveInsights"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListInsights where
  hashWithSalt :: Int -> ListInsights -> Int
hashWithSalt Int
_salt ListInsights' {Maybe Natural
Maybe Text
ListInsightsStatusFilter
statusFilter :: ListInsightsStatusFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:statusFilter:ListInsights' :: ListInsights -> ListInsightsStatusFilter
$sel:nextToken:ListInsights' :: ListInsights -> Maybe Text
$sel:maxResults:ListInsights' :: ListInsights -> Maybe Natural
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ListInsightsStatusFilter
statusFilter

instance Prelude.NFData ListInsights where
  rnf :: ListInsights -> ()
rnf ListInsights' {Maybe Natural
Maybe Text
ListInsightsStatusFilter
statusFilter :: ListInsightsStatusFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:statusFilter:ListInsights' :: ListInsights -> ListInsightsStatusFilter
$sel:nextToken:ListInsights' :: ListInsights -> Maybe Text
$sel:maxResults:ListInsights' :: ListInsights -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ListInsightsStatusFilter
statusFilter

instance Data.ToHeaders ListInsights where
  toHeaders :: ListInsights -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListInsights where
  toJSON :: ListInsights -> Value
toJSON ListInsights' {Maybe Natural
Maybe Text
ListInsightsStatusFilter
statusFilter :: ListInsightsStatusFilter
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:statusFilter:ListInsights' :: ListInsights -> ListInsightsStatusFilter
$sel:nextToken:ListInsights' :: ListInsights -> Maybe Text
$sel:maxResults:ListInsights' :: ListInsights -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"StatusFilter" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ListInsightsStatusFilter
statusFilter)
          ]
      )

instance Data.ToPath ListInsights where
  toPath :: ListInsights -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/insights"

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

-- | /See:/ 'newListInsightsResponse' smart constructor.
data ListInsightsResponse = ListInsightsResponse'
  { -- | The pagination token to use to retrieve the next page of results for
    -- this operation. If there are no more pages, this value is null.
    ListInsightsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The returned list of proactive insights.
    ListInsightsResponse -> Maybe [ProactiveInsightSummary]
proactiveInsights :: Prelude.Maybe [ProactiveInsightSummary],
    -- | The returned list of reactive insights.
    ListInsightsResponse -> Maybe [ReactiveInsightSummary]
reactiveInsights :: Prelude.Maybe [ReactiveInsightSummary],
    -- | The response's http status code.
    ListInsightsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListInsightsResponse -> ListInsightsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInsightsResponse -> ListInsightsResponse -> Bool
$c/= :: ListInsightsResponse -> ListInsightsResponse -> Bool
== :: ListInsightsResponse -> ListInsightsResponse -> Bool
$c== :: ListInsightsResponse -> ListInsightsResponse -> Bool
Prelude.Eq, ReadPrec [ListInsightsResponse]
ReadPrec ListInsightsResponse
Int -> ReadS ListInsightsResponse
ReadS [ListInsightsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInsightsResponse]
$creadListPrec :: ReadPrec [ListInsightsResponse]
readPrec :: ReadPrec ListInsightsResponse
$creadPrec :: ReadPrec ListInsightsResponse
readList :: ReadS [ListInsightsResponse]
$creadList :: ReadS [ListInsightsResponse]
readsPrec :: Int -> ReadS ListInsightsResponse
$creadsPrec :: Int -> ReadS ListInsightsResponse
Prelude.Read, Int -> ListInsightsResponse -> ShowS
[ListInsightsResponse] -> ShowS
ListInsightsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInsightsResponse] -> ShowS
$cshowList :: [ListInsightsResponse] -> ShowS
show :: ListInsightsResponse -> String
$cshow :: ListInsightsResponse -> String
showsPrec :: Int -> ListInsightsResponse -> ShowS
$cshowsPrec :: Int -> ListInsightsResponse -> ShowS
Prelude.Show, forall x. Rep ListInsightsResponse x -> ListInsightsResponse
forall x. ListInsightsResponse -> Rep ListInsightsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListInsightsResponse x -> ListInsightsResponse
$cfrom :: forall x. ListInsightsResponse -> Rep ListInsightsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListInsightsResponse' 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', 'listInsightsResponse_nextToken' - The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
--
-- 'proactiveInsights', 'listInsightsResponse_proactiveInsights' - The returned list of proactive insights.
--
-- 'reactiveInsights', 'listInsightsResponse_reactiveInsights' - The returned list of reactive insights.
--
-- 'httpStatus', 'listInsightsResponse_httpStatus' - The response's http status code.
newListInsightsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListInsightsResponse
newListInsightsResponse :: Int -> ListInsightsResponse
newListInsightsResponse Int
pHttpStatus_ =
  ListInsightsResponse'
    { $sel:nextToken:ListInsightsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:proactiveInsights:ListInsightsResponse' :: Maybe [ProactiveInsightSummary]
proactiveInsights = forall a. Maybe a
Prelude.Nothing,
      $sel:reactiveInsights:ListInsightsResponse' :: Maybe [ReactiveInsightSummary]
reactiveInsights = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListInsightsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pagination token to use to retrieve the next page of results for
-- this operation. If there are no more pages, this value is null.
listInsightsResponse_nextToken :: Lens.Lens' ListInsightsResponse (Prelude.Maybe Prelude.Text)
listInsightsResponse_nextToken :: Lens' ListInsightsResponse (Maybe Text)
listInsightsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInsightsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInsightsResponse' :: ListInsightsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInsightsResponse
s@ListInsightsResponse' {} Maybe Text
a -> ListInsightsResponse
s {$sel:nextToken:ListInsightsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListInsightsResponse)

-- | The returned list of proactive insights.
listInsightsResponse_proactiveInsights :: Lens.Lens' ListInsightsResponse (Prelude.Maybe [ProactiveInsightSummary])
listInsightsResponse_proactiveInsights :: Lens' ListInsightsResponse (Maybe [ProactiveInsightSummary])
listInsightsResponse_proactiveInsights = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInsightsResponse' {Maybe [ProactiveInsightSummary]
proactiveInsights :: Maybe [ProactiveInsightSummary]
$sel:proactiveInsights:ListInsightsResponse' :: ListInsightsResponse -> Maybe [ProactiveInsightSummary]
proactiveInsights} -> Maybe [ProactiveInsightSummary]
proactiveInsights) (\s :: ListInsightsResponse
s@ListInsightsResponse' {} Maybe [ProactiveInsightSummary]
a -> ListInsightsResponse
s {$sel:proactiveInsights:ListInsightsResponse' :: Maybe [ProactiveInsightSummary]
proactiveInsights = Maybe [ProactiveInsightSummary]
a} :: ListInsightsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The returned list of reactive insights.
listInsightsResponse_reactiveInsights :: Lens.Lens' ListInsightsResponse (Prelude.Maybe [ReactiveInsightSummary])
listInsightsResponse_reactiveInsights :: Lens' ListInsightsResponse (Maybe [ReactiveInsightSummary])
listInsightsResponse_reactiveInsights = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInsightsResponse' {Maybe [ReactiveInsightSummary]
reactiveInsights :: Maybe [ReactiveInsightSummary]
$sel:reactiveInsights:ListInsightsResponse' :: ListInsightsResponse -> Maybe [ReactiveInsightSummary]
reactiveInsights} -> Maybe [ReactiveInsightSummary]
reactiveInsights) (\s :: ListInsightsResponse
s@ListInsightsResponse' {} Maybe [ReactiveInsightSummary]
a -> ListInsightsResponse
s {$sel:reactiveInsights:ListInsightsResponse' :: Maybe [ReactiveInsightSummary]
reactiveInsights = Maybe [ReactiveInsightSummary]
a} :: ListInsightsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListInsightsResponse where
  rnf :: ListInsightsResponse -> ()
rnf ListInsightsResponse' {Int
Maybe [ReactiveInsightSummary]
Maybe [ProactiveInsightSummary]
Maybe Text
httpStatus :: Int
reactiveInsights :: Maybe [ReactiveInsightSummary]
proactiveInsights :: Maybe [ProactiveInsightSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListInsightsResponse' :: ListInsightsResponse -> Int
$sel:reactiveInsights:ListInsightsResponse' :: ListInsightsResponse -> Maybe [ReactiveInsightSummary]
$sel:proactiveInsights:ListInsightsResponse' :: ListInsightsResponse -> Maybe [ProactiveInsightSummary]
$sel:nextToken:ListInsightsResponse' :: ListInsightsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ProactiveInsightSummary]
proactiveInsights
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [ReactiveInsightSummary]
reactiveInsights
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus