{-# 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-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)
--
-- Returns a list of insights in your AWS 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_nextToken,
    listInsights_maxResults,
    listInsights_statusFilter,

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

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

import qualified Amazonka.Core as Core
import Amazonka.DevOpsGuru.Types
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:/ 'newListInsights' smart constructor.
data ListInsights = 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 -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | 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
(ListInsights -> ListInsights -> Bool)
-> (ListInsights -> ListInsights -> Bool) -> Eq ListInsights
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]
(Int -> ReadS ListInsights)
-> ReadS [ListInsights]
-> ReadPrec ListInsights
-> ReadPrec [ListInsights]
-> Read 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
(Int -> ListInsights -> ShowS)
-> (ListInsights -> String)
-> ([ListInsights] -> ShowS)
-> Show ListInsights
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. ListInsights -> Rep ListInsights x)
-> (forall x. Rep ListInsights x -> ListInsights)
-> Generic ListInsights
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:
--
-- '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.
--
-- '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.
--
-- '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' :: Maybe Text
-> Maybe Natural -> ListInsightsStatusFilter -> ListInsights
ListInsights'
    { $sel:nextToken:ListInsights' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListInsights' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:statusFilter:ListInsights' :: ListInsightsStatusFilter
statusFilter = ListInsightsStatusFilter
pStatusFilter_
    }

-- | 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 :: (Maybe Text -> f (Maybe Text)) -> ListInsights -> f ListInsights
listInsights_nextToken = (ListInsights -> Maybe Text)
-> (ListInsights -> Maybe Text -> ListInsights)
-> Lens ListInsights ListInsights (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Natural -> f (Maybe Natural))
-> ListInsights -> f ListInsights
listInsights_maxResults = (ListInsights -> Maybe Natural)
-> (ListInsights -> Maybe Natural -> ListInsights)
-> Lens ListInsights ListInsights (Maybe Natural) (Maybe Natural)
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)

-- | 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 :: (ListInsightsStatusFilter -> f ListInsightsStatusFilter)
-> ListInsights -> f ListInsights
listInsights_statusFilter = (ListInsights -> ListInsightsStatusFilter)
-> (ListInsights -> ListInsightsStatusFilter -> ListInsights)
-> Lens
     ListInsights
     ListInsights
     ListInsightsStatusFilter
     ListInsightsStatusFilter
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListInsights
ListInsightsResponse
rs
            ListInsightsResponse
-> Getting (First Text) ListInsightsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListInsightsResponse -> Const (First Text) ListInsightsResponse
Lens' ListInsightsResponse (Maybe Text)
listInsightsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListInsightsResponse -> Const (First Text) ListInsightsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListInsightsResponse 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 ListInsights
forall a. Maybe a
Prelude.Nothing
    | Maybe [ProactiveInsightSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListInsights
ListInsightsResponse
rs
            ListInsightsResponse
-> Getting
     (First [ProactiveInsightSummary])
     ListInsightsResponse
     [ProactiveInsightSummary]
-> Maybe [ProactiveInsightSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ProactiveInsightSummary]
 -> Const
      (First [ProactiveInsightSummary])
      (Maybe [ProactiveInsightSummary]))
-> ListInsightsResponse
-> Const (First [ProactiveInsightSummary]) ListInsightsResponse
Lens' ListInsightsResponse (Maybe [ProactiveInsightSummary])
listInsightsResponse_proactiveInsights
              ((Maybe [ProactiveInsightSummary]
  -> Const
       (First [ProactiveInsightSummary])
       (Maybe [ProactiveInsightSummary]))
 -> ListInsightsResponse
 -> Const (First [ProactiveInsightSummary]) ListInsightsResponse)
-> (([ProactiveInsightSummary]
     -> Const
          (First [ProactiveInsightSummary]) [ProactiveInsightSummary])
    -> Maybe [ProactiveInsightSummary]
    -> Const
         (First [ProactiveInsightSummary])
         (Maybe [ProactiveInsightSummary]))
-> Getting
     (First [ProactiveInsightSummary])
     ListInsightsResponse
     [ProactiveInsightSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ProactiveInsightSummary]
 -> Const
      (First [ProactiveInsightSummary]) [ProactiveInsightSummary])
-> Maybe [ProactiveInsightSummary]
-> Const
     (First [ProactiveInsightSummary]) (Maybe [ProactiveInsightSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListInsights
forall a. Maybe a
Prelude.Nothing
    | Maybe [ReactiveInsightSummary] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse ListInsights
ListInsightsResponse
rs
            ListInsightsResponse
-> Getting
     (First [ReactiveInsightSummary])
     ListInsightsResponse
     [ReactiveInsightSummary]
-> Maybe [ReactiveInsightSummary]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ReactiveInsightSummary]
 -> Const
      (First [ReactiveInsightSummary]) (Maybe [ReactiveInsightSummary]))
-> ListInsightsResponse
-> Const (First [ReactiveInsightSummary]) ListInsightsResponse
Lens' ListInsightsResponse (Maybe [ReactiveInsightSummary])
listInsightsResponse_reactiveInsights
              ((Maybe [ReactiveInsightSummary]
  -> Const
       (First [ReactiveInsightSummary]) (Maybe [ReactiveInsightSummary]))
 -> ListInsightsResponse
 -> Const (First [ReactiveInsightSummary]) ListInsightsResponse)
-> (([ReactiveInsightSummary]
     -> Const (First [ReactiveInsightSummary]) [ReactiveInsightSummary])
    -> Maybe [ReactiveInsightSummary]
    -> Const
         (First [ReactiveInsightSummary]) (Maybe [ReactiveInsightSummary]))
-> Getting
     (First [ReactiveInsightSummary])
     ListInsightsResponse
     [ReactiveInsightSummary]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ReactiveInsightSummary]
 -> Const (First [ReactiveInsightSummary]) [ReactiveInsightSummary])
-> Maybe [ReactiveInsightSummary]
-> Const
     (First [ReactiveInsightSummary]) (Maybe [ReactiveInsightSummary])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe ListInsights
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      ListInsights -> Maybe ListInsights
forall a. a -> Maybe a
Prelude.Just (ListInsights -> Maybe ListInsights)
-> ListInsights -> Maybe ListInsights
forall a b. (a -> b) -> a -> b
Prelude.$
        ListInsights
rq
          ListInsights -> (ListInsights -> ListInsights) -> ListInsights
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListInsights -> Identity ListInsights
Lens ListInsights ListInsights (Maybe Text) (Maybe Text)
listInsights_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> ListInsights -> Identity ListInsights)
-> Maybe Text -> ListInsights -> ListInsights
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListInsights
ListInsightsResponse
rs
          ListInsightsResponse
-> Getting (First Text) ListInsightsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListInsightsResponse -> Const (First Text) ListInsightsResponse
Lens' ListInsightsResponse (Maybe Text)
listInsightsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> ListInsightsResponse -> Const (First Text) ListInsightsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListInsightsResponse 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 ListInsights where
  type AWSResponse ListInsights = ListInsightsResponse
  request :: ListInsights -> Request ListInsights
request = Service -> ListInsights -> Request ListInsights
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListInsights
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListInsights)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListInsights))
-> Logger
-> Service
-> Proxy ListInsights
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListInsights)))
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 [ReactiveInsightSummary]
-> Maybe Text
-> Maybe [ProactiveInsightSummary]
-> Int
-> ListInsightsResponse
ListInsightsResponse'
            (Maybe [ReactiveInsightSummary]
 -> Maybe Text
 -> Maybe [ProactiveInsightSummary]
 -> Int
 -> ListInsightsResponse)
-> Either String (Maybe [ReactiveInsightSummary])
-> Either
     String
     (Maybe Text
      -> Maybe [ProactiveInsightSummary] -> Int -> ListInsightsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ReactiveInsightSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReactiveInsights"
                            Either String (Maybe (Maybe [ReactiveInsightSummary]))
-> Maybe [ReactiveInsightSummary]
-> Either String (Maybe [ReactiveInsightSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ReactiveInsightSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either
  String
  (Maybe Text
   -> Maybe [ProactiveInsightSummary] -> Int -> ListInsightsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe [ProactiveInsightSummary] -> Int -> ListInsightsResponse)
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 [ProactiveInsightSummary] -> Int -> ListInsightsResponse)
-> Either String (Maybe [ProactiveInsightSummary])
-> Either String (Int -> ListInsightsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ProactiveInsightSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProactiveInsights"
                            Either String (Maybe (Maybe [ProactiveInsightSummary]))
-> Maybe [ProactiveInsightSummary]
-> Either String (Maybe [ProactiveInsightSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ProactiveInsightSummary]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> ListInsightsResponse)
-> Either String Int -> Either String ListInsightsResponse
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 ListInsights

instance Prelude.NFData ListInsights

instance Core.ToHeaders ListInsights where
  toHeaders :: ListInsights -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListInsights -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 ListInsights where
  toJSON :: ListInsights -> Value
toJSON ListInsights' {Maybe Natural
Maybe Text
ListInsightsStatusFilter
statusFilter :: ListInsightsStatusFilter
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:statusFilter:ListInsights' :: ListInsights -> ListInsightsStatusFilter
$sel:maxResults:ListInsights' :: ListInsights -> Maybe Natural
$sel:nextToken:ListInsights' :: ListInsights -> 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
"StatusFilter" Text -> ListInsightsStatusFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ListInsightsStatusFilter
statusFilter)
          ]
      )

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

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

-- | /See:/ 'newListInsightsResponse' smart constructor.
data ListInsightsResponse = ListInsightsResponse'
  { -- | The returned list of reactive insights.
    ListInsightsResponse -> Maybe [ReactiveInsightSummary]
reactiveInsights :: Prelude.Maybe [ReactiveInsightSummary],
    -- | 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 response's http status code.
    ListInsightsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListInsightsResponse -> ListInsightsResponse -> Bool
(ListInsightsResponse -> ListInsightsResponse -> Bool)
-> (ListInsightsResponse -> ListInsightsResponse -> Bool)
-> Eq ListInsightsResponse
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]
(Int -> ReadS ListInsightsResponse)
-> ReadS [ListInsightsResponse]
-> ReadPrec ListInsightsResponse
-> ReadPrec [ListInsightsResponse]
-> Read 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
(Int -> ListInsightsResponse -> ShowS)
-> (ListInsightsResponse -> String)
-> ([ListInsightsResponse] -> ShowS)
-> Show ListInsightsResponse
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. ListInsightsResponse -> Rep ListInsightsResponse x)
-> (forall x. Rep ListInsightsResponse x -> ListInsightsResponse)
-> Generic ListInsightsResponse
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:
--
-- 'reactiveInsights', 'listInsightsResponse_reactiveInsights' - The returned list of reactive insights.
--
-- '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.
--
-- 'httpStatus', 'listInsightsResponse_httpStatus' - The response's http status code.
newListInsightsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListInsightsResponse
newListInsightsResponse :: Int -> ListInsightsResponse
newListInsightsResponse Int
pHttpStatus_ =
  ListInsightsResponse' :: Maybe [ReactiveInsightSummary]
