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

    -- * Request Lenses
    getAnomalySubscriptions_subscriptionArnList,
    getAnomalySubscriptions_nextPageToken,
    getAnomalySubscriptions_maxResults,
    getAnomalySubscriptions_monitorArn,

    -- * Destructuring the Response
    GetAnomalySubscriptionsResponse (..),
    newGetAnomalySubscriptionsResponse,

    -- * Response Lenses
    getAnomalySubscriptionsResponse_nextPageToken,
    getAnomalySubscriptionsResponse_httpStatus,
    getAnomalySubscriptionsResponse_anomalySubscriptions,
  )
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:/ 'newGetAnomalySubscriptions' smart constructor.
data GetAnomalySubscriptions = GetAnomalySubscriptions'
  { -- | A list of cost anomaly subscription ARNs.
    GetAnomalySubscriptions -> Maybe [Text]
subscriptionArnList :: Prelude.Maybe [Prelude.Text],
    -- | 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.
    GetAnomalySubscriptions -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | The number of entries a paginated response contains.
    GetAnomalySubscriptions -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | Cost anomaly monitor ARNs.
    GetAnomalySubscriptions -> Maybe Text
monitorArn :: Prelude.Maybe Prelude.Text
  }
  deriving (GetAnomalySubscriptions -> GetAnomalySubscriptions -> Bool
(GetAnomalySubscriptions -> GetAnomalySubscriptions -> Bool)
-> (GetAnomalySubscriptions -> GetAnomalySubscriptions -> Bool)
-> Eq GetAnomalySubscriptions
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAnomalySubscriptions -> GetAnomalySubscriptions -> Bool
$c/= :: GetAnomalySubscriptions -> GetAnomalySubscriptions -> Bool
== :: GetAnomalySubscriptions -> GetAnomalySubscriptions -> Bool
$c== :: GetAnomalySubscriptions -> GetAnomalySubscriptions -> Bool
Prelude.Eq, ReadPrec [GetAnomalySubscriptions]
ReadPrec GetAnomalySubscriptions
Int -> ReadS GetAnomalySubscriptions
ReadS [GetAnomalySubscriptions]
(Int -> ReadS GetAnomalySubscriptions)
-> ReadS [GetAnomalySubscriptions]
-> ReadPrec GetAnomalySubscriptions
-> ReadPrec [GetAnomalySubscriptions]
-> Read GetAnomalySubscriptions
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAnomalySubscriptions]
$creadListPrec :: ReadPrec [GetAnomalySubscriptions]
readPrec :: ReadPrec GetAnomalySubscriptions
$creadPrec :: ReadPrec GetAnomalySubscriptions
readList :: ReadS [GetAnomalySubscriptions]
$creadList :: ReadS [GetAnomalySubscriptions]
readsPrec :: Int -> ReadS GetAnomalySubscriptions
$creadsPrec :: Int -> ReadS GetAnomalySubscriptions
Prelude.Read, Int -> GetAnomalySubscriptions -> ShowS
[GetAnomalySubscriptions] -> ShowS
GetAnomalySubscriptions -> String
(Int -> GetAnomalySubscriptions -> ShowS)
-> (GetAnomalySubscriptions -> String)
-> ([GetAnomalySubscriptions] -> ShowS)
-> Show GetAnomalySubscriptions
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAnomalySubscriptions] -> ShowS
$cshowList :: [GetAnomalySubscriptions] -> ShowS
show :: GetAnomalySubscriptions -> String
$cshow :: GetAnomalySubscriptions -> String
showsPrec :: Int -> GetAnomalySubscriptions -> ShowS
$cshowsPrec :: Int -> GetAnomalySubscriptions -> ShowS
Prelude.Show, (forall x.
 GetAnomalySubscriptions -> Rep GetAnomalySubscriptions x)
-> (forall x.
    Rep GetAnomalySubscriptions x -> GetAnomalySubscriptions)
-> Generic GetAnomalySubscriptions
forall x. Rep GetAnomalySubscriptions x -> GetAnomalySubscriptions
forall x. GetAnomalySubscriptions -> Rep GetAnomalySubscriptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetAnomalySubscriptions x -> GetAnomalySubscriptions
$cfrom :: forall x. GetAnomalySubscriptions -> Rep GetAnomalySubscriptions x
Prelude.Generic)

-- |
-- Create a value of 'GetAnomalySubscriptions' 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:
--
-- 'subscriptionArnList', 'getAnomalySubscriptions_subscriptionArnList' - A list of cost anomaly subscription ARNs.
--
-- 'nextPageToken', 'getAnomalySubscriptions_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.
--
-- 'maxResults', 'getAnomalySubscriptions_maxResults' - The number of entries a paginated response contains.
--
-- 'monitorArn', 'getAnomalySubscriptions_monitorArn' - Cost anomaly monitor ARNs.
newGetAnomalySubscriptions ::
  GetAnomalySubscriptions
newGetAnomalySubscriptions :: GetAnomalySubscriptions
newGetAnomalySubscriptions =
  GetAnomalySubscriptions' :: Maybe [Text]
-> Maybe Text -> Maybe Int -> Maybe Text -> GetAnomalySubscriptions
GetAnomalySubscriptions'
    { $sel:subscriptionArnList:GetAnomalySubscriptions' :: Maybe [Text]
subscriptionArnList =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextPageToken:GetAnomalySubscriptions' :: Maybe Text
nextPageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetAnomalySubscriptions' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:monitorArn:GetAnomalySubscriptions' :: Maybe Text
monitorArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | A list of cost anomaly subscription ARNs.
getAnomalySubscriptions_subscriptionArnList :: Lens.Lens' GetAnomalySubscriptions (Prelude.Maybe [Prelude.Text])
getAnomalySubscriptions_subscriptionArnList :: (Maybe [Text] -> f (Maybe [Text]))
-> GetAnomalySubscriptions -> f GetAnomalySubscriptions
getAnomalySubscriptions_subscriptionArnList = (GetAnomalySubscriptions -> Maybe [Text])
-> (GetAnomalySubscriptions
    -> Maybe [Text] -> GetAnomalySubscriptions)
-> Lens
     GetAnomalySubscriptions
     GetAnomalySubscriptions
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalySubscriptions' {Maybe [Text]
subscriptionArnList :: Maybe [Text]
$sel:subscriptionArnList:GetAnomalySubscriptions' :: GetAnomalySubscriptions -> Maybe [Text]
subscriptionArnList} -> Maybe [Text]
subscriptionArnList) (\s :: GetAnomalySubscriptions
s@GetAnomalySubscriptions' {} Maybe [Text]
a -> GetAnomalySubscriptions
s {$sel:subscriptionArnList:GetAnomalySubscriptions' :: Maybe [Text]
subscriptionArnList = Maybe [Text]
a} :: GetAnomalySubscriptions) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetAnomalySubscriptions -> f GetAnomalySubscriptions)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetAnomalySubscriptions
-> f GetAnomalySubscriptions
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 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.
getAnomalySubscriptions_nextPageToken :: Lens.Lens' GetAnomalySubscriptions (Prelude.Maybe Prelude.Text)
getAnomalySubscriptions_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetAnomalySubscriptions -> f GetAnomalySubscriptions
getAnomalySubscriptions_nextPageToken = (GetAnomalySubscriptions -> Maybe Text)
-> (GetAnomalySubscriptions
    -> Maybe Text -> GetAnomalySubscriptions)
-> Lens
     GetAnomalySubscriptions
     GetAnomalySubscriptions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalySubscriptions' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetAnomalySubscriptions' :: GetAnomalySubscriptions -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetAnomalySubscriptions
s@GetAnomalySubscriptions' {} Maybe Text
a -> GetAnomalySubscriptions
s {$sel:nextPageToken:GetAnomalySubscriptions' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetAnomalySubscriptions)

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

-- | Cost anomaly monitor ARNs.
getAnomalySubscriptions_monitorArn :: Lens.Lens' GetAnomalySubscriptions (Prelude.Maybe Prelude.Text)
getAnomalySubscriptions_monitorArn :: (Maybe Text -> f (Maybe Text))
-> GetAnomalySubscriptions -> f GetAnomalySubscriptions
getAnomalySubscriptions_monitorArn = (GetAnomalySubscriptions -> Maybe Text)
-> (GetAnomalySubscriptions
    -> Maybe Text -> GetAnomalySubscriptions)
-> Lens
     GetAnomalySubscriptions
     GetAnomalySubscriptions
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalySubscriptions' {Maybe Text
monitorArn :: Maybe Text
$sel:monitorArn:GetAnomalySubscriptions' :: GetAnomalySubscriptions -> Maybe Text
monitorArn} -> Maybe Text
monitorArn) (\s :: GetAnomalySubscriptions
s@GetAnomalySubscriptions' {} Maybe Text
a -> GetAnomalySubscriptions
s {$sel:monitorArn:GetAnomalySubscriptions' :: Maybe Text
monitorArn = Maybe Text
a} :: GetAnomalySubscriptions)

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

instance Prelude.Hashable GetAnomalySubscriptions

instance Prelude.NFData GetAnomalySubscriptions

instance Core.ToHeaders GetAnomalySubscriptions where
  toHeaders :: GetAnomalySubscriptions -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetAnomalySubscriptions -> 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.GetAnomalySubscriptions" ::
                          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 GetAnomalySubscriptions where
  toJSON :: GetAnomalySubscriptions -> Value
