{-# 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.ElastiCache.Types.CacheEngineVersion
-- 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.ElastiCache.Types.CacheEngineVersion 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

-- | Provides all of the details about a particular cache engine version.
--
-- /See:/ 'newCacheEngineVersion' smart constructor.
data CacheEngineVersion = CacheEngineVersion'
  { -- | The description of the cache engine.
    CacheEngineVersion -> Maybe Text
cacheEngineDescription :: Prelude.Maybe Prelude.Text,
    -- | The description of the cache engine version.
    CacheEngineVersion -> Maybe Text
cacheEngineVersionDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the cache parameter group family associated with this cache
    -- engine.
    --
    -- Valid values are: @memcached1.4@ | @memcached1.5@ | @memcached1.6@ |
    -- @redis2.6@ | @redis2.8@ | @redis3.2@ | @redis4.0@ | @redis5.0@ |
    -- @redis6.x@
    CacheEngineVersion -> Maybe Text
cacheParameterGroupFamily :: Prelude.Maybe Prelude.Text,
    -- | The name of the cache engine.
    CacheEngineVersion -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
    -- | The version number of the cache engine.
    CacheEngineVersion -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text
  }
  deriving (CacheEngineVersion -> CacheEngineVersion -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CacheEngineVersion -> CacheEngineVersion -> Bool
$c/= :: CacheEngineVersion -> CacheEngineVersion -> Bool
== :: CacheEngineVersion -> CacheEngineVersion -> Bool
$c== :: CacheEngineVersion -> CacheEngineVersion -> Bool
Prelude.Eq, ReadPrec [CacheEngineVersion]
ReadPrec CacheEngineVersion
Int -> ReadS CacheEngineVersion
ReadS [CacheEngineVersion]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CacheEngineVersion]
$creadListPrec :: ReadPrec [CacheEngineVersion]
readPrec :: ReadPrec CacheEngineVersion
$creadPrec :: ReadPrec CacheEngineVersion
readList :: ReadS [CacheEngineVersion]
$creadList :: ReadS [CacheEngineVersion]
readsPrec :: Int -> ReadS CacheEngineVersion
$creadsPrec :: Int -> ReadS CacheEngineVersion
Prelude.Read, Int -> CacheEngineVersion -> ShowS
[CacheEngineVersion] -> ShowS
CacheEngineVersion -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CacheEngineVersion] -> ShowS
$cshowList :: [CacheEngineVersion] -> ShowS
show :: CacheEngineVersion -> String
$cshow :: CacheEngineVersion -> String
showsPrec :: Int -> CacheEngineVersion -> ShowS
$cshowsPrec :: Int -> CacheEngineVersion -> ShowS
Prelude.Show, forall x. Rep CacheEngineVersion x -> CacheEngineVersion
forall x. CacheEngineVersion -> Rep CacheEngineVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CacheEngineVersion x -> CacheEngineVersion
$cfrom :: forall x. CacheEngineVersion -> Rep CacheEngineVersion x
Prelude.Generic)

-- |
-- Create a value of 'CacheEngineVersion' 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:
--
-- 'cacheEngineDescription', 'cacheEngineVersion_cacheEngineDescription' - The description of the cache engine.
--
-- 'cacheEngineVersionDescription', 'cacheEngineVersion_cacheEngineVersionDescription' - The description of the cache engine version.
--
-- 'cacheParameterGroupFamily', 'cacheEngineVersion_cacheParameterGroupFamily' - The name of the cache parameter group family associated with this cache
-- engine.
--
-- Valid values are: @memcached1.4@ | @memcached1.5@ | @memcached1.6@ |
-- @redis2.6@ | @redis2.8@ | @redis3.2@ | @redis4.0@ | @redis5.0@ |
-- @redis6.x@
--
-- 'engine', 'cacheEngineVersion_engine' - The name of the cache engine.
--
-- 'engineVersion', 'cacheEngineVersion_engineVersion' - The version number of the cache engine.
newCacheEngineVersion ::
  CacheEngineVersion
newCacheEngineVersion :: CacheEngineVersion
newCacheEngineVersion =
  CacheEngineVersion'
    { $sel:cacheEngineDescription:CacheEngineVersion' :: Maybe Text
cacheEngineDescription =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cacheEngineVersionDescription:CacheEngineVersion' :: Maybe Text
cacheEngineVersionDescription = forall a. Maybe a
Prelude.Nothing,
      $sel:cacheParameterGroupFamily:CacheEngineVersion' :: Maybe Text
cacheParameterGroupFamily = forall a. Maybe a
Prelude.Nothing,
      $sel:engine:CacheEngineVersion' :: Maybe Text
engine = forall a. Maybe a
Prelude.Nothing,
      $sel:engineVersion:CacheEngineVersion' :: Maybe Text
engineVersion = forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the cache engine.
cacheEngineVersion_cacheEngineDescription :: Lens.Lens' CacheEngineVersion (Prelude.Maybe Prelude.Text)
cacheEngineVersion_cacheEngineDescription :: Lens' CacheEngineVersion (Maybe Text)
cacheEngineVersion_cacheEngineDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheEngineVersion' {Maybe Text
cacheEngineDescription :: Maybe Text
$sel:cacheEngineDescription:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
cacheEngineDescription} -> Maybe Text
cacheEngineDescription) (\s :: CacheEngineVersion
s@CacheEngineVersion' {} Maybe Text
a -> CacheEngineVersion
s {$sel:cacheEngineDescription:CacheEngineVersion' :: Maybe Text
cacheEngineDescription = Maybe Text
a} :: CacheEngineVersion)

-- | The description of the cache engine version.
cacheEngineVersion_cacheEngineVersionDescription :: Lens.Lens' CacheEngineVersion (Prelude.Maybe Prelude.Text)
cacheEngineVersion_cacheEngineVersionDescription :: Lens' CacheEngineVersion (Maybe Text)
cacheEngineVersion_cacheEngineVersionDescription = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheEngineVersion' {Maybe Text
cacheEngineVersionDescription :: Maybe Text
$sel:cacheEngineVersionDescription:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
cacheEngineVersionDescription} -> Maybe Text
cacheEngineVersionDescription) (\s :: CacheEngineVersion
s@CacheEngineVersion' {} Maybe Text
a -> CacheEngineVersion
s {$sel:cacheEngineVersionDescription:CacheEngineVersion' :: Maybe Text
cacheEngineVersionDescription = Maybe Text
a} :: CacheEngineVersion)

-- | The name of the cache parameter group family associated with this cache
-- engine.
--
-- Valid values are: @memcached1.4@ | @memcached1.5@ | @memcached1.6@ |
-- @redis2.6@ | @redis2.8@ | @redis3.2@ | @redis4.0@ | @redis5.0@ |
-- @redis6.x@
cacheEngineVersion_cacheParameterGroupFamily :: Lens.Lens' CacheEngineVersion (Prelude.Maybe Prelude.Text)
cacheEngineVersion_cacheParameterGroupFamily :: Lens' CacheEngineVersion (Maybe Text)
cacheEngineVersion_cacheParameterGroupFamily = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheEngineVersion' {Maybe Text
cacheParameterGroupFamily :: Maybe Text
$sel:cacheParameterGroupFamily:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
cacheParameterGroupFamily} -> Maybe Text
cacheParameterGroupFamily) (\s :: CacheEngineVersion
s@CacheEngineVersion' {} Maybe Text
a -> CacheEngineVersion
s {$sel:cacheParameterGroupFamily:CacheEngineVersion' :: Maybe Text
cacheParameterGroupFamily = Maybe Text
a} :: CacheEngineVersion)

-- | The name of the cache engine.
cacheEngineVersion_engine :: Lens.Lens' CacheEngineVersion (Prelude.Maybe Prelude.Text)
cacheEngineVersion_engine :: Lens' CacheEngineVersion (Maybe Text)
cacheEngineVersion_engine = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheEngineVersion' {Maybe Text
engine :: Maybe Text
$sel:engine:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
engine} -> Maybe Text
engine) (\s :: CacheEngineVersion
s@CacheEngineVersion' {} Maybe Text
a -> CacheEngineVersion
s {$sel:engine:CacheEngineVersion' :: Maybe Text
engine = Maybe Text
a} :: CacheEngineVersion)

-- | The version number of the cache engine.
cacheEngineVersion_engineVersion :: Lens.Lens' CacheEngineVersion (Prelude.Maybe Prelude.Text)
cacheEngineVersion_engineVersion :: Lens' CacheEngineVersion (Maybe Text)
cacheEngineVersion_engineVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CacheEngineVersion' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: CacheEngineVersion
s@CacheEngineVersion' {} Maybe Text
a -> CacheEngineVersion
s {$sel:engineVersion:CacheEngineVersion' :: Maybe Text
engineVersion = Maybe Text
a} :: CacheEngineVersion)

instance Data.FromXML CacheEngineVersion where
  parseXML :: [Node] -> Either String CacheEngineVersion
parseXML [Node]
x =
    Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CacheEngineVersion
CacheEngineVersion'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CacheEngineDescription")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CacheEngineVersionDescription")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"CacheParameterGroupFamily")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Engine")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"EngineVersion")

instance Prelude.Hashable CacheEngineVersion where
  hashWithSalt :: Int -> CacheEngineVersion -> Int
hashWithSalt Int
_salt CacheEngineVersion' {Maybe Text
engineVersion :: Maybe Text
engine :: Maybe Text
cacheParameterGroupFamily :: Maybe Text
cacheEngineVersionDescription :: Maybe Text
cacheEngineDescription :: Maybe Text
$sel:engineVersion:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
$sel:engine:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
$sel:cacheParameterGroupFamily:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
$sel:cacheEngineVersionDescription:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
$sel:cacheEngineDescription:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheEngineDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheEngineVersionDescription
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheParameterGroupFamily
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
engine
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
engineVersion

instance Prelude.NFData CacheEngineVersion where
  rnf :: CacheEngineVersion -> ()
rnf CacheEngineVersion' {Maybe Text
engineVersion :: Maybe Text
engine :: Maybe Text
cacheParameterGroupFamily :: Maybe Text
cacheEngineVersionDescription :: Maybe Text
cacheEngineDescription :: Maybe Text
$sel:engineVersion:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
$sel:engine:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
$sel:cacheParameterGroupFamily:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
$sel:cacheEngineVersionDescription:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
$sel:cacheEngineDescription:CacheEngineVersion' :: CacheEngineVersion -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheEngineDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheEngineVersionDescription
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
cacheParameterGroupFamily
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
engine
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
engineVersion