{-# 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.Budgets.DescribeBudgets
-- 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)
--
-- Lists the budgets that are associated with an account.
--
-- The Request Syntax section shows the @BudgetLimit@ syntax. For
-- @PlannedBudgetLimits@, see the
-- <https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_budgets_DescribeBudgets.html#API_DescribeBudgets_Examples Examples>
-- section.
--
-- This operation returns paginated results.
module Amazonka.Budgets.DescribeBudgets
  ( -- * Creating a Request
    DescribeBudgets (..),
    newDescribeBudgets,

    -- * Request Lenses
    describeBudgets_nextToken,
    describeBudgets_maxResults,
    describeBudgets_accountId,

    -- * Destructuring the Response
    DescribeBudgetsResponse (..),
    newDescribeBudgetsResponse,

    -- * Response Lenses
    describeBudgetsResponse_nextToken,
    describeBudgetsResponse_budgets,
    describeBudgetsResponse_httpStatus,
  )
where

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

-- | Request of DescribeBudgets
--
-- /See:/ 'newDescribeBudgets' smart constructor.
data DescribeBudgets = DescribeBudgets'
  { -- | The pagination token that you include in your request to indicate the
    -- next set of results that you want to retrieve.
    DescribeBudgets -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | An optional integer that represents how many entries a paginated
    -- response contains. The maximum is 100.
    DescribeBudgets -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The @accountId@ that is associated with the budgets that you want
    -- descriptions of.
    DescribeBudgets -> Text
accountId :: Prelude.Text
  }
  deriving (DescribeBudgets -> DescribeBudgets -> Bool
(DescribeBudgets -> DescribeBudgets -> Bool)
-> (DescribeBudgets -> DescribeBudgets -> Bool)
-> Eq DescribeBudgets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBudgets -> DescribeBudgets -> Bool
$c/= :: DescribeBudgets -> DescribeBudgets -> Bool
== :: DescribeBudgets -> DescribeBudgets -> Bool
$c== :: DescribeBudgets -> DescribeBudgets -> Bool
Prelude.Eq, ReadPrec [DescribeBudgets]
ReadPrec DescribeBudgets
Int -> ReadS DescribeBudgets
ReadS [DescribeBudgets]
(Int -> ReadS DescribeBudgets)
-> ReadS [DescribeBudgets]
-> ReadPrec DescribeBudgets
-> ReadPrec [DescribeBudgets]
-> Read DescribeBudgets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeBudgets]
$creadListPrec :: ReadPrec [DescribeBudgets]
readPrec :: ReadPrec DescribeBudgets
$creadPrec :: ReadPrec DescribeBudgets
readList :: ReadS [DescribeBudgets]
$creadList :: ReadS [DescribeBudgets]
readsPrec :: Int -> ReadS DescribeBudgets
$creadsPrec :: Int -> ReadS DescribeBudgets
Prelude.Read, Int -> DescribeBudgets -> ShowS
[DescribeBudgets] -> ShowS
DescribeBudgets -> String
(Int -> DescribeBudgets -> ShowS)
-> (DescribeBudgets -> String)
-> ([DescribeBudgets] -> ShowS)
-> Show DescribeBudgets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBudgets] -> ShowS
$cshowList :: [DescribeBudgets] -> ShowS
show :: DescribeBudgets -> String
$cshow :: DescribeBudgets -> String
showsPrec :: Int -> DescribeBudgets -> ShowS
$cshowsPrec :: Int -> DescribeBudgets -> ShowS
Prelude.Show, (forall x. DescribeBudgets -> Rep DescribeBudgets x)
-> (forall x. Rep DescribeBudgets x -> DescribeBudgets)
-> Generic DescribeBudgets
forall x. Rep DescribeBudgets x -> DescribeBudgets
forall x. DescribeBudgets -> Rep DescribeBudgets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeBudgets x -> DescribeBudgets
$cfrom :: forall x. DescribeBudgets -> Rep DescribeBudgets x
Prelude.Generic)

-- |
-- Create a value of 'DescribeBudgets' 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', 'describeBudgets_nextToken' - The pagination token that you include in your request to indicate the
-- next set of results that you want to retrieve.
--
-- 'maxResults', 'describeBudgets_maxResults' - An optional integer that represents how many entries a paginated
-- response contains. The maximum is 100.
--
-- 'accountId', 'describeBudgets_accountId' - The @accountId@ that is associated with the budgets that you want
-- descriptions of.
newDescribeBudgets ::
  -- | 'accountId'
  Prelude.Text ->
  DescribeBudgets
newDescribeBudgets :: Text -> DescribeBudgets
newDescribeBudgets Text
pAccountId_ =
  DescribeBudgets' :: Maybe Text -> Maybe Natural -> Text -> DescribeBudgets
