{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CostExplorer.Types.ElastiCacheInstanceDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 instance family of the recommended reservation.
    ElastiCacheInstanceDetails -> Maybe Text
family :: Prelude.Maybe Prelude.Text,
    -- | The type of node that Amazon Web Services recommends.
    ElastiCacheInstanceDetails -> Maybe Text
nodeType :: Prelude.Maybe Prelude.Text,
    -- | The description of the recommended reservation.
    ElastiCacheInstanceDetails -> Maybe Text
productDescription :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services Region of the recommended reservation.
    ElastiCacheInstanceDetails -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
    -- | Determines whether the recommended reservation is size flexible.
    ElastiCacheInstanceDetails -> Maybe Bool
sizeFlexEligible :: Prelude.Maybe Prelude.Bool
  }
  deriving (ElastiCacheInstanceDetails -> ElastiCacheInstanceDetails -> Bool
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]
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
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.
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.
--
-- 'family', 'elastiCacheInstanceDetails_family' - The instance family of the recommended reservation.
--
-- 'nodeType', 'elastiCacheInstanceDetails_nodeType' - The type of node that Amazon Web Services recommends.
--
-- 'productDescription', 'elastiCacheInstanceDetails_productDescription' - The description of the recommended reservation.
--
-- 'region', 'elastiCacheInstanceDetails_region' - The Amazon Web Services Region of the recommended reservation.
--
-- 'sizeFlexEligible', 'elastiCacheInstanceDetails_sizeFlexEligible' - Determines whether the recommended reservation is size flexible.
newElastiCacheInstanceDetails ::
  ElastiCacheInstanceDetails
newElastiCacheInstanceDetails :: ElastiCacheInstanceDetails
newElastiCacheInstanceDetails =
  ElastiCacheInstanceDetails'
    { $sel:currentGeneration:ElastiCacheInstanceDetails' :: Maybe Bool
currentGeneration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:family:ElastiCacheInstanceDetails' :: Maybe Text
family = forall a. Maybe a
Prelude.Nothing,
      $sel:nodeType:ElastiCacheInstanceDetails' :: Maybe Text
nodeType = forall a. Maybe a
Prelude.Nothing,
      $sel:productDescription:ElastiCacheInstanceDetails' :: Maybe Text
productDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:region:ElastiCacheInstanceDetails' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
      $sel:sizeFlexEligible:ElastiCacheInstanceDetails' :: Maybe Bool
sizeFlexEligible = 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 :: Lens' ElastiCacheInstanceDetails (Maybe Bool)
elastiCacheInstanceDetails_currentGeneration = 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 instance family of the recommended reservation.
elastiCacheInstanceDetails_family :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Text)
elastiCacheInstanceDetails_family :: Lens' ElastiCacheInstanceDetails (Maybe Text)
elastiCacheInstanceDetails_family = 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)

-- | The type of node that Amazon Web Services recommends.
elastiCacheInstanceDetails_nodeType :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Text)
elastiCacheInstanceDetails_nodeType :: Lens' ElastiCacheInstanceDetails (Maybe Text)
elastiCacheInstanceDetails_nodeType = 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)

-- | The description of the recommended reservation.
elastiCacheInstanceDetails_productDescription :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Text)
elastiCacheInstanceDetails_productDescription :: Lens' ElastiCacheInstanceDetails (Maybe Text)
elastiCacheInstanceDetails_productDescription = 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 Amazon Web Services Region of the recommended reservation.
elastiCacheInstanceDetails_region :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Text)
elastiCacheInstanceDetails_region :: Lens' ElastiCacheInstanceDetails (Maybe Text)
elastiCacheInstanceDetails_region = 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)

-- | Determines whether the recommended reservation is size flexible.
elastiCacheInstanceDetails_sizeFlexEligible :: Lens.Lens' ElastiCacheInstanceDetails (Prelude.Maybe Prelude.Bool)
elastiCacheInstanceDetails_sizeFlexEligible :: Lens' ElastiCacheInstanceDetails (Maybe Bool)
elastiCacheInstanceDetails_sizeFlexEligible = 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)

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

instance Prelude.Hashable ElastiCacheInstanceDetails where
  hashWithSalt :: Int -> ElastiCacheInstanceDetails -> Int
hashWithSalt Int
_salt ElastiCacheInstanceDetails' {Maybe Bool
Maybe Text
sizeFlexEligible :: Maybe Bool
region :: Maybe Text
productDescription :: Maybe Text
nodeType :: Maybe Text
family :: Maybe Text
currentGeneration :: Maybe Bool
$sel:sizeFlexEligible:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Bool
$sel:region:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
$sel:productDescription:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
$sel:nodeType:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
$sel:family:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
$sel:currentGeneration:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Bool
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
currentGeneration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
family
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nodeType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
productDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
sizeFlexEligible

instance Prelude.NFData ElastiCacheInstanceDetails where
  rnf :: ElastiCacheInstanceDetails -> ()
rnf ElastiCacheInstanceDetails' {Maybe Bool
Maybe Text
sizeFlexEligible :: Maybe Bool
region :: Maybe Text
productDescription :: Maybe Text
nodeType :: Maybe Text
family :: Maybe Text
currentGeneration :: Maybe Bool
$sel:sizeFlexEligible:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Bool
$sel:region:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
$sel:productDescription:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
$sel:nodeType:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
$sel:family:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Text
$sel:currentGeneration:ElastiCacheInstanceDetails' :: ElastiCacheInstanceDetails -> Maybe Bool
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
currentGeneration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
family
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nodeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
productDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
sizeFlexEligible