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

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

-- | Provides information that defines a MySQL endpoint.
--
-- /See:/ 'newMySQLSettings' smart constructor.
data MySQLSettings = MySQLSettings'
  { -- | Specifies a script to run immediately after DMS connects to the
    -- endpoint. The migration task continues running regardless if the SQL
    -- statement succeeds or fails.
    --
    -- For this parameter, provide the code of the script itself, not the name
    -- of a file containing the script.
    MySQLSettings -> Maybe Text
afterConnectScript :: Prelude.Maybe Prelude.Text,
    -- | Adjusts the behavior of DMS when migrating from an SQL Server source
    -- database that is hosted as part of an Always On availability group
    -- cluster. If you need DMS to poll all the nodes in the Always On cluster
    -- for transaction backups, set this attribute to @false@.
    MySQLSettings -> Maybe Bool
cleanSourceMetadataOnMismatch :: Prelude.Maybe Prelude.Bool,
    -- | Database name for the endpoint. For a MySQL source or target endpoint,
    -- don\'t explicitly specify the database using the @DatabaseName@ request
    -- parameter on either the @CreateEndpoint@ or @ModifyEndpoint@ API call.
    -- Specifying @DatabaseName@ when you create or modify a MySQL endpoint
    -- replicates all the task tables to this single database. For MySQL
    -- endpoints, you specify the database only when you specify the schema in
    -- the table-mapping rules of the DMS task.
    MySQLSettings -> Maybe Text
databaseName :: Prelude.Maybe Prelude.Text,
    -- | Specifies how often to check the binary log for new changes\/events when
    -- the database is idle. The default is five seconds.
    --
    -- Example: @eventsPollInterval=5;@
    --
    -- In the example, DMS checks for changes in the binary logs every five
    -- seconds.
    MySQLSettings -> Maybe Int
eventsPollInterval :: Prelude.Maybe Prelude.Int,
    -- | Specifies the maximum size (in KB) of any .csv file used to transfer
    -- data to a MySQL-compatible database.
    --
    -- Example: @maxFileSize=512@
    MySQLSettings -> Maybe Int
maxFileSize :: Prelude.Maybe Prelude.Int,
    -- | Improves performance when loading data into the MySQL-compatible target
    -- database. Specifies how many threads to use to load the data into the
    -- MySQL-compatible target database. Setting a large number of threads can
    -- have an adverse effect on database performance, because a separate
    -- connection is required for each thread. The default is one.
    --
    -- Example: @parallelLoadThreads=1@
    MySQLSettings -> Maybe Int
parallelLoadThreads :: Prelude.Maybe Prelude.Int,
    -- | Endpoint connection password.
    MySQLSettings -> Maybe (Sensitive Text)
password :: Prelude.Maybe (Data.Sensitive Prelude.Text),
    -- | Endpoint TCP port.
    MySQLSettings -> 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 MySQL 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/.
    MySQLSettings -> Maybe Text
secretsManagerAccessRoleArn :: Prelude.Maybe Prelude.Text,
    -- | The full ARN, partial ARN, or friendly name of the
    -- @SecretsManagerSecret@ that contains the MySQL endpoint connection
    -- details.
    MySQLSettings -> Maybe Text
secretsManagerSecretId :: Prelude.Maybe Prelude.Text,
    -- | Fully qualified domain name of the endpoint.
    MySQLSettings -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text,
    -- | Specifies the time zone for the source MySQL database.
    --
    -- Example: @serverTimezone=US\/Pacific;@
    --
    -- Note: Do not enclose time zones in single quotes.
    MySQLSettings -> Maybe Text
serverTimezone :: Prelude.Maybe Prelude.Text,
    -- | Specifies where to migrate source tables on the target, either to a
    -- single database or multiple databases. If you specify
    -- @SPECIFIC_DATABASE@, specify the database name using the @DatabaseName@
    -- parameter of the @Endpoint@ object.
    --
    -- Example: @targetDbType=MULTIPLE_DATABASES@
    MySQLSettings -> Maybe TargetDbType
targetDbType :: Prelude.Maybe TargetDbType,
    -- | Endpoint connection user name.
    MySQLSettings -> Maybe Text
username :: Prelude.Maybe Prelude.Text
  }
  deriving (MySQLSettings -> MySQLSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MySQLSettings -> MySQLSettings -> Bool
$c/= :: MySQLSettings -> MySQLSettings -> Bool
== :: MySQLSettings -> MySQLSettings -> Bool
$c== :: MySQLSettings -> MySQLSettings -> Bool
Prelude.Eq, Int -> MySQLSettings -> ShowS
[MySQLSettings] -> ShowS
MySQLSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MySQLSettings] -> ShowS
$cshowList :: [MySQLSettings] -> ShowS
show :: MySQLSettings -> String
$cshow :: MySQLSettings -> String
showsPrec :: Int -> MySQLSettings -> ShowS
$cshowsPrec :: Int -> MySQLSettings -> ShowS
Prelude.Show, forall x. Rep MySQLSettings x -> MySQLSettings
forall x. MySQLSettings -> Rep MySQLSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MySQLSettings x -> MySQLSettings
$cfrom :: forall x. MySQLSettings -> Rep MySQLSettings x
Prelude.Generic)

