{-# 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.MongoDbSettings
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DMS.Types.MongoDbSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.DMS.Types.AuthMechanismValue
import Amazonka.DMS.Types.AuthTypeValue
import Amazonka.DMS.Types.NestingLevelValue
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides information that defines a MongoDB endpoint.
--
-- /See:/ 'newMongoDbSettings' smart constructor.
data MongoDbSettings = MongoDbSettings'
  { -- | The authentication mechanism you use to access the MongoDB source
    -- endpoint.
    --
    -- For the default value, in MongoDB version 2.x, @\"default\"@ is
    -- @\"mongodb_cr\"@. For MongoDB version 3.x or later, @\"default\"@ is
    -- @\"scram_sha_1\"@. This setting isn\'t used when @AuthType@ is set to
    -- @\"no\"@.
    MongoDbSettings -> Maybe AuthMechanismValue
authMechanism :: Prelude.Maybe AuthMechanismValue,
    -- | The MongoDB database name. This setting isn\'t used when @AuthType@ is
    -- set to @\"no\"@.
    --
    -- The default is @\"admin\"@.
    MongoDbSettings -> Maybe Text
authSource :: Prelude.Maybe Prelude.Text,
    -- | The authentication type you use to access the MongoDB source endpoint.
    --
    -- When when set to @\"no\"@, user name and password parameters are not
    -- used and can be empty.
    MongoDbSettings -> Maybe AuthTypeValue
authType :: Prelude.Maybe AuthTypeValue,
    -- | The database name on the MongoDB source endpoint.
    MongoDbSettings -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
    -- | Indicates the number of documents to preview to determine the document
    -- organization. Use this setting when @NestingLevel@ is set to @\"one\"@.
    --
    -- Must be a positive value greater than @0@. Default value is @1000@.
    MongoDbSettings -> Maybe Text
docsToInvestigate :: Prelude.Maybe Prelude.Text,
    -- | Specifies the document ID. Use this setting when @NestingLevel@ is set
    -- to @\"none\"@.
    --
    -- Default value is @\"false\"@.
    MongoDbSettings -> Maybe Text
extractDocId :: Prelude.Maybe Prelude.Text,
    -- | The KMS key identifier that is used to encrypt the content on the
    -- replication instance. If you don\'t specify a value for the @KmsKeyId@
    -- parameter, then DMS uses your default encryption key. KMS creates the
    -- default encryption key for your Amazon Web Services account. Your Amazon
    -- Web Services account has a different default encryption key for each
    -- Amazon Web Services Region.
    MongoDbSettings -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | Specifies either document or table mode.
    --
    -- Default value is @\"none\"@. Specify @\"none\"@ to use document mode.
    -- Specify @\"one\"@ to use table mode.
    MongoDbSettings -> Maybe NestingLevelValue
nestingLevel :: Prelude.Maybe NestingLevelValue,
    -- | The password for the user account you use to access the MongoDB source
    -- endpoint.
    MongoDbSettings -> Maybe (Sensitive Text)
password :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | The port value for the MongoDB source endpoint.
    MongoDbSettings -> Maybe Int
port :: Prelude.Maybe Prelude.Int,
    -- | 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 MongoDB 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/.
    MongoDbSettings -> Maybe Text
secretsManagerAccessRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The full ARN, partial ARN, or friendly name of the
    -- @SecretsManagerSecret@ that contains the MongoDB endpoint connection
    -- details.
    MongoDbSettings -> Maybe Text
secretsManagerSecretId :: Prelude.Maybe Prelude.Text,
    -- | The name of the server on the MongoDB source endpoint.
    MongoDbSettings -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text,
    -- | The user name you use to access the MongoDB source endpoint.
    MongoDbSettings -> Maybe Text
username :: Prelude.Maybe Prelude.Text
  }
  deriving (MongoDbSettings -> MongoDbSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MongoDbSettings -> MongoDbSettings -> Bool
$c/= :: MongoDbSettings -> MongoDbSettings -> Bool
== :: MongoDbSettings -> MongoDbSettings -> Bool
$c== :: MongoDbSettings -> MongoDbSettings -> Bool
Prelude.Eq, Int -> MongoDbSettings -> ShowS
[MongoDbSettings] -> ShowS
MongoDbSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MongoDbSettings] -> ShowS
$cshowList :: [MongoDbSettings] -> ShowS
show :: MongoDbSettings -> String
$cshow :: MongoDbSettings -> String
showsPrec :: Int -> MongoDbSettings -> ShowS
$cshowsPrec :: Int -> MongoDbSettings -> ShowS
Prelude.Show, forall x. Rep MongoDbSettings x -> MongoDbSettings
forall x. MongoDbSettings -> Rep MongoDbSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MongoDbSettings x -> MongoDbSettings
$cfrom :: forall x. MongoDbSettings -> Rep MongoDbSettings x
Prelude.Generic)

-- |
-- Create a value of 'MongoDbSettings' 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:
--
-- 'authMechanism', 'mongoDbSettings_authMechanism' - The authentication mechanism you use to access the MongoDB source
-- endpoint.
--
-- For the default value, in MongoDB version 2.x, @\"default\"@ is
-- @\"mongodb_cr\"@. For MongoDB version 3.x or later, @\"default\"@ is
-- @\"scram_sha_1\"@. This setting isn\'t used when @AuthType@ is set to
-- @\"no\"@.
--
-- 'authSource', 'mongoDbSettings_authSource' - The MongoDB database name. This setting isn\'t used when @AuthType@ is
-- set to @\"no\"@.
--
-- The default is @\"admin\"@.
--
-- 'authType', 'mongoDbSettings_authType' - The authentication type you use to access the MongoDB source endpoint.
--
-- When when set to @\"no\"@, user name and password parameters are not
-- used and can be empty.
--
-- 'databaseName', 'mongoDbSettings_databaseName' - The database name on the MongoDB source endpoint.
--
-- 'docsToInvestigate', 'mongoDbSettings_docsToInvestigate' - Indicates the number of documents to preview to determine the document
-- organization. Use this setting when @NestingLevel@ is set to @\"one\"@.
--
-- Must be a positive value greater than @0@. Default value is @1000@.
--
-- 'extractDocId', 'mongoDbSettings_extractDocId' - Specifies the document ID. Use this setting when @NestingLevel@ is set
-- to @\"none\"@.
--
-- Default value is @\"false\"@.
--
-- 'kmsKeyId', 'mongoDbSettings_kmsKeyId' - The KMS key identifier that is used to encrypt the content on the
-- replication instance. If you don\'t specify a value for the @KmsKeyId@
-- parameter, then DMS uses your default encryption key. KMS creates the
-- default encryption key for your Amazon Web Services account. Your Amazon
-- Web Services account has a different default encryption key for each
-- Amazon Web Services Region.
--
-- 'nestingLevel', 'mongoDbSettings_nestingLevel' - Specifies either document or table mode.
--
-- Default value is @\"none\"@. Specify @\"none\"@ to use document mode.
-- Specify @\"one\"@ to use table mode.
--
-- 'password', 'mongoDbSettings_password' - The password for the user account you use to access the MongoDB source
-- endpoint.
--
-- 'port', 'mongoDbSettings_port' - The port value for the MongoDB source endpoint.
--
-- 'secretsManagerAccessRoleArn', 'mongoDbSettings_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 MongoDB 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/.
--
-- 'secretsManagerSecretId', 'mongoDbSettings_secretsManagerSecretId' - The full ARN, partial ARN, or friendly name of the
-- @SecretsManagerSecret@ that contains the MongoDB endpoint connection
-- details.
--
-- 'serverName', 'mongoDbSettings_serverName' - The name of the server on the MongoDB source endpoint.
--
-- 'username', 'mongoDbSettings_username' - The user name you use to access the MongoDB source endpoint.
newMongoDbSettings ::
  MongoDbSettings
newMongoDbSettings :: MongoDbSettings
newMongoDbSettings =
  MongoDbSettings'
    { $sel:authMechanism:MongoDbSettings' :: Maybe AuthMechanismValue
authMechanism = forall a. Maybe a
Prelude.Nothing,
      $sel:authSource:MongoDbSettings' :: Maybe Text
authSource = forall a. Maybe a
Prelude.Nothing,
      $sel:authType:MongoDbSettings' :: Maybe AuthTypeValue
authType = forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:MongoDbSettings' :: Maybe Text
databaseName = forall a. Maybe a
Prelude.Nothing,
      $sel:docsToInvestigate:MongoDbSettings' :: Maybe Text
docsToInvestigate = forall a. Maybe a
Prelude.Nothing,
      $sel:extractDocId:MongoDbSettings' :: Maybe Text
extractDocId = forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:MongoDbSettings' :: Maybe Text
kmsKeyId = forall a. Maybe a
Prelude.Nothing,
      $sel:nestingLevel:MongoDbSettings' :: Maybe NestingLevelValue
nestingLevel = forall a. Maybe a
Prelude.Nothing,
      $sel:password:MongoDbSettings' :: Maybe (Sensitive Text)
password = forall a. Maybe a
Prelude.Nothing,
      $sel:port:MongoDbSettings' :: Maybe Int
port = forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerAccessRoleArn:MongoDbSettings' :: Maybe Text
secretsManagerAccessRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerSecretId:MongoDbSettings' :: Maybe Text
secretsManagerSecretId = forall a. Maybe a
Prelude.Nothing,
      $sel:serverName:MongoDbSettings' :: Maybe Text
serverName = forall a. Maybe a
Prelude.Nothing,
      $sel:username:MongoDbSettings' :: Maybe Text
username = forall a. Maybe a
Prelude.Nothing
    }

-- | The authentication mechanism you use to access the MongoDB source
-- endpoint.
--
-- For the default value, in MongoDB version 2.x, @\"default\"@ is
-- @\"mongodb_cr\"@. For MongoDB version 3.x or later, @\"default\"@ is
-- @\"scram_sha_1\"@. This setting isn\'t used when @AuthType@ is set to
-- @\"no\"@.
mongoDbSettings_authMechanism :: Lens.Lens' MongoDbSettings (Prelude.Maybe AuthMechanismValue)
mongoDbSettings_authMechanism :: Lens' MongoDbSettings (Maybe AuthMechanismValue)
mongoDbSettings_authMechanism = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe AuthMechanismValue
authMechanism :: Maybe AuthMechanismValue
$sel:authMechanism:MongoDbSettings' :: MongoDbSettings -> Maybe AuthMechanismValue
authMechanism} -> Maybe AuthMechanismValue
authMechanism) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe AuthMechanismValue
a -> MongoDbSettings
s {$sel:authMechanism:MongoDbSettings' :: Maybe AuthMechanismValue
authMechanism = Maybe AuthMechanismValue
a} :: MongoDbSettings)

-- | The MongoDB database name. This setting isn\'t used when @AuthType@ is
-- set to @\"no\"@.
--
-- The default is @\"admin\"@.
mongoDbSettings_authSource :: Lens.Lens' MongoDbSettings (Prelude.Maybe Prelude.Text)
mongoDbSettings_authSource :: Lens' MongoDbSettings (Maybe Text)
mongoDbSettings_authSource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe Text
authSource :: Maybe Text
$sel:authSource:MongoDbSettings' :: MongoDbSettings -> Maybe Text
authSource} -> Maybe Text
authSource) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe Text
a -> MongoDbSettings
s {$sel:authSource:MongoDbSettings' :: Maybe Text
authSource = Maybe Text
a} :: MongoDbSettings)

-- | The authentication type you use to access the MongoDB source endpoint.
--
-- When when set to @\"no\"@, user name and password parameters are not
-- used and can be empty.
mongoDbSettings_authType :: Lens.Lens' MongoDbSettings (Prelude.Maybe AuthTypeValue)
mongoDbSettings_authType :: Lens' MongoDbSettings (Maybe AuthTypeValue)
mongoDbSettings_authType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe AuthTypeValue
authType :: Maybe AuthTypeValue
$sel:authType:MongoDbSettings' :: MongoDbSettings -> Maybe AuthTypeValue
authType} -> Maybe AuthTypeValue
authType) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe AuthTypeValue
a -> MongoDbSettings
s {$sel:authType:MongoDbSettings' :: Maybe AuthTypeValue
authType = Maybe AuthTypeValue
a} :: MongoDbSettings)

-- | The database name on the MongoDB source endpoint.
mongoDbSettings_databaseName :: Lens.Lens' MongoDbSettings (Prelude.Maybe Prelude.Text)
mongoDbSettings_databaseName :: Lens' MongoDbSettings (Maybe Text)
mongoDbSettings_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:MongoDbSettings' :: MongoDbSettings -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe Text
a -> MongoDbSettings
s {$sel:databaseName:MongoDbSettings' :: Maybe Text
databaseName = Maybe Text
a} :: MongoDbSettings)

-- | Indicates the number of documents to preview to determine the document
-- organization. Use this setting when @NestingLevel@ is set to @\"one\"@.
--
-- Must be a positive value greater than @0@. Default value is @1000@.
mongoDbSettings_docsToInvestigate :: Lens.Lens' MongoDbSettings (Prelude.Maybe Prelude.Text)
mongoDbSettings_docsToInvestigate :: Lens' MongoDbSettings (Maybe Text)
mongoDbSettings_docsToInvestigate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe Text
docsToInvestigate :: Maybe Text
$sel:docsToInvestigate:MongoDbSettings' :: MongoDbSettings -> Maybe Text
docsToInvestigate} -> Maybe Text
docsToInvestigate) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe Text
a -> MongoDbSettings
s {$sel:docsToInvestigate:MongoDbSettings' :: Maybe Text
docsToInvestigate = Maybe Text
a} :: MongoDbSettings)

-- | Specifies the document ID. Use this setting when @NestingLevel@ is set
-- to @\"none\"@.
--
-- Default value is @\"false\"@.
mongoDbSettings_extractDocId :: Lens.Lens' MongoDbSettings (Prelude.Maybe Prelude.Text)
mongoDbSettings_extractDocId :: Lens' MongoDbSettings (Maybe Text)
mongoDbSettings_extractDocId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe Text
extractDocId :: Maybe Text
$sel:extractDocId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
extractDocId} -> Maybe Text
extractDocId) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe Text
a -> MongoDbSettings
s {$sel:extractDocId:MongoDbSettings' :: Maybe Text
extractDocId = Maybe Text
a} :: MongoDbSettings)

-- | The KMS key identifier that is used to encrypt the content on the
-- replication instance. If you don\'t specify a value for the @KmsKeyId@
-- parameter, then DMS uses your default encryption key. KMS creates the
-- default encryption key for your Amazon Web Services account. Your Amazon
-- Web Services account has a different default encryption key for each
-- Amazon Web Services Region.
mongoDbSettings_kmsKeyId :: Lens.Lens' MongoDbSettings (Prelude.Maybe Prelude.Text)
mongoDbSettings_kmsKeyId :: Lens' MongoDbSettings (Maybe Text)
mongoDbSettings_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe Text
a -> MongoDbSettings
s {$sel:kmsKeyId:MongoDbSettings' :: Maybe Text
kmsKeyId = Maybe Text
a} :: MongoDbSettings)

-- | Specifies either document or table mode.
--
-- Default value is @\"none\"@. Specify @\"none\"@ to use document mode.
-- Specify @\"one\"@ to use table mode.
mongoDbSettings_nestingLevel :: Lens.Lens' MongoDbSettings (Prelude.Maybe NestingLevelValue)
mongoDbSettings_nestingLevel :: Lens' MongoDbSettings (Maybe NestingLevelValue)
mongoDbSettings_nestingLevel = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe NestingLevelValue
nestingLevel :: Maybe NestingLevelValue
$sel:nestingLevel:MongoDbSettings' :: MongoDbSettings -> Maybe NestingLevelValue
nestingLevel} -> Maybe NestingLevelValue
nestingLevel) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe NestingLevelValue
a -> MongoDbSettings
s {$sel:nestingLevel:MongoDbSettings' :: Maybe NestingLevelValue
nestingLevel = Maybe NestingLevelValue
a} :: MongoDbSettings)

-- | The password for the user account you use to access the MongoDB source
-- endpoint.
mongoDbSettings_password :: Lens.Lens' MongoDbSettings (Prelude.Maybe Prelude.Text)
mongoDbSettings_password :: Lens' MongoDbSettings (Maybe Text)
mongoDbSettings_password = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe (Sensitive Text)
password :: Maybe (Sensitive Text)
$sel:password:MongoDbSettings' :: MongoDbSettings -> Maybe (Sensitive Text)
password} -> Maybe (Sensitive Text)
password) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe (Sensitive Text)
a -> MongoDbSettings
s {$sel:password:MongoDbSettings' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
a} :: MongoDbSettings) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive

-- | The port value for the MongoDB source endpoint.
mongoDbSettings_port :: Lens.Lens' MongoDbSettings (Prelude.Maybe Prelude.Int)
mongoDbSettings_port :: Lens' MongoDbSettings (Maybe Int)
mongoDbSettings_port = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe Int
port :: Maybe Int
$sel:port:MongoDbSettings' :: MongoDbSettings -> Maybe Int
port} -> Maybe Int
port) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe Int
a -> MongoDbSettings
s {$sel:port:MongoDbSettings' :: Maybe Int
port = Maybe Int
a} :: MongoDbSettings)

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

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

-- | The name of the server on the MongoDB source endpoint.
mongoDbSettings_serverName :: Lens.Lens' MongoDbSettings (Prelude.Maybe Prelude.Text)
mongoDbSettings_serverName :: Lens' MongoDbSettings (Maybe Text)
mongoDbSettings_serverName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe Text
serverName :: Maybe Text
$sel:serverName:MongoDbSettings' :: MongoDbSettings -> Maybe Text
serverName} -> Maybe Text
serverName) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe Text
a -> MongoDbSettings
s {$sel:serverName:MongoDbSettings' :: Maybe Text
serverName = Maybe Text
a} :: MongoDbSettings)

-- | The user name you use to access the MongoDB source endpoint.
mongoDbSettings_username :: Lens.Lens' MongoDbSettings (Prelude.Maybe Prelude.Text)
mongoDbSettings_username :: Lens' MongoDbSettings (Maybe Text)
mongoDbSettings_username = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MongoDbSettings' {Maybe Text
username :: Maybe Text
$sel:username:MongoDbSettings' :: MongoDbSettings -> Maybe Text
username} -> Maybe Text
username) (\s :: MongoDbSettings
s@MongoDbSettings' {} Maybe Text
a -> MongoDbSettings
s {$sel:username:MongoDbSettings' :: Maybe Text
username = Maybe Text
a} :: MongoDbSettings)

instance Data.FromJSON MongoDbSettings where
  parseJSON :: Value -> Parser MongoDbSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MongoDbSettings"
      ( \Object
x ->
          Maybe AuthMechanismValue
-> Maybe Text
-> Maybe AuthTypeValue
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe NestingLevelValue
-> Maybe (Sensitive Text)
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MongoDbSettings
MongoDbSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AuthMechanism")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AuthSource")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AuthType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DatabaseName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"DocsToInvestigate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ExtractDocId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"KmsKeyId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"NestingLevel")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Password")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Port")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecretsManagerAccessRoleArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SecretsManagerSecretId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ServerName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Username")
      )

instance Prelude.Hashable MongoDbSettings where
  hashWithSalt :: Int -> MongoDbSettings -> Int
hashWithSalt Int
_salt MongoDbSettings' {Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe AuthMechanismValue
Maybe AuthTypeValue
Maybe NestingLevelValue
username :: Maybe Text
serverName :: Maybe Text
secretsManagerSecretId :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
port :: Maybe Int
password :: Maybe (Sensitive Text)
nestingLevel :: Maybe NestingLevelValue
kmsKeyId :: Maybe Text
extractDocId :: Maybe Text
docsToInvestigate :: Maybe Text
databaseName :: Maybe Text
authType :: Maybe AuthTypeValue
authSource :: Maybe Text
authMechanism :: Maybe AuthMechanismValue
$sel:username:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:serverName:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:secretsManagerSecretId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:port:MongoDbSettings' :: MongoDbSettings -> Maybe Int
$sel:password:MongoDbSettings' :: MongoDbSettings -> Maybe (Sensitive Text)
$sel:nestingLevel:MongoDbSettings' :: MongoDbSettings -> Maybe NestingLevelValue
$sel:kmsKeyId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:extractDocId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:docsToInvestigate:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:databaseName:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:authType:MongoDbSettings' :: MongoDbSettings -> Maybe AuthTypeValue
$sel:authSource:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:authMechanism:MongoDbSettings' :: MongoDbSettings -> Maybe AuthMechanismValue
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthMechanismValue
authMechanism
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
authSource
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AuthTypeValue
authType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
docsToInvestigate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
extractDocId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NestingLevelValue
nestingLevel
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
password
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
port
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
secretsManagerAccessRoleArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
secretsManagerSecretId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serverName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
username

instance Prelude.NFData MongoDbSettings where
  rnf :: MongoDbSettings -> ()
rnf MongoDbSettings' {Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe AuthMechanismValue
Maybe AuthTypeValue
Maybe NestingLevelValue
username :: Maybe Text
serverName :: Maybe Text
secretsManagerSecretId :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
port :: Maybe Int
password :: Maybe (Sensitive Text)
nestingLevel :: Maybe NestingLevelValue
kmsKeyId :: Maybe Text
extractDocId :: Maybe Text
docsToInvestigate :: Maybe Text
databaseName :: Maybe Text
authType :: Maybe AuthTypeValue
authSource :: Maybe Text
authMechanism :: Maybe AuthMechanismValue
$sel:username:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:serverName:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:secretsManagerSecretId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:port:MongoDbSettings' :: MongoDbSettings -> Maybe Int
$sel:password:MongoDbSettings' :: MongoDbSettings -> Maybe (Sensitive Text)
$sel:nestingLevel:MongoDbSettings' :: MongoDbSettings -> Maybe NestingLevelValue
$sel:kmsKeyId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:extractDocId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:docsToInvestigate:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:databaseName:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:authType:MongoDbSettings' :: MongoDbSettings -> Maybe AuthTypeValue
$sel:authSource:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:authMechanism:MongoDbSettings' :: MongoDbSettings -> Maybe AuthMechanismValue
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthMechanismValue
authMechanism
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
authSource
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AuthTypeValue
authType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
databaseName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
docsToInvestigate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
extractDocId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NestingLevelValue
nestingLevel
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
password
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
port
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
secretsManagerAccessRoleArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
secretsManagerSecretId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serverName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
username

instance Data.ToJSON MongoDbSettings where
  toJSON :: MongoDbSettings -> Value
toJSON MongoDbSettings' {Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe AuthMechanismValue
Maybe AuthTypeValue
Maybe NestingLevelValue
username :: Maybe Text
serverName :: Maybe Text
secretsManagerSecretId :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
port :: Maybe Int
password :: Maybe (Sensitive Text)
nestingLevel :: Maybe NestingLevelValue
kmsKeyId :: Maybe Text
extractDocId :: Maybe Text
docsToInvestigate :: Maybe Text
databaseName :: Maybe Text
authType :: Maybe AuthTypeValue
authSource :: Maybe Text
authMechanism :: Maybe AuthMechanismValue
$sel:username:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:serverName:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:secretsManagerSecretId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:port:MongoDbSettings' :: MongoDbSettings -> Maybe Int
$sel:password:MongoDbSettings' :: MongoDbSettings -> Maybe (Sensitive Text)
$sel:nestingLevel:MongoDbSettings' :: MongoDbSettings -> Maybe NestingLevelValue
$sel:kmsKeyId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:extractDocId:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:docsToInvestigate:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:databaseName:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:authType:MongoDbSettings' :: MongoDbSettings -> Maybe AuthTypeValue
$sel:authSource:MongoDbSettings' :: MongoDbSettings -> Maybe Text
$sel:authMechanism:MongoDbSettings' :: MongoDbSettings -> Maybe AuthMechanismValue
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AuthMechanism" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AuthMechanismValue
authMechanism,
            (Key
"AuthSource" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
authSource,
            (Key
"AuthType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AuthTypeValue
authType,
            (Key
"DatabaseName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
databaseName,
            (Key
"DocsToInvestigate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
docsToInvestigate,
            (Key
"ExtractDocId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
extractDocId,
            (Key
"KmsKeyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
            (Key
"NestingLevel" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NestingLevelValue
nestingLevel,
            (Key
"Password" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Text)
password,
            (Key
"Port" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
port,
            (Key
"SecretsManagerAccessRoleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
secretsManagerAccessRoleArn,
            (Key
"SecretsManagerSecretId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
secretsManagerSecretId,
            (Key
"ServerName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
serverName,
            (Key
"Username" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
username
          ]
      )