{-# 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.DeleteClusterSnapshot
(
DeleteClusterSnapshot (..),
newDeleteClusterSnapshot,
deleteClusterSnapshot_snapshotClusterIdentifier,
deleteClusterSnapshot_snapshotIdentifier,
DeleteClusterSnapshotResponse (..),
newDeleteClusterSnapshotResponse,
deleteClusterSnapshotResponse_snapshot,
deleteClusterSnapshotResponse_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 DeleteClusterSnapshot = DeleteClusterSnapshot'
{
DeleteClusterSnapshot -> Maybe Text
snapshotClusterIdentifier :: Prelude.Maybe Prelude.Text,
DeleteClusterSnapshot -> Text
snapshotIdentifier :: Prelude.Text
}
deriving (DeleteClusterSnapshot -> DeleteClusterSnapshot -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteClusterSnapshot -> DeleteClusterSnapshot -> Bool
$c/= :: DeleteClusterSnapshot -> DeleteClusterSnapshot -> Bool
== :: DeleteClusterSnapshot -> DeleteClusterSnapshot -> Bool
$c== :: DeleteClusterSnapshot -> DeleteClusterSnapshot -> Bool
Prelude.Eq, ReadPrec [DeleteClusterSnapshot]
ReadPrec DeleteClusterSnapshot
Int -> ReadS DeleteClusterSnapshot
ReadS [DeleteClusterSnapshot]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteClusterSnapshot]
$creadListPrec :: ReadPrec [DeleteClusterSnapshot]
readPrec :: ReadPrec DeleteClusterSnapshot
$creadPrec :: ReadPrec DeleteClusterSnapshot
readList :: ReadS [DeleteClusterSnapshot]
$creadList :: ReadS [DeleteClusterSnapshot]
readsPrec :: Int -> ReadS DeleteClusterSnapshot
$creadsPrec :: Int -> ReadS DeleteClusterSnapshot
Prelude.Read, Int -> DeleteClusterSnapshot -> ShowS
[DeleteClusterSnapshot] -> ShowS
DeleteClusterSnapshot -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteClusterSnapshot] -> ShowS
$cshowList :: [DeleteClusterSnapshot] -> ShowS
show :: DeleteClusterSnapshot -> String
$cshow :: DeleteClusterSnapshot -> String
showsPrec :: Int -> DeleteClusterSnapshot -> ShowS
$cshowsPrec :: Int -> DeleteClusterSnapshot -> ShowS
Prelude.Show, forall x. Rep DeleteClusterSnapshot x -> DeleteClusterSnapshot
forall x. DeleteClusterSnapshot -> Rep DeleteClusterSnapshot x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteClusterSnapshot x -> DeleteClusterSnapshot
$cfrom :: forall x. DeleteClusterSnapshot -> Rep DeleteClusterSnapshot x
Prelude.Generic)
newDeleteClusterSnapshot ::
Prelude.Text ->
DeleteClusterSnapshot
newDeleteClusterSnapshot :: Text -> DeleteClusterSnapshot
newDeleteClusterSnapshot Text
pSnapshotIdentifier_ =
DeleteClusterSnapshot'
{ $sel:snapshotClusterIdentifier:DeleteClusterSnapshot' :: Maybe Text
snapshotClusterIdentifier =
forall a. Maybe a
Prelude.Nothing,
$sel:snapshotIdentifier:DeleteClusterSnapshot' :: Text
snapshotIdentifier = Text
pSnapshotIdentifier_
}
deleteClusterSnapshot_snapshotClusterIdentifier :: Lens.Lens' DeleteClusterSnapshot (Prelude.Maybe Prelude.Text)
deleteClusterSnapshot_snapshotClusterIdentifier :: Lens' DeleteClusterSnapshot (Maybe Text)
deleteClusterSnapshot_snapshotClusterIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteClusterSnapshot' {Maybe Text
snapshotClusterIdentifier :: Maybe Text
$sel:snapshotClusterIdentifier:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Maybe Text
snapshotClusterIdentifier} -> Maybe Text
snapshotClusterIdentifier) (\s :: DeleteClusterSnapshot
s@DeleteClusterSnapshot' {} Maybe Text
a -> DeleteClusterSnapshot
s {$sel:snapshotClusterIdentifier:DeleteClusterSnapshot' :: Maybe Text
snapshotClusterIdentifier = Maybe Text
a} :: DeleteClusterSnapshot)
deleteClusterSnapshot_snapshotIdentifier :: Lens.Lens' DeleteClusterSnapshot Prelude.Text
deleteClusterSnapshot_snapshotIdentifier :: Lens' DeleteClusterSnapshot Text
deleteClusterSnapshot_snapshotIdentifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteClusterSnapshot' {Text
snapshotIdentifier :: Text
$sel:snapshotIdentifier:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Text
snapshotIdentifier} -> Text
snapshotIdentifier) (\s :: DeleteClusterSnapshot
s@DeleteClusterSnapshot' {} Text
a -> DeleteClusterSnapshot
s {$sel:snapshotIdentifier:DeleteClusterSnapshot' :: Text
snapshotIdentifier = Text
a} :: DeleteClusterSnapshot)
instance Core.AWSRequest DeleteClusterSnapshot where
type
AWSResponse DeleteClusterSnapshot =
DeleteClusterSnapshotResponse
request :: (Service -> Service)
-> DeleteClusterSnapshot -> Request DeleteClusterSnapshot
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 DeleteClusterSnapshot
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteClusterSnapshot)))
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
"DeleteClusterSnapshotResult"
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Snapshot -> Int -> DeleteClusterSnapshotResponse
DeleteClusterSnapshotResponse'
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
"Snapshot")
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 DeleteClusterSnapshot where
hashWithSalt :: Int -> DeleteClusterSnapshot -> Int
hashWithSalt Int
_salt DeleteClusterSnapshot' {Maybe Text
Text
snapshotIdentifier :: Text
snapshotClusterIdentifier :: Maybe Text
$sel:snapshotIdentifier:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Text
$sel:snapshotClusterIdentifier:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snapshotClusterIdentifier
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotIdentifier
instance Prelude.NFData DeleteClusterSnapshot where
rnf :: DeleteClusterSnapshot -> ()
rnf DeleteClusterSnapshot' {Maybe Text
Text
snapshotIdentifier :: Text
snapshotClusterIdentifier :: Maybe Text
$sel:snapshotIdentifier:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Text
$sel:snapshotClusterIdentifier:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snapshotClusterIdentifier
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotIdentifier
instance Data.ToHeaders DeleteClusterSnapshot where
toHeaders :: DeleteClusterSnapshot -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath DeleteClusterSnapshot where
toPath :: DeleteClusterSnapshot -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteClusterSnapshot where
toQuery :: DeleteClusterSnapshot -> QueryString
toQuery DeleteClusterSnapshot' {Maybe Text
Text
snapshotIdentifier :: Text
snapshotClusterIdentifier :: Maybe Text
$sel:snapshotIdentifier:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Text
$sel:snapshotClusterIdentifier:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Maybe Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Action"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"DeleteClusterSnapshot" :: Prelude.ByteString),
ByteString
"Version"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: (ByteString
"2012-12-01" :: Prelude.ByteString),
ByteString
"SnapshotClusterIdentifier"
forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
snapshotClusterIdentifier,
ByteString
"SnapshotIdentifier" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
snapshotIdentifier
]
data DeleteClusterSnapshotResponse = DeleteClusterSnapshotResponse'
{ DeleteClusterSnapshotResponse -> Maybe Snapshot
snapshot :: Prelude.Maybe Snapshot,
DeleteClusterSnapshotResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteClusterSnapshotResponse
-> DeleteClusterSnapshotResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteClusterSnapshotResponse
-> DeleteClusterSnapshotResponse -> Bool
$c/= :: DeleteClusterSnapshotResponse
-> DeleteClusterSnapshotResponse -> Bool
== :: DeleteClusterSnapshotResponse
-> DeleteClusterSnapshotResponse -> Bool
$c== :: DeleteClusterSnapshotResponse
-> DeleteClusterSnapshotResponse -> Bool
Prelude.Eq, ReadPrec [DeleteClusterSnapshotResponse]
ReadPrec DeleteClusterSnapshotResponse
Int -> ReadS DeleteClusterSnapshotResponse
ReadS [DeleteClusterSnapshotResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteClusterSnapshotResponse]
$creadListPrec :: ReadPrec [DeleteClusterSnapshotResponse]
readPrec :: ReadPrec DeleteClusterSnapshotResponse
$creadPrec :: ReadPrec DeleteClusterSnapshotResponse
readList :: ReadS [DeleteClusterSnapshotResponse]
$creadList :: ReadS [DeleteClusterSnapshotResponse]
readsPrec :: Int -> ReadS DeleteClusterSnapshotResponse
$creadsPrec :: Int -> ReadS DeleteClusterSnapshotResponse
Prelude.Read, Int -> DeleteClusterSnapshotResponse -> ShowS
[DeleteClusterSnapshotResponse] -> ShowS
DeleteClusterSnapshotResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteClusterSnapshotResponse] -> ShowS
$cshowList :: [DeleteClusterSnapshotResponse] -> ShowS
show :: DeleteClusterSnapshotResponse -> String
$cshow :: DeleteClusterSnapshotResponse -> String
showsPrec :: Int -> DeleteClusterSnapshotResponse -> ShowS
$cshowsPrec :: Int -> DeleteClusterSnapshotResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteClusterSnapshotResponse x
-> DeleteClusterSnapshotResponse
forall x.
DeleteClusterSnapshotResponse
-> Rep DeleteClusterSnapshotResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteClusterSnapshotResponse x
-> DeleteClusterSnapshotResponse
$cfrom :: forall x.
DeleteClusterSnapshotResponse
-> Rep DeleteClusterSnapshotResponse x
Prelude.Generic)
newDeleteClusterSnapshotResponse ::
Prelude.Int ->
DeleteClusterSnapshotResponse
newDeleteClusterSnapshotResponse :: Int -> DeleteClusterSnapshotResponse
newDeleteClusterSnapshotResponse Int
pHttpStatus_ =
DeleteClusterSnapshotResponse'
{ $sel:snapshot:DeleteClusterSnapshotResponse' :: Maybe Snapshot
snapshot =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteClusterSnapshotResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteClusterSnapshotResponse_snapshot :: Lens.Lens' DeleteClusterSnapshotResponse (Prelude.Maybe Snapshot)
deleteClusterSnapshotResponse_snapshot :: Lens' DeleteClusterSnapshotResponse (Maybe Snapshot)
deleteClusterSnapshotResponse_snapshot = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteClusterSnapshotResponse' {Maybe Snapshot
snapshot :: Maybe Snapshot
$sel:snapshot:DeleteClusterSnapshotResponse' :: DeleteClusterSnapshotResponse -> Maybe Snapshot
snapshot} -> Maybe Snapshot
snapshot) (\s :: DeleteClusterSnapshotResponse
s@DeleteClusterSnapshotResponse' {} Maybe Snapshot
a -> DeleteClusterSnapshotResponse
s {$sel:snapshot:DeleteClusterSnapshotResponse' :: Maybe Snapshot
snapshot = Maybe Snapshot
a} :: DeleteClusterSnapshotResponse)
deleteClusterSnapshotResponse_httpStatus :: Lens.Lens' DeleteClusterSnapshotResponse Prelude.Int
deleteClusterSnapshotResponse_httpStatus :: Lens' DeleteClusterSnapshotResponse Int
deleteClusterSnapshotResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteClusterSnapshotResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteClusterSnapshotResponse' :: DeleteClusterSnapshotResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteClusterSnapshotResponse
s@DeleteClusterSnapshotResponse' {} Int
a -> DeleteClusterSnapshotResponse
s {$sel:httpStatus:DeleteClusterSnapshotResponse' :: Int
httpStatus = Int
a} :: DeleteClusterSnapshotResponse)
instance Prelude.NFData DeleteClusterSnapshotResponse where
rnf :: DeleteClusterSnapshotResponse -> ()
rnf DeleteClusterSnapshotResponse' {Int
Maybe Snapshot
httpStatus :: Int
snapshot :: Maybe Snapshot
$sel:httpStatus:DeleteClusterSnapshotResponse' :: DeleteClusterSnapshotResponse -> Int
$sel:snapshot:DeleteClusterSnapshotResponse' :: DeleteClusterSnapshotResponse -> Maybe Snapshot
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Snapshot
snapshot
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus