{-# 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.LookoutMetrics.ListAnomalyGroupSummaries
-- 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 anomaly groups.
module Amazonka.LookoutMetrics.ListAnomalyGroupSummaries
  ( -- * Creating a Request
    ListAnomalyGroupSummaries (..),
    newListAnomalyGroupSummaries,

    -- * Request Lenses
    listAnomalyGroupSummaries_nextToken,
    listAnomalyGroupSummaries_maxResults,
    listAnomalyGroupSummaries_anomalyDetectorArn,
    listAnomalyGroupSummaries_sensitivityThreshold,

    -- * Destructuring the Response
    ListAnomalyGroupSummariesResponse (..),
    newListAnomalyGroupSummariesResponse,

    -- * Response Lenses
    listAnomalyGroupSummariesResponse_anomalyGroupStatistics,
    listAnomalyGroupSummariesResponse_nextToken,
    listAnomalyGroupSummariesResponse_anomalyGroupSummaryList,
    listAnomalyGroupSummariesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.LookoutMetrics.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListAnomalyGroupSummaries' smart constructor.
data ListAnomalyGroupSummaries = ListAnomalyGroupSummaries'
  { -- | Specify the pagination token that\'s returned by a previous request to
    -- retrieve the next page of results.
    ListAnomalyGroupSummaries -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return.
    ListAnomalyGroupSummaries -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The Amazon Resource Name (ARN) of the anomaly detector.
    ListAnomalyGroupSummaries -> Text
anomalyDetectorArn :: Prelude.Text,
    -- | The minimum severity score for inclusion in the output.
    ListAnomalyGroupSummaries -> Natural
sensitivityThreshold :: Prelude.Natural
  }
  deriving (ListAnomalyGroupSummaries -> ListAnomalyGroupSummaries -> Bool
(ListAnomalyGroupSummaries -> ListAnomalyGroupSummaries -> Bool)
-> (ListAnomalyGroupSummaries -> ListAnomalyGroupSummaries -> Bool)
-> Eq ListAnomalyGroupSummaries
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAnomalyGroupSummaries -> ListAnomalyGroupSummaries -> Bool
$c/= :: ListAnomalyGroupSummaries -> ListAnomalyGroupSummaries -> Bool
== :: ListAnomalyGroupSummaries -> ListAnomalyGroupSummaries -> Bool
$c== :: ListAnomalyGroupSummaries -> ListAnomalyGroupSummaries -> Bool
Prelude.Eq, ReadPrec [ListAnomalyGroupSummaries]
ReadPrec ListAnomalyGroupSummaries
Int -> ReadS ListAnomalyGroupSummaries
ReadS [ListAnomalyGroupSummaries]
(Int -> ReadS ListAnomalyGroupSummaries)
-> ReadS [ListAnomalyGroupSummaries]
-> ReadPrec ListAnomalyGroupSummaries
-> ReadPrec [ListAnomalyGroupSummaries]
-> Read ListAnomalyGroupSummaries
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAnomalyGroupSummaries]
$creadListPrec :: ReadPrec [ListAnomalyGroupSummaries]
readPrec :: ReadPrec ListAnomalyGroupSummaries
$creadPrec :: ReadPrec ListAnomalyGroupSummaries
readList :: ReadS [ListAnomalyGroupSummaries]
$creadList :: ReadS [ListAnomalyGroupSummaries]
readsPrec :: Int -> ReadS ListAnomalyGroupSummaries
$creadsPrec :: Int -> ReadS ListAnomalyGroupSummaries
Prelude.Read, Int -> ListAnomalyGroupSummaries -> ShowS
[ListAnomalyGroupSummaries] -> ShowS
ListAnomalyGroupSummaries -> String
(Int -> ListAnomalyGroupSummaries -> ShowS)
-> (ListAnomalyGroupSummaries -> String)
-> ([ListAnomalyGroupSummaries] -> ShowS)
-> Show ListAnomalyGroupSummaries
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAnomalyGroupSummaries] -> ShowS
$cshowList :: [ListAnomalyGroupSummaries] -> ShowS
show :: ListAnomalyGroupSummaries -> String
$cshow :: ListAnomalyGroupSummaries -> String
showsPrec :: Int -> ListAnomalyGroupSummaries -> ShowS
$cshowsPrec :: Int -> ListAnomalyGroupSummaries -> ShowS
Prelude.Show, (forall x.
 ListAnomalyGroupSummaries -> Rep ListAnomalyGroupSummaries x)
-> (forall x.
    Rep ListAnomalyGroupSummaries x -> ListAnomalyGroupSummaries)
-> Generic ListAnomalyGroupSummaries
forall x.
Rep ListAnomalyGroupSummaries x -> ListAnomalyGroupSummaries
forall x.
ListAnomalyGroupSummaries -> Rep ListAnomalyGroupSummaries x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAnomalyGroupSummaries x -> ListAnomalyGroupSummaries
$cfrom :: forall x.
ListAnomalyGroupSummaries -> Rep ListAnomalyGroupSummaries x
Prelude.Generic)

-- |
-- Create a value of 'ListAnomalyGroupSummaries' 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', 'listAnomalyGroupSummaries_nextToken' - Specify the pagination token that\'s returned by a previous request to
-- retrieve the next page of results.
--
-- 'maxResults', 'listAnomalyGroupSummaries_maxResults' - The maximum number of results to return.
--
-- 'anomalyDetectorArn', 'listAnomalyGroupSummaries_anomalyDetectorArn' - The Amazon Resource Name (ARN) of the anomaly detector.
--
-- 'sensitivityThreshold', 'listAnomalyGroupSummaries_sensitivityThreshold' - The minimum severity score for inclusion in the output.
newListAnomalyGroupSummaries ::
  -- | 'anomalyDetectorArn'
  Prelude.Text ->
  -- | 'sensitivityThreshold'
  Prelude.Natural ->
  ListAnomalyGroupSummaries
newListAnomalyGroupSummaries :: Text -> Natural -> ListAnomalyGroupSummaries
newListAnomalyGroupSummaries
  Text
pAnomalyDetectorArn_
  Natural
pSensitivityThreshold_ =
    ListAnomalyGroupSummaries' :: Maybe Text
-> Maybe Natural -> Text -> Natural -> ListAnomalyGroupSummaries
ListAnomalyGroupSummaries'
      { $sel:nextToken:ListAnomalyGroupSummaries' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:ListAnomalyGroupSummaries' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:anomalyDetectorArn:ListAnomalyGroupSummaries' :: Text
anomalyDetectorArn = Text
pAnomalyDetectorArn_,
        $sel:sensitivityThreshold:ListAnomalyGroupSummaries' :: Natural
sensitivityThreshold = Natural
pSensitivityThreshold_
      }

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

-- | The maximum number of results to return.
listAnomalyGroupSummaries_maxResults :: Lens.Lens' ListAnomalyGroupSummaries (Prelude.Maybe Prelude.Natural)
listAnomalyGroupSummaries_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListAnomalyGroupSummaries -> f ListAnomalyGroupSummaries
listAnomalyGroupSummaries_maxResults = (ListAnomalyGroupSummaries -> Maybe Natural)
-> (ListAnomalyGroupSummaries
    -> Maybe Natural -> ListAnomalyGroupSummaries)
-> Lens
     ListAnomalyGroupSummaries
     ListAnomalyGroupSummaries
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnomalyGroupSummaries' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAnomalyGroupSummaries' :: ListAnomalyGroupSummaries -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAnomalyGroupSummaries
s@ListAnomalyGroupSummaries' {} Maybe Natural
a -> ListAnomalyGroupSummaries
s {$sel:maxResults:ListAnomalyGroupSummaries' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAnomalyGroupSummaries)

-- | The Amazon Resource Name (ARN) of the anomaly detector.
listAnomalyGroupSummaries_anomalyDetectorArn :: Lens.Lens' ListAnomalyGroupSummaries Prelude.Text
listAnomalyGroupSummaries_anomalyDetectorArn :: (Text -> f Text)
-> ListAnomalyGroupSummaries -> f ListAnomalyGroupSummaries
listAnomalyGroupSummaries_anomalyDetectorArn = (ListAnomalyGroupSummaries -> Text)
-> (ListAnomalyGroupSummaries -> Text -> ListAnomalyGroupSummaries)
-> Lens
     ListAnomalyGroupSummaries ListAnomalyGroupSummaries Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnomalyGroupSummaries' {Text
anomalyDetectorArn :: Text
$sel:anomalyDetectorArn:ListAnomalyGroupSummaries' :: ListAnomalyGroupSummaries -> Text
anomalyDetectorArn} -> Text
anomalyDetectorArn) (\s :: ListAnomalyGroupSummaries
s@ListAnomalyGroupSummaries' {} Text
a -> ListAnomalyGroupSummaries
s {$sel:anomalyDetectorArn:ListAnomalyGroupSummaries' :: Text
anomalyDetectorArn = Text
a} :: ListAnomalyGroupSummaries)

-- | The minimum severity score for inclusion in the output.
listAnomalyGroupSummaries_sensitivityThreshold :: Lens.Lens' ListAnomalyGroupSummaries Prelude.Natural
listAnomalyGroupSummaries_sensitivityThreshold :: (Natural -> f Natural)
-> ListAnomalyGroupSummaries -> f ListAnomalyGroupSummaries
listAnomalyGroupSummaries_sensitivityThreshold = (ListAnomalyGroupSummaries -> Natural)
-> (ListAnomalyGroupSummaries
    -> Natural -> ListAnomalyGroupSummaries)
-> Lens
     ListAnomalyGroupSummaries ListAnomalyGroupSummaries Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnomalyGroupSummaries' {Natural
sensitivityThreshold :: Natural
$sel:sensitivityThreshold:ListAnomalyGroupSummaries' :: ListAnomalyGroupSummaries -> Natural
sensitivityThreshold} -> Natural
sensitivityThreshold) (\s :: ListAnomalyGroupSummaries
s@ListAnomalyGroupSummaries' {} Natural
a -> ListAnomalyGroupSummaries
s {$sel:sensitivityThreshold:ListAnomalyGroupSummaries' :: Natural
sensitivityThreshold = Natural
a} :: ListAnomalyGroupSummaries)

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

instance Prelude.NFData ListAnomalyGroupSummaries

instance Core.ToHeaders ListAnomalyGroupSummaries where
  toHeaders :: ListAnomalyGroupSummaries -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListAnomalyGroupSummaries -> 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 ListAnomalyGroupSummaries where
  toJSON :: ListAnomalyGroupSummaries -> Value
toJSON ListAnomalyGroupSummaries' {Natural
Maybe Natural
Maybe Text
Text
sensitivityThreshold :: Natural
anomalyDetectorArn :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:sensitivityThreshold:ListAnomalyGroupSummaries' :: ListAnomalyGroupSummaries -> Natural
$sel:anomalyDetectorArn:ListAnomalyGroupSummaries' :: ListAnomalyGroupSummaries -> Text
$sel:maxResults:ListAnomalyGroupSummaries' :: ListAnomalyGroupSummaries -> Maybe Natural
$sel:nextToken:ListAnomalyGroupSummaries' :: ListAnomalyGroupSummaries -> 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
"AnomalyDetectorArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
anomalyDetectorArn),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"SensitivityThreshold"
                  Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
sensitivityThreshold
              )
          ]
      )

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

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

-- | /See:/ 'newListAnomalyGroupSummariesResponse' smart constructor.
data ListAnomalyGroupSummariesResponse = ListAnomalyGroupSummariesResponse'
  { -- | Aggregated details about the anomaly groups.
    ListAnomalyGroupSummariesResponse -> Maybe AnomalyGroupStatistics
anomalyGroupStatistics :: Prelude.Maybe AnomalyGroupStatistics,
    -- | The pagination token that\'s included if more results are available.
    ListAnomalyGroupSummariesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of anomaly group summaries.
    ListAnomalyGroupSummariesResponse -> Maybe [AnomalyGroupSummary]
anomalyGroupSummaryList :: Prelude.Maybe [AnomalyGroupSummary],
    -- | The response's http status code.
    ListAnomalyGroupSummariesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListAnomalyGroupSummariesResponse
-> ListAnomalyGroupSummariesResponse -> Bool
(ListAnomalyGroupSummariesResponse
 -> ListAnomalyGroupSummariesResponse -> Bool)
-> (ListAnomalyGroupSummariesResponse
    -> ListAnomalyGroupSummariesResponse -> Bool)
-> Eq ListAnomalyGroupSummariesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAnomalyGroupSummariesResponse
-> ListAnomalyGroupSummariesResponse -> Bool
$c/= :: ListAnomalyGroupSummariesResponse
-> ListAnomalyGroupSummariesResponse -> Bool
== :: ListAnomalyGroupSummariesResponse
-> ListAnomalyGroupSummariesResponse -> Bool
$c== :: ListAnomalyGroupSummariesResponse
-> ListAnomalyGroupSummariesResponse -> Bool
Prelude.Eq, ReadPrec [ListAnomalyGroupSummariesResponse]
ReadPrec ListAnomalyGroupSummariesResponse
Int -> ReadS ListAnomalyGroupSummariesResponse
ReadS [ListAnomalyGroupSummariesResponse]
(Int -> ReadS ListAnomalyGroupSummariesResponse)
-> ReadS [ListAnomalyGroupSummariesResponse]
-> ReadPrec ListAnomalyGroupSummariesResponse
-> ReadPrec [ListAnomalyGroupSummariesResponse]
-> Read ListAnomalyGroupSummariesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAnomalyGroupSummariesResponse]
$creadListPrec :: ReadPrec [ListAnomalyGroupSummariesResponse]
readPrec :: ReadPrec ListAnomalyGroupSummariesResponse
$creadPrec :: ReadPrec ListAnomalyGroupSummariesResponse
readList :: ReadS [ListAnomalyGroupSummariesResponse]
$creadList :: ReadS [ListAnomalyGroupSummariesResponse]
readsPrec :: Int -> ReadS ListAnomalyGroupSummariesResponse
$creadsPrec :: Int -> ReadS ListAnomalyGroupSummariesResponse
Prelude.Read, Int -> ListAnomalyGroupSummariesResponse -> ShowS
[ListAnomalyGroupSummariesResponse] -> ShowS
ListAnomalyGroupSummariesResponse -> String
(Int -> ListAnomalyGroupSummariesResponse -> ShowS)
-> (ListAnomalyGroupSummariesResponse -> String)
-> ([ListAnomalyGroupSummariesResponse] -> ShowS)
-> Show ListAnomalyGroupSummariesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAnomalyGroupSummariesResponse] -> ShowS
$cshowList :: [ListAnomalyGroupSummariesResponse] -> ShowS
show :: ListAnomalyGroupSummariesResponse -> String
$cshow :: ListAnomalyGroupSummariesResponse -> String
showsPrec :: Int -> ListAnomalyGroupSummariesResponse -> ShowS
$cshowsPrec :: Int -> ListAnomalyGroupSummariesResponse -> ShowS
Prelude.Show, (forall x.
 ListAnomalyGroupSummariesResponse
 -> Rep ListAnomalyGroupSummariesResponse x)
-> (forall x.
    Rep ListAnomalyGroupSummariesResponse x
    -> ListAnomalyGroupSummariesResponse)
