{-# 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.DescribeNotificationsForBudget
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the notifications that are associated with a budget.
--
-- This operation returns paginated results.
module Amazonka.Budgets.DescribeNotificationsForBudget
  ( -- * Creating a Request
    DescribeNotificationsForBudget (..),
    newDescribeNotificationsForBudget,

    -- * Request Lenses
    describeNotificationsForBudget_maxResults,
    describeNotificationsForBudget_nextToken,
    describeNotificationsForBudget_accountId,
    describeNotificationsForBudget_budgetName,

    -- * Destructuring the Response
    DescribeNotificationsForBudgetResponse (..),
    newDescribeNotificationsForBudgetResponse,

    -- * Response Lenses
    describeNotificationsForBudgetResponse_nextToken,
    describeNotificationsForBudgetResponse_notifications,
    describeNotificationsForBudgetResponse_httpStatus,
  )
where

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

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

-- |
-- Create a value of 'DescribeNotificationsForBudget' 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:
--
-- 'maxResults', 'describeNotificationsForBudget_maxResults' - An optional integer that represents how many entries a paginated
-- response contains. The maximum is 100.
--
-- 'nextToken', 'describeNotificationsForBudget_nextToken' - The pagination token that you include in your request to indicate the
-- next set of results that you want to retrieve.
--
-- 'accountId', 'describeNotificationsForBudget_accountId' - The @accountId@ that is associated with the budget whose notifications
-- you want descriptions of.
--
-- 'budgetName', 'describeNotificationsForBudget_budgetName' - The name of the budget whose notifications you want descriptions of.
newDescribeNotificationsForBudget ::
  -- | 'accountId'
  Prelude.Text ->
  -- | 'budgetName'
  Prelude.Text ->
  DescribeNotificationsForBudget
newDescribeNotificationsForBudget :: Text -> Text -> DescribeNotificationsForBudget
newDescribeNotificationsForBudget
  Text
pAccountId_
  Text
pBudgetName_ =
    DescribeNotificationsForBudget'
      { $sel:maxResults:DescribeNotificationsForBudget' :: Maybe Natural
maxResults =
          forall a. Maybe a
Prelude.Nothing,
        $sel:nextToken:DescribeNotificationsForBudget' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
        $sel:accountId:DescribeNotificationsForBudget' :: Text
accountId = Text
pAccountId_,
        $sel:budgetName:DescribeNotificationsForBudget' :: Text
budgetName = Text
pBudgetName_
      }

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

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

-- | The @accountId@ that is associated with the budget whose notifications
-- you want descriptions of.
describeNotificationsForBudget_accountId :: Lens.Lens' DescribeNotificationsForBudget Prelude.Text
describeNotificationsForBudget_accountId :: Lens' DescribeNotificationsForBudget Text
describeNotificationsForBudget_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationsForBudget' {Text
accountId :: Text
$sel:accountId:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Text
accountId} -> Text
accountId) (\s :: DescribeNotificationsForBudget
s@DescribeNotificationsForBudget' {} Text
a -> DescribeNotificationsForBudget
s {$sel:accountId:DescribeNotificationsForBudget' :: Text
accountId = Text
a} :: DescribeNotificationsForBudget)

-- | The name of the budget whose notifications you want descriptions of.
describeNotificationsForBudget_budgetName :: Lens.Lens' DescribeNotificationsForBudget Prelude.Text
describeNotificationsForBudget_budgetName :: Lens' DescribeNotificationsForBudget Text
describeNotificationsForBudget_budgetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationsForBudget' {Text
budgetName :: Text
$sel:budgetName:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Text
budgetName} -> Text
budgetName) (\s :: DescribeNotificationsForBudget
s@DescribeNotificationsForBudget' {} Text
a -> DescribeNotificationsForBudget
s {$sel:budgetName:DescribeNotificationsForBudget' :: Text
budgetName = Text
a} :: DescribeNotificationsForBudget)

instance Core.AWSPager DescribeNotificationsForBudget where
  page :: DescribeNotificationsForBudget
-> AWSResponse DescribeNotificationsForBudget
-> Maybe DescribeNotificationsForBudget
page DescribeNotificationsForBudget
rq AWSResponse DescribeNotificationsForBudget
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeNotificationsForBudget
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNotificationsForBudgetResponse (Maybe Text)
describeNotificationsForBudgetResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeNotificationsForBudget
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNotificationsForBudgetResponse (Maybe [Notification])
describeNotificationsForBudgetResponse_notifications
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ DescribeNotificationsForBudget
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' DescribeNotificationsForBudget (Maybe Text)
describeNotificationsForBudget_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeNotificationsForBudget
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' DescribeNotificationsForBudgetResponse (Maybe Text)
describeNotificationsForBudgetResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance
  Core.AWSRequest
    DescribeNotificationsForBudget
  where
  type
    AWSResponse DescribeNotificationsForBudget =
      DescribeNotificationsForBudgetResponse
  request :: (Service -> Service)
-> DescribeNotificationsForBudget
-> Request DescribeNotificationsForBudget
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeNotificationsForBudget
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse (AWSResponse DescribeNotificationsForBudget)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [Notification]
-> Int
-> DescribeNotificationsForBudgetResponse
DescribeNotificationsForBudgetResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Notifications" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    DescribeNotificationsForBudget
  where
  hashWithSalt :: Int -> DescribeNotificationsForBudget -> Int
hashWithSalt
    Int
_salt
    DescribeNotificationsForBudget' {Maybe Natural
Maybe Text
Text
budgetName :: Text
accountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:budgetName:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Text
$sel:accountId:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Text
$sel:nextToken:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Maybe Text
$sel:maxResults:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
accountId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
budgetName

instance
  Prelude.NFData
    DescribeNotificationsForBudget
  where
  rnf :: DescribeNotificationsForBudget -> ()
rnf DescribeNotificationsForBudget' {Maybe Natural
Maybe Text
Text
budgetName :: Text
accountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:budgetName:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Text
$sel:accountId:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Text
$sel:nextToken:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Maybe Text
$sel:maxResults:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
budgetName

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

instance Data.ToJSON DescribeNotificationsForBudget where
  toJSON :: DescribeNotificationsForBudget -> Value
toJSON DescribeNotificationsForBudget' {Maybe Natural
Maybe Text
Text
budgetName :: Text
accountId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:budgetName:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Text
$sel:accountId:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Text
$sel:nextToken:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Maybe Text
$sel:maxResults:DescribeNotificationsForBudget' :: DescribeNotificationsForBudget -> Maybe Natural
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            forall a. a -> Maybe a
Prelude.Just (Key
"AccountId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
accountId),
            forall a. a -> Maybe a
Prelude.Just (Key
"BudgetName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
budgetName)
          ]
      )

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

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

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

-- |
-- Create a value of 'DescribeNotificationsForBudgetResponse' 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', 'describeNotificationsForBudgetResponse_nextToken' - The pagination token in the service response that indicates the next set
-- of results that you can retrieve.
--
-- 'notifications', 'describeNotificationsForBudgetResponse_notifications' - A list of notifications that are associated with a budget.
--
-- 'httpStatus', 'describeNotificationsForBudgetResponse_httpStatus' - The response's http status code.
newDescribeNotificationsForBudgetResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeNotificationsForBudgetResponse
newDescribeNotificationsForBudgetResponse :: Int -> DescribeNotificationsForBudgetResponse
newDescribeNotificationsForBudgetResponse
  Int
pHttpStatus_ =
    DescribeNotificationsForBudgetResponse'
      { $sel:nextToken:DescribeNotificationsForBudgetResponse' :: Maybe Text
nextToken =
          forall a. Maybe a
Prelude.Nothing,
        $sel:notifications:DescribeNotificationsForBudgetResponse' :: Maybe [Notification]
notifications = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeNotificationsForBudgetResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

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

-- | A list of notifications that are associated with a budget.
describeNotificationsForBudgetResponse_notifications :: Lens.Lens' DescribeNotificationsForBudgetResponse (Prelude.Maybe [Notification])
describeNotificationsForBudgetResponse_notifications :: Lens' DescribeNotificationsForBudgetResponse (Maybe [Notification])
describeNotificationsForBudgetResponse_notifications = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeNotificationsForBudgetResponse' {Maybe [Notification]
notifications :: Maybe [Notification]
$sel:notifications:DescribeNotificationsForBudgetResponse' :: DescribeNotificationsForBudgetResponse -> Maybe [Notification]
notifications} -> Maybe [Notification]
notifications) (\s :: DescribeNotificationsForBudgetResponse
s@DescribeNotificationsForBudgetResponse' {} Maybe [Notification]
a -> DescribeNotificationsForBudgetResponse
s {$sel:notifications:DescribeNotificationsForBudgetResponse' :: Maybe [Notification]
notifications = Maybe [Notification]
a} :: DescribeNotificationsForBudgetResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeNotificationsForBudgetResponse
  where
  rnf :: DescribeNotificationsForBudgetResponse -> ()
rnf DescribeNotificationsForBudgetResponse' {Int
Maybe [Notification]
Maybe Text
httpStatus :: Int
notifications :: Maybe [Notification]
nextToken :: Maybe Text
$sel:httpStatus:DescribeNotificationsForBudgetResponse' :: DescribeNotificationsForBudgetResponse -> Int
$sel:notifications:DescribeNotificationsForBudgetResponse' :: DescribeNotificationsForBudgetResponse -> Maybe [Notification]
$sel:nextToken:DescribeNotificationsForBudgetResponse' :: DescribeNotificationsForBudgetResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Notification]
notifications
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus