{-# 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.DescribeBudgetActionsForBudget
-- 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)
--
-- Describes all of the budget actions for a budget.
--
-- This operation returns paginated results.
module Amazonka.Budgets.DescribeBudgetActionsForBudget
  ( -- * Creating a Request
    DescribeBudgetActionsForBudget (..),
    newDescribeBudgetActionsForBudget,

    -- * Request Lenses
    describeBudgetActionsForBudget_nextToken,
    describeBudgetActionsForBudget_maxResults,
    describeBudgetActionsForBudget_accountId,
    describeBudgetActionsForBudget_budgetName,

    -- * Destructuring the Response
    DescribeBudgetActionsForBudgetResponse (..),
    newDescribeBudgetActionsForBudgetResponse,

    -- * Response Lenses
    describeBudgetActionsForBudgetResponse_nextToken,
    describeBudgetActionsForBudgetResponse_httpStatus,
    describeBudgetActionsForBudgetResponse_actions,
  )
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

-- | /See:/ 'newDescribeBudgetActionsForBudget' smart constructor.
data DescribeBudgetActionsForBudget = DescribeBudgetActionsForBudget'
  { DescribeBudgetActionsForBudget -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    DescribeBudgetActionsForBudget -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    DescribeBudgetActionsForBudget -> Text
accountId :: Prelude.Text,
    DescribeBudgetActionsForBudget -> Text
budgetName :: Prelude.Text
  }
  deriving (DescribeBudgetActionsForBudget
-> DescribeBudgetActionsForBudget -> Bool
(DescribeBudgetActionsForBudget
 -> DescribeBudgetActionsForBudget -> Bool)
-> (DescribeBudgetActionsForBudget
    -> DescribeBudgetActionsForBudget -> Bool)
-> Eq DescribeBudgetActionsForBudget
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBudgetActionsForBudget
-> DescribeBudgetActionsForBudget -> Bool
$c/= :: DescribeBudgetActionsForBudget
-> DescribeBudgetActionsForBudget -> Bool
== :: DescribeBudgetActionsForBudget
-> DescribeBudgetActionsForBudget -> Bool
$c== :: DescribeBudgetActionsForBudget
-> DescribeBudgetActionsForBudget -> Bool
Prelude.Eq, ReadPrec [DescribeBudgetActionsForBudget]
ReadPrec DescribeBudgetActionsForBudget
Int -> ReadS DescribeBudgetActionsForBudget
ReadS [DescribeBudgetActionsForBudget]
(Int -> ReadS DescribeBudgetActionsForBudget)
-> ReadS [DescribeBudgetActionsForBudget]
-> ReadPrec DescribeBudgetActionsForBudget
-> ReadPrec [DescribeBudgetActionsForBudget]
-> Read DescribeBudgetActionsForBudget
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeBudgetActionsForBudget]
$creadListPrec :: ReadPrec [DescribeBudgetActionsForBudget]
readPrec :: ReadPrec DescribeBudgetActionsForBudget
$creadPrec :: ReadPrec DescribeBudgetActionsForBudget
readList :: ReadS [DescribeBudgetActionsForBudget]
$creadList :: ReadS [DescribeBudgetActionsForBudget]
readsPrec :: Int -> ReadS DescribeBudgetActionsForBudget
$creadsPrec :: Int -> ReadS DescribeBudgetActionsForBudget
Prelude.Read, Int -> DescribeBudgetActionsForBudget -> ShowS
[DescribeBudgetActionsForBudget] -> ShowS
DescribeBudgetActionsForBudget -> String
(Int -> DescribeBudgetActionsForBudget -> ShowS)
-> (DescribeBudgetActionsForBudget -> String)
-> ([DescribeBudgetActionsForBudget] -> ShowS)
-> Show DescribeBudgetActionsForBudget
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBudgetActionsForBudget] -> ShowS
$cshowList :: [DescribeBudgetActionsForBudget] -> ShowS
show :: DescribeBudgetActionsForBudget -> String
$cshow :: DescribeBudgetActionsForBudget -> String
showsPrec :: Int -> DescribeBudgetActionsForBudget -> ShowS
$cshowsPrec :: Int -> DescribeBudgetActionsForBudget -> ShowS
Prelude.Show, (forall x.
 DescribeBudgetActionsForBudget
 -> Rep DescribeBudgetActionsForBudget x)
-> (forall x.
    Rep DescribeBudgetActionsForBudget x
    -> DescribeBudgetActionsForBudget)
