{-# 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.CostExplorer.Types.ReservationPurchaseRecommendationSummary
-- 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.CostExplorer.Types.ReservationPurchaseRecommendationSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A summary about this recommendation, such as the currency code, the
-- amount that Amazon Web Services estimates that you could save, and the
-- total amount of reservation to purchase.
--
-- /See:/ 'newReservationPurchaseRecommendationSummary' smart constructor.
data ReservationPurchaseRecommendationSummary = ReservationPurchaseRecommendationSummary'
  { -- | The currency code used for this recommendation.
    ReservationPurchaseRecommendationSummary -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | The total amount that Amazon Web Services estimates that this
    -- recommendation could save you in a month, as a percentage of your costs.
    ReservationPurchaseRecommendationSummary -> Maybe Text
totalEstimatedMonthlySavingsPercentage :: Prelude.Maybe Prelude.Text,
    -- | The total amount that Amazon Web Services estimates that this
    -- recommendation could save you in a month.
    ReservationPurchaseRecommendationSummary -> Maybe Text
totalEstimatedMonthlySavingsAmount :: Prelude.Maybe Prelude.Text
  }
  deriving (ReservationPurchaseRecommendationSummary
-> ReservationPurchaseRecommendationSummary -> Bool
(ReservationPurchaseRecommendationSummary
 -> ReservationPurchaseRecommendationSummary -> Bool)
-> (ReservationPurchaseRecommendationSummary
    -> ReservationPurchaseRecommendationSummary -> Bool)
-> Eq ReservationPurchaseRecommendationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservationPurchaseRecommendationSummary
-> ReservationPurchaseRecommendationSummary -> Bool
$c/= :: ReservationPurchaseRecommendationSummary
-> ReservationPurchaseRecommendationSummary -> Bool
== :: ReservationPurchaseRecommendationSummary
-> ReservationPurchaseRecommendationSummary -> Bool
$c== :: ReservationPurchaseRecommendationSummary
-> ReservationPurchaseRecommendationSummary -> Bool
Prelude.Eq, ReadPrec [ReservationPurchaseRecommendationSummary]
ReadPrec ReservationPurchaseRecommendationSummary
Int -> ReadS ReservationPurchaseRecommendationSummary
ReadS [ReservationPurchaseRecommendationSummary]
(Int -> ReadS ReservationPurchaseRecommendationSummary)
-> ReadS [ReservationPurchaseRecommendationSummary]
-> ReadPrec ReservationPurchaseRecommendationSummary
-> ReadPrec [ReservationPurchaseRecommendationSummary]
-> Read ReservationPurchaseRecommendationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservationPurchaseRecommendationSummary]
$creadListPrec :: ReadPrec [ReservationPurchaseRecommendationSummary]
readPrec :: ReadPrec ReservationPurchaseRecommendationSummary
$creadPrec :: ReadPrec ReservationPurchaseRecommendationSummary
readList :: ReadS [ReservationPurchaseRecommendationSummary]
$creadList :: ReadS [ReservationPurchaseRecommendationSummary]
readsPrec :: Int -> ReadS ReservationPurchaseRecommendationSummary
$creadsPrec :: Int -> ReadS ReservationPurchaseRecommendationSummary
Prelude.Read, Int -> ReservationPurchaseRecommendationSummary -> ShowS
[ReservationPurchaseRecommendationSummary] -> ShowS
ReservationPurchaseRecommendationSummary -> String
(Int -> ReservationPurchaseRecommendationSummary -> ShowS)
-> (ReservationPurchaseRecommendationSummary -> String)
-> ([ReservationPurchaseRecommendationSummary] -> ShowS)
-> Show ReservationPurchaseRecommendationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservationPurchaseRecommendationSummary] -> ShowS
$cshowList :: [ReservationPurchaseRecommendationSummary] -> ShowS
show :: ReservationPurchaseRecommendationSummary -> String
$cshow :: ReservationPurchaseRecommendationSummary -> String
showsPrec :: Int -> ReservationPurchaseRecommendationSummary -> ShowS
$cshowsPrec :: Int -> ReservationPurchaseRecommendationSummary -> ShowS
Prelude.Show, (forall x.
 ReservationPurchaseRecommendationSummary
 -> Rep ReservationPurchaseRecommendationSummary x)
