{-# 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.EnableSnapshotCopy
-- 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 the automatic copy of snapshots from one region to another
-- region for a specified cluster.
module Amazonka.Redshift.EnableSnapshotCopy
  ( -- * Creating a Request
    EnableSnapshotCopy (..),
    newEnableSnapshotCopy,

    -- * Request Lenses
    enableSnapshotCopy_manualSnapshotRetentionPeriod,
    enableSnapshotCopy_retentionPeriod,
    enableSnapshotCopy_snapshotCopyGrantName,
    enableSnapshotCopy_clusterIdentifier,
    enableSnapshotCopy_destinationRegion,

    -- * Destructuring the Response
    EnableSnapshotCopyResponse (..),
    newEnableSnapshotCopyResponse,

    -- * Response Lenses
    enableSnapshotCopyResponse_cluster,
    enableSnapshotCopyResponse_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:/ 'newEnableSnapshotCopy' smart constructor.
data EnableSnapshotCopy = EnableSnapshotCopy'
  { -- | The number of days to retain newly copied snapshots in the destination
    -- Amazon Web Services Region after they are copied from the source Amazon
    -- Web Services Region. 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.
    EnableSnapshotCopy -> Maybe Int
manualSnapshotRetentionPeriod :: Prelude.Maybe Prelude.Int,
    -- | The number of days to retain automated snapshots in the destination
    -- region after they are copied from the source region.
    --
    -- Default: 7.
    --
    -- Constraints: Must be at least 1 and no more than 35.
    EnableSnapshotCopy -> Maybe Int
retentionPeriod :: Prelude.Maybe Prelude.Int,
    -- | The name of the snapshot copy grant to use when snapshots of an Amazon
    -- Web Services KMS-encrypted cluster are copied to the destination region.
    EnableSnapshotCopy -> Maybe Text
snapshotCopyGrantName :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the source cluster to copy snapshots from.
    --
    -- Constraints: Must be the valid name of an existing cluster that does not
    -- already have cross-region snapshot copy enabled.
    EnableSnapshotCopy -> Text
clusterIdentifier :: Prelude.Text,
    -- | The destination Amazon Web Services Region that you want to copy
    -- snapshots to.
    --
    -- Constraints: Must be the name of a valid Amazon Web Services Region. For
    -- more information, see
    -- <https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region Regions and Endpoints>
    -- in the Amazon Web Services General Reference.
    EnableSnapshotCopy -> Text
destinationRegion :: Prelude.Text
  }
  deriving (EnableSnapshotCopy -> EnableSnapshotCopy -> Bool
(EnableSnapshotCopy -> EnableSnapshotCopy -> Bool)
-> (EnableSnapshotCopy -> EnableSnapshotCopy -> Bool)
-> Eq EnableSnapshotCopy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnableSnapshotCopy -> EnableSnapshotCopy -> Bool
$c/= :: EnableSnapshotCopy -> EnableSnapshotCopy -> Bool
== :: EnableSnapshotCopy -> EnableSnapshotCopy -> Bool
$c== :: EnableSnapshotCopy -> EnableSnapshotCopy -> Bool
Prelude.Eq, ReadPrec [EnableSnapshotCopy]
ReadPrec EnableSnapshotCopy
Int -> ReadS EnableSnapshotCopy
ReadS [EnableSnapshotCopy]
(Int -> ReadS EnableSnapshotCopy)
-> ReadS [EnableSnapshotCopy]
-> ReadPrec EnableSnapshotCopy
-> ReadPrec [EnableSnapshotCopy]
-> Read EnableSnapshotCopy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnableSnapshotCopy]
$creadListPrec :: ReadPrec [EnableSnapshotCopy]
readPrec :: ReadPrec EnableSnapshotCopy
$creadPrec :: ReadPrec EnableSnapshotCopy
readList :: ReadS [EnableSnapshotCopy]
$creadList :: ReadS [EnableSnapshotCopy]
readsPrec :: Int -> ReadS EnableSnapshotCopy
$creadsPrec :: Int -> ReadS EnableSnapshotCopy
Prelude.Read, Int -> EnableSnapshotCopy -> ShowS
[EnableSnapshotCopy] -> ShowS
EnableSnapshotCopy -> String
(Int -> EnableSnapshotCopy -> ShowS)
-> (EnableSnapshotCopy -> String)
-> ([EnableSnapshotCopy] -> ShowS)
-> Show EnableSnapshotCopy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnableSnapshotCopy] -> ShowS
$cshowList :: [EnableSnapshotCopy] -> ShowS
show :: EnableSnapshotCopy -> String
$cshow :: EnableSnapshotCopy -> String
showsPrec :: Int -> EnableSnapshotCopy -> ShowS
$cshowsPrec :: Int -> EnableSnapshotCopy -> ShowS
Prelude.Show, (forall x. EnableSnapshotCopy -> Rep EnableSnapshotCopy x)
-> (forall x. Rep EnableSnapshotCopy x -> EnableSnapshotCopy)
-> Generic EnableSnapshotCopy
forall x. Rep EnableSnapshotCopy x -> EnableSnapshotCopy
forall x. EnableSnapshotCopy -> Rep EnableSnapshotCopy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnableSnapshotCopy x -> EnableSnapshotCopy
$cfrom :: forall x. EnableSnapshotCopy -> Rep EnableSnapshotCopy x
Prelude.Generic)