toJSON GetAnomalySubscriptions' {Maybe Int
Maybe [Text]
Maybe Text
monitorArn :: Maybe Text
maxResults :: Maybe Int
nextPageToken :: Maybe Text
subscriptionArnList :: Maybe [Text]
$sel:monitorArn:GetAnomalySubscriptions' :: GetAnomalySubscriptions -> Maybe Text
$sel:maxResults:GetAnomalySubscriptions' :: GetAnomalySubscriptions -> Maybe Int
$sel:nextPageToken:GetAnomalySubscriptions' :: GetAnomalySubscriptions -> Maybe Text
$sel:subscriptionArnList:GetAnomalySubscriptions' :: GetAnomalySubscriptions -> Maybe [Text]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SubscriptionArnList" 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]
subscriptionArnList,
            (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
"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,
            (Text
"MonitorArn" 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
monitorArn
          ]
      )

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

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

-- | /See:/ 'newGetAnomalySubscriptionsResponse' smart constructor.
data GetAnomalySubscriptionsResponse = GetAnomalySubscriptionsResponse'
  { -- | 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.
    GetAnomalySubscriptionsResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetAnomalySubscriptionsResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of cost anomaly subscriptions that includes the detailed metadata
    -- for each one.
    GetAnomalySubscriptionsResponse -> [AnomalySubscription]
anomalySubscriptions :: [AnomalySubscription]
  }
  deriving (GetAnomalySubscriptionsResponse
-> GetAnomalySubscriptionsResponse -> Bool
(GetAnomalySubscriptionsResponse
 -> GetAnomalySubscriptionsResponse -> Bool)
-> (GetAnomalySubscriptionsResponse
    -> GetAnomalySubscriptionsResponse -> Bool)
-> Eq GetAnomalySubscriptionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetAnomalySubscriptionsResponse
-> GetAnomalySubscriptionsResponse -> Bool
$c/= :: GetAnomalySubscriptionsResponse
-> GetAnomalySubscriptionsResponse -> Bool
== :: GetAnomalySubscriptionsResponse
-> GetAnomalySubscriptionsResponse -> Bool
$c== :: GetAnomalySubscriptionsResponse
-> GetAnomalySubscriptionsResponse -> Bool
Prelude.Eq, ReadPrec [GetAnomalySubscriptionsResponse]
ReadPrec GetAnomalySubscriptionsResponse
Int -> ReadS GetAnomalySubscriptionsResponse
ReadS [GetAnomalySubscriptionsResponse]
(Int -> ReadS GetAnomalySubscriptionsResponse)
-> ReadS [GetAnomalySubscriptionsResponse]
-> ReadPrec GetAnomalySubscriptionsResponse
-> ReadPrec [GetAnomalySubscriptionsResponse]
-> Read GetAnomalySubscriptionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetAnomalySubscriptionsResponse]
$creadListPrec :: ReadPrec [GetAnomalySubscriptionsResponse]
readPrec :: ReadPrec GetAnomalySubscriptionsResponse
$creadPrec :: ReadPrec GetAnomalySubscriptionsResponse
readList :: ReadS [GetAnomalySubscriptionsResponse]
$creadList :: ReadS [GetAnomalySubscriptionsResponse]
readsPrec :: Int -> ReadS GetAnomalySubscriptionsResponse
$creadsPrec :: Int -> ReadS GetAnomalySubscriptionsResponse
Prelude.Read, Int -> GetAnomalySubscriptionsResponse -> ShowS
[GetAnomalySubscriptionsResponse] -> ShowS
GetAnomalySubscriptionsResponse -> String
(Int -> GetAnomalySubscriptionsResponse -> ShowS)
-> (GetAnomalySubscriptionsResponse -> String)
-> ([GetAnomalySubscriptionsResponse] -> ShowS)
-> Show GetAnomalySubscriptionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetAnomalySubscriptionsResponse] -> ShowS
$cshowList :: [GetAnomalySubscriptionsResponse] -> ShowS
show :: GetAnomalySubscriptionsResponse -> String
$cshow :: GetAnomalySubscriptionsResponse -> String
showsPrec :: Int -> GetAnomalySubscriptionsResponse -> ShowS
$cshowsPrec :: Int -> GetAnomalySubscriptionsResponse -> ShowS
Prelude.Show, (forall x.
 GetAnomalySubscriptionsResponse
 -> Rep GetAnomalySubscriptionsResponse x)
-> (forall x.
    Rep GetAnomalySubscriptionsResponse x
    -> GetAnomalySubscriptionsResponse)