-> Generic ListAnomalyGroupSummariesResponse
forall x.
Rep ListAnomalyGroupSummariesResponse x
-> ListAnomalyGroupSummariesResponse
forall x.
ListAnomalyGroupSummariesResponse
-> Rep ListAnomalyGroupSummariesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAnomalyGroupSummariesResponse x
-> ListAnomalyGroupSummariesResponse
$cfrom :: forall x.
ListAnomalyGroupSummariesResponse
-> Rep ListAnomalyGroupSummariesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListAnomalyGroupSummariesResponse' 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:
--
-- 'anomalyGroupStatistics', 'listAnomalyGroupSummariesResponse_anomalyGroupStatistics' - Aggregated details about the anomaly groups.
--
-- 'nextToken', 'listAnomalyGroupSummariesResponse_nextToken' - The pagination token that\'s included if more results are available.
--
-- 'anomalyGroupSummaryList', 'listAnomalyGroupSummariesResponse_anomalyGroupSummaryList' - A list of anomaly group summaries.
--
-- 'httpStatus', 'listAnomalyGroupSummariesResponse_httpStatus' - The response's http status code.
newListAnomalyGroupSummariesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListAnomalyGroupSummariesResponse
newListAnomalyGroupSummariesResponse :: Int -> ListAnomalyGroupSummariesResponse
newListAnomalyGroupSummariesResponse Int
pHttpStatus_ =
  ListAnomalyGroupSummariesResponse' :: Maybe AnomalyGroupStatistics
-> Maybe Text
-> Maybe [AnomalyGroupSummary]
-> Int
-> ListAnomalyGroupSummariesResponse
ListAnomalyGroupSummariesResponse'
    { $sel:anomalyGroupStatistics:ListAnomalyGroupSummariesResponse' :: Maybe AnomalyGroupStatistics
anomalyGroupStatistics =
        Maybe AnomalyGroupStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListAnomalyGroupSummariesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:anomalyGroupSummaryList:ListAnomalyGroupSummariesResponse' :: Maybe [AnomalyGroupSummary]
anomalyGroupSummaryList =
        Maybe [AnomalyGroupSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListAnomalyGroupSummariesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Aggregated details about the anomaly groups.
listAnomalyGroupSummariesResponse_anomalyGroupStatistics :: Lens.Lens' ListAnomalyGroupSummariesResponse (Prelude.Maybe AnomalyGroupStatistics)
listAnomalyGroupSummariesResponse_anomalyGroupStatistics :: (Maybe AnomalyGroupStatistics -> f (Maybe AnomalyGroupStatistics))
-> ListAnomalyGroupSummariesResponse
-> f ListAnomalyGroupSummariesResponse
listAnomalyGroupSummariesResponse_anomalyGroupStatistics = (ListAnomalyGroupSummariesResponse -> Maybe AnomalyGroupStatistics)
-> (ListAnomalyGroupSummariesResponse
    -> Maybe AnomalyGroupStatistics
    -> ListAnomalyGroupSummariesResponse)
-> Lens
     ListAnomalyGroupSummariesResponse
     ListAnomalyGroupSummariesResponse
     (Maybe AnomalyGroupStatistics)
     (Maybe AnomalyGroupStatistics)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnomalyGroupSummariesResponse' {Maybe AnomalyGroupStatistics
anomalyGroupStatistics :: Maybe AnomalyGroupStatistics
$sel:anomalyGroupStatistics:ListAnomalyGroupSummariesResponse' :: ListAnomalyGroupSummariesResponse -> Maybe AnomalyGroupStatistics
anomalyGroupStatistics} -> Maybe AnomalyGroupStatistics
anomalyGroupStatistics) (\s :: ListAnomalyGroupSummariesResponse
s@ListAnomalyGroupSummariesResponse' {} Maybe AnomalyGroupStatistics
a -> ListAnomalyGroupSummariesResponse
s {$sel:anomalyGroupStatistics:ListAnomalyGroupSummariesResponse' :: Maybe AnomalyGroupStatistics
anomalyGroupStatistics = Maybe AnomalyGroupStatistics
a} :: ListAnomalyGroupSummariesResponse)

-- | The pagination token that\'s included if more results are available.
listAnomalyGroupSummariesResponse_nextToken :: Lens.Lens' ListAnomalyGroupSummariesResponse (Prelude.Maybe Prelude.Text)
listAnomalyGroupSummariesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListAnomalyGroupSummariesResponse
-> f ListAnomalyGroupSummariesResponse
listAnomalyGroupSummariesResponse_nextToken = (ListAnomalyGroupSummariesResponse -> Maybe Text)
-> (ListAnomalyGroupSummariesResponse
    -> Maybe Text -> ListAnomalyGroupSummariesResponse)