-- |
-- Create a value of 'EnableSnapshotCopy' 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', 'enableSnapshotCopy_manualSnapshotRetentionPeriod' - The number of days to retain newly copied snapshots in the destination
-- Amazon Web Services Region after they are copied from the source Amazon
-- Web Services Region. 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.
--
-- 'retentionPeriod', 'enableSnapshotCopy_retentionPeriod' - The number of days to retain automated snapshots in the destination
-- region after they are copied from the source region.
--
-- Default: 7.
--
-- Constraints: Must be at least 1 and no more than 35.
--
-- 'snapshotCopyGrantName', 'enableSnapshotCopy_snapshotCopyGrantName' - The name of the snapshot copy grant to use when snapshots of an Amazon
-- Web Services KMS-encrypted cluster are copied to the destination region.
--
-- 'clusterIdentifier', 'enableSnapshotCopy_clusterIdentifier' - The unique identifier of the source cluster to copy snapshots from.
--
-- Constraints: Must be the valid name of an existing cluster that does not
-- already have cross-region snapshot copy enabled.
--
-- 'destinationRegion', 'enableSnapshotCopy_destinationRegion' - The destination Amazon Web Services Region that you want to copy
-- snapshots to.
--
-- Constraints: Must be the name of a valid Amazon Web Services Region. For
-- more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region Regions and Endpoints>
-- in the Amazon Web Services General Reference.
newEnableSnapshotCopy ::
  -- | 'clusterIdentifier'
  Prelude.Text ->
  -- | 'destinationRegion'
  Prelude.Text ->
  EnableSnapshotCopy
newEnableSnapshotCopy :: Text -> Text -> EnableSnapshotCopy
newEnableSnapshotCopy
  Text
pClusterIdentifier_
  Text
pDestinationRegion_ =
    EnableSnapshotCopy' :: Maybe Int
-> Maybe Int -> Maybe Text -> Text -> Text -> EnableSnapshotCopy
EnableSnapshotCopy'
      { $sel:manualSnapshotRetentionPeriod:EnableSnapshotCopy' :: Maybe Int
manualSnapshotRetentionPeriod =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:retentionPeriod:EnableSnapshotCopy' :: Maybe Int
retentionPeriod = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:snapshotCopyGrantName:EnableSnapshotCopy' :: Maybe Text
snapshotCopyGrantName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:clusterIdentifier:EnableSnapshotCopy' :: Text
clusterIdentifier = Text
pClusterIdentifier_,
        $sel:destinationRegion:EnableSnapshotCopy' :: Text
destinationRegion = Text
pDestinationRegion_
      }

-- | The number of days to retain newly copied snapshots in the destination
-- Amazon Web Services Region after they are copied from the source Amazon
-- Web Services Region. 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.
enableSnapshotCopy_manualSnapshotRetentionPeriod :: Lens.Lens' EnableSnapshotCopy (Prelude.Maybe Prelude.Int)
enableSnapshotCopy_manualSnapshotRetentionPeriod :: (Maybe Int -> f (Maybe Int))
-> EnableSnapshotCopy -> f EnableSnapshotCopy
enableSnapshotCopy_manualSnapshotRetentionPeriod = (EnableSnapshotCopy -> Maybe Int)
-> (EnableSnapshotCopy -> Maybe Int -> EnableSnapshotCopy)
-> Lens
     EnableSnapshotCopy EnableSnapshotCopy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSnapshotCopy' {Maybe Int
