{-# 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.TerminateRecommendationDetail
-- 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.TerminateRecommendationDetail where

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

-- | Details on termination recommendation.
--
-- /See:/ 'newTerminateRecommendationDetail' smart constructor.
data TerminateRecommendationDetail = TerminateRecommendationDetail'
  { -- | The currency code that Amazon Web Services used to calculate the costs
    -- for this instance.
    TerminateRecommendationDetail -> Maybe Text
currencyCode :: Prelude.Maybe Prelude.Text,
    -- | The estimated savings that result from modification, on a monthly basis.
    TerminateRecommendationDetail -> Maybe Text
estimatedMonthlySavings :: Prelude.Maybe Prelude.Text
  }
  deriving (TerminateRecommendationDetail
-> TerminateRecommendationDetail -> Bool
(TerminateRecommendationDetail
 -> TerminateRecommendationDetail -> Bool)
-> (TerminateRecommendationDetail
    -> TerminateRecommendationDetail -> Bool)
-> Eq TerminateRecommendationDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TerminateRecommendationDetail
-> TerminateRecommendationDetail -> Bool
$c/= :: TerminateRecommendationDetail
-> TerminateRecommendationDetail -> Bool
== :: TerminateRecommendationDetail
-> TerminateRecommendationDetail -> Bool
$c== :: TerminateRecommendationDetail
-> TerminateRecommendationDetail -> Bool
Prelude.Eq, ReadPrec [TerminateRecommendationDetail]
ReadPrec TerminateRecommendationDetail
Int -> ReadS TerminateRecommendationDetail
ReadS [TerminateRecommendationDetail]
(Int -> ReadS TerminateRecommendationDetail)
-> ReadS [TerminateRecommendationDetail]
-> ReadPrec TerminateRecommendationDetail
-> ReadPrec [TerminateRecommendationDetail]
-> Read TerminateRecommendationDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TerminateRecommendationDetail]
$creadListPrec :: ReadPrec [TerminateRecommendationDetail]
readPrec :: ReadPrec TerminateRecommendationDetail
$creadPrec :: ReadPrec TerminateRecommendationDetail
readList :: ReadS [TerminateRecommendationDetail]
$creadList :: ReadS [TerminateRecommendationDetail]
readsPrec :: Int -> ReadS TerminateRecommendationDetail
$creadsPrec :: Int -> ReadS TerminateRecommendationDetail
Prelude.Read, Int -> TerminateRecommendationDetail -> ShowS
[TerminateRecommendationDetail] -> ShowS
TerminateRecommendationDetail -> String
(Int -> TerminateRecommendationDetail -> ShowS)
-> (TerminateRecommendationDetail -> String)
-> ([TerminateRecommendationDetail] -> ShowS)
-> Show TerminateRecommendationDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TerminateRecommendationDetail] -> ShowS
$cshowList :: [TerminateRecommendationDetail] -> ShowS
show :: TerminateRecommendationDetail -> String
$cshow :: TerminateRecommendationDetail -> String
showsPrec :: Int -> TerminateRecommendationDetail -> ShowS
$cshowsPrec :: Int -> TerminateRecommendationDetail -> ShowS
Prelude.Show, (forall x.
 TerminateRecommendationDetail
 -> Rep TerminateRecommendationDetail x)
-> (forall x.
    Rep TerminateRecommendationDetail x
    -> TerminateRecommendationDetail)
-> Generic TerminateRecommendationDetail
forall x.
Rep TerminateRecommendationDetail x
-> TerminateRecommendationDetail
forall x.
TerminateRecommendationDetail
-> Rep TerminateRecommendationDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep TerminateRecommendationDetail x
-> TerminateRecommendationDetail
$cfrom :: forall x.
TerminateRecommendationDetail
-> Rep TerminateRecommendationDetail x
Prelude.Generic)

-- |
-- Create a value of 'TerminateRecommendationDetail' 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', 'terminateRecommendationDetail_currencyCode' - The currency code that Amazon Web Services used to calculate the costs
-- for this instance.
--
-- 'estimatedMonthlySavings', 'terminateRecommendationDetail_estimatedMonthlySavings' - The estimated savings that result from modification, on a monthly basis.
newTerminateRecommendationDetail ::
  TerminateRecommendationDetail
