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

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

-- | Provides information that defines an IBM Db2 LUW endpoint.
--
-- /See:/ 'newIBMDb2Settings' smart constructor.
data IBMDb2Settings = IBMDb2Settings'
  { -- | Fully qualified domain name of the endpoint.
    IBMDb2Settings -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text,
    -- | For ongoing replication (CDC), use CurrentLSN to specify a log sequence
    -- number (LSN) where you want the replication to start.
    IBMDb2Settings -> Maybe Text
currentLsn :: Prelude.Maybe Prelude.Text,
    -- | Enables ongoing replication (CDC) as a BOOLEAN value. The default is
    -- true.
    IBMDb2Settings -> Maybe Bool
setDataCaptureChanges :: Prelude.Maybe Prelude.Bool,
    -- | 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 Db2 LUW 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/.
    IBMDb2Settings -> Maybe Text
secretsManagerAccessRoleArn :: Prelude.Maybe Prelude.Text,
    -- | Endpoint connection user name.
    IBMDb2Settings -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
    -- | Endpoint connection password.
    IBMDb2Settings -> Maybe (Sensitive Text)
password :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Database name for the endpoint.
    IBMDb2Settings -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
    -- | The full ARN, partial ARN, or friendly name of the
    -- @SecretsManagerSecret@ that contains the Db2 LUW endpoint connection
    -- details.
    IBMDb2Settings -> Maybe Text
secretsManagerSecretId :: Prelude.Maybe Prelude.Text,
    -- | Maximum number of bytes per read, as a NUMBER value. The default is 64
    -- KB.
    IBMDb2Settings -> Maybe Int
maxKBytesPerRead :: Prelude.Maybe Prelude.Int,
    -- | Endpoint TCP port. The default value is 50000.
    IBMDb2Settings -> Maybe Int
port :: Prelude.Maybe Prelude.Int
  }
  deriving (IBMDb2Settings -> IBMDb2Settings -> Bool
(IBMDb2Settings -> IBMDb2Settings -> Bool)
-> (IBMDb2Settings -> IBMDb2Settings -> Bool) -> Eq IBMDb2Settings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: IBMDb2Settings -> IBMDb2Settings -> Bool
$c/= :: IBMDb2Settings -> IBMDb2Settings -> Bool
== :: IBMDb2Settings -> IBMDb2Settings -> Bool
$c== :: IBMDb2Settings -> IBMDb2Settings -> Bool
Prelude.Eq, Int -> IBMDb2Settings -> ShowS
[IBMDb2Settings] -> ShowS
IBMDb2Settings -> String
(Int -> IBMDb2Settings -> ShowS)
-> (IBMDb2Settings -> String)
-> ([IBMDb2Settings] -> ShowS)
-> Show IBMDb2Settings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [IBMDb2Settings] -> ShowS
$cshowList :: [IBMDb2Settings] -> ShowS
show :: IBMDb2Settings -> String
$cshow :: IBMDb2Settings -> String
showsPrec :: Int -> IBMDb2Settings -> ShowS
$cshowsPrec :: Int -> IBMDb2Settings -> ShowS
Prelude.Show, (forall x. IBMDb2Settings -> Rep IBMDb2Settings x)
-> (forall x. Rep IBMDb2Settings x -> IBMDb2Settings)
-> Generic IBMDb2Settings
forall x. Rep IBMDb2Settings x -> IBMDb2Settings
forall x. IBMDb2Settings -> Rep IBMDb2Settings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep IBMDb2Settings x -> IBMDb2Settings
$cfrom :: forall x. IBMDb2Settings -> Rep IBMDb2Settings x
Prelude.Generic)

-- |
-- Create a value of 'IBMDb2Settings' 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:
--
-- 'serverName', 'iBMDb2Settings_serverName' - Fully qualified domain name of the endpoint.
--
-- 'currentLsn', 'iBMDb2Settings_currentLsn' - For ongoing replication (CDC), use CurrentLSN to specify a log sequence
-- number (LSN) where you want the replication to start.
--
-- 'setDataCaptureChanges', 'iBMDb2Settings_setDataCaptureChanges' - Enables ongoing replication (CDC) as a BOOLEAN value. The default is
-- true.
--
-- 'secretsManagerAccessRoleArn', 'iBMDb2Settings_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 Db2 LUW 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', 'iBMDb2Settings_username' - Endpoint connection user name.
--
-- 'password', 'iBMDb2Settings_password' - Endpoint connection password.
--
-- 'databaseName', 'iBMDb2Settings_databaseName' - Database name for the endpoint.
--
-- 'secretsManagerSecretId', 'iBMDb2Settings_secretsManagerSecretId' - The full ARN, partial ARN, or friendly name of the
-- @SecretsManagerSecret@ that contains the Db2 LUW endpoint connection
-- details.
--
-- 'maxKBytesPerRead', 'iBMDb2Settings_maxKBytesPerRead' - Maximum number of bytes per read, as a NUMBER value. The default is 64
-- KB.
--
-- 'port', 'iBMDb2Settings_port' - Endpoint TCP port. The default value is 50000.
newIBMDb2Settings ::
  IBMDb2Settings
newIBMDb2Settings :: IBMDb2Settings
newIBMDb2Settings =
  IBMDb2Settings' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> IBMDb2Settings
IBMDb2Settings'
    { $sel:serverName:IBMDb2Settings' :: Maybe Text
serverName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:currentLsn:IBMDb2Settings' :: Maybe Text
currentLsn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:setDataCaptureChanges:IBMDb2Settings' :: Maybe Bool
setDataCaptureChanges = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerAccessRoleArn:IBMDb2Settings' :: Maybe Text
secretsManagerAccessRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:username:IBMDb2Settings' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:password:IBMDb2Settings' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:IBMDb2Settings' :: Maybe Text
databaseName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerSecretId:IBMDb2Settings' :: Maybe Text
secretsManagerSecretId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxKBytesPerRead:IBMDb2Settings' :: Maybe Int
maxKBytesPerRead = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:port:IBMDb2Settings' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

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

-- | For ongoing replication (CDC), use CurrentLSN to specify a log sequence
-- number (LSN) where you want the replication to start.
iBMDb2Settings_currentLsn :: Lens.Lens' IBMDb2Settings (Prelude.Maybe Prelude.Text)
iBMDb2Settings_currentLsn :: (Maybe Text -> f (Maybe Text))
-> IBMDb2Settings -> f IBMDb2Settings
iBMDb2Settings_currentLsn = (IBMDb2Settings -> Maybe Text)
-> (IBMDb2Settings -> Maybe Text -> IBMDb2Settings)
-> Lens IBMDb2Settings IBMDb2Settings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IBMDb2Settings' {Maybe Text
currentLsn :: Maybe Text
$sel:currentLsn:IBMDb2Settings' :: IBMDb2Settings -> Maybe Text
currentLsn} -> Maybe Text
currentLsn) (\s :: IBMDb2Settings
s@IBMDb2Settings' {} Maybe Text
a -> IBMDb2Settings
s {$sel:currentLsn:IBMDb2Settings' :: Maybe Text
currentLsn = Maybe Text
a} :: IBMDb2Settings)

-- | Enables ongoing replication (CDC) as a BOOLEAN value. The default is
-- true.
iBMDb2Settings_setDataCaptureChanges :: Lens.Lens' IBMDb2Settings (Prelude.Maybe Prelude.Bool)
iBMDb2Settings_setDataCaptureChanges :: (Maybe Bool -> f (Maybe Bool))
-> IBMDb2Settings -> f IBMDb2Settings
iBMDb2Settings_setDataCaptureChanges = (IBMDb2Settings -> Maybe Bool)
-> (IBMDb2Settings -> Maybe Bool -> IBMDb2Settings)
-> Lens IBMDb2Settings IBMDb2Settings (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IBMDb2Settings' {Maybe Bool
setDataCaptureChanges :: Maybe Bool
$sel:setDataCaptureChanges:IBMDb2Settings' :: IBMDb2Settings -> Maybe Bool
setDataCaptureChanges} -> Maybe Bool
setDataCaptureChanges) (\s :: IBMDb2Settings
s@IBMDb2Settings' {} Maybe Bool
a -> IBMDb2Settings
s {$sel:setDataCaptureChanges:IBMDb2Settings' :: Maybe Bool
setDataCaptureChanges = Maybe Bool
a} :: IBMDb2Settings)

-- | 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 Db2 LUW 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/.
iBMDb2Settings_secretsManagerAccessRoleArn :: Lens.Lens' IBMDb2Settings (Prelude.Maybe Prelude.Text)
iBMDb2Settings_secretsManagerAccessRoleArn :: (Maybe Text -> f (Maybe Text))
-> IBMDb2Settings -> f IBMDb2Settings
iBMDb2Settings_secretsManagerAccessRoleArn = (IBMDb2Settings -> Maybe Text)
-> (IBMDb2Settings -> Maybe Text -> IBMDb2Settings)
-> Lens IBMDb2Settings IBMDb2Settings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IBMDb2Settings' {Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
$sel:secretsManagerAccessRoleArn:IBMDb2Settings' :: IBMDb2Settings -> Maybe Text
secretsManagerAccessRoleArn} -> Maybe Text
secretsManagerAccessRoleArn) (\s :: IBMDb2Settings
s@IBMDb2Settings' {} Maybe Text
a -> IBMDb2Settings
s {$sel:secretsManagerAccessRoleArn:IBMDb2Settings' :: Maybe Text
secretsManagerAccessRoleArn = Maybe Text
a} :: IBMDb2Settings)

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

-- | Endpoint connection password.
iBMDb2Settings_password :: Lens.Lens' IBMDb2Settings (Prelude.Maybe Prelude.Text)
iBMDb2Settings_password :: (Maybe Text -> f (Maybe Text))
-> IBMDb2Settings -> f IBMDb2Settings
iBMDb2Settings_password = (IBMDb2Settings -> Maybe (Sensitive Text))
-> (IBMDb2Settings -> Maybe (Sensitive Text) -> IBMDb2Settings)
-> Lens
     IBMDb2Settings
     IBMDb2Settings
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IBMDb2Settings' {Maybe (Sensitive Text)
password :: Maybe (Sensitive Text)
$sel:password:IBMDb2Settings' :: IBMDb2Settings -> Maybe (Sensitive Text)
password} -> Maybe (Sensitive Text)
password) (\s :: IBMDb2Settings
s@IBMDb2Settings' {} Maybe (Sensitive Text)
a -> IBMDb2Settings
s {$sel:password:IBMDb2Settings' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
a} :: IBMDb2Settings) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> IBMDb2Settings -> f IBMDb2Settings)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> IBMDb2Settings
-> f IBMDb2Settings
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.
iBMDb2Settings_databaseName :: Lens.Lens' IBMDb2Settings (Prelude.Maybe Prelude.Text)
iBMDb2Settings_databaseName :: (Maybe Text -> f (Maybe Text))
-> IBMDb2Settings -> f IBMDb2Settings
iBMDb2Settings_databaseName = (IBMDb2Settings -> Maybe Text)
-> (IBMDb2Settings -> Maybe Text -> IBMDb2Settings)
-> Lens IBMDb2Settings IBMDb2Settings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IBMDb2Settings' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:IBMDb2Settings' :: IBMDb2Settings -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: IBMDb2Settings
s@IBMDb2Settings' {} Maybe Text
a -> IBMDb2Settings
s {$sel:databaseName:IBMDb2Settings' :: Maybe Text
databaseName = Maybe Text
a} :: IBMDb2Settings)

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

-- | Maximum number of bytes per read, as a NUMBER value. The default is 64
-- KB.
iBMDb2Settings_maxKBytesPerRead :: Lens.Lens' IBMDb2Settings (Prelude.Maybe Prelude.Int)
iBMDb2Settings_maxKBytesPerRead :: (Maybe Int -> f (Maybe Int)) -> IBMDb2Settings -> f IBMDb2Settings
iBMDb2Settings_maxKBytesPerRead = (IBMDb2Settings -> Maybe Int)
-> (IBMDb2Settings -> Maybe Int -> IBMDb2Settings)
-> Lens IBMDb2Settings IBMDb2Settings (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IBMDb2Settings' {Maybe Int
maxKBytesPerRead :: Maybe Int
$sel:maxKBytesPerRead:IBMDb2Settings' :: IBMDb2Settings -> Maybe Int
maxKBytesPerRead} -> Maybe Int
maxKBytesPerRead) (\s :: IBMDb2Settings
s@IBMDb2Settings' {} Maybe Int
a -> IBMDb2Settings
s {$sel:maxKBytesPerRead:IBMDb2Settings' :: Maybe Int
maxKBytesPerRead = Maybe Int
a} :: IBMDb2Settings)

-- | Endpoint TCP port. The default value is 50000.
iBMDb2Settings_port :: Lens.Lens' IBMDb2Settings (Prelude.Maybe Prelude.Int)
iBMDb2Settings_port :: (Maybe Int -> f (Maybe Int)) -> IBMDb2Settings -> f IBMDb2Settings
iBMDb2Settings_port = (IBMDb2Settings -> Maybe Int)
-> (IBMDb2Settings -> Maybe Int -> IBMDb2Settings)
-> Lens IBMDb2Settings IBMDb2Settings (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IBMDb2Settings' {Maybe Int
port :: Maybe Int
$sel:port:IBMDb2Settings' :: IBMDb2Settings -> Maybe Int
port} -> Maybe Int
port) (\s :: IBMDb2Settings
s@IBMDb2Settings' {} Maybe Int
a -> IBMDb2Settings
s {$sel:port:IBMDb2Settings' :: Maybe Int
port = Maybe Int
a} :: IBMDb2Settings)

instance Core.FromJSON IBMDb2Settings where
  parseJSON :: Value -> Parser IBMDb2Settings
parseJSON =
    String
-> (Object -> Parser IBMDb2Settings)
-> Value
-> Parser IBMDb2Settings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"IBMDb2Settings"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> IBMDb2Settings
IBMDb2Settings'
            (Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe Text
 -> Maybe Text
 -> Maybe Int
 -> Maybe Int
 -> IBMDb2Settings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> IBMDb2Settings)
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
"ServerName")
            Parser
  (Maybe Text
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> IBMDb2Settings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> IBMDb2Settings)
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
"CurrentLsn")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> IBMDb2Settings)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> IBMDb2Settings)
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
"SetDataCaptureChanges")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> IBMDb2Settings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> IBMDb2Settings)
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 (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> IBMDb2Settings)
-> Parser (Maybe Text)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe Text
      -> Maybe Text
      -> Maybe Int
      -> Maybe Int
      -> IBMDb2Settings)
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 (Sensitive Text)
   -> Maybe Text
   -> Maybe Text
   -> Maybe Int
   -> Maybe Int
   -> IBMDb2Settings)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Int -> Maybe Int -> IBMDb2Settings)
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 Int -> Maybe Int -> IBMDb2Settings)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Int -> Maybe Int -> IBMDb2Settings)
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 Int -> Maybe Int -> IBMDb2Settings)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> Maybe Int -> IBMDb2Settings)
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 Int -> Maybe Int -> IBMDb2Settings)
-> Parser (Maybe Int) -> Parser (Maybe Int -> IBMDb2Settings)
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
"MaxKBytesPerRead")
            Parser (Maybe Int -> IBMDb2Settings)
-> Parser (Maybe Int) -> Parser IBMDb2Settings
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")
      )

instance Prelude.Hashable IBMDb2Settings

instance Prelude.NFData IBMDb2Settings

instance Core.ToJSON IBMDb2Settings where
  toJSON :: IBMDb2Settings -> Value
toJSON IBMDb2Settings' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive Text)
port :: Maybe Int
maxKBytesPerRead :: Maybe Int
secretsManagerSecretId :: Maybe Text
databaseName :: Maybe Text
password :: Maybe (Sensitive Text)
username :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
setDataCaptureChanges :: Maybe Bool
currentLsn :: Maybe Text
serverName :: Maybe Text
$sel:port:IBMDb2Settings' :: IBMDb2Settings -> Maybe Int
$sel:maxKBytesPerRead:IBMDb2Settings' :: IBMDb2Settings -> Maybe Int
$sel:secretsManagerSecretId:IBMDb2Settings' :: IBMDb2Settings -> Maybe Text
$sel:databaseName:IBMDb2Settings' :: IBMDb2Settings -> Maybe Text
$sel:password:IBMDb2Settings' :: IBMDb2Settings -> Maybe (Sensitive Text)
$sel:username:IBMDb2Settings' :: IBMDb2Settings -> Maybe Text
$sel:secretsManagerAccessRoleArn:IBMDb2Settings' :: IBMDb2Settings -> Maybe Text
$sel:setDataCaptureChanges:IBMDb2Settings' :: IBMDb2Settings -> Maybe Bool
$sel:currentLsn:IBMDb2Settings' :: IBMDb2Settings -> Maybe Text
$sel:serverName:IBMDb2Settings' :: IBMDb2Settings -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"CurrentLsn" 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
currentLsn,
            (Text
"SetDataCaptureChanges" 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
setDataCaptureChanges,
            (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
"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
"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
"MaxKBytesPerRead" 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
maxKBytesPerRead,
            (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
          ]
      )