manualSnapshotRetentionPeriod :: Maybe Int
$sel:manualSnapshotRetentionPeriod:EnableSnapshotCopy' :: EnableSnapshotCopy -> Maybe Int
manualSnapshotRetentionPeriod} -> Maybe Int
manualSnapshotRetentionPeriod) (\s :: EnableSnapshotCopy
s@EnableSnapshotCopy' {} Maybe Int
a -> EnableSnapshotCopy
s {$sel:manualSnapshotRetentionPeriod:EnableSnapshotCopy' :: Maybe Int
manualSnapshotRetentionPeriod = Maybe Int
a} :: EnableSnapshotCopy)

-- | The number of days to retain automated snapshots in the destination
-- region after they are copied from the source region.
--
-- Default: 7.
--
-- Constraints: Must be at least 1 and no more than 35.
enableSnapshotCopy_retentionPeriod :: Lens.Lens' EnableSnapshotCopy (Prelude.Maybe Prelude.Int)
enableSnapshotCopy_retentionPeriod :: (Maybe Int -> f (Maybe Int))
-> EnableSnapshotCopy -> f EnableSnapshotCopy
enableSnapshotCopy_retentionPeriod = (EnableSnapshotCopy -> Maybe Int)
-> (EnableSnapshotCopy -> Maybe Int -> EnableSnapshotCopy)
-> Lens
     EnableSnapshotCopy EnableSnapshotCopy (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSnapshotCopy' {Maybe Int
retentionPeriod :: Maybe Int
$sel:retentionPeriod:EnableSnapshotCopy' :: EnableSnapshotCopy -> Maybe Int
retentionPeriod} -> Maybe Int
retentionPeriod) (\s :: EnableSnapshotCopy
s@EnableSnapshotCopy' {} Maybe Int
a -> EnableSnapshotCopy
s {$sel:retentionPeriod:EnableSnapshotCopy' :: Maybe Int
retentionPeriod = Maybe Int
a} :: EnableSnapshotCopy)

-- | The name of the snapshot copy grant to use when snapshots of an Amazon
-- Web Services KMS-encrypted cluster are copied to the destination region.
enableSnapshotCopy_snapshotCopyGrantName :: Lens.Lens' EnableSnapshotCopy (Prelude.Maybe Prelude.Text)
enableSnapshotCopy_snapshotCopyGrantName :: (Maybe Text -> f (Maybe Text))
-> EnableSnapshotCopy -> f EnableSnapshotCopy
enableSnapshotCopy_snapshotCopyGrantName = (EnableSnapshotCopy -> Maybe Text)
-> (EnableSnapshotCopy -> Maybe Text -> EnableSnapshotCopy)
-> Lens
     EnableSnapshotCopy EnableSnapshotCopy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSnapshotCopy' {Maybe Text
snapshotCopyGrantName :: Maybe Text
$sel:snapshotCopyGrantName:EnableSnapshotCopy' :: EnableSnapshotCopy -> Maybe Text
snapshotCopyGrantName} -> Maybe Text
snapshotCopyGrantName) (\s :: EnableSnapshotCopy
s@EnableSnapshotCopy' {} Maybe Text
a -> EnableSnapshotCopy
s {$sel:snapshotCopyGrantName:EnableSnapshotCopy' :: Maybe Text
snapshotCopyGrantName = Maybe Text
a} :: EnableSnapshotCopy)

-- | The unique identifier of the source cluster to copy snapshots from.
--
-- Constraints: Must be the valid name of an existing cluster that does not
-- already have cross-region snapshot copy enabled.
enableSnapshotCopy_clusterIdentifier :: Lens.Lens' EnableSnapshotCopy Prelude.Text
enableSnapshotCopy_clusterIdentifier :: (Text -> f Text) -> EnableSnapshotCopy -> f EnableSnapshotCopy
enableSnapshotCopy_clusterIdentifier = (EnableSnapshotCopy -> Text)
-> (EnableSnapshotCopy -> Text -> EnableSnapshotCopy)
-> Lens EnableSnapshotCopy EnableSnapshotCopy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSnapshotCopy' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:EnableSnapshotCopy' :: EnableSnapshotCopy -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: EnableSnapshotCopy
s@EnableSnapshotCopy' {} Text
a -> EnableSnapshotCopy
s {$sel:clusterIdentifier:EnableSnapshotCopy' :: Text
clusterIdentifier = Text
a} :: EnableSnapshotCopy)

