{-# 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.Redshift.CopyClusterSnapshot
-- 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 automated cluster snapshot to a new manual cluster
-- snapshot. The source must be an automated snapshot and it must be in the
-- available state.
--
-- When you delete a cluster, Amazon Redshift deletes any automated
-- snapshots of the cluster. Also, when the retention period of the
-- snapshot expires, Amazon Redshift automatically deletes it. If you want
-- to keep an automated snapshot for a longer period, you can make a manual
-- copy of the snapshot. Manual snapshots are retained until you delete
-- them.
--
-- For more information about working with snapshots, go to
-- <https://docs.aws.amazon.com/redshift/latest/mgmt/working-with-snapshots.html Amazon Redshift Snapshots>
-- in the /Amazon Redshift Cluster Management Guide/.
module Amazonka.Redshift.CopyClusterSnapshot
  ( -- * Creating a Request
    CopyClusterSnapshot (..),
    newCopyClusterSnapshot,

    -- * Request Lenses
    copyClusterSnapshot_manualSnapshotRetentionPeriod,
    copyClusterSnapshot_sourceSnapshotClusterIdentifier,
    copyClusterSnapshot_sourceSnapshotIdentifier,
    copyClusterSnapshot_targetSnapshotIdentifier,

    -- * Destructuring the Response
    CopyClusterSnapshotResponse (..),
    newCopyClusterSnapshotResponse,

    -- * Response Lenses
    copyClusterSnapshotResponse_snapshot,
    copyClusterSnapshotResponse_httpStatus,
  )
where

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

-- |
--
-- /See:/ 'newCopyClusterSnapshot' smart constructor.
data CopyClusterSnapshot = CopyClusterSnapshot'
  { -- | The number of days that a manual snapshot is retained. If the value is
    -- -1, the manual snapshot is retained indefinitely.
    --
    -- The value must be either -1 or an integer between 1 and 3,653.
    --
    -- The default value is -1.
    CopyClusterSnapshot -> Maybe Int
manualSnapshotRetentionPeriod :: Prelude.Maybe Prelude.Int,
    -- | The identifier of the cluster the source snapshot was created from. This
    -- parameter is required if your IAM user has a policy containing a
    -- snapshot resource element that specifies anything other than * for the
    -- cluster name.
    --
    -- Constraints:
    --
    -- -   Must be the identifier for a valid cluster.
    CopyClusterSnapshot -> Maybe Text
sourceSnapshotClusterIdentifier :: Prelude.Maybe Prelude.Text,
    -- | The identifier for the source snapshot.
    --
    -- Constraints:
    --
    -- -   Must be the identifier for a valid automated snapshot whose state is
    --     @available@.
    CopyClusterSnapshot -> Text
sourceSnapshotIdentifier :: Prelude.Text,
    -- | The identifier given to the new manual snapshot.
    --
    -- Constraints:
    --
    -- -   Cannot be null, empty, or blank.
    --
    -- -   Must contain from 1 to 255 alphanumeric characters or hyphens.
    --
    -- -   First character must be a letter.
    --
    -- -   Cannot end with a hyphen or contain two consecutive hyphens.
    --
    -- -   Must be unique for the Amazon Web Services account that is making
    --     the request.
    CopyClusterSnapshot -> Text
targetSnapshotIdentifier :: Prelude.Text
  }
  deriving (CopyClusterSnapshot -> CopyClusterSnapshot -> Bool
(CopyClusterSnapshot -> CopyClusterSnapshot -> Bool)
-> (CopyClusterSnapshot -> CopyClusterSnapshot -> Bool)
-> Eq CopyClusterSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CopyClusterSnapshot -> CopyClusterSnapshot -> Bool
$c/= :: CopyClusterSnapshot -> CopyClusterSnapshot -> Bool
== :: CopyClusterSnapshot -> CopyClusterSnapshot -> Bool
$c== :: CopyClusterSnapshot -> CopyClusterSnapshot -> Bool
Prelude.Eq, ReadPrec [CopyClusterSnapshot]
ReadPrec CopyClusterSnapshot
Int -> ReadS CopyClusterSnapshot
ReadS [CopyClusterSnapshot]
(Int -> ReadS CopyClusterSnapshot)
-> ReadS [CopyClusterSnapshot]
-> ReadPrec CopyClusterSnapshot
-> ReadPrec [CopyClusterSnapshot]
-> Read CopyClusterSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CopyClusterSnapshot]
$creadListPrec :: ReadPrec [CopyClusterSnapshot]
readPrec :: ReadPrec CopyClusterSnapshot
$creadPrec :: ReadPrec CopyClusterSnapshot
readList :: ReadS [CopyClusterSnapshot]
$creadList :: ReadS [CopyClusterSnapshot]
readsPrec :: Int -> ReadS CopyClusterSnapshot
$creadsPrec :: Int -> ReadS CopyClusterSnapshot
Prelude.Read, Int -> CopyClusterSnapshot -> ShowS
[CopyClusterSnapshot] -> ShowS
CopyClusterSnapshot -> String
(Int -> CopyClusterSnapshot -> ShowS)
-> (CopyClusterSnapshot -> String)
-> ([CopyClusterSnapshot] -> ShowS)
-> Show CopyClusterSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CopyClusterSnapshot] -> ShowS
$cshowList :: [CopyClusterSnapshot] -> ShowS
show :: CopyClusterSnapshot -> String
$cshow :: CopyClusterSnapshot -> String
showsPrec :: Int -> CopyClusterSnapshot -> ShowS
$cshowsPrec :: Int -> CopyClusterSnapshot -> ShowS
Prelude.Show, (forall x. CopyClusterSnapshot -> Rep CopyClusterSnapshot x)
-> (forall x. Rep CopyClusterSnapshot x -> CopyClusterSnapshot)
-> Generic CopyClusterSnapshot
forall x. Rep CopyClusterSnapshot x -> CopyClusterSnapshot
forall x. CopyClusterSnapshot -> Rep CopyClusterSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CopyClusterSnapshot x -> CopyClusterSnapshot
$cfrom :: forall x. CopyClusterSnapshot -> Rep CopyClusterSnapshot x
Prelude.Generic)

