{-# 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.RDS.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.RDS.Types.EngineDefaults 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
import Amazonka.RDS.Types.Parameter

-- | 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
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:
--
-- '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'
    { $sel:dbParameterGroupFamily:EngineDefaults' :: Maybe Text
dbParameterGroupFamily =
        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
    }

-- | 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 :: Lens' EngineDefaults (Maybe Text)
engineDefaults_dbParameterGroupFamily = 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 :: 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 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
"DBParameterGroupFamily")
      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 [Parameter]
Maybe Text
parameters :: Maybe [Parameter]
marker :: Maybe Text
dbParameterGroupFamily :: Maybe Text
$sel:parameters:EngineDefaults' :: EngineDefaults -> Maybe [Parameter]
$sel:marker:EngineDefaults' :: EngineDefaults -> Maybe Text
$sel:dbParameterGroupFamily:EngineDefaults' :: EngineDefaults -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
dbParameterGroupFamily
      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 [Parameter]
Maybe Text
parameters :: Maybe [Parameter]
marker :: Maybe Text
dbParameterGroupFamily :: Maybe Text
$sel:parameters:EngineDefaults' :: EngineDefaults -> Maybe [Parameter]
$sel:marker:EngineDefaults' :: EngineDefaults -> Maybe Text
$sel:dbParameterGroupFamily:EngineDefaults' :: EngineDefaults -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
dbParameterGroupFamily
      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