{-# 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.DocDbElastic.DeleteClusterSnapshot
(
DeleteClusterSnapshot (..),
newDeleteClusterSnapshot,
deleteClusterSnapshot_snapshotArn,
DeleteClusterSnapshotResponse (..),
newDeleteClusterSnapshotResponse,
deleteClusterSnapshotResponse_httpStatus,
deleteClusterSnapshotResponse_snapshot,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DocDbElastic.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteClusterSnapshot = DeleteClusterSnapshot'
{
DeleteClusterSnapshot -> Text
snapshotArn :: 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
pSnapshotArn_ =
DeleteClusterSnapshot' {$sel:snapshotArn:DeleteClusterSnapshot' :: Text
snapshotArn = Text
pSnapshotArn_}
deleteClusterSnapshot_snapshotArn :: Lens.Lens' DeleteClusterSnapshot Prelude.Text
deleteClusterSnapshot_snapshotArn :: Lens' DeleteClusterSnapshot Text
deleteClusterSnapshot_snapshotArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteClusterSnapshot' {Text
snapshotArn :: Text
$sel:snapshotArn:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Text
snapshotArn} -> Text
snapshotArn) (\s :: DeleteClusterSnapshot
s@DeleteClusterSnapshot' {} Text
a -> DeleteClusterSnapshot
s {$sel:snapshotArn:DeleteClusterSnapshot' :: Text
snapshotArn = 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.delete (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 =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Int -> ClusterSnapshot -> DeleteClusterSnapshotResponse
DeleteClusterSnapshotResponse'
forall (f :: * -> *) a b. Functor 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))
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"snapshot")
)
instance Prelude.Hashable DeleteClusterSnapshot where
hashWithSalt :: Int -> DeleteClusterSnapshot -> Int
hashWithSalt Int
_salt DeleteClusterSnapshot' {Text
snapshotArn :: Text
$sel:snapshotArn:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
snapshotArn
instance Prelude.NFData DeleteClusterSnapshot where
rnf :: DeleteClusterSnapshot -> ()
rnf DeleteClusterSnapshot' {Text
snapshotArn :: Text
$sel:snapshotArn:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
snapshotArn
instance Data.ToHeaders DeleteClusterSnapshot where
toHeaders :: DeleteClusterSnapshot -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath DeleteClusterSnapshot where
toPath :: DeleteClusterSnapshot -> ByteString
toPath DeleteClusterSnapshot' {Text
snapshotArn :: Text
$sel:snapshotArn:DeleteClusterSnapshot' :: DeleteClusterSnapshot -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/cluster-snapshot/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
snapshotArn]
instance Data.ToQuery DeleteClusterSnapshot where
toQuery :: DeleteClusterSnapshot -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteClusterSnapshotResponse = DeleteClusterSnapshotResponse'
{
DeleteClusterSnapshotResponse -> Int
httpStatus :: Prelude.Int,
DeleteClusterSnapshotResponse -> ClusterSnapshot
snapshot :: ClusterSnapshot
}
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 ->
ClusterSnapshot ->
DeleteClusterSnapshotResponse
newDeleteClusterSnapshotResponse :: Int -> ClusterSnapshot -> DeleteClusterSnapshotResponse
newDeleteClusterSnapshotResponse
Int
pHttpStatus_
ClusterSnapshot
pSnapshot_ =
DeleteClusterSnapshotResponse'
{ $sel:httpStatus:DeleteClusterSnapshotResponse' :: Int
httpStatus =
Int
pHttpStatus_,
$sel:snapshot:DeleteClusterSnapshotResponse' :: ClusterSnapshot
snapshot = ClusterSnapshot
pSnapshot_
}
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)
deleteClusterSnapshotResponse_snapshot :: Lens.Lens' DeleteClusterSnapshotResponse ClusterSnapshot
deleteClusterSnapshotResponse_snapshot :: Lens' DeleteClusterSnapshotResponse ClusterSnapshot
deleteClusterSnapshotResponse_snapshot = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteClusterSnapshotResponse' {ClusterSnapshot
snapshot :: ClusterSnapshot
$sel:snapshot:DeleteClusterSnapshotResponse' :: DeleteClusterSnapshotResponse -> ClusterSnapshot
snapshot} -> ClusterSnapshot
snapshot) (\s :: DeleteClusterSnapshotResponse
s@DeleteClusterSnapshotResponse' {} ClusterSnapshot
a -> DeleteClusterSnapshotResponse
s {$sel:snapshot:DeleteClusterSnapshotResponse' :: ClusterSnapshot
snapshot = ClusterSnapshot
a} :: DeleteClusterSnapshotResponse)
instance Prelude.NFData DeleteClusterSnapshotResponse where
rnf :: DeleteClusterSnapshotResponse -> ()
rnf DeleteClusterSnapshotResponse' {Int
ClusterSnapshot
snapshot :: ClusterSnapshot
httpStatus :: Int
$sel:snapshot:DeleteClusterSnapshotResponse' :: DeleteClusterSnapshotResponse -> ClusterSnapshot
$sel:httpStatus:DeleteClusterSnapshotResponse' :: DeleteClusterSnapshotResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf ClusterSnapshot
snapshot