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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Neptune.Types.Parameter
import qualified Amazonka.Prelude as Prelude

-- | Contains the result of a successful invocation of the
-- DescribeEngineDefaultParameters action.
--
-- /See:/ 'newEngineDefaults' smart constructor.
data EngineDefaults = EngineDefaults'
  { -- | Specifies the name of the DB parameter group family that the engine
    -- default parameters apply to.
    EngineDefaults -> Maybe Text
dbParameterGroupFamily :: Prelude.Maybe Prelude.Text,
    -- | An optional pagination token provided by a previous EngineDefaults
    -- request. If this parameter is specified, the response includes only
    -- records beyond the marker, up to the value specified by @MaxRecords@ .
    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
(EngineDefaults -> EngineDefaults -> Bool)
-> (EngineDefaults -> EngineDefaults -> Bool) -> Eq EngineDefaults
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]
(Int -> ReadS EngineDefaults)
-> ReadS [EngineDefaults]
-> ReadPrec EngineDefaults
-> ReadPrec [EngineDefaults]
-> Read 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
(Int -> EngineDefaults -> ShowS)
-> (EngineDefaults -> String)
-> ([EngineDefaults] -> ShowS)
-> Show EngineDefaults
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. EngineDefaults -> Rep EngineDefaults x)
-> (forall x. Rep EngineDefaults x -> EngineDefaults)
-> Generic EngineDefaults
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:
--
-- 'dbParameterGroupFamily', 'engineDefaults_dbParameterGroupFamily' - Specifies the name of the DB parameter group family that the engine
-- default parameters apply to.
--
-- 'marker', 'engineDefaults_marker' - An optional pagination token provided by a previous EngineDefaults
-- request. If this parameter is specified, the response includes only
-- records beyond the marker, up to the value specified by @MaxRecords@ .
--
-- 'parameters', 'engineDefaults_parameters' - Contains a list of engine default parameters.
newEngineDefaults ::
  EngineDefaults
newEngineDefaults :: EngineDefaults
newEngineDefaults =
  EngineDefaults' :: Maybe Text -> Maybe Text -> Maybe [Parameter] -> EngineDefaults
EngineDefaults'
    { $sel:dbParameterGroupFamily:EngineDefaults' :: Maybe Text
dbParameterGroupFamily =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:EngineDefaults' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:EngineDefaults' :: Maybe [Parameter]
parameters = Maybe [Parameter]
forall a. Maybe a
Prelude.Nothing
    }

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

-- | An optional pagination token provided by a previous EngineDefaults
-- request. If this parameter is specified, the response includes only
-- records beyond the marker, up to the value specified by @MaxRecords@ .
engineDefaults_marker :: Lens.Lens' EngineDefaults (Prelude.Maybe Prelude.Text)
engineDefaults_marker :: (Maybe Text -> f (Maybe Text))
-> EngineDefaults -> f EngineDefaults
engineDefaults_marker = (EngineDefaults -> Maybe Text)
-> (EngineDefaults -> Maybe Text -> EngineDefaults)
-> Lens EngineDefaults EngineDefaults (Maybe Text) (Maybe Text)
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 :: (Maybe [Parameter] -> f (Maybe [Parameter]))
-> EngineDefaults -> f EngineDefaults
engineDefaults_parameters = (EngineDefaults -> Maybe [Parameter])
-> (EngineDefaults -> Maybe [Parameter] -> EngineDefaults)
-> Lens
     EngineDefaults
     EngineDefaults
     (Maybe [Parameter])
     (Maybe [Parameter])
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) ((Maybe [Parameter] -> f (Maybe [Parameter]))
 -> EngineDefaults -> f EngineDefaults)
-> ((Maybe [Parameter] -> f (Maybe [Parameter]))
    -> Maybe [Parameter] -> f (Maybe [Parameter]))
-> (Maybe [Parameter] -> f (Maybe [Parameter]))
-> EngineDefaults
-> f EngineDefaults
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Parameter] [Parameter] [Parameter] [Parameter]
-> Iso
     (Maybe [Parameter])
     (Maybe [Parameter])
     (Maybe [Parameter])
     (Maybe [Parameter])
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 AnIso [Parameter] [Parameter] [Parameter] [Parameter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable EngineDefaults

instance Prelude.NFData EngineDefaults