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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ElastiCache.Types.CacheNodeTypeSpecificParameter
import Amazonka.ElastiCache.Types.Parameter
import qualified Amazonka.Prelude as Prelude

-- | Represents the output of a @DescribeEngineDefaultParameters@ operation.
--
-- /See:/ 'newEngineDefaults' smart constructor.
data EngineDefaults = EngineDefaults'
  { -- | A list of parameters specific to a particular cache node type. Each
    -- element in the list contains detailed information about one parameter.
    EngineDefaults -> Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters :: Prelude.Maybe [CacheNodeTypeSpecificParameter],
    -- | Specifies the name of the cache parameter group family to which the
    -- engine default parameters apply.
    --
    -- Valid values are: @memcached1.4@ | @memcached1.5@ | @memcached1.6@ |
    -- @redis2.6@ | @redis2.8@ | @redis3.2@ | @redis4.0@ | @redis5.0@ |
    -- @redis6.0@ | @redis6.x@
    EngineDefaults -> Maybe Text
cacheParameterGroupFamily :: Prelude.Maybe Prelude.Text,
    -- | Provides an identifier to allow retrieval of paginated results.
    EngineDefaults -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | Contains a list of engine default parameters.
    EngineDefaults -> Maybe [Parameter]
parameters :: Prelude.Maybe [Parameter]
  }
  deriving (EngineDefaults -> EngineDefaults -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EngineDefaults -> EngineDefaults -> Bool
$c/= :: EngineDefaults -> EngineDefaults -> Bool
== :: EngineDefaults -> EngineDefaults -> Bool
$c== :: EngineDefaults -> EngineDefaults -> Bool
Prelude.Eq, ReadPrec [EngineDefaults]
ReadPrec EngineDefaults
Int -> ReadS EngineDefaults
ReadS [EngineDefaults]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EngineDefaults]
$creadListPrec :: ReadPrec [EngineDefaults]
readPrec :: ReadPrec EngineDefaults
$creadPrec :: ReadPrec EngineDefaults
readList :: ReadS [EngineDefaults]
$creadList :: ReadS [EngineDefaults]
readsPrec :: Int -> ReadS EngineDefaults
$creadsPrec :: Int -> ReadS EngineDefaults
Prelude.Read, Int -> EngineDefaults -> ShowS
[EngineDefaults] -> ShowS
EngineDefaults -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EngineDefaults] -> ShowS
$cshowList :: [EngineDefaults] -> ShowS
show :: EngineDefaults -> String
$cshow :: EngineDefaults -> String
showsPrec :: Int -> EngineDefaults -> ShowS
$cshowsPrec :: Int -> EngineDefaults -> ShowS
Prelude.Show, forall x. Rep EngineDefaults x -> EngineDefaults
forall x. EngineDefaults -> Rep EngineDefaults x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EngineDefaults x -> EngineDefaults
$cfrom :: forall x. EngineDefaults -> Rep EngineDefaults x
Prelude.Generic)

-- |
-- Create a value of 'EngineDefaults' 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:
--
-- 'cacheNodeTypeSpecificParameters', 'engineDefaults_cacheNodeTypeSpecificParameters' - A list of parameters specific to a particular cache node type. Each
-- element in the list contains detailed information about one parameter.
--
-- 'cacheParameterGroupFamily', 'engineDefaults_cacheParameterGroupFamily' - Specifies the name of the cache parameter group family to which the
-- engine default parameters apply.
--
-- Valid values are: @memcached1.4@ | @memcached1.5@ | @memcached1.6@ |
-- @redis2.6@ | @redis2.8@ | @redis3.2@ | @redis4.0@ | @redis5.0@ |
-- @redis6.0@ | @redis6.x@
--
-- 'marker', 'engineDefaults_marker' - Provides an identifier to allow retrieval of paginated results.
--
-- 'parameters', 'engineDefaults_parameters' - Contains a list of engine default parameters.
newEngineDefaults ::
  EngineDefaults
newEngineDefaults :: EngineDefaults
newEngineDefaults =
  EngineDefaults'
    { $sel:cacheNodeTypeSpecificParameters:EngineDefaults' :: Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cacheParameterGroupFamily:EngineDefaults' :: Maybe Text
cacheParameterGroupFamily = forall a. Maybe a
Prelude.Nothing,
      $sel:marker:EngineDefaults' :: Maybe Text
marker = forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:EngineDefaults' :: Maybe [Parameter]
parameters = forall a. Maybe a
Prelude.Nothing
    }

-- | A list of parameters specific to a particular cache node type. Each
-- element in the list contains detailed information about one parameter.
engineDefaults_cacheNodeTypeSpecificParameters :: Lens.Lens' EngineDefaults (Prelude.Maybe [CacheNodeTypeSpecificParameter])
engineDefaults_cacheNodeTypeSpecificParameters :: Lens' EngineDefaults (Maybe [CacheNodeTypeSpecificParameter])
engineDefaults_cacheNodeTypeSpecificParameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EngineDefaults' {Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters :: Maybe [CacheNodeTypeSpecificParameter]
$sel:cacheNodeTypeSpecificParameters:EngineDefaults' :: EngineDefaults -> Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters} -> Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters) (\s :: EngineDefaults
s@EngineDefaults' {} Maybe [CacheNodeTypeSpecificParameter]
a -> EngineDefaults
s {$sel:cacheNodeTypeSpecificParameters:EngineDefaults' :: Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters = Maybe [CacheNodeTypeSpecificParameter]
a} :: EngineDefaults) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Specifies the name of the cache parameter group family to which the
-- engine default parameters apply.
--
-- Valid values are: @memcached1.4@ | @memcached1.5@ | @memcached1.6@ |
-- @redis2.6@ | @redis2.8@ | @redis3.2@ | @redis4.0@ | @redis5.0@ |
-- @redis6.0@ | @redis6.x@
engineDefaults_cacheParameterGroupFamily :: Lens.Lens' EngineDefaults (Prelude.Maybe Prelude.Text)
engineDefaults_cacheParameterGroupFamily :: Lens' EngineDefaults (Maybe Text)
engineDefaults_cacheParameterGroupFamily = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EngineDefaults' {Maybe Text
cacheParameterGroupFamily :: Maybe Text
$sel:cacheParameterGroupFamily:EngineDefaults' :: EngineDefaults -> Maybe Text
cacheParameterGroupFamily} -> Maybe Text
cacheParameterGroupFamily) (\s :: EngineDefaults
s@EngineDefaults' {} Maybe Text
a -> EngineDefaults
s {$sel:cacheParameterGroupFamily:EngineDefaults' :: Maybe Text
cacheParameterGroupFamily = Maybe Text
a} :: EngineDefaults)

-- | Provides an identifier to allow retrieval of paginated results.
engineDefaults_marker :: Lens.Lens' EngineDefaults (Prelude.Maybe Prelude.Text)
engineDefaults_marker :: Lens' EngineDefaults (Maybe Text)
engineDefaults_marker = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EngineDefaults' {Maybe Text
marker :: Maybe Text
$sel:marker:EngineDefaults' :: EngineDefaults -> Maybe Text
marker} -> Maybe Text
marker) (\s :: EngineDefaults
s@EngineDefaults' {} Maybe Text
a -> EngineDefaults
s {$sel:marker:EngineDefaults' :: Maybe Text
marker = Maybe Text
a} :: EngineDefaults)

-- | Contains a list of engine default parameters.
engineDefaults_parameters :: Lens.Lens' EngineDefaults (Prelude.Maybe [Parameter])
engineDefaults_parameters :: Lens' EngineDefaults (Maybe [Parameter])
engineDefaults_parameters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EngineDefaults' {Maybe [Parameter]
parameters :: Maybe [Parameter]
$sel:parameters:EngineDefaults' :: EngineDefaults -> Maybe [Parameter]
parameters} -> Maybe [Parameter]
parameters) (\s :: EngineDefaults
s@EngineDefaults' {} Maybe [Parameter]
a -> EngineDefaults
s {$sel:parameters:EngineDefaults' :: Maybe [Parameter]
parameters = Maybe [Parameter]
a} :: EngineDefaults) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Data.FromXML EngineDefaults where
  parseXML :: [Node] -> Either String EngineDefaults
parseXML [Node]
x =
    Maybe [CacheNodeTypeSpecificParameter]
-> Maybe Text -> Maybe Text -> Maybe [Parameter] -> EngineDefaults
EngineDefaults'
      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
"CacheNodeTypeSpecificParameters"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may
                        (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"CacheNodeTypeSpecificParameter")
                  )
      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
"Marker")
      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
"Parameters"
                      forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                      forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (forall a. FromXML a => Text -> [Node] -> Either String [a]
Data.parseXMLList Text
"Parameter")
                  )

instance Prelude.Hashable EngineDefaults where
  hashWithSalt :: Int -> EngineDefaults -> Int
hashWithSalt Int
_salt EngineDefaults' {Maybe [CacheNodeTypeSpecificParameter]
Maybe [Parameter]
Maybe Text
parameters :: Maybe [Parameter]
marker :: Maybe Text
cacheParameterGroupFamily :: Maybe Text
cacheNodeTypeSpecificParameters :: Maybe [CacheNodeTypeSpecificParameter]
$sel:parameters:EngineDefaults' :: EngineDefaults -> Maybe [Parameter]
$sel:marker:EngineDefaults' :: EngineDefaults -> Maybe Text
$sel:cacheParameterGroupFamily:EngineDefaults' :: EngineDefaults -> Maybe Text
$sel:cacheNodeTypeSpecificParameters:EngineDefaults' :: EngineDefaults -> Maybe [CacheNodeTypeSpecificParameter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
cacheParameterGroupFamily
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Parameter]
parameters

instance Prelude.NFData EngineDefaults where
  rnf :: EngineDefaults -> ()
rnf EngineDefaults' {Maybe [CacheNodeTypeSpecificParameter]
Maybe [Parameter]
Maybe Text
parameters :: Maybe [Parameter]
marker :: Maybe Text
cacheParameterGroupFamily :: Maybe Text
cacheNodeTypeSpecificParameters :: Maybe [CacheNodeTypeSpecificParameter]
$sel:parameters:EngineDefaults' :: EngineDefaults -> Maybe [Parameter]
$sel:marker:EngineDefaults' :: EngineDefaults -> Maybe Text
$sel:cacheParameterGroupFamily:EngineDefaults' :: EngineDefaults -> Maybe Text
$sel:cacheNodeTypeSpecificParameters:EngineDefaults' :: EngineDefaults -> Maybe [CacheNodeTypeSpecificParameter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [CacheNodeTypeSpecificParameter]
cacheNodeTypeSpecificParameters
      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
marker
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Parameter]
parameters