newTerminateRecommendationDetail :: TerminateRecommendationDetail
newTerminateRecommendationDetail =
  TerminateRecommendationDetail' :: Maybe Text -> Maybe Text -> TerminateRecommendationDetail
TerminateRecommendationDetail'
    { $sel:currencyCode:TerminateRecommendationDetail' :: Maybe Text
currencyCode =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:estimatedMonthlySavings:TerminateRecommendationDetail' :: Maybe Text
estimatedMonthlySavings = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The currency code that Amazon Web Services used to calculate the costs
-- for this instance.
terminateRecommendationDetail_currencyCode :: Lens.Lens' TerminateRecommendationDetail (Prelude.Maybe Prelude.Text)
terminateRecommendationDetail_currencyCode :: (Maybe Text -> f (Maybe Text))
-> TerminateRecommendationDetail -> f TerminateRecommendationDetail
terminateRecommendationDetail_currencyCode = (TerminateRecommendationDetail -> Maybe Text)
-> (TerminateRecommendationDetail
    -> Maybe Text -> TerminateRecommendationDetail)
-> Lens
     TerminateRecommendationDetail
     TerminateRecommendationDetail
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateRecommendationDetail' {Maybe Text
currencyCode :: Maybe Text
$sel:currencyCode:TerminateRecommendationDetail' :: TerminateRecommendationDetail -> Maybe Text
currencyCode} -> Maybe Text
currencyCode) (\s :: TerminateRecommendationDetail
s@TerminateRecommendationDetail' {} Maybe Text
a -> TerminateRecommendationDetail
s {$sel:currencyCode:TerminateRecommendationDetail' :: Maybe Text
currencyCode = Maybe Text
a} :: TerminateRecommendationDetail)

-- | The estimated savings that result from modification, on a monthly basis.
terminateRecommendationDetail_estimatedMonthlySavings :: Lens.Lens' TerminateRecommendationDetail (Prelude.Maybe Prelude.Text)
terminateRecommendationDetail_estimatedMonthlySavings :: (Maybe Text -> f (Maybe Text))
-> TerminateRecommendationDetail -> f TerminateRecommendationDetail
terminateRecommendationDetail_estimatedMonthlySavings = (TerminateRecommendationDetail -> Maybe Text)
-> (TerminateRecommendationDetail
    -> Maybe Text -> TerminateRecommendationDetail)
-> Lens
     TerminateRecommendationDetail
     TerminateRecommendationDetail
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TerminateRecommendationDetail' {Maybe Text
estimatedMonthlySavings :: Maybe Text
$sel:estimatedMonthlySavings:TerminateRecommendationDetail' :: TerminateRecommendationDetail -> Maybe Text
estimatedMonthlySavings} -> Maybe Text
estimatedMonthlySavings) (\s :: TerminateRecommendationDetail
s@TerminateRecommendationDetail' {} Maybe Text
a -> TerminateRecommendationDetail
s {$sel:estimatedMonthlySavings:TerminateRecommendationDetail' :: Maybe Text
estimatedMonthlySavings = Maybe Text
a} :: TerminateRecommendationDetail)

instance Core.FromJSON TerminateRecommendationDetail where
  parseJSON :: Value -> Parser TerminateRecommendationDetail
parseJSON =
    String
-> (Object -> Parser TerminateRecommendationDetail)
-> Value
-> Parser TerminateRecommendationDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TerminateRecommendationDetail"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> TerminateRecommendationDetail
TerminateRecommendationDetail'
            (Maybe Text -> Maybe Text -> TerminateRecommendationDetail)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> TerminateRecommendationDetail)
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 -> TerminateRecommendationDetail)
-> Parser (Maybe Text) -> Parser TerminateRecommendationDetail
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
"EstimatedMonthlySavings")
      )

instance
  Prelude.Hashable
    TerminateRecommendationDetail

instance Prelude.NFData TerminateRecommendationDetail