{-# 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.BillingConductor.Types.BillingGroupCostReportElement
-- 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.BillingConductor.Types.BillingGroupCostReportElement 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

-- | A summary report of actual Amazon Web Services charges and calculated
-- Amazon Web Services charges, based on the associated pricing plan of a
-- billing group.
--
-- /See:/ 'newBillingGroupCostReportElement' smart constructor.
data BillingGroupCostReportElement = BillingGroupCostReportElement'
  { -- | The actual Amazon Web Services charges for the billing group.
    BillingGroupCostReportElement -> Maybe Text
aWSCost :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of a billing group.
    BillingGroupCostReportElement -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The displayed currency.
    BillingGroupCostReportElement -> Maybe Text
currency :: Prelude.Maybe Prelude.Text,
    -- | The billing group margin.
    BillingGroupCostReportElement -> Maybe Text
margin :: Prelude.Maybe Prelude.Text,
    -- | The percentage of billing group margin.
    BillingGroupCostReportElement -> Maybe Text
marginPercentage :: Prelude.Maybe Prelude.Text,
    -- | The hypothetical Amazon Web Services charges based on the associated
    -- pricing plan of a billing group.
    BillingGroupCostReportElement -> Maybe Text
proformaCost :: Prelude.Maybe Prelude.Text
  }
  deriving (BillingGroupCostReportElement
-> BillingGroupCostReportElement -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BillingGroupCostReportElement
-> BillingGroupCostReportElement -> Bool
$c/= :: BillingGroupCostReportElement
-> BillingGroupCostReportElement -> Bool
== :: BillingGroupCostReportElement
-> BillingGroupCostReportElement -> Bool
$c== :: BillingGroupCostReportElement
-> BillingGroupCostReportElement -> Bool
Prelude.Eq, ReadPrec [BillingGroupCostReportElement]
ReadPrec BillingGroupCostReportElement
Int -> ReadS BillingGroupCostReportElement
ReadS [BillingGroupCostReportElement]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BillingGroupCostReportElement]
$creadListPrec :: ReadPrec [BillingGroupCostReportElement]
readPrec :: ReadPrec BillingGroupCostReportElement
$creadPrec :: ReadPrec BillingGroupCostReportElement
readList :: ReadS [BillingGroupCostReportElement]
$creadList :: ReadS [BillingGroupCostReportElement]
readsPrec :: Int -> ReadS BillingGroupCostReportElement
$creadsPrec :: Int -> ReadS BillingGroupCostReportElement
Prelude.Read, Int -> BillingGroupCostReportElement -> ShowS
[BillingGroupCostReportElement] -> ShowS
BillingGroupCostReportElement -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BillingGroupCostReportElement] -> ShowS
$cshowList :: [BillingGroupCostReportElement] -> ShowS
show :: BillingGroupCostReportElement -> String
$cshow :: BillingGroupCostReportElement -> String
showsPrec :: Int -> BillingGroupCostReportElement -> ShowS
$cshowsPrec :: Int -> BillingGroupCostReportElement -> ShowS
Prelude.Show, forall x.
Rep BillingGroupCostReportElement x
-> BillingGroupCostReportElement
forall x.
BillingGroupCostReportElement
-> Rep BillingGroupCostReportElement x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BillingGroupCostReportElement x
-> BillingGroupCostReportElement
$cfrom :: forall x.
BillingGroupCostReportElement
-> Rep BillingGroupCostReportElement x
Prelude.Generic)

-- |
-- Create a value of 'BillingGroupCostReportElement' 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:
--
-- 'aWSCost', 'billingGroupCostReportElement_aWSCost' - The actual Amazon Web Services charges for the billing group.
--
-- 'arn', 'billingGroupCostReportElement_arn' - The Amazon Resource Name (ARN) of a billing group.
--
-- 'currency', 'billingGroupCostReportElement_currency' - The displayed currency.
--
-- 'margin', 'billingGroupCostReportElement_margin' - The billing group margin.
--
-- 'marginPercentage', 'billingGroupCostReportElement_marginPercentage' - The percentage of billing group margin.
--
-- 'proformaCost', 'billingGroupCostReportElement_proformaCost' - The hypothetical Amazon Web Services charges based on the associated
-- pricing plan of a billing group.
newBillingGroupCostReportElement ::
  BillingGroupCostReportElement
