{-# 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.Lightsail.Types.PendingModifiedRelationalDatabaseValues
-- 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.Lightsail.Types.PendingModifiedRelationalDatabaseValues where

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

-- | Describes a pending database value modification.
--
-- /See:/ 'newPendingModifiedRelationalDatabaseValues' smart constructor.
data PendingModifiedRelationalDatabaseValues = PendingModifiedRelationalDatabaseValues'
  { -- | The database engine version.
    PendingModifiedRelationalDatabaseValues -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | The password for the master user of the database.
    PendingModifiedRelationalDatabaseValues -> Maybe Text
masterUserPassword :: Prelude.Maybe Prelude.Text,
    -- | A Boolean value indicating whether automated backup retention is
    -- enabled.
    PendingModifiedRelationalDatabaseValues -> Maybe Bool
backupRetentionEnabled :: Prelude.Maybe Prelude.Bool
  }
  deriving (PendingModifiedRelationalDatabaseValues
-> PendingModifiedRelationalDatabaseValues -> Bool
(PendingModifiedRelationalDatabaseValues
 -> PendingModifiedRelationalDatabaseValues -> Bool)
-> (PendingModifiedRelationalDatabaseValues
    -> PendingModifiedRelationalDatabaseValues -> Bool)
-> Eq PendingModifiedRelationalDatabaseValues
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PendingModifiedRelationalDatabaseValues
-> PendingModifiedRelationalDatabaseValues -> Bool
$c/= :: PendingModifiedRelationalDatabaseValues
-> PendingModifiedRelationalDatabaseValues -> Bool
== :: PendingModifiedRelationalDatabaseValues
-> PendingModifiedRelationalDatabaseValues -> Bool
$c== :: PendingModifiedRelationalDatabaseValues
-> PendingModifiedRelationalDatabaseValues -> Bool
Prelude.Eq, ReadPrec [PendingModifiedRelationalDatabaseValues]
ReadPrec PendingModifiedRelationalDatabaseValues
Int -> ReadS PendingModifiedRelationalDatabaseValues
ReadS [PendingModifiedRelationalDatabaseValues]
(Int -> ReadS PendingModifiedRelationalDatabaseValues)
-> ReadS [PendingModifiedRelationalDatabaseValues]
-> ReadPrec PendingModifiedRelationalDatabaseValues
-> ReadPrec [PendingModifiedRelationalDatabaseValues]
-> Read PendingModifiedRelationalDatabaseValues
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PendingModifiedRelationalDatabaseValues]
$creadListPrec :: ReadPrec [PendingModifiedRelationalDatabaseValues]
readPrec :: ReadPrec PendingModifiedRelationalDatabaseValues
$creadPrec :: ReadPrec PendingModifiedRelationalDatabaseValues
readList :: ReadS [PendingModifiedRelationalDatabaseValues]
$creadList :: ReadS [PendingModifiedRelationalDatabaseValues]
readsPrec :: Int -> ReadS PendingModifiedRelationalDatabaseValues
$creadsPrec :: Int -> ReadS PendingModifiedRelationalDatabaseValues
Prelude.Read, Int -> PendingModifiedRelationalDatabaseValues -> ShowS
[PendingModifiedRelationalDatabaseValues] -> ShowS
PendingModifiedRelationalDatabaseValues -> String
(Int -> PendingModifiedRelationalDatabaseValues -> ShowS)
-> (PendingModifiedRelationalDatabaseValues -> String)
-> ([PendingModifiedRelationalDatabaseValues] -> ShowS)
-> Show PendingModifiedRelationalDatabaseValues
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PendingModifiedRelationalDatabaseValues] -> ShowS
$cshowList :: [PendingModifiedRelationalDatabaseValues] -> ShowS
show :: PendingModifiedRelationalDatabaseValues -> String
$cshow :: PendingModifiedRelationalDatabaseValues -> String
showsPrec :: Int -> PendingModifiedRelationalDatabaseValues -> ShowS
$cshowsPrec :: Int -> PendingModifiedRelationalDatabaseValues -> ShowS
Prelude.Show, (forall x.
 PendingModifiedRelationalDatabaseValues
 -> Rep PendingModifiedRelationalDatabaseValues x)
-> (forall x.
    Rep PendingModifiedRelationalDatabaseValues x
    -> PendingModifiedRelationalDatabaseValues)
-> Generic PendingModifiedRelationalDatabaseValues
forall x.
Rep PendingModifiedRelationalDatabaseValues x
-> PendingModifiedRelationalDatabaseValues
forall x.
PendingModifiedRelationalDatabaseValues
-> Rep PendingModifiedRelationalDatabaseValues x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PendingModifiedRelationalDatabaseValues x
-> PendingModifiedRelationalDatabaseValues
$cfrom :: forall x.
PendingModifiedRelationalDatabaseValues
-> Rep PendingModifiedRelationalDatabaseValues x
Prelude.Generic)

-- |
-- Create a value of 'PendingModifiedRelationalDatabaseValues' 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', 'pendingModifiedRelationalDatabaseValues_engineVersion' - The database engine version.
--
-- 'masterUserPassword', 'pendingModifiedRelationalDatabaseValues_masterUserPassword' - The password for the master user of the database.
--
-- 'backupRetentionEnabled', 'pendingModifiedRelationalDatabaseValues_backupRetentionEnabled' - A Boolean value indicating whether automated backup retention is
-- enabled.
newPendingModifiedRelationalDatabaseValues ::
  PendingModifiedRelationalDatabaseValues
newPendingModifiedRelationalDatabaseValues :: PendingModifiedRelationalDatabaseValues
newPendingModifiedRelationalDatabaseValues =
  PendingModifiedRelationalDatabaseValues' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> PendingModifiedRelationalDatabaseValues
PendingModifiedRelationalDatabaseValues'
    { $sel:engineVersion:PendingModifiedRelationalDatabaseValues' :: Maybe Text
engineVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:masterUserPassword:PendingModifiedRelationalDatabaseValues' :: Maybe Text
masterUserPassword =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupRetentionEnabled:PendingModifiedRelationalDatabaseValues' :: Maybe Bool
backupRetentionEnabled =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The password for the master user of the database.
pendingModifiedRelationalDatabaseValues_masterUserPassword :: Lens.Lens' PendingModifiedRelationalDatabaseValues (Prelude.Maybe Prelude.Text)
pendingModifiedRelationalDatabaseValues_masterUserPassword :: (Maybe Text -> f (Maybe Text))
-> PendingModifiedRelationalDatabaseValues
-> f PendingModifiedRelationalDatabaseValues
pendingModifiedRelationalDatabaseValues_masterUserPassword = (PendingModifiedRelationalDatabaseValues -> Maybe Text)
-> (PendingModifiedRelationalDatabaseValues
    -> Maybe Text -> PendingModifiedRelationalDatabaseValues)
-> Lens
     PendingModifiedRelationalDatabaseValues
     PendingModifiedRelationalDatabaseValues
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PendingModifiedRelationalDatabaseValues' {Maybe Text
masterUserPassword :: Maybe Text
$sel:masterUserPassword:PendingModifiedRelationalDatabaseValues' :: PendingModifiedRelationalDatabaseValues -> Maybe Text
masterUserPassword} -> Maybe Text
masterUserPassword) (\s :: PendingModifiedRelationalDatabaseValues
s@PendingModifiedRelationalDatabaseValues' {} Maybe Text
a -> PendingModifiedRelationalDatabaseValues
s {$sel:masterUserPassword:PendingModifiedRelationalDatabaseValues' :: Maybe Text
masterUserPassword = Maybe Text
a} :: PendingModifiedRelationalDatabaseValues)

-- | A Boolean value indicating whether automated backup retention is
-- enabled.
pendingModifiedRelationalDatabaseValues_backupRetentionEnabled :: Lens.Lens' PendingModifiedRelationalDatabaseValues (Prelude.Maybe Prelude.Bool)
pendingModifiedRelationalDatabaseValues_backupRetentionEnabled :: (Maybe Bool -> f (Maybe Bool))
-> PendingModifiedRelationalDatabaseValues
-> f PendingModifiedRelationalDatabaseValues
pendingModifiedRelationalDatabaseValues_backupRetentionEnabled = (PendingModifiedRelationalDatabaseValues -> Maybe Bool)
-> (PendingModifiedRelationalDatabaseValues
    -> Maybe Bool -> PendingModifiedRelationalDatabaseValues)
-> Lens
     PendingModifiedRelationalDatabaseValues
     PendingModifiedRelationalDatabaseValues
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PendingModifiedRelationalDatabaseValues' {Maybe Bool
backupRetentionEnabled :: Maybe Bool
$sel:backupRetentionEnabled:PendingModifiedRelationalDatabaseValues' :: PendingModifiedRelationalDatabaseValues -> Maybe Bool
backupRetentionEnabled} -> Maybe Bool
backupRetentionEnabled) (\s :: PendingModifiedRelationalDatabaseValues
s@PendingModifiedRelationalDatabaseValues' {} Maybe Bool
a -> PendingModifiedRelationalDatabaseValues
s {$sel:backupRetentionEnabled:PendingModifiedRelationalDatabaseValues' :: Maybe Bool
backupRetentionEnabled = Maybe Bool
a} :: PendingModifiedRelationalDatabaseValues)

instance
  Core.FromJSON
    PendingModifiedRelationalDatabaseValues
  where
  parseJSON :: Value -> Parser PendingModifiedRelationalDatabaseValues
parseJSON =
    String
-> (Object -> Parser PendingModifiedRelationalDatabaseValues)
-> Value
-> Parser PendingModifiedRelationalDatabaseValues
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PendingModifiedRelationalDatabaseValues"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> PendingModifiedRelationalDatabaseValues
PendingModifiedRelationalDatabaseValues'
            (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> PendingModifiedRelationalDatabaseValues)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool -> PendingModifiedRelationalDatabaseValues)
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 Bool -> PendingModifiedRelationalDatabaseValues)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> PendingModifiedRelationalDatabaseValues)
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
"masterUserPassword")
            Parser (Maybe Bool -> PendingModifiedRelationalDatabaseValues)
-> Parser (Maybe Bool)
-> Parser PendingModifiedRelationalDatabaseValues
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"backupRetentionEnabled")
      )

instance
  Prelude.Hashable
    PendingModifiedRelationalDatabaseValues

instance
  Prelude.NFData
    PendingModifiedRelationalDatabaseValues