-- | The destination Amazon Web Services Region that you want to copy
-- snapshots to.
--
-- Constraints: Must be the name of a valid Amazon Web Services Region. For
-- more information, see
-- <https://docs.aws.amazon.com/general/latest/gr/rande.html#redshift_region Regions and Endpoints>
-- in the Amazon Web Services General Reference.
enableSnapshotCopy_destinationRegion :: Lens.Lens' EnableSnapshotCopy Prelude.Text
enableSnapshotCopy_destinationRegion :: (Text -> f Text) -> EnableSnapshotCopy -> f EnableSnapshotCopy
enableSnapshotCopy_destinationRegion = (EnableSnapshotCopy -> Text)
-> (EnableSnapshotCopy -> Text -> EnableSnapshotCopy)
-> Lens EnableSnapshotCopy EnableSnapshotCopy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSnapshotCopy' {Text
destinationRegion :: Text
$sel:destinationRegion:EnableSnapshotCopy' :: EnableSnapshotCopy -> Text
destinationRegion} -> Text
destinationRegion) (\s :: EnableSnapshotCopy
s@EnableSnapshotCopy' {} Text
a -> EnableSnapshotCopy
s {$sel:destinationRegion:EnableSnapshotCopy' :: Text
destinationRegion = Text
a} :: EnableSnapshotCopy)

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

instance Prelude.NFData EnableSnapshotCopy

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

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

instance Core.ToQuery EnableSnapshotCopy where
  toQuery :: EnableSnapshotCopy -> QueryString
toQuery EnableSnapshotCopy' {Maybe Int
Maybe Text
Text
destinationRegion :: Text
clusterIdentifier :: Text
snapshotCopyGrantName :: Maybe Text
retentionPeriod :: Maybe Int
manualSnapshotRetentionPeriod :: Maybe Int
$sel:destinationRegion:EnableSnapshotCopy' :: EnableSnapshotCopy -> Text
$sel:clusterIdentifier:EnableSnapshotCopy' :: EnableSnapshotCopy -> Text
$sel:snapshotCopyGrantName:EnableSnapshotCopy' :: EnableSnapshotCopy -> Maybe Text
$sel:retentionPeriod:EnableSnapshotCopy' :: EnableSnapshotCopy -> Maybe Int
$sel:manualSnapshotRetentionPeriod:EnableSnapshotCopy' :: EnableSnapshotCopy -> 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
"EnableSnapshotCopy" :: 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
"RetentionPeriod" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
retentionPeriod,
        ByteString
"SnapshotCopyGrantName"
          ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
snapshotCopyGrantName,
        ByteString
"ClusterIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
clusterIdentifier,
        ByteString
"DestinationRegion" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
destinationRegion
      ]

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

-- |
-- Create a value of 'EnableSnapshotCopyResponse' 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:
--
-- 'cluster', 'enableSnapshotCopyResponse_cluster' - Undocumented member.
--
-- 'httpStatus', 'enableSnapshotCopyResponse_httpStatus' - The response's http status code.
newEnableSnapshotCopyResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  EnableSnapshotCopyResponse
newEnableSnapshotCopyResponse :: Int -> EnableSnapshotCopyResponse
newEnableSnapshotCopyResponse Int
pHttpStatus_ =
  EnableSnapshotCopyResponse' :: Maybe Cluster -> Int -> EnableSnapshotCopyResponse
EnableSnapshotCopyResponse'
    { $sel:cluster:EnableSnapshotCopyResponse' :: Maybe Cluster
cluster =
        Maybe Cluster
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:EnableSnapshotCopyResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
enableSnapshotCopyResponse_cluster :: Lens.Lens' EnableSnapshotCopyResponse (Prelude.Maybe Cluster)
enableSnapshotCopyResponse_cluster :: (Maybe Cluster -> f (Maybe Cluster))
-> EnableSnapshotCopyResponse -> f EnableSnapshotCopyResponse
enableSnapshotCopyResponse_cluster = (EnableSnapshotCopyResponse -> Maybe Cluster)
-> (EnableSnapshotCopyResponse
    -> Maybe Cluster -> EnableSnapshotCopyResponse)
-> Lens
     EnableSnapshotCopyResponse
     EnableSnapshotCopyResponse
     (Maybe Cluster)
     (Maybe Cluster)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnableSnapshotCopyResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:EnableSnapshotCopyResponse' :: EnableSnapshotCopyResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: EnableSnapshotCopyResponse
s@EnableSnapshotCopyResponse' {} Maybe Cluster
a -> EnableSnapshotCopyResponse
s {$sel:cluster:EnableSnapshotCopyResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: EnableSnapshotCopyResponse)

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

instance Prelude.NFData EnableSnapshotCopyResponse