{-# 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.CostExplorer.GetAnomalyMonitors
-- 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)
--
-- Retrieves the cost anomaly monitor definitions for your account. You can
-- filter using a list of cost anomaly monitor Amazon Resource Names
-- (ARNs).
module Amazonka.CostExplorer.GetAnomalyMonitors
  ( -- * Creating a Request
    GetAnomalyMonitors (..),
    newGetAnomalyMonitors,

    -- * Request Lenses
    getAnomalyMonitors_nextPageToken,
    getAnomalyMonitors_monitorArnList,
    getAnomalyMonitors_maxResults,

    -- * Destructuring the Response
    GetAnomalyMonitorsResponse (..),
    newGetAnomalyMonitorsResponse,

    -- * Response Lenses
    getAnomalyMonitorsResponse_nextPageToken,
    getAnomalyMonitorsResponse_httpStatus,
    getAnomalyMonitorsResponse_anomalyMonitors,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.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:/ 'newGetAnomalyMonitors' smart constructor.
data GetAnomalyMonitors = GetAnomalyMonitors'
  { -- | The token to retrieve the next set of results. Amazon Web Services
    -- provides the token when the response from a previous call has more
    -- results than the maximum page size.
    GetAnomalyMonitors -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | A list of cost anomaly monitor ARNs.
    GetAnomalyMonitors -> Maybe [Text]
monitorArnList :: Prelude.Maybe [Prelude.Text],
    -- | The number of entries that a paginated response contains.
    GetAnomalyMonitors -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int
  }
  deriving (GetAnomalyMonitors -> GetAnomalyMonitors -> Bool
(GetAnomalyMonitors -> GetAnomalyMonitors -> Bool)
-> (GetAnomalyMonitors -> GetAnomalyMonitors -> Bool)
-> Eq GetAnomalyMonitors
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAnomalyMonitors -> GetAnomalyMonitors -> Bool
$c/= :: GetAnomalyMonitors -> GetAnomalyMonitors -> Bool
== :: GetAnomalyMonitors -> GetAnomalyMonitors -> Bool
$c== :: GetAnomalyMonitors -> GetAnomalyMonitors -> Bool
Prelude.Eq, ReadPrec [GetAnomalyMonitors]
ReadPrec GetAnomalyMonitors
Int -> ReadS GetAnomalyMonitors
ReadS [GetAnomalyMonitors]
(Int -> ReadS GetAnomalyMonitors)
-> ReadS [GetAnomalyMonitors]
-> ReadPrec GetAnomalyMonitors
-> ReadPrec [GetAnomalyMonitors]
-> Read GetAnomalyMonitors
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAnomalyMonitors]
$creadListPrec :: ReadPrec [GetAnomalyMonitors]
readPrec :: ReadPrec GetAnomalyMonitors
$creadPrec :: ReadPrec GetAnomalyMonitors
readList :: ReadS [GetAnomalyMonitors]
$creadList :: ReadS [GetAnomalyMonitors]
readsPrec :: Int -> ReadS GetAnomalyMonitors
$creadsPrec :: Int -> ReadS GetAnomalyMonitors
Prelude.Read, Int -> GetAnomalyMonitors -> ShowS
[GetAnomalyMonitors] -> ShowS
GetAnomalyMonitors -> String
(Int -> GetAnomalyMonitors -> ShowS)
-> (GetAnomalyMonitors -> String)
-> ([GetAnomalyMonitors] -> ShowS)
-> Show GetAnomalyMonitors
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAnomalyMonitors] -> ShowS
$cshowList :: [GetAnomalyMonitors] -> ShowS
show :: GetAnomalyMonitors -> String
$cshow :: GetAnomalyMonitors -> String
showsPrec :: Int -> GetAnomalyMonitors -> ShowS
$cshowsPrec :: Int -> GetAnomalyMonitors -> ShowS
Prelude.Show, (forall x. GetAnomalyMonitors -> Rep GetAnomalyMonitors x)
-> (forall x. Rep GetAnomalyMonitors x -> GetAnomalyMonitors)
-> Generic GetAnomalyMonitors
forall x. Rep GetAnomalyMonitors x -> GetAnomalyMonitors
forall x. GetAnomalyMonitors -> Rep GetAnomalyMonitors x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAnomalyMonitors x -> GetAnomalyMonitors
$cfrom :: forall x. GetAnomalyMonitors -> Rep GetAnomalyMonitors x
Prelude.Generic)

