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

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

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

-- | The database name on the DocumentDB source endpoint.
docDbSettings_databaseName :: Lens.Lens' DocDbSettings (Prelude.Maybe Prelude.Text)
docDbSettings_databaseName :: Lens' DocDbSettings (Maybe Text)
docDbSettings_databaseName = 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 :: Lens' DocDbSettings (Maybe Int)
docDbSettings_docsToInvestigate = 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)

-- | 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 :: Lens' DocDbSettings (Maybe Bool)
docDbSettings_extractDocId = 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 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 :: Lens' DocDbSettings (Maybe Text)
docDbSettings_kmsKeyId = 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)

-- | 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 :: Lens' DocDbSettings (Maybe NestingLevelValue)
docDbSettings_nestingLevel = 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 password for the user account you use to access the DocumentDB
-- source endpoint.
docDbSettings_password :: Lens.Lens' DocDbSettings (Prelude.Maybe Prelude.Text)
docDbSettings_password :: Lens' DocDbSettings (Maybe Text)
docDbSettings_password = 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) 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 DocumentDB source endpoint.
docDbSettings_port :: Lens.Lens' DocDbSettings (Prelude.Maybe Prelude.Int)
docDbSettings_port :: Lens' DocDbSettings (Maybe Int)
docDbSettings_port = 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)

-- | 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 :: Lens' DocDbSettings (Maybe Text)
docDbSettings_secretsManagerAccessRoleArn = 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 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 :: Lens' DocDbSettings (Maybe Text)
docDbSettings_secretsManagerSecretId = 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)

-- | The name of the server on the DocumentDB source endpoint.
docDbSettings_serverName :: Lens.Lens' DocDbSettings (Prelude.Maybe Prelude.Text)
docDbSettings_serverName :: Lens' DocDbSettings (Maybe Text)
docDbSettings_serverName = 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 user name you use to access the DocumentDB source endpoint.
docDbSettings_username :: Lens.Lens' DocDbSettings (Prelude.Maybe Prelude.Text)
docDbSettings_username :: Lens' DocDbSettings (Maybe Text)
docDbSettings_username = 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)

instance Data.FromJSON DocDbSettings where
  parseJSON :: Value -> Parser DocDbSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"DocDbSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Int
-> Maybe Bool
-> Maybe Text
-> Maybe NestingLevelValue
-> Maybe (Sensitive Text)
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> DocDbSettings
DocDbSettings'
            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
"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 DocDbSettings where
  hashWithSalt :: Int -> DocDbSettings -> Int
hashWithSalt Int
_salt DocDbSettings' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive Text)
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 Bool
docsToInvestigate :: Maybe Int
databaseName :: Maybe Text
$sel:username:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:serverName:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:secretsManagerSecretId:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:port:DocDbSettings' :: DocDbSettings -> Maybe Int
$sel:password:DocDbSettings' :: DocDbSettings -> Maybe (Sensitive Text)
$sel:nestingLevel:DocDbSettings' :: DocDbSettings -> Maybe NestingLevelValue
$sel:kmsKeyId:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:extractDocId:DocDbSettings' :: DocDbSettings -> Maybe Bool
$sel:docsToInvestigate:DocDbSettings' :: DocDbSettings -> Maybe Int
$sel:databaseName:DocDbSettings' :: DocDbSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
docsToInvestigate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
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 DocDbSettings where
  rnf :: DocDbSettings -> ()
rnf DocDbSettings' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive Text)
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 Bool
docsToInvestigate :: Maybe Int
databaseName :: Maybe Text
$sel:username:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:serverName:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:secretsManagerSecretId:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:port:DocDbSettings' :: DocDbSettings -> Maybe Int
$sel:password:DocDbSettings' :: DocDbSettings -> Maybe (Sensitive Text)
$sel:nestingLevel:DocDbSettings' :: DocDbSettings -> Maybe NestingLevelValue
$sel:kmsKeyId:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:extractDocId:DocDbSettings' :: DocDbSettings -> Maybe Bool
$sel:docsToInvestigate:DocDbSettings' :: DocDbSettings -> Maybe Int
$sel:databaseName:DocDbSettings' :: DocDbSettings -> Maybe Text
..} =
    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 Int
docsToInvestigate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
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 DocDbSettings where
  toJSON :: DocDbSettings -> Value
toJSON DocDbSettings' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive Text)
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 Bool
docsToInvestigate :: Maybe Int
databaseName :: Maybe Text
$sel:username:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:serverName:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:secretsManagerSecretId:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:port:DocDbSettings' :: DocDbSettings -> Maybe Int
$sel:password:DocDbSettings' :: DocDbSettings -> Maybe (Sensitive Text)
$sel:nestingLevel:DocDbSettings' :: DocDbSettings -> Maybe NestingLevelValue
$sel:kmsKeyId:DocDbSettings' :: DocDbSettings -> Maybe Text
$sel:extractDocId:DocDbSettings' :: DocDbSettings -> Maybe Bool
$sel:docsToInvestigate:DocDbSettings' :: DocDbSettings -> Maybe Int
$sel:databaseName:DocDbSettings' :: DocDbSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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 Int
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 Bool
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
          ]
      )