{-# 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.ModifyClusterSnapshot
(
ModifyClusterSnapshot (..),
newModifyClusterSnapshot,
modifyClusterSnapshot_manualSnapshotRetentionPeriod,
modifyClusterSnapshot_force,
modifyClusterSnapshot_snapshotIdentifier,
ModifyClusterSnapshotResponse (..),
newModifyClusterSnapshotResponse,
modifyClusterSnapshotResponse_snapshot,
modifyClusterSnapshotResponse_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
data ModifyClusterSnapshot = ModifyClusterSnapshot'
{
ModifyClusterSnapshot -> Maybe Int
manualSnapshotRetentionPeriod :: Prelude.Maybe Prelude.Int,
ModifyClusterSnapshot -> Maybe Bool
force :: Prelude.Maybe Prelude.Bool,
ModifyClusterSnapshot -> Text
snapshotIdentifier :: Prelude.Text
}
deriving (ModifyClusterSnapshot -> ModifyClusterSnapshot -> Bool
(ModifyClusterSnapshot -> ModifyClusterSnapshot -> Bool)
-> (ModifyClusterSnapshot -> ModifyClusterSnapshot -> Bool)
-> Eq ModifyClusterSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyClusterSnapshot -> ModifyClusterSnapshot -> Bool
$c/= :: ModifyClusterSnapshot -> ModifyClusterSnapshot -> Bool
== :: ModifyClusterSnapshot -> ModifyClusterSnapshot -> Bool
$c== :: ModifyClusterSnapshot -> ModifyClusterSnapshot -> Bool
Prelude.Eq, ReadPrec [ModifyClusterSnapshot]
ReadPrec ModifyClusterSnapshot
Int -> ReadS ModifyClusterSnapshot
ReadS [ModifyClusterSnapshot]
(Int -> ReadS ModifyClusterSnapshot)
-> ReadS [ModifyClusterSnapshot]
-> ReadPrec ModifyClusterSnapshot
-> ReadPrec [ModifyClusterSnapshot]
-> Read ModifyClusterSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyClusterSnapshot]
$creadListPrec :: ReadPrec [ModifyClusterSnapshot]
readPrec :: ReadPrec ModifyClusterSnapshot
$creadPrec :: ReadPrec ModifyClusterSnapshot
readList :: ReadS [ModifyClusterSnapshot]
$creadList :: ReadS [ModifyClusterSnapshot]
readsPrec :: Int -> ReadS ModifyClusterSnapshot
$creadsPrec :: Int -> ReadS ModifyClusterSnapshot
Prelude.Read, Int -> ModifyClusterSnapshot -> ShowS
[ModifyClusterSnapshot] -> ShowS
ModifyClusterSnapshot -> String
(Int -> ModifyClusterSnapshot -> ShowS)
-> (ModifyClusterSnapshot -> String)
-> ([ModifyClusterSnapshot] -> ShowS)
-> Show ModifyClusterSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyClusterSnapshot] -> ShowS
$cshowList :: [ModifyClusterSnapshot] -> ShowS
show :: ModifyClusterSnapshot -> String
$cshow :: ModifyClusterSnapshot -> String
showsPrec :: Int -> ModifyClusterSnapshot -> ShowS
$cshowsPrec :: Int -> ModifyClusterSnapshot -> ShowS
Prelude.Show, (forall x. ModifyClusterSnapshot -> Rep ModifyClusterSnapshot x)
-> (forall x. Rep ModifyClusterSnapshot x -> ModifyClusterSnapshot)
-> Generic ModifyClusterSnapshot
forall x. Rep ModifyClusterSnapshot x -> ModifyClusterSnapshot
forall x. ModifyClusterSnapshot -> Rep ModifyClusterSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyClusterSnapshot x -> ModifyClusterSnapshot
$cfrom :: forall x. ModifyClusterSnapshot -> Rep ModifyClusterSnapshot x
Prelude.Generic)
newModifyClusterSnapshot ::
Prelude.Text ->
ModifyClusterSnapshot
newModifyClusterSnapshot :: Text -> ModifyClusterSnapshot
newModifyClusterSnapshot Text
pSnapshotIdentifier_ =
ModifyClusterSnapshot' :: Maybe Int -> Maybe Bool -> Text -> ModifyClusterSnapshot
ModifyClusterSnapshot'
{ $sel:manualSnapshotRetentionPeriod:ModifyClusterSnapshot' :: Maybe Int
manualSnapshotRetentionPeriod =
Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:force:ModifyClusterSnapshot' :: Maybe Bool
force = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:snapshotIdentifier:ModifyClusterSnapshot' :: Text
snapshotIdentifier = Text
pSnapshotIdentifier_
}
modifyClusterSnapshot_manualSnapshotRetentionPeriod :: Lens.Lens' ModifyClusterSnapshot (Prelude.Maybe Prelude.Int)
modifyClusterSnapshot_manualSnapshotRetentionPeriod :: (Maybe Int -> f (Maybe Int))
-> ModifyClusterSnapshot -> f ModifyClusterSnapshot
modifyClusterSnapshot_manualSnapshotRetentionPeriod = (ModifyClusterSnapshot -> Maybe Int)
-> (ModifyClusterSnapshot -> Maybe Int -> ModifyClusterSnapshot)
-> Lens
ModifyClusterSnapshot ModifyClusterSnapshot (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterSnapshot' {Maybe Int
manualSnapshotRetentionPeriod :: Maybe Int
$sel:manualSnapshotRetentionPeriod:ModifyClusterSnapshot' :: ModifyClusterSnapshot -> Maybe Int
manualSnapshotRetentionPeriod} -> Maybe Int
manualSnapshotRetentionPeriod) (\s :: ModifyClusterSnapshot
s@ModifyClusterSnapshot' {} Maybe Int
a -> ModifyClusterSnapshot
s {$sel:manualSnapshotRetentionPeriod:ModifyClusterSnapshot' :: Maybe Int
manualSnapshotRetentionPeriod = Maybe Int
a} :: ModifyClusterSnapshot)
modifyClusterSnapshot_force :: Lens.Lens' ModifyClusterSnapshot (Prelude.Maybe Prelude.Bool)
modifyClusterSnapshot_force :: (Maybe Bool -> f (Maybe Bool))
-> ModifyClusterSnapshot -> f ModifyClusterSnapshot
modifyClusterSnapshot_force = (ModifyClusterSnapshot -> Maybe Bool)
-> (ModifyClusterSnapshot -> Maybe Bool -> ModifyClusterSnapshot)
-> Lens
ModifyClusterSnapshot
ModifyClusterSnapshot
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterSnapshot' {Maybe Bool
force :: Maybe Bool
$sel:force:ModifyClusterSnapshot' :: ModifyClusterSnapshot -> Maybe Bool
force} -> Maybe Bool
force) (\s :: ModifyClusterSnapshot
s@ModifyClusterSnapshot' {} Maybe Bool
a -> ModifyClusterSnapshot
s {$sel:force:ModifyClusterSnapshot' :: Maybe Bool
force = Maybe Bool
a} :: ModifyClusterSnapshot)
modifyClusterSnapshot_snapshotIdentifier :: Lens.Lens' ModifyClusterSnapshot Prelude.Text
modifyClusterSnapshot_snapshotIdentifier :: (Text -> f Text)
-> ModifyClusterSnapshot -> f ModifyClusterSnapshot
modifyClusterSnapshot_snapshotIdentifier = (ModifyClusterSnapshot -> Text)
-> (ModifyClusterSnapshot -> Text -> ModifyClusterSnapshot)
-> Lens ModifyClusterSnapshot ModifyClusterSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterSnapshot' {Text
snapshotIdentifier :: Text
$sel:snapshotIdentifier:ModifyClusterSnapshot' :: ModifyClusterSnapshot -> Text
snapshotIdentifier} -> Text
snapshotIdentifier) (\s :: ModifyClusterSnapshot
s@ModifyClusterSnapshot' {} Text
a -> ModifyClusterSnapshot
s {$sel:snapshotIdentifier:ModifyClusterSnapshot' :: Text
snapshotIdentifier = Text
a} :: ModifyClusterSnapshot)
instance Core.AWSRequest ModifyClusterSnapshot where
type
AWSResponse ModifyClusterSnapshot =
ModifyClusterSnapshotResponse
request :: ModifyClusterSnapshot -> Request ModifyClusterSnapshot
request = Service -> ModifyClusterSnapshot -> Request ModifyClusterSnapshot
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ModifyClusterSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyClusterSnapshot)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ModifyClusterSnapshot))
-> Logger
-> Service
-> Proxy ModifyClusterSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ModifyClusterSnapshot)))
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
"ModifyClusterSnapshotResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Snapshot -> Int -> ModifyClusterSnapshotResponse
ModifyClusterSnapshotResponse'
(Maybe Snapshot -> Int -> ModifyClusterSnapshotResponse)
-> Either String (Maybe Snapshot)
-> Either String (Int -> ModifyClusterSnapshotResponse)
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 -> ModifyClusterSnapshotResponse)
-> Either String Int -> Either String ModifyClusterSnapshotResponse
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 ModifyClusterSnapshot
instance Prelude.NFData ModifyClusterSnapshot
instance Core.ToHeaders ModifyClusterSnapshot where
toHeaders :: ModifyClusterSnapshot -> ResponseHeaders
toHeaders = ResponseHeaders -> ModifyClusterSnapshot -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ModifyClusterSnapshot where
toPath :: ModifyClusterSnapshot -> ByteString
toPath = ByteString -> ModifyClusterSnapshot -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ModifyClusterSnapshot where
toQuery :: ModifyClusterSnapshot -> QueryString
toQuery ModifyClusterSnapshot' {Maybe Bool
Maybe Int
Text
snapshotIdentifier :: Text
force :: Maybe Bool
manualSnapshotRetentionPeriod :: Maybe Int
$sel:snapshotIdentifier:ModifyClusterSnapshot' :: ModifyClusterSnapshot -> Text
$sel:force:ModifyClusterSnapshot' :: ModifyClusterSnapshot -> Maybe Bool
$sel:manualSnapshotRetentionPeriod:ModifyClusterSnapshot' :: ModifyClusterSnapshot -> 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
"ModifyClusterSnapshot" :: 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
"Force" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
force,
ByteString
"SnapshotIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
snapshotIdentifier
]
data ModifyClusterSnapshotResponse = ModifyClusterSnapshotResponse'
{ ModifyClusterSnapshotResponse -> Maybe Snapshot
snapshot :: Prelude.Maybe Snapshot,
ModifyClusterSnapshotResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyClusterSnapshotResponse
-> ModifyClusterSnapshotResponse -> Bool
(ModifyClusterSnapshotResponse
-> ModifyClusterSnapshotResponse -> Bool)
-> (ModifyClusterSnapshotResponse
-> ModifyClusterSnapshotResponse -> Bool)
-> Eq ModifyClusterSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyClusterSnapshotResponse
-> ModifyClusterSnapshotResponse -> Bool
$c/= :: ModifyClusterSnapshotResponse
-> ModifyClusterSnapshotResponse -> Bool
== :: ModifyClusterSnapshotResponse
-> ModifyClusterSnapshotResponse -> Bool
$c== :: ModifyClusterSnapshotResponse
-> ModifyClusterSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [ModifyClusterSnapshotResponse]
ReadPrec ModifyClusterSnapshotResponse
Int -> ReadS ModifyClusterSnapshotResponse
ReadS [ModifyClusterSnapshotResponse]
(Int -> ReadS ModifyClusterSnapshotResponse)
-> ReadS [ModifyClusterSnapshotResponse]
-> ReadPrec ModifyClusterSnapshotResponse
-> ReadPrec [ModifyClusterSnapshotResponse]
-> Read ModifyClusterSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyClusterSnapshotResponse]
$creadListPrec :: ReadPrec [ModifyClusterSnapshotResponse]
readPrec :: ReadPrec ModifyClusterSnapshotResponse
$creadPrec :: ReadPrec ModifyClusterSnapshotResponse
readList :: ReadS [ModifyClusterSnapshotResponse]
$creadList :: ReadS [ModifyClusterSnapshotResponse]
readsPrec :: Int -> ReadS ModifyClusterSnapshotResponse
$creadsPrec :: Int -> ReadS ModifyClusterSnapshotResponse
Prelude.Read, Int -> ModifyClusterSnapshotResponse -> ShowS
[ModifyClusterSnapshotResponse] -> ShowS
ModifyClusterSnapshotResponse -> String
(Int -> ModifyClusterSnapshotResponse -> ShowS)
-> (ModifyClusterSnapshotResponse -> String)
-> ([ModifyClusterSnapshotResponse] -> ShowS)
-> Show ModifyClusterSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyClusterSnapshotResponse] -> ShowS
$cshowList :: [ModifyClusterSnapshotResponse] -> ShowS
show :: ModifyClusterSnapshotResponse -> String
$cshow :: ModifyClusterSnapshotResponse -> String
showsPrec :: Int -> ModifyClusterSnapshotResponse -> ShowS
$cshowsPrec :: Int -> ModifyClusterSnapshotResponse -> ShowS
Prelude.Show, (forall x.
ModifyClusterSnapshotResponse
-> Rep ModifyClusterSnapshotResponse x)
-> (forall x.
Rep ModifyClusterSnapshotResponse x
-> ModifyClusterSnapshotResponse)
-> Generic ModifyClusterSnapshotResponse
forall x.
Rep ModifyClusterSnapshotResponse x
-> ModifyClusterSnapshotResponse
forall x.
ModifyClusterSnapshotResponse
-> Rep ModifyClusterSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyClusterSnapshotResponse x
-> ModifyClusterSnapshotResponse
$cfrom :: forall x.
ModifyClusterSnapshotResponse
-> Rep ModifyClusterSnapshotResponse x
Prelude.Generic)
newModifyClusterSnapshotResponse ::
Prelude.Int ->
ModifyClusterSnapshotResponse
newModifyClusterSnapshotResponse :: Int -> ModifyClusterSnapshotResponse
newModifyClusterSnapshotResponse Int
pHttpStatus_ =
ModifyClusterSnapshotResponse' :: Maybe Snapshot -> Int -> ModifyClusterSnapshotResponse
ModifyClusterSnapshotResponse'
{ $sel:snapshot:ModifyClusterSnapshotResponse' :: Maybe Snapshot
snapshot =
Maybe Snapshot
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ModifyClusterSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
}
modifyClusterSnapshotResponse_snapshot :: Lens.Lens' ModifyClusterSnapshotResponse (Prelude.Maybe Snapshot)
modifyClusterSnapshotResponse_snapshot :: (Maybe Snapshot -> f (Maybe Snapshot))
-> ModifyClusterSnapshotResponse -> f ModifyClusterSnapshotResponse
modifyClusterSnapshotResponse_snapshot = (ModifyClusterSnapshotResponse -> Maybe Snapshot)
-> (ModifyClusterSnapshotResponse
-> Maybe Snapshot -> ModifyClusterSnapshotResponse)
-> Lens
ModifyClusterSnapshotResponse
ModifyClusterSnapshotResponse
(Maybe Snapshot)
(Maybe Snapshot)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterSnapshotResponse' {Maybe Snapshot
snapshot :: Maybe Snapshot
$sel:snapshot:ModifyClusterSnapshotResponse' :: ModifyClusterSnapshotResponse -> Maybe Snapshot
snapshot} -> Maybe Snapshot
snapshot) (\s :: ModifyClusterSnapshotResponse
s@ModifyClusterSnapshotResponse' {} Maybe Snapshot
a -> ModifyClusterSnapshotResponse
s {$sel:snapshot:ModifyClusterSnapshotResponse' :: Maybe Snapshot
snapshot = Maybe Snapshot
a} :: ModifyClusterSnapshotResponse)
modifyClusterSnapshotResponse_httpStatus :: Lens.Lens' ModifyClusterSnapshotResponse Prelude.Int
modifyClusterSnapshotResponse_httpStatus :: (Int -> f Int)
-> ModifyClusterSnapshotResponse -> f ModifyClusterSnapshotResponse
modifyClusterSnapshotResponse_httpStatus = (ModifyClusterSnapshotResponse -> Int)
-> (ModifyClusterSnapshotResponse
-> Int -> ModifyClusterSnapshotResponse)
-> Lens
ModifyClusterSnapshotResponse ModifyClusterSnapshotResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClusterSnapshotResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyClusterSnapshotResponse' :: ModifyClusterSnapshotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyClusterSnapshotResponse
s@ModifyClusterSnapshotResponse' {} Int
a -> ModifyClusterSnapshotResponse
s {$sel:httpStatus:ModifyClusterSnapshotResponse' :: Int
httpStatus = Int
a} :: ModifyClusterSnapshotResponse)
instance Prelude.NFData ModifyClusterSnapshotResponse