-- |
-- Create a value of 'GetAnomalyMonitors' 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:
--
-- 'nextPageToken', 'getAnomalyMonitors_nextPageToken' - The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
--
-- 'monitorArnList', 'getAnomalyMonitors_monitorArnList' - A list of cost anomaly monitor ARNs.
--
-- 'maxResults', 'getAnomalyMonitors_maxResults' - The number of entries that a paginated response contains.
newGetAnomalyMonitors ::
  GetAnomalyMonitors
newGetAnomalyMonitors :: GetAnomalyMonitors
newGetAnomalyMonitors =
  GetAnomalyMonitors' :: Maybe Text -> Maybe [Text] -> Maybe Int -> GetAnomalyMonitors
GetAnomalyMonitors'
    { $sel:nextPageToken:GetAnomalyMonitors' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:monitorArnList:GetAnomalyMonitors' :: Maybe [Text]
monitorArnList = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetAnomalyMonitors' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
getAnomalyMonitors_nextPageToken :: Lens.Lens' GetAnomalyMonitors (Prelude.Maybe Prelude.Text)
getAnomalyMonitors_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetAnomalyMonitors -> f GetAnomalyMonitors
getAnomalyMonitors_nextPageToken = (GetAnomalyMonitors -> Maybe Text)
-> (GetAnomalyMonitors -> Maybe Text -> GetAnomalyMonitors)
-> Lens
     GetAnomalyMonitors GetAnomalyMonitors (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalyMonitors' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetAnomalyMonitors' :: GetAnomalyMonitors -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetAnomalyMonitors
s@GetAnomalyMonitors' {} Maybe Text
a -> GetAnomalyMonitors
s {$sel:nextPageToken:GetAnomalyMonitors' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetAnomalyMonitors)

-- | A list of cost anomaly monitor ARNs.
getAnomalyMonitors_monitorArnList :: Lens.Lens' GetAnomalyMonitors (Prelude.Maybe [Prelude.Text])
getAnomalyMonitors_monitorArnList :: (Maybe [Text] -> f (Maybe [Text]))
-> GetAnomalyMonitors -> f GetAnomalyMonitors
getAnomalyMonitors_monitorArnList = (GetAnomalyMonitors -> Maybe [Text])
-> (GetAnomalyMonitors -> Maybe [Text] -> GetAnomalyMonitors)
-> Lens
     GetAnomalyMonitors GetAnomalyMonitors (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalyMonitors' {Maybe [Text]
monitorArnList :: Maybe [Text]
$sel:monitorArnList:GetAnomalyMonitors' :: GetAnomalyMonitors -> Maybe [Text]
monitorArnList} -> Maybe [Text]
monitorArnList) (\s :: GetAnomalyMonitors
s@GetAnomalyMonitors' {} Maybe [Text]
a -> GetAnomalyMonitors
s {$sel:monitorArnList:GetAnomalyMonitors' :: Maybe [Text]
monitorArnList = Maybe [Text]
a} :: GetAnomalyMonitors) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetAnomalyMonitors -> f GetAnomalyMonitors)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetAnomalyMonitors
-> f GetAnomalyMonitors
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The number of entries that a paginated response contains.
getAnomalyMonitors_maxResults :: Lens.Lens' GetAnomalyMonitors (Prelude.Maybe Prelude.Int)
getAnomalyMonitors_maxResults :: (Maybe Int -> f (Maybe Int))
-> GetAnomalyMonitors -> f GetAnomalyMonitors
getAnomalyMonitors_maxResults = (GetAnomalyMonitors -> Maybe Int)
-> (GetAnomalyMonitors -> Maybe Int -> GetAnomalyMonitors)
-> Lens
     GetAnomalyMonitors GetAnomalyMonitors (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalyMonitors' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:GetAnomalyMonitors' :: GetAnomalyMonitors -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: GetAnomalyMonitors
s@GetAnomalyMonitors' {} Maybe Int
a -> GetAnomalyMonitors
s {$sel:maxResults:GetAnomalyMonitors' :: Maybe Int
maxResults = Maybe Int
a} :: GetAnomalyMonitors)

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

instance Prelude.Hashable GetAnomalyMonitors

instance Prelude.NFData GetAnomalyMonitors

instance Core.ToHeaders GetAnomalyMonitors where
  toHeaders :: GetAnomalyMonitors -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAnomalyMonitors -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSInsightsIndexService.GetAnomalyMonitors" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetAnomalyMonitors where
  toJSON :: GetAnomalyMonitors -> Value
toJSON GetAnomalyMonitors' {Maybe Int
Maybe [Text]
Maybe Text
maxResults :: Maybe Int
monitorArnList :: Maybe [Text]
nextPageToken :: Maybe Text
$sel:maxResults:GetAnomalyMonitors' :: GetAnomalyMonitors -> Maybe Int
$sel:monitorArnList:GetAnomalyMonitors' :: GetAnomalyMonitors -> Maybe [Text]
$sel:nextPageToken:GetAnomalyMonitors' :: GetAnomalyMonitors -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"NextPageToken" 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
nextPageToken,
            (Text
"MonitorArnList" 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]
monitorArnList,
            (Text
"MaxResults" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults
          ]
      )

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

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

