{-# 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.RDS.ModifyDBSnapshot
(
ModifyDBSnapshot (..),
newModifyDBSnapshot,
modifyDBSnapshot_engineVersion,
modifyDBSnapshot_optionGroupName,
modifyDBSnapshot_dbSnapshotIdentifier,
ModifyDBSnapshotResponse (..),
newModifyDBSnapshotResponse,
modifyDBSnapshotResponse_dbSnapshot,
modifyDBSnapshotResponse_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
data ModifyDBSnapshot = ModifyDBSnapshot'
{
ModifyDBSnapshot -> Maybe Text
engineVersion :: Prelude.Maybe Prelude.Text,
ModifyDBSnapshot -> Maybe Text
optionGroupName :: Prelude.Maybe Prelude.Text,
ModifyDBSnapshot -> Text
dbSnapshotIdentifier :: Prelude.Text
}
deriving (ModifyDBSnapshot -> ModifyDBSnapshot -> Bool
(ModifyDBSnapshot -> ModifyDBSnapshot -> Bool)
-> (ModifyDBSnapshot -> ModifyDBSnapshot -> Bool)
-> Eq ModifyDBSnapshot
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyDBSnapshot -> ModifyDBSnapshot -> Bool
$c/= :: ModifyDBSnapshot -> ModifyDBSnapshot -> Bool
== :: ModifyDBSnapshot -> ModifyDBSnapshot -> Bool
$c== :: ModifyDBSnapshot -> ModifyDBSnapshot -> Bool
Prelude.Eq, ReadPrec [ModifyDBSnapshot]
ReadPrec ModifyDBSnapshot
Int -> ReadS ModifyDBSnapshot
ReadS [ModifyDBSnapshot]
(Int -> ReadS ModifyDBSnapshot)
-> ReadS [ModifyDBSnapshot]
-> ReadPrec ModifyDBSnapshot
-> ReadPrec [ModifyDBSnapshot]
-> Read ModifyDBSnapshot
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyDBSnapshot]
$creadListPrec :: ReadPrec [ModifyDBSnapshot]
readPrec :: ReadPrec ModifyDBSnapshot
$creadPrec :: ReadPrec ModifyDBSnapshot
readList :: ReadS [ModifyDBSnapshot]
$creadList :: ReadS [ModifyDBSnapshot]
readsPrec :: Int -> ReadS ModifyDBSnapshot
$creadsPrec :: Int -> ReadS ModifyDBSnapshot
Prelude.Read, Int -> ModifyDBSnapshot -> ShowS
[ModifyDBSnapshot] -> ShowS
ModifyDBSnapshot -> String
(Int -> ModifyDBSnapshot -> ShowS)
-> (ModifyDBSnapshot -> String)
-> ([ModifyDBSnapshot] -> ShowS)
-> Show ModifyDBSnapshot
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyDBSnapshot] -> ShowS
$cshowList :: [ModifyDBSnapshot] -> ShowS
show :: ModifyDBSnapshot -> String
$cshow :: ModifyDBSnapshot -> String
showsPrec :: Int -> ModifyDBSnapshot -> ShowS
$cshowsPrec :: Int -> ModifyDBSnapshot -> ShowS
Prelude.Show, (forall x. ModifyDBSnapshot -> Rep ModifyDBSnapshot x)
-> (forall x. Rep ModifyDBSnapshot x -> ModifyDBSnapshot)
-> Generic ModifyDBSnapshot
forall x. Rep ModifyDBSnapshot x -> ModifyDBSnapshot
forall x. ModifyDBSnapshot -> Rep ModifyDBSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ModifyDBSnapshot x -> ModifyDBSnapshot
$cfrom :: forall x. ModifyDBSnapshot -> Rep ModifyDBSnapshot x
Prelude.Generic)
newModifyDBSnapshot ::
Prelude.Text ->
ModifyDBSnapshot
newModifyDBSnapshot :: Text -> ModifyDBSnapshot
newModifyDBSnapshot Text
pDBSnapshotIdentifier_ =
ModifyDBSnapshot' :: Maybe Text -> Maybe Text -> Text -> ModifyDBSnapshot
ModifyDBSnapshot'
{ $sel:engineVersion:ModifyDBSnapshot' :: Maybe Text
engineVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:optionGroupName:ModifyDBSnapshot' :: Maybe Text
optionGroupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dbSnapshotIdentifier:ModifyDBSnapshot' :: Text
dbSnapshotIdentifier = Text
pDBSnapshotIdentifier_
}
modifyDBSnapshot_engineVersion :: Lens.Lens' ModifyDBSnapshot (Prelude.Maybe Prelude.Text)
modifyDBSnapshot_engineVersion :: (Maybe Text -> f (Maybe Text))
-> ModifyDBSnapshot -> f ModifyDBSnapshot
modifyDBSnapshot_engineVersion = (ModifyDBSnapshot -> Maybe Text)
-> (ModifyDBSnapshot -> Maybe Text -> ModifyDBSnapshot)
-> Lens ModifyDBSnapshot ModifyDBSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBSnapshot' {Maybe Text
engineVersion :: Maybe Text
$sel:engineVersion:ModifyDBSnapshot' :: ModifyDBSnapshot -> Maybe Text
engineVersion} -> Maybe Text
engineVersion) (\s :: ModifyDBSnapshot
s@ModifyDBSnapshot' {} Maybe Text
a -> ModifyDBSnapshot
s {$sel:engineVersion:ModifyDBSnapshot' :: Maybe Text
engineVersion = Maybe Text
a} :: ModifyDBSnapshot)
modifyDBSnapshot_optionGroupName :: Lens.Lens' ModifyDBSnapshot (Prelude.Maybe Prelude.Text)
modifyDBSnapshot_optionGroupName :: (Maybe Text -> f (Maybe Text))
-> ModifyDBSnapshot -> f ModifyDBSnapshot
modifyDBSnapshot_optionGroupName = (ModifyDBSnapshot -> Maybe Text)
-> (ModifyDBSnapshot -> Maybe Text -> ModifyDBSnapshot)
-> Lens ModifyDBSnapshot ModifyDBSnapshot (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBSnapshot' {Maybe Text
optionGroupName :: Maybe Text
$sel:optionGroupName:ModifyDBSnapshot' :: ModifyDBSnapshot -> Maybe Text
optionGroupName} -> Maybe Text
optionGroupName) (\s :: ModifyDBSnapshot
s@ModifyDBSnapshot' {} Maybe Text
a -> ModifyDBSnapshot
s {$sel:optionGroupName:ModifyDBSnapshot' :: Maybe Text
optionGroupName = Maybe Text
a} :: ModifyDBSnapshot)
modifyDBSnapshot_dbSnapshotIdentifier :: Lens.Lens' ModifyDBSnapshot Prelude.Text
modifyDBSnapshot_dbSnapshotIdentifier :: (Text -> f Text) -> ModifyDBSnapshot -> f ModifyDBSnapshot
modifyDBSnapshot_dbSnapshotIdentifier = (ModifyDBSnapshot -> Text)
-> (ModifyDBSnapshot -> Text -> ModifyDBSnapshot)
-> Lens ModifyDBSnapshot ModifyDBSnapshot Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBSnapshot' {Text
dbSnapshotIdentifier :: Text
$sel:dbSnapshotIdentifier:ModifyDBSnapshot' :: ModifyDBSnapshot -> Text
dbSnapshotIdentifier} -> Text
dbSnapshotIdentifier) (\s :: ModifyDBSnapshot
s@ModifyDBSnapshot' {} Text
a -> ModifyDBSnapshot
s {$sel:dbSnapshotIdentifier:ModifyDBSnapshot' :: Text
dbSnapshotIdentifier = Text
a} :: ModifyDBSnapshot)
instance Core.AWSRequest ModifyDBSnapshot where
type
AWSResponse ModifyDBSnapshot =
ModifyDBSnapshotResponse
request :: ModifyDBSnapshot -> Request ModifyDBSnapshot
request = Service -> ModifyDBSnapshot -> Request ModifyDBSnapshot
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
response :: Logger
-> Service
-> Proxy ModifyDBSnapshot
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyDBSnapshot)))
response =
Text
-> (Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ModifyDBSnapshot))
-> Logger
-> Service
-> Proxy ModifyDBSnapshot
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ModifyDBSnapshot)))
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
"ModifyDBSnapshotResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe DBSnapshot -> Int -> ModifyDBSnapshotResponse
ModifyDBSnapshotResponse'
(Maybe DBSnapshot -> Int -> ModifyDBSnapshotResponse)
-> Either String (Maybe DBSnapshot)
-> Either String (Int -> ModifyDBSnapshotResponse)
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 -> ModifyDBSnapshotResponse)
-> Either String Int -> Either String ModifyDBSnapshotResponse
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 ModifyDBSnapshot
instance Prelude.NFData ModifyDBSnapshot
instance Core.ToHeaders ModifyDBSnapshot where
toHeaders :: ModifyDBSnapshot -> ResponseHeaders
toHeaders = ResponseHeaders -> ModifyDBSnapshot -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ModifyDBSnapshot where
toPath :: ModifyDBSnapshot -> ByteString
toPath = ByteString -> ModifyDBSnapshot -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ModifyDBSnapshot where
toQuery :: ModifyDBSnapshot -> QueryString
toQuery ModifyDBSnapshot' {Maybe Text
Text
dbSnapshotIdentifier :: Text
optionGroupName :: Maybe Text
engineVersion :: Maybe Text
$sel:dbSnapshotIdentifier:ModifyDBSnapshot' :: ModifyDBSnapshot -> Text
$sel:optionGroupName:ModifyDBSnapshot' :: ModifyDBSnapshot -> Maybe Text
$sel:engineVersion:ModifyDBSnapshot' :: ModifyDBSnapshot -> 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
"ModifyDBSnapshot" :: Prelude.ByteString),
ByteString
"Version"
ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2014-10-31" :: Prelude.ByteString),
ByteString
"EngineVersion" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
engineVersion,
ByteString
"OptionGroupName" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
optionGroupName,
ByteString
"DBSnapshotIdentifier" ByteString -> Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Text
dbSnapshotIdentifier
]
data ModifyDBSnapshotResponse = ModifyDBSnapshotResponse'
{ ModifyDBSnapshotResponse -> Maybe DBSnapshot
dbSnapshot :: Prelude.Maybe DBSnapshot,
ModifyDBSnapshotResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ModifyDBSnapshotResponse -> ModifyDBSnapshotResponse -> Bool
(ModifyDBSnapshotResponse -> ModifyDBSnapshotResponse -> Bool)
-> (ModifyDBSnapshotResponse -> ModifyDBSnapshotResponse -> Bool)
-> Eq ModifyDBSnapshotResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyDBSnapshotResponse -> ModifyDBSnapshotResponse -> Bool
$c/= :: ModifyDBSnapshotResponse -> ModifyDBSnapshotResponse -> Bool
== :: ModifyDBSnapshotResponse -> ModifyDBSnapshotResponse -> Bool
$c== :: ModifyDBSnapshotResponse -> ModifyDBSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [ModifyDBSnapshotResponse]
ReadPrec ModifyDBSnapshotResponse
Int -> ReadS ModifyDBSnapshotResponse
ReadS [ModifyDBSnapshotResponse]
(Int -> ReadS ModifyDBSnapshotResponse)
-> ReadS [ModifyDBSnapshotResponse]
-> ReadPrec ModifyDBSnapshotResponse
-> ReadPrec [ModifyDBSnapshotResponse]
-> Read ModifyDBSnapshotResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyDBSnapshotResponse]
$creadListPrec :: ReadPrec [ModifyDBSnapshotResponse]
readPrec :: ReadPrec ModifyDBSnapshotResponse
$creadPrec :: ReadPrec ModifyDBSnapshotResponse
readList :: ReadS [ModifyDBSnapshotResponse]
$creadList :: ReadS [ModifyDBSnapshotResponse]
readsPrec :: Int -> ReadS ModifyDBSnapshotResponse
$creadsPrec :: Int -> ReadS ModifyDBSnapshotResponse
Prelude.Read, Int -> ModifyDBSnapshotResponse -> ShowS
[ModifyDBSnapshotResponse] -> ShowS
ModifyDBSnapshotResponse -> String
(Int -> ModifyDBSnapshotResponse -> ShowS)
-> (ModifyDBSnapshotResponse -> String)
-> ([ModifyDBSnapshotResponse] -> ShowS)
-> Show ModifyDBSnapshotResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyDBSnapshotResponse] -> ShowS
$cshowList :: [ModifyDBSnapshotResponse] -> ShowS
show :: ModifyDBSnapshotResponse -> String
$cshow :: ModifyDBSnapshotResponse -> String
showsPrec :: Int -> ModifyDBSnapshotResponse -> ShowS
$cshowsPrec :: Int -> ModifyDBSnapshotResponse -> ShowS
Prelude.Show, (forall x.
ModifyDBSnapshotResponse -> Rep ModifyDBSnapshotResponse x)
-> (forall x.
Rep ModifyDBSnapshotResponse x -> ModifyDBSnapshotResponse)
-> Generic ModifyDBSnapshotResponse
forall x.
Rep ModifyDBSnapshotResponse x -> ModifyDBSnapshotResponse
forall x.
ModifyDBSnapshotResponse -> Rep ModifyDBSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyDBSnapshotResponse x -> ModifyDBSnapshotResponse
$cfrom :: forall x.
ModifyDBSnapshotResponse -> Rep ModifyDBSnapshotResponse x
Prelude.Generic)
newModifyDBSnapshotResponse ::
Prelude.Int ->
ModifyDBSnapshotResponse
newModifyDBSnapshotResponse :: Int -> ModifyDBSnapshotResponse
newModifyDBSnapshotResponse Int
pHttpStatus_ =
ModifyDBSnapshotResponse' :: Maybe DBSnapshot -> Int -> ModifyDBSnapshotResponse
ModifyDBSnapshotResponse'
{ $sel:dbSnapshot:ModifyDBSnapshotResponse' :: Maybe DBSnapshot
dbSnapshot =
Maybe DBSnapshot
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ModifyDBSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
}
modifyDBSnapshotResponse_dbSnapshot :: Lens.Lens' ModifyDBSnapshotResponse (Prelude.Maybe DBSnapshot)
modifyDBSnapshotResponse_dbSnapshot :: (Maybe DBSnapshot -> f (Maybe DBSnapshot))
-> ModifyDBSnapshotResponse -> f ModifyDBSnapshotResponse
modifyDBSnapshotResponse_dbSnapshot = (ModifyDBSnapshotResponse -> Maybe DBSnapshot)
-> (ModifyDBSnapshotResponse
-> Maybe DBSnapshot -> ModifyDBSnapshotResponse)
-> Lens
ModifyDBSnapshotResponse
ModifyDBSnapshotResponse
(Maybe DBSnapshot)
(Maybe DBSnapshot)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBSnapshotResponse' {Maybe DBSnapshot
dbSnapshot :: Maybe DBSnapshot
$sel:dbSnapshot:ModifyDBSnapshotResponse' :: ModifyDBSnapshotResponse -> Maybe DBSnapshot
dbSnapshot} -> Maybe DBSnapshot
dbSnapshot) (\s :: ModifyDBSnapshotResponse
s@ModifyDBSnapshotResponse' {} Maybe DBSnapshot
a -> ModifyDBSnapshotResponse
s {$sel:dbSnapshot:ModifyDBSnapshotResponse' :: Maybe DBSnapshot
dbSnapshot = Maybe DBSnapshot
a} :: ModifyDBSnapshotResponse)
modifyDBSnapshotResponse_httpStatus :: Lens.Lens' ModifyDBSnapshotResponse Prelude.Int
modifyDBSnapshotResponse_httpStatus :: (Int -> f Int)
-> ModifyDBSnapshotResponse -> f ModifyDBSnapshotResponse
modifyDBSnapshotResponse_httpStatus = (ModifyDBSnapshotResponse -> Int)
-> (ModifyDBSnapshotResponse -> Int -> ModifyDBSnapshotResponse)
-> Lens ModifyDBSnapshotResponse ModifyDBSnapshotResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyDBSnapshotResponse' {Int
httpStatus :: Int
$sel:httpStatus:ModifyDBSnapshotResponse' :: ModifyDBSnapshotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ModifyDBSnapshotResponse
s@ModifyDBSnapshotResponse' {} Int
a -> ModifyDBSnapshotResponse
s {$sel:httpStatus:ModifyDBSnapshotResponse' :: Int
httpStatus = Int
a} :: ModifyDBSnapshotResponse)
instance Prelude.NFData ModifyDBSnapshotResponse