-- |
-- Create a value of 'MySQLSettings' 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:
--
-- 'afterConnectScript', 'mySQLSettings_afterConnectScript' - Specifies a script to run immediately after DMS connects to the
-- endpoint. The migration task continues running regardless if the SQL
-- statement succeeds or fails.
--
-- For this parameter, provide the code of the script itself, not the name
-- of a file containing the script.
--
-- 'cleanSourceMetadataOnMismatch', 'mySQLSettings_cleanSourceMetadataOnMismatch' - Adjusts the behavior of DMS when migrating from an SQL Server source
-- database that is hosted as part of an Always On availability group
-- cluster. If you need DMS to poll all the nodes in the Always On cluster
-- for transaction backups, set this attribute to @false@.
--
-- 'databaseName', 'mySQLSettings_databaseName' - Database name for the endpoint. For a MySQL source or target endpoint,
-- don\'t explicitly specify the database using the @DatabaseName@ request
-- parameter on either the @CreateEndpoint@ or @ModifyEndpoint@ API call.
-- Specifying @DatabaseName@ when you create or modify a MySQL endpoint
-- replicates all the task tables to this single database. For MySQL
-- endpoints, you specify the database only when you specify the schema in
-- the table-mapping rules of the DMS task.
--
-- 'eventsPollInterval', 'mySQLSettings_eventsPollInterval' - Specifies how often to check the binary log for new changes\/events when
-- the database is idle. The default is five seconds.
--
-- Example: @eventsPollInterval=5;@
--
-- In the example, DMS checks for changes in the binary logs every five
-- seconds.
--
-- 'maxFileSize', 'mySQLSettings_maxFileSize' - Specifies the maximum size (in KB) of any .csv file used to transfer
-- data to a MySQL-compatible database.
--
-- Example: @maxFileSize=512@
--
-- 'parallelLoadThreads', 'mySQLSettings_parallelLoadThreads' - Improves performance when loading data into the MySQL-compatible target
-- database. Specifies how many threads to use to load the data into the
-- MySQL-compatible target database. Setting a large number of threads can
-- have an adverse effect on database performance, because a separate
-- connection is required for each thread. The default is one.
--
-- Example: @parallelLoadThreads=1@
--
-- 'password', 'mySQLSettings_password' - Endpoint connection password.
--
-- 'port', 'mySQLSettings_port' - Endpoint TCP port.
--
-- 'secretsManagerAccessRoleArn', 'mySQLSettings_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 MySQL 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', 'mySQLSettings_secretsManagerSecretId' - The full ARN, partial ARN, or friendly name of the
-- @SecretsManagerSecret@ that contains the MySQL endpoint connection
-- details.
--
-- 'serverName', 'mySQLSettings_serverName' - Fully qualified domain name of the endpoint.
--
-- 'serverTimezone', 'mySQLSettings_serverTimezone' - Specifies the time zone for the source MySQL database.
--
-- Example: @serverTimezone=US\/Pacific;@
--
-- Note: Do not enclose time zones in single quotes.
--
-- 'targetDbType', 'mySQLSettings_targetDbType' - Specifies where to migrate source tables on the target, either to a
-- single database or multiple databases. If you specify
-- @SPECIFIC_DATABASE@, specify the database name using the @DatabaseName@
-- parameter of the @Endpoint@ object.
--
-- Example: @targetDbType=MULTIPLE_DATABASES@
--
-- 'username', 'mySQLSettings_username' - Endpoint connection user name.
newMySQLSettings ::
  MySQLSettings
