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

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

-- | Describes the parameters of a database.
--
-- /See:/ 'newRelationalDatabaseParameter' smart constructor.
data RelationalDatabaseParameter = RelationalDatabaseParameter'
  { -- | Specifies the engine-specific parameter type.
    RelationalDatabaseParameter -> Maybe Text
applyType :: Prelude.Maybe Prelude.Text,
    -- | Specifies the value of the parameter.
    RelationalDatabaseParameter -> Maybe Text
parameterValue :: Prelude.Maybe Prelude.Text,
    -- | Indicates when parameter updates are applied.
    --
    -- Can be @immediate@ or @pending-reboot@.
    RelationalDatabaseParameter -> Maybe Text
applyMethod :: Prelude.Maybe Prelude.Text,
    -- | Specifies the valid data type for the parameter.
    RelationalDatabaseParameter -> Maybe Text
dataType :: Prelude.Maybe Prelude.Text,
    -- | A Boolean value indicating whether the parameter can be modified.
    RelationalDatabaseParameter -> Maybe Bool
isModifiable :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the valid range of values for the parameter.
    RelationalDatabaseParameter -> Maybe Text
allowedValues :: Prelude.Maybe Prelude.Text,
    -- | Specifies the name of the parameter.
    RelationalDatabaseParameter -> Maybe Text
parameterName :: Prelude.Maybe Prelude.Text,
    -- | Provides a description of the parameter.
    RelationalDatabaseParameter -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (RelationalDatabaseParameter -> RelationalDatabaseParameter -> Bool
(RelationalDatabaseParameter
 -> RelationalDatabaseParameter -> Bool)
-> (RelationalDatabaseParameter
    -> RelationalDatabaseParameter -> Bool)
-> Eq RelationalDatabaseParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RelationalDatabaseParameter -> RelationalDatabaseParameter -> Bool
$c/= :: RelationalDatabaseParameter -> RelationalDatabaseParameter -> Bool
== :: RelationalDatabaseParameter -> RelationalDatabaseParameter -> Bool
$c== :: RelationalDatabaseParameter -> RelationalDatabaseParameter -> Bool
Prelude.Eq, ReadPrec [RelationalDatabaseParameter]
ReadPrec RelationalDatabaseParameter
Int -> ReadS RelationalDatabaseParameter
ReadS [RelationalDatabaseParameter]
(Int -> ReadS RelationalDatabaseParameter)
-> ReadS [RelationalDatabaseParameter]
-> ReadPrec RelationalDatabaseParameter
-> ReadPrec [RelationalDatabaseParameter]
-> Read RelationalDatabaseParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RelationalDatabaseParameter]
$creadListPrec :: ReadPrec [RelationalDatabaseParameter]
readPrec :: ReadPrec RelationalDatabaseParameter
$creadPrec :: ReadPrec RelationalDatabaseParameter
readList :: ReadS [RelationalDatabaseParameter]
$creadList :: ReadS [RelationalDatabaseParameter]
readsPrec :: Int -> ReadS RelationalDatabaseParameter
$creadsPrec :: Int -> ReadS RelationalDatabaseParameter
Prelude.Read, Int -> RelationalDatabaseParameter -> ShowS
[RelationalDatabaseParameter] -> ShowS
RelationalDatabaseParameter -> String
(Int -> RelationalDatabaseParameter -> ShowS)
-> (RelationalDatabaseParameter -> String)
-> ([RelationalDatabaseParameter] -> ShowS)
-> Show RelationalDatabaseParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RelationalDatabaseParameter] -> ShowS
$cshowList :: [RelationalDatabaseParameter] -> ShowS
show :: RelationalDatabaseParameter -> String
$cshow :: RelationalDatabaseParameter -> String
showsPrec :: Int -> RelationalDatabaseParameter -> ShowS
$cshowsPrec :: Int -> RelationalDatabaseParameter -> ShowS
Prelude.Show, (forall x.
 RelationalDatabaseParameter -> Rep RelationalDatabaseParameter x)
-> (forall x.
    Rep RelationalDatabaseParameter x -> RelationalDatabaseParameter)
-> Generic RelationalDatabaseParameter
forall x.
Rep RelationalDatabaseParameter x -> RelationalDatabaseParameter
forall x.
RelationalDatabaseParameter -> Rep RelationalDatabaseParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RelationalDatabaseParameter x -> RelationalDatabaseParameter
$cfrom :: forall x.
RelationalDatabaseParameter -> Rep RelationalDatabaseParameter x
Prelude.Generic)

-- |
-- Create a value of 'RelationalDatabaseParameter' 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:
--
-- 'applyType', 'relationalDatabaseParameter_applyType' - Specifies the engine-specific parameter type.
--
-- 'parameterValue', 'relationalDatabaseParameter_parameterValue' - Specifies the value of the parameter.
--
-- 'applyMethod', 'relationalDatabaseParameter_applyMethod' - Indicates when parameter updates are applied.
--
-- Can be @immediate@ or @pending-reboot@.
--
-- 'dataType', 'relationalDatabaseParameter_dataType' - Specifies the valid data type for the parameter.
--
-- 'isModifiable', 'relationalDatabaseParameter_isModifiable' - A Boolean value indicating whether the parameter can be modified.
--
-- 'allowedValues', 'relationalDatabaseParameter_allowedValues' - Specifies the valid range of values for the parameter.
--
-- 'parameterName', 'relationalDatabaseParameter_parameterName' - Specifies the name of the parameter.
--
-- 'description', 'relationalDatabaseParameter_description' - Provides a description of the parameter.
newRelationalDatabaseParameter ::
  RelationalDatabaseParameter
newRelationalDatabaseParameter :: RelationalDatabaseParameter
newRelationalDatabaseParameter =
  RelationalDatabaseParameter' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RelationalDatabaseParameter
RelationalDatabaseParameter'
    { $sel:applyType:RelationalDatabaseParameter' :: Maybe Text
applyType =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterValue:RelationalDatabaseParameter' :: Maybe Text
parameterValue = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:applyMethod:RelationalDatabaseParameter' :: Maybe Text
applyMethod = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dataType:RelationalDatabaseParameter' :: Maybe Text
dataType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:isModifiable:RelationalDatabaseParameter' :: Maybe Bool
isModifiable = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:allowedValues:RelationalDatabaseParameter' :: Maybe Text
allowedValues = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameterName:RelationalDatabaseParameter' :: Maybe Text
parameterName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:RelationalDatabaseParameter' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies the engine-specific parameter type.
relationalDatabaseParameter_applyType :: Lens.Lens' RelationalDatabaseParameter (Prelude.Maybe Prelude.Text)
relationalDatabaseParameter_applyType :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseParameter -> f RelationalDatabaseParameter
relationalDatabaseParameter_applyType = (RelationalDatabaseParameter -> Maybe Text)
-> (RelationalDatabaseParameter
    -> Maybe Text -> RelationalDatabaseParameter)
-> Lens
     RelationalDatabaseParameter
     RelationalDatabaseParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseParameter' {Maybe Text
applyType :: Maybe Text
$sel:applyType:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
applyType} -> Maybe Text
applyType) (\s :: RelationalDatabaseParameter
s@RelationalDatabaseParameter' {} Maybe Text
a -> RelationalDatabaseParameter
s {$sel:applyType:RelationalDatabaseParameter' :: Maybe Text
applyType = Maybe Text
a} :: RelationalDatabaseParameter)

-- | Specifies the value of the parameter.
relationalDatabaseParameter_parameterValue :: Lens.Lens' RelationalDatabaseParameter (Prelude.Maybe Prelude.Text)
relationalDatabaseParameter_parameterValue :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseParameter -> f RelationalDatabaseParameter
relationalDatabaseParameter_parameterValue = (RelationalDatabaseParameter -> Maybe Text)
-> (RelationalDatabaseParameter
    -> Maybe Text -> RelationalDatabaseParameter)
-> Lens
     RelationalDatabaseParameter
     RelationalDatabaseParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseParameter' {Maybe Text
parameterValue :: Maybe Text
$sel:parameterValue:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
parameterValue} -> Maybe Text
parameterValue) (\s :: RelationalDatabaseParameter
s@RelationalDatabaseParameter' {} Maybe Text
a -> RelationalDatabaseParameter
s {$sel:parameterValue:RelationalDatabaseParameter' :: Maybe Text
parameterValue = Maybe Text
a} :: RelationalDatabaseParameter)

-- | Indicates when parameter updates are applied.
--
-- Can be @immediate@ or @pending-reboot@.
relationalDatabaseParameter_applyMethod :: Lens.Lens' RelationalDatabaseParameter (Prelude.Maybe Prelude.Text)
relationalDatabaseParameter_applyMethod :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseParameter -> f RelationalDatabaseParameter
relationalDatabaseParameter_applyMethod = (RelationalDatabaseParameter -> Maybe Text)
-> (RelationalDatabaseParameter
    -> Maybe Text -> RelationalDatabaseParameter)
-> Lens
     RelationalDatabaseParameter
     RelationalDatabaseParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseParameter' {Maybe Text
applyMethod :: Maybe Text
$sel:applyMethod:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
applyMethod} -> Maybe Text
applyMethod) (\s :: RelationalDatabaseParameter
s@RelationalDatabaseParameter' {} Maybe Text
a -> RelationalDatabaseParameter
s {$sel:applyMethod:RelationalDatabaseParameter' :: Maybe Text
applyMethod = Maybe Text
a} :: RelationalDatabaseParameter)

-- | Specifies the valid data type for the parameter.
relationalDatabaseParameter_dataType :: Lens.Lens' RelationalDatabaseParameter (Prelude.Maybe Prelude.Text)
relationalDatabaseParameter_dataType :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseParameter -> f RelationalDatabaseParameter
relationalDatabaseParameter_dataType = (RelationalDatabaseParameter -> Maybe Text)
-> (RelationalDatabaseParameter
    -> Maybe Text -> RelationalDatabaseParameter)
-> Lens
     RelationalDatabaseParameter
     RelationalDatabaseParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseParameter' {Maybe Text
dataType :: Maybe Text
$sel:dataType:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
dataType} -> Maybe Text
dataType) (\s :: RelationalDatabaseParameter
s@RelationalDatabaseParameter' {} Maybe Text
a -> RelationalDatabaseParameter
s {$sel:dataType:RelationalDatabaseParameter' :: Maybe Text
dataType = Maybe Text
a} :: RelationalDatabaseParameter)

-- | A Boolean value indicating whether the parameter can be modified.
relationalDatabaseParameter_isModifiable :: Lens.Lens' RelationalDatabaseParameter (Prelude.Maybe Prelude.Bool)
relationalDatabaseParameter_isModifiable :: (Maybe Bool -> f (Maybe Bool))
-> RelationalDatabaseParameter -> f RelationalDatabaseParameter
relationalDatabaseParameter_isModifiable = (RelationalDatabaseParameter -> Maybe Bool)
-> (RelationalDatabaseParameter
    -> Maybe Bool -> RelationalDatabaseParameter)
-> Lens
     RelationalDatabaseParameter
     RelationalDatabaseParameter
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseParameter' {Maybe Bool
isModifiable :: Maybe Bool
$sel:isModifiable:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Bool
isModifiable} -> Maybe Bool
isModifiable) (\s :: RelationalDatabaseParameter
s@RelationalDatabaseParameter' {} Maybe Bool
a -> RelationalDatabaseParameter
s {$sel:isModifiable:RelationalDatabaseParameter' :: Maybe Bool
isModifiable = Maybe Bool
a} :: RelationalDatabaseParameter)

-- | Specifies the valid range of values for the parameter.
relationalDatabaseParameter_allowedValues :: Lens.Lens' RelationalDatabaseParameter (Prelude.Maybe Prelude.Text)
relationalDatabaseParameter_allowedValues :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseParameter -> f RelationalDatabaseParameter
relationalDatabaseParameter_allowedValues = (RelationalDatabaseParameter -> Maybe Text)
-> (RelationalDatabaseParameter
    -> Maybe Text -> RelationalDatabaseParameter)
-> Lens
     RelationalDatabaseParameter
     RelationalDatabaseParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseParameter' {Maybe Text
allowedValues :: Maybe Text
$sel:allowedValues:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
allowedValues} -> Maybe Text
allowedValues) (\s :: RelationalDatabaseParameter
s@RelationalDatabaseParameter' {} Maybe Text
a -> RelationalDatabaseParameter
s {$sel:allowedValues:RelationalDatabaseParameter' :: Maybe Text
allowedValues = Maybe Text
a} :: RelationalDatabaseParameter)

-- | Specifies the name of the parameter.
relationalDatabaseParameter_parameterName :: Lens.Lens' RelationalDatabaseParameter (Prelude.Maybe Prelude.Text)
relationalDatabaseParameter_parameterName :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseParameter -> f RelationalDatabaseParameter
relationalDatabaseParameter_parameterName = (RelationalDatabaseParameter -> Maybe Text)
-> (RelationalDatabaseParameter
    -> Maybe Text -> RelationalDatabaseParameter)
-> Lens
     RelationalDatabaseParameter
     RelationalDatabaseParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseParameter' {Maybe Text
parameterName :: Maybe Text
$sel:parameterName:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
parameterName} -> Maybe Text
parameterName) (\s :: RelationalDatabaseParameter
s@RelationalDatabaseParameter' {} Maybe Text
a -> RelationalDatabaseParameter
s {$sel:parameterName:RelationalDatabaseParameter' :: Maybe Text
parameterName = Maybe Text
a} :: RelationalDatabaseParameter)

-- | Provides a description of the parameter.
relationalDatabaseParameter_description :: Lens.Lens' RelationalDatabaseParameter (Prelude.Maybe Prelude.Text)
relationalDatabaseParameter_description :: (Maybe Text -> f (Maybe Text))
-> RelationalDatabaseParameter -> f RelationalDatabaseParameter
relationalDatabaseParameter_description = (RelationalDatabaseParameter -> Maybe Text)
-> (RelationalDatabaseParameter
    -> Maybe Text -> RelationalDatabaseParameter)
-> Lens
     RelationalDatabaseParameter
     RelationalDatabaseParameter
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RelationalDatabaseParameter' {Maybe Text
description :: Maybe Text
$sel:description:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
description} -> Maybe Text
description) (\s :: RelationalDatabaseParameter
s@RelationalDatabaseParameter' {} Maybe Text
a -> RelationalDatabaseParameter
s {$sel:description:RelationalDatabaseParameter' :: Maybe Text
description = Maybe Text
a} :: RelationalDatabaseParameter)

instance Core.FromJSON RelationalDatabaseParameter where
  parseJSON :: Value -> Parser RelationalDatabaseParameter
parseJSON =
    String
-> (Object -> Parser RelationalDatabaseParameter)
-> Value
-> Parser RelationalDatabaseParameter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RelationalDatabaseParameter"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> RelationalDatabaseParameter
RelationalDatabaseParameter'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> RelationalDatabaseParameter)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> RelationalDatabaseParameter)
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
"applyType")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> RelationalDatabaseParameter)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> RelationalDatabaseParameter)
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
"parameterValue")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> RelationalDatabaseParameter)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> RelationalDatabaseParameter)
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
"applyMethod")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> RelationalDatabaseParameter)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> RelationalDatabaseParameter)
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
"dataType")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> RelationalDatabaseParameter)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> RelationalDatabaseParameter)
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
"isModifiable")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> RelationalDatabaseParameter)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> RelationalDatabaseParameter)
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
"allowedValues")
            Parser (Maybe Text -> Maybe Text -> RelationalDatabaseParameter)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> RelationalDatabaseParameter)
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
"parameterName")
            Parser (Maybe Text -> RelationalDatabaseParameter)
-> Parser (Maybe Text) -> Parser RelationalDatabaseParameter
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
"description")
      )

instance Prelude.Hashable RelationalDatabaseParameter

instance Prelude.NFData RelationalDatabaseParameter

instance Core.ToJSON RelationalDatabaseParameter where
  toJSON :: RelationalDatabaseParameter -> Value
toJSON RelationalDatabaseParameter' {Maybe Bool
Maybe Text
description :: Maybe Text
parameterName :: Maybe Text
allowedValues :: Maybe Text
isModifiable :: Maybe Bool
dataType :: Maybe Text
applyMethod :: Maybe Text
parameterValue :: Maybe Text
applyType :: Maybe Text
$sel:description:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
$sel:parameterName:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
$sel:allowedValues:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
$sel:isModifiable:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Bool
$sel:dataType:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
$sel:applyMethod:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
$sel:parameterValue:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
$sel:applyType:RelationalDatabaseParameter' :: RelationalDatabaseParameter -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"applyType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
applyType,
            (Text
"parameterValue" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterValue,
            (Text
"applyMethod" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
applyMethod,
            (Text
"dataType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
dataType,
            (Text
"isModifiable" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
isModifiable,
            (Text
"allowedValues" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
allowedValues,
            (Text
"parameterName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
parameterName,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description
          ]
      )