{-# 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 #-}
module Amazonka.Redshift.ModifySnapshotCopyRetentionPeriod
(
ModifySnapshotCopyRetentionPeriod (..),
newModifySnapshotCopyRetentionPeriod,
modifySnapshotCopyRetentionPeriod_manual,
modifySnapshotCopyRetentionPeriod_clusterIdentifier,
modifySnapshotCopyRetentionPeriod_retentionPeriod,
ModifySnapshotCopyRetentionPeriodResponse (..),
newModifySnapshotCopyRetentionPeriodResponse,
modifySnapshotCopyRetentionPeriodResponse_cluster,
modifySnapshotCopyRetentionPeriodResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.Redshift.Types
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ModifySnapshotCopyRetentionPeriod = ModifySnapshotCopyRetentionPeriod'
{
ModifySnapshotCopyRetentionPeriod -> Maybe Bool
manual :: Prelude.Maybe Prelude.Bool,
ModifySnapshotCopyRetentionPeriod -> Text
clusterIdentifier :: Prelude.Text,
ModifySnapshotCopyRetentionPeriod -> Int
retentionPeriod :: Prelude.Int
}
deriving (ModifySnapshotCopyRetentionPeriod
-> ModifySnapshotCopyRetentionPeriod -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifySnapshotCopyRetentionPeriod
-> ModifySnapshotCopyRetentionPeriod -> Bool
$c/= :: ModifySnapshotCopyRetentionPeriod
-> ModifySnapshotCopyRetentionPeriod -> Bool
== :: ModifySnapshotCopyRetentionPeriod
-> ModifySnapshotCopyRetentionPeriod -> Bool
$c== :: ModifySnapshotCopyRetentionPeriod
-> ModifySnapshotCopyRetentionPeriod -> Bool
Prelude.Eq, ReadPrec [ModifySnapshotCopyRetentionPeriod]
ReadPrec ModifySnapshotCopyRetentionPeriod
Int -> ReadS ModifySnapshotCopyRetentionPeriod
ReadS [ModifySnapshotCopyRetentionPeriod]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifySnapshotCopyRetentionPeriod]
$creadListPrec :: ReadPrec [ModifySnapshotCopyRetentionPeriod]
readPrec :: ReadPrec ModifySnapshotCopyRetentionPeriod
$creadPrec :: ReadPrec ModifySnapshotCopyRetentionPeriod
readList :: ReadS [ModifySnapshotCopyRetentionPeriod]
$creadList :: ReadS [ModifySnapshotCopyRetentionPeriod]
readsPrec :: Int -> ReadS ModifySnapshotCopyRetentionPeriod
$creadsPrec :: Int -> ReadS ModifySnapshotCopyRetentionPeriod
Prelude.Read, Int -> ModifySnapshotCopyRetentionPeriod -> ShowS
[ModifySnapshotCopyRetentionPeriod] -> ShowS
ModifySnapshotCopyRetentionPeriod -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifySnapshotCopyRetentionPeriod] -> ShowS
$cshowList :: [ModifySnapshotCopyRetentionPeriod] -> ShowS
show :: ModifySnapshotCopyRetentionPeriod -> String
$cshow :: ModifySnapshotCopyRetentionPeriod -> String
showsPrec :: Int -> ModifySnapshotCopyRetentionPeriod -> ShowS
$cshowsPrec :: Int -> ModifySnapshotCopyRetentionPeriod -> ShowS
Prelude.Show, forall x.
Rep ModifySnapshotCopyRetentionPeriod x
-> ModifySnapshotCopyRetentionPeriod
forall x.
ModifySnapshotCopyRetentionPeriod
-> Rep ModifySnapshotCopyRetentionPeriod x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifySnapshotCopyRetentionPeriod x
-> ModifySnapshotCopyRetentionPeriod
$cfrom :: forall x.
ModifySnapshotCopyRetentionPeriod
-> Rep ModifySnapshotCopyRetentionPeriod x
Prelude.Generic)
newModifySnapshotCopyRetentionPeriod ::
Prelude.Text ->
Prelude.Int ->
ModifySnapshotCopyRetentionPeriod
newModifySnapshotCopyRetentionPeriod :: Text -> Int -> ModifySnapshotCopyRetentionPeriod
newModifySnapshotCopyRetentionPeriod
Text
pClusterIdentifier_
Int
pRetentionPeriod_ =
ModifySnapshotCopyRetentionPeriod'
{ $sel:manual:ModifySnapshotCopyRetentionPeriod' :: Maybe Bool
manual =
forall a. Maybe a
Prelude.Nothing,
$sel:clusterIdentifier:ModifySnapshotCopyRetentionPeriod' :: Text
clusterIdentifier = Text
pClusterIdentifier_,
$sel:retentionPeriod:ModifySnapshotCopyRetentionPeriod' :: Int
retentionPeriod = Int
pRetentionPeriod_
}
modifySnapshotCopyRetentionPeriod_manual :: Lens.Lens' ModifySnapshotCopyRetentionPeriod (Prelude.Maybe Prelude.Bool)
modifySnapshotCopyRetentionPeriod_manual :: Lens' ModifySnapshotCopyRetentionPeriod (Maybe Bool)
modifySnapshotCopyRetentionPeriod_manual = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySnapshotCopyRetentionPeriod' {Maybe Bool
manual :: Maybe Bool
$sel:manual:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Maybe Bool
manual} -> Maybe Bool
manual) (\s :: ModifySnapshotCopyRetentionPeriod
s@ModifySnapshotCopyRetentionPeriod' {} Maybe Bool
a -> ModifySnapshotCopyRetentionPeriod
s {$sel:manual:ModifySnapshotCopyRetentionPeriod' :: Maybe Bool
manual = Maybe Bool
a} :: ModifySnapshotCopyRetentionPeriod)
modifySnapshotCopyRetentionPeriod_clusterIdentifier :: Lens.Lens' ModifySnapshotCopyRetentionPeriod Prelude.Text
modifySnapshotCopyRetentionPeriod_clusterIdentifier :: Lens' ModifySnapshotCopyRetentionPeriod Text
modifySnapshotCopyRetentionPeriod_clusterIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySnapshotCopyRetentionPeriod' {Text
clusterIdentifier :: Text
$sel:clusterIdentifier:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Text
clusterIdentifier} -> Text
clusterIdentifier) (\s :: ModifySnapshotCopyRetentionPeriod
s@ModifySnapshotCopyRetentionPeriod' {} Text
a -> ModifySnapshotCopyRetentionPeriod
s {$sel:clusterIdentifier:ModifySnapshotCopyRetentionPeriod' :: Text
clusterIdentifier = Text
a} :: ModifySnapshotCopyRetentionPeriod)
modifySnapshotCopyRetentionPeriod_retentionPeriod :: Lens.Lens' ModifySnapshotCopyRetentionPeriod Prelude.Int
modifySnapshotCopyRetentionPeriod_retentionPeriod :: Lens' ModifySnapshotCopyRetentionPeriod Int
modifySnapshotCopyRetentionPeriod_retentionPeriod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySnapshotCopyRetentionPeriod' {Int
retentionPeriod :: Int
$sel:retentionPeriod:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Int
retentionPeriod} -> Int
retentionPeriod) (\s :: ModifySnapshotCopyRetentionPeriod
s@ModifySnapshotCopyRetentionPeriod' {} Int
a -> ModifySnapshotCopyRetentionPeriod
s {$sel:retentionPeriod:ModifySnapshotCopyRetentionPeriod' :: Int
retentionPeriod = Int
a} :: ModifySnapshotCopyRetentionPeriod)
instance
Core.AWSRequest
ModifySnapshotCopyRetentionPeriod
where
type
AWSResponse ModifySnapshotCopyRetentionPeriod =
ModifySnapshotCopyRetentionPeriodResponse
request :: (Service -> Service)
-> ModifySnapshotCopyRetentionPeriod
-> Request ModifySnapshotCopyRetentionPeriod
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ModifySnapshotCopyRetentionPeriod
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ModifySnapshotCopyRetentionPeriod)))
response =
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
-> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
Text
"ModifySnapshotCopyRetentionPeriodResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Cluster -> Int -> ModifySnapshotCopyRetentionPeriodResponse
ModifySnapshotCopyRetentionPeriodResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Cluster")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
ModifySnapshotCopyRetentionPeriod
where
hashWithSalt :: Int -> ModifySnapshotCopyRetentionPeriod -> Int
hashWithSalt
Int
_salt
ModifySnapshotCopyRetentionPeriod' {Int
Maybe Bool
Text
retentionPeriod :: Int
clusterIdentifier :: Text
manual :: Maybe Bool
$sel:retentionPeriod:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Int
$sel:clusterIdentifier:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Text
$sel:manual:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Maybe Bool
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
manual
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
clusterIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Int
retentionPeriod
instance
Prelude.NFData
ModifySnapshotCopyRetentionPeriod
where
rnf :: ModifySnapshotCopyRetentionPeriod -> ()
rnf ModifySnapshotCopyRetentionPeriod' {Int
Maybe Bool
Text
retentionPeriod :: Int
clusterIdentifier :: Text
manual :: Maybe Bool
$sel:retentionPeriod:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Int
$sel:clusterIdentifier:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Text
$sel:manual:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Maybe Bool
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
manual
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
clusterIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
retentionPeriod
instance
Data.ToHeaders
ModifySnapshotCopyRetentionPeriod
where
toHeaders :: ModifySnapshotCopyRetentionPeriod -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance
Data.ToPath
ModifySnapshotCopyRetentionPeriod
where
toPath :: ModifySnapshotCopyRetentionPeriod -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
ModifySnapshotCopyRetentionPeriod
where
toQuery :: ModifySnapshotCopyRetentionPeriod -> QueryString
toQuery ModifySnapshotCopyRetentionPeriod' {Int
Maybe Bool
Text
retentionPeriod :: Int
clusterIdentifier :: Text
manual :: Maybe Bool
$sel:retentionPeriod:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Int
$sel:clusterIdentifier:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Text
$sel:manual:ModifySnapshotCopyRetentionPeriod' :: ModifySnapshotCopyRetentionPeriod -> Maybe Bool
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: ( ByteString
"ModifySnapshotCopyRetentionPeriod" ::
Prelude.ByteString
),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"Manual" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Bool
manual,
ByteString
"ClusterIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
clusterIdentifier,
ByteString
"RetentionPeriod" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Int
retentionPeriod
]
data ModifySnapshotCopyRetentionPeriodResponse = ModifySnapshotCopyRetentionPeriodResponse'
{ ModifySnapshotCopyRetentionPeriodResponse -> Maybe Cluster
cluster :: Prelude.Maybe Cluster,
ModifySnapshotCopyRetentionPeriodResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifySnapshotCopyRetentionPeriodResponse
-> ModifySnapshotCopyRetentionPeriodResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifySnapshotCopyRetentionPeriodResponse
-> ModifySnapshotCopyRetentionPeriodResponse -> Bool
$c/= :: ModifySnapshotCopyRetentionPeriodResponse
-> ModifySnapshotCopyRetentionPeriodResponse -> Bool
== :: ModifySnapshotCopyRetentionPeriodResponse
-> ModifySnapshotCopyRetentionPeriodResponse -> Bool
$c== :: ModifySnapshotCopyRetentionPeriodResponse
-> ModifySnapshotCopyRetentionPeriodResponse -> Bool
Prelude.Eq, ReadPrec [ModifySnapshotCopyRetentionPeriodResponse]
ReadPrec ModifySnapshotCopyRetentionPeriodResponse
Int -> ReadS ModifySnapshotCopyRetentionPeriodResponse
ReadS [ModifySnapshotCopyRetentionPeriodResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifySnapshotCopyRetentionPeriodResponse]
$creadListPrec :: ReadPrec [ModifySnapshotCopyRetentionPeriodResponse]
readPrec :: ReadPrec ModifySnapshotCopyRetentionPeriodResponse
$creadPrec :: ReadPrec ModifySnapshotCopyRetentionPeriodResponse
readList :: ReadS [ModifySnapshotCopyRetentionPeriodResponse]
$creadList :: ReadS [ModifySnapshotCopyRetentionPeriodResponse]
readsPrec :: Int -> ReadS ModifySnapshotCopyRetentionPeriodResponse
$creadsPrec :: Int -> ReadS ModifySnapshotCopyRetentionPeriodResponse
Prelude.Read, Int -> ModifySnapshotCopyRetentionPeriodResponse -> ShowS
[ModifySnapshotCopyRetentionPeriodResponse] -> ShowS
ModifySnapshotCopyRetentionPeriodResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifySnapshotCopyRetentionPeriodResponse] -> ShowS
$cshowList :: [ModifySnapshotCopyRetentionPeriodResponse] -> ShowS
show :: ModifySnapshotCopyRetentionPeriodResponse -> String
$cshow :: ModifySnapshotCopyRetentionPeriodResponse -> String
showsPrec :: Int -> ModifySnapshotCopyRetentionPeriodResponse -> ShowS
$cshowsPrec :: Int -> ModifySnapshotCopyRetentionPeriodResponse -> ShowS
Prelude.Show, forall x.
Rep ModifySnapshotCopyRetentionPeriodResponse x
-> ModifySnapshotCopyRetentionPeriodResponse
forall x.
ModifySnapshotCopyRetentionPeriodResponse
-> Rep ModifySnapshotCopyRetentionPeriodResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifySnapshotCopyRetentionPeriodResponse x
-> ModifySnapshotCopyRetentionPeriodResponse
$cfrom :: forall x.
ModifySnapshotCopyRetentionPeriodResponse
-> Rep ModifySnapshotCopyRetentionPeriodResponse x
Prelude.Generic)
newModifySnapshotCopyRetentionPeriodResponse ::
Prelude.Int ->
ModifySnapshotCopyRetentionPeriodResponse
newModifySnapshotCopyRetentionPeriodResponse :: Int -> ModifySnapshotCopyRetentionPeriodResponse
newModifySnapshotCopyRetentionPeriodResponse
Int
pHttpStatus_ =
ModifySnapshotCopyRetentionPeriodResponse'
{ $sel:cluster:ModifySnapshotCopyRetentionPeriodResponse' :: Maybe Cluster
cluster =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ModifySnapshotCopyRetentionPeriodResponse' :: Int
httpStatus = Int
pHttpStatus_
}
modifySnapshotCopyRetentionPeriodResponse_cluster :: Lens.Lens' ModifySnapshotCopyRetentionPeriodResponse (Prelude.Maybe Cluster)
modifySnapshotCopyRetentionPeriodResponse_cluster :: Lens' ModifySnapshotCopyRetentionPeriodResponse (Maybe Cluster)
modifySnapshotCopyRetentionPeriodResponse_cluster = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySnapshotCopyRetentionPeriodResponse' {Maybe Cluster
cluster :: Maybe Cluster
$sel:cluster:ModifySnapshotCopyRetentionPeriodResponse' :: ModifySnapshotCopyRetentionPeriodResponse -> Maybe Cluster
cluster} -> Maybe Cluster
cluster) (\s :: ModifySnapshotCopyRetentionPeriodResponse
s@ModifySnapshotCopyRetentionPeriodResponse' {} Maybe Cluster
a -> ModifySnapshotCopyRetentionPeriodResponse
s {$sel:cluster:ModifySnapshotCopyRetentionPeriodResponse' :: Maybe Cluster
cluster = Maybe Cluster
a} :: ModifySnapshotCopyRetentionPeriodResponse)
modifySnapshotCopyRetentionPeriodResponse_httpStatus :: Lens.Lens' ModifySnapshotCopyRetentionPeriodResponse Prelude.Int
modifySnapshotCopyRetentionPeriodResponse_httpStatus :: Lens' ModifySnapshotCopyRetentionPeriodResponse Int
modifySnapshotCopyRetentionPeriodResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifySnapshotCopyRetentionPeriodResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifySnapshotCopyRetentionPeriodResponse' :: ModifySnapshotCopyRetentionPeriodResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifySnapshotCopyRetentionPeriodResponse
s@ModifySnapshotCopyRetentionPeriodResponse' {} Int
a -> ModifySnapshotCopyRetentionPeriodResponse
s {$sel:httpStatus:ModifySnapshotCopyRetentionPeriodResponse' :: Int
httpStatus = Int
a} :: ModifySnapshotCopyRetentionPeriodResponse)
instance
Prelude.NFData
ModifySnapshotCopyRetentionPeriodResponse
where
rnf :: ModifySnapshotCopyRetentionPeriodResponse -> ()
rnf ModifySnapshotCopyRetentionPeriodResponse' {Int
Maybe Cluster
httpStatus :: Int
cluster :: Maybe Cluster
$sel:httpStatus:ModifySnapshotCopyRetentionPeriodResponse' :: ModifySnapshotCopyRetentionPeriodResponse -> Int
$sel:cluster:ModifySnapshotCopyRetentionPeriodResponse' :: ModifySnapshotCopyRetentionPeriodResponse -> Maybe Cluster
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Cluster
cluster
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus