{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.RDS.RestoreDBClusterToPointInTime
-- 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)
--
-- Restores a DB cluster to an arbitrary point in time. Users can restore
-- to any point in time before @LatestRestorableTime@ for up to
-- @BackupRetentionPeriod@ days. The target DB cluster is created from the
-- source DB cluster with the same configuration as the original DB
-- cluster, except that the new DB cluster is created with the default DB
-- security group.
--
-- This action only restores the DB cluster, not the DB instances for that
-- DB cluster. You must invoke the @CreateDBInstance@ action to create DB
-- instances for the restored DB cluster, specifying the identifier of the
-- restored DB cluster in @DBClusterIdentifier@. You can create DB
-- instances only after the @RestoreDBClusterToPointInTime@ action has
-- completed and the DB cluster is available.
--
-- For more information on Amazon Aurora, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html What Is Amazon Aurora?>
-- in the /Amazon Aurora User Guide./
--
-- This action only applies to Aurora DB clusters.
module Amazonka.RDS.RestoreDBClusterToPointInTime
  ( -- * Creating a Request
    RestoreDBClusterToPointInTime (..),
    newRestoreDBClusterToPointInTime,

    -- * Request Lenses
    restoreDBClusterToPointInTime_deletionProtection,
    restoreDBClusterToPointInTime_useLatestRestorableTime,
    restoreDBClusterToPointInTime_dbSubnetGroupName,
    restoreDBClusterToPointInTime_domain,
    restoreDBClusterToPointInTime_backtrackWindow,
    restoreDBClusterToPointInTime_kmsKeyId,
    restoreDBClusterToPointInTime_vpcSecurityGroupIds,
    restoreDBClusterToPointInTime_dbClusterParameterGroupName,
    restoreDBClusterToPointInTime_engineMode,
    restoreDBClusterToPointInTime_scalingConfiguration,
    restoreDBClusterToPointInTime_restoreType,
    restoreDBClusterToPointInTime_optionGroupName,
    restoreDBClusterToPointInTime_copyTagsToSnapshot,
    restoreDBClusterToPointInTime_restoreToTime,
    restoreDBClusterToPointInTime_domainIAMRoleName,
    restoreDBClusterToPointInTime_tags,
    restoreDBClusterToPointInTime_port,
    restoreDBClusterToPointInTime_enableIAMDatabaseAuthentication,
    restoreDBClusterToPointInTime_enableCloudwatchLogsExports,
    restoreDBClusterToPointInTime_dbClusterIdentifier,
    restoreDBClusterToPointInTime_sourceDBClusterIdentifier,

    -- * Destructuring the Response
    RestoreDBClusterToPointInTimeResponse (..),
    newRestoreDBClusterToPointInTimeResponse,

    -- * Response Lenses
    restoreDBClusterToPointInTimeResponse_dbCluster,
    restoreDBClusterToPointInTimeResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RDS.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- |
--
-- /See:/ 'newRestoreDBClusterToPointInTime' smart constructor.
data RestoreDBClusterToPointInTime = RestoreDBClusterToPointInTime'
  { -- | A value that indicates whether the DB cluster has deletion protection
    -- enabled. The database can\'t be deleted when deletion protection is
    -- enabled. By default, deletion protection is disabled.
    RestoreDBClusterToPointInTime -> Maybe Bool
deletionProtection :: Prelude.Maybe Prelude.Bool,
    -- | A value that indicates whether to restore the DB cluster to the latest
    -- restorable backup time. By default, the DB cluster isn\'t restored to
    -- the latest restorable backup time.
    --
    -- Constraints: Can\'t be specified if @RestoreToTime@ parameter is
    -- provided.
    RestoreDBClusterToPointInTime -> Maybe Bool
useLatestRestorableTime :: Prelude.Maybe Prelude.Bool,
    -- | The DB subnet group name to use for the new DB cluster.
    --
    -- Constraints: If supplied, must match the name of an existing
    -- DBSubnetGroup.
    --
    -- Example: @mySubnetgroup@
    RestoreDBClusterToPointInTime -> Maybe Text
dbSubnetGroupName :: Prelude.Maybe Prelude.Text,
    -- | Specify the Active Directory directory ID to restore the DB cluster in.
    -- The domain must be created prior to this operation.
    --
    -- For Amazon Aurora DB clusters, Amazon RDS can use Kerberos
    -- Authentication to authenticate users that connect to the DB cluster. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html Kerberos Authentication>
    -- in the /Amazon Aurora User Guide/.
    RestoreDBClusterToPointInTime -> Maybe Text
domain :: Prelude.Maybe Prelude.Text,
    -- | The target backtrack window, in seconds. To disable backtracking, set
    -- this value to 0.
    --
    -- Currently, Backtrack is only supported for Aurora MySQL DB clusters.
    --
    -- Default: 0
    --
    -- Constraints:
    --
    -- -   If specified, this value must be set to a number from 0 to 259,200
    --     (72 hours).
    RestoreDBClusterToPointInTime -> Maybe Integer
backtrackWindow :: Prelude.Maybe Prelude.Integer,
    -- | The Amazon Web Services KMS key identifier to use when restoring an
    -- encrypted DB cluster from an encrypted DB cluster.
    --
    -- The Amazon Web Services KMS key identifier is the key ARN, key ID, alias
    -- ARN, or alias name for the Amazon Web Services KMS customer master key
    -- (CMK). To use a CMK in a different Amazon Web Services account, specify
    -- the key ARN or alias ARN.
    --
    -- You can restore to a new DB cluster and encrypt the new DB cluster with
    -- a Amazon Web Services KMS CMK that is different than the Amazon Web
    -- Services KMS key used to encrypt the source DB cluster. The new DB
    -- cluster is encrypted with the Amazon Web Services KMS CMK identified by
    -- the @KmsKeyId@ parameter.
    --
    -- If you don\'t specify a value for the @KmsKeyId@ parameter, then the
    -- following occurs:
    --
    -- -   If the DB cluster is encrypted, then the restored DB cluster is
    --     encrypted using the Amazon Web Services KMS CMK that was used to
    --     encrypt the source DB cluster.
    --
    -- -   If the DB cluster isn\'t encrypted, then the restored DB cluster
    --     isn\'t encrypted.
    --
    -- If @DBClusterIdentifier@ refers to a DB cluster that isn\'t encrypted,
    -- then the restore request is rejected.
    RestoreDBClusterToPointInTime -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | A list of VPC security groups that the new DB cluster belongs to.
    RestoreDBClusterToPointInTime -> Maybe [Text]
vpcSecurityGroupIds :: Prelude.Maybe [Prelude.Text],
    -- | The name of the DB cluster parameter group to associate with this DB
    -- cluster. If this argument is omitted, the default DB cluster parameter
    -- group for the specified engine is used.
    --
    -- Constraints:
    --
    -- -   If supplied, must match the name of an existing DB cluster parameter
    --     group.
    --
    -- -   Must be 1 to 255 letters, numbers, or hyphens.
    --
    -- -   First character must be a letter.
    --
    -- -   Can\'t end with a hyphen or contain two consecutive hyphens.
    RestoreDBClusterToPointInTime -> Maybe Text
dbClusterParameterGroupName :: Prelude.Maybe Prelude.Text,
    -- | The engine mode of the new cluster. Specify @provisioned@ or
    -- @serverless@, depending on the type of the cluster you are creating. You
    -- can create an Aurora Serverless clone from a provisioned cluster, or a
    -- provisioned clone from an Aurora Serverless cluster. To create a clone
    -- that is an Aurora Serverless cluster, the original cluster must be an
    -- Aurora Serverless cluster or an encrypted provisioned cluster.
    RestoreDBClusterToPointInTime -> Maybe Text
engineMode :: Prelude.Maybe Prelude.Text,
    -- | For DB clusters in @serverless@ DB engine mode, the scaling properties
    -- of the DB cluster.
    RestoreDBClusterToPointInTime -> Maybe ScalingConfiguration
scalingConfiguration :: Prelude.Maybe ScalingConfiguration,
    -- | The type of restore to be performed. You can specify one of the
    -- following values:
    --
    -- -   @full-copy@ - The new DB cluster is restored as a full copy of the
    --     source DB cluster.
    --
    -- -   @copy-on-write@ - The new DB cluster is restored as a clone of the
    --     source DB cluster.
    --
    -- Constraints: You can\'t specify @copy-on-write@ if the engine version of
    -- the source DB cluster is earlier than 1.11.
    --
    -- If you don\'t specify a @RestoreType@ value, then the new DB cluster is
    -- restored as a full copy of the source DB cluster.
    RestoreDBClusterToPointInTime -> Maybe Text
restoreType :: Prelude.Maybe Prelude.Text,
    -- | The name of the option group for the new DB cluster.
    RestoreDBClusterToPointInTime -> Maybe Text
optionGroupName :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether to copy all tags from the restored DB
    -- cluster to snapshots of the restored DB cluster. The default is not to
    -- copy them.
    RestoreDBClusterToPointInTime -> Maybe Bool
copyTagsToSnapshot :: Prelude.Maybe Prelude.Bool,
    -- | The date and time to restore the DB cluster to.
    --
    -- Valid Values: Value must be a time in Universal Coordinated Time (UTC)
    -- format
    --
    -- Constraints:
    --
    -- -   Must be before the latest restorable time for the DB instance
    --
    -- -   Must be specified if @UseLatestRestorableTime@ parameter isn\'t
    --     provided
    --
    -- -   Can\'t be specified if the @UseLatestRestorableTime@ parameter is
    --     enabled
    --
    -- -   Can\'t be specified if the @RestoreType@ parameter is
    --     @copy-on-write@
    --
    -- Example: @2015-03-07T23:45:00Z@
    RestoreDBClusterToPointInTime -> Maybe ISO8601
restoreToTime :: Prelude.Maybe Core.ISO8601,
    -- | Specify the name of the IAM role to be used when making API calls to the
    -- Directory Service.
    RestoreDBClusterToPointInTime -> Maybe Text
domainIAMRoleName :: Prelude.Maybe Prelude.Text,
    RestoreDBClusterToPointInTime -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The port number on which the new DB cluster accepts connections.
    --
    -- Constraints: A value from @1150-65535@.
    --
    -- Default: The default port for the engine.
    RestoreDBClusterToPointInTime -> Maybe Int
port :: Prelude.Maybe Prelude.Int,
    -- | A value that indicates whether to enable mapping of Amazon Web Services
    -- Identity and Access Management (IAM) accounts to database accounts. By
    -- default, mapping is disabled.
    --
    -- For more information, see
    -- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html IAM Database Authentication>
    -- in the /Amazon Aurora User Guide./
    RestoreDBClusterToPointInTime -> Maybe Bool
enableIAMDatabaseAuthentication :: Prelude.Maybe Prelude.Bool,
    -- | The list of logs that the restored DB cluster is to export to CloudWatch
    -- Logs. The values in the list depend on the DB engine being used. For
    -- more information, see
    -- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch Publishing Database Logs to Amazon CloudWatch Logs>
    -- in the /Amazon Aurora User Guide/.
    RestoreDBClusterToPointInTime -> Maybe [Text]
enableCloudwatchLogsExports :: Prelude.Maybe [Prelude.Text],
    -- | The name of the new DB cluster to be created.
    --
    -- Constraints:
    --
    -- -   Must contain from 1 to 63 letters, numbers, or hyphens
    --
    -- -   First character must be a letter
    --
    -- -   Can\'t end with a hyphen or contain two consecutive hyphens
    RestoreDBClusterToPointInTime -> Text
dbClusterIdentifier :: Prelude.Text,
    -- | The identifier of the source DB cluster from which to restore.
    --
    -- Constraints:
    --
    -- -   Must match the identifier of an existing DBCluster.
    RestoreDBClusterToPointInTime -> Text
sourceDBClusterIdentifier :: Prelude.Text
  }
  deriving (RestoreDBClusterToPointInTime
-> RestoreDBClusterToPointInTime -> Bool
(RestoreDBClusterToPointInTime
 -> RestoreDBClusterToPointInTime -> Bool)
-> (RestoreDBClusterToPointInTime
    -> RestoreDBClusterToPointInTime -> Bool)
-> Eq RestoreDBClusterToPointInTime
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreDBClusterToPointInTime
-> RestoreDBClusterToPointInTime -> Bool
$c/= :: RestoreDBClusterToPointInTime
-> RestoreDBClusterToPointInTime -> Bool
== :: RestoreDBClusterToPointInTime
-> RestoreDBClusterToPointInTime -> Bool
$c== :: RestoreDBClusterToPointInTime
-> RestoreDBClusterToPointInTime -> Bool
Prelude.Eq, ReadPrec [RestoreDBClusterToPointInTime]
ReadPrec RestoreDBClusterToPointInTime
Int -> ReadS RestoreDBClusterToPointInTime
ReadS [RestoreDBClusterToPointInTime]
(Int -> ReadS RestoreDBClusterToPointInTime)
-> ReadS [RestoreDBClusterToPointInTime]
-> ReadPrec RestoreDBClusterToPointInTime
-> ReadPrec [RestoreDBClusterToPointInTime]
-> Read RestoreDBClusterToPointInTime
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreDBClusterToPointInTime]
$creadListPrec :: ReadPrec [RestoreDBClusterToPointInTime]
readPrec :: ReadPrec RestoreDBClusterToPointInTime
$creadPrec :: ReadPrec RestoreDBClusterToPointInTime
readList :: ReadS [RestoreDBClusterToPointInTime]
$creadList :: ReadS [RestoreDBClusterToPointInTime]
readsPrec :: Int -> ReadS RestoreDBClusterToPointInTime
$creadsPrec :: Int -> ReadS RestoreDBClusterToPointInTime
Prelude.Read, Int -> RestoreDBClusterToPointInTime -> ShowS
[RestoreDBClusterToPointInTime] -> ShowS
RestoreDBClusterToPointInTime -> String
(Int -> RestoreDBClusterToPointInTime -> ShowS)
-> (RestoreDBClusterToPointInTime -> String)
-> ([RestoreDBClusterToPointInTime] -> ShowS)
-> Show RestoreDBClusterToPointInTime
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreDBClusterToPointInTime] -> ShowS
$cshowList :: [RestoreDBClusterToPointInTime] -> ShowS
show :: RestoreDBClusterToPointInTime -> String
$cshow :: RestoreDBClusterToPointInTime -> String
showsPrec :: Int -> RestoreDBClusterToPointInTime -> ShowS
$cshowsPrec :: Int -> RestoreDBClusterToPointInTime -> ShowS
Prelude.Show, (forall x.
 RestoreDBClusterToPointInTime
 -> Rep RestoreDBClusterToPointInTime x)
-> (forall x.
    Rep RestoreDBClusterToPointInTime x
    -> RestoreDBClusterToPointInTime)
-> Generic RestoreDBClusterToPointInTime
forall x.
Rep RestoreDBClusterToPointInTime x
-> RestoreDBClusterToPointInTime
forall x.
RestoreDBClusterToPointInTime
-> Rep RestoreDBClusterToPointInTime x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RestoreDBClusterToPointInTime x
-> RestoreDBClusterToPointInTime
$cfrom :: forall x.
RestoreDBClusterToPointInTime
-> Rep RestoreDBClusterToPointInTime x
Prelude.Generic)

-- |
-- Create a value of 'RestoreDBClusterToPointInTime' 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:
--
-- 'deletionProtection', 'restoreDBClusterToPointInTime_deletionProtection' - A value that indicates whether the DB cluster has deletion protection
-- enabled. The database can\'t be deleted when deletion protection is
-- enabled. By default, deletion protection is disabled.
--
-- 'useLatestRestorableTime', 'restoreDBClusterToPointInTime_useLatestRestorableTime' - A value that indicates whether to restore the DB cluster to the latest
-- restorable backup time. By default, the DB cluster isn\'t restored to
-- the latest restorable backup time.
--
-- Constraints: Can\'t be specified if @RestoreToTime@ parameter is
-- provided.
--
-- 'dbSubnetGroupName', 'restoreDBClusterToPointInTime_dbSubnetGroupName' - The DB subnet group name to use for the new DB cluster.
--
-- Constraints: If supplied, must match the name of an existing
-- DBSubnetGroup.
--
-- Example: @mySubnetgroup@
--
-- 'domain', 'restoreDBClusterToPointInTime_domain' - Specify the Active Directory directory ID to restore the DB cluster in.
-- The domain must be created prior to this operation.
--
-- For Amazon Aurora DB clusters, Amazon RDS can use Kerberos
-- Authentication to authenticate users that connect to the DB cluster. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html Kerberos Authentication>
-- in the /Amazon Aurora User Guide/.
--
-- 'backtrackWindow', 'restoreDBClusterToPointInTime_backtrackWindow' - The target backtrack window, in seconds. To disable backtracking, set
-- this value to 0.
--
-- Currently, Backtrack is only supported for Aurora MySQL DB clusters.
--
-- Default: 0
--
-- Constraints:
--
-- -   If specified, this value must be set to a number from 0 to 259,200
--     (72 hours).
--
-- 'kmsKeyId', 'restoreDBClusterToPointInTime_kmsKeyId' - The Amazon Web Services KMS key identifier to use when restoring an
-- encrypted DB cluster from an encrypted DB cluster.
--
-- The Amazon Web Services KMS key identifier is the key ARN, key ID, alias
-- ARN, or alias name for the Amazon Web Services KMS customer master key
-- (CMK). To use a CMK in a different Amazon Web Services account, specify
-- the key ARN or alias ARN.
--
-- You can restore to a new DB cluster and encrypt the new DB cluster with
-- a Amazon Web Services KMS CMK that is different than the Amazon Web
-- Services KMS key used to encrypt the source DB cluster. The new DB
-- cluster is encrypted with the Amazon Web Services KMS CMK identified by
-- the @KmsKeyId@ parameter.
--
-- If you don\'t specify a value for the @KmsKeyId@ parameter, then the
-- following occurs:
--
-- -   If the DB cluster is encrypted, then the restored DB cluster is
--     encrypted using the Amazon Web Services KMS CMK that was used to
--     encrypt the source DB cluster.
--
-- -   If the DB cluster isn\'t encrypted, then the restored DB cluster
--     isn\'t encrypted.
--
-- If @DBClusterIdentifier@ refers to a DB cluster that isn\'t encrypted,
-- then the restore request is rejected.
--
-- 'vpcSecurityGroupIds', 'restoreDBClusterToPointInTime_vpcSecurityGroupIds' - A list of VPC security groups that the new DB cluster belongs to.
--
-- 'dbClusterParameterGroupName', 'restoreDBClusterToPointInTime_dbClusterParameterGroupName' - The name of the DB cluster parameter group to associate with this DB
-- cluster. If this argument is omitted, the default DB cluster parameter
-- group for the specified engine is used.
--
-- Constraints:
--
-- -   If supplied, must match the name of an existing DB cluster parameter
--     group.
--
-- -   Must be 1 to 255 letters, numbers, or hyphens.
--
-- -   First character must be a letter.
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens.
--
-- 'engineMode', 'restoreDBClusterToPointInTime_engineMode' - The engine mode of the new cluster. Specify @provisioned@ or
-- @serverless@, depending on the type of the cluster you are creating. You
-- can create an Aurora Serverless clone from a provisioned cluster, or a
-- provisioned clone from an Aurora Serverless cluster. To create a clone
-- that is an Aurora Serverless cluster, the original cluster must be an
-- Aurora Serverless cluster or an encrypted provisioned cluster.
--
-- 'scalingConfiguration', 'restoreDBClusterToPointInTime_scalingConfiguration' - For DB clusters in @serverless@ DB engine mode, the scaling properties
-- of the DB cluster.
--
-- 'restoreType', 'restoreDBClusterToPointInTime_restoreType' - The type of restore to be performed. You can specify one of the
-- following values:
--
-- -   @full-copy@ - The new DB cluster is restored as a full copy of the
--     source DB cluster.
--
-- -   @copy-on-write@ - The new DB cluster is restored as a clone of the
--     source DB cluster.
--
-- Constraints: You can\'t specify @copy-on-write@ if the engine version of
-- the source DB cluster is earlier than 1.11.
--
-- If you don\'t specify a @RestoreType@ value, then the new DB cluster is
-- restored as a full copy of the source DB cluster.
--
-- 'optionGroupName', 'restoreDBClusterToPointInTime_optionGroupName' - The name of the option group for the new DB cluster.
--
-- 'copyTagsToSnapshot', 'restoreDBClusterToPointInTime_copyTagsToSnapshot' - A value that indicates whether to copy all tags from the restored DB
-- cluster to snapshots of the restored DB cluster. The default is not to
-- copy them.
--
-- 'restoreToTime', 'restoreDBClusterToPointInTime_restoreToTime' - The date and time to restore the DB cluster to.
--
-- Valid Values: Value must be a time in Universal Coordinated Time (UTC)
-- format
--
-- Constraints:
--
-- -   Must be before the latest restorable time for the DB instance
--
-- -   Must be specified if @UseLatestRestorableTime@ parameter isn\'t
--     provided
--
-- -   Can\'t be specified if the @UseLatestRestorableTime@ parameter is
--     enabled
--
-- -   Can\'t be specified if the @RestoreType@ parameter is
--     @copy-on-write@
--
-- Example: @2015-03-07T23:45:00Z@
--
-- 'domainIAMRoleName', 'restoreDBClusterToPointInTime_domainIAMRoleName' - Specify the name of the IAM role to be used when making API calls to the
-- Directory Service.
--
-- 'tags', 'restoreDBClusterToPointInTime_tags' - Undocumented member.
--
-- 'port', 'restoreDBClusterToPointInTime_port' - The port number on which the new DB cluster accepts connections.
--
-- Constraints: A value from @1150-65535@.
--
-- Default: The default port for the engine.
--
-- 'enableIAMDatabaseAuthentication', 'restoreDBClusterToPointInTime_enableIAMDatabaseAuthentication' - A value that indicates whether to enable mapping of Amazon Web Services
-- Identity and Access Management (IAM) accounts to database accounts. By
-- default, mapping is disabled.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html IAM Database Authentication>
-- in the /Amazon Aurora User Guide./
--
-- 'enableCloudwatchLogsExports', 'restoreDBClusterToPointInTime_enableCloudwatchLogsExports' - The list of logs that the restored DB cluster is to export to CloudWatch
-- Logs. The values in the list depend on the DB engine being used. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch Publishing Database Logs to Amazon CloudWatch Logs>
-- in the /Amazon Aurora User Guide/.
--
-- 'dbClusterIdentifier', 'restoreDBClusterToPointInTime_dbClusterIdentifier' - The name of the new DB cluster to be created.
--
-- Constraints:
--
-- -   Must contain from 1 to 63 letters, numbers, or hyphens
--
-- -   First character must be a letter
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens
--
-- 'sourceDBClusterIdentifier', 'restoreDBClusterToPointInTime_sourceDBClusterIdentifier' - The identifier of the source DB cluster from which to restore.
--
-- Constraints:
--
-- -   Must match the identifier of an existing DBCluster.
newRestoreDBClusterToPointInTime ::
  -- | 'dbClusterIdentifier'
  Prelude.Text ->
  -- | 'sourceDBClusterIdentifier'
  Prelude.Text ->
  RestoreDBClusterToPointInTime
newRestoreDBClusterToPointInTime :: Text -> Text -> RestoreDBClusterToPointInTime
newRestoreDBClusterToPointInTime
  Text
pDBClusterIdentifier_
  Text
pSourceDBClusterIdentifier_ =
    RestoreDBClusterToPointInTime' :: Maybe Bool
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe ScalingConfiguration
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe ISO8601
-> Maybe Text
-> Maybe [Tag]
-> Maybe Int
-> Maybe Bool
-> Maybe [Text]
-> Text
-> Text
-> RestoreDBClusterToPointInTime
RestoreDBClusterToPointInTime'
      { $sel:deletionProtection:RestoreDBClusterToPointInTime' :: Maybe Bool
deletionProtection =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:useLatestRestorableTime:RestoreDBClusterToPointInTime' :: Maybe Bool
useLatestRestorableTime = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:dbSubnetGroupName:RestoreDBClusterToPointInTime' :: Maybe Text
dbSubnetGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:domain:RestoreDBClusterToPointInTime' :: Maybe Text
domain = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:backtrackWindow:RestoreDBClusterToPointInTime' :: Maybe Integer
backtrackWindow = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:RestoreDBClusterToPointInTime' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:vpcSecurityGroupIds:RestoreDBClusterToPointInTime' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:dbClusterParameterGroupName:RestoreDBClusterToPointInTime' :: Maybe Text
dbClusterParameterGroupName =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:engineMode:RestoreDBClusterToPointInTime' :: Maybe Text
engineMode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:scalingConfiguration:RestoreDBClusterToPointInTime' :: Maybe ScalingConfiguration
scalingConfiguration = Maybe ScalingConfiguration
forall a. Maybe a
Prelude.Nothing,
        $sel:restoreType:RestoreDBClusterToPointInTime' :: Maybe Text
restoreType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:optionGroupName:RestoreDBClusterToPointInTime' :: Maybe Text
optionGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:copyTagsToSnapshot:RestoreDBClusterToPointInTime' :: Maybe Bool
copyTagsToSnapshot = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:restoreToTime:RestoreDBClusterToPointInTime' :: Maybe ISO8601
restoreToTime = Maybe ISO8601
forall a. Maybe a
Prelude.Nothing,
        $sel:domainIAMRoleName:RestoreDBClusterToPointInTime' :: Maybe Text
domainIAMRoleName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:RestoreDBClusterToPointInTime' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:port:RestoreDBClusterToPointInTime' :: Maybe Int
port = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:enableIAMDatabaseAuthentication:RestoreDBClusterToPointInTime' :: Maybe Bool
enableIAMDatabaseAuthentication =
          Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:enableCloudwatchLogsExports:RestoreDBClusterToPointInTime' :: Maybe [Text]
enableCloudwatchLogsExports =
          Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
        $sel:dbClusterIdentifier:RestoreDBClusterToPointInTime' :: Text
dbClusterIdentifier = Text
pDBClusterIdentifier_,
        $sel:sourceDBClusterIdentifier:RestoreDBClusterToPointInTime' :: Text
sourceDBClusterIdentifier =
          Text
pSourceDBClusterIdentifier_
      }

-- | A value that indicates whether the DB cluster has deletion protection
-- enabled. The database can\'t be deleted when deletion protection is
-- enabled. By default, deletion protection is disabled.
restoreDBClusterToPointInTime_deletionProtection :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Bool)
restoreDBClusterToPointInTime_deletionProtection :: (Maybe Bool -> f (Maybe Bool))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_deletionProtection = (RestoreDBClusterToPointInTime -> Maybe Bool)
-> (RestoreDBClusterToPointInTime
    -> Maybe Bool -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Bool
deletionProtection :: Maybe Bool
$sel:deletionProtection:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Bool
deletionProtection} -> Maybe Bool
deletionProtection) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Bool
a -> RestoreDBClusterToPointInTime
s {$sel:deletionProtection:RestoreDBClusterToPointInTime' :: Maybe Bool
deletionProtection = Maybe Bool
a} :: RestoreDBClusterToPointInTime)

-- | A value that indicates whether to restore the DB cluster to the latest
-- restorable backup time. By default, the DB cluster isn\'t restored to
-- the latest restorable backup time.
--
-- Constraints: Can\'t be specified if @RestoreToTime@ parameter is
-- provided.
restoreDBClusterToPointInTime_useLatestRestorableTime :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Bool)
restoreDBClusterToPointInTime_useLatestRestorableTime :: (Maybe Bool -> f (Maybe Bool))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_useLatestRestorableTime = (RestoreDBClusterToPointInTime -> Maybe Bool)
-> (RestoreDBClusterToPointInTime
    -> Maybe Bool -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Bool
useLatestRestorableTime :: Maybe Bool
$sel:useLatestRestorableTime:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Bool
useLatestRestorableTime} -> Maybe Bool
useLatestRestorableTime) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Bool
a -> RestoreDBClusterToPointInTime
s {$sel:useLatestRestorableTime:RestoreDBClusterToPointInTime' :: Maybe Bool
useLatestRestorableTime = Maybe Bool
a} :: RestoreDBClusterToPointInTime)

-- | The DB subnet group name to use for the new DB cluster.
--
-- Constraints: If supplied, must match the name of an existing
-- DBSubnetGroup.
--
-- Example: @mySubnetgroup@
restoreDBClusterToPointInTime_dbSubnetGroupName :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Text)
restoreDBClusterToPointInTime_dbSubnetGroupName :: (Maybe Text -> f (Maybe Text))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_dbSubnetGroupName = (RestoreDBClusterToPointInTime -> Maybe Text)
-> (RestoreDBClusterToPointInTime
    -> Maybe Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Text
dbSubnetGroupName :: Maybe Text
$sel:dbSubnetGroupName:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
dbSubnetGroupName} -> Maybe Text
dbSubnetGroupName) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Text
a -> RestoreDBClusterToPointInTime
s {$sel:dbSubnetGroupName:RestoreDBClusterToPointInTime' :: Maybe Text
dbSubnetGroupName = Maybe Text
a} :: RestoreDBClusterToPointInTime)

-- | Specify the Active Directory directory ID to restore the DB cluster in.
-- The domain must be created prior to this operation.
--
-- For Amazon Aurora DB clusters, Amazon RDS can use Kerberos
-- Authentication to authenticate users that connect to the DB cluster. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/kerberos-authentication.html Kerberos Authentication>
-- in the /Amazon Aurora User Guide/.
restoreDBClusterToPointInTime_domain :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Text)
restoreDBClusterToPointInTime_domain :: (Maybe Text -> f (Maybe Text))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_domain = (RestoreDBClusterToPointInTime -> Maybe Text)
-> (RestoreDBClusterToPointInTime
    -> Maybe Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Text
domain :: Maybe Text
$sel:domain:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
domain} -> Maybe Text
domain) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Text
a -> RestoreDBClusterToPointInTime
s {$sel:domain:RestoreDBClusterToPointInTime' :: Maybe Text
domain = Maybe Text
a} :: RestoreDBClusterToPointInTime)

-- | The target backtrack window, in seconds. To disable backtracking, set
-- this value to 0.
--
-- Currently, Backtrack is only supported for Aurora MySQL DB clusters.
--
-- Default: 0
--
-- Constraints:
--
-- -   If specified, this value must be set to a number from 0 to 259,200
--     (72 hours).
restoreDBClusterToPointInTime_backtrackWindow :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Integer)
restoreDBClusterToPointInTime_backtrackWindow :: (Maybe Integer -> f (Maybe Integer))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_backtrackWindow = (RestoreDBClusterToPointInTime -> Maybe Integer)
-> (RestoreDBClusterToPointInTime
    -> Maybe Integer -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Integer
backtrackWindow :: Maybe Integer
$sel:backtrackWindow:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Integer
backtrackWindow} -> Maybe Integer
backtrackWindow) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Integer
a -> RestoreDBClusterToPointInTime
s {$sel:backtrackWindow:RestoreDBClusterToPointInTime' :: Maybe Integer
backtrackWindow = Maybe Integer
a} :: RestoreDBClusterToPointInTime)

-- | The Amazon Web Services KMS key identifier to use when restoring an
-- encrypted DB cluster from an encrypted DB cluster.
--
-- The Amazon Web Services KMS key identifier is the key ARN, key ID, alias
-- ARN, or alias name for the Amazon Web Services KMS customer master key
-- (CMK). To use a CMK in a different Amazon Web Services account, specify
-- the key ARN or alias ARN.
--
-- You can restore to a new DB cluster and encrypt the new DB cluster with
-- a Amazon Web Services KMS CMK that is different than the Amazon Web
-- Services KMS key used to encrypt the source DB cluster. The new DB
-- cluster is encrypted with the Amazon Web Services KMS CMK identified by
-- the @KmsKeyId@ parameter.
--
-- If you don\'t specify a value for the @KmsKeyId@ parameter, then the
-- following occurs:
--
-- -   If the DB cluster is encrypted, then the restored DB cluster is
--     encrypted using the Amazon Web Services KMS CMK that was used to
--     encrypt the source DB cluster.
--
-- -   If the DB cluster isn\'t encrypted, then the restored DB cluster
--     isn\'t encrypted.
--
-- If @DBClusterIdentifier@ refers to a DB cluster that isn\'t encrypted,
-- then the restore request is rejected.
restoreDBClusterToPointInTime_kmsKeyId :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Text)
restoreDBClusterToPointInTime_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_kmsKeyId = (RestoreDBClusterToPointInTime -> Maybe Text)
-> (RestoreDBClusterToPointInTime
    -> Maybe Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Text
a -> RestoreDBClusterToPointInTime
s {$sel:kmsKeyId:RestoreDBClusterToPointInTime' :: Maybe Text
kmsKeyId = Maybe Text
a} :: RestoreDBClusterToPointInTime)

-- | A list of VPC security groups that the new DB cluster belongs to.
restoreDBClusterToPointInTime_vpcSecurityGroupIds :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe [Prelude.Text])
restoreDBClusterToPointInTime_vpcSecurityGroupIds :: (Maybe [Text] -> f (Maybe [Text]))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_vpcSecurityGroupIds = (RestoreDBClusterToPointInTime -> Maybe [Text])
-> (RestoreDBClusterToPointInTime
    -> Maybe [Text] -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe [Text]
vpcSecurityGroupIds :: Maybe [Text]
$sel:vpcSecurityGroupIds:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe [Text]
vpcSecurityGroupIds} -> Maybe [Text]
vpcSecurityGroupIds) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe [Text]
a -> RestoreDBClusterToPointInTime
s {$sel:vpcSecurityGroupIds:RestoreDBClusterToPointInTime' :: Maybe [Text]
vpcSecurityGroupIds = Maybe [Text]
a} :: RestoreDBClusterToPointInTime) ((Maybe [Text] -> f (Maybe [Text]))
 -> RestoreDBClusterToPointInTime
 -> f RestoreDBClusterToPointInTime)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> RestoreDBClusterToPointInTime
-> f RestoreDBClusterToPointInTime
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the DB cluster parameter group to associate with this DB
-- cluster. If this argument is omitted, the default DB cluster parameter
-- group for the specified engine is used.
--
-- Constraints:
--
-- -   If supplied, must match the name of an existing DB cluster parameter
--     group.
--
-- -   Must be 1 to 255 letters, numbers, or hyphens.
--
-- -   First character must be a letter.
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens.
restoreDBClusterToPointInTime_dbClusterParameterGroupName :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Text)
restoreDBClusterToPointInTime_dbClusterParameterGroupName :: (Maybe Text -> f (Maybe Text))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_dbClusterParameterGroupName = (RestoreDBClusterToPointInTime -> Maybe Text)
-> (RestoreDBClusterToPointInTime
    -> Maybe Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Text
dbClusterParameterGroupName :: Maybe Text
$sel:dbClusterParameterGroupName:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
dbClusterParameterGroupName} -> Maybe Text
dbClusterParameterGroupName) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Text
a -> RestoreDBClusterToPointInTime
s {$sel:dbClusterParameterGroupName:RestoreDBClusterToPointInTime' :: Maybe Text
dbClusterParameterGroupName = Maybe Text
a} :: RestoreDBClusterToPointInTime)

-- | The engine mode of the new cluster. Specify @provisioned@ or
-- @serverless@, depending on the type of the cluster you are creating. You
-- can create an Aurora Serverless clone from a provisioned cluster, or a
-- provisioned clone from an Aurora Serverless cluster. To create a clone
-- that is an Aurora Serverless cluster, the original cluster must be an
-- Aurora Serverless cluster or an encrypted provisioned cluster.
restoreDBClusterToPointInTime_engineMode :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Text)
restoreDBClusterToPointInTime_engineMode :: (Maybe Text -> f (Maybe Text))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_engineMode = (RestoreDBClusterToPointInTime -> Maybe Text)
-> (RestoreDBClusterToPointInTime
    -> Maybe Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Text
engineMode :: Maybe Text
$sel:engineMode:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
engineMode} -> Maybe Text
engineMode) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Text
a -> RestoreDBClusterToPointInTime
s {$sel:engineMode:RestoreDBClusterToPointInTime' :: Maybe Text
engineMode = Maybe Text
a} :: RestoreDBClusterToPointInTime)

-- | For DB clusters in @serverless@ DB engine mode, the scaling properties
-- of the DB cluster.
restoreDBClusterToPointInTime_scalingConfiguration :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe ScalingConfiguration)
restoreDBClusterToPointInTime_scalingConfiguration :: (Maybe ScalingConfiguration -> f (Maybe ScalingConfiguration))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_scalingConfiguration = (RestoreDBClusterToPointInTime -> Maybe ScalingConfiguration)
-> (RestoreDBClusterToPointInTime
    -> Maybe ScalingConfiguration -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe ScalingConfiguration)
     (Maybe ScalingConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe ScalingConfiguration
scalingConfiguration :: Maybe ScalingConfiguration
$sel:scalingConfiguration:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe ScalingConfiguration
scalingConfiguration} -> Maybe ScalingConfiguration
scalingConfiguration) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe ScalingConfiguration
a -> RestoreDBClusterToPointInTime
s {$sel:scalingConfiguration:RestoreDBClusterToPointInTime' :: Maybe ScalingConfiguration
scalingConfiguration = Maybe ScalingConfiguration
a} :: RestoreDBClusterToPointInTime)

-- | The type of restore to be performed. You can specify one of the
-- following values:
--
-- -   @full-copy@ - The new DB cluster is restored as a full copy of the
--     source DB cluster.
--
-- -   @copy-on-write@ - The new DB cluster is restored as a clone of the
--     source DB cluster.
--
-- Constraints: You can\'t specify @copy-on-write@ if the engine version of
-- the source DB cluster is earlier than 1.11.
--
-- If you don\'t specify a @RestoreType@ value, then the new DB cluster is
-- restored as a full copy of the source DB cluster.
restoreDBClusterToPointInTime_restoreType :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Text)
restoreDBClusterToPointInTime_restoreType :: (Maybe Text -> f (Maybe Text))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_restoreType = (RestoreDBClusterToPointInTime -> Maybe Text)
-> (RestoreDBClusterToPointInTime
    -> Maybe Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Text
restoreType :: Maybe Text
$sel:restoreType:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
restoreType} -> Maybe Text
restoreType) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Text
a -> RestoreDBClusterToPointInTime
s {$sel:restoreType:RestoreDBClusterToPointInTime' :: Maybe Text
restoreType = Maybe Text
a} :: RestoreDBClusterToPointInTime)

-- | The name of the option group for the new DB cluster.
restoreDBClusterToPointInTime_optionGroupName :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Text)
restoreDBClusterToPointInTime_optionGroupName :: (Maybe Text -> f (Maybe Text))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_optionGroupName = (RestoreDBClusterToPointInTime -> Maybe Text)
-> (RestoreDBClusterToPointInTime
    -> Maybe Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Text
optionGroupName :: Maybe Text
$sel:optionGroupName:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
optionGroupName} -> Maybe Text
optionGroupName) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Text
a -> RestoreDBClusterToPointInTime
s {$sel:optionGroupName:RestoreDBClusterToPointInTime' :: Maybe Text
optionGroupName = Maybe Text
a} :: RestoreDBClusterToPointInTime)

-- | A value that indicates whether to copy all tags from the restored DB
-- cluster to snapshots of the restored DB cluster. The default is not to
-- copy them.
restoreDBClusterToPointInTime_copyTagsToSnapshot :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Bool)
restoreDBClusterToPointInTime_copyTagsToSnapshot :: (Maybe Bool -> f (Maybe Bool))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_copyTagsToSnapshot = (RestoreDBClusterToPointInTime -> Maybe Bool)
-> (RestoreDBClusterToPointInTime
    -> Maybe Bool -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Bool
copyTagsToSnapshot :: Maybe Bool
$sel:copyTagsToSnapshot:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Bool
copyTagsToSnapshot} -> Maybe Bool
copyTagsToSnapshot) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Bool
a -> RestoreDBClusterToPointInTime
s {$sel:copyTagsToSnapshot:RestoreDBClusterToPointInTime' :: Maybe Bool
copyTagsToSnapshot = Maybe Bool
a} :: RestoreDBClusterToPointInTime)

-- | The date and time to restore the DB cluster to.
--
-- Valid Values: Value must be a time in Universal Coordinated Time (UTC)
-- format
--
-- Constraints:
--
-- -   Must be before the latest restorable time for the DB instance
--
-- -   Must be specified if @UseLatestRestorableTime@ parameter isn\'t
--     provided
--
-- -   Can\'t be specified if the @UseLatestRestorableTime@ parameter is
--     enabled
--
-- -   Can\'t be specified if the @RestoreType@ parameter is
--     @copy-on-write@
--
-- Example: @2015-03-07T23:45:00Z@
restoreDBClusterToPointInTime_restoreToTime :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.UTCTime)
restoreDBClusterToPointInTime_restoreToTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_restoreToTime = (RestoreDBClusterToPointInTime -> Maybe ISO8601)
-> (RestoreDBClusterToPointInTime
    -> Maybe ISO8601 -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe ISO8601)
     (Maybe ISO8601)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe ISO8601
restoreToTime :: Maybe ISO8601
$sel:restoreToTime:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe ISO8601
restoreToTime} -> Maybe ISO8601
restoreToTime) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe ISO8601
a -> RestoreDBClusterToPointInTime
s {$sel:restoreToTime:RestoreDBClusterToPointInTime' :: Maybe ISO8601
restoreToTime = Maybe ISO8601
a} :: RestoreDBClusterToPointInTime) ((Maybe ISO8601 -> f (Maybe ISO8601))
 -> RestoreDBClusterToPointInTime
 -> f RestoreDBClusterToPointInTime)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe ISO8601 -> f (Maybe ISO8601))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> RestoreDBClusterToPointInTime
-> f RestoreDBClusterToPointInTime
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso ISO8601 ISO8601 UTCTime UTCTime
-> Iso
     (Maybe ISO8601) (Maybe ISO8601) (Maybe UTCTime) (Maybe UTCTime)
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 ISO8601 ISO8601 UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specify the name of the IAM role to be used when making API calls to the
-- Directory Service.
restoreDBClusterToPointInTime_domainIAMRoleName :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Text)
restoreDBClusterToPointInTime_domainIAMRoleName :: (Maybe Text -> f (Maybe Text))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_domainIAMRoleName = (RestoreDBClusterToPointInTime -> Maybe Text)
-> (RestoreDBClusterToPointInTime
    -> Maybe Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Text
domainIAMRoleName :: Maybe Text
$sel:domainIAMRoleName:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
domainIAMRoleName} -> Maybe Text
domainIAMRoleName) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Text
a -> RestoreDBClusterToPointInTime
s {$sel:domainIAMRoleName:RestoreDBClusterToPointInTime' :: Maybe Text
domainIAMRoleName = Maybe Text
a} :: RestoreDBClusterToPointInTime)

-- | Undocumented member.
restoreDBClusterToPointInTime_tags :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe [Tag])
restoreDBClusterToPointInTime_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_tags = (RestoreDBClusterToPointInTime -> Maybe [Tag])
-> (RestoreDBClusterToPointInTime
    -> Maybe [Tag] -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe [Tag]
a -> RestoreDBClusterToPointInTime
s {$sel:tags:RestoreDBClusterToPointInTime' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: RestoreDBClusterToPointInTime) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> RestoreDBClusterToPointInTime
 -> f RestoreDBClusterToPointInTime)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> RestoreDBClusterToPointInTime
-> f RestoreDBClusterToPointInTime
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The port number on which the new DB cluster accepts connections.
--
-- Constraints: A value from @1150-65535@.
--
-- Default: The default port for the engine.
restoreDBClusterToPointInTime_port :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Int)
restoreDBClusterToPointInTime_port :: (Maybe Int -> f (Maybe Int))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_port = (RestoreDBClusterToPointInTime -> Maybe Int)
-> (RestoreDBClusterToPointInTime
    -> Maybe Int -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Int
port :: Maybe Int
$sel:port:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Int
port} -> Maybe Int
port) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Int
a -> RestoreDBClusterToPointInTime
s {$sel:port:RestoreDBClusterToPointInTime' :: Maybe Int
port = Maybe Int
a} :: RestoreDBClusterToPointInTime)

-- | A value that indicates whether to enable mapping of Amazon Web Services
-- Identity and Access Management (IAM) accounts to database accounts. By
-- default, mapping is disabled.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/UsingWithRDS.IAMDBAuth.html IAM Database Authentication>
-- in the /Amazon Aurora User Guide./
restoreDBClusterToPointInTime_enableIAMDatabaseAuthentication :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe Prelude.Bool)
restoreDBClusterToPointInTime_enableIAMDatabaseAuthentication :: (Maybe Bool -> f (Maybe Bool))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_enableIAMDatabaseAuthentication = (RestoreDBClusterToPointInTime -> Maybe Bool)
-> (RestoreDBClusterToPointInTime
    -> Maybe Bool -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe Bool
enableIAMDatabaseAuthentication :: Maybe Bool
$sel:enableIAMDatabaseAuthentication:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Bool
enableIAMDatabaseAuthentication} -> Maybe Bool
enableIAMDatabaseAuthentication) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe Bool
a -> RestoreDBClusterToPointInTime
s {$sel:enableIAMDatabaseAuthentication:RestoreDBClusterToPointInTime' :: Maybe Bool
enableIAMDatabaseAuthentication = Maybe Bool
a} :: RestoreDBClusterToPointInTime)

-- | The list of logs that the restored DB cluster is to export to CloudWatch
-- Logs. The values in the list depend on the DB engine being used. For
-- more information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_LogAccess.html#USER_LogAccess.Procedural.UploadtoCloudWatch Publishing Database Logs to Amazon CloudWatch Logs>
-- in the /Amazon Aurora User Guide/.
restoreDBClusterToPointInTime_enableCloudwatchLogsExports :: Lens.Lens' RestoreDBClusterToPointInTime (Prelude.Maybe [Prelude.Text])
restoreDBClusterToPointInTime_enableCloudwatchLogsExports :: (Maybe [Text] -> f (Maybe [Text]))
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_enableCloudwatchLogsExports = (RestoreDBClusterToPointInTime -> Maybe [Text])
-> (RestoreDBClusterToPointInTime
    -> Maybe [Text] -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Maybe [Text]
enableCloudwatchLogsExports :: Maybe [Text]
$sel:enableCloudwatchLogsExports:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe [Text]
enableCloudwatchLogsExports} -> Maybe [Text]
enableCloudwatchLogsExports) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Maybe [Text]
a -> RestoreDBClusterToPointInTime
s {$sel:enableCloudwatchLogsExports:RestoreDBClusterToPointInTime' :: Maybe [Text]
enableCloudwatchLogsExports = Maybe [Text]
a} :: RestoreDBClusterToPointInTime) ((Maybe [Text] -> f (Maybe [Text]))
 -> RestoreDBClusterToPointInTime
 -> f RestoreDBClusterToPointInTime)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> RestoreDBClusterToPointInTime
-> f RestoreDBClusterToPointInTime
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the new DB cluster to be created.
--
-- Constraints:
--
-- -   Must contain from 1 to 63 letters, numbers, or hyphens
--
-- -   First character must be a letter
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens
restoreDBClusterToPointInTime_dbClusterIdentifier :: Lens.Lens' RestoreDBClusterToPointInTime Prelude.Text
restoreDBClusterToPointInTime_dbClusterIdentifier :: (Text -> f Text)
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_dbClusterIdentifier = (RestoreDBClusterToPointInTime -> Text)
-> (RestoreDBClusterToPointInTime
    -> Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Text
dbClusterIdentifier :: Text
$sel:dbClusterIdentifier:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Text
dbClusterIdentifier} -> Text
dbClusterIdentifier) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Text
a -> RestoreDBClusterToPointInTime
s {$sel:dbClusterIdentifier:RestoreDBClusterToPointInTime' :: Text
dbClusterIdentifier = Text
a} :: RestoreDBClusterToPointInTime)

-- | The identifier of the source DB cluster from which to restore.
--
-- Constraints:
--
-- -   Must match the identifier of an existing DBCluster.
restoreDBClusterToPointInTime_sourceDBClusterIdentifier :: Lens.Lens' RestoreDBClusterToPointInTime Prelude.Text
restoreDBClusterToPointInTime_sourceDBClusterIdentifier :: (Text -> f Text)
-> RestoreDBClusterToPointInTime -> f RestoreDBClusterToPointInTime
restoreDBClusterToPointInTime_sourceDBClusterIdentifier = (RestoreDBClusterToPointInTime -> Text)
-> (RestoreDBClusterToPointInTime
    -> Text -> RestoreDBClusterToPointInTime)
-> Lens
     RestoreDBClusterToPointInTime
     RestoreDBClusterToPointInTime
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTime' {Text
sourceDBClusterIdentifier :: Text
$sel:sourceDBClusterIdentifier:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Text
sourceDBClusterIdentifier} -> Text
sourceDBClusterIdentifier) (\s :: RestoreDBClusterToPointInTime
s@RestoreDBClusterToPointInTime' {} Text
a -> RestoreDBClusterToPointInTime
s {$sel:sourceDBClusterIdentifier:RestoreDBClusterToPointInTime' :: Text
sourceDBClusterIdentifier = Text
a} :: RestoreDBClusterToPointInTime)

instance
  Core.AWSRequest
    RestoreDBClusterToPointInTime
  where
  type
    AWSResponse RestoreDBClusterToPointInTime =
      RestoreDBClusterToPointInTimeResponse
  request :: RestoreDBClusterToPointInTime
-> Request RestoreDBClusterToPointInTime
request = Service
-> RestoreDBClusterToPointInTime
-> Request RestoreDBClusterToPointInTime
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy RestoreDBClusterToPointInTime
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RestoreDBClusterToPointInTime)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse RestoreDBClusterToPointInTime))
-> Logger
-> Service
-> Proxy RestoreDBClusterToPointInTime
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse RestoreDBClusterToPointInTime)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"RestoreDBClusterToPointInTimeResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe DBCluster -> Int -> RestoreDBClusterToPointInTimeResponse
RestoreDBClusterToPointInTimeResponse'
            (Maybe DBCluster -> Int -> RestoreDBClusterToPointInTimeResponse)
-> Either String (Maybe DBCluster)
-> Either String (Int -> RestoreDBClusterToPointInTimeResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DBCluster)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBCluster")
            Either String (Int -> RestoreDBClusterToPointInTimeResponse)
-> Either String Int
-> Either String RestoreDBClusterToPointInTimeResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance
  Prelude.Hashable
    RestoreDBClusterToPointInTime

instance Prelude.NFData RestoreDBClusterToPointInTime

instance Core.ToHeaders RestoreDBClusterToPointInTime where
  toHeaders :: RestoreDBClusterToPointInTime -> ResponseHeaders
toHeaders = ResponseHeaders -> RestoreDBClusterToPointInTime -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath RestoreDBClusterToPointInTime where
  toPath :: RestoreDBClusterToPointInTime -> ByteString
toPath = ByteString -> RestoreDBClusterToPointInTime -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery RestoreDBClusterToPointInTime where
  toQuery :: RestoreDBClusterToPointInTime -> QueryString
toQuery RestoreDBClusterToPointInTime' {Maybe Bool
Maybe Int
Maybe Integer
Maybe [Text]
Maybe [Tag]
Maybe Text
Maybe ISO8601
Maybe ScalingConfiguration
Text
sourceDBClusterIdentifier :: Text
dbClusterIdentifier :: Text
enableCloudwatchLogsExports :: Maybe [Text]
enableIAMDatabaseAuthentication :: Maybe Bool
port :: Maybe Int
tags :: Maybe [Tag]
domainIAMRoleName :: Maybe Text
restoreToTime :: Maybe ISO8601
copyTagsToSnapshot :: Maybe Bool
optionGroupName :: Maybe Text
restoreType :: Maybe Text
scalingConfiguration :: Maybe ScalingConfiguration
engineMode :: Maybe Text
dbClusterParameterGroupName :: Maybe Text
vpcSecurityGroupIds :: Maybe [Text]
kmsKeyId :: Maybe Text
backtrackWindow :: Maybe Integer
domain :: Maybe Text
dbSubnetGroupName :: Maybe Text
useLatestRestorableTime :: Maybe Bool
deletionProtection :: Maybe Bool
$sel:sourceDBClusterIdentifier:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Text
$sel:dbClusterIdentifier:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Text
$sel:enableCloudwatchLogsExports:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe [Text]
$sel:enableIAMDatabaseAuthentication:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Bool
$sel:port:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Int
$sel:tags:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe [Tag]
$sel:domainIAMRoleName:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
$sel:restoreToTime:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe ISO8601
$sel:copyTagsToSnapshot:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Bool
$sel:optionGroupName:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
$sel:restoreType:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
$sel:scalingConfiguration:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe ScalingConfiguration
$sel:engineMode:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
$sel:dbClusterParameterGroupName:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
$sel:vpcSecurityGroupIds:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe [Text]
$sel:kmsKeyId:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
$sel:backtrackWindow:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Integer
$sel:domain:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
$sel:dbSubnetGroupName:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Text
$sel:useLatestRestorableTime:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Bool
$sel:deletionProtection:RestoreDBClusterToPointInTime' :: RestoreDBClusterToPointInTime -> Maybe Bool
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"RestoreDBClusterToPointInTime" ::
                      Prelude.ByteString
                  ),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"DeletionProtection" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
deletionProtection,
        ByteString
"UseLatestRestorableTime"
          ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
useLatestRestorableTime,
        ByteString
"DBSubnetGroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbSubnetGroupName,
        ByteString
"Domain" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
domain,
        ByteString
"BacktrackWindow" ByteString -> Maybe Integer -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Integer
backtrackWindow,
        ByteString
"KmsKeyId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
kmsKeyId,
        ByteString
"VpcSecurityGroupIds"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"VpcSecurityGroupId"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
vpcSecurityGroupIds
            ),
        ByteString
"DBClusterParameterGroupName"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
dbClusterParameterGroupName,
        ByteString
"EngineMode" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
engineMode,
        ByteString
"ScalingConfiguration" ByteString -> Maybe ScalingConfiguration -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ScalingConfiguration
scalingConfiguration,
        ByteString
"RestoreType" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
restoreType,
        ByteString
"OptionGroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
optionGroupName,
        ByteString
"CopyTagsToSnapshot" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
copyTagsToSnapshot,
        ByteString
"RestoreToTime" ByteString -> Maybe ISO8601 -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe ISO8601
restoreToTime,
        ByteString
"DomainIAMRoleName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
domainIAMRoleName,
        ByteString
"Tags"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Tag] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"Tag" ([Tag] -> QueryString) -> Maybe [Tag] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags),
        ByteString
"Port" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
port,
        ByteString
"EnableIAMDatabaseAuthentication"
          ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
enableIAMDatabaseAuthentication,
        ByteString
"EnableCloudwatchLogsExports"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            ( ByteString -> [Text] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
                ([Text] -> QueryString) -> Maybe [Text] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
enableCloudwatchLogsExports
            ),
        ByteString
"DBClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbClusterIdentifier,
        ByteString
"SourceDBClusterIdentifier"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sourceDBClusterIdentifier
      ]

-- | /See:/ 'newRestoreDBClusterToPointInTimeResponse' smart constructor.
data RestoreDBClusterToPointInTimeResponse = RestoreDBClusterToPointInTimeResponse'
  { RestoreDBClusterToPointInTimeResponse -> Maybe DBCluster
dbCluster :: Prelude.Maybe DBCluster,
    -- | The response's http status code.
    RestoreDBClusterToPointInTimeResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (RestoreDBClusterToPointInTimeResponse
-> RestoreDBClusterToPointInTimeResponse -> Bool
(RestoreDBClusterToPointInTimeResponse
 -> RestoreDBClusterToPointInTimeResponse -> Bool)
-> (RestoreDBClusterToPointInTimeResponse
    -> RestoreDBClusterToPointInTimeResponse -> Bool)
-> Eq RestoreDBClusterToPointInTimeResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RestoreDBClusterToPointInTimeResponse
-> RestoreDBClusterToPointInTimeResponse -> Bool
$c/= :: RestoreDBClusterToPointInTimeResponse
-> RestoreDBClusterToPointInTimeResponse -> Bool
== :: RestoreDBClusterToPointInTimeResponse
-> RestoreDBClusterToPointInTimeResponse -> Bool
$c== :: RestoreDBClusterToPointInTimeResponse
-> RestoreDBClusterToPointInTimeResponse -> Bool
Prelude.Eq, ReadPrec [RestoreDBClusterToPointInTimeResponse]
ReadPrec RestoreDBClusterToPointInTimeResponse
Int -> ReadS RestoreDBClusterToPointInTimeResponse
ReadS [RestoreDBClusterToPointInTimeResponse]
(Int -> ReadS RestoreDBClusterToPointInTimeResponse)
-> ReadS [RestoreDBClusterToPointInTimeResponse]
-> ReadPrec RestoreDBClusterToPointInTimeResponse
-> ReadPrec [RestoreDBClusterToPointInTimeResponse]
-> Read RestoreDBClusterToPointInTimeResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RestoreDBClusterToPointInTimeResponse]
$creadListPrec :: ReadPrec [RestoreDBClusterToPointInTimeResponse]
readPrec :: ReadPrec RestoreDBClusterToPointInTimeResponse
$creadPrec :: ReadPrec RestoreDBClusterToPointInTimeResponse
readList :: ReadS [RestoreDBClusterToPointInTimeResponse]
$creadList :: ReadS [RestoreDBClusterToPointInTimeResponse]
readsPrec :: Int -> ReadS RestoreDBClusterToPointInTimeResponse
$creadsPrec :: Int -> ReadS RestoreDBClusterToPointInTimeResponse
Prelude.Read, Int -> RestoreDBClusterToPointInTimeResponse -> ShowS
[RestoreDBClusterToPointInTimeResponse] -> ShowS
RestoreDBClusterToPointInTimeResponse -> String
(Int -> RestoreDBClusterToPointInTimeResponse -> ShowS)
-> (RestoreDBClusterToPointInTimeResponse -> String)
-> ([RestoreDBClusterToPointInTimeResponse] -> ShowS)
-> Show RestoreDBClusterToPointInTimeResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RestoreDBClusterToPointInTimeResponse] -> ShowS
$cshowList :: [RestoreDBClusterToPointInTimeResponse] -> ShowS
show :: RestoreDBClusterToPointInTimeResponse -> String
$cshow :: RestoreDBClusterToPointInTimeResponse -> String
showsPrec :: Int -> RestoreDBClusterToPointInTimeResponse -> ShowS
$cshowsPrec :: Int -> RestoreDBClusterToPointInTimeResponse -> ShowS
Prelude.Show, (forall x.
 RestoreDBClusterToPointInTimeResponse
 -> Rep RestoreDBClusterToPointInTimeResponse x)
-> (forall x.
    Rep RestoreDBClusterToPointInTimeResponse x
    -> RestoreDBClusterToPointInTimeResponse)
-> Generic RestoreDBClusterToPointInTimeResponse
forall x.
Rep RestoreDBClusterToPointInTimeResponse x
-> RestoreDBClusterToPointInTimeResponse
forall x.
RestoreDBClusterToPointInTimeResponse
-> Rep RestoreDBClusterToPointInTimeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep RestoreDBClusterToPointInTimeResponse x
-> RestoreDBClusterToPointInTimeResponse
$cfrom :: forall x.
RestoreDBClusterToPointInTimeResponse
-> Rep RestoreDBClusterToPointInTimeResponse x
Prelude.Generic)

-- |
-- Create a value of 'RestoreDBClusterToPointInTimeResponse' 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:
--
-- 'dbCluster', 'restoreDBClusterToPointInTimeResponse_dbCluster' - Undocumented member.
--
-- 'httpStatus', 'restoreDBClusterToPointInTimeResponse_httpStatus' - The response's http status code.
newRestoreDBClusterToPointInTimeResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  RestoreDBClusterToPointInTimeResponse
newRestoreDBClusterToPointInTimeResponse :: Int -> RestoreDBClusterToPointInTimeResponse
newRestoreDBClusterToPointInTimeResponse Int
pHttpStatus_ =
  RestoreDBClusterToPointInTimeResponse' :: Maybe DBCluster -> Int -> RestoreDBClusterToPointInTimeResponse
RestoreDBClusterToPointInTimeResponse'
    { $sel:dbCluster:RestoreDBClusterToPointInTimeResponse' :: Maybe DBCluster
dbCluster =
        Maybe DBCluster
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:RestoreDBClusterToPointInTimeResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
restoreDBClusterToPointInTimeResponse_dbCluster :: Lens.Lens' RestoreDBClusterToPointInTimeResponse (Prelude.Maybe DBCluster)
restoreDBClusterToPointInTimeResponse_dbCluster :: (Maybe DBCluster -> f (Maybe DBCluster))
-> RestoreDBClusterToPointInTimeResponse
-> f RestoreDBClusterToPointInTimeResponse
restoreDBClusterToPointInTimeResponse_dbCluster = (RestoreDBClusterToPointInTimeResponse -> Maybe DBCluster)
-> (RestoreDBClusterToPointInTimeResponse
    -> Maybe DBCluster -> RestoreDBClusterToPointInTimeResponse)
-> Lens
     RestoreDBClusterToPointInTimeResponse
     RestoreDBClusterToPointInTimeResponse
     (Maybe DBCluster)
     (Maybe DBCluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTimeResponse' {Maybe DBCluster
dbCluster :: Maybe DBCluster
$sel:dbCluster:RestoreDBClusterToPointInTimeResponse' :: RestoreDBClusterToPointInTimeResponse -> Maybe DBCluster
dbCluster} -> Maybe DBCluster
dbCluster) (\s :: RestoreDBClusterToPointInTimeResponse
s@RestoreDBClusterToPointInTimeResponse' {} Maybe DBCluster
a -> RestoreDBClusterToPointInTimeResponse
s {$sel:dbCluster:RestoreDBClusterToPointInTimeResponse' :: Maybe DBCluster
dbCluster = Maybe DBCluster
a} :: RestoreDBClusterToPointInTimeResponse)

-- | The response's http status code.
restoreDBClusterToPointInTimeResponse_httpStatus :: Lens.Lens' RestoreDBClusterToPointInTimeResponse Prelude.Int
restoreDBClusterToPointInTimeResponse_httpStatus :: (Int -> f Int)
-> RestoreDBClusterToPointInTimeResponse
-> f RestoreDBClusterToPointInTimeResponse
restoreDBClusterToPointInTimeResponse_httpStatus = (RestoreDBClusterToPointInTimeResponse -> Int)
-> (RestoreDBClusterToPointInTimeResponse
    -> Int -> RestoreDBClusterToPointInTimeResponse)
-> Lens
     RestoreDBClusterToPointInTimeResponse
     RestoreDBClusterToPointInTimeResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RestoreDBClusterToPointInTimeResponse' {Int
httpStatus :: Int
$sel:httpStatus:RestoreDBClusterToPointInTimeResponse' :: RestoreDBClusterToPointInTimeResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: RestoreDBClusterToPointInTimeResponse
s@RestoreDBClusterToPointInTimeResponse' {} Int
a -> RestoreDBClusterToPointInTimeResponse
s {$sel:httpStatus:RestoreDBClusterToPointInTimeResponse' :: Int
httpStatus = Int
a} :: RestoreDBClusterToPointInTimeResponse)

instance
  Prelude.NFData
    RestoreDBClusterToPointInTimeResponse