-- |
-- Create a value of 'CopyClusterSnapshot' 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:
--
-- 'manualSnapshotRetentionPeriod', 'copyClusterSnapshot_manualSnapshotRetentionPeriod' - The number of days that a manual snapshot is retained. If the value is
-- -1, the manual snapshot is retained indefinitely.
--
-- The value must be either -1 or an integer between 1 and 3,653.
--
-- The default value is -1.
--
-- 'sourceSnapshotClusterIdentifier', 'copyClusterSnapshot_sourceSnapshotClusterIdentifier' - The identifier of the cluster the source snapshot was created from. This
-- parameter is required if your IAM user has a policy containing a
-- snapshot resource element that specifies anything other than * for the
-- cluster name.
--
-- Constraints:
--
-- -   Must be the identifier for a valid cluster.
--
-- 'sourceSnapshotIdentifier', 'copyClusterSnapshot_sourceSnapshotIdentifier' - The identifier for the source snapshot.
--
-- Constraints:
--
-- -   Must be the identifier for a valid automated snapshot whose state is
--     @available@.
--
-- 'targetSnapshotIdentifier', 'copyClusterSnapshot_targetSnapshotIdentifier' - The identifier given to the new manual snapshot.
--
-- Constraints:
--
-- -   Cannot be null, empty, or blank.
--
-- -   Must contain from 1 to 255 alphanumeric characters or hyphens.
--
-- -   First character must be a letter.
--
-- -   Cannot end with a hyphen or contain two consecutive hyphens.
--
-- -   Must be unique for the Amazon Web Services account that is making
--     the request.
newCopyClusterSnapshot ::
  -- | 'sourceSnapshotIdentifier'
  Prelude.Text ->
  -- | 'targetSnapshotIdentifier'
  Prelude.Text ->
  CopyClusterSnapshot
newCopyClusterSnapshot :: Text -> Text -> CopyClusterSnapshot
newCopyClusterSnapshot
  Text
pSourceSnapshotIdentifier_
  Text
pTargetSnapshotIdentifier_ =
    CopyClusterSnapshot' :: Maybe Int -> Maybe Text -> Text -> Text -> CopyClusterSnapshot
CopyClusterSnapshot'
      { $sel:manualSnapshotRetentionPeriod:CopyClusterSnapshot' :: Maybe Int
manualSnapshotRetentionPeriod =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceSnapshotClusterIdentifier:CopyClusterSnapshot' :: Maybe Text
sourceSnapshotClusterIdentifier = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:sourceSnapshotIdentifier:CopyClusterSnapshot' :: Text
sourceSnapshotIdentifier =
          Text
pSourceSnapshotIdentifier_,
        $sel:targetSnapshotIdentifier:CopyClusterSnapshot' :: Text
targetSnapshotIdentifier =
          Text
pTargetSnapshotIdentifier_
      }