-> Maybe Text
-> Maybe [ProactiveInsightSummary]
-> Int
-> ListInsightsResponse
ListInsightsResponse'
    { $sel:reactiveInsights:ListInsightsResponse' :: Maybe [ReactiveInsightSummary]
reactiveInsights =
        Maybe [ReactiveInsightSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListInsightsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:proactiveInsights:ListInsightsResponse' :: Maybe [ProactiveInsightSummary]
proactiveInsights = Maybe [ProactiveInsightSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListInsightsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The returned list of reactive insights.
listInsightsResponse_reactiveInsights :: Lens.Lens' ListInsightsResponse (Prelude.Maybe [ReactiveInsightSummary])
listInsightsResponse_reactiveInsights :: (Maybe [ReactiveInsightSummary]
 -> f (Maybe [ReactiveInsightSummary]))
-> ListInsightsResponse -> f ListInsightsResponse
listInsightsResponse_reactiveInsights = (ListInsightsResponse -> Maybe [ReactiveInsightSummary])
-> (ListInsightsResponse
    -> Maybe [ReactiveInsightSummary] -> ListInsightsResponse)
-> Lens' ListInsightsResponse (Maybe [ReactiveInsightSummary])
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) ((Maybe [ReactiveInsightSummary]
  -> f (Maybe [ReactiveInsightSummary]))
 -> ListInsightsResponse -> f ListInsightsResponse)
-> ((Maybe [ReactiveInsightSummary]
     -> f (Maybe [ReactiveInsightSummary]))
    -> Maybe [ReactiveInsightSummary]
    -> f (Maybe [ReactiveInsightSummary]))
-> (Maybe [ReactiveInsightSummary]
    -> f (Maybe [ReactiveInsightSummary]))
-> ListInsightsResponse
-> f ListInsightsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ReactiveInsightSummary]
  [ReactiveInsightSummary]
  [ReactiveInsightSummary]
  [ReactiveInsightSummary]
-> Iso
     (Maybe [ReactiveInsightSummary])
     (Maybe [ReactiveInsightSummary])
     (Maybe [ReactiveInsightSummary])
     (Maybe [ReactiveInsightSummary])
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
  [ReactiveInsightSummary]
  [ReactiveInsightSummary]
  [ReactiveInsightSummary]
  [ReactiveInsightSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListInsightsResponse -> f ListInsightsResponse
listInsightsResponse_nextToken = (ListInsightsResponse -> Maybe Text)
-> (ListInsightsResponse -> Maybe Text -> ListInsightsResponse)
-> Lens' ListInsightsResponse (Maybe Text)
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 :: (Maybe [ProactiveInsightSummary]
 -> f (Maybe [ProactiveInsightSummary]))
-> ListInsightsResponse -> f ListInsightsResponse
listInsightsResponse_proactiveInsights = (ListInsightsResponse -> Maybe [ProactiveInsightSummary])
-> (ListInsightsResponse
    -> Maybe [ProactiveInsightSummary] -> ListInsightsResponse)
-> Lens' ListInsightsResponse (Maybe [ProactiveInsightSummary])
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) ((Maybe [ProactiveInsightSummary]
  -> f (Maybe [ProactiveInsightSummary]))
 -> ListInsightsResponse -> f ListInsightsResponse)
-> ((Maybe [ProactiveInsightSummary]
     -> f (Maybe [ProactiveInsightSummary]))
    -> Maybe [ProactiveInsightSummary]
    -> f (Maybe [ProactiveInsightSummary]))
-> (Maybe [ProactiveInsightSummary]
    -> f (Maybe [ProactiveInsightSummary]))
-> ListInsightsResponse
-> f ListInsightsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ProactiveInsightSummary]
  [ProactiveInsightSummary]
  [ProactiveInsightSummary]
  [ProactiveInsightSummary]
-> Iso
     (Maybe [ProactiveInsightSummary])
     (Maybe [ProactiveInsightSummary])
     (Maybe [ProactiveInsightSummary])
     (Maybe [ProactiveInsightSummary])
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
  [ProactiveInsightSummary]
  [ProactiveInsightSummary]
  [ProactiveInsightSummary]
  [ProactiveInsightSummary]
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 :: (Int -> f Int) -> ListInsightsResponse -> f ListInsightsResponse
listInsightsResponse_httpStatus = (ListInsightsResponse -> Int)
-> (ListInsightsResponse -> Int -> ListInsightsResponse)
-> Lens ListInsightsResponse ListInsightsResponse Int Int
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