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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.RelationalDatabaseEngine
import qualified Amazonka.Prelude as Prelude

-- | Describes a database image, or blueprint. A blueprint describes the
-- major engine version of a database.
--
-- /See:/ 'newRelationalDatabaseBlueprint' smart constructor.
data RelationalDatabaseBlueprint = RelationalDatabaseBlueprint'
  { -- | The database engine version for the database blueprint (for example,
    -- @5.7.23@).
    RelationalDatabaseBlueprint -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
    -- | A Boolean value indicating whether the engine version is the default for
    -- the database blueprint.
    RelationalDatabaseBlueprint -> Maybe Bool
isEngineDefault :: Prelude.Maybe Prelude.Bool,
    -- | The description of the database engine version for the database
    -- blueprint.
    RelationalDatabaseBlueprint -> Maybe Text
engineVersionDescription :: Prelude.Maybe Prelude.Text,
    -- | The database software of the database blueprint (for example, @MySQL@).
    RelationalDatabaseBlueprint -> Maybe RelationalDatabaseEngine
engine :: Prelude.Maybe RelationalDatabaseEngine,
    -- | The ID for the database blueprint.
    RelationalDatabaseBlueprint -> Maybe Text
blueprintId :: Prelude.Maybe Prelude.Text,
    -- | The description of the database engine for the database blueprint.
    RelationalDatabaseBlueprint -> Maybe Text
engineDescription :: Prelude.Maybe Prelude.Text
  }
  deriving (RelationalDatabaseBlueprint -> RelationalDatabaseBlueprint -> Bool
(RelationalDatabaseBlueprint
 -> RelationalDatabaseBlueprint -> Bool)
-> (RelationalDatabaseBlueprint
    -> RelationalDatabaseBlueprint -> Bool)
-> Eq RelationalDatabaseBlueprint
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RelationalDatabaseBlueprint -> RelationalDatabaseBlueprint -> Bool
$c/= :: RelationalDatabaseBlueprint -> RelationalDatabaseBlueprint -> Bool
== :: RelationalDatabaseBlueprint -> RelationalDatabaseBlueprint -> Bool
$c== :: RelationalDatabaseBlueprint -> RelationalDatabaseBlueprint -> Bool
Prelude.Eq, ReadPrec [RelationalDatabaseBlueprint]
ReadPrec RelationalDatabaseBlueprint
Int -> ReadS RelationalDatabaseBlueprint
ReadS [RelationalDatabaseBlueprint]
(Int -> ReadS RelationalDatabaseBlueprint)
-> ReadS [RelationalDatabaseBlueprint]
-> ReadPrec RelationalDatabaseBlueprint
-> ReadPrec [RelationalDatabaseBlueprint]
-> Read RelationalDatabaseBlueprint
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RelationalDatabaseBlueprint]
$creadListPrec :: ReadPrec [RelationalDatabaseBlueprint]
readPrec :: ReadPrec RelationalDatabaseBlueprint
$creadPrec :: ReadPrec RelationalDatabaseBlueprint
readList :: ReadS [RelationalDatabaseBlueprint]
$creadList :: ReadS [RelationalDatabaseBlueprint]
readsPrec :: Int -> ReadS RelationalDatabaseBlueprint
$creadsPrec :: Int -> ReadS RelationalDatabaseBlueprint
Prelude.Read, Int -> RelationalDatabaseBlueprint -> ShowS
[RelationalDatabaseBlueprint] -> ShowS
RelationalDatabaseBlueprint -> String
(Int -> RelationalDatabaseBlueprint -> ShowS)
-> (RelationalDatabaseBlueprint -> String)
-> ([RelationalDatabaseBlueprint] -> ShowS)
-> Show RelationalDatabaseBlueprint
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RelationalDatabaseBlueprint] -> ShowS
$cshowList :: [RelationalDatabaseBlueprint] -> ShowS
show :: RelationalDatabaseBlueprint -> String
$cshow :: RelationalDatabaseBlueprint -> String
showsPrec :: Int -> RelationalDatabaseBlueprint -> ShowS
$cshowsPrec :: Int -> RelationalDatabaseBlueprint -> ShowS
Prelude.Show, (forall x.
 RelationalDatabaseBlueprint -> Rep RelationalDatabaseBlueprint x)
-> (forall x.
    Rep RelationalDatabaseBlueprint x -> RelationalDatabaseBlueprint)
-> Generic RelationalDatabaseBlueprint
forall x.
Rep RelationalDatabaseBlueprint x -> RelationalDatabaseBlueprint
forall x.
RelationalDatabaseBlueprint -> Rep RelationalDatabaseBlueprint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RelationalDatabaseBlueprint x -> RelationalDatabaseBlueprint
$cfrom :: forall x.
RelationalDatabaseBlueprint -> Rep RelationalDatabaseBlueprint x
Prelude.Generic)

-- |
-- Create a value of 'RelationalDatabaseBlueprint' 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', 'relationalDatabaseBlueprint_engineVersion' - The database engine version for the database blueprint (for example,
-- @5.7.23@).
--
-- 'isEngineDefault', 'relationalDatabaseBlueprint_isEngineDefault' - A Boolean value indicating whether the engine version is the default for
-- the database blueprint.
--
-- 'engineVersionDescription', 'relationalDatabaseBlueprint_engineVersionDescription' - The description of the database engine version for the database
-- blueprint.
--
-- 'engine', 'relationalDatabaseBlueprint_engine' - The database software of the database blueprint (for example, @MySQL@).
--
-- 'blueprintId', 'relationalDatabaseBlueprint_blueprintId' - The ID for the database blueprint.
--
-- 'engineDescription', 'relationalDatabaseBlueprint_engineDescription' - The description of the database engine for the database blueprint.
newRelationalDatabaseBlueprint ::
  RelationalDatabaseBlueprint
newRelationalDatabaseBlueprint :: RelationalDatabaseBlueprint
newRelationalDatabaseBlueprint =
  RelationalDatabaseBlueprint' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe RelationalDatabaseEngine
-> Maybe Text
-> Maybe Text
-> RelationalDatabaseBlueprint
RelationalDatabaseBlueprint'
    { $sel:engineVersion:RelationalDatabaseBlueprint' :: Maybe Text
engineVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isEngineDefault:RelationalDatabaseBlueprint' :: Maybe Bool
isEngineDefault = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:engineVersionDescription:RelationalDatabaseBlueprint' :: Maybe Text
engineVersionDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engine:RelationalDatabaseBlueprint' :: Maybe RelationalDatabaseEngine
engine = Maybe RelationalDatabaseEngine
forall a. Maybe a
Prelude.Nothing,
      $sel:blueprintId:RelationalDatabaseBlueprint' :: Maybe Text
blueprintId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:engineDescription:RelationalDatabaseBlueprint' :: Maybe Text
engineDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The database engine version for the database blueprint (for example,
-- @5.7.23@).
relationalDatabaseBlueprint_engineVersion :: Lens.Lens' RelationalDatabaseBlueprint (Prelude.Maybe Prelude.Text)
relationalDatabaseBlueprint_engineVersion :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseBlueprint -> f RelationalDatabaseBlueprint
relationalDatabaseBlueprint_engineVersion = (RelationalDatabaseBlueprint -> Maybe Text)
-> (RelationalDatabaseBlueprint
    -> Maybe Text -> RelationalDatabaseBlueprint)
-> Lens
     RelationalDatabaseBlueprint
     RelationalDatabaseBlueprint
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseBlueprint' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:RelationalDatabaseBlueprint' :: RelationalDatabaseBlueprint -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: RelationalDatabaseBlueprint
s@RelationalDatabaseBlueprint' {} Maybe Text
a -> RelationalDatabaseBlueprint
s {$sel:engineVersion:RelationalDatabaseBlueprint' :: Maybe Text
engineVersion = Maybe Text
a} :: RelationalDatabaseBlueprint)

-- | A Boolean value indicating whether the engine version is the default for
-- the database blueprint.
relationalDatabaseBlueprint_isEngineDefault :: Lens.Lens' RelationalDatabaseBlueprint (Prelude.Maybe Prelude.Bool)
relationalDatabaseBlueprint_isEngineDefault :: (Maybe Bool -> f (Maybe Bool))
-> RelationalDatabaseBlueprint -> f RelationalDatabaseBlueprint
relationalDatabaseBlueprint_isEngineDefault = (RelationalDatabaseBlueprint -> Maybe Bool)
-> (RelationalDatabaseBlueprint
    -> Maybe Bool -> RelationalDatabaseBlueprint)
-> Lens
     RelationalDatabaseBlueprint
     RelationalDatabaseBlueprint
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseBlueprint' {Maybe Bool
isEngineDefault :: Maybe Bool
$sel:isEngineDefault:RelationalDatabaseBlueprint' :: RelationalDatabaseBlueprint -> Maybe Bool
isEngineDefault} -> Maybe Bool
isEngineDefault) (\s :: RelationalDatabaseBlueprint
s@RelationalDatabaseBlueprint' {} Maybe Bool
a -> RelationalDatabaseBlueprint
s {$sel:isEngineDefault:RelationalDatabaseBlueprint' :: Maybe Bool
isEngineDefault = Maybe Bool
a} :: RelationalDatabaseBlueprint)

-- | The description of the database engine version for the database
-- blueprint.
relationalDatabaseBlueprint_engineVersionDescription :: Lens.Lens' RelationalDatabaseBlueprint (Prelude.Maybe Prelude.Text)
relationalDatabaseBlueprint_engineVersionDescription :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseBlueprint -> f RelationalDatabaseBlueprint
relationalDatabaseBlueprint_engineVersionDescription = (RelationalDatabaseBlueprint -> Maybe Text)
-> (RelationalDatabaseBlueprint
    -> Maybe Text -> RelationalDatabaseBlueprint)
-> Lens
     RelationalDatabaseBlueprint
     RelationalDatabaseBlueprint
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseBlueprint' {Maybe Text
engineVersionDescription :: Maybe Text
$sel:engineVersionDescription:RelationalDatabaseBlueprint' :: RelationalDatabaseBlueprint -> Maybe Text
engineVersionDescription} -> Maybe Text
engineVersionDescription) (\s :: RelationalDatabaseBlueprint
s@RelationalDatabaseBlueprint' {} Maybe Text
a -> RelationalDatabaseBlueprint
s {$sel:engineVersionDescription:RelationalDatabaseBlueprint' :: Maybe Text
engineVersionDescription = Maybe Text
a} :: RelationalDatabaseBlueprint)

-- | The database software of the database blueprint (for example, @MySQL@).
relationalDatabaseBlueprint_engine :: Lens.Lens' RelationalDatabaseBlueprint (Prelude.Maybe RelationalDatabaseEngine)
relationalDatabaseBlueprint_engine :: (Maybe RelationalDatabaseEngine
 -> f (Maybe RelationalDatabaseEngine))
-> RelationalDatabaseBlueprint -> f RelationalDatabaseBlueprint
relationalDatabaseBlueprint_engine = (RelationalDatabaseBlueprint -> Maybe RelationalDatabaseEngine)
-> (RelationalDatabaseBlueprint
    -> Maybe RelationalDatabaseEngine -> RelationalDatabaseBlueprint)
-> Lens
     RelationalDatabaseBlueprint
     RelationalDatabaseBlueprint
     (Maybe RelationalDatabaseEngine)
     (Maybe RelationalDatabaseEngine)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseBlueprint' {Maybe RelationalDatabaseEngine
engine :: Maybe RelationalDatabaseEngine
$sel:engine:RelationalDatabaseBlueprint' :: RelationalDatabaseBlueprint -> Maybe RelationalDatabaseEngine
engine} -> Maybe RelationalDatabaseEngine
engine) (\s :: RelationalDatabaseBlueprint
s@RelationalDatabaseBlueprint' {} Maybe RelationalDatabaseEngine
a -> RelationalDatabaseBlueprint
s {$sel:engine:RelationalDatabaseBlueprint' :: Maybe RelationalDatabaseEngine
engine = Maybe RelationalDatabaseEngine
a} :: RelationalDatabaseBlueprint)

-- | The ID for the database blueprint.
relationalDatabaseBlueprint_blueprintId :: Lens.Lens' RelationalDatabaseBlueprint (Prelude.Maybe Prelude.Text)
relationalDatabaseBlueprint_blueprintId :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseBlueprint -> f RelationalDatabaseBlueprint
relationalDatabaseBlueprint_blueprintId = (RelationalDatabaseBlueprint -> Maybe Text)
-> (RelationalDatabaseBlueprint
    -> Maybe Text -> RelationalDatabaseBlueprint)
-> Lens
     RelationalDatabaseBlueprint
     RelationalDatabaseBlueprint
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseBlueprint' {Maybe Text
blueprintId :: Maybe Text
$sel:blueprintId:RelationalDatabaseBlueprint' :: RelationalDatabaseBlueprint -> Maybe Text
blueprintId} -> Maybe Text
blueprintId) (\s :: RelationalDatabaseBlueprint
s@RelationalDatabaseBlueprint' {} Maybe Text
a -> RelationalDatabaseBlueprint
s {$sel:blueprintId:RelationalDatabaseBlueprint' :: Maybe Text
blueprintId = Maybe Text
a} :: RelationalDatabaseBlueprint)

-- | The description of the database engine for the database blueprint.
relationalDatabaseBlueprint_engineDescription :: Lens.Lens' RelationalDatabaseBlueprint (Prelude.Maybe Prelude.Text)
relationalDatabaseBlueprint_engineDescription :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseBlueprint -> f RelationalDatabaseBlueprint
relationalDatabaseBlueprint_engineDescription = (RelationalDatabaseBlueprint -> Maybe Text)
-> (RelationalDatabaseBlueprint
    -> Maybe Text -> RelationalDatabaseBlueprint)
-> Lens
     RelationalDatabaseBlueprint
     RelationalDatabaseBlueprint
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseBlueprint' {Maybe Text
engineDescription :: Maybe Text
$sel:engineDescription:RelationalDatabaseBlueprint' :: RelationalDatabaseBlueprint -> Maybe Text
engineDescription} -> Maybe Text
engineDescription) (\s :: RelationalDatabaseBlueprint
s@RelationalDatabaseBlueprint' {} Maybe Text
a -> RelationalDatabaseBlueprint
s {$sel:engineDescription:RelationalDatabaseBlueprint' :: Maybe Text
engineDescription = Maybe Text
a} :: RelationalDatabaseBlueprint)

instance Core.FromJSON RelationalDatabaseBlueprint where
  parseJSON :: Value -> Parser RelationalDatabaseBlueprint
parseJSON =
    String
-> (Object -> Parser RelationalDatabaseBlueprint)
-> Value
-> Parser RelationalDatabaseBlueprint
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RelationalDatabaseBlueprint"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe RelationalDatabaseEngine
-> Maybe Text
-> Maybe Text
-> RelationalDatabaseBlueprint
RelationalDatabaseBlueprint'
            (Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe RelationalDatabaseEngine
 -> Maybe Text
 -> Maybe Text
 -> RelationalDatabaseBlueprint)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe RelationalDatabaseEngine
      -> Maybe Text
      -> Maybe Text
      -> RelationalDatabaseBlueprint)
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 Bool
   -> Maybe Text
   -> Maybe RelationalDatabaseEngine
   -> Maybe Text
   -> Maybe Text
   -> RelationalDatabaseBlueprint)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe RelationalDatabaseEngine
      -> Maybe Text
      -> Maybe Text
      -> RelationalDatabaseBlueprint)
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
"isEngineDefault")
            Parser
  (Maybe Text
   -> Maybe RelationalDatabaseEngine
   -> Maybe Text
   -> Maybe Text
   -> RelationalDatabaseBlueprint)
-> Parser (Maybe Text)
-> Parser
     (Maybe RelationalDatabaseEngine
      -> Maybe Text -> Maybe Text -> RelationalDatabaseBlueprint)
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
"engineVersionDescription")
            Parser
  (Maybe RelationalDatabaseEngine
   -> Maybe Text -> Maybe Text -> RelationalDatabaseBlueprint)
-> Parser (Maybe RelationalDatabaseEngine)
-> Parser (Maybe Text -> Maybe Text -> RelationalDatabaseBlueprint)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RelationalDatabaseEngine)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"engine")
            Parser (Maybe Text -> Maybe Text -> RelationalDatabaseBlueprint)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> RelationalDatabaseBlueprint)
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
"blueprintId")
            Parser (Maybe Text -> RelationalDatabaseBlueprint)
-> Parser (Maybe Text) -> Parser RelationalDatabaseBlueprint
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
"engineDescription")
      )

instance Prelude.Hashable RelationalDatabaseBlueprint

instance Prelude.NFData RelationalDatabaseBlueprint