-- | The number of days that a manual snapshot is retained. If the value is
-- -1, the manual snapshot is retained indefinitely.
--
-- The value must be either -1 or an integer between 1 and 3,653.
--
-- The default value is -1.
copyClusterSnapshot_manualSnapshotRetentionPeriod :: Lens.Lens' CopyClusterSnapshot (Prelude.Maybe Prelude.Int)
copyClusterSnapshot_manualSnapshotRetentionPeriod :: (Maybe Int -> f (Maybe Int))
-> CopyClusterSnapshot -> f CopyClusterSnapshot
copyClusterSnapshot_manualSnapshotRetentionPeriod = (CopyClusterSnapshot -> Maybe Int)
-> (CopyClusterSnapshot -> Maybe Int -> CopyClusterSnapshot)
-> Lens
     CopyClusterSnapshot CopyClusterSnapshot (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyClusterSnapshot' {Maybe Int
manualSnapshotRetentionPeriod :: Maybe Int
$sel:manualSnapshotRetentionPeriod:CopyClusterSnapshot' :: CopyClusterSnapshot -> Maybe Int
manualSnapshotRetentionPeriod} -> Maybe Int
manualSnapshotRetentionPeriod) (\s :: CopyClusterSnapshot
s@CopyClusterSnapshot' {} Maybe Int
a -> CopyClusterSnapshot
s {$sel:manualSnapshotRetentionPeriod:CopyClusterSnapshot' :: Maybe Int
manualSnapshotRetentionPeriod = Maybe Int
a} :: CopyClusterSnapshot)

-- | The identifier of the cluster the source snapshot was created from. This
-- parameter is required if your IAM user has a policy containing a
-- snapshot resource element that specifies anything other than * for the
-- cluster name.
--
-- Constraints:
--
-- -   Must be the identifier for a valid cluster.
copyClusterSnapshot_sourceSnapshotClusterIdentifier :: Lens.Lens' CopyClusterSnapshot (Prelude.Maybe Prelude.Text)
copyClusterSnapshot_sourceSnapshotClusterIdentifier :: (Maybe Text -> f (Maybe Text))
-> CopyClusterSnapshot -> f CopyClusterSnapshot
copyClusterSnapshot_sourceSnapshotClusterIdentifier = (CopyClusterSnapshot -> Maybe Text)
-> (CopyClusterSnapshot -> Maybe Text -> CopyClusterSnapshot)
-> Lens
     CopyClusterSnapshot CopyClusterSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyClusterSnapshot' {Maybe Text
sourceSnapshotClusterIdentifier :: Maybe Text
$sel:sourceSnapshotClusterIdentifier:CopyClusterSnapshot' :: CopyClusterSnapshot -> Maybe Text
sourceSnapshotClusterIdentifier} -> Maybe Text
sourceSnapshotClusterIdentifier) (\s :: CopyClusterSnapshot
s@CopyClusterSnapshot' {} Maybe Text
a -> CopyClusterSnapshot
s {$sel:sourceSnapshotClusterIdentifier:CopyClusterSnapshot' :: Maybe Text
sourceSnapshotClusterIdentifier = Maybe Text
a} :: CopyClusterSnapshot)

-- | The identifier for the source snapshot.
--
-- Constraints:
--
-- -   Must be the identifier for a valid automated snapshot whose state is
--     @available@.
copyClusterSnapshot_sourceSnapshotIdentifier :: Lens.Lens' CopyClusterSnapshot Prelude.Text
copyClusterSnapshot_sourceSnapshotIdentifier :: (Text -> f Text) -> CopyClusterSnapshot -> f CopyClusterSnapshot
copyClusterSnapshot_sourceSnapshotIdentifier = (CopyClusterSnapshot -> Text)
-> (CopyClusterSnapshot -> Text -> CopyClusterSnapshot)
-> Lens CopyClusterSnapshot CopyClusterSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyClusterSnapshot' {Text
sourceSnapshotIdentifier :: Text
$sel:sourceSnapshotIdentifier:CopyClusterSnapshot' :: CopyClusterSnapshot -> Text
sourceSnapshotIdentifier} -> Text
sourceSnapshotIdentifier) (\s :: CopyClusterSnapshot
s@CopyClusterSnapshot' {} Text
a -> CopyClusterSnapshot
s {$sel:sourceSnapshotIdentifier:CopyClusterSnapshot' :: Text
sourceSnapshotIdentifier = Text
a} :: CopyClusterSnapshot)

