{-# 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.DMS.Types.PostgreSQLSettings
-- 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.DMS.Types.PostgreSQLSettings where

import qualified Amazonka.Core as Core
import Amazonka.DMS.Types.PluginNameValue
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Provides information that defines a PostgreSQL endpoint.
--
-- /See:/ 'newPostgreSQLSettings' smart constructor.
data PostgreSQLSettings = PostgreSQLSettings'
  { -- | Sets the client statement timeout for the PostgreSQL instance, in
    -- seconds. The default value is 60 seconds.
    --
    -- Example: @executeTimeout=100;@
    PostgreSQLSettings -> Maybe Int
executeTimeout :: Prelude.Maybe Prelude.Int,
    -- | Specifies the maximum size (in KB) of any .csv file used to transfer
    -- data to PostgreSQL.
    --
    -- Example: @maxFileSize=512@
    PostgreSQLSettings -> Maybe Int
maxFileSize :: Prelude.Maybe Prelude.Int,
    -- | When set to @true@, this value causes a task to fail if the actual size
    -- of a LOB column is greater than the specified @LobMaxSize@.
    --
    -- If task is set to Limited LOB mode and this option is set to true, the
    -- task fails instead of truncating the LOB data.
    PostgreSQLSettings -> Maybe Bool
failTasksOnLobTruncation :: Prelude.Maybe Prelude.Bool,
    -- | Fully qualified domain name of the endpoint.
    PostgreSQLSettings -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text,
    -- | The schema in which the operational DDL database artifacts are created.
    --
    -- Example: @ddlArtifactsSchema=xyzddlschema;@
    PostgreSQLSettings -> Maybe Text
ddlArtifactsSchema :: Prelude.Maybe Prelude.Text,
    -- | Sets the name of a previously created logical replication slot for a
    -- change data capture (CDC) load of the PostgreSQL source instance.
    --
    -- When used with the @CdcStartPosition@ request parameter for the DMS API
    -- , this attribute also makes it possible to use native CDC start points.
    -- DMS verifies that the specified logical replication slot exists before
    -- starting the CDC load task. It also verifies that the task was created
    -- with a valid setting of @CdcStartPosition@. If the specified slot
    -- doesn\'t exist or the task doesn\'t have a valid @CdcStartPosition@
    -- setting, DMS raises an error.
    --
    -- For more information about setting the @CdcStartPosition@ request
    -- parameter, see
    -- <dms/latest/userguide/CHAP_Task.CDC.html#CHAP_Task.CDC.StartPoint.Native Determining a CDC native start point>
    -- in the /Database Migration Service User Guide/. For more information
    -- about using @CdcStartPosition@, see
    -- <https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateReplicationTask.html CreateReplicationTask>,
    -- <https://docs.aws.amazon.com/dms/latest/APIReference/API_StartReplicationTask.html StartReplicationTask>,
    -- and
    -- <https://docs.aws.amazon.com/dms/latest/APIReference/API_ModifyReplicationTask.html ModifyReplicationTask>.
    PostgreSQLSettings -> Maybe Text
slotName :: Prelude.Maybe Prelude.Text,
    -- | The full Amazon Resource Name (ARN) of the IAM role that specifies DMS
    -- as the trusted entity and grants the required permissions to access the
    -- value in @SecretsManagerSecret@. The role must allow the @iam:PassRole@
    -- action. @SecretsManagerSecret@ has the value of the Amazon Web Services
    -- Secrets Manager secret that allows access to the PostgreSQL endpoint.
    --
    -- You can specify one of two sets of values for these permissions. You can
    -- specify the values for this setting and @SecretsManagerSecretId@. Or you
    -- can specify clear-text values for @UserName@, @Password@, @ServerName@,
    -- and @Port@. You can\'t specify both. For more information on creating
    -- this @SecretsManagerSecret@ and the @SecretsManagerAccessRoleArn@ and
    -- @SecretsManagerSecretId@ required to access it, see
    -- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager Using secrets to access Database Migration Service resources>
    -- in the /Database Migration Service User Guide/.
    PostgreSQLSettings -> Maybe Text
secretsManagerAccessRoleArn :: Prelude.Maybe Prelude.Text,
    -- | Endpoint connection user name.
    PostgreSQLSettings -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
    -- | Sets the WAL heartbeat frequency (in minutes).
    PostgreSQLSettings -> Maybe Int
heartbeatFrequency :: Prelude.Maybe Prelude.Int,
    -- | Endpoint connection password.
    PostgreSQLSettings -> Maybe (Sensitive Text)
password :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Database name for the endpoint.
    PostgreSQLSettings -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
    -- | For use with change data capture (CDC) only, this attribute has DMS
    -- bypass foreign keys and user triggers to reduce the time it takes to
    -- bulk load data.
    --
    -- Example: @afterConnectScript=SET session_replication_role=\'replica\'@
    PostgreSQLSettings -> Maybe Text
afterConnectScript :: Prelude.Maybe Prelude.Text,
    -- | The full ARN, partial ARN, or friendly name of the
    -- @SecretsManagerSecret@ that contains the PostgreSQL endpoint connection
    -- details.
    PostgreSQLSettings -> Maybe Text
secretsManagerSecretId :: Prelude.Maybe Prelude.Text,
    -- | To capture DDL events, DMS creates various artifacts in the PostgreSQL
    -- database when the task starts. You can later remove these artifacts.
    --
    -- If this value is set to @N@, you don\'t have to create tables or
    -- triggers on the source database.
    PostgreSQLSettings -> Maybe Bool
captureDdls :: Prelude.Maybe Prelude.Bool,
    -- | Specifies the plugin to use to create a replication slot.
    PostgreSQLSettings -> Maybe PluginNameValue
pluginName :: Prelude.Maybe PluginNameValue,
    -- | Endpoint TCP port.
    PostgreSQLSettings -> Maybe Int
port :: Prelude.Maybe Prelude.Int,
    -- | Sets the schema in which the heartbeat artifacts are created.
    PostgreSQLSettings -> Maybe Text
heartbeatSchema :: Prelude.Maybe Prelude.Text,
    -- | The write-ahead log (WAL) heartbeat feature mimics a dummy transaction.
    -- By doing this, it prevents idle logical replication slots from holding
    -- onto old WAL logs, which can result in storage full situations on the
    -- source. This heartbeat keeps @restart_lsn@ moving and prevents storage
    -- full scenarios.
    PostgreSQLSettings -> Maybe Bool
heartbeatEnable :: Prelude.Maybe Prelude.Bool
  }
  deriving (PostgreSQLSettings -> PostgreSQLSettings -> Bool
(PostgreSQLSettings -> PostgreSQLSettings -> Bool)
-> (PostgreSQLSettings -> PostgreSQLSettings -> Bool)
-> Eq PostgreSQLSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PostgreSQLSettings -> PostgreSQLSettings -> Bool
$c/= :: PostgreSQLSettings -> PostgreSQLSettings -> Bool
== :: PostgreSQLSettings -> PostgreSQLSettings -> Bool
$c== :: PostgreSQLSettings -> PostgreSQLSettings -> Bool
Prelude.Eq, Int -> PostgreSQLSettings -> ShowS
[PostgreSQLSettings] -> ShowS
PostgreSQLSettings -> String
(Int -> PostgreSQLSettings -> ShowS)
-> (PostgreSQLSettings -> String)
-> ([PostgreSQLSettings] -> ShowS)
-> Show PostgreSQLSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PostgreSQLSettings] -> ShowS
$cshowList :: [PostgreSQLSettings] -> ShowS
show :: PostgreSQLSettings -> String
$cshow :: PostgreSQLSettings -> String
showsPrec :: Int -> PostgreSQLSettings -> ShowS
$cshowsPrec :: Int -> PostgreSQLSettings -> ShowS
Prelude.Show, (forall x. PostgreSQLSettings -> Rep PostgreSQLSettings x)
-> (forall x. Rep PostgreSQLSettings x -> PostgreSQLSettings)
-> Generic PostgreSQLSettings
forall x. Rep PostgreSQLSettings x -> PostgreSQLSettings
forall x. PostgreSQLSettings -> Rep PostgreSQLSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PostgreSQLSettings x -> PostgreSQLSettings
$cfrom :: forall x. PostgreSQLSettings -> Rep PostgreSQLSettings x
Prelude.Generic)