newMySQLSettings :: MySQLSettings
newMySQLSettings =
  MySQLSettings'
    { $sel:afterConnectScript:MySQLSettings' :: Maybe Text
afterConnectScript =
        forall a. Maybe a
Prelude.Nothing,
      $sel:cleanSourceMetadataOnMismatch:MySQLSettings' :: Maybe Bool
cleanSourceMetadataOnMismatch = forall a. Maybe a
Prelude.Nothing,
      $sel:databaseName:MySQLSettings' :: Maybe Text
databaseName = forall a. Maybe a
Prelude.Nothing,
      $sel:eventsPollInterval:MySQLSettings' :: Maybe Int
eventsPollInterval = forall a. Maybe a
Prelude.Nothing,
      $sel:maxFileSize:MySQLSettings' :: Maybe Int
maxFileSize = forall a. Maybe a
Prelude.Nothing,
      $sel:parallelLoadThreads:MySQLSettings' :: Maybe Int
parallelLoadThreads = forall a. Maybe a
Prelude.Nothing,
      $sel:password:MySQLSettings' :: Maybe (Sensitive Text)
password = forall a. Maybe a
Prelude.Nothing,
      $sel:port:MySQLSettings' :: Maybe Int
port = forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerAccessRoleArn:MySQLSettings' :: Maybe Text
secretsManagerAccessRoleArn = forall a. Maybe a
Prelude.Nothing,
      $sel:secretsManagerSecretId:MySQLSettings' :: Maybe Text
secretsManagerSecretId = forall a. Maybe a
Prelude.Nothing,
      $sel:serverName:MySQLSettings' :: Maybe Text
serverName = forall a. Maybe a
Prelude.Nothing,
      $sel:serverTimezone:MySQLSettings' :: Maybe Text
serverTimezone = forall a. Maybe a
Prelude.Nothing,
      $sel:targetDbType:MySQLSettings' :: Maybe TargetDbType
targetDbType = forall a. Maybe a
Prelude.Nothing,
      $sel:username:MySQLSettings' :: Maybe Text
username = forall a. Maybe a
Prelude.Nothing
    }

-- | Specifies a script to run immediately after DMS connects to the
-- endpoint. The migration task continues running regardless if the SQL
-- statement succeeds or fails.
--
-- For this parameter, provide the code of the script itself, not the name
-- of a file containing the script.
mySQLSettings_afterConnectScript :: Lens.Lens' MySQLSettings (Prelude.Maybe Prelude.Text)
mySQLSettings_afterConnectScript :: Lens' MySQLSettings (Maybe Text)
mySQLSettings_afterConnectScript = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLSettings' {Maybe Text
afterConnectScript :: Maybe Text
$sel:afterConnectScript:MySQLSettings' :: MySQLSettings -> Maybe Text
afterConnectScript} -> Maybe Text
afterConnectScript) (\s :: MySQLSettings
s@MySQLSettings' {} Maybe Text
a -> MySQLSettings
s {$sel:afterConnectScript:MySQLSettings' :: Maybe Text
afterConnectScript = Maybe Text
a} :: MySQLSettings)

-- | Adjusts the behavior of DMS when migrating from an SQL Server source
-- database that is hosted as part of an Always On availability group
-- cluster. If you need DMS to poll all the nodes in the Always On cluster
-- for transaction backups, set this attribute to @false@.
mySQLSettings_cleanSourceMetadataOnMismatch :: Lens.Lens' MySQLSettings (Prelude.Maybe Prelude.Bool)
mySQLSettings_cleanSourceMetadataOnMismatch :: Lens' MySQLSettings (Maybe Bool)
mySQLSettings_cleanSourceMetadataOnMismatch = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLSettings' {Maybe Bool
cleanSourceMetadataOnMismatch :: Maybe Bool
$sel:cleanSourceMetadataOnMismatch:MySQLSettings' :: MySQLSettings -> Maybe Bool
cleanSourceMetadataOnMismatch} -> Maybe Bool
cleanSourceMetadataOnMismatch) (\s :: MySQLSettings
s@MySQLSettings' {} Maybe Bool
a -> MySQLSettings
s {$sel:cleanSourceMetadataOnMismatch:MySQLSettings' :: Maybe Bool
cleanSourceMetadataOnMismatch = Maybe Bool
a} :: MySQLSettings)

-- | Database name for the endpoint. For a MySQL source or target endpoint,
-- don\'t explicitly specify the database using the @DatabaseName@ request
-- parameter on either the @CreateEndpoint@ or @ModifyEndpoint@ API call.
-- Specifying @DatabaseName@ when you create or modify a MySQL endpoint
-- replicates all the task tables to this single database. For MySQL
-- endpoints, you specify the database only when you specify the schema in
-- the table-mapping rules of the DMS task.
mySQLSettings_databaseName :: Lens.Lens' MySQLSettings (Prelude.Maybe Prelude.Text)
mySQLSettings_databaseName :: Lens' MySQLSettings (Maybe Text)
mySQLSettings_databaseName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLSettings' {Maybe Text
databaseName :: Maybe Text
$sel:databaseName:MySQLSettings' :: MySQLSettings -> Maybe Text
databaseName} -> Maybe Text
databaseName) (\s :: MySQLSettings
s@MySQLSettings' {} Maybe Text
a -> MySQLSettings
s {$sel:databaseName:MySQLSettings' :: Maybe Text
databaseName = Maybe Text
a} :: MySQLSettings)

-- | Specifies how often to check the binary log for new changes\/events when
-- the database is idle. The default is five seconds.
--
-- Example: @eventsPollInterval=5;@
--
-- In the example, DMS checks for changes in the binary logs every five
-- seconds.
mySQLSettings_eventsPollInterval :: Lens.Lens' MySQLSettings (Prelude.Maybe Prelude.Int)
mySQLSettings_eventsPollInterval :: Lens' MySQLSettings (Maybe Int)
mySQLSettings_eventsPollInterval = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLSettings' {Maybe Int
eventsPollInterval :: Maybe Int
$sel:eventsPollInterval:MySQLSettings' :: MySQLSettings -> Maybe Int
eventsPollInterval} -> Maybe Int
eventsPollInterval) (\s :: MySQLSettings
s@MySQLSettings' {} Maybe Int
a -> MySQLSettings
s {$sel:eventsPollInterval:MySQLSettings' :: Maybe Int
eventsPollInterval = Maybe Int
a} :: MySQLSettings)

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

-- | Improves performance when loading data into the MySQL-compatible target
-- database. Specifies how many threads to use to load the data into the
-- MySQL-compatible target database. Setting a large number of threads can
-- have an adverse effect on database performance, because a separate
-- connection is required for each thread. The default is one.
--
-- Example: @parallelLoadThreads=1@
mySQLSettings_parallelLoadThreads :: Lens.Lens' MySQLSettings (Prelude.Maybe Prelude.Int)
mySQLSettings_parallelLoadThreads :: Lens' MySQLSettings (Maybe Int)
mySQLSettings_parallelLoadThreads = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLSettings' {Maybe Int
parallelLoadThreads :: Maybe Int
$sel:parallelLoadThreads:MySQLSettings' :: MySQLSettings -> Maybe Int
parallelLoadThreads} -> Maybe Int
parallelLoadThreads) (\s :: MySQLSettings
s@MySQLSettings' {} Maybe Int
a -> MySQLSettings
s {$sel:parallelLoadThreads:MySQLSettings' :: Maybe Int
parallelLoadThreads = Maybe Int
a} :: MySQLSettings)

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

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

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

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

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

-- | Specifies the time zone for the source MySQL database.
--
-- Example: @serverTimezone=US\/Pacific;@
--
-- Note: Do not enclose time zones in single quotes.
mySQLSettings_serverTimezone :: Lens.Lens' MySQLSettings (Prelude.Maybe Prelude.Text)
mySQLSettings_serverTimezone :: Lens' MySQLSettings (Maybe Text)
mySQLSettings_serverTimezone = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLSettings' {Maybe Text
serverTimezone :: Maybe Text
$sel:serverTimezone:MySQLSettings' :: MySQLSettings -> Maybe Text
serverTimezone} -> Maybe Text
serverTimezone) (\s :: MySQLSettings
s@MySQLSettings' {} Maybe Text
a -> MySQLSettings
s {$sel:serverTimezone:MySQLSettings' :: Maybe Text
serverTimezone = Maybe Text
a} :: MySQLSettings)

-- | Specifies where to migrate source tables on the target, either to a
-- single database or multiple databases. If you specify
-- @SPECIFIC_DATABASE@, specify the database name using the @DatabaseName@
-- parameter of the @Endpoint@ object.
--
-- Example: @targetDbType=MULTIPLE_DATABASES@
mySQLSettings_targetDbType :: Lens.Lens' MySQLSettings (Prelude.Maybe TargetDbType)
mySQLSettings_targetDbType :: Lens' MySQLSettings (Maybe TargetDbType)
mySQLSettings_targetDbType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MySQLSettings' {Maybe TargetDbType
targetDbType :: Maybe TargetDbType
$sel:targetDbType:MySQLSettings' :: MySQLSettings -> Maybe TargetDbType
targetDbType} -> Maybe TargetDbType
targetDbType) (\s :: MySQLSettings
s@MySQLSettings' {} Maybe TargetDbType
a -> MySQLSettings
s {$sel:targetDbType:MySQLSettings' :: Maybe TargetDbType
targetDbType = Maybe TargetDbType
a} :: MySQLSettings)

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

instance Data.FromJSON MySQLSettings where
  parseJSON :: Value -> Parser MySQLSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MySQLSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe (Sensitive Text)
-> Maybe Int
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe TargetDbType
-> Maybe Text
-> MySQLSettings
MySQLSettings'
            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
"AfterConnectScript")
            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
"CleanSourceMetadataOnMismatch")
            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
"EventsPollInterval")
            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
"MaxFileSize")
            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
"ParallelLoadThreads")
            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
"ServerTimezone")
            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
"TargetDbType")
            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 MySQLSettings where
  hashWithSalt :: Int -> MySQLSettings -> Int
hashWithSalt Int
_salt MySQLSettings' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe TargetDbType
username :: Maybe Text
targetDbType :: Maybe TargetDbType
serverTimezone :: Maybe Text
serverName :: Maybe Text
secretsManagerSecretId :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
port :: Maybe Int
password :: Maybe (Sensitive Text)
parallelLoadThreads :: Maybe Int
maxFileSize :: Maybe Int
eventsPollInterval :: Maybe Int
databaseName :: Maybe Text
cleanSourceMetadataOnMismatch :: Maybe Bool
afterConnectScript :: Maybe Text
$sel:username:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:targetDbType:MySQLSettings' :: MySQLSettings -> Maybe TargetDbType
$sel:serverTimezone:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:serverName:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:secretsManagerSecretId:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:port:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:password:MySQLSettings' :: MySQLSettings -> Maybe (Sensitive Text)
$sel:parallelLoadThreads:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:maxFileSize:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:eventsPollInterval:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:databaseName:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:cleanSourceMetadataOnMismatch:MySQLSettings' :: MySQLSettings -> Maybe Bool
$sel:afterConnectScript:MySQLSettings' :: MySQLSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
afterConnectScript
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
cleanSourceMetadataOnMismatch
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
databaseName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
eventsPollInterval
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxFileSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
parallelLoadThreads
      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
serverTimezone
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe TargetDbType
targetDbType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
username

instance Prelude.NFData MySQLSettings where
  rnf :: MySQLSettings -> ()
rnf MySQLSettings' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe TargetDbType
username :: Maybe Text
targetDbType :: Maybe TargetDbType
serverTimezone :: Maybe Text
serverName :: Maybe Text
secretsManagerSecretId :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
port :: Maybe Int
password :: Maybe (Sensitive Text)
parallelLoadThreads :: Maybe Int
maxFileSize :: Maybe Int
eventsPollInterval :: Maybe Int
databaseName :: Maybe Text
cleanSourceMetadataOnMismatch :: Maybe Bool
afterConnectScript :: Maybe Text
$sel:username:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:targetDbType:MySQLSettings' :: MySQLSettings -> Maybe TargetDbType
$sel:serverTimezone:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:serverName:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:secretsManagerSecretId:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:port:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:password:MySQLSettings' :: MySQLSettings -> Maybe (Sensitive Text)
$sel:parallelLoadThreads:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:maxFileSize:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:eventsPollInterval:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:databaseName:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:cleanSourceMetadataOnMismatch:MySQLSettings' :: MySQLSettings -> Maybe Bool
$sel:afterConnectScript:MySQLSettings' :: MySQLSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
afterConnectScript
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
cleanSourceMetadataOnMismatch
      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 Int
eventsPollInterval
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxFileSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
parallelLoadThreads
      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
serverTimezone
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe TargetDbType
targetDbType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
username

instance Data.ToJSON MySQLSettings where
  toJSON :: MySQLSettings -> Value
toJSON MySQLSettings' {Maybe Bool
Maybe Int
Maybe Text
Maybe (Sensitive Text)
Maybe TargetDbType
username :: Maybe Text
targetDbType :: Maybe TargetDbType
serverTimezone :: Maybe Text
serverName :: Maybe Text
secretsManagerSecretId :: Maybe Text
secretsManagerAccessRoleArn :: Maybe Text
port :: Maybe Int
password :: Maybe (Sensitive Text)
parallelLoadThreads :: Maybe Int
maxFileSize :: Maybe Int
eventsPollInterval :: Maybe Int
databaseName :: Maybe Text
cleanSourceMetadataOnMismatch :: Maybe Bool
afterConnectScript :: Maybe Text
$sel:username:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:targetDbType:MySQLSettings' :: MySQLSettings -> Maybe TargetDbType
$sel:serverTimezone:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:serverName:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:secretsManagerSecretId:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:secretsManagerAccessRoleArn:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:port:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:password:MySQLSettings' :: MySQLSettings -> Maybe (Sensitive Text)
$sel:parallelLoadThreads:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:maxFileSize:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:eventsPollInterval:MySQLSettings' :: MySQLSettings -> Maybe Int
$sel:databaseName:MySQLSettings' :: MySQLSettings -> Maybe Text
$sel:cleanSourceMetadataOnMismatch:MySQLSettings' :: MySQLSettings -> Maybe Bool
$sel:afterConnectScript:MySQLSettings' :: MySQLSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AfterConnectScript" 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
afterConnectScript,
            (Key
"CleanSourceMetadataOnMismatch" 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
cleanSourceMetadataOnMismatch,
            (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
"EventsPollInterval" 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
eventsPollInterval,
            (Key
"MaxFileSize" 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
maxFileSize,
            (Key
"ParallelLoadThreads" 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
parallelLoadThreads,
            (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
"ServerTimezone" 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
serverTimezone,
            (Key
"TargetDbType" 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 TargetDbType
targetDbType,
            (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
          ]
      )