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

import qualified Amazonka.Core as Core
import Amazonka.CostExplorer.Types.LookbackPeriodInDays
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Metadata for this recommendation set.
--
-- /See:/ 'newRightsizingRecommendationMetadata' smart constructor.
data RightsizingRecommendationMetadata = RightsizingRecommendationMetadata'
  { -- | The ID for this specific recommendation.
    RightsizingRecommendationMetadata -> Maybe Text
recommendationId :: Prelude.Maybe Prelude.Text,
    -- | The timestamp for when Amazon Web Services made this recommendation.
    RightsizingRecommendationMetadata -> Maybe Text
generationTimestamp :: Prelude.Maybe Prelude.Text,
    -- | Additional metadata that might be applicable to the recommendation.
    RightsizingRecommendationMetadata -> Maybe Text
additionalMetadata :: Prelude.Maybe Prelude.Text,
    -- | The number of days of previous usage that Amazon Web Services considers
    -- when making this recommendation.
    RightsizingRecommendationMetadata -> Maybe LookbackPeriodInDays
lookbackPeriodInDays :: Prelude.Maybe LookbackPeriodInDays
  }
  deriving (RightsizingRecommendationMetadata
-> RightsizingRecommendationMetadata -> Bool
(RightsizingRecommendationMetadata
 -> RightsizingRecommendationMetadata -> Bool)
-> (RightsizingRecommendationMetadata
    -> RightsizingRecommendationMetadata -> Bool)
-> Eq RightsizingRecommendationMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RightsizingRecommendationMetadata
-> RightsizingRecommendationMetadata -> Bool
$c/= :: RightsizingRecommendationMetadata
-> RightsizingRecommendationMetadata -> Bool
== :: RightsizingRecommendationMetadata
-> RightsizingRecommendationMetadata -> Bool
$c== :: RightsizingRecommendationMetadata
-> RightsizingRecommendationMetadata -> Bool
Prelude.Eq, ReadPrec [RightsizingRecommendationMetadata]
ReadPrec RightsizingRecommendationMetadata
Int -> ReadS RightsizingRecommendationMetadata
ReadS [RightsizingRecommendationMetadata]
(Int -> ReadS RightsizingRecommendationMetadata)
-> ReadS [RightsizingRecommendationMetadata]
-> ReadPrec RightsizingRecommendationMetadata
-> ReadPrec [RightsizingRecommendationMetadata]
-> Read RightsizingRecommendationMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RightsizingRecommendationMetadata]
$creadListPrec :: ReadPrec [RightsizingRecommendationMetadata]
readPrec :: ReadPrec RightsizingRecommendationMetadata
$creadPrec :: ReadPrec RightsizingRecommendationMetadata
readList :: ReadS [RightsizingRecommendationMetadata]
$creadList :: ReadS [RightsizingRecommendationMetadata]
readsPrec :: Int -> ReadS RightsizingRecommendationMetadata
$creadsPrec :: Int -> ReadS RightsizingRecommendationMetadata
Prelude.Read, Int -> RightsizingRecommendationMetadata -> ShowS
[RightsizingRecommendationMetadata] -> ShowS
RightsizingRecommendationMetadata -> String
(Int -> RightsizingRecommendationMetadata -> ShowS)
-> (RightsizingRecommendationMetadata -> String)
-> ([RightsizingRecommendationMetadata] -> ShowS)
-> Show RightsizingRecommendationMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RightsizingRecommendationMetadata] -> ShowS
$cshowList :: [RightsizingRecommendationMetadata] -> ShowS
show :: RightsizingRecommendationMetadata -> String
$cshow :: RightsizingRecommendationMetadata -> String
showsPrec :: Int -> RightsizingRecommendationMetadata -> ShowS
$cshowsPrec :: Int -> RightsizingRecommendationMetadata -> ShowS
Prelude.Show, (forall x.
 RightsizingRecommendationMetadata
 -> Rep RightsizingRecommendationMetadata x)
-> (forall x.
    Rep RightsizingRecommendationMetadata x
    -> RightsizingRecommendationMetadata)
-> Generic RightsizingRecommendationMetadata
forall x.
Rep RightsizingRecommendationMetadata x
-> RightsizingRecommendationMetadata
forall x.
RightsizingRecommendationMetadata
-> Rep RightsizingRecommendationMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RightsizingRecommendationMetadata x
-> RightsizingRecommendationMetadata
$cfrom :: forall x.
RightsizingRecommendationMetadata
-> Rep RightsizingRecommendationMetadata x
Prelude.Generic)

-- |
-- Create a value of 'RightsizingRecommendationMetadata' 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', 'rightsizingRecommendationMetadata_recommendationId' - The ID for this specific recommendation.
--
-- 'generationTimestamp', 'rightsizingRecommendationMetadata_generationTimestamp' - The timestamp for when Amazon Web Services made this recommendation.
--
-- 'additionalMetadata', 'rightsizingRecommendationMetadata_additionalMetadata' - Additional metadata that might be applicable to the recommendation.
--
-- 'lookbackPeriodInDays', 'rightsizingRecommendationMetadata_lookbackPeriodInDays' - The number of days of previous usage that Amazon Web Services considers
-- when making this recommendation.
newRightsizingRecommendationMetadata ::
  RightsizingRecommendationMetadata
newRightsizingRecommendationMetadata :: RightsizingRecommendationMetadata
newRightsizingRecommendationMetadata =
  RightsizingRecommendationMetadata' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe LookbackPeriodInDays
-> RightsizingRecommendationMetadata
RightsizingRecommendationMetadata'
    { $sel:recommendationId:RightsizingRecommendationMetadata' :: Maybe Text
recommendationId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:generationTimestamp:RightsizingRecommendationMetadata' :: Maybe Text
generationTimestamp = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:additionalMetadata:RightsizingRecommendationMetadata' :: Maybe Text
additionalMetadata = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lookbackPeriodInDays:RightsizingRecommendationMetadata' :: Maybe LookbackPeriodInDays
lookbackPeriodInDays = Maybe LookbackPeriodInDays
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

-- | The number of days of previous usage that Amazon Web Services considers
-- when making this recommendation.
rightsizingRecommendationMetadata_lookbackPeriodInDays :: Lens.Lens' RightsizingRecommendationMetadata (Prelude.Maybe LookbackPeriodInDays)
rightsizingRecommendationMetadata_lookbackPeriodInDays :: (Maybe LookbackPeriodInDays -> f (Maybe LookbackPeriodInDays))
-> RightsizingRecommendationMetadata
-> f RightsizingRecommendationMetadata
rightsizingRecommendationMetadata_lookbackPeriodInDays = (RightsizingRecommendationMetadata -> Maybe LookbackPeriodInDays)
-> (RightsizingRecommendationMetadata
    -> Maybe LookbackPeriodInDays -> RightsizingRecommendationMetadata)
-> Lens
     RightsizingRecommendationMetadata
     RightsizingRecommendationMetadata
     (Maybe LookbackPeriodInDays)
     (Maybe LookbackPeriodInDays)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RightsizingRecommendationMetadata' {Maybe LookbackPeriodInDays
lookbackPeriodInDays :: Maybe LookbackPeriodInDays
$sel:lookbackPeriodInDays:RightsizingRecommendationMetadata' :: RightsizingRecommendationMetadata -> Maybe LookbackPeriodInDays
lookbackPeriodInDays} -> Maybe LookbackPeriodInDays
lookbackPeriodInDays) (\s :: RightsizingRecommendationMetadata
s@RightsizingRecommendationMetadata' {} Maybe LookbackPeriodInDays
a -> RightsizingRecommendationMetadata
s {$sel:lookbackPeriodInDays:RightsizingRecommendationMetadata' :: Maybe LookbackPeriodInDays
lookbackPeriodInDays = Maybe LookbackPeriodInDays
a} :: RightsizingRecommendationMetadata)

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

instance
  Prelude.Hashable
    RightsizingRecommendationMetadata

instance
  Prelude.NFData
    RightsizingRecommendationMetadata