-- | /See:/ 'newGetAnomalyMonitorsResponse' smart constructor.
data GetAnomalyMonitorsResponse = GetAnomalyMonitorsResponse'
  { -- | The token to retrieve the next set of results. Amazon Web Services
    -- provides the token when the response from a previous call has more
    -- results than the maximum page size.
    GetAnomalyMonitorsResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetAnomalyMonitorsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of cost anomaly monitors that includes the detailed metadata for
    -- each monitor.
    GetAnomalyMonitorsResponse -> [AnomalyMonitor]
anomalyMonitors :: [AnomalyMonitor]
  }
  deriving (GetAnomalyMonitorsResponse -> GetAnomalyMonitorsResponse -> Bool
(GetAnomalyMonitorsResponse -> GetAnomalyMonitorsResponse -> Bool)
-> (GetAnomalyMonitorsResponse
    -> GetAnomalyMonitorsResponse -> Bool)
-> Eq GetAnomalyMonitorsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAnomalyMonitorsResponse -> GetAnomalyMonitorsResponse -> Bool
$c/= :: GetAnomalyMonitorsResponse -> GetAnomalyMonitorsResponse -> Bool
== :: GetAnomalyMonitorsResponse -> GetAnomalyMonitorsResponse -> Bool
$c== :: GetAnomalyMonitorsResponse -> GetAnomalyMonitorsResponse -> Bool
Prelude.Eq, ReadPrec [GetAnomalyMonitorsResponse]
ReadPrec GetAnomalyMonitorsResponse
Int -> ReadS GetAnomalyMonitorsResponse
ReadS [GetAnomalyMonitorsResponse]
(Int -> ReadS GetAnomalyMonitorsResponse)
-> ReadS [GetAnomalyMonitorsResponse]
-> ReadPrec GetAnomalyMonitorsResponse
-> ReadPrec [GetAnomalyMonitorsResponse]
-> Read GetAnomalyMonitorsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAnomalyMonitorsResponse]
$creadListPrec :: ReadPrec [GetAnomalyMonitorsResponse]
readPrec :: ReadPrec GetAnomalyMonitorsResponse
$creadPrec :: ReadPrec GetAnomalyMonitorsResponse
readList :: ReadS [GetAnomalyMonitorsResponse]
$creadList :: ReadS [GetAnomalyMonitorsResponse]
readsPrec :: Int -> ReadS GetAnomalyMonitorsResponse
$creadsPrec :: Int -> ReadS GetAnomalyMonitorsResponse
Prelude.Read, Int -> GetAnomalyMonitorsResponse -> ShowS
[GetAnomalyMonitorsResponse] -> ShowS
GetAnomalyMonitorsResponse -> String
(Int -> GetAnomalyMonitorsResponse -> ShowS)
-> (GetAnomalyMonitorsResponse -> String)
-> ([GetAnomalyMonitorsResponse] -> ShowS)
-> Show GetAnomalyMonitorsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAnomalyMonitorsResponse] -> ShowS
$cshowList :: [GetAnomalyMonitorsResponse] -> ShowS
show :: GetAnomalyMonitorsResponse -> String
$cshow :: GetAnomalyMonitorsResponse -> String
showsPrec :: Int -> GetAnomalyMonitorsResponse -> ShowS
$cshowsPrec :: Int -> GetAnomalyMonitorsResponse -> ShowS
Prelude.Show, (forall x.
 GetAnomalyMonitorsResponse -> Rep GetAnomalyMonitorsResponse x)
-> (forall x.
    Rep GetAnomalyMonitorsResponse x -> GetAnomalyMonitorsResponse)