-> (forall x.
    Rep ReservationPurchaseRecommendationSummary x
    -> ReservationPurchaseRecommendationSummary)
-> Generic ReservationPurchaseRecommendationSummary
forall x.
Rep ReservationPurchaseRecommendationSummary x
-> ReservationPurchaseRecommendationSummary
forall x.
ReservationPurchaseRecommendationSummary
-> Rep ReservationPurchaseRecommendationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReservationPurchaseRecommendationSummary x
-> ReservationPurchaseRecommendationSummary
$cfrom :: forall x.
ReservationPurchaseRecommendationSummary
-> Rep ReservationPurchaseRecommendationSummary x
Prelude.Generic)

-- |
-- Create a value of 'ReservationPurchaseRecommendationSummary' 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:
--
-- 'currencyCode', 'reservationPurchaseRecommendationSummary_currencyCode' - The currency code used for this recommendation.
--
-- 'totalEstimatedMonthlySavingsPercentage', 'reservationPurchaseRecommendationSummary_totalEstimatedMonthlySavingsPercentage' - The total amount that Amazon Web Services estimates that this
-- recommendation could save you in a month, as a percentage of your costs.
--
-- 'totalEstimatedMonthlySavingsAmount', 'reservationPurchaseRecommendationSummary_totalEstimatedMonthlySavingsAmount' - The total amount that Amazon Web Services estimates that this
-- recommendation could save you in a month.
newReservationPurchaseRecommendationSummary ::
  ReservationPurchaseRecommendationSummary
newReservationPurchaseRecommendationSummary :: ReservationPurchaseRecommendationSummary
newReservationPurchaseRecommendationSummary =
  ReservationPurchaseRecommendationSummary' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> ReservationPurchaseRecommendationSummary
ReservationPurchaseRecommendationSummary'
    { $sel:currencyCode:ReservationPurchaseRecommendationSummary' :: Maybe Text
currencyCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:totalEstimatedMonthlySavingsPercentage:ReservationPurchaseRecommendationSummary' :: Maybe Text
totalEstimatedMonthlySavingsPercentage =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:totalEstimatedMonthlySavingsAmount:ReservationPurchaseRecommendationSummary' :: Maybe Text
totalEstimatedMonthlySavingsAmount =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The currency code used for this recommendation.
reservationPurchaseRecommendationSummary_currencyCode :: Lens.Lens' ReservationPurchaseRecommendationSummary (Prelude.Maybe Prelude.Text)
reservationPurchaseRecommendationSummary_currencyCode :: (Maybe Text -> f (Maybe Text))
-> ReservationPurchaseRecommendationSummary
-> f ReservationPurchaseRecommendationSummary
reservationPurchaseRecommendationSummary_currencyCode = (ReservationPurchaseRecommendationSummary -> Maybe Text)
-> (ReservationPurchaseRecommendationSummary
    -> Maybe Text -> ReservationPurchaseRecommendationSummary)
-> Lens
     ReservationPurchaseRecommendationSummary
     ReservationPurchaseRecommendationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPurchaseRecommendationSummary' {Maybe Text
currencyCode :: Maybe Text
$sel:currencyCode:ReservationPurchaseRecommendationSummary' :: ReservationPurchaseRecommendationSummary -> Maybe Text
currencyCode} -> Maybe Text
currencyCode) (\s :: ReservationPurchaseRecommendationSummary
s@ReservationPurchaseRecommendationSummary' {} Maybe Text
a -> ReservationPurchaseRecommendationSummary
s {$sel:currencyCode:ReservationPurchaseRecommendationSummary' :: Maybe Text
currencyCode = Maybe Text
a} :: ReservationPurchaseRecommendationSummary)

-- | The total amount that Amazon Web Services estimates that this
-- recommendation could save you in a month, as a percentage of your costs.
reservationPurchaseRecommendationSummary_totalEstimatedMonthlySavingsPercentage :: Lens.Lens' ReservationPurchaseRecommendationSummary (Prelude.Maybe Prelude.Text)
reservationPurchaseRecommendationSummary_totalEstimatedMonthlySavingsPercentage :: (Maybe Text -> f (Maybe Text))
-> ReservationPurchaseRecommendationSummary
-> f ReservationPurchaseRecommendationSummary
reservationPurchaseRecommendationSummary_totalEstimatedMonthlySavingsPercentage = (ReservationPurchaseRecommendationSummary -> Maybe Text)
-> (ReservationPurchaseRecommendationSummary
    -> Maybe Text -> ReservationPurchaseRecommendationSummary)
-> Lens
     ReservationPurchaseRecommendationSummary
     ReservationPurchaseRecommendationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPurchaseRecommendationSummary' {Maybe Text
totalEstimatedMonthlySavingsPercentage :: Maybe Text
$sel:totalEstimatedMonthlySavingsPercentage:ReservationPurchaseRecommendationSummary' :: ReservationPurchaseRecommendationSummary -> Maybe Text
totalEstimatedMonthlySavingsPercentage} -> Maybe Text
totalEstimatedMonthlySavingsPercentage) (\s :: ReservationPurchaseRecommendationSummary
s@ReservationPurchaseRecommendationSummary' {} Maybe Text
a -> ReservationPurchaseRecommendationSummary
s {$sel:totalEstimatedMonthlySavingsPercentage:ReservationPurchaseRecommendationSummary' :: Maybe Text
totalEstimatedMonthlySavingsPercentage = Maybe Text
a} :: ReservationPurchaseRecommendationSummary)

-- | The total amount that Amazon Web Services estimates that this
-- recommendation could save you in a month.
reservationPurchaseRecommendationSummary_totalEstimatedMonthlySavingsAmount :: Lens.Lens' ReservationPurchaseRecommendationSummary (Prelude.Maybe Prelude.Text)
reservationPurchaseRecommendationSummary_totalEstimatedMonthlySavingsAmount :: (Maybe Text -> f (Maybe Text))
-> ReservationPurchaseRecommendationSummary
-> f ReservationPurchaseRecommendationSummary
reservationPurchaseRecommendationSummary_totalEstimatedMonthlySavingsAmount = (ReservationPurchaseRecommendationSummary -> Maybe Text)
-> (ReservationPurchaseRecommendationSummary
    -> Maybe Text -> ReservationPurchaseRecommendationSummary)
-> Lens
     ReservationPurchaseRecommendationSummary
     ReservationPurchaseRecommendationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPurchaseRecommendationSummary' {Maybe Text
totalEstimatedMonthlySavingsAmount :: Maybe Text
$sel:totalEstimatedMonthlySavingsAmount:ReservationPurchaseRecommendationSummary' :: ReservationPurchaseRecommendationSummary -> Maybe Text
totalEstimatedMonthlySavingsAmount} -> Maybe Text
totalEstimatedMonthlySavingsAmount) (\s :: ReservationPurchaseRecommendationSummary
s@ReservationPurchaseRecommendationSummary' {} Maybe Text
a -> ReservationPurchaseRecommendationSummary
s {$sel:totalEstimatedMonthlySavingsAmount:ReservationPurchaseRecommendationSummary' :: Maybe Text
totalEstimatedMonthlySavingsAmount = Maybe Text
a} :: ReservationPurchaseRecommendationSummary)

instance
  Core.FromJSON
    ReservationPurchaseRecommendationSummary
  where
  parseJSON :: Value -> Parser ReservationPurchaseRecommendationSummary
parseJSON =
    String
-> (Object -> Parser ReservationPurchaseRecommendationSummary)
-> Value
-> Parser ReservationPurchaseRecommendationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ReservationPurchaseRecommendationSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> ReservationPurchaseRecommendationSummary
ReservationPurchaseRecommendationSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> ReservationPurchaseRecommendationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> ReservationPurchaseRecommendationSummary)
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
"CurrencyCode")
            Parser
  (Maybe Text
   -> Maybe Text -> ReservationPurchaseRecommendationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ReservationPurchaseRecommendationSummary)
forall (f :: * -> *) a b. Applicative f => 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
"TotalEstimatedMonthlySavingsPercentage")
            Parser (Maybe Text -> ReservationPurchaseRecommendationSummary)
-> Parser (Maybe Text)
-> Parser ReservationPurchaseRecommendationSummary
forall (f :: * -> *) a b. Applicative f => 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
"TotalEstimatedMonthlySavingsAmount")
      )

instance
  Prelude.Hashable
    ReservationPurchaseRecommendationSummary

instance
  Prelude.NFData
    ReservationPurchaseRecommendationSummary