-- | The identifier given to the new manual snapshot.
--
-- Constraints:
--
-- -   Cannot be null, empty, or blank.
--
-- -   Must contain from 1 to 255 alphanumeric characters or hyphens.
--
-- -   First character must be a letter.
--
-- -   Cannot end with a hyphen or contain two consecutive hyphens.
--
-- -   Must be unique for the Amazon Web Services account that is making
--     the request.
copyClusterSnapshot_targetSnapshotIdentifier :: Lens.Lens' CopyClusterSnapshot Prelude.Text
copyClusterSnapshot_targetSnapshotIdentifier :: (Text -> f Text) -> CopyClusterSnapshot -> f CopyClusterSnapshot
copyClusterSnapshot_targetSnapshotIdentifier = (CopyClusterSnapshot -> Text)
-> (CopyClusterSnapshot -> Text -> CopyClusterSnapshot)
-> Lens CopyClusterSnapshot CopyClusterSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyClusterSnapshot' {Text
targetSnapshotIdentifier :: Text
$sel:targetSnapshotIdentifier:CopyClusterSnapshot' :: CopyClusterSnapshot -> Text
targetSnapshotIdentifier} -> Text
targetSnapshotIdentifier) (\s :: CopyClusterSnapshot
s@CopyClusterSnapshot' {} Text
a -> CopyClusterSnapshot
s {$sel:targetSnapshotIdentifier:CopyClusterSnapshot' :: Text
targetSnapshotIdentifier = Text
a} :: CopyClusterSnapshot)

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

instance Prelude.NFData CopyClusterSnapshot

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

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

instance Core.ToQuery CopyClusterSnapshot where
  toQuery :: CopyClusterSnapshot -> QueryString
toQuery CopyClusterSnapshot' {Maybe Int
Maybe Text
Text
targetSnapshotIdentifier :: Text
sourceSnapshotIdentifier :: Text
sourceSnapshotClusterIdentifier :: Maybe Text
manualSnapshotRetentionPeriod :: Maybe Int
$sel:targetSnapshotIdentifier:CopyClusterSnapshot' :: CopyClusterSnapshot -> Text
$sel:sourceSnapshotIdentifier:CopyClusterSnapshot' :: CopyClusterSnapshot -> Text
$sel:sourceSnapshotClusterIdentifier:CopyClusterSnapshot' :: CopyClusterSnapshot -> Maybe Text
$sel:manualSnapshotRetentionPeriod:CopyClusterSnapshot' :: CopyClusterSnapshot -> Maybe Int
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"CopyClusterSnapshot" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
        ByteString
"ManualSnapshotRetentionPeriod"
          ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
manualSnapshotRetentionPeriod,
        ByteString
"SourceSnapshotClusterIdentifier"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
sourceSnapshotClusterIdentifier,
        ByteString
"SourceSnapshotIdentifier"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
sourceSnapshotIdentifier,
        ByteString
"TargetSnapshotIdentifier"
          ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
targetSnapshotIdentifier
      ]

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

-- |
-- Create a value of 'CopyClusterSnapshotResponse' 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:
--
-- 'snapshot', 'copyClusterSnapshotResponse_snapshot' - Undocumented member.
--
-- 'httpStatus', 'copyClusterSnapshotResponse_httpStatus' - The response's http status code.
newCopyClusterSnapshotResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CopyClusterSnapshotResponse
newCopyClusterSnapshotResponse :: Int -> CopyClusterSnapshotResponse
newCopyClusterSnapshotResponse Int
pHttpStatus_ =
  CopyClusterSnapshotResponse' :: Maybe Snapshot -> Int -> CopyClusterSnapshotResponse
CopyClusterSnapshotResponse'
    { $sel:snapshot:CopyClusterSnapshotResponse' :: Maybe Snapshot
snapshot =
        Maybe Snapshot
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CopyClusterSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
copyClusterSnapshotResponse_snapshot :: Lens.Lens' CopyClusterSnapshotResponse (Prelude.Maybe Snapshot)
copyClusterSnapshotResponse_snapshot :: (Maybe Snapshot -> f (Maybe Snapshot))
-> CopyClusterSnapshotResponse -> f CopyClusterSnapshotResponse
copyClusterSnapshotResponse_snapshot = (CopyClusterSnapshotResponse -> Maybe Snapshot)
-> (CopyClusterSnapshotResponse
    -> Maybe Snapshot -> CopyClusterSnapshotResponse)
-> Lens
     CopyClusterSnapshotResponse
     CopyClusterSnapshotResponse
     (Maybe Snapshot)
     (Maybe Snapshot)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CopyClusterSnapshotResponse' {Maybe Snapshot
snapshot :: Maybe Snapshot
$sel:snapshot:CopyClusterSnapshotResponse' :: CopyClusterSnapshotResponse -> Maybe Snapshot
snapshot} -> Maybe Snapshot
snapshot) (\s :: CopyClusterSnapshotResponse
s@CopyClusterSnapshotResponse' {} Maybe Snapshot
a -> CopyClusterSnapshotResponse
s {$sel:snapshot:CopyClusterSnapshotResponse' :: Maybe Snapshot
snapshot = Maybe Snapshot
a} :: CopyClusterSnapshotResponse)

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

instance Prelude.NFData CopyClusterSnapshotResponse