-> Lens
     ListAnomalyGroupSummariesResponse
     ListAnomalyGroupSummariesResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnomalyGroupSummariesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAnomalyGroupSummariesResponse' :: ListAnomalyGroupSummariesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAnomalyGroupSummariesResponse
s@ListAnomalyGroupSummariesResponse' {} Maybe Text
a -> ListAnomalyGroupSummariesResponse
s {$sel:nextToken:ListAnomalyGroupSummariesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAnomalyGroupSummariesResponse)

-- | A list of anomaly group summaries.
listAnomalyGroupSummariesResponse_anomalyGroupSummaryList :: Lens.Lens' ListAnomalyGroupSummariesResponse (Prelude.Maybe [AnomalyGroupSummary])
listAnomalyGroupSummariesResponse_anomalyGroupSummaryList :: (Maybe [AnomalyGroupSummary] -> f (Maybe [AnomalyGroupSummary]))
-> ListAnomalyGroupSummariesResponse
-> f ListAnomalyGroupSummariesResponse
listAnomalyGroupSummariesResponse_anomalyGroupSummaryList = (ListAnomalyGroupSummariesResponse -> Maybe [AnomalyGroupSummary])
-> (ListAnomalyGroupSummariesResponse
    -> Maybe [AnomalyGroupSummary]
    -> ListAnomalyGroupSummariesResponse)
-> Lens
     ListAnomalyGroupSummariesResponse
     ListAnomalyGroupSummariesResponse
     (Maybe [AnomalyGroupSummary])
     (Maybe [AnomalyGroupSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAnomalyGroupSummariesResponse' {Maybe [AnomalyGroupSummary]
anomalyGroupSummaryList :: Maybe [AnomalyGroupSummary]
$sel:anomalyGroupSummaryList:ListAnomalyGroupSummariesResponse' :: ListAnomalyGroupSummariesResponse -> Maybe [AnomalyGroupSummary]
anomalyGroupSummaryList} -> Maybe [AnomalyGroupSummary]
anomalyGroupSummaryList) (\s :: ListAnomalyGroupSummariesResponse
s@ListAnomalyGroupSummariesResponse' {} Maybe [AnomalyGroupSummary]
a -> ListAnomalyGroupSummariesResponse
s {$sel:anomalyGroupSummaryList:ListAnomalyGroupSummariesResponse' :: Maybe [AnomalyGroupSummary]
anomalyGroupSummaryList = Maybe [AnomalyGroupSummary]
a} :: ListAnomalyGroupSummariesResponse) ((Maybe [AnomalyGroupSummary] -> f (Maybe [AnomalyGroupSummary]))
 -> ListAnomalyGroupSummariesResponse
 -> f ListAnomalyGroupSummariesResponse)
-> ((Maybe [AnomalyGroupSummary]
     -> f (Maybe [AnomalyGroupSummary]))
    -> Maybe [AnomalyGroupSummary] -> f (Maybe [AnomalyGroupSummary]))
-> (Maybe [AnomalyGroupSummary] -> f (Maybe [AnomalyGroupSummary]))
-> ListAnomalyGroupSummariesResponse
-> f ListAnomalyGroupSummariesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [AnomalyGroupSummary]
  [AnomalyGroupSummary]
  [AnomalyGroupSummary]
  [AnomalyGroupSummary]
-> Iso
     (Maybe [AnomalyGroupSummary])
     (Maybe [AnomalyGroupSummary])
     (Maybe [AnomalyGroupSummary])
     (Maybe [AnomalyGroupSummary])
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
  [AnomalyGroupSummary]
  [AnomalyGroupSummary]
  [AnomalyGroupSummary]
  [AnomalyGroupSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListAnomalyGroupSummariesResponse