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

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

-- | Details about the Amazon ElastiCache instances that Amazon Web Services
-- recommends that you purchase.
--
-- /See:/ 'newElastiCacheInstanceDetails' smart constructor.
data ElastiCacheInstanceDetails = ElastiCacheInstanceDetails'
  { -- | Determines whether the recommendation is for a current generation
    -- instance.
    ElastiCacheInstanceDetails -> Maybe Bool
currentGeneration :: Prelude.Maybe Prelude.Bool,
    -- | The description of the recommended reservation.
    ElastiCacheInstanceDetails -> Maybe Text
productDescription :: Prelude.Maybe Prelude.Text,
    -- | The instance family of the recommended reservation.
    ElastiCacheInstanceDetails -> Maybe Text
family :: Prelude.Maybe Prelude.Text,
    -- | Determines whether the recommended reservation is size flexible.
    ElastiCacheInstanceDetails -> Maybe Bool
sizeFlexEligible :: Prelude.Maybe Prelude.Bool,
    -- | The Amazon Web Services Region of the recommended reservation.
    ElastiCacheInstanceDetails -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | The type of node that Amazon Web Services recommends.
    ElastiCacheInstanceDetails -> Maybe Text
nodeType :: Prelude.Maybe Prelude.Text
  }
  deriving (ElastiCacheInstanceDetails -> ElastiCacheInstanceDetails -> Bool
(ElastiCacheInstanceDetails -> ElastiCacheInstanceDetails -> Bool)
-> (ElastiCacheInstanceDetails
    -> ElastiCacheInstanceDetails -> Bool)
-> Eq ElastiCacheInstanceDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ElastiCacheInstanceDetails -> ElastiCacheInstanceDetails -> Bool
$c/= :: ElastiCacheInstanceDetails -> ElastiCacheInstanceDetails -> Bool
== :: ElastiCacheInstanceDetails -> ElastiCacheInstanceDetails -> Bool
$c== :: ElastiCacheInstanceDetails -> ElastiCacheInstanceDetails -> Bool
Prelude.Eq, ReadPrec [ElastiCacheInstanceDetails]
ReadPrec ElastiCacheInstanceDetails
Int -> ReadS ElastiCacheInstanceDetails
ReadS [ElastiCacheInstanceDetails]
(Int -> ReadS ElastiCacheInstanceDetails)
-> ReadS [ElastiCacheInstanceDetails]
-> ReadPrec ElastiCacheInstanceDetails
-> ReadPrec [ElastiCacheInstanceDetails]
-> Read ElastiCacheInstanceDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ElastiCacheInstanceDetails]
$creadListPrec :: ReadPrec [ElastiCacheInstanceDetails]
readPrec :: ReadPrec ElastiCacheInstanceDetails
$creadPrec :: ReadPrec ElastiCacheInstanceDetails
readList :: ReadS [ElastiCacheInstanceDetails]
$creadList :: ReadS [ElastiCacheInstanceDetails]
readsPrec :: Int -> ReadS ElastiCacheInstanceDetails
$creadsPrec :: Int -> ReadS ElastiCacheInstanceDetails
Prelude.Read, Int -> ElastiCacheInstanceDetails -> ShowS
[ElastiCacheInstanceDetails] -> ShowS
ElastiCacheInstanceDetails -> String
(Int -> ElastiCacheInstanceDetails -> ShowS)
-> (ElastiCacheInstanceDetails -> String)
-> ([ElastiCacheInstanceDetails] -> ShowS)
-> Show ElastiCacheInstanceDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ElastiCacheInstanceDetails] -> ShowS
$cshowList :: [ElastiCacheInstanceDetails] -> ShowS
show :: ElastiCacheInstanceDetails -> String
$cshow :: ElastiCacheInstanceDetails -> String
showsPrec :: Int -> ElastiCacheInstanceDetails -> ShowS
$cshowsPrec :: Int -> ElastiCacheInstanceDetails -> ShowS
Prelude.Show, (forall x.
 ElastiCacheInstanceDetails -> Rep ElastiCacheInstanceDetails x)
-> (forall x.
    Rep ElastiCacheInstanceDetails x -> ElastiCacheInstanceDetails)
-> Generic ElastiCacheInstanceDetails
forall x.
Rep ElastiCacheInstanceDetails x -> ElastiCacheInstanceDetails
forall x.
ElastiCacheInstanceDetails -> Rep ElastiCacheInstanceDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ElastiCacheInstanceDetails x -> ElastiCacheInstanceDetails
$cfrom :: forall x.
ElastiCacheInstanceDetails -> Rep ElastiCacheInstanceDetails x
Prelude.Generic)

-- |
-- Create a value of 'ElastiCacheInstanceDetails' 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:
--
-- 'currentGeneration', 'elastiCacheInstanceDetails_currentGeneration' - Determines whether the recommendation is for a current generation
-- instance.
--
-- 'productDescription', 'elastiCacheInstanceDetails_productDescription' - The description of the recommended reservation.
--
-- 'family', 'elastiCacheInstanceDetails_family' - The instance family of the recommended reservation.
--
-- 'sizeFlexEligible', 'elastiCacheInstanceDetails_sizeFlexEligible' - Determines whether the recommended reservation is size flexible.
--
-- 'region', 'elastiCacheInstanceDetails_region' - The Amazon Web Services Region of the recommended reservation.
--
-- 'nodeType', 'elastiCacheInstanceDetails_nodeType' - The type of node that Amazon Web Services recommends.
newElastiCacheInstanceDetails ::
  ElastiCacheInstanceDetails
newElastiCacheInstanceDetails :: ElastiCacheInstanceDetails
newElastiCacheInstanceDetails =
  ElastiCacheInstanceDetails' :: Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> ElastiCacheInstanceDetails
ElastiCacheInstanceDetails'
    { $sel:currentGeneration:ElastiCacheInstanceDetails' :: Maybe Bool
currentGeneration =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:productDescription:ElastiCacheInstanceDetails' :: Maybe Text
productDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:family:ElastiCacheInstanceDetails' :: Maybe Text
family = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sizeFlexEligible:ElastiCacheInstanceDetails' :: Maybe Bool
sizeFlexEligible = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:region:ElastiCacheInstanceDetails' :: Maybe Text
region = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nodeType:ElastiCacheInstanceDetails' :: Maybe Text
nodeType = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Determines whether the recommendation is for a current generation
-- instance.
elastiCacheInstanceDetails_currentGeneration :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Bool)
elastiCacheInstanceDetails_currentGeneration :: (Maybe Bool -> f (Maybe Bool))
-> ElastiCacheInstanceDetails -> f ElastiCacheInstanceDetails
elastiCacheInstanceDetails_currentGeneration = (ElastiCacheInstanceDetails -> Maybe Bool)
-> (ElastiCacheInstanceDetails
    -> Maybe Bool -> ElastiCacheInstanceDetails)
-> Lens
     ElastiCacheInstanceDetails
     ElastiCacheInstanceDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElastiCacheInstanceDetails' {Maybe Bool
currentGeneration :: Maybe Bool
$sel:currentGeneration:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Bool
currentGeneration} -> Maybe Bool
currentGeneration) (\s :: ElastiCacheInstanceDetails
s@ElastiCacheInstanceDetails' {} Maybe Bool
a -> ElastiCacheInstanceDetails
s {$sel:currentGeneration:ElastiCacheInstanceDetails' :: Maybe Bool
currentGeneration = Maybe Bool
a} :: ElastiCacheInstanceDetails)

-- | The description of the recommended reservation.
elastiCacheInstanceDetails_productDescription :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Text)
elastiCacheInstanceDetails_productDescription :: (Maybe Text -> f (Maybe Text))
-> ElastiCacheInstanceDetails -> f ElastiCacheInstanceDetails
elastiCacheInstanceDetails_productDescription = (ElastiCacheInstanceDetails -> Maybe Text)
-> (ElastiCacheInstanceDetails
    -> Maybe Text -> ElastiCacheInstanceDetails)
-> Lens
     ElastiCacheInstanceDetails
     ElastiCacheInstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElastiCacheInstanceDetails' {Maybe Text
productDescription :: Maybe Text
$sel:productDescription:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
productDescription} -> Maybe Text
productDescription) (\s :: ElastiCacheInstanceDetails
s@ElastiCacheInstanceDetails' {} Maybe Text
a -> ElastiCacheInstanceDetails
s {$sel:productDescription:ElastiCacheInstanceDetails' :: Maybe Text
productDescription = Maybe Text
a} :: ElastiCacheInstanceDetails)

-- | The instance family of the recommended reservation.
elastiCacheInstanceDetails_family :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Text)
elastiCacheInstanceDetails_family :: (Maybe Text -> f (Maybe Text))
-> ElastiCacheInstanceDetails -> f ElastiCacheInstanceDetails
elastiCacheInstanceDetails_family = (ElastiCacheInstanceDetails -> Maybe Text)
-> (ElastiCacheInstanceDetails
    -> Maybe Text -> ElastiCacheInstanceDetails)
-> Lens
     ElastiCacheInstanceDetails
     ElastiCacheInstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElastiCacheInstanceDetails' {Maybe Text
family :: Maybe Text
$sel:family:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
family} -> Maybe Text
family) (\s :: ElastiCacheInstanceDetails
s@ElastiCacheInstanceDetails' {} Maybe Text
a -> ElastiCacheInstanceDetails
s {$sel:family:ElastiCacheInstanceDetails' :: Maybe Text
family = Maybe Text
a} :: ElastiCacheInstanceDetails)

-- | Determines whether the recommended reservation is size flexible.
elastiCacheInstanceDetails_sizeFlexEligible :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Bool)
elastiCacheInstanceDetails_sizeFlexEligible :: (Maybe Bool -> f (Maybe Bool))
-> ElastiCacheInstanceDetails -> f ElastiCacheInstanceDetails
elastiCacheInstanceDetails_sizeFlexEligible = (ElastiCacheInstanceDetails -> Maybe Bool)
-> (ElastiCacheInstanceDetails
    -> Maybe Bool -> ElastiCacheInstanceDetails)
-> Lens
     ElastiCacheInstanceDetails
     ElastiCacheInstanceDetails
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElastiCacheInstanceDetails' {Maybe Bool
sizeFlexEligible :: Maybe Bool
$sel:sizeFlexEligible:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Bool
sizeFlexEligible} -> Maybe Bool
sizeFlexEligible) (\s :: ElastiCacheInstanceDetails
s@ElastiCacheInstanceDetails' {} Maybe Bool
a -> ElastiCacheInstanceDetails
s {$sel:sizeFlexEligible:ElastiCacheInstanceDetails' :: Maybe Bool
sizeFlexEligible = Maybe Bool
a} :: ElastiCacheInstanceDetails)

-- | The Amazon Web Services Region of the recommended reservation.
elastiCacheInstanceDetails_region :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Text)
elastiCacheInstanceDetails_region :: (Maybe Text -> f (Maybe Text))
-> ElastiCacheInstanceDetails -> f ElastiCacheInstanceDetails
elastiCacheInstanceDetails_region = (ElastiCacheInstanceDetails -> Maybe Text)
-> (ElastiCacheInstanceDetails
    -> Maybe Text -> ElastiCacheInstanceDetails)
-> Lens
     ElastiCacheInstanceDetails
     ElastiCacheInstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElastiCacheInstanceDetails' {Maybe Text
region :: Maybe Text
$sel:region:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
region} -> Maybe Text
region) (\s :: ElastiCacheInstanceDetails
s@ElastiCacheInstanceDetails' {} Maybe Text
a -> ElastiCacheInstanceDetails
s {$sel:region:ElastiCacheInstanceDetails' :: Maybe Text
region = Maybe Text
a} :: ElastiCacheInstanceDetails)

-- | The type of node that Amazon Web Services recommends.
elastiCacheInstanceDetails_nodeType :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Text)
elastiCacheInstanceDetails_nodeType :: (Maybe Text -> f (Maybe Text))
-> ElastiCacheInstanceDetails -> f ElastiCacheInstanceDetails
elastiCacheInstanceDetails_nodeType = (ElastiCacheInstanceDetails -> Maybe Text)
-> (ElastiCacheInstanceDetails
    -> Maybe Text -> ElastiCacheInstanceDetails)
-> Lens
     ElastiCacheInstanceDetails
     ElastiCacheInstanceDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ElastiCacheInstanceDetails' {Maybe Text
nodeType :: Maybe Text
$sel:nodeType:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
nodeType} -> Maybe Text
nodeType) (\s :: ElastiCacheInstanceDetails
s@ElastiCacheInstanceDetails' {} Maybe Text
a -> ElastiCacheInstanceDetails
s {$sel:nodeType:ElastiCacheInstanceDetails' :: Maybe Text
nodeType = Maybe Text
a} :: ElastiCacheInstanceDetails)

instance Core.FromJSON ElastiCacheInstanceDetails where
  parseJSON :: Value -> Parser ElastiCacheInstanceDetails
parseJSON =
    String
-> (Object -> Parser ElastiCacheInstanceDetails)
-> Value
-> Parser ElastiCacheInstanceDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ElastiCacheInstanceDetails"
      ( \Object
x ->
          Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> ElastiCacheInstanceDetails
ElastiCacheInstanceDetails'
            (Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> ElastiCacheInstanceDetails)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> ElastiCacheInstanceDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CurrentGeneration")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> ElastiCacheInstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> ElastiCacheInstanceDetails)
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
"ProductDescription")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> ElastiCacheInstanceDetails)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text -> Maybe Text -> ElastiCacheInstanceDetails)
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
"Family")
            Parser
  (Maybe Bool
   -> Maybe Text -> Maybe Text -> ElastiCacheInstanceDetails)
-> Parser (Maybe Bool)
-> Parser (Maybe Text -> Maybe Text -> ElastiCacheInstanceDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SizeFlexEligible")
            Parser (Maybe Text -> Maybe Text -> ElastiCacheInstanceDetails)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ElastiCacheInstanceDetails)
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
"Region")
            Parser (Maybe Text -> ElastiCacheInstanceDetails)
-> Parser (Maybe Text) -> Parser ElastiCacheInstanceDetails
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
"NodeType")
      )

instance Prelude.Hashable ElastiCacheInstanceDetails

instance Prelude.NFData ElastiCacheInstanceDetails