-- |
-- Create a value of 'PostgreSQLSettings' 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:
--
-- 'executeTimeout', 'postgreSQLSettings_executeTimeout' - Sets the client statement timeout for the PostgreSQL instance, in
-- seconds. The default value is 60 seconds.
--
-- Example: @executeTimeout=100;@
--
-- 'maxFileSize', 'postgreSQLSettings_maxFileSize' - Specifies the maximum size (in KB) of any .csv file used to transfer
-- data to PostgreSQL.
--
-- Example: @maxFileSize=512@
--
-- 'failTasksOnLobTruncation', 'postgreSQLSettings_failTasksOnLobTruncation' - When set to @true@, this value causes a task to fail if the actual size
-- of a LOB column is greater than the specified @LobMaxSize@.
--
-- If task is set to Limited LOB mode and this option is set to true, the
-- task fails instead of truncating the LOB data.
--
-- 'serverName', 'postgreSQLSettings_serverName' - Fully qualified domain name of the endpoint.
--
-- 'ddlArtifactsSchema', 'postgreSQLSettings_ddlArtifactsSchema' - The schema in which the operational DDL database artifacts are created.
--
-- Example: @ddlArtifactsSchema=xyzddlschema;@
--
-- 'slotName', 'postgreSQLSettings_slotName' - Sets the name of a previously created logical replication slot for a
-- change data capture (CDC) load of the PostgreSQL source instance.
--
-- When used with the @CdcStartPosition@ request parameter for the DMS API
-- , this attribute also makes it possible to use native CDC start points.
-- DMS verifies that the specified logical replication slot exists before
-- starting the CDC load task. It also verifies that the task was created
-- with a valid setting of @CdcStartPosition@. If the specified slot
-- doesn\'t exist or the task doesn\'t have a valid @CdcStartPosition@
-- setting, DMS raises an error.
--
-- For more information about setting the @CdcStartPosition@ request
-- parameter, see
-- <dms/latest/userguide/CHAP_Task.CDC.html#CHAP_Task.CDC.StartPoint.Native Determining a CDC native start point>
-- in the /Database Migration Service User Guide/. For more information
-- about using @CdcStartPosition@, see
-- <https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateReplicationTask.html CreateReplicationTask>,
-- <https://docs.aws.amazon.com/dms/latest/APIReference/API_StartReplicationTask.html StartReplicationTask>,
-- and
-- <https://docs.aws.amazon.com/dms/latest/APIReference/API_ModifyReplicationTask.html ModifyReplicationTask>.
--
-- 'secretsManagerAccessRoleArn', 'postgreSQLSettings_secretsManagerAccessRoleArn' - The full Amazon Resource Name (ARN) of the IAM role that specifies DMS
-- as the trusted entity and grants the required permissions to access the
-- value in @SecretsManagerSecret@. The role must allow the @iam:PassRole@
-- action. @SecretsManagerSecret@ has the value of the Amazon Web Services
-- Secrets Manager secret that allows access to the PostgreSQL endpoint.
--
-- You can specify one of two sets of values for these permissions. You can
-- specify the values for this setting and @SecretsManagerSecretId@. Or you
-- can specify clear-text values for @UserName@, @Password@, @ServerName@,
-- and @Port@. You can\'t specify both. For more information on creating
-- this @SecretsManagerSecret@ and the @SecretsManagerAccessRoleArn@ and
-- @SecretsManagerSecretId@ required to access it, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager Using secrets to access Database Migration Service resources>
-- in the /Database Migration Service User Guide/.
--
-- 'username', 'postgreSQLSettings_username' - Endpoint connection user name.
--
-- 'heartbeatFrequency', 'postgreSQLSettings_heartbeatFrequency' - Sets the WAL heartbeat frequency (in minutes).
--
-- 'password', 'postgreSQLSettings_password' - Endpoint connection password.
--
-- 'databaseName', 'postgreSQLSettings_databaseName' - Database name for the endpoint.
--
-- 'afterConnectScript', 'postgreSQLSettings_afterConnectScript' - For use with change data capture (CDC) only, this attribute has DMS
-- bypass foreign keys and user triggers to reduce the time it takes to
-- bulk load data.
--
-- Example: @afterConnectScript=SET session_replication_role=\'replica\'@
--
-- 'secretsManagerSecretId', 'postgreSQLSettings_secretsManagerSecretId' - The full ARN, partial ARN, or friendly name of the
-- @SecretsManagerSecret@ that contains the PostgreSQL endpoint connection
-- details.
--
-- 'captureDdls', 'postgreSQLSettings_captureDdls' - To capture DDL events, DMS creates various artifacts in the PostgreSQL
-- database when the task starts. You can later remove these artifacts.
--
-- If this value is set to @N@, you don\'t have to create tables or
-- triggers on the source database.
--
-- 'pluginName', 'postgreSQLSettings_pluginName' - Specifies the plugin to use to create a replication slot.
--
-- 'port', 'postgreSQLSettings_port' - Endpoint TCP port.
--
-- 'heartbeatSchema', 'postgreSQLSettings_heartbeatSchema' - Sets the schema in which the heartbeat artifacts are created.
--
-- 'heartbeatEnable', 'postgreSQLSettings_heartbeatEnable' - The write-ahead log (WAL) heartbeat feature mimics a dummy transaction.
-- By doing this, it prevents idle logical replication slots from holding
-- onto old WAL logs, which can result in storage full situations on the
-- source. This heartbeat keeps @restart_lsn@ moving and prevents storage
-- full scenarios.
newPostgreSQLSettings ::
  PostgreSQLSettings
