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

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

-- | Metadata about your Savings Plans Purchase Recommendations.
--
-- /See:/ 'newSavingsPlansPurchaseRecommendationMetadata' smart constructor.
data SavingsPlansPurchaseRecommendationMetadata = SavingsPlansPurchaseRecommendationMetadata'
  { -- | The unique identifier for the recommendation set.
    SavingsPlansPurchaseRecommendationMetadata -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text,
    -- | The timestamp showing when the recommendations were generated.
    SavingsPlansPurchaseRecommendationMetadata -> Maybe Text
generationTimestamp :: Prelude.Maybe Prelude.Text,
    -- | Additional metadata that might be applicable to the recommendation.
    SavingsPlansPurchaseRecommendationMetadata -> Maybe Text
additionalMetadata :: Prelude.Maybe Prelude.Text
  }
  deriving (SavingsPlansPurchaseRecommendationMetadata
-> SavingsPlansPurchaseRecommendationMetadata -> Bool
(SavingsPlansPurchaseRecommendationMetadata
 -> SavingsPlansPurchaseRecommendationMetadata -> Bool)
-> (SavingsPlansPurchaseRecommendationMetadata
    -> SavingsPlansPurchaseRecommendationMetadata -> Bool)
-> Eq SavingsPlansPurchaseRecommendationMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SavingsPlansPurchaseRecommendationMetadata
-> SavingsPlansPurchaseRecommendationMetadata -> Bool
$c/= :: SavingsPlansPurchaseRecommendationMetadata
-> SavingsPlansPurchaseRecommendationMetadata -> Bool
== :: SavingsPlansPurchaseRecommendationMetadata
-> SavingsPlansPurchaseRecommendationMetadata -> Bool
$c== :: SavingsPlansPurchaseRecommendationMetadata
-> SavingsPlansPurchaseRecommendationMetadata -> Bool
Prelude.Eq, ReadPrec [SavingsPlansPurchaseRecommendationMetadata]
ReadPrec SavingsPlansPurchaseRecommendationMetadata
Int -> ReadS SavingsPlansPurchaseRecommendationMetadata
ReadS [SavingsPlansPurchaseRecommendationMetadata]
(Int -> ReadS SavingsPlansPurchaseRecommendationMetadata)
-> ReadS [SavingsPlansPurchaseRecommendationMetadata]
-> ReadPrec SavingsPlansPurchaseRecommendationMetadata
-> ReadPrec [SavingsPlansPurchaseRecommendationMetadata]
-> Read SavingsPlansPurchaseRecommendationMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SavingsPlansPurchaseRecommendationMetadata]
$creadListPrec :: ReadPrec [SavingsPlansPurchaseRecommendationMetadata]
readPrec :: ReadPrec SavingsPlansPurchaseRecommendationMetadata
$creadPrec :: ReadPrec SavingsPlansPurchaseRecommendationMetadata
readList :: ReadS [SavingsPlansPurchaseRecommendationMetadata]
$creadList :: ReadS [SavingsPlansPurchaseRecommendationMetadata]
readsPrec :: Int -> ReadS SavingsPlansPurchaseRecommendationMetadata
$creadsPrec :: Int -> ReadS SavingsPlansPurchaseRecommendationMetadata
Prelude.Read, Int -> SavingsPlansPurchaseRecommendationMetadata -> ShowS
[SavingsPlansPurchaseRecommendationMetadata] -> ShowS
SavingsPlansPurchaseRecommendationMetadata -> String
(Int -> SavingsPlansPurchaseRecommendationMetadata -> ShowS)
-> (SavingsPlansPurchaseRecommendationMetadata -> String)
-> ([SavingsPlansPurchaseRecommendationMetadata] -> ShowS)
-> Show SavingsPlansPurchaseRecommendationMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SavingsPlansPurchaseRecommendationMetadata] -> ShowS
$cshowList :: [SavingsPlansPurchaseRecommendationMetadata] -> ShowS
show :: SavingsPlansPurchaseRecommendationMetadata -> String
$cshow :: SavingsPlansPurchaseRecommendationMetadata -> String
showsPrec :: Int -> SavingsPlansPurchaseRecommendationMetadata -> ShowS
$cshowsPrec :: Int -> SavingsPlansPurchaseRecommendationMetadata -> ShowS
Prelude.Show, (forall x.
 SavingsPlansPurchaseRecommendationMetadata
 -> Rep SavingsPlansPurchaseRecommendationMetadata x)
