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

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

-- | Provides information that defines a DocumentDB endpoint.
--
-- /See:/ 'newDocDbSettings' smart constructor.
data DocDbSettings = DocDbSettings'
  { -- | The name of the server on the DocumentDB source endpoint.
    DocDbSettings -> Maybe Text
serverName :: 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 DocumentDB 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/.
    DocDbSettings -> Maybe Text
secretsManagerAccessRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The user name you use to access the DocumentDB source endpoint.
    DocDbSettings -> Maybe Text
username :: 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.
    DocDbSettings -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The password for the user account you use to access the DocumentDB
    -- source endpoint.
    DocDbSettings -> Maybe (Sensitive Text)
password :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | Specifies either document or table mode.
    --
    -- Default value is @\"none\"@. Specify @\"none\"@ to use document mode.
    -- Specify @\"one\"@ to use table mode.
    DocDbSettings -> Maybe NestingLevelValue
nestingLevel :: Prelude.Maybe NestingLevelValue,
    -- | The database name on the DocumentDB source endpoint.
    DocDbSettings -> 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@.
    DocDbSettings -> Maybe Int
docsToInvestigate :: Prelude.Maybe Prelude.Int,
    -- | The full ARN, partial ARN, or friendly name of the
    -- @SecretsManagerSecret@ that contains the DocumentDB endpoint connection
    -- details.
    DocDbSettings -> Maybe Text
secretsManagerSecretId :: Prelude.Maybe Prelude.Text,
    -- | Specifies the document ID. Use this setting when @NestingLevel@ is set
    -- to @\"none\"@.
    --
    -- Default value is @\"false\"@.
    DocDbSettings -> Maybe Bool
extractDocId :: Prelude.Maybe Prelude.Bool,
    -- | The port value for the DocumentDB source endpoint.
    DocDbSettings -> Maybe Int
port :: Prelude.Maybe Prelude.Int
  }
  deriving (DocDbSettings -> DocDbSettings -> Bool
(DocDbSettings -> DocDbSettings -> Bool)
-> (DocDbSettings -> DocDbSettings -> Bool) -> Eq DocDbSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DocDbSettings -> DocDbSettings -> Bool
$c/= :: DocDbSettings -> DocDbSettings -> Bool
== :: DocDbSettings -> DocDbSettings -> Bool
$c== :: DocDbSettings -> DocDbSettings -> Bool
Prelude.Eq, Int -> DocDbSettings -> ShowS
[DocDbSettings] -> ShowS
DocDbSettings -> String
(Int -> DocDbSettings -> ShowS)
-> (DocDbSettings -> String)
-> ([DocDbSettings] -> ShowS)
-> Show DocDbSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DocDbSettings] -> ShowS
$cshowList :: [DocDbSettings] -> ShowS
show :: DocDbSettings -> String
$cshow :: DocDbSettings -> String
showsPrec :: Int -> DocDbSettings -> ShowS
$cshowsPrec :: Int -> DocDbSettings -> ShowS
Prelude.Show, (forall x. DocDbSettings -> Rep DocDbSettings x)
-> (forall x. Rep DocDbSettings x -> DocDbSettings)
-> Generic DocDbSettings
forall x. Rep DocDbSettings x -> DocDbSettings
forall x. DocDbSettings -> Rep DocDbSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DocDbSettings x -> DocDbSettings
$cfrom :: forall x. DocDbSettings -> Rep DocDbSettings x
Prelude.Generic)

-- |
-- Create a value of 'DocDbSettings' 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', 'docDbSettings_serverName' - The name of the server on the DocumentDB source endpoint.
--
-- 'secretsManagerAccessRoleArn', 'docDbSettings_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 DocumentDB 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', 'docDbSettings_username' - The user name you use to access the DocumentDB source endpoint.
--
-- 'kmsKeyId', 'docDbSettings_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.
--
-- 'password', 'docDbSettings_password' - The password for the user account you use to access the DocumentDB
-- source endpoint.
--
-- 'nestingLevel', 'docDbSettings_nestingLevel' - Specifies either document or table mode.
--
-- Default value is @\"none\"@. Specify @\"none\"@ to use document mode.
-- Specify @\"one\"@ to use table mode.
--
-- 'databaseName', 'docDbSettings_databaseName' - The database name on the DocumentDB source endpoint.
--
-- 'docsToInvestigate', 'docDbSettings_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@.
--
-- 'secretsManagerSecretId', 'docDbSettings_secretsManagerSecretId' - The full ARN, partial ARN, or friendly name of the
-- @SecretsManagerSecret@ that contains the DocumentDB endpoint connection
-- details.
--
-- 'extractDocId', 'docDbSettings_extractDocId' - Specifies the document ID. Use this setting when @NestingLevel@ is set
-- to @\"none\"@.
--
-- Default value is @\"false\"@.
--
-- 'port', 'docDbSettings_port' - The port value for the DocumentDB source endpoint.
newDocDbSettings ::
  DocDbSettings
newDocDbSettings :: DocDbSettings
newDocDbSettings =
  DocDbSettings' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe NestingLevelValue
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Int
-> DocDbSettings
DocDbSettings'
    { $sel:serverName:DocDbSettings' :: Maybe Text
serverName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerAccessRoleArn:DocDbSettings' :: Maybe Text
secretsManagerAccessRoleArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:username:DocDbSettings' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:DocDbSettings' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:password:DocDbSettings' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:nestingLevel:DocDbSettings' :: Maybe NestingLevelValue
nestingLevel = Maybe NestingLevelValue
forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:DocDbSettings' :: Maybe Text
databaseName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:docsToInvestigate:DocDbSettings' :: Maybe Int
docsToInvestigate = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerSecretId:DocDbSettings' :: Maybe Text
secretsManagerSecretId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:extractDocId:DocDbSettings' :: Maybe Bool
extractDocId = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:port:DocDbSettings' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

-- | 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.
docDbSettings_kmsKeyId :: Lens.Lens' DocDbSettings (Prelude.Maybe Prelude.Text)
docDbSettings_kmsKeyId :: (Maybe Text -> f (Maybe Text)) -> DocDbSettings -> f DocDbSettings
docDbSettings_kmsKeyId = (DocDbSettings -> Maybe Text)
-> (DocDbSettings -> Maybe Text -> DocDbSettings)
-> Lens DocDbSettings DocDbSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocDbSettings' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:DocDbSettings' :: DocDbSettings -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: DocDbSettings
s@DocDbSettings' {} Maybe Text
a -> DocDbSettings
s {$sel:kmsKeyId:DocDbSettings' :: Maybe Text
kmsKeyId = Maybe Text
a} :: DocDbSettings)

-- | The password for the user account you use to access the DocumentDB
-- source endpoint.
docDbSettings_password :: Lens.Lens' DocDbSettings (Prelude.Maybe Prelude.Text)
docDbSettings_password :: (Maybe Text -> f (Maybe Text)) -> DocDbSettings -> f DocDbSettings
docDbSettings_password = (DocDbSettings -> Maybe (Sensitive Text))
-> (DocDbSettings -> Maybe (Sensitive Text) -> DocDbSettings)
-> Lens
     DocDbSettings
     DocDbSettings
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocDbSettings' {Maybe (Sensitive Text)
password :: Maybe (Sensitive Text)
$sel:password:DocDbSettings' :: DocDbSettings -> Maybe (Sensitive Text)
password} -> Maybe (Sensitive Text)
password) (\s :: DocDbSettings
s@DocDbSettings' {} Maybe (Sensitive Text)
a -> DocDbSettings
s {$sel:password:DocDbSettings' :: Maybe (Sensitive Text)
password = Maybe (Sensitive Text)
a} :: DocDbSettings) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> DocDbSettings -> f DocDbSettings)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> DocDbSettings
-> f DocDbSettings
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

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

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

-- | 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@.
docDbSettings_docsToInvestigate :: Lens.Lens' DocDbSettings (Prelude.Maybe Prelude.Int)
docDbSettings_docsToInvestigate :: (Maybe Int -> f (Maybe Int)) -> DocDbSettings -> f DocDbSettings
docDbSettings_docsToInvestigate = (DocDbSettings -> Maybe Int)
-> (DocDbSettings -> Maybe Int -> DocDbSettings)
-> Lens DocDbSettings DocDbSettings (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DocDbSettings' {Maybe Int
docsToInvestigate :: Maybe Int
$sel:docsToInvestigate:DocDbSettings' :: DocDbSettings -> Maybe Int
docsToInvestigate} -> Maybe Int
docsToInvestigate) (\s :: DocDbSettings
s@DocDbSettings' {} Maybe Int
a -> DocDbSettings
s {$sel:docsToInvestigate:DocDbSettings' :: Maybe Int
docsToInvestigate = Maybe Int
a} :: DocDbSettings)

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

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

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

instance Core.FromJSON DocDbSettings where
  parseJSON :: Value -> Parser DocDbSettings
parseJSON =
    String
-> (Object -> Parser DocDbSettings)
-> Value
-> Parser DocDbSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DocDbSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe (Sensitive Text)
-> Maybe NestingLevelValue
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Bool
-> Maybe Int
-> DocDbSettings
DocDbSettings'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe (Sensitive Text)
 -> Maybe NestingLevelValue
 -> Maybe Text
 -> Maybe Int
 -> Maybe Text
 -> Maybe Bool
 -> Maybe Int
 -> DocDbSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe NestingLevelValue
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> DocDbSettings)
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 Text
   -> Maybe Text
   -> Maybe (Sensitive Text)
   -> Maybe NestingLevelValue
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> DocDbSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe NestingLevelValue
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> DocDbSettings)
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 Text
   -> Maybe (Sensitive Text)
   -> Maybe NestingLevelValue
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> DocDbSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (Sensitive Text)
      -> Maybe NestingLevelValue
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> DocDbSettings)
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 Text
   -> Maybe (Sensitive Text)
   -> Maybe NestingLevelValue
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> DocDbSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe (Sensitive Text)
      -> Maybe NestingLevelValue
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> DocDbSettings)
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
"KmsKeyId")
            Parser
  (Maybe (Sensitive Text)
   -> Maybe NestingLevelValue
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> DocDbSettings)
-> Parser (Maybe (Sensitive Text))
-> Parser
     (Maybe NestingLevelValue
      -> Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> DocDbSettings)
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 NestingLevelValue
   -> Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> DocDbSettings)
-> Parser (Maybe NestingLevelValue)
-> Parser
     (Maybe Text
      -> Maybe Int
      -> Maybe Text
      -> Maybe Bool
      -> Maybe Int
      -> DocDbSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NestingLevelValue)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NestingLevel")
            Parser
  (Maybe Text
   -> Maybe Int
   -> Maybe Text
   -> Maybe Bool
   -> Maybe Int
   -> DocDbSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Int
      -> Maybe Text -> Maybe Bool -> Maybe Int -> DocDbSettings)
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 Int
   -> Maybe Text -> Maybe Bool -> Maybe Int -> DocDbSettings)
-> Parser (Maybe Int)
-> Parser (Maybe Text -> Maybe Bool -> Maybe Int -> DocDbSettings)
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
"DocsToInvestigate")
            Parser (Maybe Text -> Maybe Bool -> Maybe Int -> DocDbSettings)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> Maybe Int -> DocDbSettings)
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 Int -> DocDbSettings)
-> Parser (Maybe Bool) -> Parser (Maybe Int -> DocDbSettings)
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
"ExtractDocId")
            Parser (Maybe Int -> DocDbSettings)
-> Parser (Maybe Int) -> Parser DocDbSettings
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 DocDbSettings

instance Prelude.NFData DocDbSettings

instance Core.ToJSON DocDbSettings where
  toJSON :: DocDbSettings -> Value
toJSON DocDbSettings' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe NestingLevelValue
port :: Maybe Int
extractDocId :: Maybe Bool
secretsManagerSecretId :: Maybe Text
docsToInvestigate :: Maybe Int
databaseName :: Maybe Text
nestingLevel :: Maybe NestingLevelValue
password :: Maybe (Sensitive Text)
kmsKeyId :: Maybe Text
username :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
serverName :: Maybe Text
$sel:port:DocDbSettings' :: DocDbSettings -> Maybe Int
$sel:extractDocId:DocDbSettings' :: DocDbSettings -> Maybe Bool
$sel:secretsManagerSecretId:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:docsToInvestigate:DocDbSettings' :: DocDbSettings -> Maybe Int
$sel:databaseName:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:nestingLevel:DocDbSettings' :: DocDbSettings -> Maybe NestingLevelValue
$sel:password:DocDbSettings' :: DocDbSettings -> Maybe (Sensitive Text)
$sel:kmsKeyId:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:username:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:serverName:DocDbSettings' :: DocDbSettings -> 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
"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
"KmsKeyId" 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
kmsKeyId,
            (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
"NestingLevel" Text -> NestingLevelValue -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NestingLevelValue -> Pair)
-> Maybe NestingLevelValue -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NestingLevelValue
nestingLevel,
            (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
"DocsToInvestigate" 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
docsToInvestigate,
            (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
"ExtractDocId" 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
extractDocId,
            (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
          ]
      )