newPostgreSQLSettings :: PostgreSQLSettings
newPostgreSQLSettings =
  PostgreSQLSettings' :: Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe PluginNameValue
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> PostgreSQLSettings
PostgreSQLSettings'
    { $sel:executeTimeout:PostgreSQLSettings' :: Maybe Int
executeTimeout =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:maxFileSize:PostgreSQLSettings' :: Maybe Int
maxFileSize = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:failTasksOnLobTruncation:PostgreSQLSettings' :: Maybe Bool
failTasksOnLobTruncation = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:serverName:PostgreSQLSettings' :: Maybe Text
serverName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:ddlArtifactsSchema:PostgreSQLSettings' :: Maybe Text
ddlArtifactsSchema = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:slotName:PostgreSQLSettings' :: Maybe Text
slotName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerAccessRoleArn:PostgreSQLSettings' :: Maybe Text
secretsManagerAccessRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:username:PostgreSQLSettings' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:heartbeatFrequency:PostgreSQLSettings' :: Maybe Int
heartbeatFrequency = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:password:PostgreSQLSettings' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:PostgreSQLSettings' :: Maybe Text
databaseName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:afterConnectScript:PostgreSQLSettings' :: Maybe Text
afterConnectScript = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerSecretId:PostgreSQLSettings' :: Maybe Text
secretsManagerSecretId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:captureDdls:PostgreSQLSettings' :: Maybe Bool
captureDdls = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:pluginName:PostgreSQLSettings' :: Maybe PluginNameValue
pluginName = Maybe PluginNameValue
forall a. Maybe a
Prelude.Nothing,
      $sel:port:PostgreSQLSettings' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:heartbeatSchema:PostgreSQLSettings' :: Maybe Text
heartbeatSchema = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:heartbeatEnable:PostgreSQLSettings' :: Maybe Bool
heartbeatEnable = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Sets the client statement timeout for the PostgreSQL instance, in
-- seconds. The default value is 60 seconds.
--
-- Example: @executeTimeout=100;@
postgreSQLSettings_executeTimeout :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Int)
postgreSQLSettings_executeTimeout :: (Maybe Int -> f (Maybe Int))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_executeTimeout = (PostgreSQLSettings -> Maybe Int)
-> (PostgreSQLSettings -> Maybe Int -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Int
executeTimeout :: Maybe Int
$sel:executeTimeout:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Int
executeTimeout} -> Maybe Int
executeTimeout) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Int
a -> PostgreSQLSettings
s {$sel:executeTimeout:PostgreSQLSettings' :: Maybe Int
executeTimeout = Maybe Int
a} :: PostgreSQLSettings)

-- | Specifies the maximum size (in KB) of any .csv file used to transfer
-- data to PostgreSQL.
--
-- Example: @maxFileSize=512@
postgreSQLSettings_maxFileSize :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Int)
postgreSQLSettings_maxFileSize :: (Maybe Int -> f (Maybe Int))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_maxFileSize = (PostgreSQLSettings -> Maybe Int)
-> (PostgreSQLSettings -> Maybe Int -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Int
maxFileSize :: Maybe Int
$sel:maxFileSize:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Int
maxFileSize} -> Maybe Int
maxFileSize) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Int
a -> PostgreSQLSettings
s {$sel:maxFileSize:PostgreSQLSettings' :: Maybe Int
maxFileSize = Maybe Int
a} :: PostgreSQLSettings)

-- | When set to @true@, this value causes a task to fail if the actual size
-- of a LOB column is greater than the specified @LobMaxSize@.
--
-- If task is set to Limited LOB mode and this option is set to true, the
-- task fails instead of truncating the LOB data.
postgreSQLSettings_failTasksOnLobTruncation :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Bool)
postgreSQLSettings_failTasksOnLobTruncation :: (Maybe Bool -> f (Maybe Bool))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_failTasksOnLobTruncation = (PostgreSQLSettings -> Maybe Bool)
-> (PostgreSQLSettings -> Maybe Bool -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Bool
failTasksOnLobTruncation :: Maybe Bool
$sel:failTasksOnLobTruncation:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Bool
failTasksOnLobTruncation} -> Maybe Bool
failTasksOnLobTruncation) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Bool
a -> PostgreSQLSettings
s {$sel:failTasksOnLobTruncation:PostgreSQLSettings' :: Maybe Bool
failTasksOnLobTruncation = Maybe Bool
a} :: PostgreSQLSettings)

-- | Fully qualified domain name of the endpoint.
postgreSQLSettings_serverName :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_serverName :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_serverName = (PostgreSQLSettings -> Maybe Text)
-> (PostgreSQLSettings -> Maybe Text -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Text
serverName :: Maybe Text
$sel:serverName:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
serverName} -> Maybe Text
serverName) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Text
a -> PostgreSQLSettings
s {$sel:serverName:PostgreSQLSettings' :: Maybe Text
serverName = Maybe Text
a} :: PostgreSQLSettings)

-- | The schema in which the operational DDL database artifacts are created.
--
-- Example: @ddlArtifactsSchema=xyzddlschema;@
postgreSQLSettings_ddlArtifactsSchema :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_ddlArtifactsSchema :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_ddlArtifactsSchema = (PostgreSQLSettings -> Maybe Text)
-> (PostgreSQLSettings -> Maybe Text -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Text
ddlArtifactsSchema :: Maybe Text
$sel:ddlArtifactsSchema:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
ddlArtifactsSchema} -> Maybe Text
ddlArtifactsSchema) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Text
a -> PostgreSQLSettings
s {$sel:ddlArtifactsSchema:PostgreSQLSettings' :: Maybe Text
ddlArtifactsSchema = Maybe Text
a} :: PostgreSQLSettings)

-- | Sets the name of a previously created logical replication slot for a
-- change data capture (CDC) load of the PostgreSQL source instance.
--
-- When used with the @CdcStartPosition@ request parameter for the DMS API
-- , this attribute also makes it possible to use native CDC start points.
-- DMS verifies that the specified logical replication slot exists before
-- starting the CDC load task. It also verifies that the task was created
-- with a valid setting of @CdcStartPosition@. If the specified slot
-- doesn\'t exist or the task doesn\'t have a valid @CdcStartPosition@
-- setting, DMS raises an error.
--
-- For more information about setting the @CdcStartPosition@ request
-- parameter, see
-- <dms/latest/userguide/CHAP_Task.CDC.html#CHAP_Task.CDC.StartPoint.Native Determining a CDC native start point>
-- in the /Database Migration Service User Guide/. For more information
-- about using @CdcStartPosition@, see
-- <https://docs.aws.amazon.com/dms/latest/APIReference/API_CreateReplicationTask.html CreateReplicationTask>,
-- <https://docs.aws.amazon.com/dms/latest/APIReference/API_StartReplicationTask.html StartReplicationTask>,
-- and
-- <https://docs.aws.amazon.com/dms/latest/APIReference/API_ModifyReplicationTask.html ModifyReplicationTask>.
postgreSQLSettings_slotName :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_slotName :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_slotName = (PostgreSQLSettings -> Maybe Text)
-> (PostgreSQLSettings -> Maybe Text -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Text
slotName :: Maybe Text
$sel:slotName:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
slotName} -> Maybe Text
slotName) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Text
a -> PostgreSQLSettings
s {$sel:slotName:PostgreSQLSettings' :: Maybe Text
slotName = Maybe Text
a} :: PostgreSQLSettings)

-- | The full Amazon Resource Name (ARN) of the IAM role that specifies DMS
-- as the trusted entity and grants the required permissions to access the
-- value in @SecretsManagerSecret@. The role must allow the @iam:PassRole@
-- action. @SecretsManagerSecret@ has the value of the Amazon Web Services
-- Secrets Manager secret that allows access to the PostgreSQL endpoint.
--
-- You can specify one of two sets of values for these permissions. You can
-- specify the values for this setting and @SecretsManagerSecretId@. Or you
-- can specify clear-text values for @UserName@, @Password@, @ServerName@,
-- and @Port@. You can\'t specify both. For more information on creating
-- this @SecretsManagerSecret@ and the @SecretsManagerAccessRoleArn@ and
-- @SecretsManagerSecretId@ required to access it, see
-- <https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager Using secrets to access Database Migration Service resources>
-- in the /Database Migration Service User Guide/.
postgreSQLSettings_secretsManagerAccessRoleArn :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_secretsManagerAccessRoleArn :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_secretsManagerAccessRoleArn = (PostgreSQLSettings -> Maybe Text)
-> (PostgreSQLSettings -> Maybe Text -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
$sel:secretsManagerAccessRoleArn:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
secretsManagerAccessRoleArn} -> Maybe Text
secretsManagerAccessRoleArn) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Text
a -> PostgreSQLSettings
s {$sel:secretsManagerAccessRoleArn:PostgreSQLSettings' :: Maybe Text
secretsManagerAccessRoleArn = Maybe Text
a} :: PostgreSQLSettings)

-- | Endpoint connection user name.
postgreSQLSettings_username :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_username :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_username = (PostgreSQLSettings -> Maybe Text)
-> (PostgreSQLSettings -> Maybe Text -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Text
username :: Maybe Text
$sel:username:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
username} -> Maybe Text
username) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Text
a -> PostgreSQLSettings
s {$sel:username:PostgreSQLSettings' :: Maybe Text
username = Maybe Text
a} :: PostgreSQLSettings)

-- | Sets the WAL heartbeat frequency (in minutes).
postgreSQLSettings_heartbeatFrequency :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Int)
postgreSQLSettings_heartbeatFrequency :: (Maybe Int -> f (Maybe Int))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_heartbeatFrequency = (PostgreSQLSettings -> Maybe Int)
-> (PostgreSQLSettings -> Maybe Int -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Int
heartbeatFrequency :: Maybe Int
$sel:heartbeatFrequency:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Int
heartbeatFrequency} -> Maybe Int
heartbeatFrequency) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Int
a -> PostgreSQLSettings
s {$sel:heartbeatFrequency:PostgreSQLSettings' :: Maybe Int
heartbeatFrequency = Maybe Int
a} :: PostgreSQLSettings)

-- | Endpoint connection password.
postgreSQLSettings_password :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_password :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_password = (PostgreSQLSettings -> Maybe (Sensitive Text))
-> (PostgreSQLSettings
    -> Maybe (Sensitive Text) -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings
     PostgreSQLSettings
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe (Sensitive Text)
password :: Maybe (Sensitive Text)
$sel:password:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe (Sensitive Text)
password} -> Maybe (Sensitive Text)
password) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe (Sensitive Text)
a -> PostgreSQLSettings
s {$sel:password:PostgreSQLSettings' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
a} :: PostgreSQLSettings) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> PostgreSQLSettings -> f PostgreSQLSettings)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings
-> f PostgreSQLSettings
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
     (Maybe Text)
     (Maybe Text)
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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | Database name for the endpoint.
postgreSQLSettings_databaseName :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_databaseName :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_databaseName = (PostgreSQLSettings -> Maybe Text)
-> (PostgreSQLSettings -> Maybe Text -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Text
a -> PostgreSQLSettings
s {$sel:databaseName:PostgreSQLSettings' :: Maybe Text
databaseName = Maybe Text
a} :: PostgreSQLSettings)

-- | For use with change data capture (CDC) only, this attribute has DMS
-- bypass foreign keys and user triggers to reduce the time it takes to
-- bulk load data.
--
-- Example: @afterConnectScript=SET session_replication_role=\'replica\'@
postgreSQLSettings_afterConnectScript :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_afterConnectScript :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_afterConnectScript = (PostgreSQLSettings -> Maybe Text)
-> (PostgreSQLSettings -> Maybe Text -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Text
afterConnectScript :: Maybe Text
$sel:afterConnectScript:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
afterConnectScript} -> Maybe Text
afterConnectScript) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Text
a -> PostgreSQLSettings
s {$sel:afterConnectScript:PostgreSQLSettings' :: Maybe Text
afterConnectScript = Maybe Text
a} :: PostgreSQLSettings)

-- | The full ARN, partial ARN, or friendly name of the
-- @SecretsManagerSecret@ that contains the PostgreSQL endpoint connection
-- details.
postgreSQLSettings_secretsManagerSecretId :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_secretsManagerSecretId :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_secretsManagerSecretId = (PostgreSQLSettings -> Maybe Text)
-> (PostgreSQLSettings -> Maybe Text -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Text
secretsManagerSecretId :: Maybe Text
$sel:secretsManagerSecretId:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
secretsManagerSecretId} -> Maybe Text
secretsManagerSecretId) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Text
a -> PostgreSQLSettings
s {$sel:secretsManagerSecretId:PostgreSQLSettings' :: Maybe Text
secretsManagerSecretId = Maybe Text
a} :: PostgreSQLSettings)

-- | To capture DDL events, DMS creates various artifacts in the PostgreSQL
-- database when the task starts. You can later remove these artifacts.
--
-- If this value is set to @N@, you don\'t have to create tables or
-- triggers on the source database.
postgreSQLSettings_captureDdls :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Bool)
postgreSQLSettings_captureDdls :: (Maybe Bool -> f (Maybe Bool))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_captureDdls = (PostgreSQLSettings -> Maybe Bool)
-> (PostgreSQLSettings -> Maybe Bool -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Bool
captureDdls :: Maybe Bool
$sel:captureDdls:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Bool
captureDdls} -> Maybe Bool
captureDdls) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Bool
a -> PostgreSQLSettings
s {$sel:captureDdls:PostgreSQLSettings' :: Maybe Bool
captureDdls = Maybe Bool
a} :: PostgreSQLSettings)

-- | Specifies the plugin to use to create a replication slot.
postgreSQLSettings_pluginName :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe PluginNameValue)
postgreSQLSettings_pluginName :: (Maybe PluginNameValue -> f (Maybe PluginNameValue))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_pluginName = (PostgreSQLSettings -> Maybe PluginNameValue)
-> (PostgreSQLSettings
    -> Maybe PluginNameValue -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings
     PostgreSQLSettings
     (Maybe PluginNameValue)
     (Maybe PluginNameValue)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe PluginNameValue
pluginName :: Maybe PluginNameValue
$sel:pluginName:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe PluginNameValue
pluginName} -> Maybe PluginNameValue
pluginName) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe PluginNameValue
a -> PostgreSQLSettings
s {$sel:pluginName:PostgreSQLSettings' :: Maybe PluginNameValue
pluginName = Maybe PluginNameValue
a} :: PostgreSQLSettings)

-- | Endpoint TCP port.
postgreSQLSettings_port :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Int)
postgreSQLSettings_port :: (Maybe Int -> f (Maybe Int))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_port = (PostgreSQLSettings -> Maybe Int)
-> (PostgreSQLSettings -> Maybe Int -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Int
port :: Maybe Int
$sel:port:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Int
port} -> Maybe Int
port) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Int
a -> PostgreSQLSettings
s {$sel:port:PostgreSQLSettings' :: Maybe Int
port = Maybe Int
a} :: PostgreSQLSettings)

-- | Sets the schema in which the heartbeat artifacts are created.
postgreSQLSettings_heartbeatSchema :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Text)
postgreSQLSettings_heartbeatSchema :: (Maybe Text -> f (Maybe Text))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_heartbeatSchema = (PostgreSQLSettings -> Maybe Text)
-> (PostgreSQLSettings -> Maybe Text -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Text
heartbeatSchema :: Maybe Text
$sel:heartbeatSchema:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
heartbeatSchema} -> Maybe Text
heartbeatSchema) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Text
a -> PostgreSQLSettings
s {$sel:heartbeatSchema:PostgreSQLSettings' :: Maybe Text
heartbeatSchema = Maybe Text
a} :: PostgreSQLSettings)

-- | The write-ahead log (WAL) heartbeat feature mimics a dummy transaction.
-- By doing this, it prevents idle logical replication slots from holding
-- onto old WAL logs, which can result in storage full situations on the
-- source. This heartbeat keeps @restart_lsn@ moving and prevents storage
-- full scenarios.
postgreSQLSettings_heartbeatEnable :: Lens.Lens' PostgreSQLSettings (Prelude.Maybe Prelude.Bool)
postgreSQLSettings_heartbeatEnable :: (Maybe Bool -> f (Maybe Bool))
-> PostgreSQLSettings -> f PostgreSQLSettings
postgreSQLSettings_heartbeatEnable = (PostgreSQLSettings -> Maybe Bool)
-> (PostgreSQLSettings -> Maybe Bool -> PostgreSQLSettings)
-> Lens
     PostgreSQLSettings PostgreSQLSettings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PostgreSQLSettings' {Maybe Bool
heartbeatEnable :: Maybe Bool
$sel:heartbeatEnable:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Bool
heartbeatEnable} -> Maybe Bool
heartbeatEnable) (\s :: PostgreSQLSettings
s@PostgreSQLSettings' {} Maybe Bool
a -> PostgreSQLSettings
s {$sel:heartbeatEnable:PostgreSQLSettings' :: Maybe Bool
heartbeatEnable = Maybe Bool
a} :: PostgreSQLSettings)

instance Core.FromJSON PostgreSQLSettings where
  parseJSON :: Value -> Parser PostgreSQLSettings
parseJSON =
    String
-> (Object -> Parser PostgreSQLSettings)
-> Value
-> Parser PostgreSQLSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"PostgreSQLSettings"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe PluginNameValue
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> PostgreSQLSettings
PostgreSQLSettings'
            (Maybe Int
 -> Maybe Int
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe (Sensitive Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe PluginNameValue
 -> Maybe Int
 -> Maybe Text
 -> Maybe Bool
 -> PostgreSQLSettings)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ExecuteTimeout")
            Parser
  (Maybe Int
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Int)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxFileSize")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
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
"FailTasksOnLobTruncation")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
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
"ServerName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
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
"DdlArtifactsSchema")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
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
"SlotName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
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
"SecretsManagerAccessRoleArn")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
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
"Username")
            Parser
  (Maybe Int
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Int)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HeartbeatFrequency")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Sensitive Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Password")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
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
"DatabaseName")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
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
"AfterConnectScript")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe PluginNameValue
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> PostgreSQLSettings)
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
"SecretsManagerSecretId")
            Parser
  (Maybe Bool
   -> Maybe PluginNameValue
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> PostgreSQLSettings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe PluginNameValue
      -> Maybe Int -> Maybe Text -> Maybe Bool -> PostgreSQLSettings)
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
"CaptureDdls")
            Parser
  (Maybe PluginNameValue
   -> Maybe Int -> Maybe Text -> Maybe Bool -> PostgreSQLSettings)
-> Parser (Maybe PluginNameValue)
-> Parser
     (Maybe Int -> Maybe Text -> Maybe Bool -> PostgreSQLSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PluginNameValue)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PluginName")
            Parser
  (Maybe Int -> Maybe Text -> Maybe Bool -> PostgreSQLSettings)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Bool -> PostgreSQLSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Port")
            Parser (Maybe Text -> Maybe Bool -> PostgreSQLSettings)
-> Parser (Maybe Text) -> Parser (Maybe Bool -> PostgreSQLSettings)
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
"HeartbeatSchema")
            Parser (Maybe Bool -> PostgreSQLSettings)
-> Parser (Maybe Bool) -> Parser PostgreSQLSettings
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
"HeartbeatEnable")
      )

instance Prelude.Hashable PostgreSQLSettings

instance Prelude.NFData PostgreSQLSettings

instance Core.ToJSON PostgreSQLSettings where
  toJSON :: PostgreSQLSettings -> Value
toJSON PostgreSQLSettings' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe PluginNameValue
heartbeatEnable :: Maybe Bool
heartbeatSchema :: Maybe Text
port :: Maybe Int
pluginName :: Maybe PluginNameValue
captureDdls :: Maybe Bool
secretsManagerSecretId :: Maybe Text
afterConnectScript :: Maybe Text
databaseName :: Maybe Text
password :: Maybe (Sensitive Text)
heartbeatFrequency :: Maybe Int
username :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
slotName :: Maybe Text
ddlArtifactsSchema :: Maybe Text
serverName :: Maybe Text
failTasksOnLobTruncation :: Maybe Bool
maxFileSize :: Maybe Int
executeTimeout :: Maybe Int
$sel:heartbeatEnable:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Bool
$sel:heartbeatSchema:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
$sel:port:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Int
$sel:pluginName:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe PluginNameValue
$sel:captureDdls:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Bool
$sel:secretsManagerSecretId:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
$sel:afterConnectScript:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
$sel:databaseName:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
$sel:password:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe (Sensitive Text)
$sel:heartbeatFrequency:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Int
$sel:username:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
$sel:slotName:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
$sel:ddlArtifactsSchema:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
$sel:serverName:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Text
$sel:failTasksOnLobTruncation:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Bool
$sel:maxFileSize:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Int
$sel:executeTimeout:PostgreSQLSettings' :: PostgreSQLSettings -> Maybe Int
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ExecuteTimeout" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
executeTimeout,
            (Text
"MaxFileSize" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxFileSize,
            (Text
"FailTasksOnLobTruncation" 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
failTasksOnLobTruncation,
            (Text
"ServerName" 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
serverName,
            (Text
"DdlArtifactsSchema" 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
ddlArtifactsSchema,
            (Text
"SlotName" 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
slotName,
            (Text
"SecretsManagerAccessRoleArn" 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
secretsManagerAccessRoleArn,
            (Text
"Username" 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
username,
            (Text
"HeartbeatFrequency" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
heartbeatFrequency,
            (Text
"Password" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Text -> Pair) -> Maybe (Sensitive Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
password,
            (Text
"DatabaseName" 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
databaseName,
            (Text
"AfterConnectScript" 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
afterConnectScript,
            (Text
"SecretsManagerSecretId" 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
secretsManagerSecretId,
            (Text
"CaptureDdls" 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
captureDdls,
            (Text
"PluginName" Text -> PluginNameValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (PluginNameValue -> Pair) -> Maybe PluginNameValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe PluginNameValue
pluginName,
            (Text
"Port" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
port,
            (Text
"HeartbeatSchema" 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
heartbeatSchema,
            (Text
"HeartbeatEnable" 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
heartbeatEnable
          ]
      )