{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# 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.Types.BudgetDetail
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.ServiceCatalog.Types.BudgetDetail where

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

-- | Information about a budget.
--
-- /See:/ 'newBudgetDetail' smart constructor.
data BudgetDetail = BudgetDetail'
  { -- | Name of the associated budget.
    BudgetDetail -> Maybe Text
budgetName :: Prelude.Maybe Prelude.Text
  }
  deriving (BudgetDetail -> BudgetDetail -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BudgetDetail -> BudgetDetail -> Bool
$c/= :: BudgetDetail -> BudgetDetail -> Bool
== :: BudgetDetail -> BudgetDetail -> Bool
$c== :: BudgetDetail -> BudgetDetail -> Bool
Prelude.Eq, ReadPrec [BudgetDetail]
ReadPrec BudgetDetail
Int -> ReadS BudgetDetail
ReadS [BudgetDetail]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BudgetDetail]
$creadListPrec :: ReadPrec [BudgetDetail]
readPrec :: ReadPrec BudgetDetail
$creadPrec :: ReadPrec BudgetDetail
readList :: ReadS [BudgetDetail]
$creadList :: ReadS [BudgetDetail]
readsPrec :: Int -> ReadS BudgetDetail
$creadsPrec :: Int -> ReadS BudgetDetail
Prelude.Read, Int -> BudgetDetail -> ShowS
[BudgetDetail] -> ShowS
BudgetDetail -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BudgetDetail] -> ShowS
$cshowList :: [BudgetDetail] -> ShowS
show :: BudgetDetail -> String
$cshow :: BudgetDetail -> String
showsPrec :: Int -> BudgetDetail -> ShowS
$cshowsPrec :: Int -> BudgetDetail -> ShowS
Prelude.Show, forall x. Rep BudgetDetail x -> BudgetDetail
forall x. BudgetDetail -> Rep BudgetDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BudgetDetail x -> BudgetDetail
$cfrom :: forall x. BudgetDetail -> Rep BudgetDetail x
Prelude.Generic)

-- |
-- Create a value of 'BudgetDetail' 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:
--
-- 'budgetName', 'budgetDetail_budgetName' - Name of the associated budget.
newBudgetDetail ::
  BudgetDetail
newBudgetDetail :: BudgetDetail
newBudgetDetail =
  BudgetDetail' {$sel:budgetName:BudgetDetail' :: Maybe Text
budgetName = forall a. Maybe a
Prelude.Nothing}

-- | Name of the associated budget.
budgetDetail_budgetName :: Lens.Lens' BudgetDetail (Prelude.Maybe Prelude.Text)
budgetDetail_budgetName :: Lens' BudgetDetail (Maybe Text)
budgetDetail_budgetName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BudgetDetail' {Maybe Text
budgetName :: Maybe Text
$sel:budgetName:BudgetDetail' :: BudgetDetail -> Maybe Text
budgetName} -> Maybe Text
budgetName) (\s :: BudgetDetail
s@BudgetDetail' {} Maybe Text
a -> BudgetDetail
s {$sel:budgetName:BudgetDetail' :: Maybe Text
budgetName = Maybe Text
a} :: BudgetDetail)

instance Data.FromJSON BudgetDetail where
  parseJSON :: Value -> Parser BudgetDetail
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BudgetDetail"
      ( \Object
x ->
          Maybe Text -> BudgetDetail
BudgetDetail' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"BudgetName")
      )

instance Prelude.Hashable BudgetDetail where
  hashWithSalt :: Int -> BudgetDetail -> Int
hashWithSalt Int
_salt BudgetDetail' {Maybe Text
budgetName :: Maybe Text
$sel:budgetName:BudgetDetail' :: BudgetDetail -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
budgetName

instance Prelude.NFData BudgetDetail where
  rnf :: BudgetDetail -> ()
rnf BudgetDetail' {Maybe Text
budgetName :: Maybe Text
$sel:budgetName:BudgetDetail' :: BudgetDetail -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
budgetName