{-# 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.DMS.DeleteReplicationTask
(
DeleteReplicationTask (..),
newDeleteReplicationTask,
deleteReplicationTask_replicationTaskArn,
DeleteReplicationTaskResponse (..),
newDeleteReplicationTaskResponse,
deleteReplicationTaskResponse_replicationTask,
deleteReplicationTaskResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DMS.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteReplicationTask = DeleteReplicationTask'
{
DeleteReplicationTask -> Text
replicationTaskArn :: Prelude.Text
}
deriving (DeleteReplicationTask -> DeleteReplicationTask -> Bool
(DeleteReplicationTask -> DeleteReplicationTask -> Bool)
-> (DeleteReplicationTask -> DeleteReplicationTask -> Bool)
-> Eq DeleteReplicationTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReplicationTask -> DeleteReplicationTask -> Bool
$c/= :: DeleteReplicationTask -> DeleteReplicationTask -> Bool
== :: DeleteReplicationTask -> DeleteReplicationTask -> Bool
$c== :: DeleteReplicationTask -> DeleteReplicationTask -> Bool
Prelude.Eq, ReadPrec [DeleteReplicationTask]
ReadPrec DeleteReplicationTask
Int -> ReadS DeleteReplicationTask
ReadS [DeleteReplicationTask]
(Int -> ReadS DeleteReplicationTask)
-> ReadS [DeleteReplicationTask]
-> ReadPrec DeleteReplicationTask
-> ReadPrec [DeleteReplicationTask]
-> Read DeleteReplicationTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReplicationTask]
$creadListPrec :: ReadPrec [DeleteReplicationTask]
readPrec :: ReadPrec DeleteReplicationTask
$creadPrec :: ReadPrec DeleteReplicationTask
readList :: ReadS [DeleteReplicationTask]
$creadList :: ReadS [DeleteReplicationTask]
readsPrec :: Int -> ReadS DeleteReplicationTask
$creadsPrec :: Int -> ReadS DeleteReplicationTask
Prelude.Read, Int -> DeleteReplicationTask -> ShowS
[DeleteReplicationTask] -> ShowS
DeleteReplicationTask -> String
(Int -> DeleteReplicationTask -> ShowS)
-> (DeleteReplicationTask -> String)
-> ([DeleteReplicationTask] -> ShowS)
-> Show DeleteReplicationTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReplicationTask] -> ShowS
$cshowList :: [DeleteReplicationTask] -> ShowS
show :: DeleteReplicationTask -> String
$cshow :: DeleteReplicationTask -> String
showsPrec :: Int -> DeleteReplicationTask -> ShowS
$cshowsPrec :: Int -> DeleteReplicationTask -> ShowS
Prelude.Show, (forall x. DeleteReplicationTask -> Rep DeleteReplicationTask x)
-> (forall x. Rep DeleteReplicationTask x -> DeleteReplicationTask)
-> Generic DeleteReplicationTask
forall x. Rep DeleteReplicationTask x -> DeleteReplicationTask
forall x. DeleteReplicationTask -> Rep DeleteReplicationTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteReplicationTask x -> DeleteReplicationTask
$cfrom :: forall x. DeleteReplicationTask -> Rep DeleteReplicationTask x
Prelude.Generic)
newDeleteReplicationTask ::
Prelude.Text ->
DeleteReplicationTask
newDeleteReplicationTask :: Text -> DeleteReplicationTask
newDeleteReplicationTask Text
pReplicationTaskArn_ =
DeleteReplicationTask' :: Text -> DeleteReplicationTask
DeleteReplicationTask'
{ $sel:replicationTaskArn:DeleteReplicationTask' :: Text
replicationTaskArn =
Text
pReplicationTaskArn_
}
deleteReplicationTask_replicationTaskArn :: Lens.Lens' DeleteReplicationTask Prelude.Text
deleteReplicationTask_replicationTaskArn :: (Text -> f Text)
-> DeleteReplicationTask -> f DeleteReplicationTask
deleteReplicationTask_replicationTaskArn = (DeleteReplicationTask -> Text)
-> (DeleteReplicationTask -> Text -> DeleteReplicationTask)
-> Lens DeleteReplicationTask DeleteReplicationTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationTask' {Text
replicationTaskArn :: Text
$sel:replicationTaskArn:DeleteReplicationTask' :: DeleteReplicationTask -> Text
replicationTaskArn} -> Text
replicationTaskArn) (\s :: DeleteReplicationTask
s@DeleteReplicationTask' {} Text
a -> DeleteReplicationTask
s {$sel:replicationTaskArn:DeleteReplicationTask' :: Text
replicationTaskArn = Text
a} :: DeleteReplicationTask)
instance Core.AWSRequest DeleteReplicationTask where
type
AWSResponse DeleteReplicationTask =
DeleteReplicationTaskResponse
request :: DeleteReplicationTask -> Request DeleteReplicationTask
request = Service -> DeleteReplicationTask -> Request DeleteReplicationTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteReplicationTask
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteReplicationTask)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse DeleteReplicationTask))
-> Logger
-> Service
-> Proxy DeleteReplicationTask
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteReplicationTask)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe ReplicationTask -> Int -> DeleteReplicationTaskResponse
DeleteReplicationTaskResponse'
(Maybe ReplicationTask -> Int -> DeleteReplicationTaskResponse)
-> Either String (Maybe ReplicationTask)
-> Either String (Int -> DeleteReplicationTaskResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe ReplicationTask)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ReplicationTask")
Either String (Int -> DeleteReplicationTaskResponse)
-> Either String Int -> Either String DeleteReplicationTaskResponse
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 DeleteReplicationTask
instance Prelude.NFData DeleteReplicationTask
instance Core.ToHeaders DeleteReplicationTask where
toHeaders :: DeleteReplicationTask -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteReplicationTask -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AmazonDMSv20160101.DeleteReplicationTask" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON DeleteReplicationTask where
toJSON :: DeleteReplicationTask -> Value
toJSON DeleteReplicationTask' {Text
replicationTaskArn :: Text
$sel:replicationTaskArn:DeleteReplicationTask' :: DeleteReplicationTask -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ReplicationTaskArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
replicationTaskArn)
]
)
instance Core.ToPath DeleteReplicationTask where
toPath :: DeleteReplicationTask -> ByteString
toPath = ByteString -> DeleteReplicationTask -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteReplicationTask where
toQuery :: DeleteReplicationTask -> QueryString
toQuery = QueryString -> DeleteReplicationTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteReplicationTaskResponse = DeleteReplicationTaskResponse'
{
DeleteReplicationTaskResponse -> Maybe ReplicationTask
replicationTask :: Prelude.Maybe ReplicationTask,
DeleteReplicationTaskResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteReplicationTaskResponse
-> DeleteReplicationTaskResponse -> Bool
(DeleteReplicationTaskResponse
-> DeleteReplicationTaskResponse -> Bool)
-> (DeleteReplicationTaskResponse
-> DeleteReplicationTaskResponse -> Bool)
-> Eq DeleteReplicationTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteReplicationTaskResponse
-> DeleteReplicationTaskResponse -> Bool
$c/= :: DeleteReplicationTaskResponse
-> DeleteReplicationTaskResponse -> Bool
== :: DeleteReplicationTaskResponse
-> DeleteReplicationTaskResponse -> Bool
$c== :: DeleteReplicationTaskResponse
-> DeleteReplicationTaskResponse -> Bool
Prelude.Eq, ReadPrec [DeleteReplicationTaskResponse]
ReadPrec DeleteReplicationTaskResponse
Int -> ReadS DeleteReplicationTaskResponse
ReadS [DeleteReplicationTaskResponse]
(Int -> ReadS DeleteReplicationTaskResponse)
-> ReadS [DeleteReplicationTaskResponse]
-> ReadPrec DeleteReplicationTaskResponse
-> ReadPrec [DeleteReplicationTaskResponse]
-> Read DeleteReplicationTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteReplicationTaskResponse]
$creadListPrec :: ReadPrec [DeleteReplicationTaskResponse]
readPrec :: ReadPrec DeleteReplicationTaskResponse
$creadPrec :: ReadPrec DeleteReplicationTaskResponse
readList :: ReadS [DeleteReplicationTaskResponse]
$creadList :: ReadS [DeleteReplicationTaskResponse]
readsPrec :: Int -> ReadS DeleteReplicationTaskResponse
$creadsPrec :: Int -> ReadS DeleteReplicationTaskResponse
Prelude.Read, Int -> DeleteReplicationTaskResponse -> ShowS
[DeleteReplicationTaskResponse] -> ShowS
DeleteReplicationTaskResponse -> String
(Int -> DeleteReplicationTaskResponse -> ShowS)
-> (DeleteReplicationTaskResponse -> String)
-> ([DeleteReplicationTaskResponse] -> ShowS)
-> Show DeleteReplicationTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteReplicationTaskResponse] -> ShowS
$cshowList :: [DeleteReplicationTaskResponse] -> ShowS
show :: DeleteReplicationTaskResponse -> String
$cshow :: DeleteReplicationTaskResponse -> String
showsPrec :: Int -> DeleteReplicationTaskResponse -> ShowS
$cshowsPrec :: Int -> DeleteReplicationTaskResponse -> ShowS
Prelude.Show, (forall x.
DeleteReplicationTaskResponse
-> Rep DeleteReplicationTaskResponse x)
-> (forall x.
Rep DeleteReplicationTaskResponse x
-> DeleteReplicationTaskResponse)
-> Generic DeleteReplicationTaskResponse
forall x.
Rep DeleteReplicationTaskResponse x
-> DeleteReplicationTaskResponse
forall x.
DeleteReplicationTaskResponse
-> Rep DeleteReplicationTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteReplicationTaskResponse x
-> DeleteReplicationTaskResponse
$cfrom :: forall x.
DeleteReplicationTaskResponse
-> Rep DeleteReplicationTaskResponse x
Prelude.Generic)
newDeleteReplicationTaskResponse ::
Prelude.Int ->
DeleteReplicationTaskResponse
newDeleteReplicationTaskResponse :: Int -> DeleteReplicationTaskResponse
newDeleteReplicationTaskResponse Int
pHttpStatus_ =
DeleteReplicationTaskResponse' :: Maybe ReplicationTask -> Int -> DeleteReplicationTaskResponse
DeleteReplicationTaskResponse'
{ $sel:replicationTask:DeleteReplicationTaskResponse' :: Maybe ReplicationTask
replicationTask =
Maybe ReplicationTask
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteReplicationTaskResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteReplicationTaskResponse_replicationTask :: Lens.Lens' DeleteReplicationTaskResponse (Prelude.Maybe ReplicationTask)
deleteReplicationTaskResponse_replicationTask :: (Maybe ReplicationTask -> f (Maybe ReplicationTask))
-> DeleteReplicationTaskResponse -> f DeleteReplicationTaskResponse
deleteReplicationTaskResponse_replicationTask = (DeleteReplicationTaskResponse -> Maybe ReplicationTask)
-> (DeleteReplicationTaskResponse
-> Maybe ReplicationTask -> DeleteReplicationTaskResponse)
-> Lens
DeleteReplicationTaskResponse
DeleteReplicationTaskResponse
(Maybe ReplicationTask)
(Maybe ReplicationTask)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationTaskResponse' {Maybe ReplicationTask
replicationTask :: Maybe ReplicationTask
$sel:replicationTask:DeleteReplicationTaskResponse' :: DeleteReplicationTaskResponse -> Maybe ReplicationTask
replicationTask} -> Maybe ReplicationTask
replicationTask) (\s :: DeleteReplicationTaskResponse
s@DeleteReplicationTaskResponse' {} Maybe ReplicationTask
a -> DeleteReplicationTaskResponse
s {$sel:replicationTask:DeleteReplicationTaskResponse' :: Maybe ReplicationTask
replicationTask = Maybe ReplicationTask
a} :: DeleteReplicationTaskResponse)
deleteReplicationTaskResponse_httpStatus :: Lens.Lens' DeleteReplicationTaskResponse Prelude.Int
deleteReplicationTaskResponse_httpStatus :: (Int -> f Int)
-> DeleteReplicationTaskResponse -> f DeleteReplicationTaskResponse
deleteReplicationTaskResponse_httpStatus = (DeleteReplicationTaskResponse -> Int)
-> (DeleteReplicationTaskResponse
-> Int -> DeleteReplicationTaskResponse)
-> Lens
DeleteReplicationTaskResponse DeleteReplicationTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteReplicationTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteReplicationTaskResponse' :: DeleteReplicationTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteReplicationTaskResponse
s@DeleteReplicationTaskResponse' {} Int
a -> DeleteReplicationTaskResponse
s {$sel:httpStatus:DeleteReplicationTaskResponse' :: Int
httpStatus = Int
a} :: DeleteReplicationTaskResponse)
instance Prelude.NFData DeleteReplicationTaskResponse