{-# 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.MemoryDb.Types.EngineVersionInfo
-- 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.MemoryDb.Types.EngineVersionInfo where

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

-- | Provides details of the Redis engine version
--
-- /See:/ 'newEngineVersionInfo' smart constructor.
data EngineVersionInfo = EngineVersionInfo'
  { -- | The engine version
    EngineVersionInfo -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | The patched engine version
    EngineVersionInfo -> Maybe Text
enginePatchVersion :: Prelude.Maybe Prelude.Text,
    -- | Specifies the name of the parameter group family to which the engine
    -- default parameters apply.
    EngineVersionInfo -> Maybe Text
parameterGroupFamily :: Prelude.Maybe Prelude.Text
  }
  deriving (EngineVersionInfo -> EngineVersionInfo -> Bool
(EngineVersionInfo -> EngineVersionInfo -> Bool)
-> (EngineVersionInfo -> EngineVersionInfo -> Bool)
-> Eq EngineVersionInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EngineVersionInfo -> EngineVersionInfo -> Bool
$c/= :: EngineVersionInfo -> EngineVersionInfo -> Bool
== :: EngineVersionInfo -> EngineVersionInfo -> Bool
$c== :: EngineVersionInfo -> EngineVersionInfo -> Bool
Prelude.Eq, ReadPrec [EngineVersionInfo]
ReadPrec EngineVersionInfo
Int -> ReadS EngineVersionInfo
ReadS [EngineVersionInfo]
(Int -> ReadS EngineVersionInfo)
-> ReadS [EngineVersionInfo]
-> ReadPrec EngineVersionInfo
-> ReadPrec [EngineVersionInfo]
-> Read EngineVersionInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EngineVersionInfo]
$creadListPrec :: ReadPrec [EngineVersionInfo]
readPrec :: ReadPrec EngineVersionInfo
$creadPrec :: ReadPrec EngineVersionInfo
readList :: ReadS [EngineVersionInfo]
$creadList :: ReadS [EngineVersionInfo]
readsPrec :: Int -> ReadS EngineVersionInfo
$creadsPrec :: Int -> ReadS EngineVersionInfo
Prelude.Read, Int -> EngineVersionInfo -> ShowS
[EngineVersionInfo] -> ShowS
EngineVersionInfo -> String
(Int -> EngineVersionInfo -> ShowS)
-> (EngineVersionInfo -> String)
-> ([EngineVersionInfo] -> ShowS)
-> Show EngineVersionInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EngineVersionInfo] -> ShowS
$cshowList :: [EngineVersionInfo] -> ShowS
show :: EngineVersionInfo -> String
$cshow :: EngineVersionInfo -> String
showsPrec :: Int -> EngineVersionInfo -> ShowS
$cshowsPrec :: Int -> EngineVersionInfo -> ShowS
Prelude.Show, (forall x. EngineVersionInfo -> Rep EngineVersionInfo x)
-> (forall x. Rep EngineVersionInfo x -> EngineVersionInfo)
-> Generic EngineVersionInfo
forall x. Rep EngineVersionInfo x -> EngineVersionInfo
forall x. EngineVersionInfo -> Rep EngineVersionInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EngineVersionInfo x -> EngineVersionInfo
$cfrom :: forall x. EngineVersionInfo -> Rep EngineVersionInfo x
Prelude.Generic)

-- |
-- Create a value of 'EngineVersionInfo' 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', 'engineVersionInfo_engineVersion' - The engine version
--
-- 'enginePatchVersion', 'engineVersionInfo_enginePatchVersion' - The patched engine version
--
-- 'parameterGroupFamily', 'engineVersionInfo_parameterGroupFamily' - Specifies the name of the parameter group family to which the engine
-- default parameters apply.
newEngineVersionInfo ::
  EngineVersionInfo
newEngineVersionInfo :: EngineVersionInfo
newEngineVersionInfo =
  EngineVersionInfo' :: Maybe Text -> Maybe Text -> Maybe Text -> EngineVersionInfo
EngineVersionInfo'
    { $sel:engineVersion:EngineVersionInfo' :: Maybe Text
engineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enginePatchVersion:EngineVersionInfo' :: Maybe Text
enginePatchVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterGroupFamily:EngineVersionInfo' :: Maybe Text
parameterGroupFamily = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The engine version
engineVersionInfo_engineVersion :: Lens.Lens' EngineVersionInfo (Prelude.Maybe Prelude.Text)
engineVersionInfo_engineVersion :: (Maybe Text -> f (Maybe Text))
-> EngineVersionInfo -> f EngineVersionInfo
engineVersionInfo_engineVersion = (EngineVersionInfo -> Maybe Text)
-> (EngineVersionInfo -> Maybe Text -> EngineVersionInfo)
-> Lens
     EngineVersionInfo EngineVersionInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EngineVersionInfo' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:EngineVersionInfo' :: EngineVersionInfo -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: EngineVersionInfo
s@EngineVersionInfo' {} Maybe Text
a -> EngineVersionInfo
s {$sel:engineVersion:EngineVersionInfo' :: Maybe Text
engineVersion = Maybe Text
a} :: EngineVersionInfo)

-- | The patched engine version
engineVersionInfo_enginePatchVersion :: Lens.Lens' EngineVersionInfo (Prelude.Maybe Prelude.Text)
engineVersionInfo_enginePatchVersion :: (Maybe Text -> f (Maybe Text))
-> EngineVersionInfo -> f EngineVersionInfo
engineVersionInfo_enginePatchVersion = (EngineVersionInfo -> Maybe Text)
-> (EngineVersionInfo -> Maybe Text -> EngineVersionInfo)
-> Lens
     EngineVersionInfo EngineVersionInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EngineVersionInfo' {Maybe Text
enginePatchVersion :: Maybe Text
$sel:enginePatchVersion:EngineVersionInfo' :: EngineVersionInfo -> Maybe Text
enginePatchVersion} -> Maybe Text
enginePatchVersion) (\s :: EngineVersionInfo
s@EngineVersionInfo' {} Maybe Text
a -> EngineVersionInfo
s {$sel:enginePatchVersion:EngineVersionInfo' :: Maybe Text
enginePatchVersion = Maybe Text
a} :: EngineVersionInfo)

-- | Specifies the name of the parameter group family to which the engine
-- default parameters apply.
engineVersionInfo_parameterGroupFamily :: Lens.Lens' EngineVersionInfo (Prelude.Maybe Prelude.Text)
engineVersionInfo_parameterGroupFamily :: (Maybe Text -> f (Maybe Text))
-> EngineVersionInfo -> f EngineVersionInfo
engineVersionInfo_parameterGroupFamily = (EngineVersionInfo -> Maybe Text)
-> (EngineVersionInfo -> Maybe Text -> EngineVersionInfo)
-> Lens
     EngineVersionInfo EngineVersionInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EngineVersionInfo' {Maybe Text
parameterGroupFamily :: Maybe Text
$sel:parameterGroupFamily:EngineVersionInfo' :: EngineVersionInfo -> Maybe Text
parameterGroupFamily} -> Maybe Text
parameterGroupFamily) (\s :: EngineVersionInfo
s@EngineVersionInfo' {} Maybe Text
a -> EngineVersionInfo
s {$sel:parameterGroupFamily:EngineVersionInfo' :: Maybe Text
parameterGroupFamily = Maybe Text
a} :: EngineVersionInfo)

instance Core.FromJSON EngineVersionInfo where
  parseJSON :: Value -> Parser EngineVersionInfo
parseJSON =
    String
-> (Object -> Parser EngineVersionInfo)
-> Value
-> Parser EngineVersionInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"EngineVersionInfo"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> EngineVersionInfo
EngineVersionInfo'
            (Maybe Text -> Maybe Text -> Maybe Text -> EngineVersionInfo)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> EngineVersionInfo)
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
"EngineVersion")
            Parser (Maybe Text -> Maybe Text -> EngineVersionInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> EngineVersionInfo)
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
"EnginePatchVersion")
            Parser (Maybe Text -> EngineVersionInfo)
-> Parser (Maybe Text) -> Parser EngineVersionInfo
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
"ParameterGroupFamily")
      )

instance Prelude.Hashable EngineVersionInfo

instance Prelude.NFData EngineVersionInfo