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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 version number of the cache engine.
    CacheEngineVersion -> Maybe Text
engineVersion :: 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 description of the cache engine.
    CacheEngineVersion -> Maybe Text
cacheEngineDescription :: Prelude.Maybe Prelude.Text,
    -- | The name of the cache engine.
    CacheEngineVersion -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
    -- | The description of the cache engine version.
    CacheEngineVersion -> Maybe Text
cacheEngineVersionDescription :: Prelude.Maybe Prelude.Text
  }
  deriving (CacheEngineVersion -> CacheEngineVersion -> Bool
(CacheEngineVersion -> CacheEngineVersion -> Bool)
-> (CacheEngineVersion -> CacheEngineVersion -> Bool)
-> Eq CacheEngineVersion
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]
(Int -> ReadS CacheEngineVersion)
-> ReadS [CacheEngineVersion]
-> ReadPrec CacheEngineVersion
-> ReadPrec [CacheEngineVersion]
-> Read 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
(Int -> CacheEngineVersion -> ShowS)
-> (CacheEngineVersion -> String)
-> ([CacheEngineVersion] -> ShowS)
-> Show CacheEngineVersion
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. CacheEngineVersion -> Rep CacheEngineVersion x)
-> (forall x. Rep CacheEngineVersion x -> CacheEngineVersion)
-> Generic CacheEngineVersion
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:
--
-- 'engineVersion', 'cacheEngineVersion_engineVersion' - The version number of the cache engine.
--
-- '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@ |
--
-- 'cacheEngineDescription', 'cacheEngineVersion_cacheEngineDescription' - The description of the cache engine.
--
-- 'engine', 'cacheEngineVersion_engine' - The name of the cache engine.
--
-- 'cacheEngineVersionDescription', 'cacheEngineVersion_cacheEngineVersionDescription' - The description of the cache engine version.
newCacheEngineVersion ::
  CacheEngineVersion
newCacheEngineVersion :: CacheEngineVersion
newCacheEngineVersion =
  CacheEngineVersion' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> CacheEngineVersion
CacheEngineVersion'
    { $sel:engineVersion:CacheEngineVersion' :: Maybe Text
engineVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheParameterGroupFamily:CacheEngineVersion' :: Maybe Text
cacheParameterGroupFamily = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheEngineDescription:CacheEngineVersion' :: Maybe Text
cacheEngineDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engine:CacheEngineVersion' :: Maybe Text
engine = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:cacheEngineVersionDescription:CacheEngineVersion' :: Maybe Text
cacheEngineVersionDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The version number of the cache engine.
cacheEngineVersion_engineVersion :: Lens.Lens' CacheEngineVersion (Prelude.Maybe Prelude.Text)
cacheEngineVersion_engineVersion :: (Maybe Text -> f (Maybe Text))
-> CacheEngineVersion -> f CacheEngineVersion
cacheEngineVersion_engineVersion = (CacheEngineVersion -> Maybe Text)
-> (CacheEngineVersion -> Maybe Text -> CacheEngineVersion)
-> Lens
     CacheEngineVersion CacheEngineVersion (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> CacheEngineVersion -> f CacheEngineVersion
cacheEngineVersion_cacheParameterGroupFamily = (CacheEngineVersion -> Maybe Text)
-> (CacheEngineVersion -> Maybe Text -> CacheEngineVersion)
-> Lens
     CacheEngineVersion CacheEngineVersion (Maybe Text) (Maybe Text)
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 description of the cache engine.
cacheEngineVersion_cacheEngineDescription :: Lens.Lens' CacheEngineVersion (Prelude.Maybe Prelude.Text)
cacheEngineVersion_cacheEngineDescription :: (Maybe Text -> f (Maybe Text))
-> CacheEngineVersion -> f CacheEngineVersion
cacheEngineVersion_cacheEngineDescription = (CacheEngineVersion -> Maybe Text)
-> (CacheEngineVersion -> Maybe Text -> CacheEngineVersion)
-> Lens
     CacheEngineVersion CacheEngineVersion (Maybe Text) (Maybe Text)
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 name of the cache engine.
cacheEngineVersion_engine :: Lens.Lens' CacheEngineVersion (Prelude.Maybe Prelude.Text)
cacheEngineVersion_engine :: (Maybe Text -> f (Maybe Text))
-> CacheEngineVersion -> f CacheEngineVersion
cacheEngineVersion_engine = (CacheEngineVersion -> Maybe Text)
-> (CacheEngineVersion -> Maybe Text -> CacheEngineVersion)
-> Lens
     CacheEngineVersion CacheEngineVersion (Maybe Text) (Maybe Text)
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 description of the cache engine version.
cacheEngineVersion_cacheEngineVersionDescription :: Lens.Lens' CacheEngineVersion (Prelude.Maybe Prelude.Text)
cacheEngineVersion_cacheEngineVersionDescription :: (Maybe Text -> f (Maybe Text))
-> CacheEngineVersion -> f CacheEngineVersion
cacheEngineVersion_cacheEngineVersionDescription = (CacheEngineVersion -> Maybe Text)
-> (CacheEngineVersion -> Maybe Text -> CacheEngineVersion)
-> Lens
     CacheEngineVersion CacheEngineVersion (Maybe Text) (Maybe Text)
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)

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

instance Prelude.Hashable CacheEngineVersion

instance Prelude.NFData CacheEngineVersion