-> Generic GetAnomalyMonitorsResponse
forall x.
Rep GetAnomalyMonitorsResponse x -> GetAnomalyMonitorsResponse
forall x.
GetAnomalyMonitorsResponse -> Rep GetAnomalyMonitorsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAnomalyMonitorsResponse x -> GetAnomalyMonitorsResponse
$cfrom :: forall x.
GetAnomalyMonitorsResponse -> Rep GetAnomalyMonitorsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAnomalyMonitorsResponse' 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:
--
-- 'nextPageToken', 'getAnomalyMonitorsResponse_nextPageToken' - The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
--
-- 'httpStatus', 'getAnomalyMonitorsResponse_httpStatus' - The response's http status code.
--
-- 'anomalyMonitors', 'getAnomalyMonitorsResponse_anomalyMonitors' - A list of cost anomaly monitors that includes the detailed metadata for
-- each monitor.
newGetAnomalyMonitorsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAnomalyMonitorsResponse
newGetAnomalyMonitorsResponse :: Int -> GetAnomalyMonitorsResponse
newGetAnomalyMonitorsResponse Int
pHttpStatus_ =
  GetAnomalyMonitorsResponse' :: Maybe Text -> Int -> [AnomalyMonitor] -> GetAnomalyMonitorsResponse
GetAnomalyMonitorsResponse'
    { $sel:nextPageToken:GetAnomalyMonitorsResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAnomalyMonitorsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:anomalyMonitors:GetAnomalyMonitorsResponse' :: [AnomalyMonitor]
anomalyMonitors = [AnomalyMonitor]
forall a. Monoid a => a
Prelude.mempty
    }

-- | The token to retrieve the next set of results. Amazon Web Services
-- provides the token when the response from a previous call has more
-- results than the maximum page size.
getAnomalyMonitorsResponse_nextPageToken :: Lens.Lens' GetAnomalyMonitorsResponse (Prelude.Maybe Prelude.Text)
getAnomalyMonitorsResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetAnomalyMonitorsResponse -> f GetAnomalyMonitorsResponse
getAnomalyMonitorsResponse_nextPageToken = (GetAnomalyMonitorsResponse -> Maybe Text)
-> (GetAnomalyMonitorsResponse
    -> Maybe Text -> GetAnomalyMonitorsResponse)
-> Lens
     GetAnomalyMonitorsResponse
     GetAnomalyMonitorsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalyMonitorsResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetAnomalyMonitorsResponse' :: GetAnomalyMonitorsResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetAnomalyMonitorsResponse
s@GetAnomalyMonitorsResponse' {} Maybe Text
a -> GetAnomalyMonitorsResponse
s {$sel:nextPageToken:GetAnomalyMonitorsResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetAnomalyMonitorsResponse)

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

-- | A list of cost anomaly monitors that includes the detailed metadata for
-- each monitor.
getAnomalyMonitorsResponse_anomalyMonitors :: Lens.Lens' GetAnomalyMonitorsResponse [AnomalyMonitor]
getAnomalyMonitorsResponse_anomalyMonitors :: ([AnomalyMonitor] -> f [AnomalyMonitor])
-> GetAnomalyMonitorsResponse -> f GetAnomalyMonitorsResponse
getAnomalyMonitorsResponse_anomalyMonitors = (GetAnomalyMonitorsResponse -> [AnomalyMonitor])
-> (GetAnomalyMonitorsResponse
    -> [AnomalyMonitor] -> GetAnomalyMonitorsResponse)
-> Lens
     GetAnomalyMonitorsResponse
     GetAnomalyMonitorsResponse
     [AnomalyMonitor]
     [AnomalyMonitor]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalyMonitorsResponse' {[AnomalyMonitor]
anomalyMonitors :: [AnomalyMonitor]
$sel:anomalyMonitors:GetAnomalyMonitorsResponse' :: GetAnomalyMonitorsResponse -> [AnomalyMonitor]
anomalyMonitors} -> [AnomalyMonitor]
anomalyMonitors) (\s :: GetAnomalyMonitorsResponse
s@GetAnomalyMonitorsResponse' {} [AnomalyMonitor]
a -> GetAnomalyMonitorsResponse
s {$sel:anomalyMonitors:GetAnomalyMonitorsResponse' :: [AnomalyMonitor]
anomalyMonitors = [AnomalyMonitor]
a} :: GetAnomalyMonitorsResponse) (([AnomalyMonitor] -> f [AnomalyMonitor])
 -> GetAnomalyMonitorsResponse -> f GetAnomalyMonitorsResponse)
-> (([AnomalyMonitor] -> f [AnomalyMonitor])
    -> [AnomalyMonitor] -> f [AnomalyMonitor])
-> ([AnomalyMonitor] -> f [AnomalyMonitor])
-> GetAnomalyMonitorsResponse
-> f GetAnomalyMonitorsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AnomalyMonitor] -> f [AnomalyMonitor])
-> [AnomalyMonitor] -> f [AnomalyMonitor]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData GetAnomalyMonitorsResponse