{-# 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.DataSync.DeleteTask
(
DeleteTask (..),
newDeleteTask,
deleteTask_taskArn,
DeleteTaskResponse (..),
newDeleteTaskResponse,
deleteTaskResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.DataSync.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 DeleteTask = DeleteTask'
{
DeleteTask -> Text
taskArn :: Prelude.Text
}
deriving (DeleteTask -> DeleteTask -> Bool
(DeleteTask -> DeleteTask -> Bool)
-> (DeleteTask -> DeleteTask -> Bool) -> Eq DeleteTask
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTask -> DeleteTask -> Bool
$c/= :: DeleteTask -> DeleteTask -> Bool
== :: DeleteTask -> DeleteTask -> Bool
$c== :: DeleteTask -> DeleteTask -> Bool
Prelude.Eq, ReadPrec [DeleteTask]
ReadPrec DeleteTask
Int -> ReadS DeleteTask
ReadS [DeleteTask]
(Int -> ReadS DeleteTask)
-> ReadS [DeleteTask]
-> ReadPrec DeleteTask
-> ReadPrec [DeleteTask]
-> Read DeleteTask
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTask]
$creadListPrec :: ReadPrec [DeleteTask]
readPrec :: ReadPrec DeleteTask
$creadPrec :: ReadPrec DeleteTask
readList :: ReadS [DeleteTask]
$creadList :: ReadS [DeleteTask]
readsPrec :: Int -> ReadS DeleteTask
$creadsPrec :: Int -> ReadS DeleteTask
Prelude.Read, Int -> DeleteTask -> ShowS
[DeleteTask] -> ShowS
DeleteTask -> String
(Int -> DeleteTask -> ShowS)
-> (DeleteTask -> String)
-> ([DeleteTask] -> ShowS)
-> Show DeleteTask
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTask] -> ShowS
$cshowList :: [DeleteTask] -> ShowS
show :: DeleteTask -> String
$cshow :: DeleteTask -> String
showsPrec :: Int -> DeleteTask -> ShowS
$cshowsPrec :: Int -> DeleteTask -> ShowS
Prelude.Show, (forall x. DeleteTask -> Rep DeleteTask x)
-> (forall x. Rep DeleteTask x -> DeleteTask) -> Generic DeleteTask
forall x. Rep DeleteTask x -> DeleteTask
forall x. DeleteTask -> Rep DeleteTask x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTask x -> DeleteTask
$cfrom :: forall x. DeleteTask -> Rep DeleteTask x
Prelude.Generic)
newDeleteTask ::
Prelude.Text ->
DeleteTask
newDeleteTask :: Text -> DeleteTask
newDeleteTask Text
pTaskArn_ =
DeleteTask' :: Text -> DeleteTask
DeleteTask' {$sel:taskArn:DeleteTask' :: Text
taskArn = Text
pTaskArn_}
deleteTask_taskArn :: Lens.Lens' DeleteTask Prelude.Text
deleteTask_taskArn :: (Text -> f Text) -> DeleteTask -> f DeleteTask
deleteTask_taskArn = (DeleteTask -> Text)
-> (DeleteTask -> Text -> DeleteTask)
-> Lens DeleteTask DeleteTask Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTask' {Text
taskArn :: Text
$sel:taskArn:DeleteTask' :: DeleteTask -> Text
taskArn} -> Text
taskArn) (\s :: DeleteTask
s@DeleteTask' {} Text
a -> DeleteTask
s {$sel:taskArn:DeleteTask' :: Text
taskArn = Text
a} :: DeleteTask)
instance Core.AWSRequest DeleteTask where
type AWSResponse DeleteTask = DeleteTaskResponse
request :: DeleteTask -> Request DeleteTask
request = Service -> DeleteTask -> Request DeleteTask
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTask)))
response =
(Int
-> ResponseHeaders -> () -> Either String (AWSResponse DeleteTask))
-> Logger
-> Service
-> Proxy DeleteTask
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTask)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> DeleteTaskResponse
DeleteTaskResponse'
(Int -> DeleteTaskResponse)
-> Either String Int -> Either String DeleteTaskResponse
forall (f :: * -> *) a b. Functor 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 DeleteTask
instance Prelude.NFData DeleteTask
instance Core.ToHeaders DeleteTask where
toHeaders :: DeleteTask -> ResponseHeaders
toHeaders =
ResponseHeaders -> DeleteTask -> 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
"FmrsService.DeleteTask" :: 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 DeleteTask where
toJSON :: DeleteTask -> Value
toJSON DeleteTask' {Text
taskArn :: Text
$sel:taskArn:DeleteTask' :: DeleteTask -> 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
"TaskArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
taskArn)]
)
instance Core.ToPath DeleteTask where
toPath :: DeleteTask -> ByteString
toPath = ByteString -> DeleteTask -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery DeleteTask where
toQuery :: DeleteTask -> QueryString
toQuery = QueryString -> DeleteTask -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteTaskResponse = DeleteTaskResponse'
{
DeleteTaskResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteTaskResponse -> DeleteTaskResponse -> Bool
(DeleteTaskResponse -> DeleteTaskResponse -> Bool)
-> (DeleteTaskResponse -> DeleteTaskResponse -> Bool)
-> Eq DeleteTaskResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTaskResponse -> DeleteTaskResponse -> Bool
$c/= :: DeleteTaskResponse -> DeleteTaskResponse -> Bool
== :: DeleteTaskResponse -> DeleteTaskResponse -> Bool
$c== :: DeleteTaskResponse -> DeleteTaskResponse -> Bool
Prelude.Eq, ReadPrec [DeleteTaskResponse]
ReadPrec DeleteTaskResponse
Int -> ReadS DeleteTaskResponse
ReadS [DeleteTaskResponse]
(Int -> ReadS DeleteTaskResponse)
-> ReadS [DeleteTaskResponse]
-> ReadPrec DeleteTaskResponse
-> ReadPrec [DeleteTaskResponse]
-> Read DeleteTaskResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTaskResponse]
$creadListPrec :: ReadPrec [DeleteTaskResponse]
readPrec :: ReadPrec DeleteTaskResponse
$creadPrec :: ReadPrec DeleteTaskResponse
readList :: ReadS [DeleteTaskResponse]
$creadList :: ReadS [DeleteTaskResponse]
readsPrec :: Int -> ReadS DeleteTaskResponse
$creadsPrec :: Int -> ReadS DeleteTaskResponse
Prelude.Read, Int -> DeleteTaskResponse -> ShowS
[DeleteTaskResponse] -> ShowS
DeleteTaskResponse -> String
(Int -> DeleteTaskResponse -> ShowS)
-> (DeleteTaskResponse -> String)
-> ([DeleteTaskResponse] -> ShowS)
-> Show DeleteTaskResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTaskResponse] -> ShowS
$cshowList :: [DeleteTaskResponse] -> ShowS
show :: DeleteTaskResponse -> String
$cshow :: DeleteTaskResponse -> String
showsPrec :: Int -> DeleteTaskResponse -> ShowS
$cshowsPrec :: Int -> DeleteTaskResponse -> ShowS
Prelude.Show, (forall x. DeleteTaskResponse -> Rep DeleteTaskResponse x)
-> (forall x. Rep DeleteTaskResponse x -> DeleteTaskResponse)
-> Generic DeleteTaskResponse
forall x. Rep DeleteTaskResponse x -> DeleteTaskResponse
forall x. DeleteTaskResponse -> Rep DeleteTaskResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTaskResponse x -> DeleteTaskResponse
$cfrom :: forall x. DeleteTaskResponse -> Rep DeleteTaskResponse x
Prelude.Generic)
newDeleteTaskResponse ::
Prelude.Int ->
DeleteTaskResponse
newDeleteTaskResponse :: Int -> DeleteTaskResponse
newDeleteTaskResponse Int
pHttpStatus_ =
DeleteTaskResponse' :: Int -> DeleteTaskResponse
DeleteTaskResponse' {$sel:httpStatus:DeleteTaskResponse' :: Int
httpStatus = Int
pHttpStatus_}
deleteTaskResponse_httpStatus :: Lens.Lens' DeleteTaskResponse Prelude.Int
deleteTaskResponse_httpStatus :: (Int -> f Int) -> DeleteTaskResponse -> f DeleteTaskResponse
deleteTaskResponse_httpStatus = (DeleteTaskResponse -> Int)
-> (DeleteTaskResponse -> Int -> DeleteTaskResponse)
-> Lens DeleteTaskResponse DeleteTaskResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTaskResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteTaskResponse' :: DeleteTaskResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteTaskResponse
s@DeleteTaskResponse' {} Int
a -> DeleteTaskResponse
s {$sel:httpStatus:DeleteTaskResponse' :: Int
httpStatus = Int
a} :: DeleteTaskResponse)
instance Prelude.NFData DeleteTaskResponse