-> Generic GetAnomalySubscriptionsResponse
forall x.
Rep GetAnomalySubscriptionsResponse x
-> GetAnomalySubscriptionsResponse
forall x.
GetAnomalySubscriptionsResponse
-> Rep GetAnomalySubscriptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetAnomalySubscriptionsResponse x
-> GetAnomalySubscriptionsResponse
$cfrom :: forall x.
GetAnomalySubscriptionsResponse
-> Rep GetAnomalySubscriptionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetAnomalySubscriptionsResponse' 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', 'getAnomalySubscriptionsResponse_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', 'getAnomalySubscriptionsResponse_httpStatus' - The response's http status code.
--
-- 'anomalySubscriptions', 'getAnomalySubscriptionsResponse_anomalySubscriptions' - A list of cost anomaly subscriptions that includes the detailed metadata
-- for each one.
newGetAnomalySubscriptionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetAnomalySubscriptionsResponse
newGetAnomalySubscriptionsResponse :: Int -> GetAnomalySubscriptionsResponse
newGetAnomalySubscriptionsResponse Int
pHttpStatus_ =
  GetAnomalySubscriptionsResponse' :: Maybe Text
-> Int -> [AnomalySubscription] -> GetAnomalySubscriptionsResponse
GetAnomalySubscriptionsResponse'
    { $sel:nextPageToken:GetAnomalySubscriptionsResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetAnomalySubscriptionsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:anomalySubscriptions:GetAnomalySubscriptionsResponse' :: [AnomalySubscription]
anomalySubscriptions = [AnomalySubscription]
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.
getAnomalySubscriptionsResponse_nextPageToken :: Lens.Lens' GetAnomalySubscriptionsResponse (Prelude.Maybe Prelude.Text)
getAnomalySubscriptionsResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> GetAnomalySubscriptionsResponse
-> f GetAnomalySubscriptionsResponse
getAnomalySubscriptionsResponse_nextPageToken = (GetAnomalySubscriptionsResponse -> Maybe Text)
-> (GetAnomalySubscriptionsResponse
    -> Maybe Text -> GetAnomalySubscriptionsResponse)
-> Lens
     GetAnomalySubscriptionsResponse
     GetAnomalySubscriptionsResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalySubscriptionsResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:GetAnomalySubscriptionsResponse' :: GetAnomalySubscriptionsResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: GetAnomalySubscriptionsResponse
s@GetAnomalySubscriptionsResponse' {} Maybe Text
a -> GetAnomalySubscriptionsResponse
s {$sel:nextPageToken:GetAnomalySubscriptionsResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: GetAnomalySubscriptionsResponse)

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

-- | A list of cost anomaly subscriptions that includes the detailed metadata
-- for each one.
getAnomalySubscriptionsResponse_anomalySubscriptions :: Lens.Lens' GetAnomalySubscriptionsResponse [AnomalySubscription]
getAnomalySubscriptionsResponse_anomalySubscriptions :: ([AnomalySubscription] -> f [AnomalySubscription])
-> GetAnomalySubscriptionsResponse
-> f GetAnomalySubscriptionsResponse
getAnomalySubscriptionsResponse_anomalySubscriptions = (GetAnomalySubscriptionsResponse -> [AnomalySubscription])
-> (GetAnomalySubscriptionsResponse
    -> [AnomalySubscription] -> GetAnomalySubscriptionsResponse)
-> Lens
     GetAnomalySubscriptionsResponse
     GetAnomalySubscriptionsResponse
     [AnomalySubscription]
     [AnomalySubscription]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetAnomalySubscriptionsResponse' {[AnomalySubscription]
anomalySubscriptions :: [AnomalySubscription]
$sel:anomalySubscriptions:GetAnomalySubscriptionsResponse' :: GetAnomalySubscriptionsResponse -> [AnomalySubscription]
anomalySubscriptions} -> [AnomalySubscription]
anomalySubscriptions) (\s :: GetAnomalySubscriptionsResponse
s@GetAnomalySubscriptionsResponse' {} [AnomalySubscription]
a -> GetAnomalySubscriptionsResponse
s {$sel:anomalySubscriptions:GetAnomalySubscriptionsResponse' :: [AnomalySubscription]
anomalySubscriptions = [AnomalySubscription]
a} :: GetAnomalySubscriptionsResponse) (([AnomalySubscription] -> f [AnomalySubscription])
 -> GetAnomalySubscriptionsResponse
 -> f GetAnomalySubscriptionsResponse)
-> (([AnomalySubscription] -> f [AnomalySubscription])
    -> [AnomalySubscription] -> f [AnomalySubscription])
-> ([AnomalySubscription] -> f [AnomalySubscription])
-> GetAnomalySubscriptionsResponse
-> f GetAnomalySubscriptionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AnomalySubscription] -> f [AnomalySubscription])
-> [AnomalySubscription] -> f [AnomalySubscription]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    GetAnomalySubscriptionsResponse