newBillingGroupCostReportElement :: BillingGroupCostReportElement
newBillingGroupCostReportElement =
  BillingGroupCostReportElement'
    { $sel:aWSCost:BillingGroupCostReportElement' :: Maybe Text
aWSCost =
        forall a. Maybe a
Prelude.Nothing,
      $sel:arn:BillingGroupCostReportElement' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:currency:BillingGroupCostReportElement' :: Maybe Text
currency = forall a. Maybe a
Prelude.Nothing,
      $sel:margin:BillingGroupCostReportElement' :: Maybe Text
margin = forall a. Maybe a
Prelude.Nothing,
      $sel:marginPercentage:BillingGroupCostReportElement' :: Maybe Text
marginPercentage = forall a. Maybe a
Prelude.Nothing,
      $sel:proformaCost:BillingGroupCostReportElement' :: Maybe Text
proformaCost = forall a. Maybe a
Prelude.Nothing
    }

-- | The actual Amazon Web Services charges for the billing group.
billingGroupCostReportElement_aWSCost :: Lens.Lens' BillingGroupCostReportElement (Prelude.Maybe Prelude.Text)
billingGroupCostReportElement_aWSCost :: Lens' BillingGroupCostReportElement (Maybe Text)
billingGroupCostReportElement_aWSCost = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingGroupCostReportElement' {Maybe Text
aWSCost :: Maybe Text
$sel:aWSCost:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
aWSCost} -> Maybe Text
aWSCost) (\s :: BillingGroupCostReportElement
s@BillingGroupCostReportElement' {} Maybe Text
a -> BillingGroupCostReportElement
s {$sel:aWSCost:BillingGroupCostReportElement' :: Maybe Text
aWSCost = Maybe Text
a} :: BillingGroupCostReportElement)

-- | The Amazon Resource Name (ARN) of a billing group.
billingGroupCostReportElement_arn :: Lens.Lens' BillingGroupCostReportElement (Prelude.Maybe Prelude.Text)
billingGroupCostReportElement_arn :: Lens' BillingGroupCostReportElement (Maybe Text)
billingGroupCostReportElement_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingGroupCostReportElement' {Maybe Text
arn :: Maybe Text
$sel:arn:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
arn} -> Maybe Text
arn) (\s :: BillingGroupCostReportElement
s@BillingGroupCostReportElement' {} Maybe Text
a -> BillingGroupCostReportElement
s {$sel:arn:BillingGroupCostReportElement' :: Maybe Text
arn = Maybe Text
a} :: BillingGroupCostReportElement)

-- | The displayed currency.
billingGroupCostReportElement_currency :: Lens.Lens' BillingGroupCostReportElement (Prelude.Maybe Prelude.Text)
billingGroupCostReportElement_currency :: Lens' BillingGroupCostReportElement (Maybe Text)
billingGroupCostReportElement_currency = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingGroupCostReportElement' {Maybe Text
currency :: Maybe Text
$sel:currency:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
currency} -> Maybe Text
currency) (\s :: BillingGroupCostReportElement
s@BillingGroupCostReportElement' {} Maybe Text
a -> BillingGroupCostReportElement
s {$sel:currency:BillingGroupCostReportElement' :: Maybe Text
currency = Maybe Text
a} :: BillingGroupCostReportElement)

-- | The billing group margin.
billingGroupCostReportElement_margin :: Lens.Lens' BillingGroupCostReportElement (Prelude.Maybe Prelude.Text)
billingGroupCostReportElement_margin :: Lens' BillingGroupCostReportElement (Maybe Text)
billingGroupCostReportElement_margin = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingGroupCostReportElement' {Maybe Text
margin :: Maybe Text
$sel:margin:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
margin} -> Maybe Text
margin) (\s :: BillingGroupCostReportElement
s@BillingGroupCostReportElement' {} Maybe Text
a -> BillingGroupCostReportElement
s {$sel:margin:BillingGroupCostReportElement' :: Maybe Text
margin = Maybe Text
a} :: BillingGroupCostReportElement)

-- | The percentage of billing group margin.
billingGroupCostReportElement_marginPercentage :: Lens.Lens' BillingGroupCostReportElement (Prelude.Maybe Prelude.Text)
billingGroupCostReportElement_marginPercentage :: Lens' BillingGroupCostReportElement (Maybe Text)
billingGroupCostReportElement_marginPercentage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingGroupCostReportElement' {Maybe Text
marginPercentage :: Maybe Text
$sel:marginPercentage:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
marginPercentage} -> Maybe Text
marginPercentage) (\s :: BillingGroupCostReportElement
s@BillingGroupCostReportElement' {} Maybe Text
a -> BillingGroupCostReportElement
s {$sel:marginPercentage:BillingGroupCostReportElement' :: Maybe Text
marginPercentage = Maybe Text
a} :: BillingGroupCostReportElement)

-- | The hypothetical Amazon Web Services charges based on the associated
-- pricing plan of a billing group.
billingGroupCostReportElement_proformaCost :: Lens.Lens' BillingGroupCostReportElement (Prelude.Maybe Prelude.Text)
billingGroupCostReportElement_proformaCost :: Lens' BillingGroupCostReportElement (Maybe Text)
billingGroupCostReportElement_proformaCost = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BillingGroupCostReportElement' {Maybe Text
proformaCost :: Maybe Text
$sel:proformaCost:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
proformaCost} -> Maybe Text
proformaCost) (\s :: BillingGroupCostReportElement
s@BillingGroupCostReportElement' {} Maybe Text
a -> BillingGroupCostReportElement
s {$sel:proformaCost:BillingGroupCostReportElement' :: Maybe Text
proformaCost = Maybe Text
a} :: BillingGroupCostReportElement)

instance Data.FromJSON BillingGroupCostReportElement where
  parseJSON :: Value -> Parser BillingGroupCostReportElement
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BillingGroupCostReportElement"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> BillingGroupCostReportElement
BillingGroupCostReportElement'
            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
"AWSCost")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Currency")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Margin")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"MarginPercentage")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ProformaCost")
      )

instance
  Prelude.Hashable
    BillingGroupCostReportElement
  where
  hashWithSalt :: Int -> BillingGroupCostReportElement -> Int
hashWithSalt Int
_salt BillingGroupCostReportElement' {Maybe Text
proformaCost :: Maybe Text
marginPercentage :: Maybe Text
margin :: Maybe Text
currency :: Maybe Text
arn :: Maybe Text
aWSCost :: Maybe Text
$sel:proformaCost:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:marginPercentage:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:margin:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:currency:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:arn:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:aWSCost:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
aWSCost
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
currency
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
margin
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marginPercentage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
proformaCost

instance Prelude.NFData BillingGroupCostReportElement where
  rnf :: BillingGroupCostReportElement -> ()
rnf BillingGroupCostReportElement' {Maybe Text
proformaCost :: Maybe Text
marginPercentage :: Maybe Text
margin :: Maybe Text
currency :: Maybe Text
arn :: Maybe Text
aWSCost :: Maybe Text
$sel:proformaCost:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:marginPercentage:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:margin:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:currency:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:arn:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
$sel:aWSCost:BillingGroupCostReportElement' :: BillingGroupCostReportElement -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
aWSCost
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
currency
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
margin
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marginPercentage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
proformaCost