{-# 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-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)
module Amazonka.ServiceCatalog.Types.BudgetDetail where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(BudgetDetail -> BudgetDetail -> Bool)
-> (BudgetDetail -> BudgetDetail -> Bool) -> Eq BudgetDetail
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]
(Int -> ReadS BudgetDetail)
-> ReadS [BudgetDetail]
-> ReadPrec BudgetDetail
-> ReadPrec [BudgetDetail]
-> Read 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
(Int -> BudgetDetail -> ShowS)
-> (BudgetDetail -> String)
-> ([BudgetDetail] -> ShowS)
-> Show BudgetDetail
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. BudgetDetail -> Rep BudgetDetail x)
-> (forall x. Rep BudgetDetail x -> BudgetDetail)
-> Generic BudgetDetail
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' :: Maybe Text -> BudgetDetail
BudgetDetail' {$sel:budgetName:BudgetDetail' :: Maybe Text
budgetName = Maybe Text
forall a. Maybe a
Prelude.Nothing}

-- | Name of the associated budget.
budgetDetail_budgetName :: Lens.Lens' BudgetDetail (Prelude.Maybe Prelude.Text)
budgetDetail_budgetName :: (Maybe Text -> f (Maybe Text)) -> BudgetDetail -> f BudgetDetail
budgetDetail_budgetName = (BudgetDetail -> Maybe Text)
-> (BudgetDetail -> Maybe Text -> BudgetDetail)
-> Lens BudgetDetail BudgetDetail (Maybe Text) (Maybe Text)
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 Core.FromJSON BudgetDetail where
  parseJSON :: Value -> Parser BudgetDetail
parseJSON =
    String
-> (Object -> Parser BudgetDetail) -> Value -> Parser BudgetDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BudgetDetail"
      ( \Object
x ->
          Maybe Text -> BudgetDetail
BudgetDetail' (Maybe Text -> BudgetDetail)
-> Parser (Maybe Text) -> Parser BudgetDetail
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BudgetName")
      )

instance Prelude.Hashable BudgetDetail

instance Prelude.NFData BudgetDetail