-> Generic DescribeBudgetActionsForBudget
forall x.
Rep DescribeBudgetActionsForBudget x
-> DescribeBudgetActionsForBudget
forall x.
DescribeBudgetActionsForBudget
-> Rep DescribeBudgetActionsForBudget x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeBudgetActionsForBudget x
-> DescribeBudgetActionsForBudget
$cfrom :: forall x.
DescribeBudgetActionsForBudget
-> Rep DescribeBudgetActionsForBudget x
Prelude.Generic)

-- |
-- Create a value of 'DescribeBudgetActionsForBudget' 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', 'describeBudgetActionsForBudget_nextToken' - Undocumented member.
--
-- 'maxResults', 'describeBudgetActionsForBudget_maxResults' - Undocumented member.
--
-- 'accountId', 'describeBudgetActionsForBudget_accountId' - Undocumented member.
--
-- 'budgetName', 'describeBudgetActionsForBudget_budgetName' - Undocumented member.
newDescribeBudgetActionsForBudget ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'budgetName'
  Prelude.Text ->
  DescribeBudgetActionsForBudget
newDescribeBudgetActionsForBudget :: Text -> Text -> DescribeBudgetActionsForBudget
newDescribeBudgetActionsForBudget
  Text
pAccountId_
  Text
pBudgetName_ =
    DescribeBudgetActionsForBudget' :: Maybe Text
-> Maybe Natural -> Text -> Text -> DescribeBudgetActionsForBudget
DescribeBudgetActionsForBudget'
      { $sel:nextToken:DescribeBudgetActionsForBudget' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:maxResults:DescribeBudgetActionsForBudget' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:accountId:DescribeBudgetActionsForBudget' :: Text
accountId = Text
pAccountId_,
        $sel:budgetName:DescribeBudgetActionsForBudget' :: Text
budgetName = Text
pBudgetName_
      }

-- | Undocumented member.
describeBudgetActionsForBudget_nextToken :: Lens.Lens' DescribeBudgetActionsForBudget (Prelude.Maybe Prelude.Text)
describeBudgetActionsForBudget_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeBudgetActionsForBudget
-> f DescribeBudgetActionsForBudget
describeBudgetActionsForBudget_nextToken = (DescribeBudgetActionsForBudget -> Maybe Text)
-> (DescribeBudgetActionsForBudget
    -> Maybe Text -> DescribeBudgetActionsForBudget)
-> Lens
     DescribeBudgetActionsForBudget
     DescribeBudgetActionsForBudget
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionsForBudget' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeBudgetActionsForBudget' :: DescribeBudgetActionsForBudget -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeBudgetActionsForBudget
s@DescribeBudgetActionsForBudget' {} Maybe Text
a -> DescribeBudgetActionsForBudget
s {$sel:nextToken:DescribeBudgetActionsForBudget' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeBudgetActionsForBudget)

-- | Undocumented member.
describeBudgetActionsForBudget_maxResults :: Lens.Lens' DescribeBudgetActionsForBudget (Prelude.Maybe Prelude.Natural)
describeBudgetActionsForBudget_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeBudgetActionsForBudget
-> f DescribeBudgetActionsForBudget
describeBudgetActionsForBudget_maxResults = (DescribeBudgetActionsForBudget -> Maybe Natural)
-> (DescribeBudgetActionsForBudget
    -> Maybe Natural -> DescribeBudgetActionsForBudget)
-> Lens
     DescribeBudgetActionsForBudget
     DescribeBudgetActionsForBudget
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionsForBudget' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeBudgetActionsForBudget' :: DescribeBudgetActionsForBudget -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeBudgetActionsForBudget
s@DescribeBudgetActionsForBudget' {} Maybe Natural
a -> DescribeBudgetActionsForBudget
s {$sel:maxResults:DescribeBudgetActionsForBudget' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeBudgetActionsForBudget)

-- | Undocumented member.
describeBudgetActionsForBudget_accountId :: Lens.Lens' DescribeBudgetActionsForBudget Prelude.Text
describeBudgetActionsForBudget_accountId :: (Text -> f Text)
-> DescribeBudgetActionsForBudget
-> f DescribeBudgetActionsForBudget
describeBudgetActionsForBudget_accountId = (DescribeBudgetActionsForBudget -> Text)
-> (DescribeBudgetActionsForBudget
    -> Text -> DescribeBudgetActionsForBudget)
-> Lens
     DescribeBudgetActionsForBudget
     DescribeBudgetActionsForBudget
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionsForBudget' {Text
accountId :: Text
$sel:accountId:DescribeBudgetActionsForBudget' :: DescribeBudgetActionsForBudget -> Text
accountId} -> Text
accountId) (\s :: DescribeBudgetActionsForBudget
s@DescribeBudgetActionsForBudget' {} Text
a -> DescribeBudgetActionsForBudget
s {$sel:accountId:DescribeBudgetActionsForBudget' :: Text
accountId = Text
a} :: DescribeBudgetActionsForBudget)

-- | Undocumented member.
describeBudgetActionsForBudget_budgetName :: Lens.Lens' DescribeBudgetActionsForBudget Prelude.Text
describeBudgetActionsForBudget_budgetName :: (Text -> f Text)
-> DescribeBudgetActionsForBudget
-> f DescribeBudgetActionsForBudget
describeBudgetActionsForBudget_budgetName = (DescribeBudgetActionsForBudget -> Text)
-> (DescribeBudgetActionsForBudget
    -> Text -> DescribeBudgetActionsForBudget)
-> Lens
     DescribeBudgetActionsForBudget
     DescribeBudgetActionsForBudget
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionsForBudget' {Text
budgetName :: Text
$sel:budgetName:DescribeBudgetActionsForBudget' :: DescribeBudgetActionsForBudget -> Text
budgetName} -> Text
budgetName) (\s :: DescribeBudgetActionsForBudget
s@DescribeBudgetActionsForBudget' {} Text
a -> DescribeBudgetActionsForBudget
s {$sel:budgetName:DescribeBudgetActionsForBudget' :: Text
budgetName = Text
a} :: DescribeBudgetActionsForBudget)

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

instance
  Prelude.Hashable
    DescribeBudgetActionsForBudget

instance
  Prelude.NFData
    DescribeBudgetActionsForBudget

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

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

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

-- | /See:/ 'newDescribeBudgetActionsForBudgetResponse' smart constructor.
data DescribeBudgetActionsForBudgetResponse = DescribeBudgetActionsForBudgetResponse'
  { DescribeBudgetActionsForBudgetResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeBudgetActionsForBudgetResponse -> Int
httpStatus :: Prelude.Int,
    -- | A list of the budget action resources information.
    DescribeBudgetActionsForBudgetResponse -> [Action]
actions :: [Action]
  }
  deriving (DescribeBudgetActionsForBudgetResponse
-> DescribeBudgetActionsForBudgetResponse -> Bool
(DescribeBudgetActionsForBudgetResponse
 -> DescribeBudgetActionsForBudgetResponse -> Bool)
-> (DescribeBudgetActionsForBudgetResponse
    -> DescribeBudgetActionsForBudgetResponse -> Bool)
-> Eq DescribeBudgetActionsForBudgetResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeBudgetActionsForBudgetResponse
-> DescribeBudgetActionsForBudgetResponse -> Bool
$c/= :: DescribeBudgetActionsForBudgetResponse
-> DescribeBudgetActionsForBudgetResponse -> Bool
== :: DescribeBudgetActionsForBudgetResponse
-> DescribeBudgetActionsForBudgetResponse -> Bool
$c== :: DescribeBudgetActionsForBudgetResponse
-> DescribeBudgetActionsForBudgetResponse -> Bool
Prelude.Eq, Int -> DescribeBudgetActionsForBudgetResponse -> ShowS
[DescribeBudgetActionsForBudgetResponse] -> ShowS
DescribeBudgetActionsForBudgetResponse -> String
(Int -> DescribeBudgetActionsForBudgetResponse -> ShowS)
-> (DescribeBudgetActionsForBudgetResponse -> String)
-> ([DescribeBudgetActionsForBudgetResponse] -> ShowS)
-> Show DescribeBudgetActionsForBudgetResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeBudgetActionsForBudgetResponse] -> ShowS
$cshowList :: [DescribeBudgetActionsForBudgetResponse] -> ShowS
show :: DescribeBudgetActionsForBudgetResponse -> String
$cshow :: DescribeBudgetActionsForBudgetResponse -> String
showsPrec :: Int -> DescribeBudgetActionsForBudgetResponse -> ShowS
$cshowsPrec :: Int -> DescribeBudgetActionsForBudgetResponse -> ShowS
Prelude.Show, (forall x.
 DescribeBudgetActionsForBudgetResponse
 -> Rep DescribeBudgetActionsForBudgetResponse x)
-> (forall x.
    Rep DescribeBudgetActionsForBudgetResponse x
    -> DescribeBudgetActionsForBudgetResponse)
-> Generic DescribeBudgetActionsForBudgetResponse
forall x.
Rep DescribeBudgetActionsForBudgetResponse x
-> DescribeBudgetActionsForBudgetResponse
forall x.
DescribeBudgetActionsForBudgetResponse
-> Rep DescribeBudgetActionsForBudgetResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeBudgetActionsForBudgetResponse x
-> DescribeBudgetActionsForBudgetResponse
$cfrom :: forall x.
DescribeBudgetActionsForBudgetResponse
-> Rep DescribeBudgetActionsForBudgetResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeBudgetActionsForBudgetResponse' 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', 'describeBudgetActionsForBudgetResponse_nextToken' - Undocumented member.
--
-- 'httpStatus', 'describeBudgetActionsForBudgetResponse_httpStatus' - The response's http status code.
--
-- 'actions', 'describeBudgetActionsForBudgetResponse_actions' - A list of the budget action resources information.
newDescribeBudgetActionsForBudgetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeBudgetActionsForBudgetResponse
newDescribeBudgetActionsForBudgetResponse :: Int -> DescribeBudgetActionsForBudgetResponse
newDescribeBudgetActionsForBudgetResponse
  Int
pHttpStatus_ =
    DescribeBudgetActionsForBudgetResponse' :: Maybe Text
-> Int -> [Action] -> DescribeBudgetActionsForBudgetResponse
DescribeBudgetActionsForBudgetResponse'
      { $sel:nextToken:DescribeBudgetActionsForBudgetResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeBudgetActionsForBudgetResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:actions:DescribeBudgetActionsForBudgetResponse' :: [Action]
actions = [Action]
forall a. Monoid a => a
Prelude.mempty
      }

-- | Undocumented member.
describeBudgetActionsForBudgetResponse_nextToken :: Lens.Lens' DescribeBudgetActionsForBudgetResponse (Prelude.Maybe Prelude.Text)
describeBudgetActionsForBudgetResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeBudgetActionsForBudgetResponse
-> f DescribeBudgetActionsForBudgetResponse
describeBudgetActionsForBudgetResponse_nextToken = (DescribeBudgetActionsForBudgetResponse -> Maybe Text)
-> (DescribeBudgetActionsForBudgetResponse
    -> Maybe Text -> DescribeBudgetActionsForBudgetResponse)
-> Lens' DescribeBudgetActionsForBudgetResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionsForBudgetResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeBudgetActionsForBudgetResponse' :: DescribeBudgetActionsForBudgetResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeBudgetActionsForBudgetResponse
s@DescribeBudgetActionsForBudgetResponse' {} Maybe Text
a -> DescribeBudgetActionsForBudgetResponse
s {$sel:nextToken:DescribeBudgetActionsForBudgetResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeBudgetActionsForBudgetResponse)

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

-- | A list of the budget action resources information.
describeBudgetActionsForBudgetResponse_actions :: Lens.Lens' DescribeBudgetActionsForBudgetResponse [Action]
describeBudgetActionsForBudgetResponse_actions :: ([Action] -> f [Action])
-> DescribeBudgetActionsForBudgetResponse
-> f DescribeBudgetActionsForBudgetResponse
describeBudgetActionsForBudgetResponse_actions = (DescribeBudgetActionsForBudgetResponse -> [Action])
-> (DescribeBudgetActionsForBudgetResponse
    -> [Action] -> DescribeBudgetActionsForBudgetResponse)
-> Lens' DescribeBudgetActionsForBudgetResponse [Action]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeBudgetActionsForBudgetResponse' {[Action]
actions :: [Action]
$sel:actions:DescribeBudgetActionsForBudgetResponse' :: DescribeBudgetActionsForBudgetResponse -> [Action]
actions} -> [Action]
actions) (\s :: DescribeBudgetActionsForBudgetResponse
s@DescribeBudgetActionsForBudgetResponse' {} [Action]
a -> DescribeBudgetActionsForBudgetResponse
s {$sel:actions:DescribeBudgetActionsForBudgetResponse' :: [Action]
actions = [Action]
a} :: DescribeBudgetActionsForBudgetResponse) (([Action] -> f [Action])
 -> DescribeBudgetActionsForBudgetResponse
 -> f DescribeBudgetActionsForBudgetResponse)
-> (([Action] -> f [Action]) -> [Action] -> f [Action])
-> ([Action] -> f [Action])
-> DescribeBudgetActionsForBudgetResponse
-> f DescribeBudgetActionsForBudgetResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Action] -> f [Action]) -> [Action] -> f [Action]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance
  Prelude.NFData
    DescribeBudgetActionsForBudgetResponse