{-# 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.CopyDBSnapshot
-- 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)
--
-- Copies the specified DB snapshot. The source DB snapshot must be in the
-- @available@ state.
--
-- You can copy a snapshot from one Amazon Web Services Region to another.
-- In that case, the Amazon Web Services Region where you call the
-- @CopyDBSnapshot@ action is the destination Amazon Web Services Region
-- for the DB snapshot copy.
--
-- For more information about copying snapshots, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopyDBSnapshot Copying a DB Snapshot>
-- in the /Amazon RDS User Guide./
module Amazonka.RDS.CopyDBSnapshot
  ( -- * Creating a Request
    CopyDBSnapshot (..),
    newCopyDBSnapshot,

    -- * Request Lenses
    copyDBSnapshot_targetCustomAvailabilityZone,
    copyDBSnapshot_preSignedUrl,
    copyDBSnapshot_copyTags,
    copyDBSnapshot_destinationRegion,
    copyDBSnapshot_kmsKeyId,
    copyDBSnapshot_optionGroupName,
    copyDBSnapshot_tags,
    copyDBSnapshot_sourceDBSnapshotIdentifier,
    copyDBSnapshot_targetDBSnapshotIdentifier,

    -- * Destructuring the Response
    CopyDBSnapshotResponse (..),
    newCopyDBSnapshotResponse,

    -- * Response Lenses
    copyDBSnapshotResponse_dbSnapshot,
    copyDBSnapshotResponse_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:/ 'newCopyDBSnapshot' smart constructor.
data CopyDBSnapshot = CopyDBSnapshot'
  { -- | The external custom Availability Zone (CAZ) identifier for the target
    -- CAZ.
    --
    -- Example: @rds-caz-aiqhTgQv@.
    CopyDBSnapshot -> Maybe Text
targetCustomAvailabilityZone :: Prelude.Maybe Prelude.Text,
    -- | The URL that contains a Signature Version 4 signed request for the
    -- @CopyDBSnapshot@ API action in the source Amazon Web Services Region
    -- that contains the source DB snapshot to copy.
    --
    -- You must specify this parameter when you copy an encrypted DB snapshot
    -- from another Amazon Web Services Region by using the Amazon RDS API.
    -- Don\'t specify @PreSignedUrl@ when you are copying an encrypted DB
    -- snapshot in the same Amazon Web Services Region.
    --
    -- The presigned URL must be a valid request for the @CopyDBSnapshot@ API
    -- action that can be executed in the source Amazon Web Services Region
    -- that contains the encrypted DB snapshot to be copied. The presigned URL
    -- request must contain the following parameter values:
    --
    -- -   @DestinationRegion@ - The Amazon Web Services Region that the
    --     encrypted DB snapshot is copied to. This Amazon Web Services Region
    --     is the same one where the @CopyDBSnapshot@ action is called that
    --     contains this presigned URL.
    --
    --     For example, if you copy an encrypted DB snapshot from the us-west-2
    --     Amazon Web Services Region to the us-east-1 Amazon Web Services
    --     Region, then you call the @CopyDBSnapshot@ action in the us-east-1
    --     Amazon Web Services Region and provide a presigned URL that contains
    --     a call to the @CopyDBSnapshot@ action in the us-west-2 Amazon Web
    --     Services Region. For this example, the @DestinationRegion@ in the
    --     presigned URL must be set to the us-east-1 Amazon Web Services
    --     Region.
    --
    -- -   @KmsKeyId@ - The Amazon Web Services KMS key identifier for the
    --     customer master key (CMK) to use to encrypt the copy of the DB
    --     snapshot in the destination Amazon Web Services Region. This is the
    --     same identifier for both the @CopyDBSnapshot@ action that is called
    --     in the destination Amazon Web Services Region, and the action
    --     contained in the presigned URL.
    --
    -- -   @SourceDBSnapshotIdentifier@ - The DB snapshot identifier for the
    --     encrypted snapshot to be copied. This identifier must be in the
    --     Amazon Resource Name (ARN) format for the source Amazon Web Services
    --     Region. For example, if you are copying an encrypted DB snapshot
    --     from the us-west-2 Amazon Web Services Region, then your
    --     @SourceDBSnapshotIdentifier@ looks like the following example:
    --     @arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115@.
    --
    -- To learn how to generate a Signature Version 4 signed request, see
    -- <https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)>
    -- and
    -- <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html Signature Version 4 Signing Process>.
    --
    -- If you are using an Amazon Web Services SDK tool or the CLI, you can
    -- specify @SourceRegion@ (or @--source-region@ for the CLI) instead of
    -- specifying @PreSignedUrl@ manually. Specifying @SourceRegion@
    -- autogenerates a pre-signed URL that is a valid request for the operation
    -- that can be executed in the source Amazon Web Services Region.
    CopyDBSnapshot -> Maybe Text
preSignedUrl :: Prelude.Maybe Prelude.Text,
    -- | A value that indicates whether to copy all tags from the source DB
    -- snapshot to the target DB snapshot. By default, tags are not copied.
    CopyDBSnapshot -> Maybe Bool
copyTags :: Prelude.Maybe Prelude.Bool,
    -- | Pseudo-parameter used when populating the @PreSignedUrl@ of a
    -- cross-region @CopyDBSnapshot@ 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@.
    CopyDBSnapshot -> Maybe Text
destinationRegion :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Web Services KMS key identifier for an encrypted DB snapshot.
    -- 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).
    --
    -- If you copy an encrypted DB snapshot from your Amazon Web Services
    -- account, you can specify a value for this parameter to encrypt the copy
    -- with a new Amazon Web Services KMS CMK. If you don\'t specify a value
    -- for this parameter, then the copy of the DB snapshot is encrypted with
    -- the same Amazon Web Services KMS key as the source DB snapshot.
    --
    -- If you copy an encrypted DB snapshot that is shared from another Amazon
    -- Web Services account, then you must specify a value for this parameter.
    --
    -- If you specify this parameter when you copy an unencrypted snapshot, the
    -- copy is encrypted.
    --
    -- If you copy an encrypted snapshot to a different Amazon Web Services
    -- Region, then you must specify a Amazon Web Services KMS key identifier
    -- for the destination Amazon Web Services Region. Amazon Web Services KMS
    -- CMKs are specific to the Amazon Web Services Region that they are
    -- created in, and you can\'t use CMKs from one Amazon Web Services Region
    -- in another Amazon Web Services Region.
    CopyDBSnapshot -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The name of an option group to associate with the copy of the snapshot.
    --
    -- Specify this option if you are copying a snapshot from one Amazon Web
    -- Services Region to another, and your DB instance uses a nondefault
    -- option group. If your source DB instance uses Transparent Data
    -- Encryption for Oracle or Microsoft SQL Server, you must specify this
    -- option when copying across Amazon Web Services Regions. For more
    -- information, see
    -- <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopySnapshot.Options Option group considerations>
    -- in the /Amazon RDS User Guide./
    CopyDBSnapshot -> Maybe Text
optionGroupName :: Prelude.Maybe Prelude.Text,
    CopyDBSnapshot -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The identifier for the source DB snapshot.
    --
    -- If the source snapshot is in the same Amazon Web Services Region as the
    -- copy, specify a valid DB snapshot identifier. For example, you might
    -- specify @rds:mysql-instance1-snapshot-20130805@.
    --
    -- If the source snapshot is in a different Amazon Web Services Region than
    -- the copy, specify a valid DB snapshot ARN. For example, you might
    -- specify
    -- @arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805@.
    --
    -- If you are copying from a shared manual DB snapshot, this parameter must
    -- be the Amazon Resource Name (ARN) of the shared DB snapshot.
    --
    -- If you are copying an encrypted snapshot this parameter must be in the
    -- ARN format for the source Amazon Web Services Region, and must match the
    -- @SourceDBSnapshotIdentifier@ in the @PreSignedUrl@ parameter.
    --
    -- Constraints:
    --
    -- -   Must specify a valid system snapshot in the \"available\" state.
    --
    -- Example: @rds:mydb-2012-04-02-00-01@
    --
    -- Example:
    -- @arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805@
    CopyDBSnapshot -> Text
sourceDBSnapshotIdentifier :: Prelude.Text,
    -- | The identifier for the copy of the snapshot.
    --
    -- Constraints:
    --
    -- -   Can\'t be null, empty, or blank
    --
    -- -   Must contain from 1 to 255 letters, numbers, or hyphens
    --
    -- -   First character must be a letter
    --
    -- -   Can\'t end with a hyphen or contain two consecutive hyphens
    --
    -- Example: @my-db-snapshot@
    CopyDBSnapshot -> Text
targetDBSnapshotIdentifier :: Prelude.Text
  }
  deriving (CopyDBSnapshot -> CopyDBSnapshot -> Bool
(CopyDBSnapshot -> CopyDBSnapshot -> Bool)
-> (CopyDBSnapshot -> CopyDBSnapshot -> Bool) -> Eq CopyDBSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyDBSnapshot -> CopyDBSnapshot -> Bool
$c/= :: CopyDBSnapshot -> CopyDBSnapshot -> Bool
== :: CopyDBSnapshot -> CopyDBSnapshot -> Bool
$c== :: CopyDBSnapshot -> CopyDBSnapshot -> Bool
Prelude.Eq, ReadPrec [CopyDBSnapshot]
ReadPrec CopyDBSnapshot
Int -> ReadS CopyDBSnapshot
ReadS [CopyDBSnapshot]
(Int -> ReadS CopyDBSnapshot)
-> ReadS [CopyDBSnapshot]
-> ReadPrec CopyDBSnapshot
-> ReadPrec [CopyDBSnapshot]
-> Read CopyDBSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CopyDBSnapshot]
$creadListPrec :: ReadPrec [CopyDBSnapshot]
readPrec :: ReadPrec CopyDBSnapshot
$creadPrec :: ReadPrec CopyDBSnapshot
readList :: ReadS [CopyDBSnapshot]
$creadList :: ReadS [CopyDBSnapshot]
readsPrec :: Int -> ReadS CopyDBSnapshot
$creadsPrec :: Int -> ReadS CopyDBSnapshot
Prelude.Read, Int -> CopyDBSnapshot -> ShowS
[CopyDBSnapshot] -> ShowS
CopyDBSnapshot -> String
(Int -> CopyDBSnapshot -> ShowS)
-> (CopyDBSnapshot -> String)
-> ([CopyDBSnapshot] -> ShowS)
-> Show CopyDBSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyDBSnapshot] -> ShowS
$cshowList :: [CopyDBSnapshot] -> ShowS
show :: CopyDBSnapshot -> String
$cshow :: CopyDBSnapshot -> String
showsPrec :: Int -> CopyDBSnapshot -> ShowS
$cshowsPrec :: Int -> CopyDBSnapshot -> ShowS
Prelude.Show, (forall x. CopyDBSnapshot -> Rep CopyDBSnapshot x)
-> (forall x. Rep CopyDBSnapshot x -> CopyDBSnapshot)
-> Generic CopyDBSnapshot
forall x. Rep CopyDBSnapshot x -> CopyDBSnapshot
forall x. CopyDBSnapshot -> Rep CopyDBSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyDBSnapshot x -> CopyDBSnapshot
$cfrom :: forall x. CopyDBSnapshot -> Rep CopyDBSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'CopyDBSnapshot' 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:
--
-- 'targetCustomAvailabilityZone', 'copyDBSnapshot_targetCustomAvailabilityZone' - The external custom Availability Zone (CAZ) identifier for the target
-- CAZ.
--
-- Example: @rds-caz-aiqhTgQv@.
--
-- 'preSignedUrl', 'copyDBSnapshot_preSignedUrl' - The URL that contains a Signature Version 4 signed request for the
-- @CopyDBSnapshot@ API action in the source Amazon Web Services Region
-- that contains the source DB snapshot to copy.
--
-- You must specify this parameter when you copy an encrypted DB snapshot
-- from another Amazon Web Services Region by using the Amazon RDS API.
-- Don\'t specify @PreSignedUrl@ when you are copying an encrypted DB
-- snapshot in the same Amazon Web Services Region.
--
-- The presigned URL must be a valid request for the @CopyDBSnapshot@ API
-- action that can be executed in the source Amazon Web Services Region
-- that contains the encrypted DB snapshot to be copied. The presigned URL
-- request must contain the following parameter values:
--
-- -   @DestinationRegion@ - The Amazon Web Services Region that the
--     encrypted DB snapshot is copied to. This Amazon Web Services Region
--     is the same one where the @CopyDBSnapshot@ action is called that
--     contains this presigned URL.
--
--     For example, if you copy an encrypted DB snapshot from the us-west-2
--     Amazon Web Services Region to the us-east-1 Amazon Web Services
--     Region, then you call the @CopyDBSnapshot@ action in the us-east-1
--     Amazon Web Services Region and provide a presigned URL that contains
--     a call to the @CopyDBSnapshot@ action in the us-west-2 Amazon Web
--     Services Region. For this example, the @DestinationRegion@ in the
--     presigned URL must be set to the us-east-1 Amazon Web Services
--     Region.
--
-- -   @KmsKeyId@ - The Amazon Web Services KMS key identifier for the
--     customer master key (CMK) to use to encrypt the copy of the DB
--     snapshot in the destination Amazon Web Services Region. This is the
--     same identifier for both the @CopyDBSnapshot@ action that is called
--     in the destination Amazon Web Services Region, and the action
--     contained in the presigned URL.
--
-- -   @SourceDBSnapshotIdentifier@ - The DB snapshot identifier for the
--     encrypted snapshot to be copied. This identifier must be in the
--     Amazon Resource Name (ARN) format for the source Amazon Web Services
--     Region. For example, if you are copying an encrypted DB snapshot
--     from the us-west-2 Amazon Web Services Region, then your
--     @SourceDBSnapshotIdentifier@ looks like the following example:
--     @arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115@.
--
-- To learn how to generate a Signature Version 4 signed request, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)>
-- and
-- <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html Signature Version 4 Signing Process>.
--
-- If you are using an Amazon Web Services SDK tool or the CLI, you can
-- specify @SourceRegion@ (or @--source-region@ for the CLI) instead of
-- specifying @PreSignedUrl@ manually. Specifying @SourceRegion@
-- autogenerates a pre-signed URL that is a valid request for the operation
-- that can be executed in the source Amazon Web Services Region.
--
-- 'copyTags', 'copyDBSnapshot_copyTags' - A value that indicates whether to copy all tags from the source DB
-- snapshot to the target DB snapshot. By default, tags are not copied.
--
-- 'destinationRegion', 'copyDBSnapshot_destinationRegion' - Pseudo-parameter used when populating the @PreSignedUrl@ of a
-- cross-region @CopyDBSnapshot@ 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', 'copyDBSnapshot_kmsKeyId' - The Amazon Web Services KMS key identifier for an encrypted DB snapshot.
-- 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).
--
-- If you copy an encrypted DB snapshot from your Amazon Web Services
-- account, you can specify a value for this parameter to encrypt the copy
-- with a new Amazon Web Services KMS CMK. If you don\'t specify a value
-- for this parameter, then the copy of the DB snapshot is encrypted with
-- the same Amazon Web Services KMS key as the source DB snapshot.
--
-- If you copy an encrypted DB snapshot that is shared from another Amazon
-- Web Services account, then you must specify a value for this parameter.
--
-- If you specify this parameter when you copy an unencrypted snapshot, the
-- copy is encrypted.
--
-- If you copy an encrypted snapshot to a different Amazon Web Services
-- Region, then you must specify a Amazon Web Services KMS key identifier
-- for the destination Amazon Web Services Region. Amazon Web Services KMS
-- CMKs are specific to the Amazon Web Services Region that they are
-- created in, and you can\'t use CMKs from one Amazon Web Services Region
-- in another Amazon Web Services Region.
--
-- 'optionGroupName', 'copyDBSnapshot_optionGroupName' - The name of an option group to associate with the copy of the snapshot.
--
-- Specify this option if you are copying a snapshot from one Amazon Web
-- Services Region to another, and your DB instance uses a nondefault
-- option group. If your source DB instance uses Transparent Data
-- Encryption for Oracle or Microsoft SQL Server, you must specify this
-- option when copying across Amazon Web Services Regions. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopySnapshot.Options Option group considerations>
-- in the /Amazon RDS User Guide./
--
-- 'tags', 'copyDBSnapshot_tags' - Undocumented member.
--
-- 'sourceDBSnapshotIdentifier', 'copyDBSnapshot_sourceDBSnapshotIdentifier' - The identifier for the source DB snapshot.
--
-- If the source snapshot is in the same Amazon Web Services Region as the
-- copy, specify a valid DB snapshot identifier. For example, you might
-- specify @rds:mysql-instance1-snapshot-20130805@.
--
-- If the source snapshot is in a different Amazon Web Services Region than
-- the copy, specify a valid DB snapshot ARN. For example, you might
-- specify
-- @arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805@.
--
-- If you are copying from a shared manual DB snapshot, this parameter must
-- be the Amazon Resource Name (ARN) of the shared DB snapshot.
--
-- If you are copying an encrypted snapshot this parameter must be in the
-- ARN format for the source Amazon Web Services Region, and must match the
-- @SourceDBSnapshotIdentifier@ in the @PreSignedUrl@ parameter.
--
-- Constraints:
--
-- -   Must specify a valid system snapshot in the \"available\" state.
--
-- Example: @rds:mydb-2012-04-02-00-01@
--
-- Example:
-- @arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805@
--
-- 'targetDBSnapshotIdentifier', 'copyDBSnapshot_targetDBSnapshotIdentifier' - The identifier for the copy of the snapshot.
--
-- Constraints:
--
-- -   Can\'t be null, empty, or blank
--
-- -   Must contain from 1 to 255 letters, numbers, or hyphens
--
-- -   First character must be a letter
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens
--
-- Example: @my-db-snapshot@
newCopyDBSnapshot ::
  -- | 'sourceDBSnapshotIdentifier'
  Prelude.Text ->
  -- | 'targetDBSnapshotIdentifier'
  Prelude.Text ->
  CopyDBSnapshot
newCopyDBSnapshot :: Text -> Text -> CopyDBSnapshot
newCopyDBSnapshot
  Text
pSourceDBSnapshotIdentifier_
  Text
pTargetDBSnapshotIdentifier_ =
    CopyDBSnapshot' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> Text
-> Text
-> CopyDBSnapshot
CopyDBSnapshot'
      { $sel:targetCustomAvailabilityZone:CopyDBSnapshot' :: Maybe Text
targetCustomAvailabilityZone =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:preSignedUrl:CopyDBSnapshot' :: Maybe Text
preSignedUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:copyTags:CopyDBSnapshot' :: Maybe Bool
copyTags = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
        $sel:destinationRegion:CopyDBSnapshot' :: Maybe Text
destinationRegion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:kmsKeyId:CopyDBSnapshot' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:optionGroupName:CopyDBSnapshot' :: Maybe Text
optionGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:CopyDBSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceDBSnapshotIdentifier:CopyDBSnapshot' :: Text
sourceDBSnapshotIdentifier =
          Text
pSourceDBSnapshotIdentifier_,
        $sel:targetDBSnapshotIdentifier:CopyDBSnapshot' :: Text
targetDBSnapshotIdentifier =
          Text
pTargetDBSnapshotIdentifier_
      }

-- | The external custom Availability Zone (CAZ) identifier for the target
-- CAZ.
--
-- Example: @rds-caz-aiqhTgQv@.
copyDBSnapshot_targetCustomAvailabilityZone :: Lens.Lens' CopyDBSnapshot (Prelude.Maybe Prelude.Text)
copyDBSnapshot_targetCustomAvailabilityZone :: (Maybe Text -> f (Maybe Text))
-> CopyDBSnapshot -> f CopyDBSnapshot
copyDBSnapshot_targetCustomAvailabilityZone = (CopyDBSnapshot -> Maybe Text)
-> (CopyDBSnapshot -> Maybe Text -> CopyDBSnapshot)
-> Lens CopyDBSnapshot CopyDBSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshot' {Maybe Text
targetCustomAvailabilityZone :: Maybe Text
$sel:targetCustomAvailabilityZone:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Text
targetCustomAvailabilityZone} -> Maybe Text
targetCustomAvailabilityZone) (\s :: CopyDBSnapshot
s@CopyDBSnapshot' {} Maybe Text
a -> CopyDBSnapshot
s {$sel:targetCustomAvailabilityZone:CopyDBSnapshot' :: Maybe Text
targetCustomAvailabilityZone = Maybe Text
a} :: CopyDBSnapshot)

-- | The URL that contains a Signature Version 4 signed request for the
-- @CopyDBSnapshot@ API action in the source Amazon Web Services Region
-- that contains the source DB snapshot to copy.
--
-- You must specify this parameter when you copy an encrypted DB snapshot
-- from another Amazon Web Services Region by using the Amazon RDS API.
-- Don\'t specify @PreSignedUrl@ when you are copying an encrypted DB
-- snapshot in the same Amazon Web Services Region.
--
-- The presigned URL must be a valid request for the @CopyDBSnapshot@ API
-- action that can be executed in the source Amazon Web Services Region
-- that contains the encrypted DB snapshot to be copied. The presigned URL
-- request must contain the following parameter values:
--
-- -   @DestinationRegion@ - The Amazon Web Services Region that the
--     encrypted DB snapshot is copied to. This Amazon Web Services Region
--     is the same one where the @CopyDBSnapshot@ action is called that
--     contains this presigned URL.
--
--     For example, if you copy an encrypted DB snapshot from the us-west-2
--     Amazon Web Services Region to the us-east-1 Amazon Web Services
--     Region, then you call the @CopyDBSnapshot@ action in the us-east-1
--     Amazon Web Services Region and provide a presigned URL that contains
--     a call to the @CopyDBSnapshot@ action in the us-west-2 Amazon Web
--     Services Region. For this example, the @DestinationRegion@ in the
--     presigned URL must be set to the us-east-1 Amazon Web Services
--     Region.
--
-- -   @KmsKeyId@ - The Amazon Web Services KMS key identifier for the
--     customer master key (CMK) to use to encrypt the copy of the DB
--     snapshot in the destination Amazon Web Services Region. This is the
--     same identifier for both the @CopyDBSnapshot@ action that is called
--     in the destination Amazon Web Services Region, and the action
--     contained in the presigned URL.
--
-- -   @SourceDBSnapshotIdentifier@ - The DB snapshot identifier for the
--     encrypted snapshot to be copied. This identifier must be in the
--     Amazon Resource Name (ARN) format for the source Amazon Web Services
--     Region. For example, if you are copying an encrypted DB snapshot
--     from the us-west-2 Amazon Web Services Region, then your
--     @SourceDBSnapshotIdentifier@ looks like the following example:
--     @arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20161115@.
--
-- To learn how to generate a Signature Version 4 signed request, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html Authenticating Requests: Using Query Parameters (Amazon Web Services Signature Version 4)>
-- and
-- <https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html Signature Version 4 Signing Process>.
--
-- If you are using an Amazon Web Services SDK tool or the CLI, you can
-- specify @SourceRegion@ (or @--source-region@ for the CLI) instead of
-- specifying @PreSignedUrl@ manually. Specifying @SourceRegion@
-- autogenerates a pre-signed URL that is a valid request for the operation
-- that can be executed in the source Amazon Web Services Region.
copyDBSnapshot_preSignedUrl :: Lens.Lens' CopyDBSnapshot (Prelude.Maybe Prelude.Text)
copyDBSnapshot_preSignedUrl :: (Maybe Text -> f (Maybe Text))
-> CopyDBSnapshot -> f CopyDBSnapshot
copyDBSnapshot_preSignedUrl = (CopyDBSnapshot -> Maybe Text)
-> (CopyDBSnapshot -> Maybe Text -> CopyDBSnapshot)
-> Lens CopyDBSnapshot CopyDBSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshot' {Maybe Text
preSignedUrl :: Maybe Text
$sel:preSignedUrl:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Text
preSignedUrl} -> Maybe Text
preSignedUrl) (\s :: CopyDBSnapshot
s@CopyDBSnapshot' {} Maybe Text
a -> CopyDBSnapshot
s {$sel:preSignedUrl:CopyDBSnapshot' :: Maybe Text
preSignedUrl = Maybe Text
a} :: CopyDBSnapshot)

-- | A value that indicates whether to copy all tags from the source DB
-- snapshot to the target DB snapshot. By default, tags are not copied.
copyDBSnapshot_copyTags :: Lens.Lens' CopyDBSnapshot (Prelude.Maybe Prelude.Bool)
copyDBSnapshot_copyTags :: (Maybe Bool -> f (Maybe Bool))
-> CopyDBSnapshot -> f CopyDBSnapshot
copyDBSnapshot_copyTags = (CopyDBSnapshot -> Maybe Bool)
-> (CopyDBSnapshot -> Maybe Bool -> CopyDBSnapshot)
-> Lens CopyDBSnapshot CopyDBSnapshot (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshot' {Maybe Bool
copyTags :: Maybe Bool
$sel:copyTags:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Bool
copyTags} -> Maybe Bool
copyTags) (\s :: CopyDBSnapshot
s@CopyDBSnapshot' {} Maybe Bool
a -> CopyDBSnapshot
s {$sel:copyTags:CopyDBSnapshot' :: Maybe Bool
copyTags = Maybe Bool
a} :: CopyDBSnapshot)

-- | Pseudo-parameter used when populating the @PreSignedUrl@ of a
-- cross-region @CopyDBSnapshot@ 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@.
copyDBSnapshot_destinationRegion :: Lens.Lens' CopyDBSnapshot (Prelude.Maybe Prelude.Text)
copyDBSnapshot_destinationRegion :: (Maybe Text -> f (Maybe Text))
-> CopyDBSnapshot -> f CopyDBSnapshot
copyDBSnapshot_destinationRegion = (CopyDBSnapshot -> Maybe Text)
-> (CopyDBSnapshot -> Maybe Text -> CopyDBSnapshot)
-> Lens CopyDBSnapshot CopyDBSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshot' {Maybe Text
destinationRegion :: Maybe Text
$sel:destinationRegion:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Text
destinationRegion} -> Maybe Text
destinationRegion) (\s :: CopyDBSnapshot
s@CopyDBSnapshot' {} Maybe Text
a -> CopyDBSnapshot
s {$sel:destinationRegion:CopyDBSnapshot' :: Maybe Text
destinationRegion = Maybe Text
a} :: CopyDBSnapshot)

-- | The Amazon Web Services KMS key identifier for an encrypted DB snapshot.
-- 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).
--
-- If you copy an encrypted DB snapshot from your Amazon Web Services
-- account, you can specify a value for this parameter to encrypt the copy
-- with a new Amazon Web Services KMS CMK. If you don\'t specify a value
-- for this parameter, then the copy of the DB snapshot is encrypted with
-- the same Amazon Web Services KMS key as the source DB snapshot.
--
-- If you copy an encrypted DB snapshot that is shared from another Amazon
-- Web Services account, then you must specify a value for this parameter.
--
-- If you specify this parameter when you copy an unencrypted snapshot, the
-- copy is encrypted.
--
-- If you copy an encrypted snapshot to a different Amazon Web Services
-- Region, then you must specify a Amazon Web Services KMS key identifier
-- for the destination Amazon Web Services Region. Amazon Web Services KMS
-- CMKs are specific to the Amazon Web Services Region that they are
-- created in, and you can\'t use CMKs from one Amazon Web Services Region
-- in another Amazon Web Services Region.
copyDBSnapshot_kmsKeyId :: Lens.Lens' CopyDBSnapshot (Prelude.Maybe Prelude.Text)
copyDBSnapshot_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> CopyDBSnapshot -> f CopyDBSnapshot
copyDBSnapshot_kmsKeyId = (CopyDBSnapshot -> Maybe Text)
-> (CopyDBSnapshot -> Maybe Text -> CopyDBSnapshot)
-> Lens CopyDBSnapshot CopyDBSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshot' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: CopyDBSnapshot
s@CopyDBSnapshot' {} Maybe Text
a -> CopyDBSnapshot
s {$sel:kmsKeyId:CopyDBSnapshot' :: Maybe Text
kmsKeyId = Maybe Text
a} :: CopyDBSnapshot)

-- | The name of an option group to associate with the copy of the snapshot.
--
-- Specify this option if you are copying a snapshot from one Amazon Web
-- Services Region to another, and your DB instance uses a nondefault
-- option group. If your source DB instance uses Transparent Data
-- Encryption for Oracle or Microsoft SQL Server, you must specify this
-- option when copying across Amazon Web Services Regions. For more
-- information, see
-- <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopySnapshot.Options Option group considerations>
-- in the /Amazon RDS User Guide./
copyDBSnapshot_optionGroupName :: Lens.Lens' CopyDBSnapshot (Prelude.Maybe Prelude.Text)
copyDBSnapshot_optionGroupName :: (Maybe Text -> f (Maybe Text))
-> CopyDBSnapshot -> f CopyDBSnapshot
copyDBSnapshot_optionGroupName = (CopyDBSnapshot -> Maybe Text)
-> (CopyDBSnapshot -> Maybe Text -> CopyDBSnapshot)
-> Lens CopyDBSnapshot CopyDBSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshot' {Maybe Text
optionGroupName :: Maybe Text
$sel:optionGroupName:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Text
optionGroupName} -> Maybe Text
optionGroupName) (\s :: CopyDBSnapshot
s@CopyDBSnapshot' {} Maybe Text
a -> CopyDBSnapshot
s {$sel:optionGroupName:CopyDBSnapshot' :: Maybe Text
optionGroupName = Maybe Text
a} :: CopyDBSnapshot)

-- | Undocumented member.
copyDBSnapshot_tags :: Lens.Lens' CopyDBSnapshot (Prelude.Maybe [Tag])
copyDBSnapshot_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CopyDBSnapshot -> f CopyDBSnapshot
copyDBSnapshot_tags = (CopyDBSnapshot -> Maybe [Tag])
-> (CopyDBSnapshot -> Maybe [Tag] -> CopyDBSnapshot)
-> Lens CopyDBSnapshot CopyDBSnapshot (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshot' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CopyDBSnapshot
s@CopyDBSnapshot' {} Maybe [Tag]
a -> CopyDBSnapshot
s {$sel:tags:CopyDBSnapshot' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CopyDBSnapshot) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CopyDBSnapshot -> f CopyDBSnapshot)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CopyDBSnapshot
-> f CopyDBSnapshot
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 identifier for the source DB snapshot.
--
-- If the source snapshot is in the same Amazon Web Services Region as the
-- copy, specify a valid DB snapshot identifier. For example, you might
-- specify @rds:mysql-instance1-snapshot-20130805@.
--
-- If the source snapshot is in a different Amazon Web Services Region than
-- the copy, specify a valid DB snapshot ARN. For example, you might
-- specify
-- @arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805@.
--
-- If you are copying from a shared manual DB snapshot, this parameter must
-- be the Amazon Resource Name (ARN) of the shared DB snapshot.
--
-- If you are copying an encrypted snapshot this parameter must be in the
-- ARN format for the source Amazon Web Services Region, and must match the
-- @SourceDBSnapshotIdentifier@ in the @PreSignedUrl@ parameter.
--
-- Constraints:
--
-- -   Must specify a valid system snapshot in the \"available\" state.
--
-- Example: @rds:mydb-2012-04-02-00-01@
--
-- Example:
-- @arn:aws:rds:us-west-2:123456789012:snapshot:mysql-instance1-snapshot-20130805@
copyDBSnapshot_sourceDBSnapshotIdentifier :: Lens.Lens' CopyDBSnapshot Prelude.Text
copyDBSnapshot_sourceDBSnapshotIdentifier :: (Text -> f Text) -> CopyDBSnapshot -> f CopyDBSnapshot
copyDBSnapshot_sourceDBSnapshotIdentifier = (CopyDBSnapshot -> Text)
-> (CopyDBSnapshot -> Text -> CopyDBSnapshot)
-> Lens CopyDBSnapshot CopyDBSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshot' {Text
sourceDBSnapshotIdentifier :: Text
$sel:sourceDBSnapshotIdentifier:CopyDBSnapshot' :: CopyDBSnapshot -> Text
sourceDBSnapshotIdentifier} -> Text
sourceDBSnapshotIdentifier) (\s :: CopyDBSnapshot
s@CopyDBSnapshot' {} Text
a -> CopyDBSnapshot
s {$sel:sourceDBSnapshotIdentifier:CopyDBSnapshot' :: Text
sourceDBSnapshotIdentifier = Text
a} :: CopyDBSnapshot)

-- | The identifier for the copy of the snapshot.
--
-- Constraints:
--
-- -   Can\'t be null, empty, or blank
--
-- -   Must contain from 1 to 255 letters, numbers, or hyphens
--
-- -   First character must be a letter
--
-- -   Can\'t end with a hyphen or contain two consecutive hyphens
--
-- Example: @my-db-snapshot@
copyDBSnapshot_targetDBSnapshotIdentifier :: Lens.Lens' CopyDBSnapshot Prelude.Text
copyDBSnapshot_targetDBSnapshotIdentifier :: (Text -> f Text) -> CopyDBSnapshot -> f CopyDBSnapshot
copyDBSnapshot_targetDBSnapshotIdentifier = (CopyDBSnapshot -> Text)
-> (CopyDBSnapshot -> Text -> CopyDBSnapshot)
-> Lens CopyDBSnapshot CopyDBSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshot' {Text
targetDBSnapshotIdentifier :: Text
$sel:targetDBSnapshotIdentifier:CopyDBSnapshot' :: CopyDBSnapshot -> Text
targetDBSnapshotIdentifier} -> Text
targetDBSnapshotIdentifier) (\s :: CopyDBSnapshot
s@CopyDBSnapshot' {} Text
a -> CopyDBSnapshot
s {$sel:targetDBSnapshotIdentifier:CopyDBSnapshot' :: Text
targetDBSnapshotIdentifier = Text
a} :: CopyDBSnapshot)

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

instance Prelude.NFData CopyDBSnapshot

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

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

instance Core.ToQuery CopyDBSnapshot where
  toQuery :: CopyDBSnapshot -> QueryString
toQuery CopyDBSnapshot' {Maybe Bool
Maybe [Tag]
Maybe Text
Text
targetDBSnapshotIdentifier :: Text
sourceDBSnapshotIdentifier :: Text
tags :: Maybe [Tag]
optionGroupName :: Maybe Text
kmsKeyId :: Maybe Text
destinationRegion :: Maybe Text
copyTags :: Maybe Bool
preSignedUrl :: Maybe Text
targetCustomAvailabilityZone :: Maybe Text
$sel:targetDBSnapshotIdentifier:CopyDBSnapshot' :: CopyDBSnapshot -> Text
$sel:sourceDBSnapshotIdentifier:CopyDBSnapshot' :: CopyDBSnapshot -> Text
$sel:tags:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe [Tag]
$sel:optionGroupName:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Text
$sel:kmsKeyId:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Text
$sel:destinationRegion:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Text
$sel:copyTags:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Bool
$sel:preSignedUrl:CopyDBSnapshot' :: CopyDBSnapshot -> Maybe Text
$sel:targetCustomAvailabilityZone:CopyDBSnapshot' :: CopyDBSnapshot -> 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
"CopyDBSnapshot" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
        ByteString
"TargetCustomAvailabilityZone"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
targetCustomAvailabilityZone,
        ByteString
"PreSignedUrl" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
preSignedUrl,
        ByteString
"CopyTags" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
copyTags,
        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
"OptionGroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
optionGroupName,
        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
"SourceDBSnapshotIdentifier"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sourceDBSnapshotIdentifier,
        ByteString
"TargetDBSnapshotIdentifier"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
targetDBSnapshotIdentifier
      ]

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

-- |
-- Create a value of 'CopyDBSnapshotResponse' 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:
--
-- 'dbSnapshot', 'copyDBSnapshotResponse_dbSnapshot' - Undocumented member.
--
-- 'httpStatus', 'copyDBSnapshotResponse_httpStatus' - The response's http status code.
newCopyDBSnapshotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CopyDBSnapshotResponse
newCopyDBSnapshotResponse :: Int -> CopyDBSnapshotResponse
newCopyDBSnapshotResponse Int
pHttpStatus_ =
  CopyDBSnapshotResponse' :: Maybe DBSnapshot -> Int -> CopyDBSnapshotResponse
CopyDBSnapshotResponse'
    { $sel:dbSnapshot:CopyDBSnapshotResponse' :: Maybe DBSnapshot
dbSnapshot =
        Maybe DBSnapshot
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CopyDBSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
copyDBSnapshotResponse_dbSnapshot :: Lens.Lens' CopyDBSnapshotResponse (Prelude.Maybe DBSnapshot)
copyDBSnapshotResponse_dbSnapshot :: (Maybe DBSnapshot -> f (Maybe DBSnapshot))
-> CopyDBSnapshotResponse -> f CopyDBSnapshotResponse
copyDBSnapshotResponse_dbSnapshot = (CopyDBSnapshotResponse -> Maybe DBSnapshot)
-> (CopyDBSnapshotResponse
    -> Maybe DBSnapshot -> CopyDBSnapshotResponse)
-> Lens
     CopyDBSnapshotResponse
     CopyDBSnapshotResponse
     (Maybe DBSnapshot)
     (Maybe DBSnapshot)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyDBSnapshotResponse' {Maybe DBSnapshot
dbSnapshot :: Maybe DBSnapshot
$sel:dbSnapshot:CopyDBSnapshotResponse' :: CopyDBSnapshotResponse -> Maybe DBSnapshot
dbSnapshot} -> Maybe DBSnapshot
dbSnapshot) (\s :: CopyDBSnapshotResponse
s@CopyDBSnapshotResponse' {} Maybe DBSnapshot
a -> CopyDBSnapshotResponse
s {$sel:dbSnapshot:CopyDBSnapshotResponse' :: Maybe DBSnapshot
dbSnapshot = Maybe DBSnapshot
a} :: CopyDBSnapshotResponse)

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

instance Prelude.NFData CopyDBSnapshotResponse