-> (forall x.
    Rep SavingsPlansPurchaseRecommendationMetadata x
    -> SavingsPlansPurchaseRecommendationMetadata)
-> Generic SavingsPlansPurchaseRecommendationMetadata
forall x.
Rep SavingsPlansPurchaseRecommendationMetadata x
-> SavingsPlansPurchaseRecommendationMetadata
forall x.
SavingsPlansPurchaseRecommendationMetadata
-> Rep SavingsPlansPurchaseRecommendationMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SavingsPlansPurchaseRecommendationMetadata x
-> SavingsPlansPurchaseRecommendationMetadata
$cfrom :: forall x.
SavingsPlansPurchaseRecommendationMetadata
-> Rep SavingsPlansPurchaseRecommendationMetadata x
Prelude.Generic)

-- |
-- Create a value of 'SavingsPlansPurchaseRecommendationMetadata' 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:
--
-- 'recommendationId', 'savingsPlansPurchaseRecommendationMetadata_recommendationId' - The unique identifier for the recommendation set.
--
-- 'generationTimestamp', 'savingsPlansPurchaseRecommendationMetadata_generationTimestamp' - The timestamp showing when the recommendations were generated.
--
-- 'additionalMetadata', 'savingsPlansPurchaseRecommendationMetadata_additionalMetadata' - Additional metadata that might be applicable to the recommendation.
newSavingsPlansPurchaseRecommendationMetadata ::
  SavingsPlansPurchaseRecommendationMetadata
newSavingsPlansPurchaseRecommendationMetadata :: SavingsPlansPurchaseRecommendationMetadata
newSavingsPlansPurchaseRecommendationMetadata =
  SavingsPlansPurchaseRecommendationMetadata' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> SavingsPlansPurchaseRecommendationMetadata
SavingsPlansPurchaseRecommendationMetadata'
    { $sel:recommendationId:SavingsPlansPurchaseRecommendationMetadata' :: Maybe Text
recommendationId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:generationTimestamp:SavingsPlansPurchaseRecommendationMetadata' :: Maybe Text
generationTimestamp =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalMetadata:SavingsPlansPurchaseRecommendationMetadata' :: Maybe Text
additionalMetadata =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier for the recommendation set.
savingsPlansPurchaseRecommendationMetadata_recommendationId :: Lens.Lens' SavingsPlansPurchaseRecommendationMetadata (Prelude.Maybe Prelude.Text)
savingsPlansPurchaseRecommendationMetadata_recommendationId :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansPurchaseRecommendationMetadata
-> f SavingsPlansPurchaseRecommendationMetadata
savingsPlansPurchaseRecommendationMetadata_recommendationId = (SavingsPlansPurchaseRecommendationMetadata -> Maybe Text)
-> (SavingsPlansPurchaseRecommendationMetadata
    -> Maybe Text -> SavingsPlansPurchaseRecommendationMetadata)
-> Lens
     SavingsPlansPurchaseRecommendationMetadata
     SavingsPlansPurchaseRecommendationMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansPurchaseRecommendationMetadata' {Maybe Text
recommendationId :: Maybe Text
$sel:recommendationId:SavingsPlansPurchaseRecommendationMetadata' :: SavingsPlansPurchaseRecommendationMetadata -> Maybe Text
recommendationId} -> Maybe Text
recommendationId) (\s :: SavingsPlansPurchaseRecommendationMetadata
s@SavingsPlansPurchaseRecommendationMetadata' {} Maybe Text
a -> SavingsPlansPurchaseRecommendationMetadata
s {$sel:recommendationId:SavingsPlansPurchaseRecommendationMetadata' :: Maybe Text
recommendationId = Maybe Text
a} :: SavingsPlansPurchaseRecommendationMetadata)

-- | The timestamp showing when the recommendations were generated.
savingsPlansPurchaseRecommendationMetadata_generationTimestamp :: Lens.Lens' SavingsPlansPurchaseRecommendationMetadata (Prelude.Maybe Prelude.Text)
savingsPlansPurchaseRecommendationMetadata_generationTimestamp :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansPurchaseRecommendationMetadata
-> f SavingsPlansPurchaseRecommendationMetadata
savingsPlansPurchaseRecommendationMetadata_generationTimestamp = (SavingsPlansPurchaseRecommendationMetadata -> Maybe Text)
-> (SavingsPlansPurchaseRecommendationMetadata
    -> Maybe Text -> SavingsPlansPurchaseRecommendationMetadata)
-> Lens
     SavingsPlansPurchaseRecommendationMetadata
     SavingsPlansPurchaseRecommendationMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansPurchaseRecommendationMetadata' {Maybe Text
generationTimestamp :: Maybe Text
$sel:generationTimestamp:SavingsPlansPurchaseRecommendationMetadata' :: SavingsPlansPurchaseRecommendationMetadata -> Maybe Text
generationTimestamp} -> Maybe Text
generationTimestamp) (\s :: SavingsPlansPurchaseRecommendationMetadata
s@SavingsPlansPurchaseRecommendationMetadata' {} Maybe Text
a -> SavingsPlansPurchaseRecommendationMetadata
s {$sel:generationTimestamp:SavingsPlansPurchaseRecommendationMetadata' :: Maybe Text
generationTimestamp = Maybe Text
a} :: SavingsPlansPurchaseRecommendationMetadata)

-- | Additional metadata that might be applicable to the recommendation.
savingsPlansPurchaseRecommendationMetadata_additionalMetadata :: Lens.Lens' SavingsPlansPurchaseRecommendationMetadata (Prelude.Maybe Prelude.Text)
savingsPlansPurchaseRecommendationMetadata_additionalMetadata :: (Maybe Text -> f (Maybe Text))
-> SavingsPlansPurchaseRecommendationMetadata
-> f SavingsPlansPurchaseRecommendationMetadata
savingsPlansPurchaseRecommendationMetadata_additionalMetadata = (SavingsPlansPurchaseRecommendationMetadata -> Maybe Text)
-> (SavingsPlansPurchaseRecommendationMetadata
    -> Maybe Text -> SavingsPlansPurchaseRecommendationMetadata)
-> Lens
     SavingsPlansPurchaseRecommendationMetadata
     SavingsPlansPurchaseRecommendationMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SavingsPlansPurchaseRecommendationMetadata' {Maybe Text
additionalMetadata :: Maybe Text
$sel:additionalMetadata:SavingsPlansPurchaseRecommendationMetadata' :: SavingsPlansPurchaseRecommendationMetadata -> Maybe Text
additionalMetadata} -> Maybe Text
additionalMetadata) (\s :: SavingsPlansPurchaseRecommendationMetadata
s@SavingsPlansPurchaseRecommendationMetadata' {} Maybe Text
a -> SavingsPlansPurchaseRecommendationMetadata
s {$sel:additionalMetadata:SavingsPlansPurchaseRecommendationMetadata' :: Maybe Text
additionalMetadata = Maybe Text
a} :: SavingsPlansPurchaseRecommendationMetadata)

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

instance
  Prelude.Hashable
    SavingsPlansPurchaseRecommendationMetadata

instance
  Prelude.NFData
    SavingsPlansPurchaseRecommendationMetadata