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

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

-- | Information about this specific recommendation, such as the timestamp
-- for when Amazon Web Services made a specific recommendation.
--
-- /See:/ 'newReservationPurchaseRecommendationMetadata' smart constructor.
data ReservationPurchaseRecommendationMetadata = ReservationPurchaseRecommendationMetadata'
  { -- | The ID for this specific recommendation.
    ReservationPurchaseRecommendationMetadata -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text,
    -- | The timestamp for when Amazon Web Services made this recommendation.
    ReservationPurchaseRecommendationMetadata -> Maybe Text
generationTimestamp :: Prelude.Maybe Prelude.Text
  }
  deriving (ReservationPurchaseRecommendationMetadata
-> ReservationPurchaseRecommendationMetadata -> Bool
(ReservationPurchaseRecommendationMetadata
 -> ReservationPurchaseRecommendationMetadata -> Bool)
-> (ReservationPurchaseRecommendationMetadata
    -> ReservationPurchaseRecommendationMetadata -> Bool)
-> Eq ReservationPurchaseRecommendationMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ReservationPurchaseRecommendationMetadata
-> ReservationPurchaseRecommendationMetadata -> Bool
$c/= :: ReservationPurchaseRecommendationMetadata
-> ReservationPurchaseRecommendationMetadata -> Bool
== :: ReservationPurchaseRecommendationMetadata
-> ReservationPurchaseRecommendationMetadata -> Bool
$c== :: ReservationPurchaseRecommendationMetadata
-> ReservationPurchaseRecommendationMetadata -> Bool
Prelude.Eq, ReadPrec [ReservationPurchaseRecommendationMetadata]
ReadPrec ReservationPurchaseRecommendationMetadata
Int -> ReadS ReservationPurchaseRecommendationMetadata
ReadS [ReservationPurchaseRecommendationMetadata]
(Int -> ReadS ReservationPurchaseRecommendationMetadata)
-> ReadS [ReservationPurchaseRecommendationMetadata]
-> ReadPrec ReservationPurchaseRecommendationMetadata
-> ReadPrec [ReservationPurchaseRecommendationMetadata]
-> Read ReservationPurchaseRecommendationMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ReservationPurchaseRecommendationMetadata]
$creadListPrec :: ReadPrec [ReservationPurchaseRecommendationMetadata]
readPrec :: ReadPrec ReservationPurchaseRecommendationMetadata
$creadPrec :: ReadPrec ReservationPurchaseRecommendationMetadata
readList :: ReadS [ReservationPurchaseRecommendationMetadata]
$creadList :: ReadS [ReservationPurchaseRecommendationMetadata]
readsPrec :: Int -> ReadS ReservationPurchaseRecommendationMetadata
$creadsPrec :: Int -> ReadS ReservationPurchaseRecommendationMetadata
Prelude.Read, Int -> ReservationPurchaseRecommendationMetadata -> ShowS
[ReservationPurchaseRecommendationMetadata] -> ShowS
ReservationPurchaseRecommendationMetadata -> String
(Int -> ReservationPurchaseRecommendationMetadata -> ShowS)
-> (ReservationPurchaseRecommendationMetadata -> String)
-> ([ReservationPurchaseRecommendationMetadata] -> ShowS)
-> Show ReservationPurchaseRecommendationMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ReservationPurchaseRecommendationMetadata] -> ShowS
$cshowList :: [ReservationPurchaseRecommendationMetadata] -> ShowS
show :: ReservationPurchaseRecommendationMetadata -> String
$cshow :: ReservationPurchaseRecommendationMetadata -> String
showsPrec :: Int -> ReservationPurchaseRecommendationMetadata -> ShowS
$cshowsPrec :: Int -> ReservationPurchaseRecommendationMetadata -> ShowS
Prelude.Show, (forall x.
 ReservationPurchaseRecommendationMetadata
 -> Rep ReservationPurchaseRecommendationMetadata x)
-> (forall x.
    Rep ReservationPurchaseRecommendationMetadata x
    -> ReservationPurchaseRecommendationMetadata)
-> Generic ReservationPurchaseRecommendationMetadata
forall x.
Rep ReservationPurchaseRecommendationMetadata x
-> ReservationPurchaseRecommendationMetadata
forall x.
ReservationPurchaseRecommendationMetadata
-> Rep ReservationPurchaseRecommendationMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ReservationPurchaseRecommendationMetadata x
-> ReservationPurchaseRecommendationMetadata
$cfrom :: forall x.
ReservationPurchaseRecommendationMetadata
-> Rep ReservationPurchaseRecommendationMetadata x
Prelude.Generic)

-- |
-- Create a value of 'ReservationPurchaseRecommendationMetadata' 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', 'reservationPurchaseRecommendationMetadata_recommendationId' - The ID for this specific recommendation.
--
-- 'generationTimestamp', 'reservationPurchaseRecommendationMetadata_generationTimestamp' - The timestamp for when Amazon Web Services made this recommendation.
newReservationPurchaseRecommendationMetadata ::
  ReservationPurchaseRecommendationMetadata
newReservationPurchaseRecommendationMetadata :: ReservationPurchaseRecommendationMetadata
newReservationPurchaseRecommendationMetadata =
  ReservationPurchaseRecommendationMetadata' :: Maybe Text
-> Maybe Text -> ReservationPurchaseRecommendationMetadata
ReservationPurchaseRecommendationMetadata'
    { $sel:recommendationId:ReservationPurchaseRecommendationMetadata' :: Maybe Text
recommendationId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:generationTimestamp:ReservationPurchaseRecommendationMetadata' :: Maybe Text
generationTimestamp =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID for this specific recommendation.
reservationPurchaseRecommendationMetadata_recommendationId :: Lens.Lens' ReservationPurchaseRecommendationMetadata (Prelude.Maybe Prelude.Text)
reservationPurchaseRecommendationMetadata_recommendationId :: (Maybe Text -> f (Maybe Text))
-> ReservationPurchaseRecommendationMetadata
-> f ReservationPurchaseRecommendationMetadata
reservationPurchaseRecommendationMetadata_recommendationId = (ReservationPurchaseRecommendationMetadata -> Maybe Text)
-> (ReservationPurchaseRecommendationMetadata
    -> Maybe Text -> ReservationPurchaseRecommendationMetadata)
-> Lens
     ReservationPurchaseRecommendationMetadata
     ReservationPurchaseRecommendationMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPurchaseRecommendationMetadata' {Maybe Text
recommendationId :: Maybe Text
$sel:recommendationId:ReservationPurchaseRecommendationMetadata' :: ReservationPurchaseRecommendationMetadata -> Maybe Text
recommendationId} -> Maybe Text
recommendationId) (\s :: ReservationPurchaseRecommendationMetadata
s@ReservationPurchaseRecommendationMetadata' {} Maybe Text
a -> ReservationPurchaseRecommendationMetadata
s {$sel:recommendationId:ReservationPurchaseRecommendationMetadata' :: Maybe Text
recommendationId = Maybe Text
a} :: ReservationPurchaseRecommendationMetadata)

-- | The timestamp for when Amazon Web Services made this recommendation.
reservationPurchaseRecommendationMetadata_generationTimestamp :: Lens.Lens' ReservationPurchaseRecommendationMetadata (Prelude.Maybe Prelude.Text)
reservationPurchaseRecommendationMetadata_generationTimestamp :: (Maybe Text -> f (Maybe Text))
-> ReservationPurchaseRecommendationMetadata
-> f ReservationPurchaseRecommendationMetadata
reservationPurchaseRecommendationMetadata_generationTimestamp = (ReservationPurchaseRecommendationMetadata -> Maybe Text)
-> (ReservationPurchaseRecommendationMetadata
    -> Maybe Text -> ReservationPurchaseRecommendationMetadata)
-> Lens
     ReservationPurchaseRecommendationMetadata
     ReservationPurchaseRecommendationMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ReservationPurchaseRecommendationMetadata' {Maybe Text
generationTimestamp :: Maybe Text
$sel:generationTimestamp:ReservationPurchaseRecommendationMetadata' :: ReservationPurchaseRecommendationMetadata -> Maybe Text
generationTimestamp} -> Maybe Text
generationTimestamp) (\s :: ReservationPurchaseRecommendationMetadata
s@ReservationPurchaseRecommendationMetadata' {} Maybe Text
a -> ReservationPurchaseRecommendationMetadata
s {$sel:generationTimestamp:ReservationPurchaseRecommendationMetadata' :: Maybe Text
generationTimestamp = Maybe Text
a} :: ReservationPurchaseRecommendationMetadata)

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

instance
  Prelude.Hashable
    ReservationPurchaseRecommendationMetadata

instance
  Prelude.NFData
    ReservationPurchaseRecommendationMetadata