DescribeBudgets'
    { $sel:nextToken:DescribeBudgets' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeBudgets' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:DescribeBudgets' :: Text
accountId = Text
pAccountId_
    }

-- | The pagination token that you include in your request to indicate the
-- next set of results that you want to retrieve.
describeBudgets_nextToken :: Lens.Lens' DescribeBudgets (Prelude.Maybe Prelude.Text)
describeBudgets_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeBudgets -> f DescribeBudgets
describeBudgets_nextToken = (DescribeBudgets -> Maybe Text)
-> (DescribeBudgets -> Maybe Text -> DescribeBudgets)
-> Lens DescribeBudgets DescribeBudgets (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgets' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeBudgets' :: DescribeBudgets -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeBudgets
s@DescribeBudgets' {} Maybe Text
a -> DescribeBudgets
s {$sel:nextToken:DescribeBudgets' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeBudgets)

-- | An optional integer that represents how many entries a paginated
-- response contains. The maximum is 100.
describeBudgets_maxResults :: Lens.Lens' DescribeBudgets (Prelude.Maybe Prelude.Natural)
describeBudgets_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeBudgets -> f DescribeBudgets
describeBudgets_maxResults = (DescribeBudgets -> Maybe Natural)
-> (DescribeBudgets -> Maybe Natural -> DescribeBudgets)
-> Lens
     DescribeBudgets DescribeBudgets (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgets' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeBudgets' :: DescribeBudgets -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeBudgets
s@DescribeBudgets' {} Maybe Natural
a -> DescribeBudgets
s {$sel:maxResults:DescribeBudgets' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeBudgets)

-- | The @accountId@ that is associated with the budgets that you want
-- descriptions of.
describeBudgets_accountId :: Lens.Lens' DescribeBudgets Prelude.Text
describeBudgets_accountId :: (Text -> f Text) -> DescribeBudgets -> f DescribeBudgets
describeBudgets_accountId = (DescribeBudgets -> Text)
-> (DescribeBudgets -> Text -> DescribeBudgets)
-> Lens DescribeBudgets DescribeBudgets Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgets' {Text
accountId :: Text
$sel:accountId:DescribeBudgets' :: DescribeBudgets -> Text
accountId} -> Text
accountId) (\s :: DescribeBudgets
s@DescribeBudgets' {} Text
a -> DescribeBudgets
s {$sel:accountId:DescribeBudgets' :: Text
accountId = Text
a} :: DescribeBudgets)

instance Core.AWSPager DescribeBudgets where
  page :: DescribeBudgets
-> AWSResponse DescribeBudgets -> Maybe DescribeBudgets
page DescribeBudgets
rq AWSResponse DescribeBudgets
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeBudgets
DescribeBudgetsResponse
rs
            DescribeBudgetsResponse
-> Getting (First Text) DescribeBudgetsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeBudgetsResponse
-> Const (First Text) DescribeBudgetsResponse
Lens' DescribeBudgetsResponse (Maybe Text)
describeBudgetsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeBudgetsResponse
 -> Const (First Text) DescribeBudgetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeBudgetsResponse 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 DescribeBudgets
forall a. Maybe a
Prelude.Nothing
    | Maybe [Budget] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeBudgets
DescribeBudgetsResponse
rs
            DescribeBudgetsResponse
-> Getting (First [Budget]) DescribeBudgetsResponse [Budget]
-> Maybe [Budget]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Budget] -> Const (First [Budget]) (Maybe [Budget]))
-> DescribeBudgetsResponse
-> Const (First [Budget]) DescribeBudgetsResponse
Lens' DescribeBudgetsResponse (Maybe [Budget])
describeBudgetsResponse_budgets ((Maybe [Budget] -> Const (First [Budget]) (Maybe [Budget]))
 -> DescribeBudgetsResponse
 -> Const (First [Budget]) DescribeBudgetsResponse)
-> (([Budget] -> Const (First [Budget]) [Budget])
    -> Maybe [Budget] -> Const (First [Budget]) (Maybe [Budget]))
-> Getting (First [Budget]) DescribeBudgetsResponse [Budget]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Budget] -> Const (First [Budget]) [Budget])
-> Maybe [Budget] -> Const (First [Budget]) (Maybe [Budget])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeBudgets
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeBudgets -> Maybe DescribeBudgets
forall a. a -> Maybe a
Prelude.Just (DescribeBudgets -> Maybe DescribeBudgets)
-> DescribeBudgets -> Maybe DescribeBudgets
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeBudgets
rq
          DescribeBudgets
-> (DescribeBudgets -> DescribeBudgets) -> DescribeBudgets
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeBudgets -> Identity DescribeBudgets
Lens DescribeBudgets DescribeBudgets (Maybe Text) (Maybe Text)
describeBudgets_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeBudgets -> Identity DescribeBudgets)
-> Maybe Text -> DescribeBudgets -> DescribeBudgets
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeBudgets
DescribeBudgetsResponse
rs
          DescribeBudgetsResponse
-> Getting (First Text) DescribeBudgetsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeBudgetsResponse
-> Const (First Text) DescribeBudgetsResponse
Lens' DescribeBudgetsResponse (Maybe Text)
describeBudgetsResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeBudgetsResponse
 -> Const (First Text) DescribeBudgetsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeBudgetsResponse 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 DescribeBudgets where
  type
    AWSResponse DescribeBudgets =
      DescribeBudgetsResponse
  request :: DescribeBudgets -> Request DescribeBudgets
request = Service -> DescribeBudgets -> Request DescribeBudgets
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeBudgets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeBudgets)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeBudgets))
-> Logger
-> Service
-> Proxy DescribeBudgets
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeBudgets)))
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 -> Maybe [Budget] -> Int -> DescribeBudgetsResponse
DescribeBudgetsResponse'
            (Maybe Text -> Maybe [Budget] -> Int -> DescribeBudgetsResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Budget] -> Int -> DescribeBudgetsResponse)
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
"NextToken")
            Either String (Maybe [Budget] -> Int -> DescribeBudgetsResponse)
-> Either String (Maybe [Budget])
-> Either String (Int -> DescribeBudgetsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Budget]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Budgets" Either String (Maybe (Maybe [Budget]))
-> Maybe [Budget] -> Either String (Maybe [Budget])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Budget]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Int -> DescribeBudgetsResponse)
-> Either String Int -> Either String DescribeBudgetsResponse
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 DescribeBudgets

instance Prelude.NFData DescribeBudgets

instance Core.ToHeaders DescribeBudgets where
  toHeaders :: DescribeBudgets -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeBudgets -> 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
"AWSBudgetServiceGateway.DescribeBudgets" ::
                          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 DescribeBudgets where
  toJSON :: DescribeBudgets -> Value
toJSON DescribeBudgets' {Maybe Natural
Maybe Text
Text
accountId :: Text
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:accountId:DescribeBudgets' :: DescribeBudgets -> Text
$sel:maxResults:DescribeBudgets' :: DescribeBudgets -> Maybe Natural
$sel:nextToken:DescribeBudgets' :: DescribeBudgets -> 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
"AccountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
accountId)
          ]
      )

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

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

-- | Response of DescribeBudgets
--
-- /See:/ 'newDescribeBudgetsResponse' smart constructor.
data DescribeBudgetsResponse = DescribeBudgetsResponse'
  { -- | The pagination token in the service response that indicates the next set
    -- of results that you can retrieve.
    DescribeBudgetsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of budgets.
    DescribeBudgetsResponse -> Maybe [Budget]
budgets :: Prelude.Maybe [Budget],
    -- | The response's http status code.
    DescribeBudgetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeBudgetsResponse -> DescribeBudgetsResponse -> Bool
(DescribeBudgetsResponse -> DescribeBudgetsResponse -> Bool)
-> (DescribeBudgetsResponse -> DescribeBudgetsResponse -> Bool)
-> Eq DescribeBudgetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBudgetsResponse -> DescribeBudgetsResponse -> Bool
$c/= :: DescribeBudgetsResponse -> DescribeBudgetsResponse -> Bool
== :: DescribeBudgetsResponse -> DescribeBudgetsResponse -> Bool
$c== :: DescribeBudgetsResponse -> DescribeBudgetsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeBudgetsResponse]
ReadPrec DescribeBudgetsResponse
Int -> ReadS DescribeBudgetsResponse
ReadS [DescribeBudgetsResponse]
(Int -> ReadS DescribeBudgetsResponse)
-> ReadS [DescribeBudgetsResponse]
-> ReadPrec DescribeBudgetsResponse
-> ReadPrec [DescribeBudgetsResponse]
-> Read DescribeBudgetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeBudgetsResponse]
$creadListPrec :: ReadPrec [DescribeBudgetsResponse]
readPrec :: ReadPrec DescribeBudgetsResponse
$creadPrec :: ReadPrec DescribeBudgetsResponse
readList :: ReadS [DescribeBudgetsResponse]
$creadList :: ReadS [DescribeBudgetsResponse]
readsPrec :: Int -> ReadS DescribeBudgetsResponse
$creadsPrec :: Int -> ReadS DescribeBudgetsResponse
Prelude.Read, Int -> DescribeBudgetsResponse -> ShowS
[DescribeBudgetsResponse] -> ShowS
DescribeBudgetsResponse -> String
(Int -> DescribeBudgetsResponse -> ShowS)
-> (DescribeBudgetsResponse -> String)
-> ([DescribeBudgetsResponse] -> ShowS)
-> Show DescribeBudgetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBudgetsResponse] -> ShowS
$cshowList :: [DescribeBudgetsResponse] -> ShowS
show :: DescribeBudgetsResponse -> String
$cshow :: DescribeBudgetsResponse -> String
showsPrec :: Int -> DescribeBudgetsResponse -> ShowS
$cshowsPrec :: Int -> DescribeBudgetsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeBudgetsResponse -> Rep DescribeBudgetsResponse x)
-> (forall x.
    Rep DescribeBudgetsResponse x -> DescribeBudgetsResponse)
-> Generic DescribeBudgetsResponse
forall x. Rep DescribeBudgetsResponse x -> DescribeBudgetsResponse
forall x. DescribeBudgetsResponse -> Rep DescribeBudgetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeBudgetsResponse x -> DescribeBudgetsResponse
$cfrom :: forall x. DescribeBudgetsResponse -> Rep DescribeBudgetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeBudgetsResponse' 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', 'describeBudgetsResponse_nextToken' - The pagination token in the service response that indicates the next set
-- of results that you can retrieve.
--
-- 'budgets', 'describeBudgetsResponse_budgets' - A list of budgets.
--
-- 'httpStatus', 'describeBudgetsResponse_httpStatus' - The response's http status code.
newDescribeBudgetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeBudgetsResponse
newDescribeBudgetsResponse :: Int -> DescribeBudgetsResponse
newDescribeBudgetsResponse Int
pHttpStatus_ =
  DescribeBudgetsResponse' :: Maybe Text -> Maybe [Budget] -> Int -> DescribeBudgetsResponse
DescribeBudgetsResponse'
    { $sel:nextToken:DescribeBudgetsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:budgets:DescribeBudgetsResponse' :: Maybe [Budget]
budgets = Maybe [Budget]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeBudgetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The pagination token in the service response that indicates the next set
-- of results that you can retrieve.
describeBudgetsResponse_nextToken :: Lens.Lens' DescribeBudgetsResponse (Prelude.Maybe Prelude.Text)
describeBudgetsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeBudgetsResponse -> f DescribeBudgetsResponse
describeBudgetsResponse_nextToken = (DescribeBudgetsResponse -> Maybe Text)
-> (DescribeBudgetsResponse
    -> Maybe Text -> DescribeBudgetsResponse)
-> Lens' DescribeBudgetsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeBudgetsResponse' :: DescribeBudgetsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeBudgetsResponse
s@DescribeBudgetsResponse' {} Maybe Text
a -> DescribeBudgetsResponse
s {$sel:nextToken:DescribeBudgetsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeBudgetsResponse)

-- | A list of budgets.
describeBudgetsResponse_budgets :: Lens.Lens' DescribeBudgetsResponse (Prelude.Maybe [Budget])
describeBudgetsResponse_budgets :: (Maybe [Budget] -> f (Maybe [Budget]))
-> DescribeBudgetsResponse -> f DescribeBudgetsResponse
describeBudgetsResponse_budgets = (DescribeBudgetsResponse -> Maybe [Budget])
-> (DescribeBudgetsResponse
    -> Maybe [Budget] -> DescribeBudgetsResponse)
-> Lens' DescribeBudgetsResponse (Maybe [Budget])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetsResponse' {Maybe [Budget]
budgets :: Maybe [Budget]
$sel:budgets:DescribeBudgetsResponse' :: DescribeBudgetsResponse -> Maybe [Budget]
budgets} -> Maybe [Budget]
budgets) (\s :: DescribeBudgetsResponse
s@DescribeBudgetsResponse' {} Maybe [Budget]
a -> DescribeBudgetsResponse
s {$sel:budgets:DescribeBudgetsResponse' :: Maybe [Budget]
budgets = Maybe [Budget]
a} :: DescribeBudgetsResponse) ((Maybe [Budget] -> f (Maybe [Budget]))
 -> DescribeBudgetsResponse -> f DescribeBudgetsResponse)
-> ((Maybe [Budget] -> f (Maybe [Budget]))
    -> Maybe [Budget] -> f (Maybe [Budget]))
-> (Maybe [Budget] -> f (Maybe [Budget]))
-> DescribeBudgetsResponse
-> f DescribeBudgetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Budget] [Budget] [Budget] [Budget]
-> Iso
     (Maybe [Budget]) (Maybe [Budget]) (Maybe [Budget]) (Maybe [Budget])
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 [Budget] [Budget] [Budget] [Budget]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeBudgetsResponse