{-# 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.ServiceCatalog.ListBudgetsForResource
-- 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 all the budgets associated to the specified resource.
module Amazonka.ServiceCatalog.ListBudgetsForResource
  ( -- * Creating a Request
    ListBudgetsForResource (..),
    newListBudgetsForResource,

    -- * Request Lenses
    listBudgetsForResource_acceptLanguage,
    listBudgetsForResource_pageToken,
    listBudgetsForResource_pageSize,
    listBudgetsForResource_resourceId,

    -- * Destructuring the Response
    ListBudgetsForResourceResponse (..),
    newListBudgetsForResourceResponse,

    -- * Response Lenses
    listBudgetsForResourceResponse_nextPageToken,
    listBudgetsForResourceResponse_budgets,
    listBudgetsForResourceResponse_httpStatus,
  )
where

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
import Amazonka.ServiceCatalog.Types

-- | /See:/ 'newListBudgetsForResource' smart constructor.
data ListBudgetsForResource = ListBudgetsForResource'
  { -- | The language code.
    --
    -- -   @en@ - English (default)
    --
    -- -   @jp@ - Japanese
    --
    -- -   @zh@ - Chinese
    ListBudgetsForResource -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
    -- | The page token for the next set of results. To retrieve the first set of
    -- results, use null.
    ListBudgetsForResource -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call.
    ListBudgetsForResource -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
    -- | The resource identifier.
    ListBudgetsForResource -> Text
resourceId :: Prelude.Text
  }
  deriving (ListBudgetsForResource -> ListBudgetsForResource -> Bool
(ListBudgetsForResource -> ListBudgetsForResource -> Bool)
-> (ListBudgetsForResource -> ListBudgetsForResource -> Bool)
-> Eq ListBudgetsForResource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBudgetsForResource -> ListBudgetsForResource -> Bool
$c/= :: ListBudgetsForResource -> ListBudgetsForResource -> Bool
== :: ListBudgetsForResource -> ListBudgetsForResource -> Bool
$c== :: ListBudgetsForResource -> ListBudgetsForResource -> Bool
Prelude.Eq, ReadPrec [ListBudgetsForResource]
ReadPrec ListBudgetsForResource
Int -> ReadS ListBudgetsForResource
ReadS [ListBudgetsForResource]
(Int -> ReadS ListBudgetsForResource)
-> ReadS [ListBudgetsForResource]
-> ReadPrec ListBudgetsForResource
-> ReadPrec [ListBudgetsForResource]
-> Read ListBudgetsForResource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBudgetsForResource]
$creadListPrec :: ReadPrec [ListBudgetsForResource]
readPrec :: ReadPrec ListBudgetsForResource
$creadPrec :: ReadPrec ListBudgetsForResource
readList :: ReadS [ListBudgetsForResource]
$creadList :: ReadS [ListBudgetsForResource]
readsPrec :: Int -> ReadS ListBudgetsForResource
$creadsPrec :: Int -> ReadS ListBudgetsForResource
Prelude.Read, Int -> ListBudgetsForResource -> ShowS
[ListBudgetsForResource] -> ShowS
ListBudgetsForResource -> String
(Int -> ListBudgetsForResource -> ShowS)
-> (ListBudgetsForResource -> String)
-> ([ListBudgetsForResource] -> ShowS)
-> Show ListBudgetsForResource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBudgetsForResource] -> ShowS
$cshowList :: [ListBudgetsForResource] -> ShowS
show :: ListBudgetsForResource -> String
$cshow :: ListBudgetsForResource -> String
showsPrec :: Int -> ListBudgetsForResource -> ShowS
$cshowsPrec :: Int -> ListBudgetsForResource -> ShowS
Prelude.Show, (forall x. ListBudgetsForResource -> Rep ListBudgetsForResource x)
-> (forall x.
    Rep ListBudgetsForResource x -> ListBudgetsForResource)
-> Generic ListBudgetsForResource
forall x. Rep ListBudgetsForResource x -> ListBudgetsForResource
forall x. ListBudgetsForResource -> Rep ListBudgetsForResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListBudgetsForResource x -> ListBudgetsForResource
$cfrom :: forall x. ListBudgetsForResource -> Rep ListBudgetsForResource x
Prelude.Generic)

-- |
-- Create a value of 'ListBudgetsForResource' 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:
--
-- 'acceptLanguage', 'listBudgetsForResource_acceptLanguage' - The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
--
-- 'pageToken', 'listBudgetsForResource_pageToken' - The page token for the next set of results. To retrieve the first set of
-- results, use null.
--
-- 'pageSize', 'listBudgetsForResource_pageSize' - The maximum number of items to return with this call.
--
-- 'resourceId', 'listBudgetsForResource_resourceId' - The resource identifier.
newListBudgetsForResource ::
  -- | 'resourceId'
  Prelude.Text ->
  ListBudgetsForResource
newListBudgetsForResource :: Text -> ListBudgetsForResource
newListBudgetsForResource Text
pResourceId_ =
  ListBudgetsForResource' :: Maybe Text
-> Maybe Text -> Maybe Natural -> Text -> ListBudgetsForResource
ListBudgetsForResource'
    { $sel:acceptLanguage:ListBudgetsForResource' :: Maybe Text
acceptLanguage =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageToken:ListBudgetsForResource' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:ListBudgetsForResource' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceId:ListBudgetsForResource' :: Text
resourceId = Text
pResourceId_
    }

-- | The language code.
--
-- -   @en@ - English (default)
--
-- -   @jp@ - Japanese
--
-- -   @zh@ - Chinese
listBudgetsForResource_acceptLanguage :: Lens.Lens' ListBudgetsForResource (Prelude.Maybe Prelude.Text)
listBudgetsForResource_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> ListBudgetsForResource -> f ListBudgetsForResource
listBudgetsForResource_acceptLanguage = (ListBudgetsForResource -> Maybe Text)
-> (ListBudgetsForResource -> Maybe Text -> ListBudgetsForResource)
-> Lens
     ListBudgetsForResource
     ListBudgetsForResource
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBudgetsForResource' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:ListBudgetsForResource' :: ListBudgetsForResource -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: ListBudgetsForResource
s@ListBudgetsForResource' {} Maybe Text
a -> ListBudgetsForResource
s {$sel:acceptLanguage:ListBudgetsForResource' :: Maybe Text
acceptLanguage = Maybe Text
a} :: ListBudgetsForResource)

-- | The page token for the next set of results. To retrieve the first set of
-- results, use null.
listBudgetsForResource_pageToken :: Lens.Lens' ListBudgetsForResource (Prelude.Maybe Prelude.Text)
listBudgetsForResource_pageToken :: (Maybe Text -> f (Maybe Text))
-> ListBudgetsForResource -> f ListBudgetsForResource
listBudgetsForResource_pageToken = (ListBudgetsForResource -> Maybe Text)
-> (ListBudgetsForResource -> Maybe Text -> ListBudgetsForResource)
-> Lens
     ListBudgetsForResource
     ListBudgetsForResource
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBudgetsForResource' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:ListBudgetsForResource' :: ListBudgetsForResource -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: ListBudgetsForResource
s@ListBudgetsForResource' {} Maybe Text
a -> ListBudgetsForResource
s {$sel:pageToken:ListBudgetsForResource' :: Maybe Text
pageToken = Maybe Text
a} :: ListBudgetsForResource)

-- | The maximum number of items to return with this call.
listBudgetsForResource_pageSize :: Lens.Lens' ListBudgetsForResource (Prelude.Maybe Prelude.Natural)
listBudgetsForResource_pageSize :: (Maybe Natural -> f (Maybe Natural))
-> ListBudgetsForResource -> f ListBudgetsForResource
listBudgetsForResource_pageSize = (ListBudgetsForResource -> Maybe Natural)
-> (ListBudgetsForResource
    -> Maybe Natural -> ListBudgetsForResource)
-> Lens
     ListBudgetsForResource
     ListBudgetsForResource
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBudgetsForResource' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:ListBudgetsForResource' :: ListBudgetsForResource -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: ListBudgetsForResource
s@ListBudgetsForResource' {} Maybe Natural
a -> ListBudgetsForResource
s {$sel:pageSize:ListBudgetsForResource' :: Maybe Natural
pageSize = Maybe Natural
a} :: ListBudgetsForResource)

-- | The resource identifier.
listBudgetsForResource_resourceId :: Lens.Lens' ListBudgetsForResource Prelude.Text
listBudgetsForResource_resourceId :: (Text -> f Text)
-> ListBudgetsForResource -> f ListBudgetsForResource
listBudgetsForResource_resourceId = (ListBudgetsForResource -> Text)
-> (ListBudgetsForResource -> Text -> ListBudgetsForResource)
-> Lens ListBudgetsForResource ListBudgetsForResource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBudgetsForResource' {Text
resourceId :: Text
$sel:resourceId:ListBudgetsForResource' :: ListBudgetsForResource -> Text
resourceId} -> Text
resourceId) (\s :: ListBudgetsForResource
s@ListBudgetsForResource' {} Text
a -> ListBudgetsForResource
s {$sel:resourceId:ListBudgetsForResource' :: Text
resourceId = Text
a} :: ListBudgetsForResource)

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

instance Prelude.NFData ListBudgetsForResource

instance Core.ToHeaders ListBudgetsForResource where
  toHeaders :: ListBudgetsForResource -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ListBudgetsForResource -> 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
"AWS242ServiceCatalogService.ListBudgetsForResource" ::
                          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 ListBudgetsForResource where
  toJSON :: ListBudgetsForResource -> Value
toJSON ListBudgetsForResource' {Maybe Natural
Maybe Text
Text
resourceId :: Text
pageSize :: Maybe Natural
pageToken :: Maybe Text
acceptLanguage :: Maybe Text
$sel:resourceId:ListBudgetsForResource' :: ListBudgetsForResource -> Text
$sel:pageSize:ListBudgetsForResource' :: ListBudgetsForResource -> Maybe Natural
$sel:pageToken:ListBudgetsForResource' :: ListBudgetsForResource -> Maybe Text
$sel:acceptLanguage:ListBudgetsForResource' :: ListBudgetsForResource -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"AcceptLanguage" 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
acceptLanguage,
            (Text
"PageToken" 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
pageToken,
            (Text
"PageSize" 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
pageSize,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceId)
          ]
      )

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

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

-- | /See:/ 'newListBudgetsForResourceResponse' smart constructor.
data ListBudgetsForResourceResponse = ListBudgetsForResourceResponse'
  { -- | The page token to use to retrieve the next set of results. If there are
    -- no additional results, this value is null.
    ListBudgetsForResourceResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
    -- | Information about the associated budgets.
    ListBudgetsForResourceResponse -> Maybe [BudgetDetail]
budgets :: Prelude.Maybe [BudgetDetail],
    -- | The response's http status code.
    ListBudgetsForResourceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListBudgetsForResourceResponse
-> ListBudgetsForResourceResponse -> Bool
(ListBudgetsForResourceResponse
 -> ListBudgetsForResourceResponse -> Bool)
-> (ListBudgetsForResourceResponse
    -> ListBudgetsForResourceResponse -> Bool)
-> Eq ListBudgetsForResourceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListBudgetsForResourceResponse
-> ListBudgetsForResourceResponse -> Bool
$c/= :: ListBudgetsForResourceResponse
-> ListBudgetsForResourceResponse -> Bool
== :: ListBudgetsForResourceResponse
-> ListBudgetsForResourceResponse -> Bool
$c== :: ListBudgetsForResourceResponse
-> ListBudgetsForResourceResponse -> Bool
Prelude.Eq, ReadPrec [ListBudgetsForResourceResponse]
ReadPrec ListBudgetsForResourceResponse
Int -> ReadS ListBudgetsForResourceResponse
ReadS [ListBudgetsForResourceResponse]
(Int -> ReadS ListBudgetsForResourceResponse)
-> ReadS [ListBudgetsForResourceResponse]
-> ReadPrec ListBudgetsForResourceResponse
-> ReadPrec [ListBudgetsForResourceResponse]
-> Read ListBudgetsForResourceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListBudgetsForResourceResponse]
$creadListPrec :: ReadPrec [ListBudgetsForResourceResponse]
readPrec :: ReadPrec ListBudgetsForResourceResponse
$creadPrec :: ReadPrec ListBudgetsForResourceResponse
readList :: ReadS [ListBudgetsForResourceResponse]
$creadList :: ReadS [ListBudgetsForResourceResponse]
readsPrec :: Int -> ReadS ListBudgetsForResourceResponse
$creadsPrec :: Int -> ReadS ListBudgetsForResourceResponse
Prelude.Read, Int -> ListBudgetsForResourceResponse -> ShowS
[ListBudgetsForResourceResponse] -> ShowS
ListBudgetsForResourceResponse -> String
(Int -> ListBudgetsForResourceResponse -> ShowS)
-> (ListBudgetsForResourceResponse -> String)
-> ([ListBudgetsForResourceResponse] -> ShowS)
-> Show ListBudgetsForResourceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListBudgetsForResourceResponse] -> ShowS
$cshowList :: [ListBudgetsForResourceResponse] -> ShowS
show :: ListBudgetsForResourceResponse -> String
$cshow :: ListBudgetsForResourceResponse -> String
showsPrec :: Int -> ListBudgetsForResourceResponse -> ShowS
$cshowsPrec :: Int -> ListBudgetsForResourceResponse -> ShowS
Prelude.Show, (forall x.
 ListBudgetsForResourceResponse
 -> Rep ListBudgetsForResourceResponse x)
-> (forall x.
    Rep ListBudgetsForResourceResponse x
    -> ListBudgetsForResourceResponse)
-> Generic ListBudgetsForResourceResponse
forall x.
Rep ListBudgetsForResourceResponse x
-> ListBudgetsForResourceResponse
forall x.
ListBudgetsForResourceResponse
-> Rep ListBudgetsForResourceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListBudgetsForResourceResponse x
-> ListBudgetsForResourceResponse
$cfrom :: forall x.
ListBudgetsForResourceResponse
-> Rep ListBudgetsForResourceResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListBudgetsForResourceResponse' 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', 'listBudgetsForResourceResponse_nextPageToken' - The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
--
-- 'budgets', 'listBudgetsForResourceResponse_budgets' - Information about the associated budgets.
--
-- 'httpStatus', 'listBudgetsForResourceResponse_httpStatus' - The response's http status code.
newListBudgetsForResourceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListBudgetsForResourceResponse
newListBudgetsForResourceResponse :: Int -> ListBudgetsForResourceResponse
newListBudgetsForResourceResponse Int
pHttpStatus_ =
  ListBudgetsForResourceResponse' :: Maybe Text
-> Maybe [BudgetDetail] -> Int -> ListBudgetsForResourceResponse
ListBudgetsForResourceResponse'
    { $sel:nextPageToken:ListBudgetsForResourceResponse' :: Maybe Text
nextPageToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:budgets:ListBudgetsForResourceResponse' :: Maybe [BudgetDetail]
budgets = Maybe [BudgetDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListBudgetsForResourceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The page token to use to retrieve the next set of results. If there are
-- no additional results, this value is null.
listBudgetsForResourceResponse_nextPageToken :: Lens.Lens' ListBudgetsForResourceResponse (Prelude.Maybe Prelude.Text)
listBudgetsForResourceResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> ListBudgetsForResourceResponse
-> f ListBudgetsForResourceResponse
listBudgetsForResourceResponse_nextPageToken = (ListBudgetsForResourceResponse -> Maybe Text)
-> (ListBudgetsForResourceResponse
    -> Maybe Text -> ListBudgetsForResourceResponse)
-> Lens
     ListBudgetsForResourceResponse
     ListBudgetsForResourceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBudgetsForResourceResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:ListBudgetsForResourceResponse' :: ListBudgetsForResourceResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: ListBudgetsForResourceResponse
s@ListBudgetsForResourceResponse' {} Maybe Text
a -> ListBudgetsForResourceResponse
s {$sel:nextPageToken:ListBudgetsForResourceResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: ListBudgetsForResourceResponse)

-- | Information about the associated budgets.
listBudgetsForResourceResponse_budgets :: Lens.Lens' ListBudgetsForResourceResponse (Prelude.Maybe [BudgetDetail])
listBudgetsForResourceResponse_budgets :: (Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
-> ListBudgetsForResourceResponse
-> f ListBudgetsForResourceResponse
listBudgetsForResourceResponse_budgets = (ListBudgetsForResourceResponse -> Maybe [BudgetDetail])
-> (ListBudgetsForResourceResponse
    -> Maybe [BudgetDetail] -> ListBudgetsForResourceResponse)
-> Lens
     ListBudgetsForResourceResponse
     ListBudgetsForResourceResponse
     (Maybe [BudgetDetail])
     (Maybe [BudgetDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListBudgetsForResourceResponse' {Maybe [BudgetDetail]
budgets :: Maybe [BudgetDetail]
$sel:budgets:ListBudgetsForResourceResponse' :: ListBudgetsForResourceResponse -> Maybe [BudgetDetail]
budgets} -> Maybe [BudgetDetail]
budgets) (\s :: ListBudgetsForResourceResponse
s@ListBudgetsForResourceResponse' {} Maybe [BudgetDetail]
a -> ListBudgetsForResourceResponse
s {$sel:budgets:ListBudgetsForResourceResponse' :: Maybe [BudgetDetail]
budgets = Maybe [BudgetDetail]
a} :: ListBudgetsForResourceResponse) ((Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
 -> ListBudgetsForResourceResponse
 -> f ListBudgetsForResourceResponse)
-> ((Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
    -> Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
-> (Maybe [BudgetDetail] -> f (Maybe [BudgetDetail]))
-> ListBudgetsForResourceResponse
-> f ListBudgetsForResourceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [BudgetDetail] [BudgetDetail] [BudgetDetail] [BudgetDetail]
-> Iso
     (Maybe [BudgetDetail])
     (Maybe [BudgetDetail])
     (Maybe [BudgetDetail])
     (Maybe [BudgetDetail])
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 [BudgetDetail] [BudgetDetail] [BudgetDetail] [BudgetDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListBudgetsForResourceResponse