{-# 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.StartDBInstanceAutomatedBackupsReplication
-- 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)
--
-- Enables replication of automated backups to a different Amazon Web
-- Services Region.
--
-- For more information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ReplicateBackups.html Replicating Automated Backups to Another Amazon Web Services Region>
-- in the /Amazon RDS User Guide./
module Amazonka.RDS.StartDBInstanceAutomatedBackupsReplication
  ( -- * Creating a Request
    StartDBInstanceAutomatedBackupsReplication (..),
    newStartDBInstanceAutomatedBackupsReplication,

    -- * Request Lenses
    startDBInstanceAutomatedBackupsReplication_preSignedUrl,
    startDBInstanceAutomatedBackupsReplication_destinationRegion,
    startDBInstanceAutomatedBackupsReplication_kmsKeyId,
    startDBInstanceAutomatedBackupsReplication_backupRetentionPeriod,
    startDBInstanceAutomatedBackupsReplication_sourceDBInstanceArn,

    -- * Destructuring the Response
    StartDBInstanceAutomatedBackupsReplicationResponse (..),
    newStartDBInstanceAutomatedBackupsReplicationResponse,

    -- * Response Lenses
    startDBInstanceAutomatedBackupsReplicationResponse_dbInstanceAutomatedBackup,
    startDBInstanceAutomatedBackupsReplicationResponse_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:/ 'newStartDBInstanceAutomatedBackupsReplication' smart constructor.
data StartDBInstanceAutomatedBackupsReplication = StartDBInstanceAutomatedBackupsReplication'
  { -- | A URL that contains a Signature Version 4 signed request for the
    -- StartDBInstanceAutomatedBackupsReplication action to be called in the
    -- Amazon Web Services Region of the source DB instance. The presigned URL
    -- must be a valid request for the
    -- StartDBInstanceAutomatedBackupsReplication API action that can be
    -- executed in the Amazon Web Services Region that contains the source DB
    -- instance.
    StartDBInstanceAutomatedBackupsReplication -> Maybe Text
preSignedUrl :: Prelude.Maybe Prelude.Text,
    -- | Pseudo-parameter used when populating the @PreSignedUrl@ of a
    -- cross-region @StartDBInstanceAutomatedBackupsReplication@ request. To
    -- replicate from region @SRC@ to region @DST@, send a request to region
    -- @DST@. In that request, pass a @PreSignedUrl@ for region @SRC@ with
    -- @DestinationRegion@ set to region @DST@.
    StartDBInstanceAutomatedBackupsReplication -> Maybe Text
destinationRegion :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services KMS key identifier for encryption of the
    -- replicated automated backups. The KMS key ID is the Amazon Resource Name
    -- (ARN) for the KMS encryption key in the destination Amazon Web Services
    -- Region, for example,
    -- @arn:aws:kms:us-east-1:123456789012:key\/AKIAIOSFODNN7EXAMPLE@.
    StartDBInstanceAutomatedBackupsReplication -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The retention period for the replicated automated backups.
    StartDBInstanceAutomatedBackupsReplication -> Maybe Int
backupRetentionPeriod :: Prelude.Maybe Prelude.Int,
    -- | The Amazon Resource Name (ARN) of the source DB instance for the
    -- replicated automated backups, for example,
    -- @arn:aws:rds:us-west-2:123456789012:db:mydatabase@.
    StartDBInstanceAutomatedBackupsReplication -> Text
sourceDBInstanceArn :: Prelude.Text
  }
  deriving (StartDBInstanceAutomatedBackupsReplication
-> StartDBInstanceAutomatedBackupsReplication -> Bool
(StartDBInstanceAutomatedBackupsReplication
 -> StartDBInstanceAutomatedBackupsReplication -> Bool)
-> (StartDBInstanceAutomatedBackupsReplication
    -> StartDBInstanceAutomatedBackupsReplication -> Bool)
-> Eq StartDBInstanceAutomatedBackupsReplication
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartDBInstanceAutomatedBackupsReplication
-> StartDBInstanceAutomatedBackupsReplication -> Bool
$c/= :: StartDBInstanceAutomatedBackupsReplication
-> StartDBInstanceAutomatedBackupsReplication -> Bool
== :: StartDBInstanceAutomatedBackupsReplication
-> StartDBInstanceAutomatedBackupsReplication -> Bool
$c== :: StartDBInstanceAutomatedBackupsReplication
-> StartDBInstanceAutomatedBackupsReplication -> Bool
Prelude.Eq, ReadPrec [StartDBInstanceAutomatedBackupsReplication]
ReadPrec StartDBInstanceAutomatedBackupsReplication
Int -> ReadS StartDBInstanceAutomatedBackupsReplication
ReadS [StartDBInstanceAutomatedBackupsReplication]
(Int -> ReadS StartDBInstanceAutomatedBackupsReplication)
-> ReadS [StartDBInstanceAutomatedBackupsReplication]
-> ReadPrec StartDBInstanceAutomatedBackupsReplication
-> ReadPrec [StartDBInstanceAutomatedBackupsReplication]
-> Read StartDBInstanceAutomatedBackupsReplication
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartDBInstanceAutomatedBackupsReplication]
$creadListPrec :: ReadPrec [StartDBInstanceAutomatedBackupsReplication]
readPrec :: ReadPrec StartDBInstanceAutomatedBackupsReplication
$creadPrec :: ReadPrec StartDBInstanceAutomatedBackupsReplication
readList :: ReadS [StartDBInstanceAutomatedBackupsReplication]
$creadList :: ReadS [StartDBInstanceAutomatedBackupsReplication]
readsPrec :: Int -> ReadS StartDBInstanceAutomatedBackupsReplication
$creadsPrec :: Int -> ReadS StartDBInstanceAutomatedBackupsReplication
Prelude.Read, Int -> StartDBInstanceAutomatedBackupsReplication -> ShowS
[StartDBInstanceAutomatedBackupsReplication] -> ShowS
StartDBInstanceAutomatedBackupsReplication -> String
(Int -> StartDBInstanceAutomatedBackupsReplication -> ShowS)
-> (StartDBInstanceAutomatedBackupsReplication -> String)
-> ([StartDBInstanceAutomatedBackupsReplication] -> ShowS)
-> Show StartDBInstanceAutomatedBackupsReplication
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartDBInstanceAutomatedBackupsReplication] -> ShowS
$cshowList :: [StartDBInstanceAutomatedBackupsReplication] -> ShowS
show :: StartDBInstanceAutomatedBackupsReplication -> String
$cshow :: StartDBInstanceAutomatedBackupsReplication -> String
showsPrec :: Int -> StartDBInstanceAutomatedBackupsReplication -> ShowS
$cshowsPrec :: Int -> StartDBInstanceAutomatedBackupsReplication -> ShowS
Prelude.Show, (forall x.
 StartDBInstanceAutomatedBackupsReplication
 -> Rep StartDBInstanceAutomatedBackupsReplication x)
-> (forall x.
    Rep StartDBInstanceAutomatedBackupsReplication x
    -> StartDBInstanceAutomatedBackupsReplication)
-> Generic StartDBInstanceAutomatedBackupsReplication
forall x.
Rep StartDBInstanceAutomatedBackupsReplication x
-> StartDBInstanceAutomatedBackupsReplication
forall x.
StartDBInstanceAutomatedBackupsReplication
-> Rep StartDBInstanceAutomatedBackupsReplication x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep StartDBInstanceAutomatedBackupsReplication x
-> StartDBInstanceAutomatedBackupsReplication
$cfrom :: forall x.
StartDBInstanceAutomatedBackupsReplication
-> Rep StartDBInstanceAutomatedBackupsReplication x
Prelude.Generic)

-- |
-- Create a value of 'StartDBInstanceAutomatedBackupsReplication' 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:
--
-- 'preSignedUrl', 'startDBInstanceAutomatedBackupsReplication_preSignedUrl' - A URL that contains a Signature Version 4 signed request for the
-- StartDBInstanceAutomatedBackupsReplication action to be called in the
-- Amazon Web Services Region of the source DB instance. The presigned URL
-- must be a valid request for the
-- StartDBInstanceAutomatedBackupsReplication API action that can be
-- executed in the Amazon Web Services Region that contains the source DB
-- instance.
--
-- 'destinationRegion', 'startDBInstanceAutomatedBackupsReplication_destinationRegion' - Pseudo-parameter used when populating the @PreSignedUrl@ of a
-- cross-region @StartDBInstanceAutomatedBackupsReplication@ request. To
-- replicate from region @SRC@ to region @DST@, send a request to region
-- @DST@. In that request, pass a @PreSignedUrl@ for region @SRC@ with
-- @DestinationRegion@ set to region @DST@.
--
-- 'kmsKeyId', 'startDBInstanceAutomatedBackupsReplication_kmsKeyId' - The Amazon Web Services KMS key identifier for encryption of the
-- replicated automated backups. The KMS key ID is the Amazon Resource Name
-- (ARN) for the KMS encryption key in the destination Amazon Web Services
-- Region, for example,
-- @arn:aws:kms:us-east-1:123456789012:key\/AKIAIOSFODNN7EXAMPLE@.
--
-- 'backupRetentionPeriod', 'startDBInstanceAutomatedBackupsReplication_backupRetentionPeriod' - The retention period for the replicated automated backups.
--
-- 'sourceDBInstanceArn', 'startDBInstanceAutomatedBackupsReplication_sourceDBInstanceArn' - The Amazon Resource Name (ARN) of the source DB instance for the
-- replicated automated backups, for example,
-- @arn:aws:rds:us-west-2:123456789012:db:mydatabase@.
newStartDBInstanceAutomatedBackupsReplication ::
  -- | 'sourceDBInstanceArn'
  Prelude.Text ->
  StartDBInstanceAutomatedBackupsReplication
newStartDBInstanceAutomatedBackupsReplication :: Text -> StartDBInstanceAutomatedBackupsReplication
newStartDBInstanceAutomatedBackupsReplication
  Text
pSourceDBInstanceArn_ =
    StartDBInstanceAutomatedBackupsReplication' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> Text
-> StartDBInstanceAutomatedBackupsReplication
StartDBInstanceAutomatedBackupsReplication'
      { $sel:preSignedUrl:StartDBInstanceAutomatedBackupsReplication' :: Maybe Text
preSignedUrl =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:destinationRegion:StartDBInstanceAutomatedBackupsReplication' :: Maybe Text
destinationRegion =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:StartDBInstanceAutomatedBackupsReplication' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:backupRetentionPeriod:StartDBInstanceAutomatedBackupsReplication' :: Maybe Int
backupRetentionPeriod =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceDBInstanceArn:StartDBInstanceAutomatedBackupsReplication' :: Text
sourceDBInstanceArn =
          Text
pSourceDBInstanceArn_
      }

-- | A URL that contains a Signature Version 4 signed request for the
-- StartDBInstanceAutomatedBackupsReplication action to be called in the
-- Amazon Web Services Region of the source DB instance. The presigned URL
-- must be a valid request for the
-- StartDBInstanceAutomatedBackupsReplication API action that can be
-- executed in the Amazon Web Services Region that contains the source DB
-- instance.
startDBInstanceAutomatedBackupsReplication_preSignedUrl :: Lens.Lens' StartDBInstanceAutomatedBackupsReplication (Prelude.Maybe Prelude.Text)
startDBInstanceAutomatedBackupsReplication_preSignedUrl :: (Maybe Text -> f (Maybe Text))
-> StartDBInstanceAutomatedBackupsReplication
-> f StartDBInstanceAutomatedBackupsReplication
startDBInstanceAutomatedBackupsReplication_preSignedUrl = (StartDBInstanceAutomatedBackupsReplication -> Maybe Text)
-> (StartDBInstanceAutomatedBackupsReplication
    -> Maybe Text -> StartDBInstanceAutomatedBackupsReplication)
-> Lens
     StartDBInstanceAutomatedBackupsReplication
     StartDBInstanceAutomatedBackupsReplication
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDBInstanceAutomatedBackupsReplication' {Maybe Text
preSignedUrl :: Maybe Text
$sel:preSignedUrl:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Maybe Text
preSignedUrl} -> Maybe Text
preSignedUrl) (\s :: StartDBInstanceAutomatedBackupsReplication
s@StartDBInstanceAutomatedBackupsReplication' {} Maybe Text
a -> StartDBInstanceAutomatedBackupsReplication
s {$sel:preSignedUrl:StartDBInstanceAutomatedBackupsReplication' :: Maybe Text
preSignedUrl = Maybe Text
a} :: StartDBInstanceAutomatedBackupsReplication)

-- | Pseudo-parameter used when populating the @PreSignedUrl@ of a
-- cross-region @StartDBInstanceAutomatedBackupsReplication@ request. To
-- replicate from region @SRC@ to region @DST@, send a request to region
-- @DST@. In that request, pass a @PreSignedUrl@ for region @SRC@ with
-- @DestinationRegion@ set to region @DST@.
startDBInstanceAutomatedBackupsReplication_destinationRegion :: Lens.Lens' StartDBInstanceAutomatedBackupsReplication (Prelude.Maybe Prelude.Text)
startDBInstanceAutomatedBackupsReplication_destinationRegion :: (Maybe Text -> f (Maybe Text))
-> StartDBInstanceAutomatedBackupsReplication
-> f StartDBInstanceAutomatedBackupsReplication
startDBInstanceAutomatedBackupsReplication_destinationRegion = (StartDBInstanceAutomatedBackupsReplication -> Maybe Text)
-> (StartDBInstanceAutomatedBackupsReplication
    -> Maybe Text -> StartDBInstanceAutomatedBackupsReplication)
-> Lens
     StartDBInstanceAutomatedBackupsReplication
     StartDBInstanceAutomatedBackupsReplication
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDBInstanceAutomatedBackupsReplication' {Maybe Text
destinationRegion :: Maybe Text
$sel:destinationRegion:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Maybe Text
destinationRegion} -> Maybe Text
destinationRegion) (\s :: StartDBInstanceAutomatedBackupsReplication
s@StartDBInstanceAutomatedBackupsReplication' {} Maybe Text
a -> StartDBInstanceAutomatedBackupsReplication
s {$sel:destinationRegion:StartDBInstanceAutomatedBackupsReplication' :: Maybe Text
destinationRegion = Maybe Text
a} :: StartDBInstanceAutomatedBackupsReplication)

-- | The Amazon Web Services KMS key identifier for encryption of the
-- replicated automated backups. The KMS key ID is the Amazon Resource Name
-- (ARN) for the KMS encryption key in the destination Amazon Web Services
-- Region, for example,
-- @arn:aws:kms:us-east-1:123456789012:key\/AKIAIOSFODNN7EXAMPLE@.
startDBInstanceAutomatedBackupsReplication_kmsKeyId :: Lens.Lens' StartDBInstanceAutomatedBackupsReplication (Prelude.Maybe Prelude.Text)
startDBInstanceAutomatedBackupsReplication_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> StartDBInstanceAutomatedBackupsReplication
-> f StartDBInstanceAutomatedBackupsReplication
startDBInstanceAutomatedBackupsReplication_kmsKeyId = (StartDBInstanceAutomatedBackupsReplication -> Maybe Text)
-> (StartDBInstanceAutomatedBackupsReplication
    -> Maybe Text -> StartDBInstanceAutomatedBackupsReplication)
-> Lens
     StartDBInstanceAutomatedBackupsReplication
     StartDBInstanceAutomatedBackupsReplication
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDBInstanceAutomatedBackupsReplication' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: StartDBInstanceAutomatedBackupsReplication
s@StartDBInstanceAutomatedBackupsReplication' {} Maybe Text
a -> StartDBInstanceAutomatedBackupsReplication
s {$sel:kmsKeyId:StartDBInstanceAutomatedBackupsReplication' :: Maybe Text
kmsKeyId = Maybe Text
a} :: StartDBInstanceAutomatedBackupsReplication)

-- | The retention period for the replicated automated backups.
startDBInstanceAutomatedBackupsReplication_backupRetentionPeriod :: Lens.Lens' StartDBInstanceAutomatedBackupsReplication (Prelude.Maybe Prelude.Int)
startDBInstanceAutomatedBackupsReplication_backupRetentionPeriod :: (Maybe Int -> f (Maybe Int))
-> StartDBInstanceAutomatedBackupsReplication
-> f StartDBInstanceAutomatedBackupsReplication
startDBInstanceAutomatedBackupsReplication_backupRetentionPeriod = (StartDBInstanceAutomatedBackupsReplication -> Maybe Int)
-> (StartDBInstanceAutomatedBackupsReplication
    -> Maybe Int -> StartDBInstanceAutomatedBackupsReplication)
-> Lens
     StartDBInstanceAutomatedBackupsReplication
     StartDBInstanceAutomatedBackupsReplication
     (Maybe Int)
     (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDBInstanceAutomatedBackupsReplication' {Maybe Int
backupRetentionPeriod :: Maybe Int
$sel:backupRetentionPeriod:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Maybe Int
backupRetentionPeriod} -> Maybe Int
backupRetentionPeriod) (\s :: StartDBInstanceAutomatedBackupsReplication
s@StartDBInstanceAutomatedBackupsReplication' {} Maybe Int
a -> StartDBInstanceAutomatedBackupsReplication
s {$sel:backupRetentionPeriod:StartDBInstanceAutomatedBackupsReplication' :: Maybe Int
backupRetentionPeriod = Maybe Int
a} :: StartDBInstanceAutomatedBackupsReplication)

-- | The Amazon Resource Name (ARN) of the source DB instance for the
-- replicated automated backups, for example,
-- @arn:aws:rds:us-west-2:123456789012:db:mydatabase@.
startDBInstanceAutomatedBackupsReplication_sourceDBInstanceArn :: Lens.Lens' StartDBInstanceAutomatedBackupsReplication Prelude.Text
startDBInstanceAutomatedBackupsReplication_sourceDBInstanceArn :: (Text -> f Text)
-> StartDBInstanceAutomatedBackupsReplication
-> f StartDBInstanceAutomatedBackupsReplication
startDBInstanceAutomatedBackupsReplication_sourceDBInstanceArn = (StartDBInstanceAutomatedBackupsReplication -> Text)
-> (StartDBInstanceAutomatedBackupsReplication
    -> Text -> StartDBInstanceAutomatedBackupsReplication)
-> Lens
     StartDBInstanceAutomatedBackupsReplication
     StartDBInstanceAutomatedBackupsReplication
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDBInstanceAutomatedBackupsReplication' {Text
sourceDBInstanceArn :: Text
$sel:sourceDBInstanceArn:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Text
sourceDBInstanceArn} -> Text
sourceDBInstanceArn) (\s :: StartDBInstanceAutomatedBackupsReplication
s@StartDBInstanceAutomatedBackupsReplication' {} Text
a -> StartDBInstanceAutomatedBackupsReplication
s {$sel:sourceDBInstanceArn:StartDBInstanceAutomatedBackupsReplication' :: Text
sourceDBInstanceArn = Text
a} :: StartDBInstanceAutomatedBackupsReplication)

instance
  Core.AWSRequest
    StartDBInstanceAutomatedBackupsReplication
  where
  type
    AWSResponse
      StartDBInstanceAutomatedBackupsReplication =
      StartDBInstanceAutomatedBackupsReplicationResponse
  request :: StartDBInstanceAutomatedBackupsReplication
-> Request StartDBInstanceAutomatedBackupsReplication
request = Service
-> StartDBInstanceAutomatedBackupsReplication
-> Request StartDBInstanceAutomatedBackupsReplication
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy StartDBInstanceAutomatedBackupsReplication
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse StartDBInstanceAutomatedBackupsReplication)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either
         String (AWSResponse StartDBInstanceAutomatedBackupsReplication))
-> Logger
-> Service
-> Proxy StartDBInstanceAutomatedBackupsReplication
-> ClientResponse ClientBody
-> m (Either
        Error
        (ClientResponse
           (AWSResponse StartDBInstanceAutomatedBackupsReplication)))
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
"StartDBInstanceAutomatedBackupsReplicationResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe DBInstanceAutomatedBackup
-> Int -> StartDBInstanceAutomatedBackupsReplicationResponse
StartDBInstanceAutomatedBackupsReplicationResponse'
            (Maybe DBInstanceAutomatedBackup
 -> Int -> StartDBInstanceAutomatedBackupsReplicationResponse)
-> Either String (Maybe DBInstanceAutomatedBackup)
-> Either
     String (Int -> StartDBInstanceAutomatedBackupsReplicationResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe DBInstanceAutomatedBackup)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"DBInstanceAutomatedBackup")
              Either
  String (Int -> StartDBInstanceAutomatedBackupsReplicationResponse)
-> Either String Int
-> Either String StartDBInstanceAutomatedBackupsReplicationResponse
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
    StartDBInstanceAutomatedBackupsReplication

instance
  Prelude.NFData
    StartDBInstanceAutomatedBackupsReplication

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

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

instance
  Core.ToQuery
    StartDBInstanceAutomatedBackupsReplication
  where
  toQuery :: StartDBInstanceAutomatedBackupsReplication -> QueryString
toQuery
    StartDBInstanceAutomatedBackupsReplication' {Maybe Int
Maybe Text
Text
sourceDBInstanceArn :: Text
backupRetentionPeriod :: Maybe Int
kmsKeyId :: Maybe Text
destinationRegion :: Maybe Text
preSignedUrl :: Maybe Text
$sel:sourceDBInstanceArn:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Text
$sel:backupRetentionPeriod:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Maybe Int
$sel:kmsKeyId:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Maybe Text
$sel:destinationRegion:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Maybe Text
$sel:preSignedUrl:StartDBInstanceAutomatedBackupsReplication' :: StartDBInstanceAutomatedBackupsReplication -> Maybe Text
..} =
      [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
        [ ByteString
"Action"
            ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ( ByteString
"StartDBInstanceAutomatedBackupsReplication" ::
                        Prelude.ByteString
                    ),
          ByteString
"Version"
            ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
          ByteString
"PreSignedUrl" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
preSignedUrl,
          ByteString
"DestinationRegion" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
destinationRegion,
          ByteString
"KmsKeyId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
kmsKeyId,
          ByteString
"BackupRetentionPeriod"
            ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
backupRetentionPeriod,
          ByteString
"SourceDBInstanceArn" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sourceDBInstanceArn
        ]

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

-- |
-- Create a value of 'StartDBInstanceAutomatedBackupsReplicationResponse' 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:
--
-- 'dbInstanceAutomatedBackup', 'startDBInstanceAutomatedBackupsReplicationResponse_dbInstanceAutomatedBackup' - Undocumented member.
--
-- 'httpStatus', 'startDBInstanceAutomatedBackupsReplicationResponse_httpStatus' - The response's http status code.
newStartDBInstanceAutomatedBackupsReplicationResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  StartDBInstanceAutomatedBackupsReplicationResponse
newStartDBInstanceAutomatedBackupsReplicationResponse :: Int -> StartDBInstanceAutomatedBackupsReplicationResponse
newStartDBInstanceAutomatedBackupsReplicationResponse
  Int
pHttpStatus_ =
    StartDBInstanceAutomatedBackupsReplicationResponse' :: Maybe DBInstanceAutomatedBackup
-> Int -> StartDBInstanceAutomatedBackupsReplicationResponse
StartDBInstanceAutomatedBackupsReplicationResponse'
      { $sel:dbInstanceAutomatedBackup:StartDBInstanceAutomatedBackupsReplicationResponse' :: Maybe DBInstanceAutomatedBackup
dbInstanceAutomatedBackup =
          Maybe DBInstanceAutomatedBackup
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:StartDBInstanceAutomatedBackupsReplicationResponse' :: Int
httpStatus =
          Int
pHttpStatus_
      }

-- | Undocumented member.
startDBInstanceAutomatedBackupsReplicationResponse_dbInstanceAutomatedBackup :: Lens.Lens' StartDBInstanceAutomatedBackupsReplicationResponse (Prelude.Maybe DBInstanceAutomatedBackup)
startDBInstanceAutomatedBackupsReplicationResponse_dbInstanceAutomatedBackup :: (Maybe DBInstanceAutomatedBackup
 -> f (Maybe DBInstanceAutomatedBackup))
-> StartDBInstanceAutomatedBackupsReplicationResponse
-> f StartDBInstanceAutomatedBackupsReplicationResponse
startDBInstanceAutomatedBackupsReplicationResponse_dbInstanceAutomatedBackup = (StartDBInstanceAutomatedBackupsReplicationResponse
 -> Maybe DBInstanceAutomatedBackup)
-> (StartDBInstanceAutomatedBackupsReplicationResponse
    -> Maybe DBInstanceAutomatedBackup
    -> StartDBInstanceAutomatedBackupsReplicationResponse)
-> Lens
     StartDBInstanceAutomatedBackupsReplicationResponse
     StartDBInstanceAutomatedBackupsReplicationResponse
     (Maybe DBInstanceAutomatedBackup)
     (Maybe DBInstanceAutomatedBackup)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartDBInstanceAutomatedBackupsReplicationResponse' {Maybe DBInstanceAutomatedBackup
dbInstanceAutomatedBackup :: Maybe DBInstanceAutomatedBackup
$sel:dbInstanceAutomatedBackup:StartDBInstanceAutomatedBackupsReplicationResponse' :: StartDBInstanceAutomatedBackupsReplicationResponse
-> Maybe DBInstanceAutomatedBackup
dbInstanceAutomatedBackup} -> Maybe DBInstanceAutomatedBackup
dbInstanceAutomatedBackup) (\s :: StartDBInstanceAutomatedBackupsReplicationResponse
s@StartDBInstanceAutomatedBackupsReplicationResponse' {} Maybe DBInstanceAutomatedBackup
a -> StartDBInstanceAutomatedBackupsReplicationResponse
s {$sel:dbInstanceAutomatedBackup:StartDBInstanceAutomatedBackupsReplicationResponse' :: Maybe DBInstanceAutomatedBackup
dbInstanceAutomatedBackup = Maybe DBInstanceAutomatedBackup
a} :: StartDBInstanceAutomatedBackupsReplicationResponse)

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

instance
  Prelude.NFData
    StartDBInstanceAutomatedBackupsReplicationResponse